byterover-cli 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/agent/infra/tools/implementations/curate-tool.js +18 -8
  2. package/dist/server/constants.d.ts +6 -0
  3. package/dist/server/constants.js +11 -0
  4. package/dist/server/core/domain/entities/task-history-entry.d.ts +775 -0
  5. package/dist/server/core/domain/entities/task-history-entry.js +88 -0
  6. package/dist/server/core/domain/transport/schemas.d.ts +1403 -11
  7. package/dist/server/core/domain/transport/schemas.js +157 -6
  8. package/dist/server/core/domain/transport/task-info.d.ts +18 -0
  9. package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +7 -0
  10. package/dist/server/core/interfaces/storage/i-task-history-store.d.ts +62 -0
  11. package/dist/server/core/interfaces/storage/i-task-history-store.js +1 -0
  12. package/dist/server/infra/daemon/brv-server.js +43 -18
  13. package/dist/server/infra/dream/dream-response-schemas.d.ts +24 -0
  14. package/dist/server/infra/dream/dream-response-schemas.js +7 -0
  15. package/dist/server/infra/dream/operations/consolidate.js +21 -8
  16. package/dist/server/infra/dream/operations/synthesize.js +35 -8
  17. package/dist/server/infra/process/task-history-entry-builder.d.ts +36 -0
  18. package/dist/server/infra/process/task-history-entry-builder.js +101 -0
  19. package/dist/server/infra/process/task-history-hook.d.ts +37 -0
  20. package/dist/server/infra/process/task-history-hook.js +70 -0
  21. package/dist/server/infra/process/task-history-store-cache.d.ts +25 -0
  22. package/dist/server/infra/process/task-history-store-cache.js +106 -0
  23. package/dist/server/infra/process/task-router.d.ts +72 -0
  24. package/dist/server/infra/process/task-router.js +690 -15
  25. package/dist/server/infra/process/transport-handlers.d.ts +8 -0
  26. package/dist/server/infra/process/transport-handlers.js +2 -0
  27. package/dist/server/infra/storage/file-task-history-store.d.ts +294 -0
  28. package/dist/server/infra/storage/file-task-history-store.js +912 -0
  29. package/dist/shared/transport/events/index.d.ts +5 -0
  30. package/dist/shared/transport/events/task-events.d.ts +204 -1
  31. package/dist/shared/transport/events/task-events.js +11 -0
  32. package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +7 -0
  33. package/dist/tui/features/tasks/stores/tasks-store.d.ts +4 -16
  34. package/dist/tui/features/tasks/stores/tasks-store.js +7 -0
  35. package/dist/tui/types/messages.d.ts +2 -9
  36. package/dist/webui/assets/index-DyVvFoM6.css +1 -0
  37. package/dist/webui/assets/index-lr0byHh9.js +130 -0
  38. package/dist/webui/index.html +2 -2
  39. package/dist/webui/sw.js +1 -1
  40. package/oclif.manifest.json +665 -665
  41. package/package.json +1 -1
  42. package/dist/webui/assets/index--sXE__bc.css +0 -1
  43. package/dist/webui/assets/index-Bkkx961b.js +0 -130
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Task History Entry — Level 2 schema (full per-task detail).
3
+ *
4
+ * Persisted shape used by `FileTaskHistoryStore` (M2.02+) to keep a
5
+ * per-project journal of every task. Includes provider/model snapshot
6
+ * (M1) plus accumulated llmservice details — response, reasoning,
7
+ * tool calls — so the Web UI can re-render a complete task detail
8
+ * after daemon restart.
9
+ *
10
+ * Discriminated union on `status`:
11
+ * - `created`: just queued, agent has not picked up yet.
12
+ * - `started`: agent acknowledged, `startedAt` set.
13
+ * - `completed` | `error` | `cancelled`: terminal — `completedAt` set.
14
+ *
15
+ * The TS shape lives in `shared/transport/events/task-events.ts` so the
16
+ * web UI can consume it without webui→server boundary inversion. The
17
+ * Zod schema below is the runtime source of truth and carries
18
+ * `satisfies z.ZodType<TaskHistoryEntry>` so any drift between the
19
+ * type and the schema is a typecheck error.
20
+ */
21
+ import { z } from 'zod';
22
+ import { TASK_HISTORY_SCHEMA_VERSION } from '../../../../shared/transport/events/task-events.js';
23
+ export { TASK_HISTORY_SCHEMA_VERSION } from '../../../../shared/transport/events/task-events.js';
24
+ // Inlined to break a transport/schemas.ts <-> entities/ circular import.
25
+ // Mirrors `TaskErrorDataSchema` in transport/schemas.ts; both must stay in sync.
26
+ const TaskErrorDataSchema = z.object({
27
+ code: z.string().optional(),
28
+ details: z.record(z.unknown()).optional(),
29
+ message: z.string(),
30
+ name: z.string(),
31
+ });
32
+ export const ToolCallEventSchema = z.object({
33
+ args: z.record(z.unknown()),
34
+ callId: z.string().optional(),
35
+ error: z.string().optional(),
36
+ errorType: z.string().optional(),
37
+ result: z.unknown().optional(),
38
+ sessionId: z.string(),
39
+ status: z.enum(['completed', 'error', 'running']),
40
+ timestamp: z.number(),
41
+ toolName: z.string(),
42
+ });
43
+ export const ReasoningContentItemSchema = z.object({
44
+ content: z.string(),
45
+ isThinking: z.boolean().optional(),
46
+ timestamp: z.number(),
47
+ });
48
+ const TaskHistoryEntryBaseSchema = z.object({
49
+ clientCwd: z.string().optional(),
50
+ content: z.string(),
51
+ createdAt: z.number(),
52
+ files: z.array(z.string()).optional(),
53
+ folderPath: z.string().optional(),
54
+ id: z.string(),
55
+ logId: z.string().optional(),
56
+ model: z.string().optional(),
57
+ projectPath: z.string(),
58
+ provider: z.string().optional(),
59
+ reasoningContents: z.array(ReasoningContentItemSchema).optional(),
60
+ responseContent: z.string().optional(),
61
+ schemaVersion: z.literal(TASK_HISTORY_SCHEMA_VERSION),
62
+ sessionId: z.string().optional(),
63
+ taskId: z.string(),
64
+ toolCalls: z.array(ToolCallEventSchema).optional(),
65
+ type: z.string(),
66
+ worktreeRoot: z.string().optional(),
67
+ });
68
+ export const TaskHistoryEntrySchema = z.discriminatedUnion('status', [
69
+ TaskHistoryEntryBaseSchema.extend({ status: z.literal('created') }),
70
+ TaskHistoryEntryBaseSchema.extend({ startedAt: z.number(), status: z.literal('started') }),
71
+ TaskHistoryEntryBaseSchema.extend({
72
+ completedAt: z.number(),
73
+ result: z.string().optional(),
74
+ startedAt: z.number().optional(),
75
+ status: z.literal('completed'),
76
+ }),
77
+ TaskHistoryEntryBaseSchema.extend({
78
+ completedAt: z.number(),
79
+ error: TaskErrorDataSchema,
80
+ startedAt: z.number().optional(),
81
+ status: z.literal('error'),
82
+ }),
83
+ TaskHistoryEntryBaseSchema.extend({
84
+ completedAt: z.number(),
85
+ startedAt: z.number().optional(),
86
+ status: z.literal('cancelled'),
87
+ }),
88
+ ]);