opencode-hashline 1.0.3 → 1.0.4
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/{chunk-IVZSANZ4.js → chunk-3AJXTHJ3.js} +3 -2
- package/dist/{chunk-OJ2CHKQK.js → chunk-DUTTCCXT.js} +1 -1
- package/dist/{hashline-W2FT5QN4.js → hashline-V3FR43UZ.js} +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.js +3 -3
- package/dist/utils.cjs +3 -2
- package/dist/utils.js +2 -2
- package/package.json +1 -1
|
@@ -111,13 +111,14 @@ function stripHashes(content, prefix) {
|
|
|
111
111
|
const escapedPrefix = effectivePrefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
112
112
|
let hashLinePattern = stripRegexCache.get(escapedPrefix);
|
|
113
113
|
if (!hashLinePattern) {
|
|
114
|
-
hashLinePattern = new RegExp(
|
|
114
|
+
hashLinePattern = new RegExp(`^([+ \\-])?${escapedPrefix}\\d+:[0-9a-f]{2,8}\\|`);
|
|
115
115
|
stripRegexCache.set(escapedPrefix, hashLinePattern);
|
|
116
116
|
}
|
|
117
117
|
return content.split("\n").map((line) => {
|
|
118
118
|
const match = line.match(hashLinePattern);
|
|
119
119
|
if (match) {
|
|
120
|
-
|
|
120
|
+
const patchMarker = match[1] || "";
|
|
121
|
+
return patchMarker + line.slice(match[0].length);
|
|
121
122
|
}
|
|
122
123
|
return line;
|
|
123
124
|
}).join("\n");
|
package/dist/index.cjs
CHANGED
|
@@ -123,13 +123,14 @@ function stripHashes(content, prefix) {
|
|
|
123
123
|
const escapedPrefix = effectivePrefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
124
124
|
let hashLinePattern = stripRegexCache.get(escapedPrefix);
|
|
125
125
|
if (!hashLinePattern) {
|
|
126
|
-
hashLinePattern = new RegExp(
|
|
126
|
+
hashLinePattern = new RegExp(`^([+ \\-])?${escapedPrefix}\\d+:[0-9a-f]{2,8}\\|`);
|
|
127
127
|
stripRegexCache.set(escapedPrefix, hashLinePattern);
|
|
128
128
|
}
|
|
129
129
|
return content.split("\n").map((line) => {
|
|
130
130
|
const match = line.match(hashLinePattern);
|
|
131
131
|
if (match) {
|
|
132
|
-
|
|
132
|
+
const patchMarker = match[1] || "";
|
|
133
|
+
return patchMarker + line.slice(match[0].length);
|
|
133
134
|
}
|
|
134
135
|
return line;
|
|
135
136
|
}).join("\n");
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createFileEditBeforeHook,
|
|
3
3
|
createFileReadAfterHook,
|
|
4
4
|
createSystemPromptHook
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DUTTCCXT.js";
|
|
6
6
|
import {
|
|
7
7
|
HashlineCache,
|
|
8
8
|
applyHashEdit,
|
|
9
9
|
resolveConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3AJXTHJ3.js";
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
import { readFileSync as readFileSync2, realpathSync as realpathSync2, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
@@ -163,7 +163,7 @@ function createHashlinePlugin(userConfig) {
|
|
|
163
163
|
const out = output;
|
|
164
164
|
const hashLen = config.hashLength || 0;
|
|
165
165
|
const prefix = config.prefix;
|
|
166
|
-
const { formatFileWithHashes, shouldExclude, getByteLength } = await import("./hashline-
|
|
166
|
+
const { formatFileWithHashes, shouldExclude, getByteLength } = await import("./hashline-V3FR43UZ.js");
|
|
167
167
|
for (const p of out.parts ?? []) {
|
|
168
168
|
if (p.type !== "file") continue;
|
|
169
169
|
if (!p.url || !p.mime?.startsWith("text/")) continue;
|
package/dist/utils.cjs
CHANGED
|
@@ -170,13 +170,14 @@ function stripHashes(content, prefix) {
|
|
|
170
170
|
const escapedPrefix = effectivePrefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
171
171
|
let hashLinePattern = stripRegexCache.get(escapedPrefix);
|
|
172
172
|
if (!hashLinePattern) {
|
|
173
|
-
hashLinePattern = new RegExp(
|
|
173
|
+
hashLinePattern = new RegExp(`^([+ \\-])?${escapedPrefix}\\d+:[0-9a-f]{2,8}\\|`);
|
|
174
174
|
stripRegexCache.set(escapedPrefix, hashLinePattern);
|
|
175
175
|
}
|
|
176
176
|
return content.split("\n").map((line) => {
|
|
177
177
|
const match = line.match(hashLinePattern);
|
|
178
178
|
if (match) {
|
|
179
|
-
|
|
179
|
+
const patchMarker = match[1] || "";
|
|
180
|
+
return patchMarker + line.slice(match[0].length);
|
|
180
181
|
}
|
|
181
182
|
return line;
|
|
182
183
|
}).join("\n");
|
package/dist/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createFileReadAfterHook,
|
|
4
4
|
createSystemPromptHook,
|
|
5
5
|
isFileReadTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DUTTCCXT.js";
|
|
7
7
|
import {
|
|
8
8
|
DEFAULT_CONFIG,
|
|
9
9
|
DEFAULT_EXCLUDE_PATTERNS,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
shouldExclude,
|
|
26
26
|
stripHashes,
|
|
27
27
|
verifyHash
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3AJXTHJ3.js";
|
|
29
29
|
export {
|
|
30
30
|
DEFAULT_CONFIG,
|
|
31
31
|
DEFAULT_EXCLUDE_PATTERNS,
|
package/package.json
CHANGED