@seqyuan/annovibe 0.8.64 → 0.8.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -5
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.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/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/runtime/route.js +1 -1
- package/.next/server/app/api/im/cancel/route.js +1 -1
- package/.next/server/app/api/im/gateway-status/route.js +3 -1
- package/.next/server/app/api/im/gateway-token/route.js +3 -1
- package/.next/server/app/api/im/project/route.js +3 -1
- package/.next/server/app/api/im/projects/route.js +3 -1
- package/.next/server/app/api/im/session-ids/route.js +1 -1
- package/.next/server/app/api/im/turn/route.js +4 -2
- package/.next/server/app/api/internal/runtime/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 +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +6 -4
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke.html +2 -2
- package/.next/server/app/smoke.rsc +2 -2
- package/.next/server/app/smoke.segments/_full.segment.rsc +2 -2
- package/.next/server/app/smoke.segments/_head.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_index.segment.rsc +2 -2
- package/.next/server/app/smoke.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/smoke.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +5 -5
- package/.next/server/chunks/1761.js +1 -0
- package/.next/server/middleware-build-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/app/{page-aef305684799ea4f.js → page-85499519228afae8.js} +6 -4
- package/.next/static/css/{56d2e8f8c1614464.css → d6038901c29122c8.css} +1 -1
- package/bin/annovibe-im-gateway.js +80 -23
- package/package.json +1 -1
- /package/.next/static/{fVfJvHfzbio-X0Dgmqh9N → kSOfQw2tkIvT6TUDYFA26}/_buildManifest.js +0 -0
- /package/.next/static/{fVfJvHfzbio-X0Dgmqh9N → kSOfQw2tkIvT6TUDYFA26}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[90484,[],"OutletBoundary"]
|
|
3
3
|
3:"$Sreact.suspense"
|
|
4
|
-
0:{"rsc":["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"
|
|
4
|
+
0:{"rsc":["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"kSOfQw2tkIvT6TUDYFA26"}
|
|
5
5
|
4:null
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
2:I[57121,[],""]
|
|
3
3
|
3:I[74581,[],""]
|
|
4
4
|
4:[]
|
|
5
|
-
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"
|
|
5
|
+
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"kSOfQw2tkIvT6TUDYFA26"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:HL["/_next/static/media/7deddc85b7ffd1dc-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
2
2
|
:HL["/_next/static/media/ec14413c594b3356-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
3
3
|
:HL["/_next/static/css/88714c00e109ce28.css","style"]
|
|
4
|
-
:HL["/_next/static/css/
|
|
5
|
-
0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"
|
|
4
|
+
:HL["/_next/static/css/d6038901c29122c8.css","style"]
|
|
5
|
+
0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"kSOfQw2tkIvT6TUDYFA26"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=2752,a.ids=[2752],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28327:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(96640),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b=new URL(a.url).searchParams.get("cwd");return e.NextResponse.json({runningVersion:"0.8.
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2752,a.ids=[2752],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28327:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(96640),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){let b=new URL(a.url).searchParams.get("cwd");return e.NextResponse.json({runningVersion:"0.8.66",pid:process.pid,uptimeSeconds:Math.round(process.uptime()),...(0,f.Bj)(),memory:b?(0,g.Wb)(b):null})}d()}catch(a){d(a)}})},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68496:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(28327),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/runtime/route",pathname:"/api/agent/runtime",filename:"route",bundlePath:"app/api/agent/runtime/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/agent/runtime/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/runtime/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=68496));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=7253,a.ids=[7253],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6276:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>j,dynamic:()=>k});var e=c(23211),f=c(56429),g=c(31761),h=c(81896),i=a([f,g,h]);[f,g,h]=i.then?(await i)():i;let k="force-dynamic";async function j(a){if(!(0,h.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=((await a.json()).cwd??"").trim();if(!b)return e.NextResponse.json({error:"Missing cwd"},{status:400});let c=(0,g.Mj)(b);if(!c?.sessionId)return e.NextResponse.json({ok:!1,cancelled:!1,reply:"No active session"});let d=(0,f.A4)(c.sessionId);if(!d?.isAlive()||!d.isBusy())return e.NextResponse.json({ok:!1,cancelled:!1,reply:"No running turn to cancel"});try{return await d.send({type:"abort"}),e.NextResponse.json({ok:!0,cancelled:!0,reply:"已取消当前任务。"})}catch(a){return e.NextResponse.json({ok:!1,cancelled:!1,reply:a instanceof Error?a.message:String(a)})}}d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},24586:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(6276),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/cancel/route",pathname:"/api/im/cancel",filename:"route",bundlePath:"app/api/im/cancel/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/cancel/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/cancel/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},31761:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},81896:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>g});var e=c(31761),f=a([e]);function g(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=24586));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=7253,a.ids=[7253],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6276:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m});var e=c(23211),f=c(29021),g=c(56429),h=c(31761),i=c(81896),j=c(40402),k=a([g,h,i,j]);[g,h,i,j]=k.then?(await k)():k;let m="force-dynamic";async function l(a){if(!(0,i.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=await a.json(),c=(b.cwd??"").trim(),d=(b.userId??"").trim();if(!c||!d)return e.NextResponse.json({error:"Missing cwd or userId"},{status:400});if(!(0,f.existsSync)(c))return e.NextResponse.json({error:`Directory does not exist: ${c}`},{status:400});let k=(0,h.Mj)(c);if(!k?.sessionId)return e.NextResponse.json({ok:!1,cancelled:!1,reply:"No active session"});let l=(0,g.A4)(k.sessionId);if(!l?.isAlive()){let a=await (0,j.os)(k.sessionId);a&&(l=(await (0,g.OF)(k.sessionId,a,c,void 0,"im")).session)}if(!l?.isAlive()||!l.isBusy())return e.NextResponse.json({ok:!1,cancelled:!1,reply:"当前没有可取消的任务。",sessionId:k.sessionId});try{return await l.send({type:"abort"}),e.NextResponse.json({ok:!0,cancelled:!0,reply:"已取消当前任务。",sessionId:l.sessionId})}catch(a){return e.NextResponse.json({ok:!1,cancelled:!1,reply:a instanceof Error?a.message:String(a)})}}d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},24586:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(6276),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/cancel/route",pathname:"/api/im/cancel",filename:"route",bundlePath:"app/api/im/cancel/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/cancel/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/cancel/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},81896:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>h,N:()=>g});var e=c(31761),f=a([e]);function g(a){try{let b=new URL(a.url).hostname.toLowerCase();if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0}catch{}let b=(a.headers.get("host")??"").split(":")[0]?.toLowerCase()??"";if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0;let c=a.headers.get("x-forwarded-for");if(!c)return!1;let d=c.split(",")[0]?.trim();return"127.0.0.1"===d||"::1"===d}function h(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601,1761],()=>b(b.s=24586));module.exports=c})();
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6710,a.ids=[6710],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},31761:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},56773:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(31761),g=c(84552),h=a([f]);f=(h.then?(await h)():h)[0];let j="force-dynamic";async function i(){let a=(0,f.SR)(),b=(0,g.IZ)(a);return e.NextResponse.json({gateway:b})}d()}catch(a){d(a)}})},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")},78335:()=>{},84552:(a,b,c)=>{"use strict";function d(a){let b="string"==typeof a?.startedAt&&a.startedAt.trim()?a.startedAt.trim():null,c="number"==typeof a?.pid&&Number.isFinite(a.pid)?a.pid:null;return!function(a){if(!a||a<=0)return!1;try{return process.kill(a,0),!0}catch{return!1}}(c)?b||c?{tone:"stale",label:"Gateway stopped",startedAt:b,pid:c,alive:!1}:{tone:"stopped",label:"Gateway not started",startedAt:null,pid:null,alive:!1}:{tone:"running",label:"Gateway running",startedAt:b,pid:c,alive:!0}}c.d(b,{IZ:()=>d})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},98944:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(56773),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/gateway-status/route",pathname:"/api/im/gateway-status",filename:"route",bundlePath:"app/api/im/gateway-status/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/gateway-status/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/gateway-status/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=98944));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=6710,a.ids=[6710],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},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")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
|
+
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},56773:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(31761),g=c(84552),h=a([f]);f=(h.then?(await h)():h)[0];let j="force-dynamic";async function i(){let a=(0,f.SR)(),b=(0,g.IZ)(a);return e.NextResponse.json({gateway:b})}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},84552:(a,b,c)=>{"use strict";function d(a){let b="string"==typeof a?.startedAt&&a.startedAt.trim()?a.startedAt.trim():null,c="number"==typeof a?.pid&&Number.isFinite(a.pid)?a.pid:null;return!function(a){if(!a||a<=0)return!1;try{return process.kill(a,0),!0}catch{return!1}}(c)?b||c?{tone:"stale",label:"Gateway stopped",startedAt:b,pid:c,alive:!1}:{tone:"stopped",label:"Gateway not started",startedAt:null,pid:null,alive:!1}:{tone:"running",label:"Gateway running",startedAt:b,pid:c,alive:!0}}c.d(b,{IZ:()=>d})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},98944:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(56773),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/gateway-status/route",pathname:"/api/im/gateway-status",filename:"route",bundlePath:"app/api/im/gateway-status/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/gateway-status/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/gateway-status/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1761],()=>b(b.s=98944));module.exports=c})();
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9815,a.ids=[9815],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},31202:(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(31761),g=a([f]);f=(g.then?(await g)():g)[0];let i="force-dynamic";async function h(){let a=(0,f.SR)();return e.NextResponse.json({token:a?.token??""})}d()}catch(a){d(a)}})},31761:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66178:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(31202),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/gateway-token/route",pathname:"/api/im/gateway-token",filename:"route",bundlePath:"app/api/im/gateway-token/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/gateway-token/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/gateway-token/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},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,[4741,1813],()=>b(b.s=66178));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9815,a.ids=[9815],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},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")},31202:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(31761),g=c(81896),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){if(!(0,g.N)(a))return e.NextResponse.json({error:"Gateway token sync is localhost-only"},{status:403});let b=(0,f.SR)();return e.NextResponse.json({token:b?.token??""})}d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
|
+
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66178:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(31202),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/gateway-token/route",pathname:"/api/im/gateway-token",filename:"route",bundlePath:"app/api/im/gateway-token/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/gateway-token/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/gateway-token/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},81896:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{D:()=>h,N:()=>g});var e=c(31761),f=a([e]);function g(a){try{let b=new URL(a.url).hostname.toLowerCase();if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0}catch{}let b=(a.headers.get("host")??"").split(":")[0]?.toLowerCase()??"";if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0;let c=a.headers.get("x-forwarded-for");if(!c)return!1;let d=c.split(",")[0]?.trim();return"127.0.0.1"===d||"::1"===d}function h(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},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,[4741,1813,1761],()=>b(b.s=66178));module.exports=c})();
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=7778,a.ids=[7778],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},28701:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,PATCH:()=>i,dynamic:()=>k});var e=c(23211),f=c(31761),g=a([f]);f=(g.then?(await g)():g)[0];let k="force-dynamic";async function h(a){let b=a.nextUrl.searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"Missing cwd"},{status:400});let c=(0,f.wY)(decodeURIComponent(b)),d=(0,f.Cv)();return c?e.NextResponse.json({...c,botSecret:void 0,hasSecret:!!c.botSecret,gatewayToken:d}):e.NextResponse.json({enabled:!1,channel:"wecom",botId:"",requireMentionInGroup:!1,allowedUsers:[],pairingCode:"",gatewayToken:d})}async function i(a){let b=await a.json(),c=b.cwd?.trim();if(!c)return e.NextResponse.json({error:"Missing cwd"},{status:400});let d=(0,f.wY)(c)??{enabled:!1,channel:"wecom",botId:"",requireMentionInGroup:!1,allowedUsers:[],pairingCode:""},g={...b.config};g.regeneratePairingCode&&(delete g.regeneratePairingCode,g.pairingCode=Math.floor(1e6*Math.random()).toString().padStart(6,"0"));let h={...d,...g};(0,f.$7)(c,h);let i=(0,f.Mj)(c),j=(0,f.Cv)();return e.NextResponse.json({...h,botSecret:void 0,hasSecret:!!h.botSecret,sessionId:i?.sessionId??null,gatewayToken:j})}async function j(a){let b=await a.json(),c=b.cwd?.trim();return c?((0,f.ht)(c),e.NextResponse.json({ok:!0})):e.NextResponse.json({error:"Missing cwd"},{status:400})}d()}catch(a){d(a)}})},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")},31761:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},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")},78335:()=>{},83668:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(28701),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/project/route",pathname:"/api/im/project",filename:"route",bundlePath:"app/api/im/project/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/project/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/project/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},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,[4741,1813],()=>b(b.s=83668));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=7778,a.ids=[7778],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},28701:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,PATCH:()=>i,dynamic:()=>k});var e=c(23211),f=c(31761),g=a([f]);f=(g.then?(await g)():g)[0];let k="force-dynamic";async function h(a){let b=a.nextUrl.searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"Missing cwd"},{status:400});let c=(0,f.wY)(decodeURIComponent(b)),d=(0,f.Cv)();return c?e.NextResponse.json({...c,botSecret:void 0,hasSecret:!!c.botSecret,gatewayToken:d}):e.NextResponse.json({enabled:!1,channel:"wecom",botId:"",requireMentionInGroup:!1,allowedUsers:[],pairingCode:"",gatewayToken:d})}async function i(a){let b=await a.json(),c=b.cwd?.trim();if(!c)return e.NextResponse.json({error:"Missing cwd"},{status:400});let d=(0,f.wY)(c)??{enabled:!1,channel:"wecom",botId:"",requireMentionInGroup:!1,allowedUsers:[],pairingCode:""},g={...b.config};g.regeneratePairingCode&&(delete g.regeneratePairingCode,g.pairingCode=Math.floor(1e6*Math.random()).toString().padStart(6,"0"));let h={...d,...g};(0,f.$7)(c,h);let i=(0,f.Mj)(c),j=(0,f.Cv)();return e.NextResponse.json({...h,botSecret:void 0,hasSecret:!!h.botSecret,sessionId:i?.sessionId??null,gatewayToken:j})}async function j(a){let b=await a.json(),c=b.cwd?.trim();return c?((0,f.ht)(c),e.NextResponse.json({ok:!0})):e.NextResponse.json({error:"Missing cwd"},{status:400})}d()}catch(a){d(a)}})},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")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
|
+
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},83668:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(28701),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/project/route",pathname:"/api/im/project",filename:"route",bundlePath:"app/api/im/project/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/project/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/project/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},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,[4741,1813,1761],()=>b(b.s=83668));module.exports=c})();
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3785,a.ids=[3785],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},31761:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},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")},78335:()=>{},79520:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(31761),g=c(81896),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){if(!(0,g.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=(0,f.Rz)();return e.NextResponse.json({projects:b})}d()}catch(a){d(a)}})},81896:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{D:()=>g});var e=c(31761),f=a([e]);function g(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89034:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(79520),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/projects/route",pathname:"/api/im/projects",filename:"route",bundlePath:"app/api/im/projects/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/projects/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/projects/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=89034));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=3785,a.ids=[3785],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},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")},33873:a=>{"use strict";a.exports=require("path")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>m,DK:()=>n,O8:()=>l,Uv:()=>o,dQ:()=>i,os:()=>k});var e=c(75430),f=c(12039),g=c(74788),h=a([e,g]);async function i(){let a=await e.SessionManager.listAll(),b=new Map,c=(0,g.tS)();for(let c of a)b.set(c.path,c.id);let d=j();return a.map(a=>{d.set(a.id,a.path);let e=c[a.id]??null;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0,sessionKind:e?.sessionKind,createdBy:e?.createdBy,sessionMeta:e}})}function j(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function k(a){let b=j().get(a);return b||(await i(),j().get(a)??null)}function l(a,b){j().set(a,b)}function m(a){j().delete(a)}function n(a){return e.SessionManager.open(a).getEntries()}function o(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
|
+
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74788:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{LN:()=>o,Of:()=>p,U5:()=>m,oR:()=>n,tS:()=>l});var e=c(29021),f=c(55511),g=c(33873),h=c(75430),i=a([h]);h=(i.then?(await i)():i)[0];let q=(0,g.join)((0,h.getAgentDir)(),"annovibe-session-meta.json"),r=Promise.resolve();function j(a){let b;b=(0,g.dirname)(q),(0,e.existsSync)(b)||(0,e.mkdirSync)(b,{recursive:!0});let c=`${q}.${(0,f.randomUUID)().slice(0,8)}.tmp`;(0,e.writeFileSync)(c,JSON.stringify(a,null,2)),(0,e.renameSync)(c,q)}async function k(a){let b,c=r;r=new Promise(a=>{b=a}),await c;try{return await a()}finally{b()}}function l(){if(!(0,e.existsSync)(q))return{};try{let a=JSON.parse((0,e.readFileSync)(q,"utf-8")),b={};for(let[c,d]of Object.entries(a)){let a=function(a){let b;if(!a||"object"!=typeof a)return null;let c="workbench"===a.sessionKind||"chat"===a.sessionKind?a.sessionKind:null;if(!c)return null;let d="launcher"===a.createdBy||"fork"===a.createdBy||"manual"===a.createdBy?a.createdBy:"manual",e=Array.isArray(a.lastToolNames)?a.lastToolNames.filter(a=>"string"==typeof a):[],f="string"==typeof a.createdAt?a.createdAt:new Date().toISOString(),g="string"==typeof a.initialSourcePath&&a.initialSourcePath?a.initialSourcePath:void 0,h="r"===a.initialKernel||"python"===a.initialKernel?a.initialKernel:void 0,i="string"==typeof a.initialKernelId&&a.initialKernelId?a.initialKernelId:void 0,j="string"==typeof a.initialKernelDisplayName&&a.initialKernelDisplayName?a.initialKernelDisplayName:void 0;if(a.goal&&"object"==typeof a.goal){let c=a.goal;"string"==typeof c.id&&"string"==typeof c.objective&&"string"==typeof c.status&&(b={id:c.id,objective:c.objective,status:c.status,tokenBudget:"number"==typeof c.tokenBudget?c.tokenBudget:void 0,tokensUsed:"number"==typeof c.tokensUsed?c.tokensUsed:0,timeUsedSeconds:"number"==typeof c.timeUsedSeconds?c.timeUsedSeconds:0,createdAt:"number"==typeof c.createdAt?c.createdAt:Date.now(),updatedAt:"number"==typeof c.updatedAt?c.updatedAt:Date.now()})}return{sessionKind:c,lastToolNames:e,createdBy:d,createdAt:f,initialSourcePath:g,initialKernel:h,initialKernelId:i,initialKernelDisplayName:j,goal:b}}(d);a&&(b[c]=a)}return b}catch{return{}}}function m(a){return l()[a]??null}async function n(a,b){await k(()=>{let c=l();c[a]=b,j(c)})}async function o(a,b){await k(()=>{let c=l(),d=c[a];d&&(c[a]={...d,...b},j(c))})}async function p(a){await k(()=>{let b=l();a in b&&(delete b[a],j(b))})}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},79520:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,dynamic:()=>j});var e=c(23211),f=c(31761),g=c(81896),h=a([f,g]);[f,g]=h.then?(await h)():h;let j="force-dynamic";async function i(a){if(!(0,g.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});let b=await (0,f.Rz)();return e.NextResponse.json({projects:b})}d()}catch(a){d(a)}})},81896:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{D:()=>h,N:()=>g});var e=c(31761),f=a([e]);function g(a){try{let b=new URL(a.url).hostname.toLowerCase();if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0}catch{}let b=(a.headers.get("host")??"").split(":")[0]?.toLowerCase()??"";if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0;let c=a.headers.get("x-forwarded-for");if(!c)return!1;let d=c.split(",")[0]?.trim();return"127.0.0.1"===d||"::1"===d}function h(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89034:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(79520),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/projects/route",pathname:"/api/im/projects",filename:"route",bundlePath:"app/api/im/projects/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/projects/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/projects/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,1761],()=>b(b.s=89034));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=6780,a.ids=[6780],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},31761:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},95767:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{T:()=>h,l:()=>i});var e=c(56429),f=c(31761),g=a([e,f]);async function h(a){let b=(0,f.Mj)(a),c=b?.sessionId?.trim()||null;if(c){let a=(0,e.A4)(c);a?.isAlive()&&a.destroy()}return{cleared:(0,f.Dg)(a),previousSessionId:c}}async function i(a){let b=(0,f.Mj)(a);if(b?.sessionId){let a=(0,e.A4)(b.sessionId);if(a?.isAlive())return{sessionId:b.sessionId}}let c=(0,f.wY)(a);c?.enabled;let{realSessionId:d}=await (0,e.OF)(`__im__${Date.now()}`,"",a,void 0,"im");return(0,f.PB)(a,d),{sessionId:d}}[e,f]=g.then?(await g)():g,d()}catch(a){d(a)}})},98188:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(99591),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/session-ids/route",pathname:"/api/im/session-ids",filename:"route",bundlePath:"app/api/im/session-ids/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/session-ids/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/session-ids/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},99591:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>j,GET:()=>i,dynamic:()=>k});var e=c(23211),f=c(31761),g=c(95767),h=a([f,g]);[f,g]=h.then?(await h)():h;let k="force-dynamic";async function i(){let a=(0,f.Rz)().map(a=>{let b=(0,f.Mj)(a.cwd);return{cwd:a.cwd,projectKey:a.projectKey,sessionId:b?.sessionId??null}});return e.NextResponse.json({sessions:a})}async function j(a){let b=a.nextUrl.searchParams.get("cwd")?.trim();if(!b)return e.NextResponse.json({error:"Missing cwd"},{status:400});let c=await (0,g.T)(b);return e.NextResponse.json({ok:!0,cleared:c.cleared,previousSessionId:c.previousSessionId})}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=98188));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=6780,a.ids=[6780],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},95767:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{TR:()=>i,bw:()=>j,lt:()=>k});var e=c(56429),f=c(40402),g=c(31761),h=a([e,f,g]);async function i(a){let b=(0,g.Mj)(a),c=b?.sessionId?.trim()||null;if(c){let a=(0,e.A4)(c);a?.isAlive()&&a.destroy()}return{cleared:(0,g.Dg)(a),previousSessionId:c}}async function j(a,b){let c,d,e,f=(c=(0,g.wY)(a),d=c?.modelProvider?.trim(),e=c?.modelId?.trim(),d&&e?{provider:d,modelId:e}:null);f&&await b.send({type:"set_model",provider:f.provider,modelId:f.modelId})}async function k(a){let b=(0,g.Mj)(a);if(b?.sessionId){let c=(0,e.A4)(b.sessionId);if(c?.isAlive())return{sessionId:c.sessionId};let d=await (0,f.os)(b.sessionId);if(d){let{session:c,realSessionId:f}=await (0,e.OF)(b.sessionId,d,a,void 0,"im");return c.isBusy()||await j(a,c).catch(()=>void 0),(0,g.PB)(a,f),{sessionId:f}}}let{session:c,realSessionId:d}=await (0,e.OF)(`__im__${Date.now()}`,"",a,void 0,"im");return await j(a,c).catch(()=>void 0),(0,g.PB)(a,d),{sessionId:d}}[e,f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},98188:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(99591),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/session-ids/route",pathname:"/api/im/session-ids",filename:"route",bundlePath:"app/api/im/session-ids/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/session-ids/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/session-ids/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},99591:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>j,GET:()=>i,dynamic:()=>k});var e=c(23211),f=c(31761),g=c(95767),h=a([f,g]);[f,g]=h.then?(await h)():h;let k="force-dynamic";async function i(){let a=(await (0,f.Rz)()).map(a=>{let b=(0,f.Mj)(a.cwd);return{cwd:a.cwd,projectKey:a.projectKey,sessionId:b?.sessionId??null}});return e.NextResponse.json({sessions:a})}async function j(a){let b=a.nextUrl.searchParams.get("cwd")?.trim();if(!b)return e.NextResponse.json({error:"Missing cwd"},{status:400});let c=await (0,g.TR)(b);return e.NextResponse.json({ok:!0,cleared:c.cleared,previousSessionId:c.previousSessionId})}d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601,1761],()=>b(b.s=98188));module.exports=c})();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=186,a.ids=[186],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21704:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(80129),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/turn/route",pathname:"/api/im/turn",filename:"route",bundlePath:"app/api/im/turn/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/turn/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/turn/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},31761:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$7:()=>p,Cv:()=>v,Dg:()=>t,Mj:()=>r,PB:()=>s,Rz:()=>w,SR:()=>u,ht:()=>q,oc:()=>x,rX:()=>y,wY:()=>o,y5:()=>z});var e=c(29021),f=c(33873),g=c(55511),h=c(75430),i=a([h]);function j(){let a=(0,f.join)((0,h.getAgentDir)(),"im");return(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448}),a}function k(a){return(0,g.createHash)("sha256").update(a).digest("hex").slice(0,16)}function l(a){return(0,f.join)(j(),`${k(a)}.json`)}function m(a){return(0,f.join)(j(),`${k(a)}-session.json`)}function n(){return(0,f.join)(j(),"gateway.json")}function o(a){let b=l(a);try{let a=JSON.parse((0,e.readFileSync)(b,"utf-8"));return{enabled:!0===a.enabled,channel:(a.channel,"wecom"),botId:"string"==typeof a.botId?a.botId.trim():"",botSecret:"string"==typeof a.botSecret?a.botSecret.trim():void 0,requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,updatedAt:a.updatedAt??new Date().toISOString()}}catch{return null}}function p(a,b){let c=l(a);b.pairingCode||(b.pairingCode=function(){let a="0123456789",b="";for(let c=0;c<6;c++)b+=a[Math.floor(Math.random()*a.length)];return b}()),b.updatedAt=new Date().toISOString(),(0,e.writeFileSync)(c,JSON.stringify(b,null,2))}function q(a){let b=l(a);try{(0,e.unlinkSync)(b)}catch{}}function r(a){let b=m(a);try{return JSON.parse((0,e.readFileSync)(b,"utf-8"))}catch{return null}}function s(a,b){(0,e.writeFileSync)(m(a),JSON.stringify({sessionId:b,updatedAt:new Date().toISOString()},null,2))}function t(a){let b=m(a);try{return(0,e.unlinkSync)(b),!0}catch{return!1}}function u(){try{return JSON.parse((0,e.readFileSync)(n(),"utf-8"))}catch{return null}}function v(){var a;let b=u();if(b?.token?.trim())return b.token.trim();let c=(0,g.createHash)("sha256").update(Date.now().toString()+Math.random().toString()).digest("hex").slice(0,32);return a={...b??{},token:c,startedAt:b?.startedAt,pid:b?.pid},(0,e.writeFileSync)(n(),JSON.stringify(a,null,2)),c}function w(){let a=j(),b=[];try{for(let c of(0,e.readdirSync)(a)){if(!c.endsWith(".json")||c.endsWith("-session.json")||"gateway.json"===c)continue;let d=(0,f.join)(a,c);try{let a=JSON.parse((0,e.readFileSync)(d,"utf-8"));if(!0!==a.enabled)continue;let f=a.cwd??"",g="string"==typeof a.botSecret&&a.botSecret.trim().length>0,h=r(f);b.push({enabled:!0,channel:"wecom",botId:"string"==typeof a.botId?a.botId.trim():"",requireMentionInGroup:!0===a.requireMentionInGroup,allowedUsers:Array.isArray(a.allowedUsers)?a.allowedUsers:[],pairingCode:"string"==typeof a.pairingCode?a.pairingCode:"",boundChatId:a.boundChatId??null,modelProvider:a.modelProvider??null,modelId:a.modelId??null,cwd:f,projectKey:c.replace(/\.json$/,""),hasSecret:g,sessionId:h?.sessionId??null,updatedAt:a.updatedAt??new Date().toISOString()})}catch{}}}catch{}return b}function x(a,b){return 0===a.allowedUsers.length||a.allowedUsers.includes(b)}function y(a,b,c,d){if(a.pairingCode&&d.trim()===a.pairingCode){let d={...a,allowedUsers:[...a.allowedUsers,c]};return p(b,d),{config:d,paired:!0,reply:"已授权。你现在可以与此 bot 交互了。"}}return{config:a,paired:!1,reply:""}}function z(a,b){return a.pairingCode?`${b} 的 bot 需要授权。 发送配对码 ${a.pairingCode} 即可。`:`${b} 的 bot 尚未配置。`}h=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},56468:(a,b,c)=>{c.d(b,{D:()=>e});class d{push(a){if(this.closed)return;let b=this.waiters.shift();b?b(a):this.buffered.push(a)}async shift(){if(this.buffered.length>0)return this.buffered.shift();if(this.closed)throw Error("queue closed");return new Promise(a=>{this.waiters.push(a)})}close(){this.closed=!0}constructor(){this.buffered=[],this.waiters=[],this.closed=!1}}async function*e(a,b){let c,e,f="",g=0,h="waiting_model",i=!1,j=new d,k=a=>{i||(i=!0,c&&clearTimeout(c),e?.(),j.push(a),j.close())};e=a.onEvent(b=>{if(!i)switch(b.type){case"agent_start":h="waiting_model",j.push({type:"status",phase:"waiting_model"});break;case"message_update":{let a=b.message;if(a?.role!=="assistant")break;let c=a.content;if(!Array.isArray(c))break;let d=c.filter(a=>a?.type==="text"&&"string"==typeof a.text).map(a=>a.text);if(0===d.length)break;f=d.join("\n\n"),"running_tools"!==h&&(h="streaming"),j.push({type:"delta",text:f});break}case"tool_execution_start":g+=1,h="running_tools",j.push({type:"status",phase:"running_tools"});break;case"tool_execution_end":0===(g=Math.max(0,g-1))&&(h=f?"streaming":"waiting_model",j.push({type:"status",phase:h}));break;case"agent_end":{let c=b.error;c?k({type:"done",ok:!1,reply:c,sessionId:a.sessionId}):f.trim()?k({type:"done",ok:!0,reply:f.trim(),sessionId:a.sessionId}):k({type:"done",ok:!1,reply:"Agent finished without a text reply.",sessionId:a.sessionId})}}}),c=setTimeout(()=>{k({type:"done",ok:!1,reply:"IM turn timed out.",sessionId:a.sessionId})},6e5),yield{type:"status",phase:"waiting_model"};try{await a.send({type:"prompt",message:b})}catch(b){k({type:"done",ok:!1,reply:b instanceof Error?b.message:String(b),sessionId:a.sessionId})}for(;;){let a;try{a=await j.shift()}catch{break}if(yield a,"done"===a.type)break}}},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},80129:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>l,dynamic:()=>m,maxDuration:()=>n});var e=c(23211),f=c(56429),g=c(31761),h=c(95767),i=c(56468),j=c(81896),k=a([f,g,h,j]);[f,g,h,j]=k.then?(await k)():k;let m="force-dynamic",n=600;async function l(a){let b;if(!(0,j.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});try{b=await a.json()}catch{return e.NextResponse.json({error:"Invalid JSON"},{status:400})}let c=(b.cwd??"").trim(),d=(b.userId??"").trim(),k=(b.message??"").trim();if(!c||!d||!k)return e.NextResponse.json({error:"Missing cwd, userId, or message"},{status:400});let l=(0,g.wY)(c);if(!l?.enabled)return e.NextResponse.json({error:"IM not enabled for this project"},{status:400});let m=(0,g.rX)(l,c,d,k);if(m.paired)return e.NextResponse.json({ok:!0,reply:m.reply,paired:!0});if(!(0,g.oc)(m.config,d))return e.NextResponse.json({ok:!0,reply:(0,g.y5)(m.config,c)});let{sessionId:n}=await (0,h.l)(c),o=(0,f.A4)(n);if(!o?.isAlive())return e.NextResponse.json({error:"Failed to start session"},{status:500});if(o.isBusy())return e.NextResponse.json({error:"Project bot is busy"},{status:409});let p=new TextEncoder,q=!1,r=new ReadableStream({async start(a){let b=b=>{if(!q)try{a.enqueue(p.encode(`data: ${JSON.stringify(b)}
|
|
1
|
+
"use strict";(()=>{var a={};a.id=186,a.ids=[186],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21704:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(80129),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/im/turn/route",pathname:"/api/im/turn",filename:"route",bundlePath:"app/api/im/turn/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/annovibe/annovibe/app/api/im/turn/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/im/turn/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},56468:(a,b,c)=>{c.d(b,{D:()=>e});class d{push(a){if(this.closed)return;let b=this.waiters.shift();b?b(a):this.buffered.push(a)}async shift(){if(this.buffered.length>0)return this.buffered.shift();if(this.closed)throw Error("queue closed");return new Promise(a=>{this.waiters.push(a)})}close(){this.closed=!0}constructor(){this.buffered=[],this.waiters=[],this.closed=!1}}async function*e(a,b){let c,e,f="",g=0,h="waiting_model",i=!1,j=new d,k=a=>{i||(i=!0,c&&clearTimeout(c),e?.(),j.push(a),j.close())};e=a.onEvent(b=>{if(!i)switch(b.type){case"agent_start":h="waiting_model",j.push({type:"status",phase:"waiting_model"});break;case"message_update":{let a=b.message;if(a?.role!=="assistant")break;let c=a.content;if(!Array.isArray(c))break;let d=c.filter(a=>a?.type==="text"&&"string"==typeof a.text).map(a=>a.text);if(0===d.length)break;f=d.join("\n\n"),"running_tools"!==h&&(h="streaming"),j.push({type:"delta",text:f});break}case"tool_execution_start":g+=1,h="running_tools",j.push({type:"status",phase:"running_tools"});break;case"tool_execution_end":0===(g=Math.max(0,g-1))&&(h=f?"streaming":"waiting_model",j.push({type:"status",phase:h}));break;case"agent_end":{let c=b.error;c?k({type:"done",ok:!1,reply:c,sessionId:a.sessionId}):f.trim()?k({type:"done",ok:!0,reply:f.trim(),sessionId:a.sessionId}):k({type:"done",ok:!1,reply:"Agent finished without a text reply.",sessionId:a.sessionId})}}}),c=setTimeout(()=>{k({type:"done",ok:!1,reply:"IM turn timed out.",sessionId:a.sessionId})},6e5),yield{type:"status",phase:"waiting_model"};try{await a.send({type:"prompt",message:b})}catch(b){k({type:"done",ok:!1,reply:b instanceof Error?b.message:String(b),sessionId:a.sessionId})}for(;;){let a;try{a=await j.shift()}catch{break}if(yield a,"done"===a.type)break}}},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},80129:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>m,dynamic:()=>n,maxDuration:()=>o});var e=c(23211),f=c(56429),g=c(31761),h=c(95767),i=c(56468),j=c(81896),k=a([f,g,h,j]);[f,g,h,j]=k.then?(await k)():k;let n="force-dynamic",o=600;function l(a){let b=new TextEncoder;return new Response(new ReadableStream({start(c){c.enqueue(b.encode(`data: ${JSON.stringify(a)}
|
|
2
2
|
|
|
3
|
-
`))
|
|
3
|
+
`)),c.close()}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no"}})}async function m(a){let b;if(!(0,j.D)(a))return e.NextResponse.json({error:"Unauthorized"},{status:401});try{b=await a.json()}catch{return e.NextResponse.json({error:"Invalid JSON"},{status:400})}let c=(b.cwd??"").trim(),d=(b.userId??"").trim(),k=(b.message??"").trim();if(!c||!d||!k)return l({type:"done",ok:!1,reply:"Missing cwd, userId, or message"});let m=(0,g.wY)(c);if(!m?.enabled)return l({type:"done",ok:!1,reply:"IM not enabled for this project"});let n=(0,g.rX)(m,c,d,k);if(n.paired)return l({type:"done",ok:!0,reply:n.reply,paired:!0});if(!(0,g.oc)(n.config,d))return l({type:"done",ok:!0,reply:(0,g.y5)(n.config,c)});let{sessionId:o}=await (0,h.lt)(c),p=(0,f.A4)(o);if(!p?.isAlive())return l({type:"done",ok:!1,reply:"Failed to start session",sessionId:o});if(p.isBusy())return l({type:"done",ok:!1,reply:"Project bot is busy",sessionId:o});await (0,h.bw)(c,p).catch(()=>void 0);let q=new TextEncoder,r=!1,s=new ReadableStream({async start(a){let b=b=>{if(!r)try{a.enqueue(q.encode(`data: ${JSON.stringify(b)}
|
|
4
|
+
|
|
5
|
+
`))}catch{r=!0}};try{for await(let a of(0,i.D)(p,k))if(b(a),"done"===a.type)break}catch(a){b({type:"done",ok:!1,reply:a instanceof Error?a.message:String(a),sessionId:o})}finally{if(!r){try{a.close()}catch{}r=!0}}},cancel(){r=!0}});return new Response(s,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no"}})}d()}catch(a){d(a)}})},81896:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>h,N:()=>g});var e=c(31761),f=a([e]);function g(a){try{let b=new URL(a.url).hostname.toLowerCase();if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0}catch{}let b=(a.headers.get("host")??"").split(":")[0]?.toLowerCase()??"";if("localhost"===b||"127.0.0.1"===b||"::1"===b)return!0;let c=a.headers.get("x-forwarded-for");if(!c)return!1;let d=c.split(",")[0]?.trim();return"127.0.0.1"===d||"::1"===d}function h(a){let b=(0,e.SR)(),c=b?.token?.trim();if(!c)return!1;let d=a.headers.get("authorization");if(!d)return!1;let f=d.match(/^Bearer\s+(.+)$/i);return!!f&&f[1].trim()===c}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},95767:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{TR:()=>i,bw:()=>j,lt:()=>k});var e=c(56429),f=c(40402),g=c(31761),h=a([e,f,g]);async function i(a){let b=(0,g.Mj)(a),c=b?.sessionId?.trim()||null;if(c){let a=(0,e.A4)(c);a?.isAlive()&&a.destroy()}return{cleared:(0,g.Dg)(a),previousSessionId:c}}async function j(a,b){let c,d,e,f=(c=(0,g.wY)(a),d=c?.modelProvider?.trim(),e=c?.modelId?.trim(),d&&e?{provider:d,modelId:e}:null);f&&await b.send({type:"set_model",provider:f.provider,modelId:f.modelId})}async function k(a){let b=(0,g.Mj)(a);if(b?.sessionId){let c=(0,e.A4)(b.sessionId);if(c?.isAlive())return{sessionId:c.sessionId};let d=await (0,f.os)(b.sessionId);if(d){let{session:c,realSessionId:f}=await (0,e.OF)(b.sessionId,d,a,void 0,"im");return c.isBusy()||await j(a,c).catch(()=>void 0),(0,g.PB)(a,f),{sessionId:f}}}let{session:c,realSessionId:d}=await (0,e.OF)(`__im__${Date.now()}`,"",a,void 0,"im");return await j(a,c).catch(()=>void 0),(0,g.PB)(a,d),{sessionId:d}}[e,f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601,1761],()=>b(b.s=21704));module.exports=c})();
|