byterover-cli 3.10.3 → 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.
- package/README.md +4 -2
- package/dist/agent/core/domain/llm/registry.d.ts +12 -0
- package/dist/agent/core/domain/llm/registry.js +49 -0
- package/dist/agent/core/domain/llm/types.d.ts +6 -0
- package/dist/agent/core/interfaces/i-content-generator.d.ts +8 -0
- package/dist/agent/infra/llm/agent-llm-service.js +18 -6
- package/dist/agent/infra/llm/context/context-manager.d.ts +4 -1
- package/dist/agent/infra/llm/context/context-manager.js +5 -1
- package/dist/agent/infra/llm/generators/ai-sdk-content-generator.d.ts +13 -0
- package/dist/agent/infra/llm/generators/ai-sdk-content-generator.js +19 -6
- package/dist/agent/infra/llm/generators/ai-sdk-message-converter.js +16 -4
- package/dist/agent/infra/llm/generators/byterover-content-generator.d.ts +1 -0
- package/dist/agent/infra/llm/generators/byterover-content-generator.js +4 -1
- package/dist/agent/infra/llm/model-capabilities.d.ts +2 -1
- package/dist/agent/infra/llm/model-capabilities.js +6 -4
- package/dist/agent/infra/llm/providers/anthropic.js +2 -0
- package/dist/agent/infra/llm/providers/deepseek.d.ts +10 -0
- package/dist/agent/infra/llm/providers/deepseek.js +33 -0
- package/dist/agent/infra/llm/providers/glm-coding-plan.d.ts +9 -0
- package/dist/agent/infra/llm/providers/glm-coding-plan.js +32 -0
- package/dist/agent/infra/llm/providers/index.js +4 -0
- package/dist/agent/infra/llm/providers/openrouter.js +2 -0
- package/dist/agent/infra/tools/implementations/curate-tool.js +18 -8
- package/dist/oclif/commands/query.js +7 -1
- package/dist/oclif/lib/task-client.d.ts +9 -0
- package/dist/oclif/lib/task-client.js +11 -1
- package/dist/server/constants.d.ts +6 -0
- package/dist/server/constants.js +11 -0
- package/dist/server/core/domain/entities/provider-registry.js +26 -0
- package/dist/server/core/domain/entities/task-history-entry.d.ts +775 -0
- package/dist/server/core/domain/entities/task-history-entry.js +88 -0
- package/dist/server/core/domain/transport/schemas.d.ts +1403 -11
- package/dist/server/core/domain/transport/schemas.js +157 -6
- package/dist/server/core/domain/transport/task-info.d.ts +18 -0
- package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +7 -0
- package/dist/server/core/interfaces/storage/i-task-history-store.d.ts +62 -0
- package/dist/server/core/interfaces/storage/i-task-history-store.js +1 -0
- package/dist/server/infra/daemon/brv-server.js +43 -18
- package/dist/server/infra/dream/dream-response-schemas.d.ts +24 -0
- package/dist/server/infra/dream/dream-response-schemas.js +7 -0
- package/dist/server/infra/dream/operations/consolidate.js +21 -8
- package/dist/server/infra/dream/operations/synthesize.js +35 -8
- package/dist/server/infra/http/provider-model-fetcher-registry.js +5 -0
- package/dist/server/infra/http/provider-model-fetchers.js +54 -27
- package/dist/server/infra/process/query-log-handler.d.ts +6 -0
- package/dist/server/infra/process/query-log-handler.js +23 -0
- package/dist/server/infra/process/task-history-entry-builder.d.ts +36 -0
- package/dist/server/infra/process/task-history-entry-builder.js +101 -0
- package/dist/server/infra/process/task-history-hook.d.ts +37 -0
- package/dist/server/infra/process/task-history-hook.js +70 -0
- package/dist/server/infra/process/task-history-store-cache.d.ts +25 -0
- package/dist/server/infra/process/task-history-store-cache.js +106 -0
- package/dist/server/infra/process/task-router.d.ts +72 -0
- package/dist/server/infra/process/task-router.js +690 -15
- package/dist/server/infra/process/transport-handlers.d.ts +8 -0
- package/dist/server/infra/process/transport-handlers.js +2 -0
- package/dist/server/infra/storage/file-task-history-store.d.ts +294 -0
- package/dist/server/infra/storage/file-task-history-store.js +912 -0
- package/dist/shared/transport/events/index.d.ts +5 -0
- package/dist/shared/transport/events/task-events.d.ts +204 -1
- package/dist/shared/transport/events/task-events.js +11 -0
- package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +7 -0
- package/dist/tui/features/tasks/stores/tasks-store.d.ts +4 -16
- package/dist/tui/features/tasks/stores/tasks-store.js +7 -0
- package/dist/tui/types/messages.d.ts +2 -9
- package/dist/webui/assets/index-DyVvFoM6.css +1 -0
- package/dist/webui/assets/index-lr0byHh9.js +130 -0
- package/dist/webui/index.html +2 -2
- package/dist/webui/sw.js +1 -1
- package/dist/webui/workbox-9c191d2f.js +1 -0
- package/oclif.manifest.json +985 -985
- package/package.json +1 -1
- package/dist/webui/assets/index-CvcqpMYn.css +0 -1
- package/dist/webui/assets/index-thSZZahh.js +0 -130
- package/dist/webui/workbox-8c29f6e4.js +0 -1
|
@@ -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
|
+
]);
|