@kimuson/claude-code-viewer 0.6.0-beta.1 → 0.6.0-beta.3

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/dist/main.js CHANGED
@@ -7,7 +7,7 @@ import { Effect as Effect65 } from "effect";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@kimuson/claude-code-viewer",
10
- version: "0.6.0-beta.1",
10
+ version: "0.6.0-beta.3",
11
11
  description: "A full-featured web-based Claude Code client that provides complete interactive functionality for managing Claude Code projects.",
12
12
  type: "module",
13
13
  license: "MIT",
@@ -39,7 +39,7 @@ var package_default = {
39
39
  fix: "run-s 'fix:*'",
40
40
  "fix:biome-format": "biome format --write .",
41
41
  "fix:biome-lint": "biome check --write --unsafe .",
42
- typecheck: "tsc --noEmit",
42
+ typecheck: "tsgo --noEmit",
43
43
  test: "vitest --run",
44
44
  "test:watch": "vitest",
45
45
  e2e: "./scripts/e2e/exec_e2e.sh",
@@ -51,21 +51,21 @@ var package_default = {
51
51
  prepare: "lefthook install"
52
52
  },
53
53
  dependencies: {
54
- "@anthropic-ai/claude-agent-sdk": "0.2.20",
55
- "@anthropic-ai/claude-code": "2.1.29",
56
- "@anthropic-ai/sdk": "0.71.2",
57
- "@effect/cluster": "0.56.1",
54
+ "@anthropic-ai/claude-agent-sdk": "0.2.42",
55
+ "@anthropic-ai/claude-code": "2.1.42",
56
+ "@anthropic-ai/sdk": "0.74.0",
57
+ "@effect/cluster": "0.56.4",
58
58
  "@effect/experimental": "0.58.0",
59
- "@effect/platform": "0.94.2",
59
+ "@effect/platform": "0.94.5",
60
60
  "@effect/platform-node": "0.104.1",
61
- "@effect/rpc": "0.73.0",
61
+ "@effect/rpc": "0.73.1",
62
62
  "@effect/sql": "0.49.0",
63
63
  "@effect/workflow": "0.16.0",
64
64
  "@hono/node-server": "1.19.9",
65
65
  "@hono/zod-validator": "0.7.6",
66
- "@hookform/resolvers": "^5.2.2",
67
- "@lingui/core": "5.9.0",
68
- "@lingui/react": "5.9.0",
66
+ "@hookform/resolvers": "5.2.2",
67
+ "@lingui/core": "5.9.1",
68
+ "@lingui/react": "5.9.1",
69
69
  "@radix-ui/react-avatar": "1.1.11",
70
70
  "@radix-ui/react-checkbox": "1.3.3",
71
71
  "@radix-ui/react-collapsible": "1.1.12",
@@ -76,63 +76,64 @@ var package_default = {
76
76
  "@radix-ui/react-slot": "1.2.4",
77
77
  "@radix-ui/react-tabs": "1.1.13",
78
78
  "@radix-ui/react-tooltip": "1.2.8",
79
+ "@replit/ruspty": "3.6.0",
79
80
  "@tailwindcss/vite": "4.1.18",
80
- "@tanstack/react-devtools": "0.9.2",
81
- "@tanstack/react-query": "5.90.20",
82
- "@tanstack/react-router": "1.156.0",
83
- "@tanstack/react-router-devtools": "1.156.0",
84
- "@xterm/addon-fit": "0.10.0",
85
- "@xterm/xterm": "5.5.0",
81
+ "@tanstack/react-devtools": "0.9.5",
82
+ "@tanstack/react-query": "5.90.21",
83
+ "@tanstack/react-router": "1.160.0",
84
+ "@tanstack/react-router-devtools": "1.160.0",
85
+ "@xterm/addon-fit": "0.11.0",
86
+ "@xterm/xterm": "6.0.0",
86
87
  "class-variance-authority": "0.7.1",
87
88
  clsx: "2.1.1",
88
- cmdk: "^1.1.1",
89
- commander: "^14.0.2",
89
+ cmdk: "1.1.1",
90
+ commander: "14.0.3",
90
91
  "date-fns": "4.1.0",
91
- effect: "3.19.15",
92
+ effect: "3.19.17",
92
93
  "es-toolkit": "1.44.0",
93
- hono: "4.11.5",
94
- jotai: "2.16.2",
95
- "lucide-react": "0.563.0",
94
+ hono: "4.11.9",
95
+ jotai: "2.17.1",
96
+ "lucide-react": "0.564.0",
96
97
  minisearch: "7.2.0",
97
- "parse-git-diff": "0.0.19",
98
+ "parse-git-diff": "0.0.20",
98
99
  prexit: "2.3.0",
99
- "radix-ui": "^1.4.3",
100
- react: "19.2.3",
101
- "react-dom": "19.2.3",
102
- "react-error-boundary": "6.1.0",
103
- "react-hook-form": "^7.71.1",
100
+ "radix-ui": "1.4.3",
101
+ react: "19.2.4",
102
+ "react-dom": "19.2.4",
103
+ "react-error-boundary": "6.1.1",
104
+ "react-hook-form": "7.71.1",
104
105
  "react-markdown": "10.1.0",
105
106
  "react-syntax-highlighter": "16.1.0",
106
107
  "remark-gfm": "4.0.1",
107
108
  sonner: "2.0.7",
108
- "tailwind-merge": "3.4.0",
109
+ "tailwind-merge": "3.4.1",
109
110
  ulid: "3.0.2",
110
- "node-pty": "1.1.0-beta34",
111
- ws: "8.18.3",
111
+ ws: "8.19.0",
112
112
  zod: "4.3.6"
113
113
  },
114
114
  devDependencies: {
115
- "@biomejs/biome": "2.3.12",
116
- "@effect/language-service": "0.72.0",
117
- "@lingui/cli": "5.9.0",
118
- "@lingui/conf": "5.9.0",
119
- "@lingui/format-json": "5.9.0",
120
- "@lingui/loader": "5.9.0",
121
- "@lingui/vite-plugin": "5.9.0",
115
+ "@biomejs/biome": "2.4.0",
116
+ "@effect/language-service": "0.73.1",
117
+ "@lingui/cli": "5.9.1",
118
+ "@lingui/conf": "5.9.1",
119
+ "@lingui/format-json": "5.9.1",
120
+ "@lingui/loader": "5.9.1",
121
+ "@lingui/vite-plugin": "5.9.1",
122
122
  "@tailwindcss/postcss": "4.1.18",
123
- "@tanstack/router-plugin": "1.156.0",
123
+ "@tanstack/router-plugin": "1.160.0",
124
124
  "@tsconfig/strictest": "2.0.8",
125
- "@types/node": "25.0.10",
126
- "@types/react": "19.2.9",
125
+ "@types/node": "25.2.3",
126
+ "@types/react": "19.2.14",
127
127
  "@types/react-dom": "19.2.3",
128
128
  "@types/react-syntax-highlighter": "15.5.13",
129
- "@types/ws": "8.18.0",
130
- "@vitejs/plugin-react-swc": "4.2.2",
131
- dotenv: "17.2.3",
132
- esbuild: "0.27.2",
133
- lefthook: "2.0.15",
129
+ "@types/ws": "8.18.1",
130
+ "@typescript/native-preview": "7.0.0-dev.20260215.1",
131
+ "@vitejs/plugin-react-swc": "4.2.3",
132
+ dotenv: "17.3.1",
133
+ esbuild: "0.27.3",
134
+ lefthook: "2.1.1",
134
135
  "npm-run-all2": "8.0.4",
135
- playwright: "1.58.0",
136
+ playwright: "1.58.2",
136
137
  "release-it": "19.2.4",
137
138
  "release-it-pnpm": "4.6.6",
138
139
  tailwindcss: "4.1.18",
@@ -238,294 +239,310 @@ import { FileSystem, Path } from "@effect/platform";
238
239
  import { Context, Effect as Effect2, Layer } from "effect";
239
240
 
240
241
  // src/lib/conversation-schema/index.ts
241
- import { z as z17 } from "zod";
242
+ import { z as z19 } from "zod";
243
+
244
+ // src/lib/conversation-schema/entry/AgentNameEntrySchema.ts
245
+ import { z } from "zod";
246
+ var AgentNameEntrySchema = z.object({
247
+ type: z.literal("agent-name"),
248
+ agentName: z.string(),
249
+ sessionId: z.string()
250
+ });
242
251
 
243
252
  // src/lib/conversation-schema/entry/AssistantEntrySchema.ts
244
- import { z as z8 } from "zod";
253
+ import { z as z9 } from "zod";
245
254
 
246
255
  // src/lib/conversation-schema/message/AssistantMessageSchema.ts
247
- import { z as z6 } from "zod";
256
+ import { z as z7 } from "zod";
248
257
 
249
258
  // src/lib/conversation-schema/content/TextContentSchema.ts
250
- import { z } from "zod";
251
- var TextContentSchema = z.object({
252
- type: z.literal("text"),
253
- text: z.string()
259
+ import { z as z2 } from "zod";
260
+ var TextContentSchema = z2.object({
261
+ type: z2.literal("text"),
262
+ text: z2.string()
254
263
  });
255
264
 
256
265
  // src/lib/conversation-schema/content/ThinkingContentSchema.ts
257
- import { z as z2 } from "zod";
258
- var ThinkingContentSchema = z2.object({
259
- type: z2.literal("thinking"),
260
- thinking: z2.string(),
261
- signature: z2.string().optional()
266
+ import { z as z3 } from "zod";
267
+ var ThinkingContentSchema = z3.object({
268
+ type: z3.literal("thinking"),
269
+ thinking: z3.string(),
270
+ signature: z3.string().optional()
262
271
  });
263
272
 
264
273
  // src/lib/conversation-schema/content/ToolResultContentSchema.ts
265
- import { z as z4 } from "zod";
274
+ import { z as z5 } from "zod";
266
275
 
267
276
  // src/lib/conversation-schema/content/ImageContentSchema.ts
268
- import { z as z3 } from "zod";
269
- var ImageContentSchema = z3.object({
270
- type: z3.literal("image"),
271
- source: z3.object({
272
- type: z3.literal("base64"),
273
- data: z3.string(),
274
- media_type: z3.enum(["image/png", "image/jpeg", "image/gif", "image/webp"])
277
+ import { z as z4 } from "zod";
278
+ var ImageContentSchema = z4.object({
279
+ type: z4.literal("image"),
280
+ source: z4.object({
281
+ type: z4.literal("base64"),
282
+ data: z4.string(),
283
+ media_type: z4.enum(["image/png", "image/jpeg", "image/gif", "image/webp"])
275
284
  })
276
285
  });
277
286
 
278
287
  // src/lib/conversation-schema/content/ToolResultContentSchema.ts
279
- var ToolResultContentSchema = z4.object({
280
- type: z4.literal("tool_result"),
281
- tool_use_id: z4.string(),
282
- content: z4.union([
283
- z4.string(),
284
- z4.array(z4.union([TextContentSchema, ImageContentSchema]))
288
+ var ToolResultContentSchema = z5.object({
289
+ type: z5.literal("tool_result"),
290
+ tool_use_id: z5.string(),
291
+ content: z5.union([
292
+ z5.string(),
293
+ z5.array(z5.union([TextContentSchema, ImageContentSchema]))
285
294
  ]),
286
- is_error: z4.boolean().optional()
295
+ is_error: z5.boolean().optional()
287
296
  });
288
297
 
289
298
  // src/lib/conversation-schema/content/ToolUseContentSchema.ts
290
- import { z as z5 } from "zod";
291
- var ToolUseContentSchema = z5.object({
292
- type: z5.literal("tool_use"),
293
- id: z5.string(),
294
- name: z5.string(),
295
- input: z5.record(z5.string(), z5.unknown())
299
+ import { z as z6 } from "zod";
300
+ var ToolUseContentSchema = z6.object({
301
+ type: z6.literal("tool_use"),
302
+ id: z6.string(),
303
+ name: z6.string(),
304
+ input: z6.record(z6.string(), z6.unknown())
296
305
  });
297
306
 
298
307
  // src/lib/conversation-schema/message/AssistantMessageSchema.ts
299
- var AssistantMessageContentSchema = z6.union([
308
+ var AssistantMessageContentSchema = z7.union([
300
309
  ThinkingContentSchema,
301
310
  TextContentSchema,
302
311
  ToolUseContentSchema,
303
312
  ToolResultContentSchema
304
313
  ]);
305
- var AssistantMessageSchema = z6.object({
306
- id: z6.string(),
307
- container: z6.null().optional(),
308
- type: z6.literal("message"),
309
- role: z6.literal("assistant"),
310
- model: z6.string(),
311
- content: z6.array(AssistantMessageContentSchema),
312
- stop_reason: z6.string().nullable(),
313
- stop_sequence: z6.string().nullable(),
314
- usage: z6.object({
315
- input_tokens: z6.number(),
316
- cache_creation_input_tokens: z6.number().optional(),
317
- cache_read_input_tokens: z6.number().optional(),
318
- cache_creation: z6.object({
319
- ephemeral_5m_input_tokens: z6.number(),
320
- ephemeral_1h_input_tokens: z6.number()
314
+ var AssistantMessageSchema = z7.object({
315
+ id: z7.string(),
316
+ container: z7.null().optional(),
317
+ type: z7.literal("message"),
318
+ role: z7.literal("assistant"),
319
+ model: z7.string(),
320
+ content: z7.array(AssistantMessageContentSchema),
321
+ stop_reason: z7.string().nullable(),
322
+ stop_sequence: z7.string().nullable(),
323
+ usage: z7.object({
324
+ input_tokens: z7.number(),
325
+ cache_creation_input_tokens: z7.number().optional(),
326
+ cache_read_input_tokens: z7.number().optional(),
327
+ cache_creation: z7.object({
328
+ ephemeral_5m_input_tokens: z7.number(),
329
+ ephemeral_1h_input_tokens: z7.number()
321
330
  }).optional(),
322
- output_tokens: z6.number(),
323
- service_tier: z6.string().nullable().optional(),
324
- server_tool_use: z6.object({
325
- web_search_requests: z6.number()
331
+ output_tokens: z7.number(),
332
+ service_tier: z7.string().nullable().optional(),
333
+ server_tool_use: z7.object({
334
+ web_search_requests: z7.number()
326
335
  }).optional()
327
336
  })
328
337
  });
329
338
 
330
339
  // src/lib/conversation-schema/entry/BaseEntrySchema.ts
331
- import { z as z7 } from "zod";
332
- var BaseEntrySchema = z7.object({
340
+ import { z as z8 } from "zod";
341
+ var BaseEntrySchema = z8.object({
333
342
  // required
334
- isSidechain: z7.boolean(),
335
- userType: z7.enum(["external"]),
336
- cwd: z7.string(),
337
- sessionId: z7.string(),
338
- version: z7.string(),
339
- uuid: z7.uuid(),
340
- timestamp: z7.string(),
343
+ isSidechain: z8.boolean(),
344
+ userType: z8.enum(["external"]),
345
+ cwd: z8.string(),
346
+ sessionId: z8.string(),
347
+ version: z8.string(),
348
+ uuid: z8.uuid(),
349
+ timestamp: z8.string(),
341
350
  // nullable
342
- parentUuid: z7.uuid().nullable(),
351
+ parentUuid: z8.uuid().nullable(),
343
352
  // optional
344
- isMeta: z7.boolean().optional(),
345
- toolUseResult: z7.unknown().optional(),
353
+ isMeta: z8.boolean().optional(),
354
+ toolUseResult: z8.unknown().optional(),
346
355
  // スキーマがツールごとに異なりすぎるし利用もしなそうなので unknown
347
- gitBranch: z7.string().optional(),
348
- isCompactSummary: z7.boolean().optional(),
349
- agentId: z7.string().optional()
356
+ gitBranch: z8.string().optional(),
357
+ isCompactSummary: z8.boolean().optional(),
358
+ agentId: z8.string().optional()
350
359
  });
351
360
 
352
361
  // src/lib/conversation-schema/entry/AssistantEntrySchema.ts
353
362
  var AssistantEntrySchema = BaseEntrySchema.extend({
354
363
  // discriminator
355
- type: z8.literal("assistant"),
364
+ type: z9.literal("assistant"),
356
365
  // required
357
366
  message: AssistantMessageSchema,
358
367
  // optional
359
- requestId: z8.string().optional(),
360
- isApiErrorMessage: z8.boolean().optional()
368
+ requestId: z9.string().optional(),
369
+ isApiErrorMessage: z9.boolean().optional()
370
+ });
371
+
372
+ // src/lib/conversation-schema/entry/CustomTitleEntrySchema.ts
373
+ import { z as z10 } from "zod";
374
+ var CustomTitleEntrySchema = z10.object({
375
+ type: z10.literal("custom-title"),
376
+ customTitle: z10.string(),
377
+ sessionId: z10.string()
361
378
  });
362
379
 
363
380
  // src/lib/conversation-schema/entry/FileHIstorySnapshotEntrySchema.ts
364
- import { z as z9 } from "zod";
365
- var FileHistorySnapshotEntrySchema = z9.object({
381
+ import { z as z11 } from "zod";
382
+ var FileHistorySnapshotEntrySchema = z11.object({
366
383
  // discriminator
367
- type: z9.literal("file-history-snapshot"),
384
+ type: z11.literal("file-history-snapshot"),
368
385
  // required
369
- messageId: z9.string(),
370
- snapshot: z9.object({
371
- messageId: z9.string(),
372
- trackedFileBackups: z9.record(z9.string(), z9.unknown()),
373
- timestamp: z9.string()
386
+ messageId: z11.string(),
387
+ snapshot: z11.object({
388
+ messageId: z11.string(),
389
+ trackedFileBackups: z11.record(z11.string(), z11.unknown()),
390
+ timestamp: z11.string()
374
391
  }),
375
- isSnapshotUpdate: z9.boolean()
392
+ isSnapshotUpdate: z11.boolean()
376
393
  });
377
394
 
378
395
  // src/lib/conversation-schema/entry/ProgressEntrySchema.ts
379
- import { z as z10 } from "zod";
396
+ import { z as z12 } from "zod";
380
397
  var ProgressEntrySchema = BaseEntrySchema.extend({
381
398
  // discriminator
382
- type: z10.literal("progress"),
399
+ type: z12.literal("progress"),
383
400
  // required
384
- data: z10.record(z10.string(), z10.any()),
385
- toolUseID: z10.string().optional(),
386
- parentToolUseID: z10.string().optional()
401
+ data: z12.record(z12.string(), z12.any()),
402
+ toolUseID: z12.string().optional(),
403
+ parentToolUseID: z12.string().optional()
387
404
  });
388
405
 
389
406
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
390
- import { z as z12 } from "zod";
407
+ import { z as z14 } from "zod";
391
408
 
392
409
  // src/lib/conversation-schema/content/DocumentContentSchema.ts
393
- import { z as z11 } from "zod";
394
- var DocumentContentSchema = z11.object({
395
- type: z11.literal("document"),
396
- source: z11.union([
397
- z11.object({
398
- media_type: z11.literal("text/plain"),
399
- type: z11.literal("text"),
400
- data: z11.string()
410
+ import { z as z13 } from "zod";
411
+ var DocumentContentSchema = z13.object({
412
+ type: z13.literal("document"),
413
+ source: z13.union([
414
+ z13.object({
415
+ media_type: z13.literal("text/plain"),
416
+ type: z13.literal("text"),
417
+ data: z13.string()
401
418
  }),
402
- z11.object({
403
- media_type: z11.enum(["application/pdf"]),
404
- type: z11.literal("base64"),
405
- data: z11.string()
419
+ z13.object({
420
+ media_type: z13.enum(["application/pdf"]),
421
+ type: z13.literal("base64"),
422
+ data: z13.string()
406
423
  })
407
424
  ])
408
425
  });
409
426
 
410
427
  // src/lib/conversation-schema/entry/QueueOperationEntrySchema.ts
411
- var QueueOperationContentSchema = z12.union([
412
- z12.string(),
428
+ var QueueOperationContentSchema = z14.union([
429
+ z14.string(),
413
430
  TextContentSchema,
414
431
  ToolResultContentSchema,
415
432
  ImageContentSchema,
416
433
  DocumentContentSchema
417
434
  ]);
418
- var QueueOperationEntrySchema = z12.union([
419
- z12.object({
420
- type: z12.literal("queue-operation"),
421
- operation: z12.literal("enqueue"),
422
- content: z12.union([
423
- z12.string(),
424
- z12.array(z12.union([z12.string(), QueueOperationContentSchema]))
435
+ var QueueOperationEntrySchema = z14.union([
436
+ z14.object({
437
+ type: z14.literal("queue-operation"),
438
+ operation: z14.literal("enqueue"),
439
+ content: z14.union([
440
+ z14.string(),
441
+ z14.array(z14.union([z14.string(), QueueOperationContentSchema]))
425
442
  ]),
426
- sessionId: z12.string(),
427
- timestamp: z12.iso.datetime()
443
+ sessionId: z14.string(),
444
+ timestamp: z14.iso.datetime()
428
445
  }),
429
- z12.object({
430
- type: z12.literal("queue-operation"),
431
- operation: z12.literal("dequeue"),
432
- sessionId: z12.string(),
433
- timestamp: z12.iso.datetime()
446
+ z14.object({
447
+ type: z14.literal("queue-operation"),
448
+ operation: z14.literal("dequeue"),
449
+ sessionId: z14.string(),
450
+ timestamp: z14.iso.datetime()
434
451
  }),
435
- z12.object({
436
- type: z12.literal("queue-operation"),
437
- operation: z12.literal("remove"),
438
- sessionId: z12.string(),
439
- timestamp: z12.iso.datetime()
452
+ z14.object({
453
+ type: z14.literal("queue-operation"),
454
+ operation: z14.literal("remove"),
455
+ sessionId: z14.string(),
456
+ timestamp: z14.iso.datetime()
440
457
  }),
441
- z12.object({
442
- type: z12.literal("queue-operation"),
443
- operation: z12.literal("popAll"),
444
- sessionId: z12.string(),
445
- timestamp: z12.iso.datetime(),
446
- content: z12.string().optional()
458
+ z14.object({
459
+ type: z14.literal("queue-operation"),
460
+ operation: z14.literal("popAll"),
461
+ sessionId: z14.string(),
462
+ timestamp: z14.iso.datetime(),
463
+ content: z14.string().optional()
447
464
  })
448
465
  ]);
449
466
 
450
467
  // src/lib/conversation-schema/entry/SummaryEntrySchema.ts
451
- import { z as z13 } from "zod";
452
- var SummaryEntrySchema = z13.object({
453
- type: z13.literal("summary"),
454
- summary: z13.string(),
455
- leafUuid: z13.string().uuid()
468
+ import { z as z15 } from "zod";
469
+ var SummaryEntrySchema = z15.object({
470
+ type: z15.literal("summary"),
471
+ summary: z15.string(),
472
+ leafUuid: z15.string().uuid()
456
473
  });
457
474
 
458
475
  // src/lib/conversation-schema/entry/SystemEntrySchema.ts
459
- import { z as z14 } from "zod";
460
- var HookInfoSchema = z14.object({
461
- command: z14.string()
476
+ import { z as z16 } from "zod";
477
+ var HookInfoSchema = z16.object({
478
+ command: z16.string()
462
479
  });
463
480
  var SystemEntryWithContentSchema = BaseEntrySchema.extend({
464
- type: z14.literal("system"),
465
- content: z14.string(),
466
- toolUseID: z14.string(),
467
- level: z14.enum(["info"]),
468
- subtype: z14.undefined().optional()
481
+ type: z16.literal("system"),
482
+ content: z16.string(),
483
+ toolUseID: z16.string(),
484
+ level: z16.enum(["info"]),
485
+ subtype: z16.undefined().optional()
469
486
  });
470
487
  var StopHookSummaryEntrySchema = BaseEntrySchema.extend({
471
- type: z14.literal("system"),
472
- subtype: z14.literal("stop_hook_summary"),
473
- toolUseID: z14.string(),
474
- level: z14.enum(["info", "suggestion"]),
475
- slug: z14.string().optional(),
476
- hookCount: z14.number(),
477
- hookInfos: z14.array(HookInfoSchema),
478
- hookErrors: z14.array(z14.unknown()),
479
- preventedContinuation: z14.boolean(),
480
- stopReason: z14.string(),
481
- hasOutput: z14.boolean()
488
+ type: z16.literal("system"),
489
+ subtype: z16.literal("stop_hook_summary"),
490
+ toolUseID: z16.string(),
491
+ level: z16.enum(["info", "suggestion"]),
492
+ slug: z16.string().optional(),
493
+ hookCount: z16.number(),
494
+ hookInfos: z16.array(HookInfoSchema),
495
+ hookErrors: z16.array(z16.unknown()),
496
+ preventedContinuation: z16.boolean(),
497
+ stopReason: z16.string(),
498
+ hasOutput: z16.boolean()
482
499
  });
483
500
  var LocalCommandEntrySchema = BaseEntrySchema.extend({
484
- type: z14.literal("system"),
485
- subtype: z14.literal("local_command"),
486
- content: z14.string(),
487
- level: z14.enum(["info"])
501
+ type: z16.literal("system"),
502
+ subtype: z16.literal("local_command"),
503
+ content: z16.string(),
504
+ level: z16.enum(["info"])
488
505
  });
489
506
  var TurnDurationEntrySchema = BaseEntrySchema.extend({
490
- type: z14.literal("system"),
491
- subtype: z14.literal("turn_duration"),
492
- durationMs: z14.number(),
493
- slug: z14.string().optional()
507
+ type: z16.literal("system"),
508
+ subtype: z16.literal("turn_duration"),
509
+ durationMs: z16.number(),
510
+ slug: z16.string().optional()
494
511
  });
495
512
  var CompactBoundaryEntrySchema = BaseEntrySchema.extend({
496
- type: z14.literal("system"),
497
- subtype: z14.literal("compact_boundary"),
498
- content: z14.string(),
499
- level: z14.enum(["info"]),
500
- slug: z14.string().optional(),
501
- logicalParentUuid: z14.string().optional(),
502
- compactMetadata: z14.object({
503
- trigger: z14.string(),
504
- preTokens: z14.number()
513
+ type: z16.literal("system"),
514
+ subtype: z16.literal("compact_boundary"),
515
+ content: z16.string(),
516
+ level: z16.enum(["info"]),
517
+ slug: z16.string().optional(),
518
+ logicalParentUuid: z16.string().optional(),
519
+ compactMetadata: z16.object({
520
+ trigger: z16.string(),
521
+ preTokens: z16.number()
505
522
  }).optional()
506
523
  });
507
524
  var ApiErrorEntrySchema = BaseEntrySchema.extend({
508
- type: z14.literal("system"),
509
- subtype: z14.literal("api_error"),
510
- level: z14.enum(["error", "warning", "info"]),
511
- error: z14.object({
512
- status: z14.number().optional(),
513
- headers: z14.record(z14.string(), z14.unknown()).optional(),
514
- requestID: z14.string().nullable().optional(),
515
- error: z14.object({
516
- type: z14.string(),
517
- error: z14.object({
518
- type: z14.string(),
519
- message: z14.string()
525
+ type: z16.literal("system"),
526
+ subtype: z16.literal("api_error"),
527
+ level: z16.enum(["error", "warning", "info"]),
528
+ error: z16.object({
529
+ status: z16.number().optional(),
530
+ headers: z16.record(z16.string(), z16.unknown()).optional(),
531
+ requestID: z16.string().nullable().optional(),
532
+ error: z16.object({
533
+ type: z16.string(),
534
+ error: z16.object({
535
+ type: z16.string(),
536
+ message: z16.string()
520
537
  }).optional(),
521
- message: z14.string().optional()
538
+ message: z16.string().optional()
522
539
  }).optional()
523
540
  }),
524
- retryInMs: z14.number().optional(),
525
- retryAttempt: z14.number().optional(),
526
- maxRetries: z14.number().optional()
541
+ retryInMs: z16.number().optional(),
542
+ retryAttempt: z16.number().optional(),
543
+ maxRetries: z16.number().optional()
527
544
  });
528
- var SystemEntrySchema = z14.union([
545
+ var SystemEntrySchema = z16.union([
529
546
  StopHookSummaryEntrySchema,
530
547
  LocalCommandEntrySchema,
531
548
  TurnDurationEntrySchema,
@@ -536,42 +553,44 @@ var SystemEntrySchema = z14.union([
536
553
  ]);
537
554
 
538
555
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
539
- import { z as z16 } from "zod";
556
+ import { z as z18 } from "zod";
540
557
 
541
558
  // src/lib/conversation-schema/message/UserMessageSchema.ts
542
- import { z as z15 } from "zod";
543
- var UserMessageContentSchema = z15.union([
544
- z15.string(),
559
+ import { z as z17 } from "zod";
560
+ var UserMessageContentSchema = z17.union([
561
+ z17.string(),
545
562
  TextContentSchema,
546
563
  ToolResultContentSchema,
547
564
  ImageContentSchema,
548
565
  DocumentContentSchema
549
566
  ]);
550
- var UserMessageSchema = z15.object({
551
- role: z15.literal("user"),
552
- content: z15.union([
553
- z15.string(),
554
- z15.array(z15.union([z15.string(), UserMessageContentSchema]))
567
+ var UserMessageSchema = z17.object({
568
+ role: z17.literal("user"),
569
+ content: z17.union([
570
+ z17.string(),
571
+ z17.array(z17.union([z17.string(), UserMessageContentSchema]))
555
572
  ])
556
573
  });
557
574
 
558
575
  // src/lib/conversation-schema/entry/UserEntrySchema.ts
559
576
  var UserEntrySchema = BaseEntrySchema.extend({
560
577
  // discriminator
561
- type: z16.literal("user"),
578
+ type: z18.literal("user"),
562
579
  // required
563
580
  message: UserMessageSchema
564
581
  });
565
582
 
566
583
  // src/lib/conversation-schema/index.ts
567
- var ConversationSchema = z17.union([
584
+ var ConversationSchema = z19.union([
568
585
  UserEntrySchema,
569
586
  AssistantEntrySchema,
570
587
  SummaryEntrySchema,
571
588
  SystemEntrySchema,
572
589
  FileHistorySnapshotEntrySchema,
573
590
  QueueOperationEntrySchema,
574
- ProgressEntrySchema
591
+ ProgressEntrySchema,
592
+ CustomTitleEntrySchema,
593
+ AgentNameEntrySchema
575
594
  ]);
576
595
 
577
596
  // src/server/core/claude-code/functions/parseJsonl.ts
@@ -603,6 +622,21 @@ var encodeProjectIdFromSessionFilePath = (sessionFilePath) => {
603
622
  return encodeProjectId(dirname(sessionFilePath));
604
623
  };
605
624
 
625
+ // src/server/core/session/functions/extractFirstUserText.ts
626
+ var extractFirstUserText = (conversation) => {
627
+ if (conversation.type !== "user") {
628
+ return null;
629
+ }
630
+ const firstUserText = typeof conversation.message.content === "string" ? conversation.message.content : (() => {
631
+ const firstContent = conversation.message.content.at(0);
632
+ if (firstContent === void 0) return null;
633
+ if (typeof firstContent === "string") return firstContent;
634
+ if (firstContent.type === "text") return firstContent.text;
635
+ return null;
636
+ })();
637
+ return firstUserText;
638
+ };
639
+
606
640
  // src/server/core/agent-session/infrastructure/AgentSessionRepository.ts
607
641
  var LayerImpl = Effect2.gen(function* () {
608
642
  const fs = yield* FileSystem.FileSystem;
@@ -630,8 +664,65 @@ var LayerImpl = Effect2.gen(function* () {
630
664
  const conversations = parseJsonl(content);
631
665
  return conversations;
632
666
  });
667
+ const listAgentSessionsForSession = (projectId, sessionId) => Effect2.gen(function* () {
668
+ const projectPath = decodeProjectId(projectId);
669
+ const results = [];
670
+ const extractAgentId = (filename) => {
671
+ const match = /^agent-(.+)\.jsonl$/.exec(filename);
672
+ return match ? match[1] ?? null : null;
673
+ };
674
+ const processFile = (filePath, filename) => Effect2.gen(function* () {
675
+ const agentId = extractAgentId(filename);
676
+ if (agentId === null) return;
677
+ const content = yield* fs.readFileString(filePath);
678
+ const firstLine = content.split("\n")[0];
679
+ if (!firstLine || firstLine.trim() === "") return;
680
+ try {
681
+ const conversations = parseJsonl(firstLine);
682
+ const firstConv = conversations[0];
683
+ const firstMessage = firstConv ? extractFirstUserText(firstConv) : null;
684
+ results.push({ agentId, firstMessage });
685
+ } catch {
686
+ results.push({ agentId, firstMessage: null });
687
+ }
688
+ });
689
+ const subagentsDir = path.join(projectPath, sessionId, "subagents");
690
+ const subagentsDirExists = yield* fs.exists(subagentsDir);
691
+ if (subagentsDirExists) {
692
+ const entries = yield* fs.readDirectory(subagentsDir).pipe(Effect2.catchAll(() => Effect2.succeed([])));
693
+ const agentFiles = entries.filter(
694
+ (f) => f.startsWith("agent-") && f.endsWith(".jsonl")
695
+ );
696
+ for (const filename of agentFiles) {
697
+ yield* processFile(path.join(subagentsDir, filename), filename).pipe(
698
+ Effect2.catchAll(() => Effect2.void)
699
+ );
700
+ }
701
+ }
702
+ const rootEntries = yield* fs.readDirectory(projectPath).pipe(Effect2.catchAll(() => Effect2.succeed([])));
703
+ const rootAgentFiles = rootEntries.filter(
704
+ (f) => f.startsWith("agent-") && f.endsWith(".jsonl")
705
+ );
706
+ for (const filename of rootAgentFiles) {
707
+ const filePath = path.join(projectPath, filename);
708
+ const content = yield* fs.readFileString(filePath).pipe(Effect2.catchAll(() => Effect2.succeed("")));
709
+ const firstLine = content.split("\n")[0];
710
+ if (!firstLine || firstLine.trim() === "") continue;
711
+ try {
712
+ const parsed = JSON.parse(firstLine);
713
+ if (typeof parsed === "object" && parsed !== null && "sessionId" in parsed && parsed.sessionId === sessionId) {
714
+ yield* processFile(filePath, filename).pipe(
715
+ Effect2.catchAll(() => Effect2.void)
716
+ );
717
+ }
718
+ } catch {
719
+ }
720
+ }
721
+ return results;
722
+ });
633
723
  return {
634
- getAgentSessionByAgentId
724
+ getAgentSessionByAgentId,
725
+ listAgentSessionsForSession
635
726
  };
636
727
  });
637
728
  var AgentSessionRepository = class extends Context.Tag(
@@ -670,8 +761,22 @@ var LayerImpl2 = Effect3.gen(function* () {
670
761
  }
671
762
  };
672
763
  });
764
+ const listAgentSessions = (params) => Effect3.gen(function* () {
765
+ const { projectId, sessionId } = params;
766
+ const agentSessions = yield* repository.listAgentSessionsForSession(
767
+ projectId,
768
+ sessionId
769
+ );
770
+ return {
771
+ status: 200,
772
+ response: {
773
+ agentSessions
774
+ }
775
+ };
776
+ });
673
777
  return {
674
- getAgentSession
778
+ getAgentSession,
779
+ listAgentSessions
675
780
  };
676
781
  });
677
782
  var AgentSessionController = class extends Context2.Tag(
@@ -719,7 +824,8 @@ var LayerImpl3 = Effect4.gen(function* () {
719
824
  claudeDir: cliOptions.claudeDir ?? getOptionalEnv2("CCV_GLOBAL_CLAUDE_DIR"),
720
825
  terminalDisabled: cliOptions.terminalDisabled ?? (isFlagEnabled(getOptionalEnv2("CCV_TERMINAL_DISABLED")) ? true : void 0),
721
826
  terminalShell: cliOptions.terminalShell ?? getOptionalEnv2("CCV_TERMINAL_SHELL") ?? void 0,
722
- terminalUnrestricted: cliOptions.terminalUnrestricted ?? (isFlagEnabled(getOptionalEnv2("CCV_TERMINAL_UNRESTRICTED")) ? true : void 0)
827
+ terminalUnrestricted: cliOptions.terminalUnrestricted ?? (isFlagEnabled(getOptionalEnv2("CCV_TERMINAL_UNRESTRICTED")) ? true : void 0),
828
+ apiOnly: cliOptions.apiOnly ?? (isFlagEnabled(getOptionalEnv2("CCV_API_ONLY")) ? true : void 0)
723
829
  };
724
830
  });
725
831
  });
@@ -784,7 +890,7 @@ import { Context as Context7, Effect as Effect9, Layer as Layer9, Option as Opti
784
890
  // src/server/core/project/services/ProjectMetaService.ts
785
891
  import { FileSystem as FileSystem3, Path as Path4 } from "@effect/platform";
786
892
  import { Context as Context6, Effect as Effect8, Layer as Layer8, Option, Ref as Ref3 } from "effect";
787
- import { z as z19 } from "zod";
893
+ import { z as z21 } from "zod";
788
894
 
789
895
  // src/server/lib/storage/FileCacheStorage/index.ts
790
896
  import { Context as Context5, Effect as Effect7, Layer as Layer7, Ref as Ref2, Runtime } from "effect";
@@ -792,7 +898,7 @@ import { Context as Context5, Effect as Effect7, Layer as Layer7, Ref as Ref2, R
792
898
  // src/server/lib/storage/FileCacheStorage/PersistentService.ts
793
899
  import { FileSystem as FileSystem2, Path as Path3 } from "@effect/platform";
794
900
  import { Context as Context4, Effect as Effect6, Layer as Layer6 } from "effect";
795
- import { z as z18 } from "zod";
901
+ import { z as z20 } from "zod";
796
902
 
797
903
  // src/server/lib/config/paths.ts
798
904
  import { homedir as homedir2 } from "node:os";
@@ -804,7 +910,7 @@ var claudeCodeViewerCacheDirPath = resolve(
804
910
  );
805
911
 
806
912
  // src/server/lib/storage/FileCacheStorage/PersistentService.ts
807
- var saveSchema = z18.array(z18.tuple([z18.string(), z18.unknown()]));
913
+ var saveSchema = z20.array(z20.tuple([z20.string(), z20.unknown()]));
808
914
  var LayerImpl5 = Effect6.gen(function* () {
809
915
  const path = yield* Path3.Path;
810
916
  const getCacheFilePath = (key) => path.resolve(claudeCodeViewerCacheDirPath, `${key}.json`);
@@ -917,7 +1023,7 @@ var makeFileCacheStorageLayer = (storageKey, schema) => Layer7.effect(
917
1023
  );
918
1024
 
919
1025
  // src/server/core/project/services/ProjectMetaService.ts
920
- var ProjectPathSchema = z19.string().nullable();
1026
+ var ProjectPathSchema = z21.string().nullable();
921
1027
  var LayerImpl6 = Effect8.gen(function* () {
922
1028
  const fs = yield* FileSystem3.FileSystem;
923
1029
  const path = yield* Path4.Path;
@@ -933,7 +1039,7 @@ var LayerImpl6 = Effect8.gen(function* () {
933
1039
  let cwd = null;
934
1040
  for (const line of lines) {
935
1041
  const conversation = parseJsonl(line).at(0);
936
- if (conversation === void 0 || conversation.type === "summary" || conversation.type === "x-error" || conversation.type === "file-history-snapshot" || conversation.type === "queue-operation") {
1042
+ if (conversation === void 0 || conversation.type === "summary" || conversation.type === "x-error" || conversation.type === "file-history-snapshot" || conversation.type === "queue-operation" || conversation.type === "custom-title" || conversation.type === "agent-name") {
937
1043
  continue;
938
1044
  }
939
1045
  cwd = conversation.cwd;
@@ -1200,12 +1306,12 @@ var scanSkillFilesWithMetadata = (dirPath) => Effect10.gen(function* () {
1200
1306
  });
1201
1307
 
1202
1308
  // src/server/core/claude-code/models/ClaudeCodeVersion.ts
1203
- import { z as z20 } from "zod";
1309
+ import { z as z22 } from "zod";
1204
1310
  var versionRegex = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
1205
- var versionSchema = z20.object({
1206
- major: z20.string().transform((value) => Number.parseInt(value, 10)),
1207
- minor: z20.string().transform((value) => Number.parseInt(value, 10)),
1208
- patch: z20.string().transform((value) => Number.parseInt(value, 10))
1311
+ var versionSchema = z22.object({
1312
+ major: z22.string().transform((value) => Number.parseInt(value, 10)),
1313
+ minor: z22.string().transform((value) => Number.parseInt(value, 10)),
1314
+ patch: z22.string().transform((value) => Number.parseInt(value, 10))
1209
1315
  }).refine(
1210
1316
  (data) => [data.major, data.minor, data.patch].every((value) => !Number.isNaN(value))
1211
1317
  );
@@ -1868,26 +1974,26 @@ import { FileSystem as FileSystem9, Path as Path11 } from "@effect/platform";
1868
1974
  import { Context as Context16, Effect as Effect21, Layer as Layer18, Option as Option3 } from "effect";
1869
1975
 
1870
1976
  // src/server/core/claude-code/functions/parseUserMessage.ts
1871
- import { z as z21 } from "zod";
1977
+ import { z as z23 } from "zod";
1872
1978
  var regExp = /<(?<tag>[^>]+)>(?<content>[\s\S]*?)<\/\k<tag>>/g;
1873
- var matchSchema = z21.object({
1874
- tag: z21.string(),
1875
- content: z21.string()
1979
+ var matchSchema = z23.object({
1980
+ tag: z23.string(),
1981
+ content: z23.string()
1876
1982
  });
1877
- var parsedUserMessageSchema = z21.union([
1878
- z21.object({
1879
- kind: z21.literal("command"),
1880
- commandName: z21.string(),
1881
- commandArgs: z21.string().optional(),
1882
- commandMessage: z21.string().optional()
1983
+ var parsedUserMessageSchema = z23.union([
1984
+ z23.object({
1985
+ kind: z23.literal("command"),
1986
+ commandName: z23.string(),
1987
+ commandArgs: z23.string().optional(),
1988
+ commandMessage: z23.string().optional()
1883
1989
  }),
1884
- z21.object({
1885
- kind: z21.literal("local-command"),
1886
- stdout: z21.string()
1990
+ z23.object({
1991
+ kind: z23.literal("local-command"),
1992
+ stdout: z23.string()
1887
1993
  }),
1888
- z21.object({
1889
- kind: z21.literal("text"),
1890
- content: z21.string()
1994
+ z23.object({
1995
+ kind: z23.literal("text"),
1996
+ content: z23.string()
1891
1997
  })
1892
1998
  ]);
1893
1999
  var parseUserMessage = (content) => {
@@ -2232,21 +2338,6 @@ var getAgentSessionFilesForSession = (projectPath, sessionId) => Effect19.gen(fu
2232
2338
  return matchingFilePaths;
2233
2339
  });
2234
2340
 
2235
- // src/server/core/session/functions/extractFirstUserText.ts
2236
- var extractFirstUserText = (conversation) => {
2237
- if (conversation.type !== "user") {
2238
- return null;
2239
- }
2240
- const firstUserText = typeof conversation.message.content === "string" ? conversation.message.content : (() => {
2241
- const firstContent = conversation.message.content.at(0);
2242
- if (firstContent === void 0) return null;
2243
- if (typeof firstContent === "string") return firstContent;
2244
- if (firstContent.type === "text") return firstContent.text;
2245
- return null;
2246
- })();
2247
- return firstUserText;
2248
- };
2249
-
2250
2341
  // src/server/core/session/functions/isValidFirstMessage.ts
2251
2342
  var ignoreCommands = [
2252
2343
  "/clear",
@@ -2282,6 +2373,9 @@ var extractFirstUserMessage = (conversation) => {
2282
2373
  if (command.kind === "command" && ignoreCommands.includes(command.commandName)) {
2283
2374
  return void 0;
2284
2375
  }
2376
+ if (command.kind === "local-command" && command.stdout.trim() === "") {
2377
+ return void 0;
2378
+ }
2285
2379
  return command;
2286
2380
  };
2287
2381
 
@@ -2301,8 +2395,8 @@ var SessionMetaService = class extends Context15.Tag("SessionMetaService")() {
2301
2395
  const getFirstUserMessage = (jsonlFilePath, lines) => Effect20.gen(function* () {
2302
2396
  const cached = yield* firstUserMessageCache.get(jsonlFilePath);
2303
2397
  if (cached !== void 0) {
2304
- if (cached !== null && cached.kind === "text" && isLocalCommandCaveat(cached.content)) {
2305
- } else {
2398
+ const isStale = cached !== null && (cached.kind === "text" && isLocalCommandCaveat(cached.content) || cached.kind === "local-command" && cached.stdout.trim() === "");
2399
+ if (!isStale) {
2306
2400
  return cached;
2307
2401
  }
2308
2402
  }
@@ -3679,16 +3773,16 @@ import { Path as Path12 } from "@effect/platform";
3679
3773
  import { Context as Context22, Effect as Effect28, Layer as Layer24, Ref as Ref9 } from "effect";
3680
3774
 
3681
3775
  // src/server/core/events/functions/parseSessionFilePath.ts
3682
- import z22 from "zod";
3776
+ import z24 from "zod";
3683
3777
  var sessionFileRegExp = /(?<projectId>.*?)\/(?<sessionId>.*?)\.jsonl$/;
3684
3778
  var agentFileRegExp = /(?<projectId>.*?)\/agent-(?<agentSessionId>.*?)\.jsonl$/;
3685
- var sessionFileGroupSchema = z22.object({
3686
- projectId: z22.string(),
3687
- sessionId: z22.string()
3779
+ var sessionFileGroupSchema = z24.object({
3780
+ projectId: z24.string(),
3781
+ sessionId: z24.string()
3688
3782
  });
3689
- var agentFileGroupSchema = z22.object({
3690
- projectId: z22.string(),
3691
- agentSessionId: z22.string()
3783
+ var agentFileGroupSchema = z24.object({
3784
+ projectId: z24.string(),
3785
+ agentSessionId: z24.string()
3692
3786
  });
3693
3787
  var parseSessionFilePath = (filePath) => {
3694
3788
  const agentMatch = filePath.match(agentFileRegExp);
@@ -4720,16 +4814,16 @@ import { Context as Context26, Data as Data4, Duration, Effect as Effect32, Eith
4720
4814
  import { Context as Context25, Effect as Effect31, Layer as Layer27, Ref as Ref10 } from "effect";
4721
4815
 
4722
4816
  // src/server/core/platform/schema.ts
4723
- import { z as z23 } from "zod";
4724
- var envSchema = z23.object({
4817
+ import { z as z25 } from "zod";
4818
+ var envSchema = z25.object({
4725
4819
  // Frameworks
4726
- CCV_ENV: z23.enum(["development", "production", "test"]).optional().default("development"),
4727
- NEXT_PHASE: z23.string().optional(),
4728
- PATH: z23.string().optional(),
4729
- SHELL: z23.string().optional(),
4730
- CCV_TERMINAL_SHELL: z23.string().optional(),
4731
- CCV_TERMINAL_UNRESTRICTED: z23.string().optional(),
4732
- CCV_TERMINAL_DISABLED: z23.string().optional()
4820
+ CCV_ENV: z25.enum(["development", "production", "test"]).optional().default("development"),
4821
+ NEXT_PHASE: z25.string().optional(),
4822
+ PATH: z25.string().optional(),
4823
+ SHELL: z25.string().optional(),
4824
+ CCV_TERMINAL_SHELL: z25.string().optional(),
4825
+ CCV_TERMINAL_UNRESTRICTED: z25.string().optional(),
4826
+ CCV_TERMINAL_DISABLED: z25.string().optional()
4733
4827
  });
4734
4828
 
4735
4829
  // src/server/core/platform/services/EnvService.ts
@@ -5686,49 +5780,49 @@ import { FileSystem as FileSystem12, Path as Path16 } from "@effect/platform";
5686
5780
  import { Context as Context29, Data as Data5, Effect as Effect36, Layer as Layer31 } from "effect";
5687
5781
 
5688
5782
  // src/server/core/scheduler/schema.ts
5689
- import { z as z24 } from "zod";
5690
- var concurrencyPolicySchema = z24.enum(["skip", "run"]);
5691
- var cronScheduleSchema = z24.object({
5692
- type: z24.literal("cron"),
5693
- expression: z24.string(),
5783
+ import { z as z26 } from "zod";
5784
+ var concurrencyPolicySchema = z26.enum(["skip", "run"]);
5785
+ var cronScheduleSchema = z26.object({
5786
+ type: z26.literal("cron"),
5787
+ expression: z26.string(),
5694
5788
  concurrencyPolicy: concurrencyPolicySchema
5695
5789
  });
5696
- var reservedScheduleSchema = z24.object({
5697
- type: z24.literal("reserved"),
5698
- reservedExecutionTime: z24.iso.datetime()
5790
+ var reservedScheduleSchema = z26.object({
5791
+ type: z26.literal("reserved"),
5792
+ reservedExecutionTime: z26.iso.datetime()
5699
5793
  });
5700
- var scheduleSchema = z24.discriminatedUnion("type", [
5794
+ var scheduleSchema = z26.discriminatedUnion("type", [
5701
5795
  cronScheduleSchema,
5702
5796
  reservedScheduleSchema
5703
5797
  ]);
5704
- var messageConfigSchema = z24.object({
5705
- content: z24.string(),
5706
- projectId: z24.string(),
5707
- baseSession: z24.union([
5708
- z24.null(),
5709
- z24.object({
5710
- type: z24.literal("fork"),
5711
- sessionId: z24.string()
5798
+ var messageConfigSchema = z26.object({
5799
+ content: z26.string(),
5800
+ projectId: z26.string(),
5801
+ baseSession: z26.union([
5802
+ z26.null(),
5803
+ z26.object({
5804
+ type: z26.literal("fork"),
5805
+ sessionId: z26.string()
5712
5806
  }),
5713
- z24.object({
5714
- type: z24.literal("resume"),
5715
- sessionId: z24.string()
5807
+ z26.object({
5808
+ type: z26.literal("resume"),
5809
+ sessionId: z26.string()
5716
5810
  })
5717
5811
  ])
5718
5812
  });
5719
- var jobStatusSchema = z24.enum(["success", "failed"]);
5720
- var schedulerJobSchema = z24.object({
5721
- id: z24.string(),
5722
- name: z24.string(),
5813
+ var jobStatusSchema = z26.enum(["success", "failed"]);
5814
+ var schedulerJobSchema = z26.object({
5815
+ id: z26.string(),
5816
+ name: z26.string(),
5723
5817
  schedule: scheduleSchema,
5724
5818
  message: messageConfigSchema,
5725
- enabled: z24.boolean(),
5726
- createdAt: z24.string().datetime(),
5727
- lastRunAt: z24.string().datetime().nullable(),
5819
+ enabled: z26.boolean(),
5820
+ createdAt: z26.string().datetime(),
5821
+ lastRunAt: z26.string().datetime().nullable(),
5728
5822
  lastRunStatus: jobStatusSchema.nullable()
5729
5823
  });
5730
- var schedulerConfigSchema = z24.object({
5731
- jobs: z24.array(schedulerJobSchema)
5824
+ var schedulerConfigSchema = z26.object({
5825
+ jobs: z26.array(schedulerJobSchema)
5732
5826
  });
5733
5827
  var newSchedulerJobSchema = schedulerJobSchema.omit({
5734
5828
  id: true,
@@ -5736,7 +5830,7 @@ var newSchedulerJobSchema = schedulerJobSchema.omit({
5736
5830
  lastRunAt: true,
5737
5831
  lastRunStatus: true
5738
5832
  }).extend({
5739
- enabled: z24.boolean().default(true)
5833
+ enabled: z26.boolean().default(true)
5740
5834
  });
5741
5835
  var updateSchedulerJobSchema = schedulerJobSchema.partial().pick({
5742
5836
  name: true,
@@ -6110,17 +6204,17 @@ var SchedulerService = class extends Context30.Tag("SchedulerService")() {
6110
6204
  };
6111
6205
 
6112
6206
  // src/server/core/rate-limit/schema.ts
6113
- import { z as z25 } from "zod";
6114
- var RateLimitEntrySchema = z25.object({
6115
- type: z25.literal("assistant"),
6116
- error: z25.literal("rate_limit"),
6117
- isApiErrorMessage: z25.literal(true),
6118
- sessionId: z25.string(),
6119
- message: z25.object({
6120
- content: z25.array(
6121
- z25.object({
6122
- type: z25.literal("text"),
6123
- text: z25.string()
6207
+ import { z as z27 } from "zod";
6208
+ var RateLimitEntrySchema = z27.object({
6209
+ type: z27.literal("assistant"),
6210
+ error: z27.literal("rate_limit"),
6211
+ isApiErrorMessage: z27.literal(true),
6212
+ sessionId: z27.string(),
6213
+ message: z27.object({
6214
+ content: z27.array(
6215
+ z27.object({
6216
+ type: z27.literal("text"),
6217
+ text: z27.string()
6124
6218
  })
6125
6219
  )
6126
6220
  })
@@ -6505,6 +6599,12 @@ var extractSearchableText = (conversation) => {
6505
6599
  if (conversation.type === "assistant") {
6506
6600
  return extractAssistantText(conversation);
6507
6601
  }
6602
+ if (conversation.type === "custom-title") {
6603
+ return conversation.customTitle;
6604
+ }
6605
+ if (conversation.type === "agent-name") {
6606
+ return null;
6607
+ }
6508
6608
  return null;
6509
6609
  };
6510
6610
  var extractUserText = (entry) => {
@@ -6972,7 +7072,7 @@ var hasAgentId = (toolUseResult) => {
6972
7072
  };
6973
7073
  var buildSidechainData = (conversations) => {
6974
7074
  const sidechainConversations = conversations.filter(
6975
- (conv) => conv.type !== "summary" && conv.type !== "file-history-snapshot" && conv.type !== "queue-operation" && conv.type !== "progress" && conv.isSidechain === true
7075
+ (conv) => conv.type !== "summary" && conv.type !== "file-history-snapshot" && conv.type !== "queue-operation" && conv.type !== "progress" && conv.type !== "custom-title" && conv.type !== "agent-name" && conv.isSidechain === true
6976
7076
  );
6977
7077
  const uuidMap = new Map(
6978
7078
  sidechainConversations.map((conv) => [conv.uuid, conv])
@@ -7441,7 +7541,7 @@ var generateSessionHtml = (session, projectId, agentSessionRepo) => Effect44.gen
7441
7541
  const existingAgentIds = /* @__PURE__ */ new Set();
7442
7542
  for (const conv of session.conversations) {
7443
7543
  if (conv.type === "x-error") continue;
7444
- if (conv.type !== "summary" && conv.type !== "file-history-snapshot" && conv.type !== "queue-operation" && conv.type !== "progress" && conv.isSidechain === true && conv.agentId !== void 0) {
7544
+ if (conv.type !== "summary" && conv.type !== "file-history-snapshot" && conv.type !== "queue-operation" && conv.type !== "progress" && conv.type !== "custom-title" && conv.type !== "agent-name" && conv.isSidechain === true && conv.agentId !== void 0) {
7445
7545
  existingAgentIds.add(conv.agentId);
7446
7546
  }
7447
7547
  }
@@ -8427,40 +8527,40 @@ import { FileSystem as FileSystem17, Path as Path19 } from "@effect/platform";
8427
8527
  import { Context as Context36, Effect as Effect46, Layer as Layer38, Option as Option4 } from "effect";
8428
8528
 
8429
8529
  // src/server/core/tasks/schema.ts
8430
- import { z as z26 } from "zod";
8431
- var TaskStatusSchema = z26.enum([
8530
+ import { z as z28 } from "zod";
8531
+ var TaskStatusSchema = z28.enum([
8432
8532
  "pending",
8433
8533
  "in_progress",
8434
8534
  "completed",
8435
8535
  "failed"
8436
8536
  ]);
8437
- var TaskSchema = z26.object({
8438
- id: z26.string(),
8439
- subject: z26.string(),
8440
- description: z26.string().optional(),
8537
+ var TaskSchema = z28.object({
8538
+ id: z28.string(),
8539
+ subject: z28.string(),
8540
+ description: z28.string().optional(),
8441
8541
  status: TaskStatusSchema,
8442
- owner: z26.string().optional(),
8443
- blocks: z26.array(z26.string()).optional(),
8444
- blockedBy: z26.array(z26.string()).optional(),
8445
- metadata: z26.record(z26.string(), z26.any()).optional(),
8446
- activeForm: z26.string().optional()
8542
+ owner: z28.string().optional(),
8543
+ blocks: z28.array(z28.string()).optional(),
8544
+ blockedBy: z28.array(z28.string()).optional(),
8545
+ metadata: z28.record(z28.string(), z28.any()).optional(),
8546
+ activeForm: z28.string().optional()
8447
8547
  });
8448
- var TaskCreateSchema = z26.object({
8449
- subject: z26.string(),
8450
- description: z26.string().optional(),
8451
- activeForm: z26.string().optional(),
8452
- metadata: z26.record(z26.string(), z26.any()).optional()
8548
+ var TaskCreateSchema = z28.object({
8549
+ subject: z28.string(),
8550
+ description: z28.string().optional(),
8551
+ activeForm: z28.string().optional(),
8552
+ metadata: z28.record(z28.string(), z28.any()).optional()
8453
8553
  });
8454
- var TaskUpdateSchema = z26.object({
8455
- taskId: z26.string(),
8554
+ var TaskUpdateSchema = z28.object({
8555
+ taskId: z28.string(),
8456
8556
  status: TaskStatusSchema.optional(),
8457
- subject: z26.string().optional(),
8458
- description: z26.string().optional(),
8459
- activeForm: z26.string().optional(),
8460
- owner: z26.string().optional(),
8461
- addBlockedBy: z26.array(z26.string()).optional(),
8462
- addBlocks: z26.array(z26.string()).optional(),
8463
- metadata: z26.record(z26.string(), z26.any()).optional()
8557
+ subject: z28.string().optional(),
8558
+ description: z28.string().optional(),
8559
+ activeForm: z28.string().optional(),
8560
+ owner: z28.string().optional(),
8561
+ addBlockedBy: z28.array(z28.string()).optional(),
8562
+ addBlocks: z28.array(z28.string()).optional(),
8563
+ metadata: z28.record(z28.string(), z28.any()).optional()
8464
8564
  });
8465
8565
 
8466
8566
  // src/server/core/tasks/services/TasksService.ts
@@ -8758,6 +8858,41 @@ var TasksController = class extends Context37.Tag("TasksController")() {
8758
8858
  // src/server/core/terminal/TerminalService.ts
8759
8859
  import { Context as Context38, Effect as Effect48, Layer as Layer40 } from "effect";
8760
8860
  import { ulid as ulid5 } from "ulid";
8861
+
8862
+ // src/server/core/terminal/normalizePtyChunk.ts
8863
+ var normalizePtyChunk = (chunk) => {
8864
+ if (typeof chunk === "string") {
8865
+ return chunk;
8866
+ }
8867
+ if (chunk instanceof Uint8Array) {
8868
+ return Buffer.from(chunk).toString("utf8");
8869
+ }
8870
+ if (chunk instanceof ArrayBuffer) {
8871
+ return Buffer.from(chunk).toString("utf8");
8872
+ }
8873
+ return null;
8874
+ };
8875
+
8876
+ // src/server/core/terminal/rusptyAdapter.ts
8877
+ var createRusptySession = (ruspty, options) => {
8878
+ const pty = new ruspty.Pty(options);
8879
+ return {
8880
+ process: {
8881
+ write: (data) => {
8882
+ pty.write.write(data);
8883
+ },
8884
+ resize: (cols, rows) => {
8885
+ pty.resize({ cols, rows });
8886
+ },
8887
+ kill: () => {
8888
+ pty.close();
8889
+ }
8890
+ },
8891
+ read: pty.read
8892
+ };
8893
+ };
8894
+
8895
+ // src/server/core/terminal/TerminalService.ts
8761
8896
  var DEFAULT_COLS = 80;
8762
8897
  var DEFAULT_ROWS = 24;
8763
8898
  var MAX_BUFFER_BYTES = 1024 * 1024 * 2;
@@ -8794,9 +8929,9 @@ var LayerImpl30 = Effect48.gen(function* () {
8794
8929
  snapshotSince: () => Effect48.succeed(void 0)
8795
8930
  };
8796
8931
  };
8797
- const nodePty = yield* Effect48.tryPromise({
8798
- try: () => import("node-pty"),
8799
- catch: (error) => new Error(`Failed to load node-pty: ${String(error)}`)
8932
+ const ruspty = yield* Effect48.tryPromise({
8933
+ try: () => import("@replit/ruspty"),
8934
+ catch: (error) => new Error(`Failed to load @replit/ruspty: ${String(error)}`)
8800
8935
  }).pipe(
8801
8936
  Effect48.catchAll(
8802
8937
  (error) => Effect48.sync(() => {
@@ -8805,10 +8940,9 @@ var LayerImpl30 = Effect48.gen(function* () {
8805
8940
  })
8806
8941
  )
8807
8942
  );
8808
- if (!nodePty) {
8809
- return disabledService("node-pty failed to load");
8943
+ if (!ruspty) {
8944
+ return disabledService("@replit/ruspty failed to load");
8810
8945
  }
8811
- const { spawn } = nodePty;
8812
8946
  const trimBuffer = (session) => {
8813
8947
  while (session.bufferBytes > MAX_BUFFER_BYTES && session.buffer.length > 0) {
8814
8948
  const removed = session.buffer.shift();
@@ -8864,16 +8998,26 @@ var LayerImpl30 = Effect48.gen(function* () {
8864
8998
  options.fallbackShell,
8865
8999
  options.unrestrictedFlag
8866
9000
  );
8867
- const pty = spawn(shell.command, shell.args, {
8868
- name: "xterm-color",
8869
- cols: DEFAULT_COLS,
8870
- rows: DEFAULT_ROWS,
8871
- cwd: options.cwd,
8872
- env: options.env
9001
+ const { process: ptyProcess, read } = createRusptySession(ruspty, {
9002
+ command: shell.command,
9003
+ args: shell.args,
9004
+ envs: options.env,
9005
+ dir: options.cwd,
9006
+ size: { cols: DEFAULT_COLS, rows: DEFAULT_ROWS },
9007
+ onExit: (_error, exitCode) => {
9008
+ const current = sessions.get(id);
9009
+ if (!current) return;
9010
+ current.exited = true;
9011
+ current.lastActivity = Date.now();
9012
+ broadcast(current, { type: "exit", code: exitCode });
9013
+ if (current.clients.size === 0) {
9014
+ destroySession(current.id);
9015
+ }
9016
+ }
8873
9017
  });
8874
9018
  const session = {
8875
9019
  id,
8876
- pty,
9020
+ pty: ptyProcess,
8877
9021
  seq: 0,
8878
9022
  buffer: [],
8879
9023
  bufferBytes: 0,
@@ -8882,27 +9026,22 @@ var LayerImpl30 = Effect48.gen(function* () {
8882
9026
  exited: false,
8883
9027
  inputBuffer: ""
8884
9028
  };
8885
- pty.onData((data) => {
8886
- if (session.exited) return;
8887
- session.lastActivity = Date.now();
8888
- session.seq += 1;
8889
- session.buffer.push({ seq: session.seq, data });
8890
- session.bufferBytes += Buffer.byteLength(data, "utf8");
8891
- trimBuffer(session);
8892
- broadcast(session, {
9029
+ read.on("data", (chunk) => {
9030
+ const data = normalizePtyChunk(chunk);
9031
+ if (data === null) return;
9032
+ const current = sessions.get(session.id);
9033
+ if (!current || current.exited) return;
9034
+ current.lastActivity = Date.now();
9035
+ current.seq += 1;
9036
+ current.buffer.push({ seq: current.seq, data });
9037
+ current.bufferBytes += Buffer.byteLength(data, "utf8");
9038
+ trimBuffer(current);
9039
+ broadcast(current, {
8893
9040
  type: "output",
8894
- seq: session.seq,
9041
+ seq: current.seq,
8895
9042
  data
8896
9043
  });
8897
9044
  });
8898
- pty.onExit((event) => {
8899
- session.exited = true;
8900
- session.lastActivity = Date.now();
8901
- broadcast(session, { type: "exit", code: event.exitCode });
8902
- if (session.clients.size === 0) {
8903
- destroySession(session.id);
8904
- }
8905
- });
8906
9045
  sessions.set(id, session);
8907
9046
  return session;
8908
9047
  };
@@ -9139,7 +9278,15 @@ var generateSessionToken = (password) => {
9139
9278
  if (!password) return "";
9140
9279
  return Buffer.from(`ccv-session:${password}`).toString("base64");
9141
9280
  };
9142
- var createAuthRequiredMiddleware = (authEnabled, validSessionToken) => {
9281
+ var getBearerToken = (authorization) => {
9282
+ if (!authorization) return void 0;
9283
+ const [scheme, token] = authorization.split(" ");
9284
+ if (!scheme || !token) return void 0;
9285
+ if (scheme.toLowerCase() !== "bearer") return void 0;
9286
+ const trimmedToken = token.trim();
9287
+ return trimmedToken.length > 0 ? trimmedToken : void 0;
9288
+ };
9289
+ var createAuthRequiredMiddleware = (authEnabled, validSessionToken, authPassword) => {
9143
9290
  return createMiddleware(async (c, next) => {
9144
9291
  if (!c.req.path.startsWith("/api")) {
9145
9292
  return next();
@@ -9148,7 +9295,10 @@ var createAuthRequiredMiddleware = (authEnabled, validSessionToken) => {
9148
9295
  return next();
9149
9296
  }
9150
9297
  const sessionToken = getCookie(c, "ccv-session");
9151
- if (!sessionToken || sessionToken !== validSessionToken) {
9298
+ const bearerToken = getBearerToken(c.req.header("Authorization"));
9299
+ const cookieAuthorized = sessionToken === validSessionToken;
9300
+ const bearerAuthorized = authPassword !== void 0 && bearerToken === authPassword;
9301
+ if (!cookieAuthorized && !bearerAuthorized) {
9152
9302
  return c.json({ error: "Unauthorized" }, 401);
9153
9303
  }
9154
9304
  await next();
@@ -9170,11 +9320,12 @@ var LayerImpl31 = Effect50.gen(function* () {
9170
9320
  if (!c.req.path.startsWith("/api")) {
9171
9321
  return next();
9172
9322
  }
9173
- const { authEnabled, validSessionToken } = await runPromise(getAuthState);
9174
- return createAuthRequiredMiddleware(authEnabled, validSessionToken)(
9175
- c,
9176
- next
9177
- );
9323
+ const { authEnabled, validSessionToken, authPassword } = await runPromise(getAuthState);
9324
+ return createAuthRequiredMiddleware(
9325
+ authEnabled,
9326
+ validSessionToken,
9327
+ authPassword
9328
+ )(c, next);
9178
9329
  }
9179
9330
  );
9180
9331
  return {
@@ -9193,25 +9344,26 @@ var AuthMiddleware = class extends Context40.Tag("AuthMiddleware")() {
9193
9344
  import { zValidator as zValidator8 } from "@hono/zod-validator";
9194
9345
  import { Effect as Effect62, Runtime as Runtime5 } from "effect";
9195
9346
  import { setCookie as setCookie3 } from "hono/cookie";
9347
+ import { createMiddleware as createMiddleware3 } from "hono/factory";
9196
9348
  import prexit from "prexit";
9197
9349
 
9198
9350
  // src/server/lib/config/config.ts
9199
- import z28 from "zod";
9351
+ import z30 from "zod";
9200
9352
 
9201
9353
  // src/lib/i18n/schema.ts
9202
- import z27 from "zod";
9203
- var localeSchema = z27.enum(["ja", "en", "zh_CN"]);
9354
+ import z29 from "zod";
9355
+ var localeSchema = z29.enum(["ja", "en", "zh_CN"]);
9204
9356
 
9205
9357
  // src/server/lib/config/config.ts
9206
- var userConfigSchema = z28.object({
9207
- hideNoUserMessageSession: z28.boolean().optional().default(true),
9208
- unifySameTitleSession: z28.boolean().optional().default(false),
9209
- enterKeyBehavior: z28.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
9210
- permissionMode: z28.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional().default("default"),
9358
+ var userConfigSchema = z30.object({
9359
+ hideNoUserMessageSession: z30.boolean().optional().default(true),
9360
+ unifySameTitleSession: z30.boolean().optional().default(false),
9361
+ enterKeyBehavior: z30.enum(["shift-enter-send", "enter-send", "command-enter-send"]).optional().default("shift-enter-send"),
9362
+ permissionMode: z30.enum(["acceptEdits", "bypassPermissions", "default", "plan"]).optional().default("default"),
9211
9363
  locale: localeSchema.optional().default("en"),
9212
- theme: z28.enum(["light", "dark", "system"]).optional().default("system"),
9213
- searchHotkey: z28.enum(["ctrl-k", "command-k"]).optional().default("command-k"),
9214
- autoScheduleContinueOnRateLimit: z28.boolean().optional().default(false)
9364
+ theme: z30.enum(["light", "dark", "system"]).optional().default("system"),
9365
+ searchHotkey: z30.enum(["ctrl-k", "command-k"]).optional().default("command-k"),
9366
+ autoScheduleContinueOnRateLimit: z30.boolean().optional().default(false)
9215
9367
  });
9216
9368
  var defaultUserConfig = userConfigSchema.parse({});
9217
9369
 
@@ -9261,13 +9413,13 @@ import { zValidator } from "@hono/zod-validator";
9261
9413
  import { Effect as Effect52 } from "effect";
9262
9414
  import { Hono as Hono2 } from "hono";
9263
9415
  import { deleteCookie, getCookie as getCookie3, setCookie as setCookie2 } from "hono/cookie";
9264
- import { z as z29 } from "zod";
9416
+ import { z as z31 } from "zod";
9265
9417
  var authRoutes = Effect52.gen(function* () {
9266
9418
  const { getAuthState } = yield* AuthMiddleware;
9267
9419
  const { validSessionToken, authEnabled, authPassword } = yield* getAuthState;
9268
9420
  return new Hono2().post(
9269
9421
  "/login",
9270
- zValidator("json", z29.object({ password: z29.string() })),
9422
+ zValidator("json", z31.object({ password: z31.string() })),
9271
9423
  async (c) => {
9272
9424
  const { password } = c.req.valid("json");
9273
9425
  if (!authEnabled) {
@@ -9306,75 +9458,75 @@ var authRoutes = Effect52.gen(function* () {
9306
9458
  import { zValidator as zValidator2 } from "@hono/zod-validator";
9307
9459
  import { Effect as Effect54 } from "effect";
9308
9460
  import { Hono as Hono3 } from "hono";
9309
- import { z as z31 } from "zod";
9461
+ import { z as z33 } from "zod";
9310
9462
 
9311
9463
  // src/server/core/claude-code/schema.ts
9312
- import { z as z30 } from "zod";
9313
- var mediaTypeSchema = z30.enum([
9464
+ import { z as z32 } from "zod";
9465
+ var mediaTypeSchema = z32.enum([
9314
9466
  "image/png",
9315
9467
  "image/jpeg",
9316
9468
  "image/gif",
9317
9469
  "image/webp"
9318
9470
  ]);
9319
- var imageBlockSchema = z30.object({
9320
- type: z30.literal("image"),
9321
- source: z30.object({
9322
- type: z30.literal("base64"),
9471
+ var imageBlockSchema = z32.object({
9472
+ type: z32.literal("image"),
9473
+ source: z32.object({
9474
+ type: z32.literal("base64"),
9323
9475
  media_type: mediaTypeSchema,
9324
- data: z30.string()
9476
+ data: z32.string()
9325
9477
  })
9326
9478
  });
9327
- var documentBlockSchema = z30.object({
9328
- type: z30.literal("document"),
9329
- source: z30.union([
9330
- z30.object({
9331
- type: z30.literal("text"),
9332
- media_type: z30.enum(["text/plain"]),
9333
- data: z30.string()
9479
+ var documentBlockSchema = z32.object({
9480
+ type: z32.literal("document"),
9481
+ source: z32.union([
9482
+ z32.object({
9483
+ type: z32.literal("text"),
9484
+ media_type: z32.enum(["text/plain"]),
9485
+ data: z32.string()
9334
9486
  }),
9335
- z30.object({
9336
- type: z30.literal("base64"),
9337
- media_type: z30.enum(["application/pdf"]),
9338
- data: z30.string()
9487
+ z32.object({
9488
+ type: z32.literal("base64"),
9489
+ media_type: z32.enum(["application/pdf"]),
9490
+ data: z32.string()
9339
9491
  })
9340
9492
  ])
9341
9493
  });
9342
- var userMessageInputSchema = z30.object({
9343
- text: z30.string().min(1),
9344
- images: z30.array(imageBlockSchema).optional(),
9345
- documents: z30.array(documentBlockSchema).optional()
9494
+ var userMessageInputSchema = z32.object({
9495
+ text: z32.string().min(1),
9496
+ images: z32.array(imageBlockSchema).optional(),
9497
+ documents: z32.array(documentBlockSchema).optional()
9346
9498
  });
9347
- var sandboxNetworkConfigSchema = z30.object({
9348
- allowedDomains: z30.array(z30.string()).optional(),
9349
- allowUnixSockets: z30.array(z30.string()).optional(),
9350
- allowAllUnixSockets: z30.boolean().optional(),
9351
- allowLocalBinding: z30.boolean().optional(),
9352
- httpProxyPort: z30.number().optional(),
9353
- socksProxyPort: z30.number().optional()
9499
+ var sandboxNetworkConfigSchema = z32.object({
9500
+ allowedDomains: z32.array(z32.string()).optional(),
9501
+ allowUnixSockets: z32.array(z32.string()).optional(),
9502
+ allowAllUnixSockets: z32.boolean().optional(),
9503
+ allowLocalBinding: z32.boolean().optional(),
9504
+ httpProxyPort: z32.number().optional(),
9505
+ socksProxyPort: z32.number().optional()
9354
9506
  });
9355
- var sandboxSettingsSchema = z30.object({
9356
- enabled: z30.boolean().optional(),
9357
- autoAllowBashIfSandboxed: z30.boolean().optional(),
9358
- allowUnsandboxedCommands: z30.boolean().optional(),
9507
+ var sandboxSettingsSchema = z32.object({
9508
+ enabled: z32.boolean().optional(),
9509
+ autoAllowBashIfSandboxed: z32.boolean().optional(),
9510
+ allowUnsandboxedCommands: z32.boolean().optional(),
9359
9511
  network: sandboxNetworkConfigSchema.optional()
9360
9512
  });
9361
- var ccOptionsSchema = z30.object({
9362
- disallowedTools: z30.array(z30.string()).optional(),
9363
- settingSources: z30.array(z30.enum(["user", "project", "local"])).optional(),
9364
- systemPrompt: z30.union([
9365
- z30.string(),
9366
- z30.object({
9367
- type: z30.literal("preset"),
9368
- preset: z30.literal("claude_code"),
9369
- append: z30.string().optional()
9513
+ var ccOptionsSchema = z32.object({
9514
+ disallowedTools: z32.array(z32.string()).optional(),
9515
+ settingSources: z32.array(z32.enum(["user", "project", "local"])).optional(),
9516
+ systemPrompt: z32.union([
9517
+ z32.string(),
9518
+ z32.object({
9519
+ type: z32.literal("preset"),
9520
+ preset: z32.literal("claude_code"),
9521
+ append: z32.string().optional()
9370
9522
  })
9371
9523
  ]).optional(),
9372
- model: z30.string().optional(),
9524
+ model: z32.string().optional(),
9373
9525
  sandbox: sandboxSettingsSchema.optional(),
9374
- maxTurns: z30.number().optional(),
9375
- maxThinkingTokens: z30.number().optional(),
9376
- env: z30.record(z30.string(), z30.string().optional()).optional(),
9377
- maxBudgetUsd: z30.number().optional()
9526
+ maxTurns: z32.number().optional(),
9527
+ maxThinkingTokens: z32.number().optional(),
9528
+ env: z32.record(z32.string(), z32.string().optional()).optional(),
9529
+ maxBudgetUsd: z32.number().optional()
9378
9530
  });
9379
9531
 
9380
9532
  // src/server/lib/effect/toEffectResponse.ts
@@ -9434,18 +9586,18 @@ var claudeCodeRoutes = Effect54.gen(function* () {
9434
9586
  "/session-processes",
9435
9587
  zValidator2(
9436
9588
  "json",
9437
- z31.object({
9438
- projectId: z31.string(),
9589
+ z33.object({
9590
+ projectId: z33.string(),
9439
9591
  input: userMessageInputSchema,
9440
- baseSession: z31.union([
9441
- z31.undefined(),
9442
- z31.object({
9443
- type: z31.literal("fork"),
9444
- sessionId: z31.string()
9592
+ baseSession: z33.union([
9593
+ z33.undefined(),
9594
+ z33.object({
9595
+ type: z33.literal("fork"),
9596
+ sessionId: z33.string()
9445
9597
  }),
9446
- z31.object({
9447
- type: z31.literal("resume"),
9448
- sessionId: z31.string()
9598
+ z33.object({
9599
+ type: z33.literal("resume"),
9600
+ sessionId: z33.string()
9449
9601
  })
9450
9602
  ]),
9451
9603
  ccOptions: ccOptionsSchema.optional()
@@ -9469,10 +9621,10 @@ var claudeCodeRoutes = Effect54.gen(function* () {
9469
9621
  "/session-processes/:sessionProcessId/continue",
9470
9622
  zValidator2(
9471
9623
  "json",
9472
- z31.object({
9473
- projectId: z31.string(),
9624
+ z33.object({
9625
+ projectId: z33.string(),
9474
9626
  input: userMessageInputSchema,
9475
- baseSessionId: z31.string()
9627
+ baseSessionId: z33.string()
9476
9628
  })
9477
9629
  ),
9478
9630
  async (c) => {
@@ -9490,7 +9642,7 @@ var claudeCodeRoutes = Effect54.gen(function* () {
9490
9642
  }
9491
9643
  ).post(
9492
9644
  "/session-processes/:sessionProcessId/abort",
9493
- zValidator2("json", z31.object({ projectId: z31.string() })),
9645
+ zValidator2("json", z33.object({ projectId: z33.string() })),
9494
9646
  async (c) => {
9495
9647
  const { sessionProcessId } = c.req.param();
9496
9648
  void Effect54.runFork(
@@ -9502,9 +9654,9 @@ var claudeCodeRoutes = Effect54.gen(function* () {
9502
9654
  "/permission-response",
9503
9655
  zValidator2(
9504
9656
  "json",
9505
- z31.object({
9506
- permissionRequestId: z31.string(),
9507
- decision: z31.enum(["allow", "deny"])
9657
+ z33.object({
9658
+ permissionRequestId: z33.string(),
9659
+ decision: z33.enum(["allow", "deny"])
9508
9660
  })
9509
9661
  ),
9510
9662
  async (c) => {
@@ -9538,16 +9690,16 @@ var featureFlagRoutes = Effect55.gen(function* () {
9538
9690
  import { zValidator as zValidator3 } from "@hono/zod-validator";
9539
9691
  import { Effect as Effect56 } from "effect";
9540
9692
  import { Hono as Hono5 } from "hono";
9541
- import { z as z32 } from "zod";
9693
+ import { z as z34 } from "zod";
9542
9694
  var fileSystemRoutes = Effect56.gen(function* () {
9543
9695
  const fileSystemController = yield* FileSystemController;
9544
9696
  return new Hono5().get(
9545
9697
  "/file-completion",
9546
9698
  zValidator3(
9547
9699
  "query",
9548
- z32.object({
9549
- projectId: z32.string(),
9550
- basePath: z32.string().optional().default("/api/")
9700
+ z34.object({
9701
+ projectId: z34.string(),
9702
+ basePath: z34.string().optional().default("/api/")
9551
9703
  })
9552
9704
  ),
9553
9705
  async (c) => {
@@ -9563,9 +9715,9 @@ var fileSystemRoutes = Effect56.gen(function* () {
9563
9715
  "/directory-browser",
9564
9716
  zValidator3(
9565
9717
  "query",
9566
- z32.object({
9567
- currentPath: z32.string().optional(),
9568
- showHidden: z32.string().optional().transform((val) => val === "true")
9718
+ z34.object({
9719
+ currentPath: z34.string().optional(),
9720
+ showHidden: z34.string().optional().transform((val) => val === "true")
9569
9721
  })
9570
9722
  ),
9571
9723
  async (c) => {
@@ -9584,24 +9736,24 @@ var fileSystemRoutes = Effect56.gen(function* () {
9584
9736
  import { zValidator as zValidator4 } from "@hono/zod-validator";
9585
9737
  import { Effect as Effect57 } from "effect";
9586
9738
  import { Hono as Hono6 } from "hono";
9587
- import { z as z34 } from "zod";
9739
+ import { z as z36 } from "zod";
9588
9740
 
9589
9741
  // src/server/core/git/schema.ts
9590
- import { z as z33 } from "zod";
9591
- var CommitRequestSchema = z33.object({
9592
- files: z33.array(z33.string().min(1)).min(1),
9593
- message: z33.string().trim().min(1)
9742
+ import { z as z35 } from "zod";
9743
+ var CommitRequestSchema = z35.object({
9744
+ files: z35.array(z35.string().min(1)).min(1),
9745
+ message: z35.string().trim().min(1)
9594
9746
  });
9595
- var CommitResultSuccessSchema = z33.object({
9596
- success: z33.literal(true),
9597
- commitSha: z33.string().length(40),
9598
- filesCommitted: z33.number().int().positive(),
9599
- message: z33.string()
9747
+ var CommitResultSuccessSchema = z35.object({
9748
+ success: z35.literal(true),
9749
+ commitSha: z35.string().length(40),
9750
+ filesCommitted: z35.number().int().positive(),
9751
+ message: z35.string()
9600
9752
  });
9601
- var CommitResultErrorSchema = z33.object({
9602
- success: z33.literal(false),
9603
- error: z33.string(),
9604
- errorCode: z33.enum([
9753
+ var CommitResultErrorSchema = z35.object({
9754
+ success: z35.literal(false),
9755
+ error: z35.string(),
9756
+ errorCode: z35.enum([
9605
9757
  "EMPTY_MESSAGE",
9606
9758
  "NO_FILES",
9607
9759
  "PROJECT_NOT_FOUND",
@@ -9609,22 +9761,22 @@ var CommitResultErrorSchema = z33.object({
9609
9761
  "HOOK_FAILED",
9610
9762
  "GIT_COMMAND_ERROR"
9611
9763
  ]),
9612
- details: z33.string().optional()
9764
+ details: z35.string().optional()
9613
9765
  });
9614
- var CommitResultSchema = z33.discriminatedUnion("success", [
9766
+ var CommitResultSchema = z35.discriminatedUnion("success", [
9615
9767
  CommitResultSuccessSchema,
9616
9768
  CommitResultErrorSchema
9617
9769
  ]);
9618
- var PushResultSuccessSchema = z33.object({
9619
- success: z33.literal(true),
9620
- remote: z33.string(),
9621
- branch: z33.string(),
9622
- objectsPushed: z33.number().int().optional()
9770
+ var PushResultSuccessSchema = z35.object({
9771
+ success: z35.literal(true),
9772
+ remote: z35.string(),
9773
+ branch: z35.string(),
9774
+ objectsPushed: z35.number().int().optional()
9623
9775
  });
9624
- var PushResultErrorSchema = z33.object({
9625
- success: z33.literal(false),
9626
- error: z33.string(),
9627
- errorCode: z33.enum([
9776
+ var PushResultErrorSchema = z35.object({
9777
+ success: z35.literal(false),
9778
+ error: z35.string(),
9779
+ errorCode: z35.enum([
9628
9780
  "PROJECT_NOT_FOUND",
9629
9781
  "NOT_A_REPOSITORY",
9630
9782
  "NO_UPSTREAM",
@@ -9634,26 +9786,26 @@ var PushResultErrorSchema = z33.object({
9634
9786
  "TIMEOUT",
9635
9787
  "GIT_COMMAND_ERROR"
9636
9788
  ]),
9637
- details: z33.string().optional()
9789
+ details: z35.string().optional()
9638
9790
  });
9639
- var PushResultSchema = z33.discriminatedUnion("success", [
9791
+ var PushResultSchema = z35.discriminatedUnion("success", [
9640
9792
  PushResultSuccessSchema,
9641
9793
  PushResultErrorSchema
9642
9794
  ]);
9643
- var CommitAndPushResultSuccessSchema = z33.object({
9644
- success: z33.literal(true),
9645
- commitSha: z33.string().length(40),
9646
- filesCommitted: z33.number().int().positive(),
9647
- message: z33.string(),
9648
- remote: z33.string(),
9649
- branch: z33.string()
9795
+ var CommitAndPushResultSuccessSchema = z35.object({
9796
+ success: z35.literal(true),
9797
+ commitSha: z35.string().length(40),
9798
+ filesCommitted: z35.number().int().positive(),
9799
+ message: z35.string(),
9800
+ remote: z35.string(),
9801
+ branch: z35.string()
9650
9802
  });
9651
- var CommitAndPushResultErrorSchema = z33.object({
9652
- success: z33.literal(false),
9653
- commitSucceeded: z33.boolean(),
9654
- commitSha: z33.string().length(40).optional(),
9655
- error: z33.string(),
9656
- errorCode: z33.enum([
9803
+ var CommitAndPushResultErrorSchema = z35.object({
9804
+ success: z35.literal(false),
9805
+ commitSucceeded: z35.boolean(),
9806
+ commitSha: z35.string().length(40).optional(),
9807
+ error: z35.string(),
9808
+ errorCode: z35.enum([
9657
9809
  "EMPTY_MESSAGE",
9658
9810
  "NO_FILES",
9659
9811
  "PROJECT_NOT_FOUND",
@@ -9666,9 +9818,9 @@ var CommitAndPushResultErrorSchema = z33.object({
9666
9818
  "NETWORK_ERROR",
9667
9819
  "TIMEOUT"
9668
9820
  ]),
9669
- details: z33.string().optional()
9821
+ details: z35.string().optional()
9670
9822
  });
9671
- var CommitAndPushResultSchema = z33.discriminatedUnion("success", [
9823
+ var CommitAndPushResultSchema = z35.discriminatedUnion("success", [
9672
9824
  CommitAndPushResultSuccessSchema,
9673
9825
  CommitAndPushResultErrorSchema
9674
9826
  ]);
@@ -9690,7 +9842,7 @@ var projectRoutes = Effect57.gen(function* () {
9690
9842
  return response;
9691
9843
  }).get(
9692
9844
  "/:projectId",
9693
- zValidator4("query", z34.object({ cursor: z34.string().optional() })),
9845
+ zValidator4("query", z36.object({ cursor: z36.string().optional() })),
9694
9846
  async (c) => {
9695
9847
  const response = await effectToResponse(
9696
9848
  c,
@@ -9705,8 +9857,8 @@ var projectRoutes = Effect57.gen(function* () {
9705
9857
  "/",
9706
9858
  zValidator4(
9707
9859
  "json",
9708
- z34.object({
9709
- projectPath: z34.string().min(1, "Project path is required")
9860
+ z36.object({
9861
+ projectPath: z36.string().min(1, "Project path is required")
9710
9862
  })
9711
9863
  ),
9712
9864
  async (c) => {
@@ -9750,15 +9902,35 @@ var projectRoutes = Effect57.gen(function* () {
9750
9902
  sessionController.deleteSession({ projectId, sessionId }).pipe(Effect57.provide(runtime))
9751
9903
  );
9752
9904
  return response;
9753
- }).get("/:projectId/agent-sessions/:agentId", async (c) => {
9905
+ }).get("/:projectId/sessions/:sessionId/agent-sessions", async (c) => {
9754
9906
  const projectId = c.req.param("projectId");
9755
- const agentId = c.req.param("agentId");
9907
+ const sessionId = c.req.param("sessionId");
9756
9908
  const response = await effectToResponse(
9757
9909
  c,
9758
- agentSessionController.getAgentSession({ projectId, agentId })
9910
+ agentSessionController.listAgentSessions({
9911
+ projectId,
9912
+ sessionId
9913
+ })
9759
9914
  );
9760
9915
  return response;
9761
- }).get("/:projectId/claude-commands", async (c) => {
9916
+ }).get(
9917
+ "/:projectId/agent-sessions/:agentId",
9918
+ zValidator4("query", z36.object({ sessionId: z36.string().optional() })),
9919
+ async (c) => {
9920
+ const projectId = c.req.param("projectId");
9921
+ const agentId = c.req.param("agentId");
9922
+ const { sessionId } = c.req.valid("query");
9923
+ const response = await effectToResponse(
9924
+ c,
9925
+ agentSessionController.getAgentSession({
9926
+ projectId,
9927
+ agentId,
9928
+ sessionId
9929
+ })
9930
+ );
9931
+ return response;
9932
+ }
9933
+ ).get("/:projectId/claude-commands", async (c) => {
9762
9934
  const response = await effectToResponse(
9763
9935
  c,
9764
9936
  claudeCodeController.getClaudeCommands({
@@ -9778,8 +9950,8 @@ var projectRoutes = Effect57.gen(function* () {
9778
9950
  "/:projectId/files",
9779
9951
  zValidator4(
9780
9952
  "query",
9781
- z34.object({
9782
- filePath: z34.string().min(1, "filePath is required")
9953
+ z36.object({
9954
+ filePath: z36.string().min(1, "filePath is required")
9783
9955
  })
9784
9956
  ),
9785
9957
  async (c) => {
@@ -9807,9 +9979,9 @@ var projectRoutes = Effect57.gen(function* () {
9807
9979
  "/:projectId/git/diff",
9808
9980
  zValidator4(
9809
9981
  "json",
9810
- z34.object({
9811
- fromRef: z34.string().min(1, "fromRef is required"),
9812
- toRef: z34.string().min(1, "toRef is required")
9982
+ z36.object({
9983
+ fromRef: z36.string().min(1, "fromRef is required"),
9984
+ toRef: z36.string().min(1, "toRef is required")
9813
9985
  })
9814
9986
  ),
9815
9987
  async (c) => {
@@ -9873,8 +10045,8 @@ var projectRoutes = Effect57.gen(function* () {
9873
10045
  "/:projectId/git/checkout",
9874
10046
  zValidator4(
9875
10047
  "json",
9876
- z34.object({
9877
- branchName: z34.string().min(1, "branchName is required")
10048
+ z36.object({
10049
+ branchName: z36.string().min(1, "branchName is required")
9878
10050
  })
9879
10051
  ),
9880
10052
  async (c) => {
@@ -9940,7 +10112,7 @@ var schedulerRoutes = Effect58.gen(function* () {
9940
10112
  import { zValidator as zValidator6 } from "@hono/zod-validator";
9941
10113
  import { Effect as Effect59 } from "effect";
9942
10114
  import { Hono as Hono8 } from "hono";
9943
- import { z as z35 } from "zod";
10115
+ import { z as z37 } from "zod";
9944
10116
  var searchRoutes = Effect59.gen(function* () {
9945
10117
  const searchController = yield* SearchController;
9946
10118
  const runtime = yield* getHonoRuntime;
@@ -9948,10 +10120,10 @@ var searchRoutes = Effect59.gen(function* () {
9948
10120
  "/",
9949
10121
  zValidator6(
9950
10122
  "query",
9951
- z35.object({
9952
- q: z35.string().min(2),
9953
- limit: z35.string().optional().transform((val) => val ? parseInt(val, 10) : void 0),
9954
- projectId: z35.string().optional()
10123
+ z37.object({
10124
+ q: z37.string().min(2),
10125
+ limit: z37.string().optional().transform((val) => val ? parseInt(val, 10) : void 0),
10126
+ projectId: z37.string().optional()
9955
10127
  })
9956
10128
  ),
9957
10129
  async (c) => {
@@ -9972,7 +10144,7 @@ import { streamSSE } from "hono/streaming";
9972
10144
  var sseRoutes = Effect60.gen(function* () {
9973
10145
  const sseController = yield* SSEController;
9974
10146
  const runtime = yield* getHonoRuntime;
9975
- return new Hono9().get("/sse", async (c) => {
10147
+ return new Hono9().get("/", async (c) => {
9976
10148
  return streamSSE(
9977
10149
  c,
9978
10150
  async (rawStream) => {
@@ -9991,7 +10163,7 @@ var sseRoutes = Effect60.gen(function* () {
9991
10163
  import { zValidator as zValidator7 } from "@hono/zod-validator";
9992
10164
  import { Effect as Effect61 } from "effect";
9993
10165
  import { Hono as Hono10 } from "hono";
9994
- import { z as z36 } from "zod";
10166
+ import { z as z38 } from "zod";
9995
10167
  var tasksRoutes = Effect61.gen(function* () {
9996
10168
  const tasksController = yield* TasksController;
9997
10169
  const runtime = yield* getHonoRuntime;
@@ -9999,9 +10171,9 @@ var tasksRoutes = Effect61.gen(function* () {
9999
10171
  "/",
10000
10172
  zValidator7(
10001
10173
  "query",
10002
- z36.object({
10003
- projectId: z36.string(),
10004
- sessionId: z36.string().optional()
10174
+ z38.object({
10175
+ projectId: z38.string(),
10176
+ sessionId: z38.string().optional()
10005
10177
  })
10006
10178
  ),
10007
10179
  async (c) => {
@@ -10024,9 +10196,9 @@ var tasksRoutes = Effect61.gen(function* () {
10024
10196
  "/",
10025
10197
  zValidator7(
10026
10198
  "query",
10027
- z36.object({
10028
- projectId: z36.string(),
10029
- sessionId: z36.string().optional()
10199
+ z38.object({
10200
+ projectId: z38.string(),
10201
+ sessionId: z38.string().optional()
10030
10202
  })
10031
10203
  ),
10032
10204
  zValidator7("json", TaskCreateSchema),
@@ -10051,9 +10223,9 @@ var tasksRoutes = Effect61.gen(function* () {
10051
10223
  "/:taskId",
10052
10224
  zValidator7(
10053
10225
  "query",
10054
- z36.object({
10055
- projectId: z36.string(),
10056
- sessionId: z36.string().optional()
10226
+ z38.object({
10227
+ projectId: z38.string(),
10228
+ sessionId: z38.string().optional()
10057
10229
  })
10058
10230
  ),
10059
10231
  zValidator7("json", TaskUpdateSchema.omit({ taskId: true })),
@@ -10079,6 +10251,26 @@ var tasksRoutes = Effect61.gen(function* () {
10079
10251
  });
10080
10252
 
10081
10253
  // src/server/hono/routes/index.ts
10254
+ var API_ONLY_ALLOWED_PREFIXES = [
10255
+ "/api/version",
10256
+ "/api/config",
10257
+ "/api/projects",
10258
+ "/api/claude-code",
10259
+ "/api/search",
10260
+ "/api/sse"
10261
+ ];
10262
+ var createApiOnlyMiddleware = (apiOnly) => createMiddleware3(async (c, next) => {
10263
+ if (apiOnly) {
10264
+ const path = c.req.path;
10265
+ const allowed = API_ONLY_ALLOWED_PREFIXES.some(
10266
+ (prefix) => path === prefix || path.startsWith(`${prefix}/`)
10267
+ );
10268
+ if (!allowed) {
10269
+ return c.json({ error: "Not Found" }, 404);
10270
+ }
10271
+ }
10272
+ return next();
10273
+ });
10082
10274
  var routes = (app, options) => Effect62.gen(function* () {
10083
10275
  const ccvOptionsService = yield* CcvOptionsService;
10084
10276
  yield* ccvOptionsService.loadCliOptions(options);
@@ -10086,6 +10278,8 @@ var routes = (app, options) => Effect62.gen(function* () {
10086
10278
  const userConfigService = yield* UserConfigService;
10087
10279
  const initializeService = yield* InitializeService;
10088
10280
  const { authRequiredMiddleware } = yield* AuthMiddleware;
10281
+ const apiOnly = (yield* ccvOptionsService.getCcvOptions("apiOnly")) === true;
10282
+ const apiOnlyMiddleware = createApiOnlyMiddleware(apiOnly);
10089
10283
  const runtime = yield* getHonoRuntime;
10090
10284
  if ((yield* envService.getEnv("NEXT_PHASE")) !== "phase-production-build") {
10091
10285
  yield* initializeService.startInitialization();
@@ -10093,7 +10287,7 @@ var routes = (app, options) => Effect62.gen(function* () {
10093
10287
  await Runtime5.runPromise(runtime)(initializeService.stopCleanup());
10094
10288
  });
10095
10289
  }
10096
- return app.use(configMiddleware).use(async (c, next) => {
10290
+ return app.use(configMiddleware).use(apiOnlyMiddleware).use(async (c, next) => {
10097
10291
  await Runtime5.runPromise(
10098
10292
  runtime,
10099
10293
  userConfigService.setUserConfig({
@@ -10267,7 +10461,8 @@ var setupTerminalWebSocket = (server) => Effect63.gen(function* () {
10267
10461
  // src/server/startServer.ts
10268
10462
  var startServer = async (options) => {
10269
10463
  const isDevelopment = isDevelopmentEnv(process.env.CCV_ENV);
10270
- if (!isDevelopment) {
10464
+ const apiOnly = options.apiOnly === true;
10465
+ if (!isDevelopment && !apiOnly) {
10271
10466
  const staticPath = resolve7(import.meta.dirname, "static");
10272
10467
  console.log("Serving static files from ", staticPath);
10273
10468
  honoApp.use(
@@ -10289,7 +10484,9 @@ var startServer = async (options) => {
10289
10484
  });
10290
10485
  const program2 = Effect64.gen(function* () {
10291
10486
  yield* routes(honoApp, options);
10292
- yield* setupTerminalWebSocket(server);
10487
+ if (!apiOnly) {
10488
+ yield* setupTerminalWebSocket(server);
10489
+ }
10293
10490
  }).pipe(Effect64.provide(MainLayer), Effect64.scoped);
10294
10491
  await Effect64.runPromise(program2);
10295
10492
  const port = isDevelopment ? (
@@ -10303,7 +10500,8 @@ var startServer = async (options) => {
10303
10500
  server.listen(parseInt(port, 10), hostname, () => {
10304
10501
  const info = server.address();
10305
10502
  const serverPort = typeof info === "object" && info !== null ? info.port : port;
10306
- console.log(`Server is running on http://${hostname}:${serverPort}`);
10503
+ const mode = apiOnly ? " (API-only mode)" : "";
10504
+ console.log(`Server is running on http://${hostname}:${serverPort}${mode}`);
10307
10505
  });
10308
10506
  };
10309
10507
  var PlatformLayer = Layer44.mergeAll(platformLayer, NodeContext2.layer);
@@ -10370,7 +10568,7 @@ program.option("-p, --port <port>", "port to listen on").option("-h, --hostname
10370
10568
  ).option("--terminal-shell <path>", "shell executable for terminal sessions").option(
10371
10569
  "--terminal-unrestricted",
10372
10570
  "disable restricted shell flags for bash sessions"
10373
- ).action(async (options) => {
10571
+ ).option("--api-only", "run in API-only mode without Web UI").action(async (options) => {
10374
10572
  await Effect65.runPromise(checkDeprecatedEnvs);
10375
10573
  await startServer(options);
10376
10574
  });