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
@@ -6,6 +6,7 @@ import { MarkdownWriter, parseCreatedAt } from '../../../../server/core/domain/k
6
6
  import { determineTier, mergeScoring, recordCurateUpdate, } from '../../../../server/core/domain/knowledge/memory-scoring.js';
7
7
  import { createDefaultRuntimeSignals, } from '../../../../server/core/domain/knowledge/runtime-signals-schema.js';
8
8
  import { warnSidecarFailure } from '../../../../server/core/domain/knowledge/sidecar-logging.js';
9
+ import { isExcludedFromSync } from '../../../../server/infra/context-tree/derived-artifact.js';
9
10
  import { toSnakeCase } from '../../../../server/utils/file-helpers.js';
10
11
  import { deriveImpactFromLoss, detectStructuralLoss } from '../../../core/domain/knowledge/conflict-detector.js';
11
12
  import { resolveStructuralLoss } from '../../../core/domain/knowledge/conflict-resolver.js';
@@ -268,14 +269,19 @@ const OperationSchema = z.object({
268
269
  type: OperationType.describe('Operation type: ADD, UPDATE, MERGE, or DELETE'),
269
270
  });
270
271
  /**
271
- * Filter out non-existent files from rawConcept.files.
272
- * Returns a new content object with only valid file paths.
272
+ * Filter out non-existent files from rawConcept.files and derived-artifact
273
+ * paths from relations.
273
274
  */
274
275
  async function filterValidFiles(content) {
275
- if (!content.rawConcept?.files || content.rawConcept.files.length === 0) {
276
- return content;
276
+ // Drop relations that won't be pushed — they'd be dangling refs on remote.
277
+ const cleanedRelations = content.relations?.filter((r) => !isExcludedFromSync(r));
278
+ const withCleanRelations = cleanedRelations === content.relations
279
+ ? content
280
+ : { ...content, relations: cleanedRelations };
281
+ if (!withCleanRelations.rawConcept?.files || withCleanRelations.rawConcept.files.length === 0) {
282
+ return withCleanRelations;
277
283
  }
278
- const checks = await Promise.all(content.rawConcept.files.map(async (filePath) => {
284
+ const checks = await Promise.all(withCleanRelations.rawConcept.files.map(async (filePath) => {
279
285
  // Skip filesystem validation for URLs and document references
280
286
  if (filePath.includes('://'))
281
287
  return true;
@@ -284,12 +290,12 @@ async function filterValidFiles(content) {
284
290
  return true;
285
291
  return DirectoryManager.fileExists(filePath);
286
292
  }));
287
- const validFiles = content.rawConcept.files.filter((_, i) => checks[i]);
293
+ const validFiles = withCleanRelations.rawConcept.files.filter((_, i) => checks[i]);
288
294
  // Return content with filtered files (empty array if none exist)
289
295
  return {
290
- ...content,
296
+ ...withCleanRelations,
291
297
  rawConcept: {
292
- ...content.rawConcept,
298
+ ...withCleanRelations.rawConcept,
293
299
  files: validFiles.length > 0 ? validFiles : undefined,
294
300
  },
295
301
  };
@@ -730,6 +736,10 @@ async function executeUpdate(basePath, operation, reviewDisabled, onAfterWrite,
730
736
  const filteredContent = await filterValidFiles(content);
731
737
  // Extract previous summary from existing file's frontmatter (for review UI)
732
738
  const existingParsed = existingContent ? MarkdownWriter.parseContent(existingContent, title) : null;
739
+ if (existingParsed?.relations?.length) {
740
+ // Drop legacy dangling refs before conflict-detection; otherwise resolver unions them back.
741
+ existingParsed.relations = existingParsed.relations.filter((r) => !isExcludedFromSync(r));
742
+ }
733
743
  const previousSummary = existingParsed?.summary;
734
744
  // Detect structural loss and auto-resolve: merge back anything the LLM dropped
735
745
  const proposedContextData = {
@@ -63,6 +63,12 @@ export declare const QUERY_LOG_DIR = "query-log";
63
63
  export declare const QUERY_LOG_ID_PREFIX = "qry";
64
64
  export declare const DREAM_LOG_DIR = "dream-log";
65
65
  export declare const DREAM_LOG_ID_PREFIX = "drm";
66
+ export declare const TASK_HISTORY_DIR = "task-history";
67
+ export declare const TASK_HISTORY_ID_PREFIX = "tsk";
68
+ export declare const TASK_HISTORY_DEFAULT_MAX_AGE_DAYS = 0;
69
+ export declare const TASK_HISTORY_DEFAULT_MAX_ENTRIES = 1000;
70
+ export declare const TASK_HISTORY_DEFAULT_MAX_INDEX_BLOAT_RATIO = 2;
71
+ export declare const TASK_HISTORY_STALE_THRESHOLD_MS = 600000;
66
72
  export declare const REVIEW_BACKUPS_DIR = "review-backups";
67
73
  export declare const SUMMARY_INDEX_FILE = "_index.md";
68
74
  export declare const ARCHIVE_DIR = "_archived";
@@ -86,6 +86,17 @@ export const QUERY_LOG_ID_PREFIX = 'qry';
86
86
  // Dream log
87
87
  export const DREAM_LOG_DIR = 'dream-log';
88
88
  export const DREAM_LOG_ID_PREFIX = 'drm';
89
+ // Task history (per-project on-disk task journal — see M2 milestone)
90
+ export const TASK_HISTORY_DIR = 'task-history';
91
+ export const TASK_HISTORY_ID_PREFIX = 'tsk';
92
+ // Age-based prune is disabled by default. Task history is a business artifact
93
+ // (audit/review), not a log — count-based rotation is the sole retention policy.
94
+ // Override per-store via `maxAgeDays` constructor option if a deployment ever
95
+ // needs time-based eviction.
96
+ export const TASK_HISTORY_DEFAULT_MAX_AGE_DAYS = 0;
97
+ export const TASK_HISTORY_DEFAULT_MAX_ENTRIES = 1000;
98
+ export const TASK_HISTORY_DEFAULT_MAX_INDEX_BLOAT_RATIO = 2;
99
+ export const TASK_HISTORY_STALE_THRESHOLD_MS = 600_000;
89
100
  // Review backups (stores pre-curate file content for local HITL review diffs)
90
101
  export const REVIEW_BACKUPS_DIR = 'review-backups';
91
102
  // === Hierarchical DAG (summary, archive, manifest) ===