@lyhue1991/pi-web 0.8.9 → 0.8.11

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 (198) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +7 -6
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/required-server-files.js +1 -1
  5. package/.next/required-server-files.json +1 -1
  6. package/.next/routes-manifest.json +6 -0
  7. package/.next/server/app/_global-error/page.js +3 -3
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  28. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  29. package/.next/server/app/api/agent/[id]/route.js +1 -1
  30. package/.next/server/app/api/agent/new/route.js +1 -1
  31. package/.next/server/app/api/agent/running/events/route.js +2 -2
  32. package/.next/server/app/api/agent/running/route.js +1 -1
  33. package/.next/server/app/api/app-update/route.js +1 -0
  34. package/.next/server/app/api/app-update/route.js.nft.json +1 -0
  35. package/.next/server/app/api/app-update/route_client-reference-manifest.js +1 -0
  36. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  37. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  38. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  39. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  40. package/.next/server/app/api/auth/providers/route.js +1 -1
  41. package/.next/server/app/api/cwd/browse/route.js +1 -1
  42. package/.next/server/app/api/cwd/validate/route.js +1 -1
  43. package/.next/server/app/api/default-cwd/route.js +1 -1
  44. package/.next/server/app/api/file-index/route.js +1 -1
  45. package/.next/server/app/api/files/[...path]/route.js +1 -1
  46. package/.next/server/app/api/git/diff/route.js +1 -1
  47. package/.next/server/app/api/git/status/route.js +2 -2
  48. package/.next/server/app/api/home/route.js +1 -1
  49. package/.next/server/app/api/models/route.js +1 -1
  50. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  51. package/.next/server/app/api/models-config/discover/route.js +1 -1
  52. package/.next/server/app/api/models-config/route.js +1 -1
  53. package/.next/server/app/api/models-config/test/route.js +1 -1
  54. package/.next/server/app/api/plugins/route.js +1 -1
  55. package/.next/server/app/api/project-trust/route.js +1 -1
  56. package/.next/server/app/api/sessions/[id]/auto-name/route.js +3 -3
  57. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  58. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  59. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  60. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  61. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  62. package/.next/server/app/api/sessions/route.js +1 -1
  63. package/.next/server/app/api/skills/check/route.js +1 -1
  64. package/.next/server/app/api/skills/install/route.js +1 -1
  65. package/.next/server/app/api/skills/route.js +2 -2
  66. package/.next/server/app/api/skills/search/route.js +1 -1
  67. package/.next/server/app/api/skills/update/route.js +1 -1
  68. package/.next/server/app/api/worktrees/route.js +1 -1
  69. package/.next/server/app/favicon.ico/route.js +1 -1
  70. package/.next/server/app/index.html +1 -1
  71. package/.next/server/app/index.rsc +6 -6
  72. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  73. package/.next/server/app/index.segments/_full.segment.rsc +6 -6
  74. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  75. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  76. package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  77. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  78. package/.next/server/app/manifest.webmanifest.body +1 -1
  79. package/.next/server/app/page.js +12 -4
  80. package/.next/server/app/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app-paths-manifest.json +7 -6
  82. package/.next/server/chunks/2325.js +2 -2
  83. package/.next/server/chunks/5582.js +2 -2
  84. package/.next/server/chunks/6429.js +1 -1
  85. package/.next/server/middleware-build-manifest.js +1 -1
  86. package/.next/server/pages/404.html +1 -1
  87. package/.next/server/pages/500.html +1 -1
  88. package/.next/static/Y3wut-kJDLcCh4UZn-zRj/_buildManifest.js +1 -0
  89. package/.next/static/chunks/5830-005dcf9c56a25234.js +7 -0
  90. package/.next/static/chunks/app/{api/agent/[id]/bash-output/route-35860f4efe0047e5.js → _global-error/page-169a43802549110e.js} +1 -1
  91. package/.next/static/chunks/app/api/agent/[id]/{events/route-35860f4efe0047e5.js → bash-output/route-169a43802549110e.js} +1 -1
  92. package/.next/static/chunks/app/api/agent/[id]/{route-35860f4efe0047e5.js → events/route-169a43802549110e.js} +1 -1
  93. package/.next/static/chunks/app/{_global-error/page-35860f4efe0047e5.js → api/agent/[id]/route-169a43802549110e.js} +1 -1
  94. package/.next/static/chunks/app/api/agent/new/route-169a43802549110e.js +1 -0
  95. package/.next/static/chunks/app/api/agent/running/events/route-169a43802549110e.js +1 -0
  96. package/.next/static/chunks/app/api/agent/running/route-169a43802549110e.js +1 -0
  97. package/.next/static/chunks/app/api/app-update/route-169a43802549110e.js +1 -0
  98. package/.next/static/chunks/app/api/auth/all-providers/route-169a43802549110e.js +1 -0
  99. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-169a43802549110e.js +1 -0
  100. package/.next/static/chunks/app/api/auth/login/[provider]/route-169a43802549110e.js +1 -0
  101. package/.next/static/chunks/app/api/auth/logout/[provider]/route-169a43802549110e.js +1 -0
  102. package/.next/static/chunks/app/api/auth/providers/route-169a43802549110e.js +1 -0
  103. package/.next/static/chunks/app/api/cwd/browse/route-169a43802549110e.js +1 -0
  104. package/.next/static/chunks/app/api/cwd/validate/route-169a43802549110e.js +1 -0
  105. package/.next/static/chunks/app/api/default-cwd/route-169a43802549110e.js +1 -0
  106. package/.next/static/chunks/app/api/file-index/route-169a43802549110e.js +1 -0
  107. package/.next/static/chunks/app/api/files/[...path]/route-169a43802549110e.js +1 -0
  108. package/.next/static/chunks/app/api/git/diff/route-169a43802549110e.js +1 -0
  109. package/.next/static/chunks/app/api/git/status/route-169a43802549110e.js +1 -0
  110. package/.next/static/chunks/app/api/home/route-169a43802549110e.js +1 -0
  111. package/.next/static/chunks/app/api/models/route-169a43802549110e.js +1 -0
  112. package/.next/static/chunks/app/api/models-config/catalog/route-169a43802549110e.js +1 -0
  113. package/.next/static/chunks/app/api/models-config/discover/route-169a43802549110e.js +1 -0
  114. package/.next/static/chunks/app/api/models-config/route-169a43802549110e.js +1 -0
  115. package/.next/static/chunks/app/api/models-config/test/route-169a43802549110e.js +1 -0
  116. package/.next/static/chunks/app/api/plugins/route-169a43802549110e.js +1 -0
  117. package/.next/static/chunks/app/api/project-trust/route-169a43802549110e.js +1 -0
  118. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-169a43802549110e.js +1 -0
  119. package/.next/static/chunks/app/api/sessions/[id]/context/route-169a43802549110e.js +1 -0
  120. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-169a43802549110e.js +1 -0
  121. package/.next/static/chunks/app/api/sessions/[id]/export/route-169a43802549110e.js +1 -0
  122. package/.next/static/chunks/app/api/sessions/[id]/route-169a43802549110e.js +1 -0
  123. package/.next/static/chunks/app/api/sessions/[id]/state/route-169a43802549110e.js +1 -0
  124. package/.next/static/chunks/app/api/sessions/route-169a43802549110e.js +1 -0
  125. package/.next/static/chunks/app/api/skills/check/route-169a43802549110e.js +1 -0
  126. package/.next/static/chunks/app/api/skills/install/route-169a43802549110e.js +1 -0
  127. package/.next/static/chunks/app/api/skills/route-169a43802549110e.js +1 -0
  128. package/.next/static/chunks/app/api/skills/search/route-169a43802549110e.js +1 -0
  129. package/.next/static/chunks/app/api/skills/update/route-169a43802549110e.js +1 -0
  130. package/.next/static/chunks/app/api/worktrees/route-169a43802549110e.js +1 -0
  131. package/.next/static/chunks/app/layout-d4ee15c25233e0ff.js +1 -0
  132. package/.next/static/chunks/app/manifest.webmanifest/route-169a43802549110e.js +1 -0
  133. package/.next/static/chunks/app/page-7e7db0fda0a48eb9.js +74 -0
  134. package/.next/static/chunks/next/dist/client/components/builtin/app-error-169a43802549110e.js +1 -0
  135. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-169a43802549110e.js +1 -0
  136. package/.next/static/chunks/next/dist/client/components/builtin/not-found-169a43802549110e.js +1 -0
  137. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-169a43802549110e.js +1 -0
  138. package/.next/static/css/{121a2cf33104c046.css → 4cbedad236d913cb.css} +1 -1
  139. package/.next/static/css/d37755afd25e5a62.css +1 -0
  140. package/.next/trace +6 -6
  141. package/.next/trace-build +1 -1
  142. package/.next/types/app/api/app-update/route.ts +351 -0
  143. package/.next/types/routes.d.ts +2 -1
  144. package/.next/types/validator.ts +9 -0
  145. package/README.ja.md +9 -1
  146. package/README.md +10 -1
  147. package/README.ru.md +9 -1
  148. package/README.zh-CN.md +9 -1
  149. package/package.json +5 -2
  150. package/public/sw.js +42 -0
  151. package/public/sw.test.mjs +86 -0
  152. package/.next/static/0higXHyDYAOyRelxENDyp/_buildManifest.js +0 -1
  153. package/.next/static/chunks/4948-5ec4f163df73e1c4.js +0 -1
  154. package/.next/static/chunks/app/api/agent/new/route-35860f4efe0047e5.js +0 -1
  155. package/.next/static/chunks/app/api/agent/running/events/route-35860f4efe0047e5.js +0 -1
  156. package/.next/static/chunks/app/api/agent/running/route-35860f4efe0047e5.js +0 -1
  157. package/.next/static/chunks/app/api/auth/all-providers/route-35860f4efe0047e5.js +0 -1
  158. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-35860f4efe0047e5.js +0 -1
  159. package/.next/static/chunks/app/api/auth/login/[provider]/route-35860f4efe0047e5.js +0 -1
  160. package/.next/static/chunks/app/api/auth/logout/[provider]/route-35860f4efe0047e5.js +0 -1
  161. package/.next/static/chunks/app/api/auth/providers/route-35860f4efe0047e5.js +0 -1
  162. package/.next/static/chunks/app/api/cwd/browse/route-35860f4efe0047e5.js +0 -1
  163. package/.next/static/chunks/app/api/cwd/validate/route-35860f4efe0047e5.js +0 -1
  164. package/.next/static/chunks/app/api/default-cwd/route-35860f4efe0047e5.js +0 -1
  165. package/.next/static/chunks/app/api/file-index/route-35860f4efe0047e5.js +0 -1
  166. package/.next/static/chunks/app/api/files/[...path]/route-35860f4efe0047e5.js +0 -1
  167. package/.next/static/chunks/app/api/git/diff/route-35860f4efe0047e5.js +0 -1
  168. package/.next/static/chunks/app/api/git/status/route-35860f4efe0047e5.js +0 -1
  169. package/.next/static/chunks/app/api/home/route-35860f4efe0047e5.js +0 -1
  170. package/.next/static/chunks/app/api/models/route-35860f4efe0047e5.js +0 -1
  171. package/.next/static/chunks/app/api/models-config/catalog/route-35860f4efe0047e5.js +0 -1
  172. package/.next/static/chunks/app/api/models-config/discover/route-35860f4efe0047e5.js +0 -1
  173. package/.next/static/chunks/app/api/models-config/route-35860f4efe0047e5.js +0 -1
  174. package/.next/static/chunks/app/api/models-config/test/route-35860f4efe0047e5.js +0 -1
  175. package/.next/static/chunks/app/api/plugins/route-35860f4efe0047e5.js +0 -1
  176. package/.next/static/chunks/app/api/project-trust/route-35860f4efe0047e5.js +0 -1
  177. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-35860f4efe0047e5.js +0 -1
  178. package/.next/static/chunks/app/api/sessions/[id]/context/route-35860f4efe0047e5.js +0 -1
  179. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-35860f4efe0047e5.js +0 -1
  180. package/.next/static/chunks/app/api/sessions/[id]/export/route-35860f4efe0047e5.js +0 -1
  181. package/.next/static/chunks/app/api/sessions/[id]/route-35860f4efe0047e5.js +0 -1
  182. package/.next/static/chunks/app/api/sessions/[id]/state/route-35860f4efe0047e5.js +0 -1
  183. package/.next/static/chunks/app/api/sessions/route-35860f4efe0047e5.js +0 -1
  184. package/.next/static/chunks/app/api/skills/check/route-35860f4efe0047e5.js +0 -1
  185. package/.next/static/chunks/app/api/skills/install/route-35860f4efe0047e5.js +0 -1
  186. package/.next/static/chunks/app/api/skills/route-35860f4efe0047e5.js +0 -1
  187. package/.next/static/chunks/app/api/skills/search/route-35860f4efe0047e5.js +0 -1
  188. package/.next/static/chunks/app/api/skills/update/route-35860f4efe0047e5.js +0 -1
  189. package/.next/static/chunks/app/api/worktrees/route-35860f4efe0047e5.js +0 -1
  190. package/.next/static/chunks/app/layout-31f2ba37eb37389a.js +0 -1
  191. package/.next/static/chunks/app/manifest.webmanifest/route-35860f4efe0047e5.js +0 -1
  192. package/.next/static/chunks/app/page-e7bc895400a4e9ee.js +0 -72
  193. package/.next/static/chunks/next/dist/client/components/builtin/app-error-35860f4efe0047e5.js +0 -1
  194. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-35860f4efe0047e5.js +0 -1
  195. package/.next/static/chunks/next/dist/client/components/builtin/not-found-35860f4efe0047e5.js +0 -1
  196. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-35860f4efe0047e5.js +0 -1
  197. package/.next/static/css/5abc1265b2e78c04.css +0 -1
  198. /package/.next/static/{0higXHyDYAOyRelxENDyp → Y3wut-kJDLcCh4UZn-zRj}/_ssgManifest.js +0 -0
@@ -0,0 +1,86 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ const listeners = new Map();
5
+ globalThis.self = {
6
+ location: {
7
+ href: "https://pi.test/sw.js?v=test",
8
+ origin: "https://pi.test",
9
+ },
10
+ addEventListener: (type, listener) => listeners.set(type, listener),
11
+ clients: null,
12
+ };
13
+
14
+ await import("./sw.js");
15
+
16
+ function dispatchNotificationClick(data) {
17
+ let pending;
18
+ let closed = false;
19
+ listeners.get("notificationclick")({
20
+ notification: {
21
+ data,
22
+ close: () => { closed = true; },
23
+ },
24
+ waitUntil: (promise) => { pending = promise; },
25
+ });
26
+ return { pending, wasClosed: () => closed };
27
+ }
28
+
29
+ test("notification click focuses an existing client at the session URL", async () => {
30
+ const calls = [];
31
+ const focusedClient = {
32
+ url: "https://pi.test/?session=session-1",
33
+ focus: async () => { calls.push("focus"); },
34
+ navigate: async () => assert.fail("exact client should not navigate"),
35
+ };
36
+ self.clients = {
37
+ matchAll: async () => [focusedClient],
38
+ openWindow: async () => assert.fail("existing client should be reused"),
39
+ };
40
+
41
+ const event = dispatchNotificationClick({ url: "/?session=session-1" });
42
+ await event.pending;
43
+
44
+ assert.equal(event.wasClosed(), true);
45
+ assert.deepEqual(calls, ["focus"]);
46
+ });
47
+
48
+ test("notification click navigates an existing client to the session", async () => {
49
+ const calls = [];
50
+ const navigatedClient = {
51
+ focus: async () => { calls.push("focus"); },
52
+ };
53
+ const existingClient = {
54
+ url: "https://pi.test/?session=other-session",
55
+ navigate: async (url) => {
56
+ calls.push(["navigate", url]);
57
+ return navigatedClient;
58
+ },
59
+ focus: async () => assert.fail("the navigated client should be focused"),
60
+ };
61
+ self.clients = {
62
+ matchAll: async () => [existingClient],
63
+ openWindow: async () => assert.fail("existing client should be reused"),
64
+ };
65
+
66
+ const event = dispatchNotificationClick({ url: "/?session=session-1" });
67
+ await event.pending;
68
+
69
+ assert.deepEqual(calls, [
70
+ ["navigate", "https://pi.test/?session=session-1"],
71
+ "focus",
72
+ ]);
73
+ });
74
+
75
+ test("notification click opens a window and rejects cross-origin targets", async () => {
76
+ const opened = [];
77
+ self.clients = {
78
+ matchAll: async () => [],
79
+ openWindow: async (url) => { opened.push(url); },
80
+ };
81
+
82
+ const event = dispatchNotificationClick({ url: "https://example.com/redirect" });
83
+ await event.pending;
84
+
85
+ assert.deepEqual(opened, ["https://pi.test/"]);
86
+ });
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:31,errorRate:1e-4,numBits:595,numHashes:14,bitArray:[0,0,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,0,1,1,1,0,1,1,0,1,0,1,1,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,0,1,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1,1,1,1,0,0,0,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,1,0,1,1,0,0,0,1,0,1,0,1,1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,1,1,0,0,0,1,0,0,1,0,1,1,1,0,1,0,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,1,0,0,0,1,1,0,1,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,0,0,1,1,0,1,0,1,0,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,0,0,1,1,0,0,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,1,0]},__routerFilterDynamic:{numItems:6,errorRate:1e-4,numBits:116,numHashes:14,bitArray:[1,1,0,0,0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,0,1,1,0,1,0,1,1,0,0,0,1,0,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,1,0,0,0,1,1,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,1,1,1,1,1,0,0,1,0,1,0,0,1,1,0,0,0]},sortedPages:["/_app"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();