@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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +7 -6
- package/.next/build-manifest.json +2 -2
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/events/route.js +2 -2
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -0
- package/.next/server/app/api/app-update/route.js.nft.json +1 -0
- package/.next/server/app/api/app-update/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +2 -2
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +3 -3
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +6 -6
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest.body +1 -1
- package/.next/server/app/page.js +12 -4
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +7 -6
- package/.next/server/chunks/2325.js +2 -2
- package/.next/server/chunks/5582.js +2 -2
- package/.next/server/chunks/6429.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/Y3wut-kJDLcCh4UZn-zRj/_buildManifest.js +1 -0
- package/.next/static/chunks/5830-005dcf9c56a25234.js +7 -0
- package/.next/static/chunks/app/{api/agent/[id]/bash-output/route-35860f4efe0047e5.js → _global-error/page-169a43802549110e.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/{events/route-35860f4efe0047e5.js → bash-output/route-169a43802549110e.js} +1 -1
- package/.next/static/chunks/app/api/agent/[id]/{route-35860f4efe0047e5.js → events/route-169a43802549110e.js} +1 -1
- package/.next/static/chunks/app/{_global-error/page-35860f4efe0047e5.js → api/agent/[id]/route-169a43802549110e.js} +1 -1
- package/.next/static/chunks/app/api/agent/new/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/agent/running/events/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/agent/running/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/app-update/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/cwd/browse/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/cwd/validate/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/file-index/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/home/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/models/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/models-config/catalog/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/project-trust/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/export/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/state/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/skills/check/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/skills/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/skills/update/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/layout-d4ee15c25233e0ff.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-169a43802549110e.js +1 -0
- package/.next/static/chunks/app/page-7e7db0fda0a48eb9.js +74 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-169a43802549110e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-169a43802549110e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-169a43802549110e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-169a43802549110e.js +1 -0
- package/.next/static/css/{121a2cf33104c046.css → 4cbedad236d913cb.css} +1 -1
- package/.next/static/css/d37755afd25e5a62.css +1 -0
- package/.next/trace +6 -6
- package/.next/trace-build +1 -1
- package/.next/types/app/api/app-update/route.ts +351 -0
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/README.ja.md +9 -1
- package/README.md +10 -1
- package/README.ru.md +9 -1
- package/README.zh-CN.md +9 -1
- package/package.json +5 -2
- package/public/sw.js +42 -0
- package/public/sw.test.mjs +86 -0
- package/.next/static/0higXHyDYAOyRelxENDyp/_buildManifest.js +0 -1
- package/.next/static/chunks/4948-5ec4f163df73e1c4.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/agent/running/events/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/agent/running/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/cwd/browse/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/cwd/validate/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/file-index/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/home/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/models/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/models-config/catalog/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/plugins/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/project-trust/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/export/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/state/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/skills/check/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/skills/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/skills/update/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/layout-31f2ba37eb37389a.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/app/page-e7bc895400a4e9ee.js +0 -72
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-35860f4efe0047e5.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-35860f4efe0047e5.js +0 -1
- package/.next/static/css/5abc1265b2e78c04.css +0 -1
- /package/.next/static/{0higXHyDYAOyRelxENDyp → Y3wut-kJDLcCh4UZn-zRj}/_ssgManifest.js +0 -0
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":4726605,"timestamp":210134520592,"id":14,"parentId":1,"tags":{},"startTime":1786322268551,"traceId":"e428a2373c9a1606"},{"name":"run-typescript","duration":3498045,"timestamp":210139248747,"id":648,"parentId":1,"tags":{},"startTime":1786322273279,"traceId":"e428a2373c9a1606"},{"name":"static-check","duration":1045989,"timestamp":210142756176,"id":651,"parentId":1,"tags":{},"startTime":1786322276787,"traceId":"e428a2373c9a1606"},{"name":"static-generation","duration":1756190,"timestamp":210144072237,"id":747,"parentId":1,"tags":{},"startTime":1786322278103,"traceId":"e428a2373c9a1606"},{"name":"collect-build-traces","duration":8828412,"timestamp":210143803337,"id":744,"parentId":1,"tags":{},"startTime":1786322277834,"traceId":"e428a2373c9a1606"},{"name":"telemetry-flush","duration":15,"timestamp":210152633067,"id":756,"parentId":1,"tags":{},"startTime":1786322286663,"traceId":"e428a2373c9a1606"},{"name":"next-build","duration":18184151,"timestamp":210134448935,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1786322268479,"traceId":"e428a2373c9a1606"}]
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// File: /Users/liangyun/Codes/pi-web/app/api/app-update/route.ts
|
|
2
|
+
import * as entry from '../../../../../app/api/app-update/route.js'
|
|
3
|
+
import type { NextRequest } from 'next/server.js'
|
|
4
|
+
|
|
5
|
+
import type { InstantConfigForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
|
|
6
|
+
|
|
7
|
+
type TEntry = typeof import('../../../../../app/api/app-update/route.js')
|
|
8
|
+
|
|
9
|
+
type SegmentParams<T extends Object = any> = T extends Record<string, any>
|
|
10
|
+
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
|
|
11
|
+
: T
|
|
12
|
+
|
|
13
|
+
// Check that the entry is a valid entry
|
|
14
|
+
checkFields<Diff<{
|
|
15
|
+
GET?: Function
|
|
16
|
+
HEAD?: Function
|
|
17
|
+
OPTIONS?: Function
|
|
18
|
+
POST?: Function
|
|
19
|
+
PUT?: Function
|
|
20
|
+
DELETE?: Function
|
|
21
|
+
PATCH?: Function
|
|
22
|
+
config?: {}
|
|
23
|
+
generateStaticParams?: Function
|
|
24
|
+
unstable_instant?: InstantConfigForTypeCheckInternal
|
|
25
|
+
unstable_dynamicStaleTime?: number
|
|
26
|
+
revalidate?: RevalidateRange<TEntry> | false
|
|
27
|
+
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
|
|
28
|
+
dynamicParams?: boolean
|
|
29
|
+
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
|
|
30
|
+
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
|
|
31
|
+
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
|
|
32
|
+
maxDuration?: number
|
|
33
|
+
|
|
34
|
+
}, TEntry, ''>>()
|
|
35
|
+
|
|
36
|
+
type RouteContext = { params: Promise<SegmentParams> }
|
|
37
|
+
// Check the prop type of the entry function
|
|
38
|
+
if ('GET' in entry) {
|
|
39
|
+
checkFields<
|
|
40
|
+
Diff<
|
|
41
|
+
ParamCheck<Request | NextRequest>,
|
|
42
|
+
{
|
|
43
|
+
__tag__: 'GET'
|
|
44
|
+
__param_position__: 'first'
|
|
45
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
|
|
46
|
+
},
|
|
47
|
+
'GET'
|
|
48
|
+
>
|
|
49
|
+
>()
|
|
50
|
+
checkFields<
|
|
51
|
+
Diff<
|
|
52
|
+
ParamCheck<RouteContext>,
|
|
53
|
+
{
|
|
54
|
+
__tag__: 'GET'
|
|
55
|
+
__param_position__: 'second'
|
|
56
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
|
|
57
|
+
},
|
|
58
|
+
'GET'
|
|
59
|
+
>
|
|
60
|
+
>()
|
|
61
|
+
|
|
62
|
+
checkFields<
|
|
63
|
+
Diff<
|
|
64
|
+
{
|
|
65
|
+
__tag__: 'GET',
|
|
66
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
__tag__: 'GET',
|
|
70
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
|
|
71
|
+
},
|
|
72
|
+
'GET'
|
|
73
|
+
>
|
|
74
|
+
>()
|
|
75
|
+
}
|
|
76
|
+
// Check the prop type of the entry function
|
|
77
|
+
if ('HEAD' in entry) {
|
|
78
|
+
checkFields<
|
|
79
|
+
Diff<
|
|
80
|
+
ParamCheck<Request | NextRequest>,
|
|
81
|
+
{
|
|
82
|
+
__tag__: 'HEAD'
|
|
83
|
+
__param_position__: 'first'
|
|
84
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
|
|
85
|
+
},
|
|
86
|
+
'HEAD'
|
|
87
|
+
>
|
|
88
|
+
>()
|
|
89
|
+
checkFields<
|
|
90
|
+
Diff<
|
|
91
|
+
ParamCheck<RouteContext>,
|
|
92
|
+
{
|
|
93
|
+
__tag__: 'HEAD'
|
|
94
|
+
__param_position__: 'second'
|
|
95
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
|
|
96
|
+
},
|
|
97
|
+
'HEAD'
|
|
98
|
+
>
|
|
99
|
+
>()
|
|
100
|
+
|
|
101
|
+
checkFields<
|
|
102
|
+
Diff<
|
|
103
|
+
{
|
|
104
|
+
__tag__: 'HEAD',
|
|
105
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
__tag__: 'HEAD',
|
|
109
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
|
|
110
|
+
},
|
|
111
|
+
'HEAD'
|
|
112
|
+
>
|
|
113
|
+
>()
|
|
114
|
+
}
|
|
115
|
+
// Check the prop type of the entry function
|
|
116
|
+
if ('OPTIONS' in entry) {
|
|
117
|
+
checkFields<
|
|
118
|
+
Diff<
|
|
119
|
+
ParamCheck<Request | NextRequest>,
|
|
120
|
+
{
|
|
121
|
+
__tag__: 'OPTIONS'
|
|
122
|
+
__param_position__: 'first'
|
|
123
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
|
|
124
|
+
},
|
|
125
|
+
'OPTIONS'
|
|
126
|
+
>
|
|
127
|
+
>()
|
|
128
|
+
checkFields<
|
|
129
|
+
Diff<
|
|
130
|
+
ParamCheck<RouteContext>,
|
|
131
|
+
{
|
|
132
|
+
__tag__: 'OPTIONS'
|
|
133
|
+
__param_position__: 'second'
|
|
134
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
|
|
135
|
+
},
|
|
136
|
+
'OPTIONS'
|
|
137
|
+
>
|
|
138
|
+
>()
|
|
139
|
+
|
|
140
|
+
checkFields<
|
|
141
|
+
Diff<
|
|
142
|
+
{
|
|
143
|
+
__tag__: 'OPTIONS',
|
|
144
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
__tag__: 'OPTIONS',
|
|
148
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
|
|
149
|
+
},
|
|
150
|
+
'OPTIONS'
|
|
151
|
+
>
|
|
152
|
+
>()
|
|
153
|
+
}
|
|
154
|
+
// Check the prop type of the entry function
|
|
155
|
+
if ('POST' in entry) {
|
|
156
|
+
checkFields<
|
|
157
|
+
Diff<
|
|
158
|
+
ParamCheck<Request | NextRequest>,
|
|
159
|
+
{
|
|
160
|
+
__tag__: 'POST'
|
|
161
|
+
__param_position__: 'first'
|
|
162
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
|
|
163
|
+
},
|
|
164
|
+
'POST'
|
|
165
|
+
>
|
|
166
|
+
>()
|
|
167
|
+
checkFields<
|
|
168
|
+
Diff<
|
|
169
|
+
ParamCheck<RouteContext>,
|
|
170
|
+
{
|
|
171
|
+
__tag__: 'POST'
|
|
172
|
+
__param_position__: 'second'
|
|
173
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
|
|
174
|
+
},
|
|
175
|
+
'POST'
|
|
176
|
+
>
|
|
177
|
+
>()
|
|
178
|
+
|
|
179
|
+
checkFields<
|
|
180
|
+
Diff<
|
|
181
|
+
{
|
|
182
|
+
__tag__: 'POST',
|
|
183
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
__tag__: 'POST',
|
|
187
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
|
|
188
|
+
},
|
|
189
|
+
'POST'
|
|
190
|
+
>
|
|
191
|
+
>()
|
|
192
|
+
}
|
|
193
|
+
// Check the prop type of the entry function
|
|
194
|
+
if ('PUT' in entry) {
|
|
195
|
+
checkFields<
|
|
196
|
+
Diff<
|
|
197
|
+
ParamCheck<Request | NextRequest>,
|
|
198
|
+
{
|
|
199
|
+
__tag__: 'PUT'
|
|
200
|
+
__param_position__: 'first'
|
|
201
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
|
|
202
|
+
},
|
|
203
|
+
'PUT'
|
|
204
|
+
>
|
|
205
|
+
>()
|
|
206
|
+
checkFields<
|
|
207
|
+
Diff<
|
|
208
|
+
ParamCheck<RouteContext>,
|
|
209
|
+
{
|
|
210
|
+
__tag__: 'PUT'
|
|
211
|
+
__param_position__: 'second'
|
|
212
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
|
|
213
|
+
},
|
|
214
|
+
'PUT'
|
|
215
|
+
>
|
|
216
|
+
>()
|
|
217
|
+
|
|
218
|
+
checkFields<
|
|
219
|
+
Diff<
|
|
220
|
+
{
|
|
221
|
+
__tag__: 'PUT',
|
|
222
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
__tag__: 'PUT',
|
|
226
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
|
|
227
|
+
},
|
|
228
|
+
'PUT'
|
|
229
|
+
>
|
|
230
|
+
>()
|
|
231
|
+
}
|
|
232
|
+
// Check the prop type of the entry function
|
|
233
|
+
if ('DELETE' in entry) {
|
|
234
|
+
checkFields<
|
|
235
|
+
Diff<
|
|
236
|
+
ParamCheck<Request | NextRequest>,
|
|
237
|
+
{
|
|
238
|
+
__tag__: 'DELETE'
|
|
239
|
+
__param_position__: 'first'
|
|
240
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
|
|
241
|
+
},
|
|
242
|
+
'DELETE'
|
|
243
|
+
>
|
|
244
|
+
>()
|
|
245
|
+
checkFields<
|
|
246
|
+
Diff<
|
|
247
|
+
ParamCheck<RouteContext>,
|
|
248
|
+
{
|
|
249
|
+
__tag__: 'DELETE'
|
|
250
|
+
__param_position__: 'second'
|
|
251
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
|
|
252
|
+
},
|
|
253
|
+
'DELETE'
|
|
254
|
+
>
|
|
255
|
+
>()
|
|
256
|
+
|
|
257
|
+
checkFields<
|
|
258
|
+
Diff<
|
|
259
|
+
{
|
|
260
|
+
__tag__: 'DELETE',
|
|
261
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
__tag__: 'DELETE',
|
|
265
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
|
|
266
|
+
},
|
|
267
|
+
'DELETE'
|
|
268
|
+
>
|
|
269
|
+
>()
|
|
270
|
+
}
|
|
271
|
+
// Check the prop type of the entry function
|
|
272
|
+
if ('PATCH' in entry) {
|
|
273
|
+
checkFields<
|
|
274
|
+
Diff<
|
|
275
|
+
ParamCheck<Request | NextRequest>,
|
|
276
|
+
{
|
|
277
|
+
__tag__: 'PATCH'
|
|
278
|
+
__param_position__: 'first'
|
|
279
|
+
__param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
|
|
280
|
+
},
|
|
281
|
+
'PATCH'
|
|
282
|
+
>
|
|
283
|
+
>()
|
|
284
|
+
checkFields<
|
|
285
|
+
Diff<
|
|
286
|
+
ParamCheck<RouteContext>,
|
|
287
|
+
{
|
|
288
|
+
__tag__: 'PATCH'
|
|
289
|
+
__param_position__: 'second'
|
|
290
|
+
__param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
|
|
291
|
+
},
|
|
292
|
+
'PATCH'
|
|
293
|
+
>
|
|
294
|
+
>()
|
|
295
|
+
|
|
296
|
+
checkFields<
|
|
297
|
+
Diff<
|
|
298
|
+
{
|
|
299
|
+
__tag__: 'PATCH',
|
|
300
|
+
__return_type__: Response | void | never | Promise<Response | void | never>
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
__tag__: 'PATCH',
|
|
304
|
+
__return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
|
|
305
|
+
},
|
|
306
|
+
'PATCH'
|
|
307
|
+
>
|
|
308
|
+
>()
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Check the arguments and return type of the generateStaticParams function
|
|
312
|
+
if ('generateStaticParams' in entry) {
|
|
313
|
+
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
|
|
314
|
+
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface PageProps {
|
|
318
|
+
params?: Promise<SegmentParams>
|
|
319
|
+
searchParams?: Promise<any>
|
|
320
|
+
}
|
|
321
|
+
export interface LayoutProps {
|
|
322
|
+
children?: React.ReactNode
|
|
323
|
+
|
|
324
|
+
params?: Promise<SegmentParams>
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// =============
|
|
328
|
+
// Utility types
|
|
329
|
+
type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
|
|
330
|
+
|
|
331
|
+
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
|
|
332
|
+
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
|
|
333
|
+
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
|
|
334
|
+
|
|
335
|
+
type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
|
|
336
|
+
type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
|
|
337
|
+
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
|
|
338
|
+
|
|
339
|
+
type ParamCheck<T> = {
|
|
340
|
+
__tag__: string
|
|
341
|
+
__param_position__: string
|
|
342
|
+
__param_type__: T
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function checkFields<_ extends { [k in keyof any]: never }>() {}
|
|
346
|
+
|
|
347
|
+
// https://github.com/sindresorhus/type-fest
|
|
348
|
+
type Numeric = number | bigint
|
|
349
|
+
type Zero = 0 | 0n
|
|
350
|
+
type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
|
|
351
|
+
type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
|
package/.next/types/routes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Do not edit this file manually
|
|
3
3
|
|
|
4
4
|
type AppRoutes = "/"
|
|
5
|
-
type AppRouteHandlerRoutes = "/api/agent/[id]" | "/api/agent/[id]/bash-output" | "/api/agent/[id]/events" | "/api/agent/new" | "/api/agent/running" | "/api/agent/running/events" | "/api/auth/all-providers" | "/api/auth/api-key/[provider]" | "/api/auth/login/[provider]" | "/api/auth/logout/[provider]" | "/api/auth/providers" | "/api/cwd/browse" | "/api/cwd/validate" | "/api/default-cwd" | "/api/file-index" | "/api/files/[...path]" | "/api/git/diff" | "/api/git/status" | "/api/home" | "/api/models" | "/api/models-config" | "/api/models-config/catalog" | "/api/models-config/discover" | "/api/models-config/test" | "/api/plugins" | "/api/project-trust" | "/api/sessions" | "/api/sessions/[id]" | "/api/sessions/[id]/auto-name" | "/api/sessions/[id]/context" | "/api/sessions/[id]/entries/[entryId]/thinking" | "/api/sessions/[id]/export" | "/api/sessions/[id]/state" | "/api/skills" | "/api/skills/check" | "/api/skills/install" | "/api/skills/search" | "/api/skills/update" | "/api/worktrees"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/agent/[id]" | "/api/agent/[id]/bash-output" | "/api/agent/[id]/events" | "/api/agent/new" | "/api/agent/running" | "/api/agent/running/events" | "/api/app-update" | "/api/auth/all-providers" | "/api/auth/api-key/[provider]" | "/api/auth/login/[provider]" | "/api/auth/logout/[provider]" | "/api/auth/providers" | "/api/cwd/browse" | "/api/cwd/validate" | "/api/default-cwd" | "/api/file-index" | "/api/files/[...path]" | "/api/git/diff" | "/api/git/status" | "/api/home" | "/api/models" | "/api/models-config" | "/api/models-config/catalog" | "/api/models-config/discover" | "/api/models-config/test" | "/api/plugins" | "/api/project-trust" | "/api/sessions" | "/api/sessions/[id]" | "/api/sessions/[id]/auto-name" | "/api/sessions/[id]/context" | "/api/sessions/[id]/entries/[entryId]/thinking" | "/api/sessions/[id]/export" | "/api/sessions/[id]/state" | "/api/skills" | "/api/skills/check" | "/api/skills/install" | "/api/skills/search" | "/api/skills/update" | "/api/worktrees"
|
|
6
6
|
type PageRoutes = never
|
|
7
7
|
type LayoutRoutes = "/"
|
|
8
8
|
type RedirectRoutes = never
|
|
@@ -18,6 +18,7 @@ interface ParamMap {
|
|
|
18
18
|
"/api/agent/new": {}
|
|
19
19
|
"/api/agent/running": {}
|
|
20
20
|
"/api/agent/running/events": {}
|
|
21
|
+
"/api/app-update": {}
|
|
21
22
|
"/api/auth/all-providers": {}
|
|
22
23
|
"/api/auth/api-key/[provider]": { "provider": string; }
|
|
23
24
|
"/api/auth/login/[provider]": { "provider": string; }
|
package/.next/types/validator.ts
CHANGED
|
@@ -110,6 +110,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
110
110
|
type __Unused = __Check
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
// Validate ../../app/api/app-update/route.ts
|
|
114
|
+
{
|
|
115
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/app-update">> = Specific
|
|
116
|
+
const handler = {} as typeof import("../../app/api/app-update/route.js")
|
|
117
|
+
type __Check = __IsExpected<typeof handler>
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
type __Unused = __Check
|
|
120
|
+
}
|
|
121
|
+
|
|
113
122
|
// Validate ../../app/api/auth/all-providers/route.ts
|
|
114
123
|
{
|
|
115
124
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/all-providers">> = Specific
|
package/README.ja.md
CHANGED
|
@@ -21,10 +21,17 @@ npx @lyhue1991/pi-web@latest
|
|
|
21
21
|
**またはグローバルにインストール:**
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
# 初回インストールまたはアップグレード
|
|
25
|
+
npm install -g @lyhue1991/pi-web@latest
|
|
25
26
|
pi-web
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
**グローバルインストールをアンインストール:**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm uninstall -g @agegr/pi-web
|
|
33
|
+
```
|
|
34
|
+
|
|
28
35
|
続いて [http://127.0.0.1:30141](http://127.0.0.1:30141) を開きます。サーバーの準備が整うと、CLI はブラウザを自動的に開こうとします。Pi Web はデフォルトで `127.0.0.1` のみをリッスンします。
|
|
29
36
|
|
|
30
37
|
**オプション:**
|
|
@@ -82,6 +89,7 @@ npx @lyhue1991/pi-web@latest
|
|
|
82
89
|
|
|
83
90
|
- **データディレクトリ**:Pi Web はデフォルトで `~/.pi/agent/sessions` を読み込みます。別の pi エージェントディレクトリを指定するには `PI_CODING_AGENT_DIR` を設定してください。
|
|
84
91
|
- **セッションファイル**:ファイルは `~/.pi/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl` に保存されます。
|
|
92
|
+
- **実行環境**:セッションの作業ディレクトリを利用できるよう、Pi Web は pi と同じ OS またはコンテナで実行してください。
|
|
85
93
|
- **モデル設定**:Models パネルは pi エージェントディレクトリ内の `models.json` を読み書きします。モデルの一覧とデフォルト値は pi の設定から取得されます。
|
|
86
94
|
- **ファイルアクセス**:ファイルの閲覧とプレビューは、選択したプロジェクトディレクトリとセッションに含まれる作業ディレクトリに限定されます。
|
|
87
95
|
- **Git worktree**:切り替え機能が表示される条件、新しい worktree の作成方法、削除時の動作については、[Pi Web の Worktree](./docs/worktrees.md) を参照してください。
|
package/README.md
CHANGED
|
@@ -21,10 +21,17 @@ npx @lyhue1991/pi-web@latest
|
|
|
21
21
|
**Or install globally:**
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
# Install or upgrade
|
|
25
|
+
npm install -g @lyhue1991/pi-web@latest
|
|
25
26
|
pi-web
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
**Uninstall a global installation:**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm uninstall -g @agegr/pi-web
|
|
33
|
+
```
|
|
34
|
+
|
|
28
35
|
Then open [http://127.0.0.1:30141](http://127.0.0.1:30141). The CLI will try to open the browser automatically after the server is ready. Pi Web listens on `127.0.0.1` by default.
|
|
29
36
|
|
|
30
37
|
**Options:**
|
|
@@ -83,6 +90,7 @@ npx @lyhue1991/pi-web@latest
|
|
|
83
90
|
|
|
84
91
|
- **Data directory**: Pi Web reads `~/.pi/agent/sessions` by default. Set `PI_CODING_AGENT_DIR` to point at another pi agent directory.
|
|
85
92
|
- **Session files**: files are stored as `~/.pi/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl`.
|
|
93
|
+
- **Runtime environment**: run Pi Web in the same OS or container as pi so session working directories remain available.
|
|
86
94
|
- **Model config**: the Models panel reads and writes `models.json` in the pi agent directory. Model lists and defaults come from pi's config.
|
|
87
95
|
- **File access**: file browsing and preview are scoped to the selected project directory and working directories that appear in sessions.
|
|
88
96
|
- **Git worktrees**: see [Worktrees in Pi Web](./docs/worktrees.md) for when the switcher appears, how new worktrees are created, and what removal does.
|
|
@@ -101,6 +109,7 @@ The local dev server runs at [http://127.0.0.1:30141](http://127.0.0.1:30141).
|
|
|
101
109
|
Common checks:
|
|
102
110
|
|
|
103
111
|
```bash
|
|
112
|
+
npm test
|
|
104
113
|
node_modules/.bin/tsc --noEmit
|
|
105
114
|
npm run lint
|
|
106
115
|
```
|
package/README.ru.md
CHANGED
|
@@ -21,10 +21,17 @@ npx @lyhue1991/pi-web@latest
|
|
|
21
21
|
**Или глобальная установка:**
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
# Первая установка или обновление
|
|
25
|
+
npm install -g @lyhue1991/pi-web@latest
|
|
25
26
|
pi-web
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
**Удаление глобальной установки:**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm uninstall -g @agegr/pi-web
|
|
33
|
+
```
|
|
34
|
+
|
|
28
35
|
Затем откройте [http://127.0.0.1:30141](http://127.0.0.1:30141). После запуска сервера CLI попытается автоматически открыть браузер. По умолчанию Pi Web прослушивает только `127.0.0.1`.
|
|
29
36
|
|
|
30
37
|
**Параметры:**
|
|
@@ -83,6 +90,7 @@ npx @lyhue1991/pi-web@latest
|
|
|
83
90
|
|
|
84
91
|
- **Каталог данных**: по умолчанию Pi Web читает `~/.pi/agent/sessions`. Чтобы указать другой каталог агента pi, задайте `PI_CODING_AGENT_DIR`.
|
|
85
92
|
- **Файлы сессий**: файлы хранятся по пути `~/.pi/agent/sessions/<encoded-cwd>/<timestamp>_<uuid>.jsonl`.
|
|
93
|
+
- **Среда выполнения**: запускайте Pi Web в той же ОС или контейнере, что и pi, чтобы рабочие каталоги из сессий были доступны.
|
|
86
94
|
- **Настройка моделей**: панель Models читает и записывает `models.json` в каталоге агента pi. Список моделей и модель по умолчанию берутся из конфигурации pi.
|
|
87
95
|
- **Доступ к файлам**: просмотр файлов ограничен выбранным каталогом проекта и рабочими каталогами, которые встречаются в сессиях.
|
|
88
96
|
- **Git worktree**: условия отображения переключателя, создание новых рабочих деревьев и их удаление описаны в документе [Worktrees in Pi Web](./docs/worktrees.md).
|
package/README.zh-CN.md
CHANGED
|
@@ -19,10 +19,17 @@ npx @lyhue1991/pi-web@latest
|
|
|
19
19
|
**或全局安装后使用:**
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
|
|
22
|
+
# 首次安装或升级
|
|
23
|
+
npm install -g @lyhue1991/pi-web@latest
|
|
23
24
|
pi-web
|
|
24
25
|
```
|
|
25
26
|
|
|
27
|
+
**卸载全局安装:**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm uninstall -g @agegr/pi-web
|
|
31
|
+
```
|
|
32
|
+
|
|
26
33
|
启动后打开 [http://127.0.0.1:30141](http://127.0.0.1:30141)。命令行版本会在服务就绪后尝试自动打开浏览器。Pi Web 默认仅监听 `127.0.0.1`。
|
|
27
34
|
|
|
28
35
|
**可选参数:**
|
|
@@ -80,6 +87,7 @@ npx @lyhue1991/pi-web@latest
|
|
|
80
87
|
|
|
81
88
|
- **数据目录**:默认读取 `~/.pi/agent/sessions` 下的会话文件。可通过环境变量 `PI_CODING_AGENT_DIR` 指定其他 pi agent 目录。
|
|
82
89
|
- **会话文件**:路径形如 `~/.pi/agent/sessions/<编码后的工作目录>/<时间戳>_<uuid>.jsonl`。
|
|
90
|
+
- **运行环境**:建议 Pi Web 与 pi 使用相同的操作系统或容器,确保会话中的工作目录可用。
|
|
83
91
|
- **模型配置**:Models 面板读写 pi agent 目录下的 `models.json`,模型列表和默认模型由 pi 的配置解析得到。
|
|
84
92
|
- **文件访问**:文件浏览和预览面向当前选择的项目目录,以及会话中已出现过的工作目录。
|
|
85
93
|
- **Git worktree**:什么时候显示切换器、新建目录在哪里、删除会影响什么,见 [Pi Web 里的 Worktree](./docs/worktrees.zh-CN.md)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyhue1991/pi-web",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
4
4
|
"description": "Web UI for the pi coding agent",
|
|
5
5
|
"homepage": "https://github.com/lyhue1991/pi-web#readme",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"start": "next start -H 127.0.0.1 -p 30141",
|
|
38
38
|
"start:lan": "next start -H 0.0.0.0 -p 30141",
|
|
39
39
|
"lint": "eslint .",
|
|
40
|
-
"test": "node --experimental-strip-types --test lib
|
|
40
|
+
"test": "node --experimental-strip-types --test \"app/**/*.test.mjs\" \"components/**/*.test.mjs\" \"hooks/**/*.test.mjs\" \"lib/**/*.test.mjs\" \"public/**/*.test.mjs\"",
|
|
41
41
|
"release": "npm version patch --no-git-tag-version && npm run build && npm publish --access public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
@@ -45,16 +45,19 @@
|
|
|
45
45
|
"@earendil-works/pi-ai": "0.84.0",
|
|
46
46
|
"@earendil-works/pi-coding-agent": "0.84.0",
|
|
47
47
|
"@earendil-works/pi-tui": "0.84.0",
|
|
48
|
+
"js-yaml": "^5.2.3",
|
|
48
49
|
"next": "16.2.12",
|
|
49
50
|
"proper-lockfile": "4.1.2",
|
|
50
51
|
"react": "^19.2.4",
|
|
51
52
|
"react-dom": "^19.2.4",
|
|
53
|
+
"remark-frontmatter": "^5.0.0",
|
|
52
54
|
"trash": "^10.1.1",
|
|
53
55
|
"undici": "8.5.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"@lobehub/icons": "^5.6.0",
|
|
57
59
|
"@tailwindcss/postcss": "^4.2.2",
|
|
60
|
+
"@types/js-yaml": "^4.0.9",
|
|
58
61
|
"@types/node": "^25",
|
|
59
62
|
"@types/proper-lockfile": "4.1.4",
|
|
60
63
|
"@types/react": "^19",
|
package/public/sw.js
CHANGED
|
@@ -63,6 +63,48 @@ self.addEventListener("fetch", (event) => {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
+
self.addEventListener("notificationclick", (event) => {
|
|
67
|
+
event.notification.close();
|
|
68
|
+
|
|
69
|
+
const requestedUrl = typeof event.notification.data?.url === "string"
|
|
70
|
+
? event.notification.data.url
|
|
71
|
+
: "/";
|
|
72
|
+
let targetUrl = new URL("/", self.location.origin);
|
|
73
|
+
try {
|
|
74
|
+
const candidate = new URL(requestedUrl, self.location.origin);
|
|
75
|
+
if (candidate.origin === self.location.origin) targetUrl = candidate;
|
|
76
|
+
} catch {
|
|
77
|
+
// Keep the root URL when notification data is malformed.
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
event.waitUntil(focusOrOpenWindow(targetUrl.href));
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
async function focusOrOpenWindow(targetUrl) {
|
|
84
|
+
const windowClients = await self.clients.matchAll({
|
|
85
|
+
type: "window",
|
|
86
|
+
includeUncontrolled: true,
|
|
87
|
+
});
|
|
88
|
+
const exactClient = windowClients.find((client) => client.url === targetUrl);
|
|
89
|
+
const candidates = exactClient
|
|
90
|
+
? [exactClient, ...windowClients.filter((client) => client !== exactClient)]
|
|
91
|
+
: windowClients;
|
|
92
|
+
|
|
93
|
+
for (const client of candidates) {
|
|
94
|
+
try {
|
|
95
|
+
const targetClient = client.url === targetUrl
|
|
96
|
+
? client
|
|
97
|
+
: (await client.navigate(targetUrl)) ?? client;
|
|
98
|
+
await targetClient.focus();
|
|
99
|
+
return;
|
|
100
|
+
} catch {
|
|
101
|
+
// The window may have closed between matchAll and focus; try the next one.
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
await self.clients.openWindow(targetUrl);
|
|
106
|
+
}
|
|
107
|
+
|
|
66
108
|
async function cacheFirst(request) {
|
|
67
109
|
const cached = await caches.match(request);
|
|
68
110
|
if (cached) return cached;
|