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
|
@@ -19,6 +19,7 @@ import type { IAgentPool } from '../../core/interfaces/agent/i-agent-pool.js';
|
|
|
19
19
|
import type { ITaskLifecycleHook } from '../../core/interfaces/process/i-task-lifecycle-hook.js';
|
|
20
20
|
import type { IProjectRegistry } from '../../core/interfaces/project/i-project-registry.js';
|
|
21
21
|
import type { IProjectRouter } from '../../core/interfaces/routing/i-project-router.js';
|
|
22
|
+
import type { ITaskHistoryStore } from '../../core/interfaces/storage/i-task-history-store.js';
|
|
22
23
|
import type { ITransportServer } from '../../core/interfaces/transport/i-transport-server.js';
|
|
23
24
|
import type { TaskInfo } from './types.js';
|
|
24
25
|
/**
|
|
@@ -47,6 +48,13 @@ type TaskRouterOptions = {
|
|
|
47
48
|
agentPool?: IAgentPool;
|
|
48
49
|
/** Function to resolve agent clientId for a given project */
|
|
49
50
|
getAgentForProject: (projectPath?: string) => string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Per-project `ITaskHistoryStore` factory (DIP). When omitted, the new
|
|
53
|
+
* persistent-history handlers (`task:list` paginated, `task:get`,
|
|
54
|
+
* `task:delete*`, `task:clearCompleted`) gracefully degrade to in-memory
|
|
55
|
+
* only — keeping pre-M2.09 unit tests unaffected.
|
|
56
|
+
*/
|
|
57
|
+
getTaskHistoryStore?: (projectPath: string) => ITaskHistoryStore;
|
|
50
58
|
/** Resolves project's review-disabled flag at task-create. Optional; missing → undefined → enabled. */
|
|
51
59
|
isReviewDisabled?: IsReviewDisabledResolver;
|
|
52
60
|
/** Lifecycle hooks for task events (e.g. CurateLogHandler). */
|
|
@@ -61,23 +69,43 @@ type TaskRouterOptions = {
|
|
|
61
69
|
preDispatchCheck?: PreDispatchCheck;
|
|
62
70
|
projectRegistry?: IProjectRegistry;
|
|
63
71
|
projectRouter?: IProjectRouter;
|
|
72
|
+
/**
|
|
73
|
+
* Resolves the active provider/model snapshot at task-create time.
|
|
74
|
+
* Failures are swallowed (fail-open) so dispatch is never blocked.
|
|
75
|
+
*/
|
|
76
|
+
resolveActiveProvider?: () => Promise<{
|
|
77
|
+
model?: string;
|
|
78
|
+
provider?: string;
|
|
79
|
+
}>;
|
|
64
80
|
/** Resolves the projectPath a client registered with (from client:register). */
|
|
65
81
|
resolveClientProjectPath?: (clientId: string) => string | undefined;
|
|
66
82
|
transport: ITransportServer;
|
|
67
83
|
};
|
|
68
84
|
export declare class TaskRouter {
|
|
85
|
+
/**
|
|
86
|
+
* Throttle window for `onTaskUpdate` flushes — bursts of llmservice events
|
|
87
|
+
* are coalesced into one save per window. 100ms keeps perceived latency low
|
|
88
|
+
* while bounding write volume on chatty multi-step agents.
|
|
89
|
+
*/
|
|
90
|
+
private static readonly FLUSH_INTERVAL_MS;
|
|
69
91
|
private readonly agentPool;
|
|
70
92
|
/**
|
|
71
93
|
* Track recently completed tasks for grace period.
|
|
72
94
|
* Allows late-arriving llmservice:* events to be routed even after task:completed.
|
|
73
95
|
*/
|
|
74
96
|
private completedTasks;
|
|
97
|
+
/** TaskIds with pending in-flight mutations awaiting the next throttled flush. */
|
|
98
|
+
private readonly dirtyTaskIds;
|
|
99
|
+
/** Pending throttle timer, if any. */
|
|
100
|
+
private flushTimer;
|
|
75
101
|
private readonly getAgentForProject;
|
|
102
|
+
private readonly getTaskHistoryStore;
|
|
76
103
|
private readonly isReviewDisabled;
|
|
77
104
|
private readonly lifecycleHooks;
|
|
78
105
|
private readonly preDispatchCheck;
|
|
79
106
|
private readonly projectRegistry;
|
|
80
107
|
private readonly projectRouter;
|
|
108
|
+
private readonly resolveActiveProvider;
|
|
81
109
|
private readonly resolveClientProjectPath;
|
|
82
110
|
/** Track active tasks */
|
|
83
111
|
private tasks;
|
|
@@ -117,8 +145,37 @@ export declare class TaskRouter {
|
|
|
117
145
|
* Register all task and LLM event handlers on the transport.
|
|
118
146
|
*/
|
|
119
147
|
setup(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Mutate the live `TaskInfo` from an `llmservice:*` event so a tab refresh
|
|
150
|
+
* during the throttle window sees the in-flight state. Each branch:
|
|
151
|
+
* - thinking: push a `{isThinking: true, content: ''}` marker
|
|
152
|
+
* - chunk(reasoning): append to last item / flip empty marker / push fresh
|
|
153
|
+
* - chunk(text): IGNORED for persistence (transient stream)
|
|
154
|
+
* - response: set responseContent + sessionId (overwrite — multi-step keeps latest)
|
|
155
|
+
* - toolCall: push running entry
|
|
156
|
+
* - toolResult: update existing entry by callId
|
|
157
|
+
* - error / unsupportedInput: IGNORED (terminal hooks capture failure)
|
|
158
|
+
*
|
|
159
|
+
* Mutations use immutable `tasks.set(id, {...task, ...delta})` so consumers
|
|
160
|
+
* holding a captured reference (e.g. notifyHooks*) see a stable snapshot.
|
|
161
|
+
*/
|
|
162
|
+
private accumulateLlmEvent;
|
|
163
|
+
/**
|
|
164
|
+
* Emit `task:deleted` to the project room when a task is removed. Skips
|
|
165
|
+
* silently when no projectPath is resolvable (broadcast wouldn't reach
|
|
166
|
+
* any room). Clients that miss the broadcast will simply not see a row
|
|
167
|
+
* disappear; they reconcile on next `task:list`.
|
|
168
|
+
*/
|
|
169
|
+
private broadcastTaskDeleted;
|
|
170
|
+
/**
|
|
171
|
+
* Drain the dirty set: for each taskId still active, fire `onTaskUpdate` on
|
|
172
|
+
* each lifecycle hook. Tasks moved to `completedTasks` between markDirty
|
|
173
|
+
* and flush are skipped — their terminal lifecycle hook already saved.
|
|
174
|
+
*/
|
|
175
|
+
private flushDirty;
|
|
120
176
|
private handleTaskCancel;
|
|
121
177
|
private handleTaskCancelled;
|
|
178
|
+
private handleTaskClearCompleted;
|
|
122
179
|
private handleTaskCompleted;
|
|
123
180
|
/**
|
|
124
181
|
* Handle task creation from a client.
|
|
@@ -134,7 +191,10 @@ export declare class TaskRouter {
|
|
|
134
191
|
* 6. Submit to agentPool (fire-and-forget)
|
|
135
192
|
*/
|
|
136
193
|
private handleTaskCreate;
|
|
194
|
+
private handleTaskDelete;
|
|
195
|
+
private handleTaskDeleteBulk;
|
|
137
196
|
private handleTaskError;
|
|
197
|
+
private handleTaskGet;
|
|
138
198
|
private handleTaskList;
|
|
139
199
|
/**
|
|
140
200
|
* Emit `task:completed` for a task that the daemon's pre-dispatch gate skipped
|
|
@@ -153,6 +213,12 @@ export declare class TaskRouter {
|
|
|
153
213
|
*/
|
|
154
214
|
private handleTaskSkippedByPreCheck;
|
|
155
215
|
private handleTaskStarted;
|
|
216
|
+
/**
|
|
217
|
+
* Mark a taskId for the next throttled `onTaskUpdate` flush.
|
|
218
|
+
* Schedules a timer if none is pending. Bursts of dirty marks within the
|
|
219
|
+
* 100ms window coalesce into a single flush.
|
|
220
|
+
*/
|
|
221
|
+
private markDirty;
|
|
156
222
|
/**
|
|
157
223
|
* Move a task to the completed tasks map with grace period cleanup.
|
|
158
224
|
*/
|
|
@@ -188,6 +254,12 @@ export declare class TaskRouter {
|
|
|
188
254
|
* Each hook is called independently; errors are caught and logged.
|
|
189
255
|
*/
|
|
190
256
|
private runCreateHooks;
|
|
257
|
+
/**
|
|
258
|
+
* Invoke `resolveActiveProvider` with a try/catch so a thrown resolver
|
|
259
|
+
* cannot block task dispatch. Returns `{}` when no resolver is configured
|
|
260
|
+
* or when the resolver rejects/throws.
|
|
261
|
+
*/
|
|
262
|
+
private safeResolveActiveProvider;
|
|
191
263
|
/**
|
|
192
264
|
* Reads the project's reviewDisabled flag at task-create.
|
|
193
265
|
*
|