@dreb/coding-agent 1.16.0 → 2.0.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 (99) hide show
  1. package/README.md +19 -9
  2. package/agents/code-reviewer.md +1 -1
  3. package/agents/completeness-checker.md +1 -1
  4. package/agents/error-auditor.md +1 -1
  5. package/agents/explore.md +1 -1
  6. package/agents/feature-dev.md +1 -1
  7. package/agents/independent-assessor.md +1 -1
  8. package/agents/simplifier.md +1 -1
  9. package/agents/test-reviewer.md +1 -1
  10. package/dist/core/system-prompt.d.ts.map +1 -1
  11. package/dist/core/system-prompt.js +7 -1
  12. package/dist/core/system-prompt.js.map +1 -1
  13. package/dist/core/tools/dreb-paths.d.ts +17 -0
  14. package/dist/core/tools/dreb-paths.d.ts.map +1 -0
  15. package/dist/core/tools/dreb-paths.js +43 -0
  16. package/dist/core/tools/dreb-paths.js.map +1 -0
  17. package/dist/core/tools/find.d.ts.map +1 -1
  18. package/dist/core/tools/find.js +8 -0
  19. package/dist/core/tools/find.js.map +1 -1
  20. package/dist/core/tools/grep.d.ts.map +1 -1
  21. package/dist/core/tools/grep.js +8 -0
  22. package/dist/core/tools/grep.js.map +1 -1
  23. package/dist/core/tools/search.d.ts +19 -1
  24. package/dist/core/tools/search.d.ts.map +1 -1
  25. package/dist/core/tools/search.js +50 -44
  26. package/dist/core/tools/search.js.map +1 -1
  27. package/package.json +2 -1
  28. package/dist/core/search/chunker.d.ts +0 -21
  29. package/dist/core/search/chunker.d.ts.map +0 -1
  30. package/dist/core/search/chunker.js +0 -51
  31. package/dist/core/search/chunker.js.map +0 -1
  32. package/dist/core/search/db.d.ts +0 -89
  33. package/dist/core/search/db.d.ts.map +0 -1
  34. package/dist/core/search/db.js +0 -406
  35. package/dist/core/search/db.js.map +0 -1
  36. package/dist/core/search/embedder.d.ts +0 -51
  37. package/dist/core/search/embedder.d.ts.map +0 -1
  38. package/dist/core/search/embedder.js +0 -143
  39. package/dist/core/search/embedder.js.map +0 -1
  40. package/dist/core/search/index-manager.d.ts +0 -55
  41. package/dist/core/search/index-manager.d.ts.map +0 -1
  42. package/dist/core/search/index-manager.js +0 -311
  43. package/dist/core/search/index-manager.js.map +0 -1
  44. package/dist/core/search/metrics/bm25.d.ts +0 -10
  45. package/dist/core/search/metrics/bm25.d.ts.map +0 -1
  46. package/dist/core/search/metrics/bm25.js +0 -32
  47. package/dist/core/search/metrics/bm25.js.map +0 -1
  48. package/dist/core/search/metrics/git-recency.d.ts +0 -14
  49. package/dist/core/search/metrics/git-recency.d.ts.map +0 -1
  50. package/dist/core/search/metrics/git-recency.js +0 -123
  51. package/dist/core/search/metrics/git-recency.js.map +0 -1
  52. package/dist/core/search/metrics/import-graph.d.ts +0 -15
  53. package/dist/core/search/metrics/import-graph.d.ts.map +0 -1
  54. package/dist/core/search/metrics/import-graph.js +0 -115
  55. package/dist/core/search/metrics/import-graph.js.map +0 -1
  56. package/dist/core/search/metrics/path-match.d.ts +0 -13
  57. package/dist/core/search/metrics/path-match.d.ts.map +0 -1
  58. package/dist/core/search/metrics/path-match.js +0 -54
  59. package/dist/core/search/metrics/path-match.js.map +0 -1
  60. package/dist/core/search/metrics/symbol-match.d.ts +0 -12
  61. package/dist/core/search/metrics/symbol-match.d.ts.map +0 -1
  62. package/dist/core/search/metrics/symbol-match.js +0 -62
  63. package/dist/core/search/metrics/symbol-match.js.map +0 -1
  64. package/dist/core/search/metrics/tokenize.d.ts +0 -12
  65. package/dist/core/search/metrics/tokenize.d.ts.map +0 -1
  66. package/dist/core/search/metrics/tokenize.js +0 -29
  67. package/dist/core/search/metrics/tokenize.js.map +0 -1
  68. package/dist/core/search/poem.d.ts +0 -38
  69. package/dist/core/search/poem.d.ts.map +0 -1
  70. package/dist/core/search/poem.js +0 -214
  71. package/dist/core/search/poem.js.map +0 -1
  72. package/dist/core/search/query-classifier.d.ts +0 -17
  73. package/dist/core/search/query-classifier.d.ts.map +0 -1
  74. package/dist/core/search/query-classifier.js +0 -54
  75. package/dist/core/search/query-classifier.js.map +0 -1
  76. package/dist/core/search/scanner.d.ts +0 -30
  77. package/dist/core/search/scanner.d.ts.map +0 -1
  78. package/dist/core/search/scanner.js +0 -335
  79. package/dist/core/search/scanner.js.map +0 -1
  80. package/dist/core/search/search.d.ts +0 -42
  81. package/dist/core/search/search.d.ts.map +0 -1
  82. package/dist/core/search/search.js +0 -337
  83. package/dist/core/search/search.js.map +0 -1
  84. package/dist/core/search/text-chunker.d.ts +0 -15
  85. package/dist/core/search/text-chunker.d.ts.map +0 -1
  86. package/dist/core/search/text-chunker.js +0 -580
  87. package/dist/core/search/text-chunker.js.map +0 -1
  88. package/dist/core/search/tree-sitter-chunker.d.ts +0 -25
  89. package/dist/core/search/tree-sitter-chunker.d.ts.map +0 -1
  90. package/dist/core/search/tree-sitter-chunker.js +0 -357
  91. package/dist/core/search/tree-sitter-chunker.js.map +0 -1
  92. package/dist/core/search/types.d.ts +0 -96
  93. package/dist/core/search/types.d.ts.map +0 -1
  94. package/dist/core/search/types.js +0 -6
  95. package/dist/core/search/types.js.map +0 -1
  96. package/dist/core/search/vector-store.d.ts +0 -43
  97. package/dist/core/search/vector-store.d.ts.map +0 -1
  98. package/dist/core/search/vector-store.js +0 -73
  99. package/dist/core/search/vector-store.js.map +0 -1
@@ -1,43 +0,0 @@
1
- /**
2
- * Vector operations for semantic search.
3
- *
4
- * Pure JS implementations — no native dependencies or SQLite UDFs needed.
5
- * Vectors are computed and compared in JS, stored as BLOBs in SQLite.
6
- */
7
- /**
8
- * Compute cosine similarity between two normalized vectors.
9
- *
10
- * For normalized vectors, cosine similarity is simply the dot product:
11
- * cos(a, b) = Σ a[i] * b[i]
12
- *
13
- * Returns a value in [-1, 1] where 1 = identical, 0 = orthogonal, -1 = opposite.
14
- */
15
- export declare function cosineSimilarity(a: Float32Array, b: Float32Array): number;
16
- /**
17
- * Pack a Float32Array into a Buffer for SQLite BLOB storage.
18
- *
19
- * Creates a copy to ensure the buffer isn't shared with other typed arrays.
20
- */
21
- export declare function packVector(vector: Float32Array): Buffer;
22
- /**
23
- * Unpack a BLOB (Uint8Array from node:sqlite) back to a Float32Array.
24
- *
25
- * The returned array shares the underlying buffer with the input for
26
- * zero-copy performance. Callers should not mutate the input after calling.
27
- */
28
- export declare function unpackVector(blob: Uint8Array): Float32Array;
29
- /**
30
- * Find the top-K most similar vectors from a set.
31
- *
32
- * Computes cosine similarity between the query vector and every candidate,
33
- * then returns the K highest-scoring results sorted by descending score.
34
- *
35
- * Uses a simple full scan — suitable for the index sizes we expect in a
36
- * single-project codebase (typically <100K chunks). For millions of vectors,
37
- * an approximate nearest neighbor index (HNSW, IVF) would be needed.
38
- */
39
- export declare function topKSimilar(query: Float32Array, vectors: Map<number, Float32Array>, k: number): Array<{
40
- id: number;
41
- score: number;
42
- }>;
43
- //# sourceMappingURL=vector-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../../../src/core/search/vector-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAOzE;AAMD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAE3D;AAMD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,CAAC,EAAE,MAAM,GACP,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBtC","sourcesContent":["/**\n * Vector operations for semantic search.\n *\n * Pure JS implementations — no native dependencies or SQLite UDFs needed.\n * Vectors are computed and compared in JS, stored as BLOBs in SQLite.\n */\n\n// ============================================================================\n// Similarity\n// ============================================================================\n\n/**\n * Compute cosine similarity between two normalized vectors.\n *\n * For normalized vectors, cosine similarity is simply the dot product:\n * cos(a, b) = Σ a[i] * b[i]\n *\n * Returns a value in [-1, 1] where 1 = identical, 0 = orthogonal, -1 = opposite.\n */\nexport function cosineSimilarity(a: Float32Array, b: Float32Array): number {\n\tconst len = a.length;\n\tlet dot = 0;\n\tfor (let i = 0; i < len; i++) {\n\t\tdot += a[i] * b[i];\n\t}\n\treturn dot;\n}\n\n// ============================================================================\n// Serialization\n// ============================================================================\n\n/**\n * Pack a Float32Array into a Buffer for SQLite BLOB storage.\n *\n * Creates a copy to ensure the buffer isn't shared with other typed arrays.\n */\nexport function packVector(vector: Float32Array): Buffer {\n\treturn Buffer.from(vector.buffer, vector.byteOffset, vector.byteLength);\n}\n\n/**\n * Unpack a BLOB (Uint8Array from node:sqlite) back to a Float32Array.\n *\n * The returned array shares the underlying buffer with the input for\n * zero-copy performance. Callers should not mutate the input after calling.\n */\nexport function unpackVector(blob: Uint8Array): Float32Array {\n\treturn new Float32Array(blob.buffer, blob.byteOffset, blob.byteLength / 4);\n}\n\n// ============================================================================\n// Top-K Search\n// ============================================================================\n\n/**\n * Find the top-K most similar vectors from a set.\n *\n * Computes cosine similarity between the query vector and every candidate,\n * then returns the K highest-scoring results sorted by descending score.\n *\n * Uses a simple full scan — suitable for the index sizes we expect in a\n * single-project codebase (typically <100K chunks). For millions of vectors,\n * an approximate nearest neighbor index (HNSW, IVF) would be needed.\n */\nexport function topKSimilar(\n\tquery: Float32Array,\n\tvectors: Map<number, Float32Array>,\n\tk: number,\n): Array<{ id: number; score: number }> {\n\tif (k <= 0 || vectors.size === 0) return [];\n\n\t// For small k relative to n, a min-heap would be more efficient.\n\t// For typical codebase sizes (<100K vectors) the difference is negligible,\n\t// and a sorted array is simpler and correct.\n\tconst scored: Array<{ id: number; score: number }> = [];\n\n\tfor (const [id, vector] of vectors) {\n\t\tscored.push({ id, score: cosineSimilarity(query, vector) });\n\t}\n\n\t// Partial sort: only need top-k, but full sort is fine for expected sizes\n\tscored.sort((a, b) => b.score - a.score);\n\n\treturn scored.slice(0, k);\n}\n"]}
@@ -1,73 +0,0 @@
1
- /**
2
- * Vector operations for semantic search.
3
- *
4
- * Pure JS implementations — no native dependencies or SQLite UDFs needed.
5
- * Vectors are computed and compared in JS, stored as BLOBs in SQLite.
6
- */
7
- // ============================================================================
8
- // Similarity
9
- // ============================================================================
10
- /**
11
- * Compute cosine similarity between two normalized vectors.
12
- *
13
- * For normalized vectors, cosine similarity is simply the dot product:
14
- * cos(a, b) = Σ a[i] * b[i]
15
- *
16
- * Returns a value in [-1, 1] where 1 = identical, 0 = orthogonal, -1 = opposite.
17
- */
18
- export function cosineSimilarity(a, b) {
19
- const len = a.length;
20
- let dot = 0;
21
- for (let i = 0; i < len; i++) {
22
- dot += a[i] * b[i];
23
- }
24
- return dot;
25
- }
26
- // ============================================================================
27
- // Serialization
28
- // ============================================================================
29
- /**
30
- * Pack a Float32Array into a Buffer for SQLite BLOB storage.
31
- *
32
- * Creates a copy to ensure the buffer isn't shared with other typed arrays.
33
- */
34
- export function packVector(vector) {
35
- return Buffer.from(vector.buffer, vector.byteOffset, vector.byteLength);
36
- }
37
- /**
38
- * Unpack a BLOB (Uint8Array from node:sqlite) back to a Float32Array.
39
- *
40
- * The returned array shares the underlying buffer with the input for
41
- * zero-copy performance. Callers should not mutate the input after calling.
42
- */
43
- export function unpackVector(blob) {
44
- return new Float32Array(blob.buffer, blob.byteOffset, blob.byteLength / 4);
45
- }
46
- // ============================================================================
47
- // Top-K Search
48
- // ============================================================================
49
- /**
50
- * Find the top-K most similar vectors from a set.
51
- *
52
- * Computes cosine similarity between the query vector and every candidate,
53
- * then returns the K highest-scoring results sorted by descending score.
54
- *
55
- * Uses a simple full scan — suitable for the index sizes we expect in a
56
- * single-project codebase (typically <100K chunks). For millions of vectors,
57
- * an approximate nearest neighbor index (HNSW, IVF) would be needed.
58
- */
59
- export function topKSimilar(query, vectors, k) {
60
- if (k <= 0 || vectors.size === 0)
61
- return [];
62
- // For small k relative to n, a min-heap would be more efficient.
63
- // For typical codebase sizes (<100K vectors) the difference is negligible,
64
- // and a sorted array is simpler and correct.
65
- const scored = [];
66
- for (const [id, vector] of vectors) {
67
- scored.push({ id, score: cosineSimilarity(query, vector) });
68
- }
69
- // Partial sort: only need top-k, but full sort is fine for expected sizes
70
- scored.sort((a, b) => b.score - a.score);
71
- return scored.slice(0, k);
72
- }
73
- //# sourceMappingURL=vector-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector-store.js","sourceRoot":"","sources":["../../../src/core/search/vector-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAe,EAAE,CAAe,EAAU;IAC1E,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACrB,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AAAA,CACX;AAED,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAoB,EAAU;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;AAAA,CACxE;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAgB,EAAgB;IAC5D,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AAAA,CAC3E;AAED,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAC1B,KAAmB,EACnB,OAAkC,EAClC,CAAS,EAC8B;IACvC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,iEAAiE;IACjE,2EAA2E;IAC3E,6CAA6C;IAC7C,MAAM,MAAM,GAAyC,EAAE,CAAC;IAExD,KAAK,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,0EAA0E;IAC1E,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAEzC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAAA,CAC1B","sourcesContent":["/**\n * Vector operations for semantic search.\n *\n * Pure JS implementations — no native dependencies or SQLite UDFs needed.\n * Vectors are computed and compared in JS, stored as BLOBs in SQLite.\n */\n\n// ============================================================================\n// Similarity\n// ============================================================================\n\n/**\n * Compute cosine similarity between two normalized vectors.\n *\n * For normalized vectors, cosine similarity is simply the dot product:\n * cos(a, b) = Σ a[i] * b[i]\n *\n * Returns a value in [-1, 1] where 1 = identical, 0 = orthogonal, -1 = opposite.\n */\nexport function cosineSimilarity(a: Float32Array, b: Float32Array): number {\n\tconst len = a.length;\n\tlet dot = 0;\n\tfor (let i = 0; i < len; i++) {\n\t\tdot += a[i] * b[i];\n\t}\n\treturn dot;\n}\n\n// ============================================================================\n// Serialization\n// ============================================================================\n\n/**\n * Pack a Float32Array into a Buffer for SQLite BLOB storage.\n *\n * Creates a copy to ensure the buffer isn't shared with other typed arrays.\n */\nexport function packVector(vector: Float32Array): Buffer {\n\treturn Buffer.from(vector.buffer, vector.byteOffset, vector.byteLength);\n}\n\n/**\n * Unpack a BLOB (Uint8Array from node:sqlite) back to a Float32Array.\n *\n * The returned array shares the underlying buffer with the input for\n * zero-copy performance. Callers should not mutate the input after calling.\n */\nexport function unpackVector(blob: Uint8Array): Float32Array {\n\treturn new Float32Array(blob.buffer, blob.byteOffset, blob.byteLength / 4);\n}\n\n// ============================================================================\n// Top-K Search\n// ============================================================================\n\n/**\n * Find the top-K most similar vectors from a set.\n *\n * Computes cosine similarity between the query vector and every candidate,\n * then returns the K highest-scoring results sorted by descending score.\n *\n * Uses a simple full scan — suitable for the index sizes we expect in a\n * single-project codebase (typically <100K chunks). For millions of vectors,\n * an approximate nearest neighbor index (HNSW, IVF) would be needed.\n */\nexport function topKSimilar(\n\tquery: Float32Array,\n\tvectors: Map<number, Float32Array>,\n\tk: number,\n): Array<{ id: number; score: number }> {\n\tif (k <= 0 || vectors.size === 0) return [];\n\n\t// For small k relative to n, a min-heap would be more efficient.\n\t// For typical codebase sizes (<100K vectors) the difference is negligible,\n\t// and a sorted array is simpler and correct.\n\tconst scored: Array<{ id: number; score: number }> = [];\n\n\tfor (const [id, vector] of vectors) {\n\t\tscored.push({ id, score: cosineSimilarity(query, vector) });\n\t}\n\n\t// Partial sort: only need top-k, but full sort is fine for expected sizes\n\tscored.sort((a, b) => b.score - a.score);\n\n\treturn scored.slice(0, k);\n}\n"]}