cursor-local-remote 0.1.0 → 0.1.2

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 (30) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -1
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +23 -23
  5. package/.next/required-server-files.json +1 -1
  6. package/.next/server/app/_not-found.html +1 -1
  7. package/.next/server/app/_not-found.rsc +1 -1
  8. package/.next/server/app/api/chat/route.js +7 -5
  9. package/.next/server/app/api/chat/route.js.nft.json +1 -1
  10. package/.next/server/app/api/push/subscribe/route.js +7 -5
  11. package/.next/server/app/api/push/subscribe/route.js.nft.json +1 -1
  12. package/.next/server/app/api/push/vapid-key/route.js +7 -5
  13. package/.next/server/app/api/push/vapid-key/route.js.nft.json +1 -1
  14. package/.next/server/app/api/sessions/route.js +7 -5
  15. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  16. package/.next/server/app/index.html +1 -1
  17. package/.next/server/app/index.rsc +1 -1
  18. package/.next/server/app-paths-manifest.json +1 -1
  19. package/.next/server/chunks/369.js +7 -5
  20. package/.next/server/chunks/519.js +7 -5
  21. package/.next/server/instrumentation.js +1 -1
  22. package/.next/server/instrumentation.js.nft.json +1 -1
  23. package/.next/server/middleware-manifest.json +1 -1
  24. package/.next/server/pages/404.html +1 -1
  25. package/.next/server/pages/500.html +1 -1
  26. package/bin/cursor-remote.mjs +3 -3
  27. package/next.config.ts +1 -1
  28. package/package.json +3 -3
  29. /package/.next/static/{qH3fSSOUNLq_-dFHc2iUI → RTQ1HYVu3tm_I6QSHC2Kq}/_buildManifest.js +0 -0
  30. /package/.next/static/{qH3fSSOUNLq_-dFHc2iUI → RTQ1HYVu3tm_I6QSHC2Kq}/_ssgManifest.js +0 -0
package/.next/BUILD_ID CHANGED
@@ -1 +1 @@
1
- qH3fSSOUNLq_-dFHc2iUI
1
+ RTQ1HYVu3tm_I6QSHC2Kq
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "/_not-found/page": "/_not-found",
3
3
  "/apple-icon.png/route": "/apple-icon.png",
4
- "/manifest.webmanifest/route": "/manifest.webmanifest",
5
4
  "/icon.png/route": "/icon.png",
5
+ "/manifest.webmanifest/route": "/manifest.webmanifest",
6
6
  "/api/info/route": "/api/info",
7
7
  "/api/push/vapid-key/route": "/api/push/vapid-key",
8
8
  "/api/push/subscribe/route": "/api/push/subscribe",
@@ -5,8 +5,8 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/qH3fSSOUNLq_-dFHc2iUI/_buildManifest.js",
9
- "static/qH3fSSOUNLq_-dFHc2iUI/_ssgManifest.js"
8
+ "static/RTQ1HYVu3tm_I6QSHC2Kq/_buildManifest.js",
9
+ "static/RTQ1HYVu3tm_I6QSHC2Kq/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [
12
12
  "static/chunks/webpack-d434b6449a9cd8f3.js",
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "version": 4,
3
3
  "routes": {
4
- "/icon.png": {
5
- "initialHeaders": {
6
- "cache-control": "public, immutable, no-transform, max-age=31536000",
7
- "content-type": "image/png",
8
- "x-next-cache-tags": "_N_T_/layout,_N_T_/icon.png/layout,_N_T_/icon.png/route,_N_T_/icon.png"
9
- },
4
+ "/_not-found": {
5
+ "initialStatus": 404,
10
6
  "experimentalBypassFor": [
11
7
  {
12
8
  "type": "header",
@@ -19,8 +15,8 @@
19
15
  }
20
16
  ],
21
17
  "initialRevalidateSeconds": false,
22
- "srcRoute": "/icon.png",
23
- "dataRoute": null,
18
+ "srcRoute": "/_not-found",
19
+ "dataRoute": "/_not-found.rsc",
24
20
  "allowHeader": [
25
21
  "host",
26
22
  "x-matched-path",
@@ -30,8 +26,12 @@
30
26
  "x-next-revalidate-tag-token"
31
27
  ]
32
28
  },
33
- "/_not-found": {
34
- "initialStatus": 404,
29
+ "/icon.png": {
30
+ "initialHeaders": {
31
+ "cache-control": "public, immutable, no-transform, max-age=31536000",
32
+ "content-type": "image/png",
33
+ "x-next-cache-tags": "_N_T_/layout,_N_T_/icon.png/layout,_N_T_/icon.png/route,_N_T_/icon.png"
34
+ },
35
35
  "experimentalBypassFor": [
36
36
  {
37
37
  "type": "header",
@@ -44,8 +44,8 @@
44
44
  }
45
45
  ],
46
46
  "initialRevalidateSeconds": false,
47
- "srcRoute": "/_not-found",
48
- "dataRoute": "/_not-found.rsc",
47
+ "srcRoute": "/icon.png",
48
+ "dataRoute": null,
49
49
  "allowHeader": [
50
50
  "host",
51
51
  "x-matched-path",
@@ -84,12 +84,7 @@
84
84
  "x-next-revalidate-tag-token"
85
85
  ]
86
86
  },
87
- "/manifest.webmanifest": {
88
- "initialHeaders": {
89
- "cache-control": "public, max-age=0, must-revalidate",
90
- "content-type": "application/manifest+json",
91
- "x-next-cache-tags": "_N_T_/layout,_N_T_/manifest.webmanifest/layout,_N_T_/manifest.webmanifest/route,_N_T_/manifest.webmanifest"
92
- },
87
+ "/": {
93
88
  "experimentalBypassFor": [
94
89
  {
95
90
  "type": "header",
@@ -102,8 +97,8 @@
102
97
  }
103
98
  ],
104
99
  "initialRevalidateSeconds": false,
105
- "srcRoute": "/manifest.webmanifest",
106
- "dataRoute": null,
100
+ "srcRoute": "/",
101
+ "dataRoute": "/index.rsc",
107
102
  "allowHeader": [
108
103
  "host",
109
104
  "x-matched-path",
@@ -113,7 +108,12 @@
113
108
  "x-next-revalidate-tag-token"
114
109
  ]
115
110
  },
116
- "/": {
111
+ "/manifest.webmanifest": {
112
+ "initialHeaders": {
113
+ "cache-control": "public, max-age=0, must-revalidate",
114
+ "content-type": "application/manifest+json",
115
+ "x-next-cache-tags": "_N_T_/layout,_N_T_/manifest.webmanifest/layout,_N_T_/manifest.webmanifest/route,_N_T_/manifest.webmanifest"
116
+ },
117
117
  "experimentalBypassFor": [
118
118
  {
119
119
  "type": "header",
@@ -126,8 +126,8 @@
126
126
  }
127
127
  ],
128
128
  "initialRevalidateSeconds": false,
129
- "srcRoute": "/",
130
- "dataRoute": "/index.rsc",
129
+ "srcRoute": "/manifest.webmanifest",
130
+ "dataRoute": null,
131
131
  "allowHeader": [
132
132
  "host",
133
133
  "x-matched-path",
@@ -289,7 +289,7 @@
289
289
  "bundlePagesRouterDependencies": false,
290
290
  "configFileName": "next.config.ts",
291
291
  "serverExternalPackages": [
292
- "better-sqlite3",
292
+ "sql.js",
293
293
  "web-push"
294
294
  ],
295
295
  "turbopack": {
@@ -1 +1 @@
1
- <!DOCTYPE html><!--qH3fSSOUNLq__dFHc2iUI--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><link rel="stylesheet" href="/_next/static/css/491f5e1d36eb62fc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d434b6449a9cd8f3.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-ebd51be49873d76c.js" async=""></script><script src="/_next/static/chunks/main-app-14a04931699eb2a2.js" async=""></script><script src="/_next/static/chunks/app/layout-11d8cab0ea5a792e.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="theme-color" content="#0a0a0b"/><title>Cursor Local Remote</title><meta name="description" content="Control Cursor IDE from any device on your local network"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="CLR"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon.png?c7e4facf85613587" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon.png?4e1b4f0ebf73adf0" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="overscroll-none"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><pwa-install manifest-url="/manifest.webmanifest" name="Cursor Local Remote" description="Control Cursor IDE from any device on your local network" icon="/apple-touch-icon.png"></pwa-install><script src="/_next/static/chunks/webpack-d434b6449a9cd8f3.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[9766,[],\"\"]\n3:I[8924,[],\"\"]\n4:I[759,[\"177\",\"static/chunks/app/layout-11d8cab0ea5a792e.js\"],\"SwRegister\"]\n5:I[2317,[\"177\",\"static/chunks/app/layout-11d8cab0ea5a792e.js\"],\"PwaInstall\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/css/491f5e1d36eb62fc.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"qH3fSSOUNLq_-dFHc2iUI\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/491f5e1d36eb62fc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"overscroll-none\",\"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,{}],[\"$\",\"$L5\",null,{}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$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\":[\"__PAGE__\",[\"$\",\"$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,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],null],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#0a0a0b\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"10:I[622,[],\"IconMark\"]\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Cursor Local Remote\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Control Cursor IDE from any device on your local network\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"CLR\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon.png?c7e4facf85613587\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?4e1b4f0ebf73adf0\",\"type\":\"image/png\",\"sizes\":\"180x180\"}],[\"$\",\"$L10\",\"8\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
1
+ <!DOCTYPE html><!--RTQ1HYVu3tm_I6QSHC2Kq--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><link rel="stylesheet" href="/_next/static/css/491f5e1d36eb62fc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d434b6449a9cd8f3.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-ebd51be49873d76c.js" async=""></script><script src="/_next/static/chunks/main-app-14a04931699eb2a2.js" async=""></script><script src="/_next/static/chunks/app/layout-11d8cab0ea5a792e.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="theme-color" content="#0a0a0b"/><title>Cursor Local Remote</title><meta name="description" content="Control Cursor IDE from any device on your local network"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="CLR"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/icon.png?c7e4facf85613587" type="image/png" sizes="32x32"/><link rel="apple-touch-icon" href="/apple-icon.png?4e1b4f0ebf73adf0" type="image/png" sizes="180x180"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="overscroll-none"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><pwa-install manifest-url="/manifest.webmanifest" name="Cursor Local Remote" description="Control Cursor IDE from any device on your local network" icon="/apple-touch-icon.png"></pwa-install><script src="/_next/static/chunks/webpack-d434b6449a9cd8f3.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[9766,[],\"\"]\n3:I[8924,[],\"\"]\n4:I[759,[\"177\",\"static/chunks/app/layout-11d8cab0ea5a792e.js\"],\"SwRegister\"]\n5:I[2317,[\"177\",\"static/chunks/app/layout-11d8cab0ea5a792e.js\"],\"PwaInstall\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/css/491f5e1d36eb62fc.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"RTQ1HYVu3tm_I6QSHC2Kq\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/491f5e1d36eb62fc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"overscroll-none\",\"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,{}],[\"$\",\"$L5\",null,{}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$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\":[\"__PAGE__\",[\"$\",\"$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,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],null],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#0a0a0b\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"10:I[622,[],\"IconMark\"]\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Cursor Local Remote\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Control Cursor IDE from any device on your local network\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"CLR\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/icon.png?c7e4facf85613587\",\"type\":\"image/png\",\"sizes\":\"32x32\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?4e1b4f0ebf73adf0\",\"type\":\"image/png\",\"sizes\":\"180x180\"}],[\"$\",\"$L10\",\"8\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
@@ -10,7 +10,7 @@ c:I[4431,[],"MetadataBoundary"]
10
10
  d:"$Sreact.suspense"
11
11
  f:I[7150,[],""]
12
12
  :HL["/_next/static/css/491f5e1d36eb62fc.css","style"]
13
- 0:{"P":null,"b":"qH3fSSOUNLq_-dFHc2iUI","p":"","c":["","_not-found"],"i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/491f5e1d36eb62fc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"overscroll-none","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,{}],["$","$L5",null,{}]]}]}]]}],{"children":["/_not-found",["$","$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":["__PAGE__",["$","$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,["$","$L6",null,{"children":["$L7",["$","$L8",null,{"promise":"$@9"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],[["$","$La",null,{"children":"$Lb"}],null],["$","$Lc",null,{"children":["$","div",null,{"hidden":true,"children":["$","$d",null,{"fallback":null,"children":"$Le"}]}]}]]}],false]],"m":"$undefined","G":["$f",[]],"s":false,"S":true}
13
+ 0:{"P":null,"b":"RTQ1HYVu3tm_I6QSHC2Kq","p":"","c":["","_not-found"],"i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/491f5e1d36eb62fc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"overscroll-none","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,{}],["$","$L5",null,{}]]}]}]]}],{"children":["/_not-found",["$","$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":["__PAGE__",["$","$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,["$","$L6",null,{"children":["$L7",["$","$L8",null,{"promise":"$@9"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],[["$","$La",null,{"children":"$Lb"}],null],["$","$Lc",null,{"children":["$","div",null,{"hidden":true,"children":["$","$d",null,{"fallback":null,"children":"$Le"}]}]}]]}],false]],"m":"$undefined","G":["$f",[]],"s":false,"S":true}
14
14
  b:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}],["$","meta","2",{"name":"theme-color","content":"#0a0a0b"}]]
15
15
  7:null
16
16
  10:I[622,[],"IconMark"]
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=276,a.ids=[276],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},401:(a,b,c)=>{"use strict";c.d(b,{Mf:()=>k,QO:()=>i,UH:()=>g,Wf:()=>d,Wg:()=>l,ZU:()=>j,c1:()=>e,jf:()=>f,wS:()=>h});let d=3e4,e=12e4,f=150,g=15e3,h=800,i=3e5,j=1e4,k=300,l=3100},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1926:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>E,dynamic:()=>D});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let u=require("node:crypto");var v=c(9646);let w=!1;var x=c(5221),y=c(6492),z=c(6277),A=c(6505),B=c(7093),C=c(401);let D="force-dynamic";async function E(a){let b=await (0,B.Y2)(a);if(b instanceof Response)return b;let c=(0,A.OG)(A.LS,b);if("error"in c)return(0,B.li)(c.error);let d=c.data,e=(0,x.K)();try{var f;let a=(0,u.randomUUID)(),b=function(a){if(!w)try{(0,v.execFileSync)("agent",["--version"],{stdio:"ignore",timeout:5e3}),w=!0}catch{throw Error("Could not find the 'agent' CLI. Make sure Cursor is installed and the CLI is on your PATH.")}let b=["-p",a.prompt,"--output-format","stream-json","--stream-partial-output"];return"1"===process.env.CURSOR_TRUST&&b.push("--trust"),a.sessionId&&b.push("--resume",a.sessionId),a.workspace&&b.push("--workspace",a.workspace),a.model&&b.push("--model",a.model),a.mode&&"agent"!==a.mode&&b.push("--mode",a.mode),(0,v.spawn)("agent",b,{stdio:["pipe","pipe","pipe"],env:{...process.env}})}({prompt:d.prompt,sessionId:d.sessionId,workspace:e,model:d.model,mode:d.mode});(0,z.VS)(a,b,e),d.sessionId&&(0,z.Xw)(a,d.sessionId),b.stderr?.on("data",()=>{});let c=await (f=d.prompt,new Promise(c=>{let d=!1,g="",h=null,i=setTimeout(()=>{d||c(null)},C.Wf);b.stdout?.on("data",b=>{let j=(g+=b.toString()).split("\n");for(let b of(g=j.pop()||"",j))if(b.trim())try{let g=JSON.parse(b);!d&&"system"===g.type&&"init"===g.subtype&&g.session_id&&(d=!0,h=g.session_id,clearTimeout(i),(0,y.ih)(g.session_id,e,f),(0,z.Xw)(a,g.session_id),c(g.session_id)),h&&("user"===g.type||"assistant"===g.type)&&(0,z.D7)(h,g)}catch{}}),b.on("close",()=>{d||(clearTimeout(i),c(null))}),b.on("error",()=>{d||(clearTimeout(i),c(null))})}));if(!c)return b.kill("SIGTERM"),(0,B.ig)("Agent failed to start");return Response.json({sessionId:c})}catch(a){return(0,B.Jo)(a,"Failed to start agent"),(0,B.ig)("Failed to start agent")}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/chat/route",pathname:"/api/chat",filename:"route",bundlePath:"app/api/chat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/chat/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){var d;let e="/api/chat/route";"/index"===e&&(e="/");let g=await F.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!E||F.isDev||x||(G="/index"===(G=C)?"/":G);let H=!0===F.isDev||!E,I=E&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>F.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>F.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await F.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5221:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(9902);function e(){let a=process.env.CURSOR_WORKSPACE;return a?(0,d.resolve)(a):process.cwd()}},6277:(a,b,c)=>{"use strict";c.d(b,{$m:()=>p,D7:()=>i,F1:()=>o,Ki:()=>j,VS:()=>l,Xw:()=>n,ix:()=>q,pl:()=>k,xy:()=>m});var d=c(401);let e=new Map,f=new Map,g=new Map,h=new Map;function i(a,b){let c=g.get(a);c||(c=[],g.set(a,c)),c.push(b);let d=h.get(a);if(d)for(let a of d)a()}function j(a){return g.get(a)??[]}function k(a,b){let c=h.get(a);c||(c=new Set,h.set(a,c));let d=c;return d.add(b),()=>{d.delete(b)}}function l(a,b,c){let i={child:b,sessionId:null,mapKey:a,workspace:c,startedAt:Date.now()};e.set(a,i);let j=()=>{i.sessionId??i.mapKey,e.delete(i.mapKey);let a=f.get(i.mapKey);if(a)for(let b of(f.delete(i.mapKey),a))b();setTimeout(()=>{g.delete(i.mapKey),h.delete(i.mapKey)},d.c1)};b.on("close",j),b.on("error",j)}function m(a,b){if(!e.has(a))return b(),()=>{};let c=f.get(a);c||(c=new Set,f.set(a,c));let d=c;return d.add(b),()=>{d.delete(b)}}function n(a,b){let c=e.get(a);c&&(c.sessionId=b,b!==a&&(e.set(b,c),e.delete(a),c.mapKey=b))}function o(){let a=new Set;for(let[b,c]of e)a.add(c.sessionId??b);return Array.from(a)}function p(a){return e.has(a)}function q(a){let b=e.get(a);return!!b&&(b.child.kill("SIGTERM"),!0)}},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>o,Lf:()=>l,ME:()=>p,ih:()=>n});var d=c(7550),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null;function l(){return k||((0,h.mkdirSync)(i,{recursive:!0}),(k=new(e())(j)).pragma("journal_mode = WAL"),k.exec(`
1
+ (()=>{var a={};a.id=276,a.ids=[276],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},401:(a,b,c)=>{"use strict";c.d(b,{Mf:()=>k,QO:()=>i,UH:()=>g,Wf:()=>d,Wg:()=>l,ZU:()=>j,c1:()=>e,jf:()=>f,wS:()=>h});let d=3e4,e=12e4,f=150,g=15e3,h=800,i=3e5,j=1e4,k=300,l=3100},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1926:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>E,dynamic:()=>D});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let u=require("node:crypto");var v=c(9646);let w=!1;var x=c(5221),y=c(6492),z=c(6277),A=c(6505),B=c(7093),C=c(401);let D="force-dynamic";async function E(a){let b=await (0,B.Y2)(a);if(b instanceof Response)return b;let c=(0,A.OG)(A.LS,b);if("error"in c)return(0,B.li)(c.error);let d=c.data,e=(0,x.K)();try{var f;let a=(0,u.randomUUID)(),b=function(a){if(!w)try{(0,v.execFileSync)("agent",["--version"],{stdio:"ignore",timeout:5e3}),w=!0}catch{throw Error("Could not find the 'agent' CLI. Make sure Cursor is installed and the CLI is on your PATH.")}let b=["-p",a.prompt,"--output-format","stream-json","--stream-partial-output"];return"1"===process.env.CURSOR_TRUST&&b.push("--trust"),a.sessionId&&b.push("--resume",a.sessionId),a.workspace&&b.push("--workspace",a.workspace),a.model&&b.push("--model",a.model),a.mode&&"agent"!==a.mode&&b.push("--mode",a.mode),(0,v.spawn)("agent",b,{stdio:["pipe","pipe","pipe"],env:{...process.env}})}({prompt:d.prompt,sessionId:d.sessionId,workspace:e,model:d.model,mode:d.mode});(0,z.VS)(a,b,e),d.sessionId&&(0,z.Xw)(a,d.sessionId),b.stderr?.on("data",()=>{});let c=await (f=d.prompt,new Promise(c=>{let d=!1,g="",h=null,i=setTimeout(()=>{d||c(null)},C.Wf);b.stdout?.on("data",b=>{let j=(g+=b.toString()).split("\n");for(let b of(g=j.pop()||"",j))if(b.trim())try{let g=JSON.parse(b);!d&&"system"===g.type&&"init"===g.subtype&&g.session_id&&(d=!0,h=g.session_id,clearTimeout(i),(0,y.ih)(g.session_id,e,f),(0,z.Xw)(a,g.session_id),c(g.session_id)),h&&("user"===g.type||"assistant"===g.type)&&(0,z.D7)(h,g)}catch{}}),b.on("close",()=>{d||(clearTimeout(i),c(null))}),b.on("error",()=>{d||(clearTimeout(i),c(null))})}));if(!c)return b.kill("SIGTERM"),(0,B.ig)("Agent failed to start");return Response.json({sessionId:c})}catch(a){return(0,B.Jo)(a,"Failed to start agent"),(0,B.ig)("Failed to start agent")}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/chat/route",pathname:"/api/chat",filename:"route",bundlePath:"app/api/chat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/chat/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){var d;let e="/api/chat/route";"/index"===e&&(e="/");let g=await F.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!E||F.isDev||x||(G="/index"===(G=C)?"/":G);let H=!0===F.isDev||!E,I=E&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>F.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>F.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await F.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5221:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(9902);function e(){let a=process.env.CURSOR_WORKSPACE;return a?(0,d.resolve)(a):process.cwd()}},6277:(a,b,c)=>{"use strict";c.d(b,{$m:()=>p,D7:()=>i,F1:()=>o,Ki:()=>j,VS:()=>l,Xw:()=>n,ix:()=>q,pl:()=>k,xy:()=>m});var d=c(401);let e=new Map,f=new Map,g=new Map,h=new Map;function i(a,b){let c=g.get(a);c||(c=[],g.set(a,c)),c.push(b);let d=h.get(a);if(d)for(let a of d)a()}function j(a){return g.get(a)??[]}function k(a,b){let c=h.get(a);c||(c=new Set,h.set(a,c));let d=c;return d.add(b),()=>{d.delete(b)}}function l(a,b,c){let i={child:b,sessionId:null,mapKey:a,workspace:c,startedAt:Date.now()};e.set(a,i);let j=()=>{i.sessionId??i.mapKey,e.delete(i.mapKey);let a=f.get(i.mapKey);if(a)for(let b of(f.delete(i.mapKey),a))b();setTimeout(()=>{g.delete(i.mapKey),h.delete(i.mapKey)},d.c1)};b.on("close",j),b.on("error",j)}function m(a,b){if(!e.has(a))return b(),()=>{};let c=f.get(a);c||(c=new Set,f.set(a,c));let d=c;return d.add(b),()=>{d.delete(b)}}function n(a,b){let c=e.get(a);c&&(c.sessionId=b,b!==a&&(e.set(b,c),e.delete(a),c.mapKey=b))}function o(){let a=new Set;for(let[b,c]of e)a.add(c.sessionId??b);return Array.from(a)}function p(a){return e.has(a)}function q(a){let b=e.get(a);return!!b&&(b.child.kill("SIGTERM"),!0)}},6293:a=>{"use strict";a.exports=require("sql.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>r,Lf:()=>n,ME:()=>s,ih:()=>q});var d=c(6293),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null,l=null;function m(){k&&(0,h.writeFileSync)(j,Buffer.from(k.export()))}async function n(){if(k)return k;let{Database:a}=await (!l&&(l=e()()),l);return(0,h.mkdirSync)(i,{recursive:!0}),(k=(0,h.existsSync)(j)?new a((0,h.readFileSync)(j)):new a).run(`
2
2
  CREATE TABLE IF NOT EXISTS sessions (
3
3
  id TEXT PRIMARY KEY,
4
4
  title TEXT NOT NULL,
@@ -6,14 +6,16 @@
6
6
  preview TEXT NOT NULL DEFAULT '',
7
7
  created_at INTEGER NOT NULL,
8
8
  updated_at INTEGER NOT NULL
9
- );
9
+ )
10
+ `),k.run(`
10
11
  CREATE TABLE IF NOT EXISTS config (
11
12
  key TEXT PRIMARY KEY,
12
13
  value TEXT NOT NULL
13
- );
14
+ )
15
+ `),k.run(`
14
16
  CREATE TABLE IF NOT EXISTS push_subscriptions (
15
17
  endpoint TEXT PRIMARY KEY,
16
18
  subscription TEXT NOT NULL,
17
19
  created_at INTEGER NOT NULL
18
- );
19
- `)),k}function m(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}function n(a,b,c){let d=l(),e=Date.now(),f=d.prepare("SELECT * FROM sessions WHERE id = ?").get(a);if(f){let b=c?c.slice(0,120):f.preview;return d.prepare("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?").run(e,b,a),m({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.prepare("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)").run(a,g,b,h,e,e),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}function o(a){let b=l();return(a?b.prepare("SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC").all(a):b.prepare("SELECT * FROM sessions ORDER BY updated_at DESC").all()).map(m)}function p(a){l().prepare("DELETE FROM sessions WHERE id = ?").run(a)}},6505:(a,b,c)=>{"use strict";c.d(b,{LS:()=>f,OG:()=>i,li:()=>g,vc:()=>h});var d=c(8629);let e=d.YjP().regex(/^[a-zA-Z0-9_-]{1,128}$/,"invalid sessionId"),f=d.Ikc({prompt:d.YjP().min(1,"prompt is required"),sessionId:e.optional(),model:d.YjP().max(128).regex(/^[a-zA-Z0-9._/-]+$/,"invalid model").optional(),mode:d.k5n(["agent","ask","plan"]).optional()}),g=d.Ikc({sessionId:e}),h=e;function i(a,b){let c=a.safeParse(b);if(c.success)return{data:c.data};let d=c.error.issues[0];return{error:d?.message??"Validation failed"}}},7093:(a,b,c)=>{"use strict";function d(a,b){return Response.json({error:a},{status:b})}function e(a){return d(a,400)}function f(a){return d(a,404)}function g(a="Internal server error"){return d(a,500)}function h(a,b){return a instanceof Error&&console.error(a),b}async function i(a){try{return await a.json()}catch{return e("Invalid JSON body")}}c.d(b,{Jo:()=>h,Y2:()=>i,ig:()=>g,li:()=>e,mX:()=>f})},7550:a=>{"use strict";a.exports=require("better-sqlite3")},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9646:a=>{"use strict";a.exports=require("child_process")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,878],()=>b(b.s=1926));module.exports=c})();
20
+ )
21
+ `),m(),k}function o(a,b,c=[]){let d=a.prepare(b);try{d.bind(c);let a=[];for(;d.step();)a.push(d.getAsObject());return a}finally{d.free()}}function p(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}async function q(a,b,c){let d=await n(),e=Date.now(),f=function(a,b,c){let d=a.prepare(b);try{if(d.bind(c),d.step())return d.getAsObject();return}finally{d.free()}}(d,"SELECT * FROM sessions WHERE id = ?",[a]);if(f){let b=c?c.slice(0,120):f.preview;return d.run("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?",[e,b,a]),m(),p({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.run("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[a,g,b,h,e,e]),m(),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}async function r(a){let b=await n();return(a?o(b,"SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC",[a]):o(b,"SELECT * FROM sessions ORDER BY updated_at DESC")).map(p)}async function s(a){(await n()).run("DELETE FROM sessions WHERE id = ?",[a]),m()}},6505:(a,b,c)=>{"use strict";c.d(b,{LS:()=>f,OG:()=>i,li:()=>g,vc:()=>h});var d=c(8629);let e=d.YjP().regex(/^[a-zA-Z0-9_-]{1,128}$/,"invalid sessionId"),f=d.Ikc({prompt:d.YjP().min(1,"prompt is required"),sessionId:e.optional(),model:d.YjP().max(128).regex(/^[a-zA-Z0-9._/-]+$/,"invalid model").optional(),mode:d.k5n(["agent","ask","plan"]).optional()}),g=d.Ikc({sessionId:e}),h=e;function i(a,b){let c=a.safeParse(b);if(c.success)return{data:c.data};let d=c.error.issues[0];return{error:d?.message??"Validation failed"}}},7093:(a,b,c)=>{"use strict";function d(a,b){return Response.json({error:a},{status:b})}function e(a){return d(a,400)}function f(a){return d(a,404)}function g(a="Internal server error"){return d(a,500)}function h(a,b){return a instanceof Error&&console.error(a),b}async function i(a){try{return await a.json()}catch{return e("Invalid JSON body")}}c.d(b,{Jo:()=>h,Y2:()=>i,ig:()=>g,li:()=>e,mX:()=>f})},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9646:a=>{"use strict";a.exports=require("child_process")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873,878],()=>b(b.s=1926));module.exports=c})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../node_modules/better-sqlite3/package.json","../../../../../node_modules/bindings/bindings.js","../../../../../node_modules/bindings/package.json","../../../../../node_modules/file-uri-to-path/index.js","../../../../../node_modules/file-uri-to-path/package.json","../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/lib/cache-handlers/default.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/873.js","../../../chunks/878.js","../../../webpack-runtime.js","route_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/lib/cache-handlers/default.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../node_modules/sql.js/package.json","../../../../../package.json","../../../../package.json","../../../chunks/873.js","../../../chunks/878.js","../../../webpack-runtime.js","route_client-reference-manifest.js"]}
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=243,a.ids=[243],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1181:a=>{"use strict";a.exports=require("web-push")},2607:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{DELETE:()=>y,POST:()=>x,dynamic:()=>w});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356),u=c(6806),v=c(7093);let w="force-dynamic";async function x(a){let b=await (0,v.Y2)(a);return b instanceof Response?b:b.endpoint&&"string"==typeof b.endpoint?((0,u.$3)(b),Response.json({ok:!0})):(0,v.li)("invalid push subscription: missing endpoint")}async function y(a){let b=await (0,v.Y2)(a);return b instanceof Response?b:b.endpoint&&"string"==typeof b.endpoint?((0,u.ig)(b.endpoint),Response.json({ok:!0})):(0,v.li)("endpoint is required")}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/push/subscribe/route",pathname:"/api/push/subscribe",filename:"route",bundlePath:"app/api/push/subscribe/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/push/subscribe/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){var d;let e="/api/push/subscribe/route";"/index"===e&&(e="/");let g=await z.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||z.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===z.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>z.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>z.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await z.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>o,Lf:()=>l,ME:()=>p,ih:()=>n});var d=c(7550),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null;function l(){return k||((0,h.mkdirSync)(i,{recursive:!0}),(k=new(e())(j)).pragma("journal_mode = WAL"),k.exec(`
1
+ (()=>{var a={};a.id=243,a.ids=[243],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1181:a=>{"use strict";a.exports=require("web-push")},2607:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{DELETE:()=>y,POST:()=>x,dynamic:()=>w});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356),u=c(6806),v=c(7093);let w="force-dynamic";async function x(a){let b=await (0,v.Y2)(a);return b instanceof Response?b:b.endpoint&&"string"==typeof b.endpoint?(await (0,u.$3)(b),Response.json({ok:!0})):(0,v.li)("invalid push subscription: missing endpoint")}async function y(a){let b=await (0,v.Y2)(a);return b instanceof Response?b:b.endpoint&&"string"==typeof b.endpoint?(await (0,u.ig)(b.endpoint),Response.json({ok:!0})):(0,v.li)("endpoint is required")}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/push/subscribe/route",pathname:"/api/push/subscribe",filename:"route",bundlePath:"app/api/push/subscribe/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/push/subscribe/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){var d;let e="/api/push/subscribe/route";"/index"===e&&(e="/");let g=await z.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||z.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===z.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>z.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>z.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await z.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6293:a=>{"use strict";a.exports=require("sql.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>r,Lf:()=>n,ME:()=>s,ih:()=>q});var d=c(6293),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null,l=null;function m(){k&&(0,h.writeFileSync)(j,Buffer.from(k.export()))}async function n(){if(k)return k;let{Database:a}=await (!l&&(l=e()()),l);return(0,h.mkdirSync)(i,{recursive:!0}),(k=(0,h.existsSync)(j)?new a((0,h.readFileSync)(j)):new a).run(`
2
2
  CREATE TABLE IF NOT EXISTS sessions (
3
3
  id TEXT PRIMARY KEY,
4
4
  title TEXT NOT NULL,
@@ -6,14 +6,16 @@
6
6
  preview TEXT NOT NULL DEFAULT '',
7
7
  created_at INTEGER NOT NULL,
8
8
  updated_at INTEGER NOT NULL
9
- );
9
+ )
10
+ `),k.run(`
10
11
  CREATE TABLE IF NOT EXISTS config (
11
12
  key TEXT PRIMARY KEY,
12
13
  value TEXT NOT NULL
13
- );
14
+ )
15
+ `),k.run(`
14
16
  CREATE TABLE IF NOT EXISTS push_subscriptions (
15
17
  endpoint TEXT PRIMARY KEY,
16
18
  subscription TEXT NOT NULL,
17
19
  created_at INTEGER NOT NULL
18
- );
19
- `)),k}function m(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}function n(a,b,c){let d=l(),e=Date.now(),f=d.prepare("SELECT * FROM sessions WHERE id = ?").get(a);if(f){let b=c?c.slice(0,120):f.preview;return d.prepare("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?").run(e,b,a),m({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.prepare("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)").run(a,g,b,h,e,e),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}function o(a){let b=l();return(a?b.prepare("SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC").all(a):b.prepare("SELECT * FROM sessions ORDER BY updated_at DESC").all()).map(m)}function p(a){l().prepare("DELETE FROM sessions WHERE id = ?").run(a)}},6806:(a,b,c)=>{"use strict";c.d(b,{$3:()=>i,HR:()=>h,ig:()=>j});var d=c(1181),e=c.n(d),f=c(6492);let g=!1;function h(){return function(){let a=function(){let a=(0,f.Lf)(),b=a.prepare("SELECT value FROM config WHERE key = 'vapid_keys'").get();if(b)return JSON.parse(b.value);let c=e().generateVAPIDKeys(),d={publicKey:c.publicKey,privateKey:c.privateKey};return a.prepare("INSERT INTO config (key, value) VALUES ('vapid_keys', ?)").run(JSON.stringify(d)),d}();return g||(e().setVapidDetails("mailto:clr@localhost",a.publicKey,a.privateKey),g=!0),a}().publicKey}function i(a){(0,f.Lf)().prepare("INSERT OR REPLACE INTO push_subscriptions (endpoint, subscription, created_at) VALUES (?, ?, ?)").run(a.endpoint,JSON.stringify(a),Date.now())}function j(a){(0,f.Lf)().prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(a)}},7093:(a,b,c)=>{"use strict";function d(a,b){return Response.json({error:a},{status:b})}function e(a){return d(a,400)}function f(a){return d(a,404)}function g(a="Internal server error"){return d(a,500)}function h(a,b){return a instanceof Error&&console.error(a),b}async function i(a){try{return await a.json()}catch{return e("Invalid JSON body")}}c.d(b,{Jo:()=>h,Y2:()=>i,ig:()=>g,li:()=>e,mX:()=>f})},7550:a=>{"use strict";a.exports=require("better-sqlite3")},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873],()=>b(b.s=2607));module.exports=c})();
20
+ )
21
+ `),m(),k}function o(a,b,c=[]){let d=a.prepare(b);try{d.bind(c);let a=[];for(;d.step();)a.push(d.getAsObject());return a}finally{d.free()}}function p(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}async function q(a,b,c){let d=await n(),e=Date.now(),f=function(a,b,c){let d=a.prepare(b);try{if(d.bind(c),d.step())return d.getAsObject();return}finally{d.free()}}(d,"SELECT * FROM sessions WHERE id = ?",[a]);if(f){let b=c?c.slice(0,120):f.preview;return d.run("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?",[e,b,a]),m(),p({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.run("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[a,g,b,h,e,e]),m(),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}async function r(a){let b=await n();return(a?o(b,"SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC",[a]):o(b,"SELECT * FROM sessions ORDER BY updated_at DESC")).map(p)}async function s(a){(await n()).run("DELETE FROM sessions WHERE id = ?",[a]),m()}},6806:(a,b,c)=>{"use strict";c.d(b,{$3:()=>k,HR:()=>j,ig:()=>l});var d=c(1181),e=c.n(d),f=c(6492);async function g(){let a=await (0,f.Lf)(),b=function(a,b,c){let d=a.prepare(b);try{if(d.bind(c),d.step())return d.getAsObject().value;return}finally{d.free()}}(a,"SELECT value FROM config WHERE key = ?",["vapid_keys"]);if(b)return JSON.parse(b);let c=e().generateVAPIDKeys(),d={publicKey:c.publicKey,privateKey:c.privateKey};return a.run("INSERT INTO config (key, value) VALUES (?, ?)",["vapid_keys",JSON.stringify(d)]),d}let h=!1;async function i(){let a=await g();return h||(e().setVapidDetails("mailto:clr@localhost",a.publicKey,a.privateKey),h=!0),a}async function j(){return(await i()).publicKey}async function k(a){(await (0,f.Lf)()).run("INSERT OR REPLACE INTO push_subscriptions (endpoint, subscription, created_at) VALUES (?, ?, ?)",[a.endpoint,JSON.stringify(a),Date.now()])}async function l(a){(await (0,f.Lf)()).run("DELETE FROM push_subscriptions WHERE endpoint = ?",[a])}},7093:(a,b,c)=>{"use strict";function d(a,b){return Response.json({error:a},{status:b})}function e(a){return d(a,400)}function f(a){return d(a,404)}function g(a="Internal server error"){return d(a,500)}function h(a,b){return a instanceof Error&&console.error(a),b}async function i(a){try{return await a.json()}catch{return e("Invalid JSON body")}}c.d(b,{Jo:()=>h,Y2:()=>i,ig:()=>g,li:()=>e,mX:()=>f})},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873],()=>b(b.s=2607));module.exports=c})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../node_modules/agent-base/dist/helpers.js","../../../../../../node_modules/agent-base/dist/index.js","../../../../../../node_modules/agent-base/package.json","../../../../../../node_modules/asn1.js/lib/asn1.js","../../../../../../node_modules/asn1.js/lib/asn1/api.js","../../../../../../node_modules/asn1.js/lib/asn1/base/buffer.js","../../../../../../node_modules/asn1.js/lib/asn1/base/index.js","../../../../../../node_modules/asn1.js/lib/asn1/base/node.js","../../../../../../node_modules/asn1.js/lib/asn1/base/reporter.js","../../../../../../node_modules/asn1.js/lib/asn1/constants/der.js","../../../../../../node_modules/asn1.js/lib/asn1/constants/index.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/der.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/index.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/pem.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/der.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/index.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/pem.js","../../../../../../node_modules/asn1.js/package.json","../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../node_modules/better-sqlite3/package.json","../../../../../../node_modules/bindings/bindings.js","../../../../../../node_modules/bindings/package.json","../../../../../../node_modules/bn.js/lib/bn.js","../../../../../../node_modules/bn.js/package.json","../../../../../../node_modules/buffer-equal-constant-time/index.js","../../../../../../node_modules/buffer-equal-constant-time/package.json","../../../../../../node_modules/debug/package.json","../../../../../../node_modules/debug/src/browser.js","../../../../../../node_modules/debug/src/common.js","../../../../../../node_modules/debug/src/index.js","../../../../../../node_modules/debug/src/node.js","../../../../../../node_modules/ecdsa-sig-formatter/package.json","../../../../../../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js","../../../../../../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js","../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../node_modules/has-flag/index.js","../../../../../../node_modules/has-flag/package.json","../../../../../../node_modules/http_ece/ece.js","../../../../../../node_modules/http_ece/package.json","../../../../../../node_modules/https-proxy-agent/dist/index.js","../../../../../../node_modules/https-proxy-agent/dist/parse-proxy-response.js","../../../../../../node_modules/https-proxy-agent/package.json","../../../../../../node_modules/inherits/inherits.js","../../../../../../node_modules/inherits/inherits_browser.js","../../../../../../node_modules/inherits/package.json","../../../../../../node_modules/jwa/index.js","../../../../../../node_modules/jwa/package.json","../../../../../../node_modules/jws/index.js","../../../../../../node_modules/jws/lib/data-stream.js","../../../../../../node_modules/jws/lib/sign-stream.js","../../../../../../node_modules/jws/lib/tostring.js","../../../../../../node_modules/jws/lib/verify-stream.js","../../../../../../node_modules/jws/package.json","../../../../../../node_modules/minimalistic-assert/index.js","../../../../../../node_modules/minimalistic-assert/package.json","../../../../../../node_modules/ms/index.js","../../../../../../node_modules/ms/package.json","../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/lib/cache-handlers/default.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../../../node_modules/safe-buffer/index.js","../../../../../../node_modules/safe-buffer/package.json","../../../../../../node_modules/safer-buffer/package.json","../../../../../../node_modules/safer-buffer/safer.js","../../../../../../node_modules/supports-color/index.js","../../../../../../node_modules/supports-color/package.json","../../../../../../node_modules/web-push/package.json","../../../../../../node_modules/web-push/src/encryption-helper.js","../../../../../../node_modules/web-push/src/index.js","../../../../../../node_modules/web-push/src/urlsafe-base64-helper.js","../../../../../../node_modules/web-push/src/vapid-helper.js","../../../../../../node_modules/web-push/src/web-push-constants.js","../../../../../../node_modules/web-push/src/web-push-error.js","../../../../../../node_modules/web-push/src/web-push-lib.js","../../../../../../package.json","../../../../../package.json","../../../../chunks/873.js","../../../../webpack-runtime.js","route_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../../../../node_modules/agent-base/dist/helpers.js","../../../../../../node_modules/agent-base/dist/index.js","../../../../../../node_modules/agent-base/package.json","../../../../../../node_modules/asn1.js/lib/asn1.js","../../../../../../node_modules/asn1.js/lib/asn1/api.js","../../../../../../node_modules/asn1.js/lib/asn1/base/buffer.js","../../../../../../node_modules/asn1.js/lib/asn1/base/index.js","../../../../../../node_modules/asn1.js/lib/asn1/base/node.js","../../../../../../node_modules/asn1.js/lib/asn1/base/reporter.js","../../../../../../node_modules/asn1.js/lib/asn1/constants/der.js","../../../../../../node_modules/asn1.js/lib/asn1/constants/index.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/der.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/index.js","../../../../../../node_modules/asn1.js/lib/asn1/decoders/pem.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/der.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/index.js","../../../../../../node_modules/asn1.js/lib/asn1/encoders/pem.js","../../../../../../node_modules/asn1.js/package.json","../../../../../../node_modules/bn.js/lib/bn.js","../../../../../../node_modules/bn.js/package.json","../../../../../../node_modules/buffer-equal-constant-time/index.js","../../../../../../node_modules/buffer-equal-constant-time/package.json","../../../../../../node_modules/debug/package.json","../../../../../../node_modules/debug/src/browser.js","../../../../../../node_modules/debug/src/common.js","../../../../../../node_modules/debug/src/index.js","../../../../../../node_modules/debug/src/node.js","../../../../../../node_modules/ecdsa-sig-formatter/package.json","../../../../../../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js","../../../../../../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js","../../../../../../node_modules/has-flag/index.js","../../../../../../node_modules/has-flag/package.json","../../../../../../node_modules/http_ece/ece.js","../../../../../../node_modules/http_ece/package.json","../../../../../../node_modules/https-proxy-agent/dist/index.js","../../../../../../node_modules/https-proxy-agent/dist/parse-proxy-response.js","../../../../../../node_modules/https-proxy-agent/package.json","../../../../../../node_modules/inherits/inherits.js","../../../../../../node_modules/inherits/inherits_browser.js","../../../../../../node_modules/inherits/package.json","../../../../../../node_modules/jwa/index.js","../../../../../../node_modules/jwa/package.json","../../../../../../node_modules/jws/index.js","../../../../../../node_modules/jws/lib/data-stream.js","../../../../../../node_modules/jws/lib/sign-stream.js","../../../../../../node_modules/jws/lib/tostring.js","../../../../../../node_modules/jws/lib/verify-stream.js","../../../../../../node_modules/jws/package.json","../../../../../../node_modules/minimalistic-assert/index.js","../../../../../../node_modules/minimalistic-assert/package.json","../../../../../../node_modules/ms/index.js","../../../../../../node_modules/ms/package.json","../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/lib/cache-handlers/default.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../../../node_modules/safe-buffer/index.js","../../../../../../node_modules/safe-buffer/package.json","../../../../../../node_modules/safer-buffer/package.json","../../../../../../node_modules/safer-buffer/safer.js","../../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../../node_modules/sql.js/package.json","../../../../../../node_modules/supports-color/index.js","../../../../../../node_modules/supports-color/package.json","../../../../../../node_modules/web-push/package.json","../../../../../../node_modules/web-push/src/encryption-helper.js","../../../../../../node_modules/web-push/src/index.js","../../../../../../node_modules/web-push/src/urlsafe-base64-helper.js","../../../../../../node_modules/web-push/src/vapid-helper.js","../../../../../../node_modules/web-push/src/web-push-constants.js","../../../../../../node_modules/web-push/src/web-push-error.js","../../../../../../node_modules/web-push/src/web-push-lib.js","../../../../../../package.json","../../../../../package.json","../../../../chunks/873.js","../../../../webpack-runtime.js","route_client-reference-manifest.js"]}
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=15,a.ids=[15],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1181:a=>{"use strict";a.exports=require("web-push")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5607:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>C,patchFetch:()=>B,routeModule:()=>x,serverHooks:()=>A,workAsyncStorage:()=>y,workUnitAsyncStorage:()=>z});var d={};c.r(d),c.d(d,{GET:()=>w,dynamic:()=>v});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356),u=c(6806);let v="force-dynamic";async function w(){return Response.json({publicKey:(0,u.HR)()})}let x=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/push/vapid-key/route",pathname:"/api/push/vapid-key",filename:"route",bundlePath:"app/api/push/vapid-key/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/push/vapid-key/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:y,workUnitAsyncStorage:z,serverHooks:A}=x;function B(){return(0,g.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:z})}async function C(a,b,c){var d;let e="/api/push/vapid-key/route";"/index"===e&&(e="/");let g=await x.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||x.isDev||y||(G="/index"===(G=D)?"/":G);let H=!0===x.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>x.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>x.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await x.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await x.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await x.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>o,Lf:()=>l,ME:()=>p,ih:()=>n});var d=c(7550),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null;function l(){return k||((0,h.mkdirSync)(i,{recursive:!0}),(k=new(e())(j)).pragma("journal_mode = WAL"),k.exec(`
1
+ (()=>{var a={};a.id=15,a.ids=[15],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1181:a=>{"use strict";a.exports=require("web-push")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5607:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>C,patchFetch:()=>B,routeModule:()=>x,serverHooks:()=>A,workAsyncStorage:()=>y,workUnitAsyncStorage:()=>z});var d={};c.r(d),c.d(d,{GET:()=>w,dynamic:()=>v});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356),u=c(6806);let v="force-dynamic";async function w(){return Response.json({publicKey:await (0,u.HR)()})}let x=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/push/vapid-key/route",pathname:"/api/push/vapid-key",filename:"route",bundlePath:"app/api/push/vapid-key/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/jonmakinen/Documents/cursor-local-remote/src/app/api/push/vapid-key/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:y,workUnitAsyncStorage:z,serverHooks:A}=x;function B(){return(0,g.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:z})}async function C(a,b,c){var d;let e="/api/push/vapid-key/route";"/index"===e&&(e="/");let g=await x.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||x.isDev||y||(G="/index"===(G=D)?"/":G);let H=!0===x.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>x.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>x.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await x.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await x.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await x.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6293:a=>{"use strict";a.exports=require("sql.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6492:(a,b,c)=>{"use strict";c.d(b,{GW:()=>r,Lf:()=>n,ME:()=>s,ih:()=>q});var d=c(6293),e=c.n(d),f=c(9902),g=c(9439),h=c(9021);let i=(0,f.join)((0,g.homedir)(),".cursor-local-remote"),j=(0,f.join)(i,"sessions.db"),k=null,l=null;function m(){k&&(0,h.writeFileSync)(j,Buffer.from(k.export()))}async function n(){if(k)return k;let{Database:a}=await (!l&&(l=e()()),l);return(0,h.mkdirSync)(i,{recursive:!0}),(k=(0,h.existsSync)(j)?new a((0,h.readFileSync)(j)):new a).run(`
2
2
  CREATE TABLE IF NOT EXISTS sessions (
3
3
  id TEXT PRIMARY KEY,
4
4
  title TEXT NOT NULL,
@@ -6,14 +6,16 @@
6
6
  preview TEXT NOT NULL DEFAULT '',
7
7
  created_at INTEGER NOT NULL,
8
8
  updated_at INTEGER NOT NULL
9
- );
9
+ )
10
+ `),k.run(`
10
11
  CREATE TABLE IF NOT EXISTS config (
11
12
  key TEXT PRIMARY KEY,
12
13
  value TEXT NOT NULL
13
- );
14
+ )
15
+ `),k.run(`
14
16
  CREATE TABLE IF NOT EXISTS push_subscriptions (
15
17
  endpoint TEXT PRIMARY KEY,
16
18
  subscription TEXT NOT NULL,
17
19
  created_at INTEGER NOT NULL
18
- );
19
- `)),k}function m(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}function n(a,b,c){let d=l(),e=Date.now(),f=d.prepare("SELECT * FROM sessions WHERE id = ?").get(a);if(f){let b=c?c.slice(0,120):f.preview;return d.prepare("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?").run(e,b,a),m({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.prepare("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)").run(a,g,b,h,e,e),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}function o(a){let b=l();return(a?b.prepare("SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC").all(a):b.prepare("SELECT * FROM sessions ORDER BY updated_at DESC").all()).map(m)}function p(a){l().prepare("DELETE FROM sessions WHERE id = ?").run(a)}},6806:(a,b,c)=>{"use strict";c.d(b,{$3:()=>i,HR:()=>h,ig:()=>j});var d=c(1181),e=c.n(d),f=c(6492);let g=!1;function h(){return function(){let a=function(){let a=(0,f.Lf)(),b=a.prepare("SELECT value FROM config WHERE key = 'vapid_keys'").get();if(b)return JSON.parse(b.value);let c=e().generateVAPIDKeys(),d={publicKey:c.publicKey,privateKey:c.privateKey};return a.prepare("INSERT INTO config (key, value) VALUES ('vapid_keys', ?)").run(JSON.stringify(d)),d}();return g||(e().setVapidDetails("mailto:clr@localhost",a.publicKey,a.privateKey),g=!0),a}().publicKey}function i(a){(0,f.Lf)().prepare("INSERT OR REPLACE INTO push_subscriptions (endpoint, subscription, created_at) VALUES (?, ?, ?)").run(a.endpoint,JSON.stringify(a),Date.now())}function j(a){(0,f.Lf)().prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(a)}},7550:a=>{"use strict";a.exports=require("better-sqlite3")},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873],()=>b(b.s=5607));module.exports=c})();
20
+ )
21
+ `),m(),k}function o(a,b,c=[]){let d=a.prepare(b);try{d.bind(c);let a=[];for(;d.step();)a.push(d.getAsObject());return a}finally{d.free()}}function p(a){return{id:a.id,title:a.title,workspace:a.workspace,preview:a.preview,createdAt:a.created_at,updatedAt:a.updated_at}}async function q(a,b,c){let d=await n(),e=Date.now(),f=function(a,b,c){let d=a.prepare(b);try{if(d.bind(c),d.step())return d.getAsObject();return}finally{d.free()}}(d,"SELECT * FROM sessions WHERE id = ?",[a]);if(f){let b=c?c.slice(0,120):f.preview;return d.run("UPDATE sessions SET updated_at = ?, preview = ? WHERE id = ?",[e,b,a]),m(),p({...f,updated_at:e,preview:b})}let g=c.slice(0,60)||"New session",h=c.slice(0,120);return d.run("INSERT INTO sessions (id, title, workspace, preview, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[a,g,b,h,e,e]),m(),{id:a,title:g,workspace:b,preview:h,createdAt:e,updatedAt:e}}async function r(a){let b=await n();return(a?o(b,"SELECT * FROM sessions WHERE workspace = ? ORDER BY updated_at DESC",[a]):o(b,"SELECT * FROM sessions ORDER BY updated_at DESC")).map(p)}async function s(a){(await n()).run("DELETE FROM sessions WHERE id = ?",[a]),m()}},6806:(a,b,c)=>{"use strict";c.d(b,{$3:()=>k,HR:()=>j,ig:()=>l});var d=c(1181),e=c.n(d),f=c(6492);async function g(){let a=await (0,f.Lf)(),b=function(a,b,c){let d=a.prepare(b);try{if(d.bind(c),d.step())return d.getAsObject().value;return}finally{d.free()}}(a,"SELECT value FROM config WHERE key = ?",["vapid_keys"]);if(b)return JSON.parse(b);let c=e().generateVAPIDKeys(),d={publicKey:c.publicKey,privateKey:c.privateKey};return a.run("INSERT INTO config (key, value) VALUES (?, ?)",["vapid_keys",JSON.stringify(d)]),d}let h=!1;async function i(){let a=await g();return h||(e().setVapidDetails("mailto:clr@localhost",a.publicKey,a.privateKey),h=!0),a}async function j(){return(await i()).publicKey}async function k(a){(await (0,f.Lf)()).run("INSERT OR REPLACE INTO push_subscriptions (endpoint, subscription, created_at) VALUES (?, ?, ?)",[a.endpoint,JSON.stringify(a),Date.now()])}async function l(a){(await (0,f.Lf)()).run("DELETE FROM push_subscriptions WHERE endpoint = ?",[a])}},8335:()=>{},9021:a=>{"use strict";a.exports=require("fs")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9439:a=>{"use strict";a.exports=require("os")},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[873],()=>b(b.s=5607));module.exports=c})();