offhands 0.1.11 → 0.1.12
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/dist/daemon.mjs +6 -1
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -6813,6 +6813,7 @@ function pathWords(path) {
|
|
|
6813
6813
|
}
|
|
6814
6814
|
var NOISE_FILES = /* @__PURE__ */ new Set(["package-lock.json", "pnpm-lock.yaml", "yarn.lock", "bun.lockb", "bun.lock", "composer.lock", "cargo.lock", "poetry.lock"]);
|
|
6815
6815
|
var isNoise = (p2) => NOISE_FILES.has((p2.split("/").pop() ?? "").toLowerCase());
|
|
6816
|
+
var MAX_UNMATCHED_WITH_MATCHES = 3;
|
|
6816
6817
|
var MAX_NAME_MATCHES = 10;
|
|
6817
6818
|
var MAX_DIRTY_ONLY = 8;
|
|
6818
6819
|
var MAX_RECENT = 6;
|
|
@@ -6843,7 +6844,11 @@ async function buildContext(workspace, prompt, opts = {}) {
|
|
|
6843
6844
|
if (findings.length === 0) return null;
|
|
6844
6845
|
const rank = (f2) => f2.matchScore > 0 ? f2.dirty ? 5 : 4 : f2.dirty ? 2 : 1;
|
|
6845
6846
|
findings.sort((a2, b2) => rank(b2) - rank(a2) || b2.matchScore - a2.matchScore);
|
|
6846
|
-
const
|
|
6847
|
+
const strongMatches = findings.filter((f2) => f2.matchScore > 0).length;
|
|
6848
|
+
const unmatchedCap = strongMatches >= 3 ? MAX_UNMATCHED_WITH_MATCHES : Infinity;
|
|
6849
|
+
let unmatched = 0;
|
|
6850
|
+
const shown = findings.filter((f2) => f2.matchScore > 0 || ++unmatched <= unmatchedCap);
|
|
6851
|
+
const { text: block, selectedCount } = formatBlock(prompt, shown, gitState, maxChars);
|
|
6847
6852
|
if (selectedCount === 0) return null;
|
|
6848
6853
|
return {
|
|
6849
6854
|
block,
|