opencode-acp 1.18.1-pr.432.183 → 1.18.1-pr.433.184
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/index.js +6 -54
- package/dist/index.js.map +1 -1
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/messages/index.d.ts +1 -1
- package/dist/lib/messages/index.d.ts.map +1 -1
- package/dist/lib/messages/utils.d.ts +0 -4
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6822,33 +6822,6 @@ function buildToolIdList(state, messages) {
|
|
|
6822
6822
|
var stripHallucinationsFromString = (text) => {
|
|
6823
6823
|
return text.replace(DCP_PAIRED_TAG_REGEX, "").replace(DCP_UNPAIRED_TAG_REGEX, "");
|
|
6824
6824
|
};
|
|
6825
|
-
var LEAKED_TRAILING_REF_REGEX = /(?:^|\n)[ \t]*(?:m(\d{4,5})|b([1-9]\d*))\b/g;
|
|
6826
|
-
var stripLeakedTrailingRefs = (text, bounds) => {
|
|
6827
|
-
if (typeof text !== "string" || text.length === 0) {
|
|
6828
|
-
return text;
|
|
6829
|
-
}
|
|
6830
|
-
const rawMessageBound = bounds.nextMessageRef;
|
|
6831
|
-
const rawBlockBound = bounds.nextBlockRef;
|
|
6832
|
-
const messageBound = typeof rawMessageBound === "number" && Number.isInteger(rawMessageBound) ? rawMessageBound : null;
|
|
6833
|
-
const blockBound = typeof rawBlockBound === "number" && Number.isInteger(rawBlockBound) ? rawBlockBound : null;
|
|
6834
|
-
if (messageBound === null && blockBound === null) {
|
|
6835
|
-
return text;
|
|
6836
|
-
}
|
|
6837
|
-
const pattern = new RegExp(LEAKED_TRAILING_REF_REGEX.source, "g");
|
|
6838
|
-
let match;
|
|
6839
|
-
while ((match = pattern.exec(text)) !== null) {
|
|
6840
|
-
if (match[1] !== void 0) {
|
|
6841
|
-
if (messageBound !== null && Number(match[1]) >= messageBound) {
|
|
6842
|
-
return text.slice(0, match.index).replace(/[ \t\r\n]*$/, "");
|
|
6843
|
-
}
|
|
6844
|
-
} else if (match[2] !== void 0) {
|
|
6845
|
-
if (blockBound !== null && Number(match[2]) >= blockBound) {
|
|
6846
|
-
return text.slice(0, match.index).replace(/[ \t\r\n]*$/, "");
|
|
6847
|
-
}
|
|
6848
|
-
}
|
|
6849
|
-
}
|
|
6850
|
-
return text;
|
|
6851
|
-
};
|
|
6852
6825
|
var stripHallucinations = (messages) => {
|
|
6853
6826
|
for (const message of messages) {
|
|
6854
6827
|
for (const part of message.parts) {
|
|
@@ -10571,7 +10544,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
10571
10544
|
import { join as join4 } from "path";
|
|
10572
10545
|
import { existsSync as existsSync4 } from "fs";
|
|
10573
10546
|
import { homedir as homedir3 } from "os";
|
|
10574
|
-
var LOG_VERSION = true ? "1.18.1-pr.
|
|
10547
|
+
var LOG_VERSION = true ? "1.18.1-pr.433.184" : "dev";
|
|
10575
10548
|
var LEVEL_RANK = {
|
|
10576
10549
|
debug: 10,
|
|
10577
10550
|
info: 20,
|
|
@@ -12911,30 +12884,9 @@ function createCommandExecuteHandler(client, registry4, logger, config, workingD
|
|
|
12911
12884
|
}
|
|
12912
12885
|
};
|
|
12913
12886
|
}
|
|
12914
|
-
function createTextCompleteHandler(
|
|
12915
|
-
return async (
|
|
12916
|
-
|
|
12917
|
-
return;
|
|
12918
|
-
}
|
|
12919
|
-
let text = stripHallucinationsFromString(output.text);
|
|
12920
|
-
const state = typeof input.sessionID === "string" ? registry4.get(input.sessionID) : void 0;
|
|
12921
|
-
if (state) {
|
|
12922
|
-
const nextBlockId = state.prune?.messages?.nextBlockId;
|
|
12923
|
-
const stripped = stripLeakedTrailingRefs(text, {
|
|
12924
|
-
nextMessageRef: Number.isInteger(state.messageIds.nextRef) ? state.messageIds.nextRef : null,
|
|
12925
|
-
nextBlockRef: Number.isInteger(nextBlockId) ? nextBlockId : null
|
|
12926
|
-
});
|
|
12927
|
-
if (stripped !== text) {
|
|
12928
|
-
logger.warn("Stripped leaked trailing ACP ref from assistant output", {
|
|
12929
|
-
sessionID: input.sessionID,
|
|
12930
|
-
messageID: input.messageID,
|
|
12931
|
-
removedChars: text.length - stripped.length,
|
|
12932
|
-
removedTailPreview: text.slice(stripped.length, stripped.length + 200)
|
|
12933
|
-
});
|
|
12934
|
-
text = stripped;
|
|
12935
|
-
}
|
|
12936
|
-
}
|
|
12937
|
-
output.text = text;
|
|
12887
|
+
function createTextCompleteHandler() {
|
|
12888
|
+
return async (_input, output) => {
|
|
12889
|
+
output.text = stripHallucinationsFromString(output.text);
|
|
12938
12890
|
};
|
|
12939
12891
|
}
|
|
12940
12892
|
function createEventHandler(registry4, logger) {
|
|
@@ -13276,7 +13228,7 @@ var server = (async (ctx) => {
|
|
|
13276
13228
|
}
|
|
13277
13229
|
const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
|
|
13278
13230
|
logger.info("ACP plugin initialized", {
|
|
13279
|
-
version: true ? "1.18.1-pr.
|
|
13231
|
+
version: true ? "1.18.1-pr.433.184" : "dev",
|
|
13280
13232
|
workspace: ctx.directory,
|
|
13281
13233
|
logLevel: logger.level,
|
|
13282
13234
|
debug: config.debug,
|
|
@@ -13341,7 +13293,7 @@ var server = (async (ctx) => {
|
|
|
13341
13293
|
hostPermissions
|
|
13342
13294
|
)
|
|
13343
13295
|
),
|
|
13344
|
-
"experimental.text.complete": guard(createTextCompleteHandler(
|
|
13296
|
+
"experimental.text.complete": guard(createTextCompleteHandler()),
|
|
13345
13297
|
"command.execute.before": guard(
|
|
13346
13298
|
createCommandExecuteHandler(
|
|
13347
13299
|
ctx.client,
|