cuelo 0.10.162 → 0.10.164

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.
Files changed (69) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +39 -39
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +2 -2
  6. package/.next/required-server-files.json +2 -2
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  25. package/.next/server/app/api/sessions/[id]/memory-trace/route.js +1 -1
  26. package/.next/server/app/api/updates/apply/route.js +1 -1
  27. package/.next/server/app/api/updates/route.js +1 -1
  28. package/.next/server/app/api/upkeep/morning/route.js +1 -1
  29. package/.next/server/app/index.html +1 -1
  30. package/.next/server/app/index.rsc +4 -4
  31. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  32. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  33. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  34. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  36. package/.next/server/app/page.js +21 -21
  37. package/.next/server/app/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/recover.html +1 -1
  40. package/.next/server/app/recover.rsc +2 -2
  41. package/.next/server/app/recover.segments/_full.segment.rsc +2 -2
  42. package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
  43. package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
  44. package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
  45. package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +1 -1
  46. package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
  47. package/.next/server/app-paths-manifest.json +39 -39
  48. package/.next/server/chunks/1008.js +1 -1
  49. package/.next/server/chunks/5948.js +1 -1
  50. package/.next/server/middleware-build-manifest.js +1 -1
  51. package/.next/server/pages/404.html +1 -1
  52. package/.next/server/pages/500.html +1 -1
  53. package/.next/server/server-reference-manifest.json +1 -1
  54. package/.next/static/chunks/app/{layout-c6b8d17d2d08658d.js → layout-9cc536a64d863319.js} +1 -1
  55. package/.next/static/chunks/app/{page-b993cafa53a7148c.js → page-6f670c6025ea8b58.js} +19 -19
  56. package/.next/trace +110 -110
  57. package/.next/trace-build +1 -1
  58. package/README.md +4 -1
  59. package/Tools/CUELO_Setup/files/native-runtime-patch.js +5 -4
  60. package/Tools/OMP_Global_Config/agent/agents/maker.md +10 -3
  61. package/Tools/OMP_Global_Config/agent/extensions/character-voice.ts +57 -10
  62. package/Tools/OMP_Global_Config/agent/extensions/command-guard/check-output-hint.ts +53 -0
  63. package/Tools/OMP_Global_Config/agent/extensions/command-guard/index.ts +2 -1
  64. package/Tools/OMP_Global_Config/agent/extensions/command-guard/matcher.ts +56 -5
  65. package/Tools/OMP_Global_Config/agent/sop/_common.md +9 -2
  66. package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +359 -0
  67. package/package.json +7 -7
  68. /package/.next/static/{7MM0SMegS0fbynJeok5rh → dmJhoGPsBcIX8G0WblHTl}/_buildManifest.js +0 -0
  69. /package/.next/static/{7MM0SMegS0fbynJeok5rh → dmJhoGPsBcIX8G0WblHTl}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[57121,[],""]
3
3
  3:I[74581,[],""]
4
- 4:I[57788,["7177","static/chunks/app/layout-c6b8d17d2d08658d.js"],"PwaRegistration"]
4
+ 4:I[57788,["7177","static/chunks/app/layout-9cc536a64d863319.js"],"PwaRegistration"]
5
5
  5:I[90484,[],"OutletBoundary"]
6
6
  6:"$Sreact.suspense"
7
7
  9:I[90484,[],"ViewportBoundary"]
@@ -10,7 +10,7 @@ d:I[27123,[],"default",1]
10
10
  :HL["/_next/static/css/2f46e0db0d4a3aed.css","style"]
11
11
  :HL["/_next/static/css/b072dbad8ae89f19.css","style"]
12
12
  :HL["/fonts/fonts.css","style"]
13
- 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$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,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"7MM0SMegS0fbynJeok5rh"}
13
+ 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$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,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"dmJhoGPsBcIX8G0WblHTl"}
14
14
  e:[]
15
15
  8:"$We"
16
16
  a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#ffffff","media":"(prefers-color-scheme: light)"}],["$","meta","3",{"name":"theme-color","content":"#16171b","media":"(prefers-color-scheme: dark)"}]]
@@ -1,7 +1,7 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[57121,[],""]
3
3
  3:I[74581,[],""]
4
- 4:I[57788,["7177","static/chunks/app/layout-c6b8d17d2d08658d.js"],"PwaRegistration"]
4
+ 4:I[57788,["7177","static/chunks/app/layout-9cc536a64d863319.js"],"PwaRegistration"]
5
5
  5:I[90484,[],"OutletBoundary"]
6
6
  6:"$Sreact.suspense"
7
7
  9:I[90484,[],"ViewportBoundary"]
@@ -10,7 +10,7 @@ d:I[27123,[],"default",1]
10
10
  :HL["/_next/static/css/2f46e0db0d4a3aed.css","style"]
11
11
  :HL["/_next/static/css/b072dbad8ae89f19.css","style"]
12
12
  :HL["/fonts/fonts.css","style"]
13
- 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$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,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"7MM0SMegS0fbynJeok5rh"}
13
+ 0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$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,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"dmJhoGPsBcIX8G0WblHTl"}
14
14
  e:[]
15
15
  8:"$We"
16
16
  a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#ffffff","media":"(prefers-color-scheme: light)"}],["$","meta","3",{"name":"theme-color","content":"#16171b","media":"(prefers-color-scheme: dark)"}]]
@@ -3,4 +3,4 @@
3
3
  3:I[90484,[],"MetadataBoundary"]
4
4
  4:"$Sreact.suspense"
5
5
  5:I[86869,[],"IconMark"]
6
- 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#ffffff","media":"(prefers-color-scheme: light)"}],["$","meta","3",{"name":"theme-color","content":"#16171b","media":"(prefers-color-scheme: dark)"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"CUELO"}],["$","meta","1",{"name":"description","content":"Web view for the omp (oh-my-pi) coding agent"}],["$","meta","2",{"name":"application-name","content":"CUELO"}],["$","link","3",{"rel":"manifest","href":"/manifest.webmanifest"}],["$","meta","4",{"name":"format-detection","content":"telephone=no"}],["$","meta","5",{"name":"mobile-web-app-capable","content":"yes"}],["$","meta","6",{"name":"apple-mobile-web-app-title","content":"CUELO"}],["$","meta","7",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","link","8",{"rel":"icon","href":"/favicon.ico?bcf2d9369cb3cf33","type":"image/x-icon","sizes":"16x16"}],["$","link","9",{"rel":"icon","href":"/icons/icon-192.png","sizes":"192x192","type":"image/png"}],["$","link","10",{"rel":"apple-touch-icon","href":"/icons/apple-touch-icon.png","sizes":"180x180","type":"image/png"}],["$","$L5","11",{}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"7MM0SMegS0fbynJeok5rh"}
6
+ 0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#ffffff","media":"(prefers-color-scheme: light)"}],["$","meta","3",{"name":"theme-color","content":"#16171b","media":"(prefers-color-scheme: dark)"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"CUELO"}],["$","meta","1",{"name":"description","content":"Web view for the omp (oh-my-pi) coding agent"}],["$","meta","2",{"name":"application-name","content":"CUELO"}],["$","link","3",{"rel":"manifest","href":"/manifest.webmanifest"}],["$","meta","4",{"name":"format-detection","content":"telephone=no"}],["$","meta","5",{"name":"mobile-web-app-capable","content":"yes"}],["$","meta","6",{"name":"apple-mobile-web-app-title","content":"CUELO"}],["$","meta","7",{"name":"apple-mobile-web-app-status-bar-style","content":"default"}],["$","link","8",{"rel":"icon","href":"/favicon.ico?bcf2d9369cb3cf33","type":"image/x-icon","sizes":"16x16"}],["$","link","9",{"rel":"icon","href":"/icons/icon-192.png","sizes":"192x192","type":"image/png"}],["$","link","10",{"rel":"apple-touch-icon","href":"/icons/apple-touch-icon.png","sizes":"180x180","type":"image/png"}],["$","$L5","11",{}]]}]}]}],null]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"dmJhoGPsBcIX8G0WblHTl"}
@@ -1,8 +1,8 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[57121,[],""]
3
3
  3:I[74581,[],""]
4
- 4:I[57788,["7177","static/chunks/app/layout-c6b8d17d2d08658d.js"],"PwaRegistration"]
4
+ 4:I[57788,["7177","static/chunks/app/layout-9cc536a64d863319.js"],"PwaRegistration"]
5
5
  :HL["/_next/static/css/2f46e0db0d4a3aed.css","style"]
6
6
  :HL["/_next/static/css/b072dbad8ae89f19.css","style"]
7
7
  :HL["/fonts/fonts.css","style"]
8
- 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}],["$","$L4",null,{}]]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"7MM0SMegS0fbynJeok5rh"}
8
+ 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2f46e0db0d4a3aed.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b072dbad8ae89f19.css","precedence":"next"}]],["$","html",null,{"lang":"en","translate":"no","className":"notranslate","data-seed":true,"suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","meta",null,{"name":"color-scheme","content":"light dark"}],["$","link",null,{"rel":"stylesheet","href":"/fonts/fonts.css"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{var s=localStorage,p=s.getItem(\"pi-theme\");if(p!==\"light\"&&p!==\"dark\"&&p!==\"auto\"){p=s.getItem(\"omp-theme\");if(p!==\"light\"&&p!==\"dark\")p=\"auto\"}var m=p===\"auto\"?(window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):p,r=document.documentElement;r.dataset.ompThemeMode=m;r.setAttribute(\"data-seed-color-mode\",m===\"dark\"?\"dark-only\":\"light-only\");r.classList.toggle(\"dark\",m===\"dark\");for(var i=r.style.length-1;i>=0;i--){var n=r.style.item(i);if(n.indexOf(\"--\")===0&&n.indexOf(\"--omp-md-\")!==0)r.style.removeProperty(n)}var c=JSON.parse(s.getItem(\"omp-theme-config\")||\"null\"),v=c&&c.palettes&&c.palettes[m];if(v&&v.variables){Object.keys(v.variables).forEach(function(k){if(k.indexOf(\"--omp-md-\")===0)r.style.setProperty(k,v.variables[k])});r.dataset.ompThemeName=v.name}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","children":[["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}],["$","$L4",null,{}]]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"dmJhoGPsBcIX8G0WblHTl"}
@@ -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":"7MM0SMegS0fbynJeok5rh"}
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":"dmJhoGPsBcIX8G0WblHTl"}
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":"7MM0SMegS0fbynJeok5rh"}
5
+ 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"dmJhoGPsBcIX8G0WblHTl"}
@@ -1,4 +1,4 @@
1
1
  :HL["/_next/static/css/2f46e0db0d4a3aed.css","style"]
2
2
  :HL["/_next/static/css/b072dbad8ae89f19.css","style"]
3
3
  :HL["/fonts/fonts.css","style"]
4
- 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":"7MM0SMegS0fbynJeok5rh"}
4
+ 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":"dmJhoGPsBcIX8G0WblHTl"}
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=3617,a.ids=[3617],a.modules={84:a=>{a.exports=import("@oh-my-pi/omp-stats/aggregator")},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")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},22127:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/memory-backend/redact")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33374:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/patterns")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},37925:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{I2:()=>w});var e=c(34069),f=c(29959),g=c(32240),h=c(83881),i=a([e,f,g]);[e,f,g]=i.then?(await i)():i;let r=/^[0-9a-f]{16}$/,s=/"customType"\s*:\s*"(memory_recall|mnemopi-recall|jev-runtime-advisory|docmap-route|autolearn-saved)"/,t=/"role"\s*:\s*"(\w+)"/,u=/"toolCallId"\s*:\s*"([^"]+)"/,v=/"name"\s*:\s*"(?:read|write|recall|reflect|learn|retain)"/;function j(a){try{let b=JSON.parse(a);return(0,e.isRecord)(b)?b:null}catch{return null}}function k(a){if("string"!=typeof a)return 0;let b=Date.parse(a);return Number.isFinite(b)?b:0}function l(a){if("string"==typeof a)return a;if(!Array.isArray(a))return"";let b=[];for(let c of a)(0,e.isRecord)(c)&&"text"===c.type&&"string"==typeof c.text&&b.push(c.text);return b.join("\n")}function m(a,b){let c=(0,g.QU)(a).text.replace(/\s+/g," ").trim();return c.length>b?`${c.slice(0,b-1)}…`:c}function n(a,b){if(!a||!b.startsWith("/"))return b.replace(/^\.\//,"");let c=a.endsWith("/")?a:`${a}/`;return b.startsWith(c)?b.slice(c.length):b}function o(a,b){for(let c of b){let b=a[c];if("string"==typeof b&&b.trim())return b}return null}class w{constructor(a){this.sessionId=a,this.requests=[],this.pending=null,this.current=null,this.cwd=null,this.calls=new Map,this.previews=new Map,this.candidatePaths=new Set}push(a){if(a.startsWith('{"type":"custom"')){if(!s.test(a))return;let b=j(a);b&&this.custom(b);return}if(a.startsWith('{"type":"message"'))return void this.message(a);if(a.startsWith('{"type":"session"')&&null===this.cwd){let b=j(a);b&&"string"==typeof b.cwd&&(this.cwd=b.cwd);return}if(s.test(a)){let b=j(a);b&&("custom"===b.type||"custom_message"===b.type)&&this.custom(b)}else/"type"\s*:\s*"message"/.test(a.slice(0,200))&&this.message(a)}finish(){for(let a of this.requests)this.finishRequest(a);let{nodes:a,edges:b}=this.graph();return(0,f.fI)({sessionId:this.sessionId,requests:this.requests,nodes:a,edges:b})}custom(a){let b="string"==typeof a.id?a.id:"",c=k(a.timestamp),d=(0,e.isRecord)(a.data)?a.data:null;switch(a.customType){case"memory_recall":{let a=d&&Array.isArray(d.memories)?d.memories:[],f=[];for(let b of a){if(!(0,e.isRecord)(b)||"string"!=typeof b.id)continue;let a="string"==typeof b.text?m(b.text,200):"";f.push({id:b.id,preview:a})}this.addRecall(b,c,f);return}case"mnemopi-recall":{let a=d&&Array.isArray(d.ids)?d.ids.filter(a=>"string"==typeof a):[];this.addRecall(b,c,a.map(a=>({id:a,preview:""})));return}case"jev-runtime-advisory":{let d=function(a){if(!a.startsWith("[JevRuntime:memory-application]"))return null;let b=[];for(let c of a.split("\n")){if(!c.startsWith("- "))continue;let a=/^- (.+?):\s*([0-9a-f]{16}(?:\s*,\s*[0-9a-f]{16})*)\s*$/.exec(c);if(!a)continue;let d=a[1].trim();b.push({label:d,shortLabel:d.replace(/\s*\([^()]*\)\s*$/,"").trim()||d,ids:a[2].split(",").map(a=>a.trim())})}let c=/판정 불명\s*(\d+)\s*개/.exec(a),d=/무관\s*(\d+)\s*개/.exec(a);return{buckets:b,unknownCount:c?Number(c[1]):null,unrelatedCount:d?Number(d[1]):null}}(l(a.content));d&&this.add({kind:"jev",entryId:b,at:c,...d});return}case"docmap-route":{let d=function(a){if(!a.startsWith("[문서 지도 후보]"))return[];let b=[],c=null;for(let d of a.split("\n")){let a=/^\d+\.\s+(\S+)(?:\s+\(STATUS:\s*([^)]*)\))?/.exec(d);if(a){c={path:a[1],status:a[2]?.trim()||null,map:null,scope:null,section:null},b.push(c);continue}if(!c)continue;let e=/^\s+(지도|SCOPE|구간):\s*(.*)$/.exec(d);if(!e)continue;let f=m(e[2],240);"지도"===e[1]?c.map=f:"SCOPE"===e[1]?c.scope=f:c.section=f}return b}(l(a.content));if(d.length>0){let a=d.map(a=>({...a,path:n(this.cwd,a.path),opened:!1}));for(let b of a)this.candidatePaths.add(b.path);this.add({kind:"docmap",entryId:b,at:c,candidates:a})}return}case"autolearn-saved":{let d=l(a.content),e=d.split("\n").filter(a=>a.startsWith("- "));for(let a of e.length>0?e:[d])this.add({kind:"saved",entryId:b,at:c,source:"autolearn",text:m(a.replace(/^- (?:교훈:\s*)?/,""),200)});return}}}message(a){let b,c=a.slice(0,600),d=t.exec(c)?.[1];if(d||(b=j(a),d="string"==typeof b?.message?.role?b.message.role:void 0),"toolResult"===d){if(this.flushPending(),0===this.calls.size)return;let d=u.exec(c)?.[1];d||(b??=j(a),d="string"==typeof b?.message?.toolCallId?b.message.toolCallId:void 0);let e=d?this.calls.get(d):void 0;if(!e||!d)return;this.calls.delete(d),b??=j(a);let f=function(a){let b=[],c=new Set,d=/(?:^|\n)- ([\s\S]*?)\(id: ([0-9a-f]{16})[^)]*\)/g;for(let e=d.exec(a);e;e=d.exec(a))c.has(e[2])||(c.add(e[2]),b.push({id:e[2],preview:m(e[1].replace(/^\[[^\]]*\]\s*/,""),200)}));return b}(l(b?.message?.content));for(let a of f)this.remember(a);0===e.step.memories.length&&(e.step.memories=f);return}if("assistant"===d){if(this.flushPending(),!a.includes('"toolCall"')||!v.test(a))return;(b??=j(a))&&this.assistant(b);return}if("user"!==d&&"developer"!==d)return;b??=j(a);let e=b?.message;if(!b||!e)return;let f="string"==typeof b.id?b.id:"",g=k(b.timestamp);if("user"===d&&!0!==e.synthetic&&"agent"!==e.attribution){let a={entryId:f,at:g,preview:m(l(e.content),160),steps:[]};this.requests.push(a),this.current=a,this.candidatePaths.clear(),this.pending&&(a.steps.push(this.pending),this.pending=null);return}let h=function(a){let b=/^\[edit-lessons\]\s+(.+?)에 묶인 기억\s*\d+\s*건/.exec(a);if(!b)return null;let c=[];for(let b of a.split("\n")){let a=/^- (.*)\(id: ([0-9a-f]{16})(?:,\s*([^)]*))?\)\s*$/.exec(b);a&&c.push({id:a[2],preview:m(a[1],200),...a[3]?{date:a[3].trim()}:{}})}return{file:b[1].trim(),memories:c}}(l(e.content));if(h){for(let a of h.memories)this.remember(a);this.add({kind:"edit-lesson",entryId:f,at:g,file:n(this.cwd,h.file),memories:h.memories})}}assistant(a){let b=a.message?.content;if(!Array.isArray(b))return;let c="string"==typeof a.id?a.id:"",d=k(a.timestamp);for(let a of b){if(!(0,e.isRecord)(a)||"toolCall"!==a.type||"string"!=typeof a.name)continue;let b=(0,e.isRecord)(a.arguments)?a.arguments:{},f="string"==typeof a.id?a.id:null,g=a.name,h="string"==typeof b.path?b.path:null;if(("write"===g||"read"===g)&&("xd://recall"===h||"xd://reflect"===h))this.explicit(c,d,f,h,function(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if((0,e.isRecord)(b))return o(b,["query","question","q"])??a}catch{}return a}(b.content));else if("recall"===g||"reflect"===g)this.explicit(c,d,f,g,o(b,["query","question","q"]));else if("read"===g&&h?.startsWith("memory://")){let a=h.slice(9).replace(/[/?#].*$/,""),b=r.test(a)?[{id:a,preview:""}]:[];this.add({kind:"explicit-recall",entryId:c,at:d,target:h,query:null,memories:b})}else if("read"===g&&h){let{path:a,selector:b}=function(a){let b=/^[a-z][a-z0-9+.-]*:\/\//i.exec(a)?.[0]??"",c=a.slice(b.length),d=/(?::(?:raw|img|conflicts|-?\d[\d,+\-]*))+$/.exec(c);return d&&0!==d.index?{path:b+c.slice(0,d.index),selector:d[0].slice(1)}:{path:a,selector:null}}(h),e=n(this.cwd,a);((function(a){if(a.startsWith("rule://")||a.startsWith("skill://")||/(?:^|\/)doc\/history\//.test(a))return!0;let b=a.slice(a.lastIndexOf("/")+1);return"HANDOFF.md"===b||"README.md"===b||"AGENTS.md"===b})(e)||this.candidatePaths.has(e))&&this.add({kind:"doc-read",entryId:c,at:d,path:e,selector:b,candidate:!1})}else if("learn"===g||"retain"===g){let a=o(b,["memory","content","text","fact"]);a&&this.add({kind:"saved",entryId:c,at:d,source:g,text:m(a,200)})}}}explicit(a,b,c,d,e){let f={kind:"explicit-recall",entryId:a,at:b,target:d,query:e?m(e,160):null,memories:[]},g=this.add(f);g&&c&&this.calls.set(c,{request:g,step:f})}addRecall(a,b,c){for(let a of c)this.remember(a);let d=this.pending??null;d?p(d.memories,c):this.pending={kind:"recall",entryId:a,at:b,memories:[...c]}}flushPending(){if(!this.pending||!this.current)return;let a=this.current.steps.find(a=>"recall"===a.kind);a?p(a.memories,this.pending.memories):this.current.steps.push(this.pending),this.pending=null}add(a){return this.current?(this.current.steps.push(a),this.current):null}remember(a){a.preview&&!this.previews.has(a.id)&&this.previews.set(a.id,a.preview)}finishRequest(a){let b=new Set,c=new Set;for(let d of a.steps){if("doc-read"===d.kind&&b.add(d.path),"docmap"===d.kind)for(let a of d.candidates)c.add(a.path);if("memories"in d)for(let a of d.memories)a.preview||(a.preview=this.previews.get(a.id)??"")}for(let d of a.steps){if("docmap"===d.kind)for(let a of d.candidates)a.opened=b.has(a.path);"doc-read"===d.kind&&(d.candidate=c.has(d.path))}}graph(){let a=new Map,b=new Map,c=(b,c,d,e)=>(a.has(b)||a.set(b,{id:b,kind:c,label:d,title:e}),b),d=(a,c,d)=>{let e=`${a}\u0000${c}\u0000${d}`;b.has(e)||b.set(e,{from:a,to:c,kind:d})},e=a=>{let b=a.preview||this.previews.get(a.id)||"";return c((0,h.zY)(a.id),"memory",b?m(b,160):a.id,b?`${a.id} \xb7 ${b}`:a.id)},f=a=>c((0,h.cz)(a),"doc",q(a),a);for(let a of this.requests){let b=c((0,h.dX)(a.entryId),"request",a.preview?m(a.preview,40):a.entryId,a.preview||a.entryId);a.steps.forEach((a,g)=>{switch(a.kind){case"recall":for(let c of a.memories)d(b,e(c),"recalled");break;case"explicit-recall":for(let c of a.memories)d(b,e(c),"explicit");break;case"edit-lesson":{let f=c((0,h.WN)(a.file),"file",q(a.file),a.file);for(let c of(d(b,f,"edited"),a.memories))d(f,e(c),"lesson");break}case"docmap":for(let c of a.candidates)d(b,f(c.path),c.opened?"opened":"candidate");break;case"doc-read":d(b,f(a.path),"opened");break;case"saved":d(b,c((0,h.hy)(a.entryId,g),"memory",m(a.text,40),a.text),"saved")}})}for(let[a,c]of b)"candidate"===c.kind&&b.has(`${c.from}\u0000${c.to}\u0000opened`)&&b.delete(a);return{nodes:[...a.values()],edges:[...b.values()]}}}function p(a,b){for(let c of b){let b=a.find(a=>a.id===c.id);b?!b.preview&&c.preview&&(b.preview=c.preview):a.push({...c})}}function q(a){return a.replace(/\/+$/,"").split("/").filter(Boolean).slice(-2).join("/")||a}d()}catch(a){d(a)}})},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47043:a=>{a.exports=import("@oh-my-pi/omp-stats/db")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},57588:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/regex")},58093:(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(92784),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/memory-trace/route",pathname:"/api/sessions/[id]/memory-trace",filename:"route",bundlePath:"app/api/sessions/[id]/memory-trace/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/sessions/[id]/memory-trace/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/sessions/[id]/memory-trace/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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64978:a=>{a.exports=import("bun:sqlite")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77037:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/session-dump-format")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},83881:(a,b,c)=>{function d(a){return`request:${a}`}function e(a){return`memory:${a}`}function f(a){return`doc:${a}`}function g(a){return`file:${a}`}function h(a,b){return`saved:${a}:${b}`}c.d(b,{WN:()=>g,cz:()=>f,dX:()=>d,hy:()=>h,zY:()=>e})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},92784:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,dynamic:()=>o,runtime:()=>n});var e=c(73024),f=c(80481),g=c(23211),h=c(37925),i=c(29959),j=c(66544),k=c(40402),l=a([h,i,k]);[h,i,k]=l.then?(await l)():l;let n="nodejs",o="force-dynamic";async function m(a,{params:b}){if(!(0,j.EN)(a))return g.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b;try{let b=await (0,k.os)(c);if(!b)return g.NextResponse.json({error:"Session not found"},{status:404});let d=new h.I2(c),i=(0,e.createReadStream)(b,{encoding:"utf8"}),j=(0,f.createInterface)({input:i,crlfDelay:1/0});try{for await(let b of j){if(a.signal.aborted)return new Response(null,{status:499});b&&d.push(b)}}finally{j.close(),i.destroy()}return g.NextResponse.json(d.finish(),{headers:{"Cache-Control":"no-store"}})}catch(a){return g.NextResponse.json({error:(0,i.LV)(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5948,402,3229,5738,2240,8116],()=>b(b.s=58093));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=3617,a.ids=[3617],a.modules={84:a=>{a.exports=import("@oh-my-pi/omp-stats/aggregator")},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")},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},22127:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/memory-backend/redact")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33374:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/patterns")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},37925:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{I2:()=>z});var e=c(34069),f=c(29959),g=c(32240),h=c(83881),i=a([e,f,g]);[e,f,g]=i.then?(await i)():i;let r=/^[0-9a-f]{16}$/,s=/"customType"\s*:\s*"(memory_recall|mnemopi-recall|jev-runtime-advisory|docmap-route|autolearn-saved)"/,t=/"role"\s*:\s*"(\w+)"/,u=/"toolCallId"\s*:\s*"([^"]+)"/,v=/"name"\s*:\s*"(?:read|write|recall|reflect|learn|retain)"/;function j(a){try{let b=JSON.parse(a);return(0,e.isRecord)(b)?b:null}catch{return null}}function k(a){if("string"!=typeof a)return 0;let b=Date.parse(a);return Number.isFinite(b)?b:0}function l(a){if("string"==typeof a)return a;if(!Array.isArray(a))return"";let b=[];for(let c of a)(0,e.isRecord)(c)&&"text"===c.type&&"string"==typeof c.text&&b.push(c.text);return b.join("\n")}function m(a,b){let c=(0,g.QU)(a).text.replace(/\s+/g," ").trim();return c.length>b?`${c.slice(0,b-1)}…`:c}function n(a,b){if(!a||!b.startsWith("/"))return b.replace(/^\.\//,"");let c=a.endsWith("/")?a:`${a}/`;return b.startsWith(c)?b.slice(c.length):b}let w=/^Lesson stored\b/,x=/^\d+ (?:memory|memories) stored\.$/,y=/^Mnemopi did not store item (\d+) of \d+: [\s\S]* Stored before the failure and kept: ((?:item \d+ \(id [^)]+\), )*item \d+ \(id [^)]+\))\.(?: Later items were not attempted\.)?$/;function o(a,b){for(let c of b){let b=a[c];if("string"==typeof b&&b.trim())return b}return null}class z{constructor(a){this.sessionId=a,this.requests=[],this.pending=null,this.current=null,this.cwd=null,this.calls=new Map,this.unconfirmed=new Set,this.previews=new Map,this.candidatePaths=new Set}push(a){if(a.startsWith('{"type":"custom"')){if(!s.test(a))return;let b=j(a);b&&this.custom(b);return}if(a.startsWith('{"type":"message"'))return void this.message(a);if(a.startsWith('{"type":"session"')&&null===this.cwd){let b=j(a);b&&"string"==typeof b.cwd&&(this.cwd=b.cwd);return}if(s.test(a)){let b=j(a);b&&("custom"===b.type||"custom_message"===b.type)&&this.custom(b)}else/"type"\s*:\s*"message"/.test(a.slice(0,200))&&this.message(a)}finish(){for(let a of this.requests)this.unconfirmed.size>0&&(a.steps=a.steps.filter(a=>!this.unconfirmed.has(a))),this.finishRequest(a);let{nodes:a,edges:b}=this.graph();return(0,f.fI)({sessionId:this.sessionId,requests:this.requests,nodes:a,edges:b})}custom(a){let b="string"==typeof a.id?a.id:"",c=k(a.timestamp),d=(0,e.isRecord)(a.data)?a.data:null;switch(a.customType){case"memory_recall":{let a=d&&Array.isArray(d.memories)?d.memories:[],f=[];for(let b of a){if(!(0,e.isRecord)(b)||"string"!=typeof b.id)continue;let a="string"==typeof b.text?m(b.text,200):"";f.push({id:b.id,preview:a})}this.addRecall(b,c,f);return}case"mnemopi-recall":{let a=d&&Array.isArray(d.ids)?d.ids.filter(a=>"string"==typeof a):[];this.addRecall(b,c,a.map(a=>({id:a,preview:""})));return}case"jev-runtime-advisory":{let d=function(a){if(!a.startsWith("[JevRuntime:memory-application]"))return null;let b=[];for(let c of a.split("\n")){if(!c.startsWith("- "))continue;let a=/^- (.+?):\s*([0-9a-f]{16}(?:\s*,\s*[0-9a-f]{16})*)\s*$/.exec(c);if(!a)continue;let d=a[1].trim();b.push({label:d,shortLabel:d.replace(/\s*\([^()]*\)\s*$/,"").trim()||d,ids:a[2].split(",").map(a=>a.trim())})}let c=/판정 불명\s*(\d+)\s*개/.exec(a),d=/무관\s*(\d+)\s*개/.exec(a);return{buckets:b,unknownCount:c?Number(c[1]):null,unrelatedCount:d?Number(d[1]):null}}(l(a.content));d&&this.add({kind:"jev",entryId:b,at:c,...d});return}case"docmap-route":{let d=function(a){if(!a.startsWith("[문서 지도 후보]"))return[];let b=[],c=null;for(let d of a.split("\n")){let a=/^\d+\.\s+(\S+)(?:\s+\(STATUS:\s*([^)]*)\))?/.exec(d);if(a){c={path:a[1],status:a[2]?.trim()||null,map:null,scope:null,section:null},b.push(c);continue}if(!c)continue;let e=/^\s+(지도|SCOPE|구간):\s*(.*)$/.exec(d);if(!e)continue;let f=m(e[2],240);"지도"===e[1]?c.map=f:"SCOPE"===e[1]?c.scope=f:c.section=f}return b}(l(a.content));if(d.length>0){let a=d.map(a=>({...a,path:n(this.cwd,a.path),opened:!1}));for(let b of a)this.candidatePaths.add(b.path);this.add({kind:"docmap",entryId:b,at:c,candidates:a})}return}case"autolearn-saved":{let d=l(a.content),e=d.split("\n").filter(a=>a.startsWith("- "));for(let a of e.length>0?e:[d])this.add({kind:"saved",entryId:b,at:c,source:"autolearn",text:m(a.replace(/^- (?:교훈:\s*)?/,""),200)});return}}}message(a){let b,c=a.slice(0,600),d=t.exec(c)?.[1];if(d||(b=j(a),d="string"==typeof b?.message?.role?b.message.role:void 0),"toolResult"===d){if(this.flushPending(),0===this.calls.size)return;let d=u.exec(c)?.[1];d||(b??=j(a),d="string"==typeof b?.message?.toolCallId?b.message.toolCallId:void 0);let e=d?this.calls.get(d):void 0;if(!e||!d)return;this.calls.delete(d),b??=j(a);let f=b?.message;if(!f)return;let g=!0===f.isError,h=l(f.content);if("read"===e.kind)g||this.unconfirmed.delete(e.step);else if("learn"===e.kind)w.test(h.trimStart())&&this.unconfirmed.delete(e.step);else if("retain"===e.kind)for(let a of function(a,b,c){if(!b&&x.test(a))return Array.from({length:c},(a,b)=>b);let d=y.exec(a);if(!d)return[];let e=Number(d[1])-1;return[...d[2].matchAll(/item (\d+) \(id /g)].map(a=>Number(a[1])-1).filter(a=>a>=0&&a<e&&a<c)}(h.trim(),g,e.steps.length)){let b=e.steps[a];b&&this.unconfirmed.delete(b)}else{let a=function(a){let b=[],c=new Set,d=/(?:^|\n)- ([\s\S]*?)\(id: ([0-9a-f]{16})[^)]*\)/g;for(let e=d.exec(a);e;e=d.exec(a))c.has(e[2])||(c.add(e[2]),b.push({id:e[2],preview:m(e[1].replace(/^\[[^\]]*\]\s*/,""),200)}));return b}(h);for(let b of a)this.remember(b);0===e.step.memories.length&&(e.step.memories=a)}return}if("assistant"===d){if(this.flushPending(),!a.includes('"toolCall"')||!v.test(a))return;(b??=j(a))&&this.assistant(b);return}if("user"!==d&&"developer"!==d)return;b??=j(a);let e=b?.message;if(!b||!e)return;let f="string"==typeof b.id?b.id:"",g=k(b.timestamp);if("user"===d&&!0!==e.synthetic&&"agent"!==e.attribution){let a={entryId:f,at:g,preview:m(l(e.content),160),steps:[]};this.requests.push(a),this.current=a,this.candidatePaths.clear(),this.pending&&(a.steps.push(this.pending),this.pending=null);return}let h=function(a){let b=/^\[edit-lessons\]\s+(.+?)에 묶인 기억\s*\d+\s*건/.exec(a);if(!b)return null;let c=[];for(let b of a.split("\n")){let a=/^- (.*)\(id: ([0-9a-f]{16})(?:,\s*([^)]*))?\)\s*$/.exec(b);a&&c.push({id:a[2],preview:m(a[1],200),...a[3]?{date:a[3].trim()}:{}})}return{file:b[1].trim(),memories:c}}(l(e.content));if(h){for(let a of h.memories)this.remember(a);this.add({kind:"edit-lesson",entryId:f,at:g,file:n(this.cwd,h.file),memories:h.memories})}}assistant(a){let b=a.message?.content;if(!Array.isArray(b))return;let c="string"==typeof a.id?a.id:"",d=k(a.timestamp);for(let a of b){if(!(0,e.isRecord)(a)||"toolCall"!==a.type||"string"!=typeof a.name)continue;let b=(0,e.isRecord)(a.arguments)?a.arguments:{},f="string"==typeof a.id?a.id:null,g=a.name,h="string"==typeof b.path?b.path:null;if(("write"===g||"read"===g)&&("xd://recall"===h||"xd://reflect"===h))this.explicit(c,d,f,h,function(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if((0,e.isRecord)(b))return o(b,["query","question","q"])??a}catch{}return a}(b.content));else if("recall"===g||"reflect"===g)this.explicit(c,d,f,g,o(b,["query","question","q"]));else if("read"===g&&h?.startsWith("memory://")){let a=h.slice(9).replace(/[/?#].*$/,""),b=r.test(a)?[{id:a,preview:""}]:[];this.add({kind:"explicit-recall",entryId:c,at:d,target:h,query:null,memories:b})}else if("read"===g&&h){let{path:a,selector:b}=function(a){let b=/^[a-z][a-z0-9+.-]*:\/\//i.exec(a)?.[0]??"",c=a.slice(b.length),d=/(?::(?:raw|img|conflicts|-?\d[\d,+\-]*))+$/.exec(c);return d&&0!==d.index?{path:b+c.slice(0,d.index),selector:d[0].slice(1)}:{path:a,selector:null}}(h),e=n(this.cwd,a);if(function(a){if(a.startsWith("rule://")||a.startsWith("skill://")||/(?:^|\/)doc\/history\//.test(a))return!0;let b=a.slice(a.lastIndexOf("/")+1);return"HANDOFF.md"===b||"README.md"===b||"AGENTS.md"===b}(e)||this.candidatePaths.has(e)){let a={kind:"doc-read",entryId:c,at:d,path:e,selector:b,candidate:!1};this.pend(f,[a],{kind:"read",step:a})}}else if("learn"===g){let a=o(b,["memory","content","text","fact"]);if(!a)continue;let e={kind:"saved",entryId:c,at:d,source:g,text:m(a,200)};this.pend(f,[e],{kind:"learn",step:e})}else if("retain"===g){let a=Array.isArray(b.items)?b.items:null,h=(a?a.map(a=>(0,e.isRecord)(a)&&"string"==typeof a.content&&a.content.trim()?a.content:null):[o(b,["memory","content","text","fact"])]).map(a=>a?{kind:"saved",entryId:c,at:d,source:g,text:m(a,200)}:null),i=h.filter(a=>null!==a);i.length>0&&this.pend(f,i,{kind:"retain",steps:h})}}}pend(a,b,c){if(this.current){for(let a of b)this.current.steps.push(a),this.unconfirmed.add(a);a&&this.calls.set(a,c)}}explicit(a,b,c,d,e){let f={kind:"explicit-recall",entryId:a,at:b,target:d,query:e?m(e,160):null,memories:[]};this.add(f)&&c&&this.calls.set(c,{kind:"explicit",step:f})}addRecall(a,b,c){for(let a of c)this.remember(a);let d=this.pending??null;d?p(d.memories,c):this.pending={kind:"recall",entryId:a,at:b,memories:[...c]}}flushPending(){if(!this.pending||!this.current)return;let a=this.current.steps.find(a=>"recall"===a.kind);a?p(a.memories,this.pending.memories):this.current.steps.push(this.pending),this.pending=null}add(a){return this.current?(this.current.steps.push(a),this.current):null}remember(a){a.preview&&!this.previews.has(a.id)&&this.previews.set(a.id,a.preview)}finishRequest(a){let b=new Set,c=new Set;for(let d of a.steps){if("doc-read"===d.kind&&b.add(d.path),"docmap"===d.kind)for(let a of d.candidates)c.add(a.path);if("memories"in d)for(let a of d.memories)a.preview||(a.preview=this.previews.get(a.id)??"")}for(let d of a.steps){if("docmap"===d.kind)for(let a of d.candidates)a.opened=b.has(a.path);"doc-read"===d.kind&&(d.candidate=c.has(d.path))}}graph(){let a=new Map,b=new Map,c=(b,c,d,e)=>(a.has(b)||a.set(b,{id:b,kind:c,label:d,title:e}),b),d=(a,c,d)=>{let e=`${a}\u0000${c}\u0000${d}`;b.has(e)||b.set(e,{from:a,to:c,kind:d})},e=a=>{let b=a.preview||this.previews.get(a.id)||"";return c((0,h.zY)(a.id),"memory",b?m(b,160):a.id,b?`${a.id} \xb7 ${b}`:a.id)},f=a=>c((0,h.cz)(a),"doc",q(a),a);for(let a of this.requests){let b=c((0,h.dX)(a.entryId),"request",a.preview?m(a.preview,40):a.entryId,a.preview||a.entryId);a.steps.forEach((a,g)=>{switch(a.kind){case"recall":for(let c of a.memories)d(b,e(c),"recalled");break;case"explicit-recall":for(let c of a.memories)d(b,e(c),"explicit");break;case"edit-lesson":{let f=c((0,h.WN)(a.file),"file",q(a.file),a.file);for(let c of(d(b,f,"edited"),a.memories))d(f,e(c),"lesson");break}case"docmap":for(let c of a.candidates)d(b,f(c.path),c.opened?"opened":"candidate");break;case"doc-read":d(b,f(a.path),"opened");break;case"saved":d(b,c((0,h.hy)(a.entryId,g),"memory",m(a.text,40),a.text),"saved")}})}for(let[a,c]of b)"candidate"===c.kind&&b.has(`${c.from}\u0000${c.to}\u0000opened`)&&b.delete(a);return{nodes:[...a.values()],edges:[...b.values()]}}}function p(a,b){for(let c of b){let b=a.find(a=>a.id===c.id);b?!b.preview&&c.preview&&(b.preview=c.preview):a.push({...c})}}function q(a){return a.replace(/\/+$/,"").split("/").filter(Boolean).slice(-2).join("/")||a}d()}catch(a){d(a)}})},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47043:a=>{a.exports=import("@oh-my-pi/omp-stats/db")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},57588:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/regex")},58093:(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(92784),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/memory-trace/route",pathname:"/api/sessions/[id]/memory-trace",filename:"route",bundlePath:"app/api/sessions/[id]/memory-trace/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/sessions/[id]/memory-trace/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/sessions/[id]/memory-trace/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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64978:a=>{a.exports=import("bun:sqlite")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77037:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/session-dump-format")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},83881:(a,b,c)=>{function d(a){return`request:${a}`}function e(a){return`memory:${a}`}function f(a){return`doc:${a}`}function g(a){return`file:${a}`}function h(a,b){return`saved:${a}:${b}`}c.d(b,{WN:()=>g,cz:()=>f,dX:()=>d,hy:()=>h,zY:()=>e})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},92784:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,dynamic:()=>o,runtime:()=>n});var e=c(73024),f=c(80481),g=c(23211),h=c(37925),i=c(29959),j=c(66544),k=c(40402),l=a([h,i,k]);[h,i,k]=l.then?(await l)():l;let n="nodejs",o="force-dynamic";async function m(a,{params:b}){if(!(0,j.EN)(a))return g.NextResponse.json({error:"Untrusted API request"},{status:403});let{id:c}=await b;try{let b=await (0,k.os)(c);if(!b)return g.NextResponse.json({error:"Session not found"},{status:404});let d=new h.I2(c),i=(0,e.createReadStream)(b,{encoding:"utf8"}),j=(0,f.createInterface)({input:i,crlfDelay:1/0});try{for await(let b of j){if(a.signal.aborted)return new Response(null,{status:499});b&&d.push(b)}}finally{j.close(),i.destroy()}return g.NextResponse.json(d.finish(),{headers:{"Cache-Control":"no-store"}})}catch(a){return g.NextResponse.json({error:(0,i.LV)(a)},{status:500})}}d()}catch(a){d(a)}})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5948,402,3229,5738,2240,8116],()=>b(b.s=58093));module.exports=c})();
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=1881,a.ids=[1881],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")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},82371:(a,b,c)=>{"use strict";c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.162")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90103:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>aa,patchFetch:()=>_,routeModule:()=>X,serverHooks:()=>$,workAsyncStorage:()=>Y,workUnitAsyncStorage:()=>Z});var d={};c.r(d),c.d(d,{GET:()=>V,POST:()=>W,dynamic:()=>R});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(23211),w=c(66544),x=c(31421),y=c(73024),z=c(48161),A=c(76760),B=c(82371);let C=["done","handed-off","restart-required","failed"];function D(a){return C.includes(a)}let E="job.json",F="update.lock",G="update.log";function H(a=process.env){let b=a.CUELO_SELF_UPDATE_DIR?.trim();return b?(0,A.resolve)(b):(0,A.join)((0,z.homedir)(),".cuelo","self-update")}function I(a){let b=(0,A.resolve)(process.cwd());return(0,y.existsSync)((0,A.join)(b,"package.json"))?b:(0,A.resolve)(a.CUELO_DIR?.trim()||b)}function J(a=process.env){let b="";try{b=(0,y.readFileSync)("/proc/self/cgroup","utf8")}catch{}return function(a){let b=a.exists??y.existsSync,c=(0,A.join)(a.homeDir,"cuelo-run"),d=(0,A.join)(c,"Tools","CUELO_Setup","wsl","update.sh"),e=/(?:^|\/)cuelo-\d+\.service(?:\/|$)/m.test(a.cgroupText);if(/(?:^|\/)cuelo\.service(?:\/|$)/m.test(a.cgroupText)&&"/data/cuelo/app"===(0,A.resolve)(a.appRoot)&&b("/etc/cuelo/cloud-update-enabled"))return{mode:"cloud",supported:!0,reason:null};if(e&&(0,A.resolve)(a.appRoot)===(0,A.resolve)(c)&&b(d))return{mode:"wsl",supported:!0,reason:null};let f=a.distDir?.trim()||".next",g=b((0,A.join)(a.appRoot,f,"BUILD_ID"));return b((0,A.join)(a.appRoot,".git"))&&b((0,A.join)(a.appRoot,"bun.lock"))&&b((0,A.join)(a.appRoot,"app","layout.tsx"))?g?{mode:"source",supported:!0,reason:null}:{mode:"source",supported:!1,reason:"this source checkout has no production build; it is a development server, so its dist dir must not be rebuilt under it"}:g&&b((0,A.join)(a.appRoot,"install.mjs"))&&"cuelo"===(0,A.basename)(a.appRoot)&&"cuelo"===function(a){try{let b=JSON.parse((0,y.readFileSync)((0,A.join)(a,"package.json"),"utf8"));return"string"==typeof b.name?b.name:null}catch{return null}}(a.appRoot)?{mode:"npm",supported:!0,reason:null}:{mode:null,supported:!1,reason:e?`the systemd unit was found but this server does not run from ${c}`:"this CUELO install was not recognised (no production build of a source checkout or npm package, and no WSL service tree)"}}({appRoot:I(a),homeDir:a.HOME?.trim()||(0,z.homedir)(),cgroupText:b,distDir:a.CUELO_DIST_DIR})}function K(a){if(!Number.isInteger(a)||a<=0)return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code}}function L(a){try{return JSON.parse((0,y.readFileSync)(a,"utf8"))}catch{return null}}function M(a,b){let c=((0,x.spawnSync)("systemctl",["--user","is-active",a],{encoding:"utf8",timeout:3e3}).stdout??"").trim();if(c)return"active"===c||"activating"===c||"reloading"===c||"deactivating"===c;let d=Date.parse(b);return Number.isFinite(d)&&Date.now()-d<18e5}function N(a,b=K,c=M){let d=function(a){if(!a||"object"!=typeof a)return null;let b="string"==typeof a.phase?a.phase:"",c="npm"===a.mode||"source"===a.mode||"wsl"===a.mode||"cloud"===a.mode?a.mode:null;return b&&c?{schemaVersion:1,mode:c,phase:b,currentVersion:"string"==typeof a.currentVersion?a.currentVersion:"unknown",targetVersion:"string"==typeof a.targetVersion?a.targetVersion:"unknown",targetRef:"string"==typeof a.targetRef?a.targetRef:null,pid:"number"==typeof a.pid?a.pid:null,supervisorPid:"number"==typeof a.supervisorPid?a.supervisorPid:null,relaunchedPid:"number"==typeof a.relaunchedPid?a.relaunchedPid:null,startedAt:"string"==typeof a.startedAt?a.startedAt:new Date(0).toISOString(),updatedAt:"string"==typeof a.updatedAt?a.updatedAt:new Date(0).toISOString(),error:"string"==typeof a.error?a.error:null,logPath:"string"==typeof a.logPath?a.logPath:(0,A.join)(H(),G)}:null}(L((0,A.join)(a,E)));if(!d)return{job:null,running:!1};if("cloud"===d.mode&&!D(d.phase)||"cloud"===d.mode&&"handed-off"===d.phase)return{job:d,running:["active","activating","deactivating"].includes(((0,x.spawnSync)("systemctl",["is-active","cuelo-cloud-update.service"],{encoding:"utf8",timeout:3e3}).stdout??"").trim())||Date.now()-Date.parse(d.updatedAt)<6e4};if("handed-off"===d.phase)return{job:d,running:!!d.targetRef&&c(d.targetRef,d.updatedAt)};if(D(d.phase))return{job:d,running:!1};let e=L((0,A.join)(a,F)),f="number"==typeof e?.pid?e.pid:d.pid;return{job:d,running:null!==f&&b(f)}}function O(a=H()){let{job:b,running:c}=N(a);return{job:b,running:c,mode:J(),runningVersion:(0,B.Bp)("0.10.162")??"unknown"}}function P(a,b){let c=a.lastIndexOf(b),d=c>=0?a[c+1]:void 0;return d&&!d.startsWith("--")?d:null}async function Q(a={}){let b,c,d=a.env??process.env,e=a.dir??H(d),f=a.mode??J(d);if(!f.supported||!f.mode)return{state:"unsupported",mode:f};let g=f.mode;(0,y.mkdirSync)(e,{recursive:!0});let h=N(e,K,a.unitRunning);if(h.running&&h.job)return{state:"running",job:h.job};if(!function(a,b){if(N(a,K,b).running)return;let c=(0,A.join)(a,F),d=L(c);if(d&&"number"==typeof d.pid){if(d.pid===process.pid||K(d.pid))return}else if(Date.now()-((0,y.statSync)(c,{throwIfNoEntry:!1})?.mtimeMs??0)<6e5)return;(0,y.rmSync)(c,{force:!0})}(e,a.unitRunning),"cloud"===g){let a=new Date().toISOString(),b={schemaVersion:1,mode:"cloud",phase:"handed-off",currentVersion:d.NEXT_PUBLIC_APP_VERSION??"unknown",targetVersion:"latest",targetRef:"cuelo-cloud-update.service",pid:null,supervisorPid:null,relaunchedPid:null,startedAt:a,updatedAt:a,error:null,logPath:(0,A.join)(e,G)};return(0,y.writeFileSync)((0,A.join)(e,E),`${JSON.stringify(b)}
1
+ (()=>{var a={};a.id=1881,a.ids=[1881],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")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},82371:(a,b,c)=>{"use strict";c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.164")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90103:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>aa,patchFetch:()=>_,routeModule:()=>X,serverHooks:()=>$,workAsyncStorage:()=>Y,workUnitAsyncStorage:()=>Z});var d={};c.r(d),c.d(d,{GET:()=>V,POST:()=>W,dynamic:()=>R});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(23211),w=c(66544),x=c(31421),y=c(73024),z=c(48161),A=c(76760),B=c(82371);let C=["done","handed-off","restart-required","failed"];function D(a){return C.includes(a)}let E="job.json",F="update.lock",G="update.log";function H(a=process.env){let b=a.CUELO_SELF_UPDATE_DIR?.trim();return b?(0,A.resolve)(b):(0,A.join)((0,z.homedir)(),".cuelo","self-update")}function I(a){let b=(0,A.resolve)(process.cwd());return(0,y.existsSync)((0,A.join)(b,"package.json"))?b:(0,A.resolve)(a.CUELO_DIR?.trim()||b)}function J(a=process.env){let b="";try{b=(0,y.readFileSync)("/proc/self/cgroup","utf8")}catch{}return function(a){let b=a.exists??y.existsSync,c=(0,A.join)(a.homeDir,"cuelo-run"),d=(0,A.join)(c,"Tools","CUELO_Setup","wsl","update.sh"),e=/(?:^|\/)cuelo-\d+\.service(?:\/|$)/m.test(a.cgroupText);if(/(?:^|\/)cuelo\.service(?:\/|$)/m.test(a.cgroupText)&&"/data/cuelo/app"===(0,A.resolve)(a.appRoot)&&b("/etc/cuelo/cloud-update-enabled"))return{mode:"cloud",supported:!0,reason:null};if(e&&(0,A.resolve)(a.appRoot)===(0,A.resolve)(c)&&b(d))return{mode:"wsl",supported:!0,reason:null};let f=a.distDir?.trim()||".next",g=b((0,A.join)(a.appRoot,f,"BUILD_ID"));return b((0,A.join)(a.appRoot,".git"))&&b((0,A.join)(a.appRoot,"bun.lock"))&&b((0,A.join)(a.appRoot,"app","layout.tsx"))?g?{mode:"source",supported:!0,reason:null}:{mode:"source",supported:!1,reason:"this source checkout has no production build; it is a development server, so its dist dir must not be rebuilt under it"}:g&&b((0,A.join)(a.appRoot,"install.mjs"))&&"cuelo"===(0,A.basename)(a.appRoot)&&"cuelo"===function(a){try{let b=JSON.parse((0,y.readFileSync)((0,A.join)(a,"package.json"),"utf8"));return"string"==typeof b.name?b.name:null}catch{return null}}(a.appRoot)?{mode:"npm",supported:!0,reason:null}:{mode:null,supported:!1,reason:e?`the systemd unit was found but this server does not run from ${c}`:"this CUELO install was not recognised (no production build of a source checkout or npm package, and no WSL service tree)"}}({appRoot:I(a),homeDir:a.HOME?.trim()||(0,z.homedir)(),cgroupText:b,distDir:a.CUELO_DIST_DIR})}function K(a){if(!Number.isInteger(a)||a<=0)return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code}}function L(a){try{return JSON.parse((0,y.readFileSync)(a,"utf8"))}catch{return null}}function M(a,b){let c=((0,x.spawnSync)("systemctl",["--user","is-active",a],{encoding:"utf8",timeout:3e3}).stdout??"").trim();if(c)return"active"===c||"activating"===c||"reloading"===c||"deactivating"===c;let d=Date.parse(b);return Number.isFinite(d)&&Date.now()-d<18e5}function N(a,b=K,c=M){let d=function(a){if(!a||"object"!=typeof a)return null;let b="string"==typeof a.phase?a.phase:"",c="npm"===a.mode||"source"===a.mode||"wsl"===a.mode||"cloud"===a.mode?a.mode:null;return b&&c?{schemaVersion:1,mode:c,phase:b,currentVersion:"string"==typeof a.currentVersion?a.currentVersion:"unknown",targetVersion:"string"==typeof a.targetVersion?a.targetVersion:"unknown",targetRef:"string"==typeof a.targetRef?a.targetRef:null,pid:"number"==typeof a.pid?a.pid:null,supervisorPid:"number"==typeof a.supervisorPid?a.supervisorPid:null,relaunchedPid:"number"==typeof a.relaunchedPid?a.relaunchedPid:null,startedAt:"string"==typeof a.startedAt?a.startedAt:new Date(0).toISOString(),updatedAt:"string"==typeof a.updatedAt?a.updatedAt:new Date(0).toISOString(),error:"string"==typeof a.error?a.error:null,logPath:"string"==typeof a.logPath?a.logPath:(0,A.join)(H(),G)}:null}(L((0,A.join)(a,E)));if(!d)return{job:null,running:!1};if("cloud"===d.mode&&!D(d.phase)||"cloud"===d.mode&&"handed-off"===d.phase)return{job:d,running:["active","activating","deactivating"].includes(((0,x.spawnSync)("systemctl",["is-active","cuelo-cloud-update.service"],{encoding:"utf8",timeout:3e3}).stdout??"").trim())||Date.now()-Date.parse(d.updatedAt)<6e4};if("handed-off"===d.phase)return{job:d,running:!!d.targetRef&&c(d.targetRef,d.updatedAt)};if(D(d.phase))return{job:d,running:!1};let e=L((0,A.join)(a,F)),f="number"==typeof e?.pid?e.pid:d.pid;return{job:d,running:null!==f&&b(f)}}function O(a=H()){let{job:b,running:c}=N(a);return{job:b,running:c,mode:J(),runningVersion:(0,B.Bp)("0.10.164")??"unknown"}}function P(a,b){let c=a.lastIndexOf(b),d=c>=0?a[c+1]:void 0;return d&&!d.startsWith("--")?d:null}async function Q(a={}){let b,c,d=a.env??process.env,e=a.dir??H(d),f=a.mode??J(d);if(!f.supported||!f.mode)return{state:"unsupported",mode:f};let g=f.mode;(0,y.mkdirSync)(e,{recursive:!0});let h=N(e,K,a.unitRunning);if(h.running&&h.job)return{state:"running",job:h.job};if(!function(a,b){if(N(a,K,b).running)return;let c=(0,A.join)(a,F),d=L(c);if(d&&"number"==typeof d.pid){if(d.pid===process.pid||K(d.pid))return}else if(Date.now()-((0,y.statSync)(c,{throwIfNoEntry:!1})?.mtimeMs??0)<6e5)return;(0,y.rmSync)(c,{force:!0})}(e,a.unitRunning),"cloud"===g){let a=new Date().toISOString(),b={schemaVersion:1,mode:"cloud",phase:"handed-off",currentVersion:d.NEXT_PUBLIC_APP_VERSION??"unknown",targetVersion:"latest",targetRef:"cuelo-cloud-update.service",pid:null,supervisorPid:null,relaunchedPid:null,startedAt:a,updatedAt:a,error:null,logPath:(0,A.join)(e,G)};return(0,y.writeFileSync)((0,A.join)(e,E),`${JSON.stringify(b)}
2
2
  `),(0,y.writeFileSync)((0,A.join)(e,"cloud-request"),""),{state:"started",job:b}}let i=d.NEXT_PUBLIC_APP_VERSION??"";try{b=a.status?await a.status({currentAppVersion:i}):await (0,B.wt)()}catch(a){return{state:"error",error:a instanceof Error?a.message:String(a)}}if(!b.updateAvailable||!b.latestRelease)return{state:"up-to-date",currentVersion:b.currentAppVersion};let j=function(a){let b=(0,A.join)(a,F);try{let a=(0,y.openSync)(b,"wx");(0,y.writeFileSync)(a,JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()})),(0,y.closeSync)(a)}catch(a){if("EEXIST"!==a.code)throw a;return null}return()=>{(0,y.rmSync)(b,{force:!0})}}(e);if(!j){let b=N(e,K,a.unitRunning);return b.running&&b.job?{state:"running",job:b.job}:{state:"error",error:`another update holds ${(0,A.join)(e,F)}`}}let k=I(d),l="wsl"===g?null:function(a){let b=L((0,A.join)(a,"supervisor.json"));if(!b||"string"!=typeof b.command||!Array.isArray(b.args))return null;let c=b.args.filter(a=>"string"==typeof a);return"number"!=typeof b.pid||"string"!=typeof b.cwd?null:{schemaVersion:1,pid:b.pid,command:b.command,args:c,cwd:b.cwd}}(e),m=Number.parseInt(d.CUELO_SUPERVISOR_PID??"",10),n=null!==l&&Number.isInteger(m)&&l.pid===m?l:null,o=b.latestRelease.version,p=new Date().toISOString(),q={schemaVersion:1,mode:g,phase:"starting",currentVersion:b.currentAppVersion,targetVersion:o,targetRef:null,pid:null,supervisorPid:l?.pid??null,relaunchedPid:null,startedAt:p,updatedAt:p,error:null,logPath:(0,A.join)(e,G)};(0,y.writeFileSync)((0,A.join)(e,E),`${JSON.stringify(q,null,2)}
3
3
  `);let r={schemaVersion:1,mode:g,appRoot:k,selfUpdateDir:e,currentVersion:b.currentAppVersion,targetVersion:o,tagName:b.latestRelease.tagName,logPath:(0,A.join)(e,G),nodeBin:d.CUELO_SELF_UPDATE_NODE?.trim()||"node",distDir:d.CUELO_DIST_DIR?.trim()||null,npmBin:d.CUELO_NPM_BIN?.trim()||("win32"===process.platform?"npm.cmd":"npm"),home:(c=n?P(n.args,"--home"):null)?(0,A.isAbsolute)(c)?c:(0,A.resolve)(n?n.cwd:process.cwd(),c):null,webPort:Number.parseInt((n?P(n.args,"--port-base"):null)??d.PORT??"",10)||30141,supervisor:n,wsl:"wsl"===g?{script:(0,A.join)(d.HOME?.trim()||(0,z.homedir)(),"cuelo-run","Tools","CUELO_Setup","wsl","update.sh"),distro:d.WSL_DISTRO_NAME??null,port:Number.parseInt(d.PORT??"",10)||30141}:null},s=(0,A.join)(e,"plan.json");(0,y.writeFileSync)(s,`${JSON.stringify(r,null,2)}
4
4
  `);try{let b=(a.spawnWorker??((a,b)=>(function(a,b,c){let d=(0,A.join)(I(c),"bin","self-update.js"),e=(0,A.join)(b,"worker.js");(0,y.copyFileSync)(d,e);let f=c.CUELO_SELF_UPDATE_NODE?.trim()||"node",g=(0,y.openSync)((0,A.join)(b,G),"a");try{let d=(0,x.spawn)(f,[e,a],{cwd:I(c),detached:!0,stdio:["ignore",g,g],env:{...c,CUELO_SELF_UPDATE_DIR:b}});if(d.unref(),!d.pid)throw Error(`could not start ${f} ${e}`);return d.pid}finally{(0,y.closeSync)(g)}})(a,b,d)))(s,e),c={...q,pid:b,updatedAt:new Date().toISOString()};return(0,y.writeFileSync)((0,A.join)(e,E),`${JSON.stringify(c,null,2)}
@@ -1 +1 @@
1
- (()=>{var a={};a.id=5572,a.ids=[5572],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")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},74970:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z,dynamic:()=>y});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(23211),w=c(66544),x=c(82371);let y="force-dynamic";async function z(a){if(!(0,w.EN)(a))return v.NextResponse.json({error:"Untrusted API request"},{status:403});try{let a=await (0,x.wt)();return v.NextResponse.json(a,{headers:{"Cache-Control":"private, no-store"}})}catch(b){let a=b instanceof Error?b.message:String(b);return v.NextResponse.json({error:a||"Unable to check for updates"},{status:502})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/updates/route",pathname:"/api/updates",filename:"route",bundlePath:"app/api/updates/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/updates/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/updates/route";"/index"===d&&(d="/");let e=await A.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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||A.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===A.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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 A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await A.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},82371:(a,b,c)=>{"use strict";c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.162")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},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=74970));module.exports=c})();
1
+ (()=>{var a={};a.id=5572,a.ids=[5572],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")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},74970:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z,dynamic:()=>y});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(23211),w=c(66544),x=c(82371);let y="force-dynamic";async function z(a){if(!(0,w.EN)(a))return v.NextResponse.json({error:"Untrusted API request"},{status:403});try{let a=await (0,x.wt)();return v.NextResponse.json(a,{headers:{"Cache-Control":"private, no-store"}})}catch(b){let a=b instanceof Error?b.message:String(b);return v.NextResponse.json({error:a||"Unable to check for updates"},{status:502})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/updates/route",pathname:"/api/updates",filename:"route",bundlePath:"app/api/updates/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/updates/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/updates/route";"/index"===d&&(d="/");let e=await A.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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||A.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===A.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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 A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await A.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},82371:(a,b,c)=>{"use strict";c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.164")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},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=74970));module.exports=c})();
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var a={};a.id=3083,a.ids=[3083],a.modules={84:a=>{a.exports=import("@oh-my-pi/omp-stats/aggregator")},261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5018:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>o,dynamic:()=>s});var e=c(34069),f=c(23211),g=c(82371),h=c(66544),i=c(56429),j=c(40402),k=c(4157),l=c(66358),m=c(89102),n=a([e,i,j]);[e,i,j]=n.then?(await n)():n;let s="force-dynamic",t=a=>console.log(`[upkeep/morning] ${a}`);async function o(a){if(!(0,h.EN)(a))return t("rejected: untrusted request"),f.NextResponse.json({error:"Untrusted API request"},{status:403});let b=[];if((0,h.E2)(a))try{b=(0,m.nU)((await a.json())?.skills)}catch{return f.NextResponse.json({error:"Invalid JSON body"},{status:400})}if("1"===new URL(a.url).searchParams.get("dryRun"))return r(!0,b);if(globalThis.__cueloMorningInFlight)return t("skipped: in-progress"),f.NextResponse.json({action:"skipped",reason:"in-progress"});globalThis.__cueloMorningInFlight=!0;try{return await r(!1,b)}finally{globalThis.__cueloMorningInFlight=!1}}async function p(a){try{let a=await (0,g.wt)();return{current:a.currentAppVersion,latest:a.latestRelease?.version??null,available:a.updateAvailable}}catch(b){return a.push(`공개 릴리스를 확인하지 못했습니다(${b instanceof Error?b.message:String(b)}).`),null}}function q(a){let{cloudCommits:b,skills:c,release:d}=a.triggers;return`${b} cloud commit(s), ${c} skill(s), release ${d??"none"}`}async function r(a,b){let c,d,g,h,n=(0,e.getAgentDir)();try{d=(0,m.uA)(n);let a=new Date,e=(0,m.Am)(),f=[],g=e?(await (0,l.I)(n,e)).deployed:null,h=e?await (0,m.ny)(e,{reported:d?.reportedSha??null,deployed:g},a):null;h&&f.push(...h.warnings);let j=await p(f);c=(0,m.Hi)({repoCwd:e,originHead:h?.originHead??null,base:h?.base??null,cloudCommits:h?.commits??[],skills:b,release:j,state:d,runningSessionIds:(0,i.HG)(),acceptedSessionId:globalThis.__cueloMorningSessionId??null,now:a,warnings:f})}catch(a){return t(`failed to plan: ${a instanceof Error?a.message:String(a)}`),f.NextResponse.json({error:"Morning plan failed"},{status:500})}if("skip"===c.action)return t(`${a?"dry run ":""}skipped: ${c.reason}`),f.NextResponse.json({action:"skipped",reason:c.reason,...a?{dryRun:a}:{}});if(a)return t(`dry run: would start a report session in ${c.repoCwd} for ${q(c)}`),f.NextResponse.json({action:"planned",dryRun:a,plan:c});if((0,k.mN)())return t("skipped: update-draining"),f.NextResponse.json({action:"skipped",reason:"update-draining"});let o=!1;try{let a=await (0,i.Yq)(void 0,c.repoCwd);return g=a.session,h=a.realSessionId,await g.send({type:"set_session_name",name:c.sessionName}),(0,j.mD)(),await g.send({type:"prompt",message:c.prompt}),o=!0,globalThis.__cueloMorningSessionId=h,(0,m.bh)(n,(0,m.XW)(c,d,h,new Date().toISOString())),t(`started ${h} in ${c.repoCwd} for ${q(c)}`),f.NextResponse.json({action:"started",sessionId:h})}catch(b){let a=b instanceof Error?b.message:String(b);return g&&!o&&await g.shutdown().catch(()=>{}),t(`failed ${o?"to record an accepted run":"to start"}: ${a}`),f.NextResponse.json({error:a,...o?{accepted:o,sessionId:h}:{}},{status:500})}}d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9015:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/plugins/loader")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},21820:a=>{a.exports=require("os")},22127:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/memory-backend/redact")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28354:a=>{a.exports=require("util")},28518:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/utils")},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")},33374:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/patterns")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40253:(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(5018),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/upkeep/morning/route",pathname:"/api/upkeep/morning",filename:"route",bundlePath:"app/api/upkeep/morning/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/upkeep/morning/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/upkeep/morning/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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45511:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/helpers/parse")},47043:a=>{a.exports=import("@oh-my-pi/omp-stats/db")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},57588:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/regex")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},63833:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/capability")},64978:a=>{a.exports=import("bun:sqlite")},65209:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/capability/hook")},66358:(a,b,c)=>{c.d(b,{I:()=>k});var d=c(51455),e=c(76760),f=c(31421);let g=(0,c(57975).promisify)(f.execFile),h=["Tools/CUELO_Phone_Bridge/"];async function i(a,b,c){try{let{stdout:d}=await g("git",["-C",a,"diff","-z","--no-renames","--name-only",b,c],{timeout:1e4}),e=d.split("\0").filter(Boolean),f=e.filter(a=>!/(^|\/)doc\//.test(a)&&!/(^|\/)HANDOFF\.md$/.test(a)&&"Tools/OMP_Global_Config/memory-sync/memories.jsonl"!==a),i=f.filter(a=>!h.some(b=>a.startsWith(b)));return{pending:i,records:e.length-f.length,offPc:f.length-i.length}}catch{return null}}async function j(a,b){try{return await g("git",["-C",a,"cat-file","-e",`${b}^{commit}`],{timeout:1e4}),!0}catch{return!1}}async function k(a,b){let c=[],f=null,h=null;try{let b=(0,e.join)(a,"..","wsl-update");for(let a of(await (0,d.readdir)(b)).filter(a=>a.endsWith(".log")).sort().reverse()){let c=[...(await (0,d.readFile)((0,e.join)(b,a),"utf8")).matchAll(/\bREADY\s+([a-f0-9]{7,40})\b/gi)];if(c.length){f=c.at(-1)[1];break}}f||c.push("배포 READY 기록을 찾지 못했습니다.")}catch{c.push("배포 로그를 읽지 못했습니다.")}if(b)try{h=(await g("git",["-C",b,"log","-1","--format=%H"],{timeout:1e4})).stdout.trim()}catch{}h||c.push("저장소 HEAD를 확인하지 못했습니다.");let k=null,l=0,m=0;if(b&&h&&f){let a=h.toLowerCase().startsWith(f.toLowerCase())?{pending:[],records:0,offPc:0}:await i(b,f,h);a?{pending:k,records:l,offPc:m}=a:c.push(await j(b,f)?`배포 리비전 ${f.slice(0,12)}을 저장소 HEAD와 비교하지 못했습니다.`:`개발 사본에 배포 리비전 ${f.slice(0,12)}이 없어 HEAD와 비교하지 못했습니다. 다른 곳에서 게시\xb7배포한 커밋을 아직 받지 않았을 수 있습니다(git fetch).`)}let n=null;try{let a=await g("gh",["run","list","--repo","gim47656-ship-it/CUELO","--limit","1","--json","status,conclusion,headSha,createdAt,workflowName"],{timeout:1e4});n=JSON.parse(a.stdout)[0]??null}catch{}return n||c.push("공개 CI 상태를 확인하지 못했습니다."),{deployed:f,head:h,pending:k,records:l,offPc:m,ci:n,warnings:c}}},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},82371:(a,b,c)=>{c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.162")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},82640:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/discovery/omp-extension-roots")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},89102:(a,b,c)=>{c.d(b,{ny:()=>w,Am:()=>t,XW:()=>q,nU:()=>r,Hi:()=>s,uA:()=>o,bh:()=>p});var d=c(31421),e=c(73024),f=c(48161),g=c(76760),h=c(57975),i=c(8102);let j=(0,h.promisify)(d.execFile),k="cuelo-morning-report.json",l=/^[a-z0-9][a-z0-9._-]{0,99}$/,m=/^origin\/wt\/nightly-(\d{4})(\d{2})(\d{2})$/,n=/^[0-9a-f]{40}$/;function o(a){let b;try{b=(0,e.readFileSync)((0,g.join)(a,k),"utf8")}catch(a){if("ENOENT"===a.code)return null;throw a}let c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c)||"string"!=typeof c.sessionId||!c.sessionId||"string"!=typeof c.startedAt||Number.isNaN(Date.parse(c.startedAt))||void 0!==c.reportedSha&&("string"!=typeof c.reportedSha||!n.test(c.reportedSha))||void 0!==c.releaseVersion&&("string"!=typeof c.releaseVersion||!c.releaseVersion))throw Error(`${k} is not a morning report record`);return{sessionId:c.sessionId,startedAt:c.startedAt,...c.reportedSha?{reportedSha:c.reportedSha}:{},...c.releaseVersion?{releaseVersion:c.releaseVersion}:{}}}function p(a,b){(0,e.mkdirSync)(a,{recursive:!0}),(0,i.$)((0,g.join)(a,k),`${JSON.stringify(b,null,2)}
1
+ "use strict";(()=>{var a={};a.id=3083,a.ids=[3083],a.modules={84:a=>{a.exports=import("@oh-my-pi/omp-stats/aggregator")},261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1740:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/custom-tools")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3330:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/persisted-revive")},4327:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/system-prompt")},5018:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>o,dynamic:()=>s});var e=c(34069),f=c(23211),g=c(82371),h=c(66544),i=c(56429),j=c(40402),k=c(4157),l=c(66358),m=c(89102),n=a([e,i,j]);[e,i,j]=n.then?(await n)():n;let s="force-dynamic",t=a=>console.log(`[upkeep/morning] ${a}`);async function o(a){if(!(0,h.EN)(a))return t("rejected: untrusted request"),f.NextResponse.json({error:"Untrusted API request"},{status:403});let b=[];if((0,h.E2)(a))try{b=(0,m.nU)((await a.json())?.skills)}catch{return f.NextResponse.json({error:"Invalid JSON body"},{status:400})}if("1"===new URL(a.url).searchParams.get("dryRun"))return r(!0,b);if(globalThis.__cueloMorningInFlight)return t("skipped: in-progress"),f.NextResponse.json({action:"skipped",reason:"in-progress"});globalThis.__cueloMorningInFlight=!0;try{return await r(!1,b)}finally{globalThis.__cueloMorningInFlight=!1}}async function p(a){try{let a=await (0,g.wt)();return{current:a.currentAppVersion,latest:a.latestRelease?.version??null,available:a.updateAvailable}}catch(b){return a.push(`공개 릴리스를 확인하지 못했습니다(${b instanceof Error?b.message:String(b)}).`),null}}function q(a){let{cloudCommits:b,skills:c,release:d}=a.triggers;return`${b} cloud commit(s), ${c} skill(s), release ${d??"none"}`}async function r(a,b){let c,d,g,h,n=(0,e.getAgentDir)();try{d=(0,m.uA)(n);let a=new Date,e=(0,m.Am)(),f=[],g=e?(await (0,l.I)(n,e)).deployed:null,h=e?await (0,m.ny)(e,{reported:d?.reportedSha??null,deployed:g},a):null;h&&f.push(...h.warnings);let j=await p(f);c=(0,m.Hi)({repoCwd:e,originHead:h?.originHead??null,base:h?.base??null,cloudCommits:h?.commits??[],skills:b,release:j,state:d,runningSessionIds:(0,i.HG)(),acceptedSessionId:globalThis.__cueloMorningSessionId??null,now:a,warnings:f})}catch(a){return t(`failed to plan: ${a instanceof Error?a.message:String(a)}`),f.NextResponse.json({error:"Morning plan failed"},{status:500})}if("skip"===c.action)return t(`${a?"dry run ":""}skipped: ${c.reason}`),f.NextResponse.json({action:"skipped",reason:c.reason,...a?{dryRun:a}:{}});if(a)return t(`dry run: would start a report session in ${c.repoCwd} for ${q(c)}`),f.NextResponse.json({action:"planned",dryRun:a,plan:c});if((0,k.mN)())return t("skipped: update-draining"),f.NextResponse.json({action:"skipped",reason:"update-draining"});let o=!1;try{let a=await (0,i.Yq)(void 0,c.repoCwd);return g=a.session,h=a.realSessionId,await g.send({type:"set_session_name",name:c.sessionName}),(0,j.mD)(),await g.send({type:"prompt",message:c.prompt}),o=!0,globalThis.__cueloMorningSessionId=h,(0,m.bh)(n,(0,m.XW)(c,d,h,new Date().toISOString())),t(`started ${h} in ${c.repoCwd} for ${q(c)}`),f.NextResponse.json({action:"started",sessionId:h})}catch(b){let a=b instanceof Error?b.message:String(b);return g&&!o&&await g.shutdown().catch(()=>{}),t(`failed ${o?"to record an accepted run":"to start"}: ${a}`),f.NextResponse.json({error:a,...o?{accepted:o,sessionId:h}:{}},{status:500})}}d()}catch(a){d(a)}})},5969:a=>{a.exports=import("@oh-my-pi/pi-agent-core/compaction")},9015:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/plugins/loader")},9655:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/runtime-init")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14882:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/messages")},19819:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/goals/settings")},21820:a=>{a.exports=require("os")},22127:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/memory-backend/redact")},25167:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-mode")},26854:a=>{a.exports=import("@oh-my-pi/pi-tui")},28354:a=>{a.exports=require("util")},28518:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/utils")},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")},33374:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/patterns")},33594:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/available-commands")},33873:a=>{a.exports=require("path")},34069:a=>{a.exports=import("@oh-my-pi/pi-utils")},34722:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/task/settings")},40253:(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(5018),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/upkeep/morning/route",pathname:"/api/upkeep/morning",filename:"route",bundlePath:"app/api/upkeep/morning/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/CUELO/CUELO/app/api/upkeep/morning/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/upkeep/morning/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,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.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=`${O} ${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(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!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=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.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!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.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:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)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});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||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)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},40575:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/tools/todo")},43696:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/modes/rpc/rpc-subagents")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45511:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/helpers/parse")},47043:a=>{a.exports=import("@oh-my-pi/omp-stats/db")},48161:a=>{a.exports=require("node:os")},48331:a=>{a.exports=import("@oh-my-pi/pi-agent-core")},51455:a=>{a.exports=require("node:fs/promises")},53739:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/session/exit-diagnostics")},55511:a=>{a.exports=require("crypto")},57588:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/secrets/regex")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},58505:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config")},59895:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/builtin-registry")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63411:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-settings")},63833:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/capability")},64978:a=>{a.exports=import("bun:sqlite")},65209:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/capability/hook")},66358:(a,b,c)=>{c.d(b,{I:()=>k});var d=c(51455),e=c(76760),f=c(31421);let g=(0,c(57975).promisify)(f.execFile),h=["Tools/CUELO_Phone_Bridge/"];async function i(a,b,c){try{let{stdout:d}=await g("git",["-C",a,"diff","-z","--no-renames","--name-only",b,c],{timeout:1e4}),e=d.split("\0").filter(Boolean),f=e.filter(a=>!/(^|\/)doc\//.test(a)&&!/(^|\/)HANDOFF\.md$/.test(a)&&"Tools/OMP_Global_Config/memory-sync/memories.jsonl"!==a),i=f.filter(a=>!h.some(b=>a.startsWith(b)));return{pending:i,records:e.length-f.length,offPc:f.length-i.length}}catch{return null}}async function j(a,b){try{return await g("git",["-C",a,"cat-file","-e",`${b}^{commit}`],{timeout:1e4}),!0}catch{return!1}}async function k(a,b){let c=[],f=null,h=null;try{let b=(0,e.join)(a,"..","wsl-update");for(let a of(await (0,d.readdir)(b)).filter(a=>a.endsWith(".log")).sort().reverse()){let c=[...(await (0,d.readFile)((0,e.join)(b,a),"utf8")).matchAll(/\bREADY\s+([a-f0-9]{7,40})\b/gi)];if(c.length){f=c.at(-1)[1];break}}f||c.push("배포 READY 기록을 찾지 못했습니다.")}catch{c.push("배포 로그를 읽지 못했습니다.")}if(b)try{h=(await g("git",["-C",b,"log","-1","--format=%H"],{timeout:1e4})).stdout.trim()}catch{}h||c.push("저장소 HEAD를 확인하지 못했습니다.");let k=null,l=0,m=0;if(b&&h&&f){let a=h.toLowerCase().startsWith(f.toLowerCase())?{pending:[],records:0,offPc:0}:await i(b,f,h);a?{pending:k,records:l,offPc:m}=a:c.push(await j(b,f)?`배포 리비전 ${f.slice(0,12)}을 저장소 HEAD와 비교하지 못했습니다.`:`개발 사본에 배포 리비전 ${f.slice(0,12)}이 없어 HEAD와 비교하지 못했습니다. 다른 곳에서 게시\xb7배포한 커밋을 아직 받지 않았을 수 있습니다(git fetch).`)}let n=null;try{let a=await g("gh",["run","list","--repo","gim47656-ship-it/CUELO","--limit","1","--json","status,conclusion,headSha,createdAt,workflowName"],{timeout:1e4});n=JSON.parse(a.stdout)[0]??null}catch{}return n||c.push("공개 CI 상태를 확인하지 못했습니다."),{deployed:f,head:h,pending:k,records:l,offPc:m,ci:n,warnings:c}}},66544:(a,b,c)=>{c.d(b,{E2:()=>k,EN:()=>j,e9:()=>i});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(){return[process.env.CUELO_HOSTNAME,...process.env.CUELO_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function h(a){try{return new URL(a).origin}catch{return null}}function i(a,b=g()){let c=a.headers.get("host"),h=c?f(c):null;return!!h&&(!!("localhost"===h||h.endsWith(".localhost")||(0,d.isIP)(h))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===h}))}function j(a,b=g()){return!!i(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!d)return!0;let e=(b=new URL(a.url),(c=a.headers.get("host"))?h(`${b.protocol}//${c}`):null);return null!==e&&h(d)===e}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73079:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-roles")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78310:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-registry")},78772:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/extensibility/settings")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},82371:(a,b,c)=>{c.d(b,{Bp:()=>f,wt:()=>h});let d="https://github.com/gim47656-ship-it/CUELO/releases";function e(a){let b=String(a??"").trim().replace(/^[^0-9]*/,""),c=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(b);return c?{major:Number(c[1]),minor:Number(c[2]),patch:Number(c[3]),prerelease:c[4]?c[4].split("."):null}:null}function f(a){let b=e(a);if(!b)return null;let c=`${b.major}.${b.minor}.${b.patch}`;return b.prerelease?`${c}-${b.prerelease.join(".")}`:c}async function g(a){let b=new AbortController,c=setTimeout(()=>b.abort(),12e3);try{let c=await a("https://api.github.com/repos/gim47656-ship-it/CUELO/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":"cuelo-update-check"},signal:b.signal,next:{revalidate:3600}});if(404===c.status)return null;if(!c.ok)throw Error(`Update source returned HTTP ${c.status}`);return await c.json()}finally{clearTimeout(c)}}async function h(a={}){var b;let c=a.fetcher??fetch,i=f(a.currentAppVersion??"0.10.164")??"unknown",j=await g(c),k=j?function(a){let b=f(a.tag_name);if(!b)throw Error("The CUELO release did not contain a valid version tag");let c="string"==typeof a.tag_name&&a.tag_name.trim()?a.tag_name.trim():`v${b}`,e="string"==typeof a.html_url&&a.html_url.startsWith(`${d}/`)?a.html_url:`${d}/tag/${encodeURIComponent(c)}`,g="string"==typeof a.body?a.body.slice(0,4e4):"";return{version:b,tagName:c,name:"string"==typeof a.name&&a.name.trim()?a.name.trim():c,body:g,htmlUrl:e,publishedAt:"string"==typeof a.published_at?a.published_at:null}}(j):null;return{currentAppVersion:i,latestRelease:k,updateAvailable:(b=k?.version??null,!!(b&&i&&function(a,b){let c=e(a),d=e(b);if(!c||!d)return 0;for(let a of["major","minor","patch"])if(c[a]!==d[a])return c[a]>d[a]?1:-1;if(!c.prerelease&&!d.prerelease)return 0;if(!c.prerelease)return 1;if(!d.prerelease)return -1;let f=Math.max(c.prerelease.length,d.prerelease.length);for(let a=0;a<f;a+=1){let b=c.prerelease[a],e=d.prerelease[a];if(void 0===b)return -1;if(void 0===e)return 1;if(b===e)continue;let f=/^\d+$/.test(b),g=/^\d+$/.test(e);if(f&&g){let a=Number(b),c=Number(e);if(a!==c)return a>c?1:-1;continue}if(f!==g)return f?-1:1;return b>e?1:-1}return 0}(b,i)>0)),checkedAt:new Date().toISOString()}}},82512:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/plan-mode/plan-files")},82640:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/discovery/omp-extension-roots")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88692:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/config/model-resolver")},89102:(a,b,c)=>{c.d(b,{ny:()=>w,Am:()=>t,XW:()=>q,nU:()=>r,Hi:()=>s,uA:()=>o,bh:()=>p});var d=c(31421),e=c(73024),f=c(48161),g=c(76760),h=c(57975),i=c(8102);let j=(0,h.promisify)(d.execFile),k="cuelo-morning-report.json",l=/^[a-z0-9][a-z0-9._-]{0,99}$/,m=/^origin\/wt\/nightly-(\d{4})(\d{2})(\d{2})$/,n=/^[0-9a-f]{40}$/;function o(a){let b;try{b=(0,e.readFileSync)((0,g.join)(a,k),"utf8")}catch(a){if("ENOENT"===a.code)return null;throw a}let c=JSON.parse(b);if(!c||"object"!=typeof c||Array.isArray(c)||"string"!=typeof c.sessionId||!c.sessionId||"string"!=typeof c.startedAt||Number.isNaN(Date.parse(c.startedAt))||void 0!==c.reportedSha&&("string"!=typeof c.reportedSha||!n.test(c.reportedSha))||void 0!==c.releaseVersion&&("string"!=typeof c.releaseVersion||!c.releaseVersion))throw Error(`${k} is not a morning report record`);return{sessionId:c.sessionId,startedAt:c.startedAt,...c.reportedSha?{reportedSha:c.reportedSha}:{},...c.releaseVersion?{releaseVersion:c.releaseVersion}:{}}}function p(a,b){(0,e.mkdirSync)(a,{recursive:!0}),(0,i.$)((0,g.join)(a,k),`${JSON.stringify(b,null,2)}
2
2
  `)}function q(a,b,c,d){let e=a.reportedSha??b?.reportedSha,f=a.releaseVersion??b?.releaseVersion;return{sessionId:c,startedAt:d,...e?{reportedSha:e}:{},...f?{releaseVersion:f}:{}}}function r(a){return Array.isArray(a)?[...new Set(a.filter(a=>"string"==typeof a&&l.test(a)))]:[]}function s(a){let{state:b,release:c,skills:d,cloudCommits:e}=a,f=c?.available&&c.latest&&c.latest!==b?.releaseVersion?c.latest:null;return e.length||d.length||f?a.repoCwd?[b?.sessionId,a.acceptedSessionId].some(b=>b&&a.runningSessionIds.includes(b))?{action:"skip",reason:"previous-still-running"}:{action:"run",repoCwd:a.repoCwd,triggers:{cloudCommits:e.length,skills:d.length,release:f},reportedSha:a.originHead,releaseVersion:c?.latest??null,sessionName:`클라우드 변경 보고 ${new Date(a.now.getTime()+324e5).toISOString().slice(0,16).replace("T"," ")}`,prompt:function(a){let{release:b}=a,c=b?b.available&&b.latest?`- 새 버전 있음: 실행 중 ${b.current}, 최신 공개 릴리스 ${b.latest}.`:`- 새 버전 없음: 실행 중 ${b.current}, 최신 공개 릴리스 ${b.latest??"없음"}. 단, origin/main의 package.json 버전이 이보다 높으면 공개 CI가 아직 끝나지 않은 것이니 설치하지 않고 마지막 줄을 「새 버전 <그 버전> 준비 중, 다음 동기화 때 설치」로 씁니다. 그 버전에 들어간 변경을 "설치된 뒤 확인"하라고 쓸 때도 이 말과 맞춥니다.`:"- 공개 릴리스를 확인하지 못했습니다. `gh release view --repo gim47656-ship-it/CUELO`로 직접 보고, 실행 중 버전보다 높을 때만 위 2번을 따릅니다.",d=a.base?.kind==="reported"?`지난 보고 때 본 origin/main ${a.base.sha} 뒤`:a.base?`지난 보고 기록이 없어 이 PC에 배포한 ${a.base.sha} 뒤`:"비교할 기준이 없어 최근 며칠",e=a.cloudCommits.length?a.cloudCommits.map(a=>`- ${a.sha.slice(0,12)} ${a.committedAt} ${a.subject}${a.records.length?` (기록: ${a.records.join(", ")})`:""}`):["- 없음"];return['CUELO 클라우드 변경 보고 세션\n\n이 세션은 사람 없이 이 PC의 클라우드 동기화가 열었습니다. 아래 두 가지만 하고 다른 일은 하지 않습니다. `ask`는 쓰지 않습니다(답할 사람이 없습니다).\n마지막 답은 보고와 설치 결과를 합쳐 세 줄 이내의 쉬운 한국어입니다. 목록\xb7제목 없이 짧은 문장으로만 쓰고, 커밋 해시와 전문용어는 뺍니다.\n\n1. 보고: `git fetch --prune` 뒤 아래 커밋과 작업 기록, 받아 온 스킬을 읽고 클라우드가 무엇을 바꿨는지 씁니다. 사용자에게 생기는 효과를 먼저, 그다음 받아 온 스킬, 사용자가 정해야 할 일이 있으면 그것을 씁니다.\n2. 설치: 아래 「릴리스」에 새 버전이 있다고 적혀 있을 때만 합니다. 그 버전의 공개 CI(`gh run list --repo gim47656-ship-it/CUELO`)가 성공했는지 먼저 확인하고, 실패\xb7미확인이면 설치하지 않습니다. 설치는 메인 체크아웃이 아니라 origin에서 받으므로 메인 체크아웃의 브랜치\xb7고친 파일\xb7다른 세션의 작업과 상관없이 진행합니다. 그 버전이 처음 들어간 origin/main 커밋을 `git log origin/main --reverse --format=%H -S\'"version": "<버전>"\' -- package.json | head -1`로 찾고, AGENTS.md 「Live deploy」의 이 PC 배포 명령에 그 커밋과 이 세션 자신의 id(`$PI_SESSION_ID`)를 넣어 실행한 뒤 `deploy_verify`로 끝났는지 확인합니다. 서버가 다시 시작되는 동안 이 세션은 멈췄다가 깨어나니 깨어난 뒤 확인을 이어 갑니다. 메인 체크아웃은 그다음에 `main` 브랜치이고 갈라진 이력이 없을 때만 `git pull --ff-only`로 따라가게 합니다. git이 고친 파일과 겹친다며 거절하거나 조건이 맞지 않으면 그 단계만 건너뛰고 파일은 건드리지 않습니다(reset\xb7stash\xb7checkout 금지). 이것은 설치 결과에 영향을 주지 않습니다.\n세 줄 가운데 마지막 줄은 설치 결과(설치한 버전, 설치하지 않은 이유, 「설치할 새 버전 없음」, 또는 「새 버전 준비 중, 다음 동기화 때 설치」)입니다.',"",`## 클라우드 야간 커밋 (${d}, 지금 origin/main ${a.originHead??"확인 못 함"})`,"",...e,"","## 이번 동기화로 받아 온 스킬 (~/.omp/agent/managed-skills)","",...a.skills.length?a.skills.map(a=>`- ${a}`):["- 없음"],"","## 릴리스","",c,...a.warnings.length?["","## 확인하지 못한 것","",...a.warnings.map(a=>`- ${a}`)]:[]].join("\n")}({base:a.base,originHead:a.originHead,cloudCommits:e,skills:d,release:c,warnings:a.warnings??[]})}:{action:"skip",reason:"no-repo"}:{action:"skip",reason:"nothing-new"}}function t(a=process.env){let b=a.CUELO_MORNING_REPO||(0,g.join)((0,f.homedir)(),"src/CUELO-private");try{return(0,e.statSync)((0,g.join)(b,".git")).isDirectory()&&(0,e.existsSync)((0,g.join)(b,"HANDOFF.md"))?b:null}catch{return null}}async function u(a,b,c=15e3){return(await j("git",["-C",a,...b],{timeout:c,maxBuffer:8388608})).stdout}async function v(a,b){try{return await u(a,["cat-file","-e",`${b}^{commit}`]),!0}catch{return!1}}async function w(a,b,c){let d=[];try{await u(a,["fetch","--prune","--quiet","origin"],12e4)}catch{d.push("git fetch origin에 실패해 이미 받아 둔 참조로 봤습니다.")}let e=null;try{e=(await u(a,["rev-parse","--verify","origin/main^{commit}"])).trim()||null}catch{return d.push("origin/main을 찾지 못했습니다."),{originHead:e,base:null,commits:[],warnings:d}}let f=null;b.reported&&await v(a,b.reported)?f={sha:b.reported,kind:"reported"}:(b.reported&&d.push(`지난 보고 커밋 ${b.reported.slice(0,12)}을 이 저장소에서 찾지 못했습니다.`),b.deployed&&await v(a,b.deployed)?f={sha:b.deployed,kind:"deployed"}:d.push("비교할 기준 커밋이 없어 최근 3일의 야간 실행만 봤습니다."));let g=f?.sha??null,h=(await u(a,["for-each-ref","--format=%(refname:short)","refs/remotes/origin/wt/"])).split("\n").map(a=>a.trim()).filter(a=>m.test(a)),i=new Map;for(let b of h){let[,d,e,f]=m.exec(b),h=Date.parse(`${d}-${e}-${f}T03:00:00+09:00`);if(!(!g&&c.getTime()-h>2592e5)){try{await u(a,["merge-base","--is-ancestor",b,"origin/main"])}catch{continue}for(let c of(await u(a,["log",b,...g?[`^${g}`]:[],"--name-only","--format=%x1e%H%x1f%cI%x1f%s"])).split("\x1e").slice(1)){let[a,...b]=c.split("\n"),[d,e,f]=a.split("\x1f");!(!d||i.has(d))&&Date.parse(e)>=h&&i.set(d,{sha:d,committedAt:e,subject:f??"",records:b.filter(a=>/^doc\/history\/.+\.md$/.test(a))})}}}return{originHead:e,base:f,commits:[...i.values()].sort((a,b)=>Date.parse(a.committedAt)-Date.parse(b.committedAt)),warnings:d}}},90431:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/async/job-manager")},92582:a=>{a.exports=import("@oh-my-pi/pi-coding-agent")},94285:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/slash-commands/acp-builtins")},94374:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/capability/extension-module")},96175:a=>{a.exports=import("@oh-my-pi/pi-coding-agent/registry/agent-lifecycle")},96282:a=>{a.exports=import("@oh-my-pi/pi-tui/overlays/model-selector")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5948,402,3229,5738,2240,4468,7015,6429],()=>b(b.s=40253));module.exports=c})();