@kimuson/claude-code-viewer 0.7.0 → 0.7.1
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/README.md +22 -0
- package/dist/main.js +1694 -1401
- package/dist/main.js.map +4 -4
- package/dist/migrations/20260403053302_nappy_night_thrasher/migration.sql +28 -0
- package/dist/migrations/20260403053302_nappy_night_thrasher/snapshot.json +318 -0
- package/dist/static/assets/{AuthProvider-BKc7q7ka.js → AuthProvider-Ds-c4CWc.js} +1 -1
- package/dist/static/assets/{ProtectedRoute-Clw5r4X-.js → ProtectedRoute-BTfjJdM-.js} +1 -1
- package/dist/static/assets/{dist-DiGJ7VFi.js → dist-Cartj9I0.js} +3 -3
- package/dist/static/assets/index-DPQFjjdS.css +2 -0
- package/dist/static/assets/index-Dd_UGB4w.js +20 -0
- package/dist/static/assets/{login-pLhQHKNI.js → login-CKSjZM5v.js} +1 -1
- package/dist/static/assets/messages-BIF6nUZW.js +1 -0
- package/dist/static/assets/messages-BLphVEYK.js +1 -0
- package/dist/static/assets/messages-CuPsU53l.js +1 -0
- package/dist/static/assets/{projects-BVPr5gWf.js → projects-DH0K12HM.js} +1 -1
- package/dist/static/assets/routes-CzLZwWu9.js +1 -0
- package/dist/static/assets/session-CJWdf6N4.js +12 -0
- package/dist/static/assets/session-vY-62UKf.js +1 -0
- package/dist/static/index.html +4 -4
- package/dist/static/sw.js +1 -1
- package/package.json +3 -1
- package/dist/static/assets/index-26yPYMZp.css +0 -2
- package/dist/static/assets/index-BO-D9mWo.js +0 -20
- package/dist/static/assets/messages-Cq0t_Ljz.js +0 -1
- package/dist/static/assets/messages-DJ70MfCl.js +0 -1
- package/dist/static/assets/messages-DRdgpO3i.js +0 -1
- package/dist/static/assets/routes-9aZugTrf.js +0 -1
- package/dist/static/assets/session-BkAg5Fs5.js +0 -1
- package/dist/static/assets/session-D-iyWO70.js +0 -8
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
ALTER TABLE `sessions` ADD `permission_allowlist_json` text;--> statement-breakpoint
|
|
2
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
3
|
+
CREATE TABLE `__new_sessions` (
|
|
4
|
+
`id` text PRIMARY KEY,
|
|
5
|
+
`project_id` text NOT NULL,
|
|
6
|
+
`file_path` text NOT NULL UNIQUE,
|
|
7
|
+
`message_count` integer DEFAULT 0 NOT NULL,
|
|
8
|
+
`first_user_message_json` text,
|
|
9
|
+
`custom_title` text,
|
|
10
|
+
`total_cost_usd` real DEFAULT 0 NOT NULL,
|
|
11
|
+
`cost_breakdown_json` text,
|
|
12
|
+
`token_usage_json` text,
|
|
13
|
+
`model_name` text,
|
|
14
|
+
`pr_links_json` text,
|
|
15
|
+
`file_mtime_ms` integer NOT NULL,
|
|
16
|
+
`last_modified_at` text NOT NULL,
|
|
17
|
+
`synced_at` integer NOT NULL,
|
|
18
|
+
`permission_allowlist_json` text,
|
|
19
|
+
CONSTRAINT `sessions_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON DELETE CASCADE
|
|
20
|
+
);
|
|
21
|
+
--> statement-breakpoint
|
|
22
|
+
INSERT INTO `__new_sessions`(`id`, `project_id`, `file_path`, `message_count`, `first_user_message_json`, `custom_title`, `total_cost_usd`, `cost_breakdown_json`, `token_usage_json`, `model_name`, `pr_links_json`, `file_mtime_ms`, `last_modified_at`, `synced_at`) SELECT `id`, `project_id`, `file_path`, `message_count`, `first_user_message_json`, `custom_title`, `total_cost_usd`, `cost_breakdown_json`, `token_usage_json`, `model_name`, `pr_links_json`, `file_mtime_ms`, `last_modified_at`, `synced_at` FROM `sessions`;--> statement-breakpoint
|
|
23
|
+
DROP TABLE `sessions`;--> statement-breakpoint
|
|
24
|
+
ALTER TABLE `__new_sessions` RENAME TO `sessions`;--> statement-breakpoint
|
|
25
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
26
|
+
DROP INDEX IF EXISTS `sessions_file_path_unique`;--> statement-breakpoint
|
|
27
|
+
CREATE INDEX `idx_sessions_project_id` ON `sessions` (`project_id`);--> statement-breakpoint
|
|
28
|
+
CREATE INDEX `idx_sessions_file_mtime` ON `sessions` (`file_mtime_ms`);
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "36c0fb3d-de17-4e04-b848-5502ed676cf1",
|
|
5
|
+
"prevIds": ["382a3f92-e566-45ff-af50-939de0afe931"],
|
|
6
|
+
"ddl": [
|
|
7
|
+
{
|
|
8
|
+
"name": "projects",
|
|
9
|
+
"entityType": "tables"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "sessions",
|
|
13
|
+
"entityType": "tables"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "sync_state",
|
|
17
|
+
"entityType": "tables"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "text",
|
|
21
|
+
"notNull": false,
|
|
22
|
+
"autoincrement": false,
|
|
23
|
+
"default": null,
|
|
24
|
+
"generated": null,
|
|
25
|
+
"name": "id",
|
|
26
|
+
"entityType": "columns",
|
|
27
|
+
"table": "projects"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "text",
|
|
31
|
+
"notNull": false,
|
|
32
|
+
"autoincrement": false,
|
|
33
|
+
"default": null,
|
|
34
|
+
"generated": null,
|
|
35
|
+
"name": "name",
|
|
36
|
+
"entityType": "columns",
|
|
37
|
+
"table": "projects"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "text",
|
|
41
|
+
"notNull": false,
|
|
42
|
+
"autoincrement": false,
|
|
43
|
+
"default": null,
|
|
44
|
+
"generated": null,
|
|
45
|
+
"name": "path",
|
|
46
|
+
"entityType": "columns",
|
|
47
|
+
"table": "projects"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"notNull": true,
|
|
52
|
+
"autoincrement": false,
|
|
53
|
+
"default": "0",
|
|
54
|
+
"generated": null,
|
|
55
|
+
"name": "session_count",
|
|
56
|
+
"entityType": "columns",
|
|
57
|
+
"table": "projects"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"notNull": true,
|
|
62
|
+
"autoincrement": false,
|
|
63
|
+
"default": null,
|
|
64
|
+
"generated": null,
|
|
65
|
+
"name": "dir_mtime_ms",
|
|
66
|
+
"entityType": "columns",
|
|
67
|
+
"table": "projects"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "integer",
|
|
71
|
+
"notNull": true,
|
|
72
|
+
"autoincrement": false,
|
|
73
|
+
"default": null,
|
|
74
|
+
"generated": null,
|
|
75
|
+
"name": "synced_at",
|
|
76
|
+
"entityType": "columns",
|
|
77
|
+
"table": "projects"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "text",
|
|
81
|
+
"notNull": false,
|
|
82
|
+
"autoincrement": false,
|
|
83
|
+
"default": null,
|
|
84
|
+
"generated": null,
|
|
85
|
+
"name": "id",
|
|
86
|
+
"entityType": "columns",
|
|
87
|
+
"table": "sessions"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "text",
|
|
91
|
+
"notNull": true,
|
|
92
|
+
"autoincrement": false,
|
|
93
|
+
"default": null,
|
|
94
|
+
"generated": null,
|
|
95
|
+
"name": "project_id",
|
|
96
|
+
"entityType": "columns",
|
|
97
|
+
"table": "sessions"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "text",
|
|
101
|
+
"notNull": true,
|
|
102
|
+
"autoincrement": false,
|
|
103
|
+
"default": null,
|
|
104
|
+
"generated": null,
|
|
105
|
+
"name": "file_path",
|
|
106
|
+
"entityType": "columns",
|
|
107
|
+
"table": "sessions"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "integer",
|
|
111
|
+
"notNull": true,
|
|
112
|
+
"autoincrement": false,
|
|
113
|
+
"default": "0",
|
|
114
|
+
"generated": null,
|
|
115
|
+
"name": "message_count",
|
|
116
|
+
"entityType": "columns",
|
|
117
|
+
"table": "sessions"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "text",
|
|
121
|
+
"notNull": false,
|
|
122
|
+
"autoincrement": false,
|
|
123
|
+
"default": null,
|
|
124
|
+
"generated": null,
|
|
125
|
+
"name": "first_user_message_json",
|
|
126
|
+
"entityType": "columns",
|
|
127
|
+
"table": "sessions"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"type": "text",
|
|
131
|
+
"notNull": false,
|
|
132
|
+
"autoincrement": false,
|
|
133
|
+
"default": null,
|
|
134
|
+
"generated": null,
|
|
135
|
+
"name": "custom_title",
|
|
136
|
+
"entityType": "columns",
|
|
137
|
+
"table": "sessions"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "real",
|
|
141
|
+
"notNull": true,
|
|
142
|
+
"autoincrement": false,
|
|
143
|
+
"default": "0",
|
|
144
|
+
"generated": null,
|
|
145
|
+
"name": "total_cost_usd",
|
|
146
|
+
"entityType": "columns",
|
|
147
|
+
"table": "sessions"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"type": "text",
|
|
151
|
+
"notNull": false,
|
|
152
|
+
"autoincrement": false,
|
|
153
|
+
"default": null,
|
|
154
|
+
"generated": null,
|
|
155
|
+
"name": "cost_breakdown_json",
|
|
156
|
+
"entityType": "columns",
|
|
157
|
+
"table": "sessions"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "text",
|
|
161
|
+
"notNull": false,
|
|
162
|
+
"autoincrement": false,
|
|
163
|
+
"default": null,
|
|
164
|
+
"generated": null,
|
|
165
|
+
"name": "token_usage_json",
|
|
166
|
+
"entityType": "columns",
|
|
167
|
+
"table": "sessions"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"type": "text",
|
|
171
|
+
"notNull": false,
|
|
172
|
+
"autoincrement": false,
|
|
173
|
+
"default": null,
|
|
174
|
+
"generated": null,
|
|
175
|
+
"name": "model_name",
|
|
176
|
+
"entityType": "columns",
|
|
177
|
+
"table": "sessions"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"type": "text",
|
|
181
|
+
"notNull": false,
|
|
182
|
+
"autoincrement": false,
|
|
183
|
+
"default": null,
|
|
184
|
+
"generated": null,
|
|
185
|
+
"name": "pr_links_json",
|
|
186
|
+
"entityType": "columns",
|
|
187
|
+
"table": "sessions"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"type": "integer",
|
|
191
|
+
"notNull": true,
|
|
192
|
+
"autoincrement": false,
|
|
193
|
+
"default": null,
|
|
194
|
+
"generated": null,
|
|
195
|
+
"name": "file_mtime_ms",
|
|
196
|
+
"entityType": "columns",
|
|
197
|
+
"table": "sessions"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"type": "text",
|
|
201
|
+
"notNull": true,
|
|
202
|
+
"autoincrement": false,
|
|
203
|
+
"default": null,
|
|
204
|
+
"generated": null,
|
|
205
|
+
"name": "last_modified_at",
|
|
206
|
+
"entityType": "columns",
|
|
207
|
+
"table": "sessions"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"type": "integer",
|
|
211
|
+
"notNull": true,
|
|
212
|
+
"autoincrement": false,
|
|
213
|
+
"default": null,
|
|
214
|
+
"generated": null,
|
|
215
|
+
"name": "synced_at",
|
|
216
|
+
"entityType": "columns",
|
|
217
|
+
"table": "sessions"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "text",
|
|
221
|
+
"notNull": false,
|
|
222
|
+
"autoincrement": false,
|
|
223
|
+
"default": null,
|
|
224
|
+
"generated": null,
|
|
225
|
+
"name": "permission_allowlist_json",
|
|
226
|
+
"entityType": "columns",
|
|
227
|
+
"table": "sessions"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"type": "text",
|
|
231
|
+
"notNull": false,
|
|
232
|
+
"autoincrement": false,
|
|
233
|
+
"default": null,
|
|
234
|
+
"generated": null,
|
|
235
|
+
"name": "key",
|
|
236
|
+
"entityType": "columns",
|
|
237
|
+
"table": "sync_state"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"type": "text",
|
|
241
|
+
"notNull": true,
|
|
242
|
+
"autoincrement": false,
|
|
243
|
+
"default": null,
|
|
244
|
+
"generated": null,
|
|
245
|
+
"name": "value",
|
|
246
|
+
"entityType": "columns",
|
|
247
|
+
"table": "sync_state"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"columns": ["project_id"],
|
|
251
|
+
"tableTo": "projects",
|
|
252
|
+
"columnsTo": ["id"],
|
|
253
|
+
"onUpdate": "NO ACTION",
|
|
254
|
+
"onDelete": "CASCADE",
|
|
255
|
+
"nameExplicit": false,
|
|
256
|
+
"name": "sessions_project_id_projects_id_fk",
|
|
257
|
+
"entityType": "fks",
|
|
258
|
+
"table": "sessions"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"columns": ["id"],
|
|
262
|
+
"nameExplicit": false,
|
|
263
|
+
"name": "projects_pk",
|
|
264
|
+
"table": "projects",
|
|
265
|
+
"entityType": "pks"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"columns": ["id"],
|
|
269
|
+
"nameExplicit": false,
|
|
270
|
+
"name": "sessions_pk",
|
|
271
|
+
"table": "sessions",
|
|
272
|
+
"entityType": "pks"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"columns": ["key"],
|
|
276
|
+
"nameExplicit": false,
|
|
277
|
+
"name": "sync_state_pk",
|
|
278
|
+
"table": "sync_state",
|
|
279
|
+
"entityType": "pks"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"columns": [
|
|
283
|
+
{
|
|
284
|
+
"value": "project_id",
|
|
285
|
+
"isExpression": false
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"isUnique": false,
|
|
289
|
+
"where": null,
|
|
290
|
+
"origin": "manual",
|
|
291
|
+
"name": "idx_sessions_project_id",
|
|
292
|
+
"entityType": "indexes",
|
|
293
|
+
"table": "sessions"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"columns": [
|
|
297
|
+
{
|
|
298
|
+
"value": "file_mtime_ms",
|
|
299
|
+
"isExpression": false
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"isUnique": false,
|
|
303
|
+
"where": null,
|
|
304
|
+
"origin": "manual",
|
|
305
|
+
"name": "idx_sessions_file_mtime",
|
|
306
|
+
"entityType": "indexes",
|
|
307
|
+
"table": "sessions"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"columns": ["file_path"],
|
|
311
|
+
"nameExplicit": false,
|
|
312
|
+
"name": "sessions_file_path_unique",
|
|
313
|
+
"entityType": "uniques",
|
|
314
|
+
"table": "sessions"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"renames": []
|
|
318
|
+
}
|
|
@@ -19,4 +19,4 @@ function useAtomValueWithDelay<Value>(
|
|
|
19
19
|
}, [store, atom, delay])
|
|
20
20
|
return value
|
|
21
21
|
}
|
|
22
|
-
`),setTimeout(l,n);return}l()});return l(),t},[a,e,n,r]),(0,i.useDebugValue)(u),Y(u)){let t=kt(a,u,()=>a.get(e));return r&&X(t),Dt(t)}return u}function jt(e,t){let n=J(t);return(0,i.useCallback)((...t)=>n.set(e,...t),[n,e])}function Mt(e,t){return[At(e,t),jt(e,t)]}var Nt=yt({authEnabled:!1,authenticated:!1,checked:!1}),Pt=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},Ft=(e,t,n)=>(t=encodeURIComponent(t),Pt(e,t,n)),It=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),Lt=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},Rt=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},zt=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},Bt=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vt(e,t){if(!Z(e)&&!Z(t))return t;let n={...e};for(let e in t){let r=t[e];Z(n[e])&&Z(r)?n[e]=Vt(n[e],r):n[e]=r}return n}var Ht=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return Ht(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),Ut=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(Ft(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=Bt(a),a=Lt(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},Wt=(e,t)=>Ht(function n(r){let i=t?.buildSearchParams??Rt,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=It(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=Lt(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=Bt(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=zt(r.args[0]&&r.args[0].param?Lt(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new Ut(c,s,{buildSearchParams:i});if(s){t??={};let e=Vt(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),Gt=class extends Error{status;statusText;constructor(e,t){super(`HttpError: ${e} ${t}`),this.status=e,this.statusText=t}},Q=Wt(`/`,{fetch:async(...e)=>{let t=await fetch(...e);if(!t.ok)throw console.error(t),new Gt(t.status,t.statusText);return t}}),$={queryKey:[`auth`,`check`],queryFn:async()=>await(await Q.api.auth.check.$get()).json()},Kt={queryKey:[`projects`],queryFn:async()=>{let e=await Q.api.projects.$get({param:{}});if(!e.ok)throw Error(`Failed to fetch projects: ${e.statusText}`);return await e.json()}},qt=(e,t)=>({queryKey:[`directory-listing`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`directory-browser`].$get({query:{...e!==void 0&&e!==``?{currentPath:e}:{},...t===void 0?{}:{showHidden:t.toString()}}});if(!n.ok)throw Error(`Failed to fetch directory listing`);return await n.json()}}),Jt=(e,t)=>({queryKey:[`projects`,e],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].$get({param:{projectId:e},query:{cursor:t}});if(!n.ok)throw Error(`Failed to fetch project: ${n.statusText}`);return await n.json()}}),Yt=(e,t)=>({queryKey:[`projects`,e,`sessions`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch session: ${n.statusText}`);return await n.json()}}),Xt=e=>({queryKey:[`claude-commands`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`][`claude-commands`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch claude commands: ${t.statusText}`);return await t.json()}}),Zt={queryKey:[`sessionProcesses`],queryFn:async()=>{let e=await Q.api[`claude-code`][`session-processes`].$get({});if(!e.ok)throw Error(`Failed to fetch alive tasks: ${e.statusText}`);return await e.json()}},Qt=e=>({queryKey:[`git`,`current-revisions`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git[`current-revisions`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch current revisions: ${t.statusText}`);return await t.json()}}),$t=e=>({queryKey:[`git`,`branches`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git.branches.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch branches: ${t.statusText}`);return await t.json()}}),en=(e,t,n)=>({queryKey:[`git`,`diff`,e,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`].git.diff.$post({param:{projectId:e},json:{fromRef:t,toRef:n}});if(!r.ok)throw Error(`Failed to fetch diff: ${r.statusText}`);return await r.json()}}),tn=e=>({queryKey:[`mcp`,`list`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].mcp.list.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch MCP list: ${t.statusText}`);return await t.json()}}),nn=(e,t)=>({queryKey:[`file-completion`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`file-completion`].$get({query:{basePath:t,projectId:e}});if(!n.ok)throw Error(`Failed to fetch file completion`);return await n.json()}}),rn={queryKey:[`config`],queryFn:async()=>{let e=await Q.api.config.$get();if(!e.ok)throw Error(`Failed to fetch config: ${e.statusText}`);return await e.json()}},an={queryKey:[`version`],queryFn:async()=>{let e=await Q.api.version.$get();if(!e.ok)throw Error(`Failed to fetch system version: ${e.statusText}`);return await e.json()}},on={queryKey:[`cc`,`meta`],queryFn:async()=>{let e=await Q.api[`claude-code`].meta.$get();if(!e.ok)throw Error(`Failed to fetch system features: ${e.statusText}`);return await e.json()}},sn={queryKey:[`flags`],queryFn:async()=>{let e=await Q.api[`feature-flags`].$get();if(!e.ok)throw Error(`Failed to fetch feature flags: ${e.statusText}`);return await e.json()}},cn=(e,t)=>({queryKey:[`projects`,e,`sessions`,t,`agent-sessions`],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`][`agent-sessions`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch agent sessions: ${n.statusText}`);return await n.json()}}),ln=(e,t,n)=>({queryKey:[`projects`,e,`agent-sessions`,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`][`agent-sessions`][`:agentId`].$get({param:{projectId:e,agentId:t},query:{sessionId:n}});if(!r.ok)throw Error(`Failed to fetch agent session: ${r.statusText}`);return await r.json()}}),un=(e,t)=>({queryKey:[`search`,e,t?.limit,t?.projectId],queryFn:async()=>{let n=await Q.api.search.$get({query:{q:e,...t?.limit===void 0?{}:{limit:t.limit.toString()},...t?.projectId!==void 0&&t.projectId!==``?{projectId:t.projectId}:{}}});if(!n.ok)throw Error(`Failed to search: ${n.statusText}`);return await n.json()}}),dn={queryKey:[`notifications`],queryFn:async()=>{let e=await Q.api.notifications.$get();if(!e.ok)throw Error(`Failed to fetch notifications: ${e.statusText}`);return await e.json()}},fn={queryKey:[`pending-permission-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-permission-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending permission requests`);return await e.json()}},pn={queryKey:[`pending-question-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-question-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending question requests`);return await e.json()}},mn=(e,t)=>({queryKey:[`projects`,e,`files`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].files.$get({param:{projectId:e},query:{filePath:t}});if(!n.ok)throw Error(`Failed to fetch file content`);return await n.json()}}),hn=({children:e})=>{let t=jt(Nt),{data:n}=We({queryKey:$.queryKey,queryFn:$.queryFn});return(0,i.useEffect)(()=>{t({authEnabled:n.authEnabled,authenticated:n.authenticated,checked:!0})},[n,t]),(0,H.jsx)(H.Fragment,{children:e})},gn=()=>{let e=At(Nt),t=U(),n=f(),r=W({mutationFn:async e=>{await Q.api.auth.login.$post({json:{password:e}})},onSuccess:async()=>{await t.invalidateQueries({queryKey:$.queryKey}),n({to:`/projects`})}}),i=W({mutationFn:async()=>{await Q.api.auth.logout.$post(),await t.invalidateQueries({queryKey:$.queryKey})},onSuccess:()=>{n({to:`/login`})}});return{authEnabled:e.authEnabled,isAuthenticated:e.authenticated,login:r.mutateAsync,logout:i.mutateAsync}};export{ee as $,jt as A,Te as B,Zt as C,Nt as D,Q as E,We as F,le as G,ge as H,Ue as I,ce as J,oe as K,Re as L,yt as M,Tt as N,Mt as O,W as P,E as Q,ke as R,Yt as S,Gt as T,R as U,be as V,L as W,O as X,x as Y,D as Z,fn as _,on as a,m as at,Kt as b,qt as c,d as ct,mn as d,l as dt,b as et,$t as f,c as ft,dn as g,tn as h,ln as i,h as it,J as j,At as k,sn as l,u as lt,en as m,s as mt,gn as n,w as nt,Xt as o,p as ot,Qt as p,o as pt,se as q,cn as r,N as rt,rn as s,f as st,hn as t,k as tt,nn as u,a as ut,pn as v,an as w,un as x,Jt as y,U as z};
|
|
22
|
+
`),setTimeout(l,n);return}l()});return l(),t},[a,e,n,r]),(0,i.useDebugValue)(u),Y(u)){let t=kt(a,u,()=>a.get(e));return r&&X(t),Dt(t)}return u}function jt(e,t){let n=J(t);return(0,i.useCallback)((...t)=>n.set(e,...t),[n,e])}function Mt(e,t){return[At(e,t),jt(e,t)]}var Nt=yt({authEnabled:!1,authenticated:!1,checked:!1}),Pt=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},Ft=(e,t,n)=>(t=encodeURIComponent(t),Pt(e,t,n)),It=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),Lt=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},Rt=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},zt=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},Bt=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vt(e,t){if(!Z(e)&&!Z(t))return t;let n={...e};for(let e in t){let r=t[e];Z(n[e])&&Z(r)?n[e]=Vt(n[e],r):n[e]=r}return n}var Ht=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return Ht(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),Ut=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(Ft(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=Bt(a),a=Lt(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},Wt=(e,t)=>Ht(function n(r){let i=t?.buildSearchParams??Rt,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=It(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=Lt(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=Bt(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=zt(r.args[0]&&r.args[0].param?Lt(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new Ut(c,s,{buildSearchParams:i});if(s){t??={};let e=Vt(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),Gt=class extends Error{status;statusText;constructor(e,t){super(`HttpError: ${e} ${t}`),this.status=e,this.statusText=t}},Q=Wt(`/`,{fetch:async(...e)=>{let t=await fetch(...e);if(!t.ok)throw console.error(t),new Gt(t.status,t.statusText);return t}}),$={queryKey:[`auth`,`check`],queryFn:async()=>await(await Q.api.auth.check.$get()).json()},Kt={queryKey:[`projects`],queryFn:async()=>{let e=await Q.api.projects.$get({param:{}});if(!e.ok)throw Error(`Failed to fetch projects: ${e.statusText}`);return await e.json()}},qt=(e,t)=>({queryKey:[`directory-listing`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`directory-browser`].$get({query:{...e!==void 0&&e!==``?{currentPath:e}:{},...t===void 0?{}:{showHidden:t.toString()}}});if(!n.ok)throw Error(`Failed to fetch directory listing`);return await n.json()}}),Jt=(e,t)=>({queryKey:[`projects`,e],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].$get({param:{projectId:e},query:{cursor:t}});if(!n.ok)throw Error(`Failed to fetch project: ${n.statusText}`);return await n.json()}}),Yt=(e,t)=>({queryKey:[`projects`,e,`sessions`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch session: ${n.statusText}`);return await n.json()}}),Xt=e=>({queryKey:[`claude-commands`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`][`claude-commands`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch claude commands: ${t.statusText}`);return await t.json()}}),Zt={queryKey:[`sessionProcesses`],queryFn:async()=>{let e=await Q.api[`claude-code`][`session-processes`].$get({});if(!e.ok)throw Error(`Failed to fetch alive tasks: ${e.statusText}`);return await e.json()}},Qt=e=>({queryKey:[`git`,`current-revisions`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git[`current-revisions`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch current revisions: ${t.statusText}`);return await t.json()}}),$t=e=>({queryKey:[`git`,`branches`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git.branches.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch branches: ${t.statusText}`);return await t.json()}}),en=(e,t,n)=>({queryKey:[`git`,`diff`,e,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`].git.diff.$post({param:{projectId:e},json:{fromRef:t,toRef:n}});if(!r.ok)throw Error(`Failed to fetch diff: ${r.statusText}`);return await r.json()}}),tn=e=>({queryKey:[`mcp`,`list`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].mcp.list.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch MCP list: ${t.statusText}`);return await t.json()}}),nn=(e,t)=>({queryKey:[`file-completion`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`file-completion`].$get({query:{basePath:t,projectId:e}});if(!n.ok)throw Error(`Failed to fetch file completion`);return await n.json()}}),rn={queryKey:[`config`],queryFn:async()=>{let e=await Q.api.config.$get();if(!e.ok)throw Error(`Failed to fetch config: ${e.statusText}`);return await e.json()}},an={queryKey:[`version`],queryFn:async()=>{let e=await Q.api.version.$get();if(!e.ok)throw Error(`Failed to fetch system version: ${e.statusText}`);return await e.json()}},on={queryKey:[`cc`,`meta`],queryFn:async()=>{let e=await Q.api[`claude-code`].meta.$get();if(!e.ok)throw Error(`Failed to fetch system features: ${e.statusText}`);return await e.json()}},sn={queryKey:[`flags`],queryFn:async()=>{let e=await Q.api[`feature-flags`].$get();if(!e.ok)throw Error(`Failed to fetch feature flags: ${e.statusText}`);return await e.json()}},cn=(e,t)=>({queryKey:[`projects`,e,`sessions`,t,`agent-sessions`],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`][`agent-sessions`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch agent sessions: ${n.statusText}`);return await n.json()}}),ln=(e,t,n)=>({queryKey:[`projects`,e,`agent-sessions`,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`][`agent-sessions`][`:agentId`].$get({param:{projectId:e,agentId:t},query:{sessionId:n}});if(!r.ok)throw Error(`Failed to fetch agent session: ${r.statusText}`);return await r.json()}}),un=(e,t)=>({queryKey:[`search`,e,t?.limit,t?.projectId],queryFn:async()=>{let n=await Q.api.search.$get({query:{q:e,...t?.limit===void 0?{}:{limit:t.limit.toString()},...t?.projectId!==void 0&&t.projectId!==``?{projectId:t.projectId}:{}}});if(!n.ok)throw Error(`Failed to search: ${n.statusText}`);return await n.json()}}),dn={queryKey:[`notifications`],queryFn:async()=>{let e=await Q.api.notifications.$get();if(!e.ok)throw Error(`Failed to fetch notifications: ${e.statusText}`);return await e.json()}},fn={queryKey:[`pending-permission-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-permission-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending permission requests`);return await e.json()}},pn=(e,t,n)=>({queryKey:[`generate-permission-rule`,e,t,n],queryFn:async()=>{let r=await Q.api[`claude-code`][`generate-permission-rule`].$post({json:{toolName:e,toolInput:t,projectId:n}});if(!r.ok)throw Error(`Failed to generate permission rule`);return await r.json()}}),mn={queryKey:[`pending-question-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-question-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending question requests`);return await e.json()}},hn=(e,t)=>({queryKey:[`projects`,e,`files`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].files.$get({param:{projectId:e},query:{filePath:t}});if(!n.ok)throw Error(`Failed to fetch file content`);return await n.json()}}),gn=({children:e})=>{let t=jt(Nt),{data:n}=We({queryKey:$.queryKey,queryFn:$.queryFn});return(0,i.useEffect)(()=>{t({authEnabled:n.authEnabled,authenticated:n.authenticated,checked:!0})},[n,t]),(0,H.jsx)(H.Fragment,{children:e})},_n=()=>{let e=At(Nt),t=U(),n=f(),r=W({mutationFn:async e=>{await Q.api.auth.login.$post({json:{password:e}})},onSuccess:async()=>{await t.invalidateQueries({queryKey:$.queryKey}),n({to:`/projects`})}}),i=W({mutationFn:async()=>{await Q.api.auth.logout.$post(),await t.invalidateQueries({queryKey:$.queryKey})},onSuccess:()=>{n({to:`/login`})}});return{authEnabled:e.authEnabled,isAuthenticated:e.authenticated,login:r.mutateAsync,logout:i.mutateAsync}};export{E as $,At as A,U as B,Yt as C,Q as D,Gt as E,W as F,L as G,be as H,We as I,se as J,le as K,Ue as L,J as M,yt as N,Nt as O,Tt as P,D as Q,Re as R,un as S,an as T,ge as U,Te as V,R as W,x as X,ce as Y,O as Z,dn as _,on as a,h as at,Jt as b,qt as c,f as ct,hn as d,a as dt,ee as et,pn as f,l as ft,tn as g,en as h,s as ht,ln as i,N as it,jt as j,Mt as k,sn as l,d as lt,Qt as m,o as mt,_n as n,k as nt,Xt as o,m as ot,$t as p,c as pt,oe as q,cn as r,w as rt,rn as s,p as st,gn as t,b as tt,nn as u,u as ut,fn as v,Zt as w,Kt as x,mn as y,ke as z};
|