opencode-acp 1.18.4-pr.483.216 → 1.18.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/index.js +2 -68
- package/dist/index.js.map +1 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/messages/index.d.ts +0 -1
- package/dist/lib/messages/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/lib/messages/reasoning-canonicalize.d.ts +0 -37
- package/dist/lib/messages/reasoning-canonicalize.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -9953,66 +9953,6 @@ function dropCompressReasoning(messages, threshold) {
|
|
|
9953
9953
|
return removed;
|
|
9954
9954
|
}
|
|
9955
9955
|
|
|
9956
|
-
// lib/messages/reasoning-canonicalize.ts
|
|
9957
|
-
var CANONICAL_OPEN = "<thinking>\n";
|
|
9958
|
-
var CANONICAL_CLOSE = "\n</thinking>";
|
|
9959
|
-
function canonicalizeReasoningShape(messages) {
|
|
9960
|
-
let normalized = 0;
|
|
9961
|
-
for (const message of messages) {
|
|
9962
|
-
if (!message || message.info.role !== "assistant") {
|
|
9963
|
-
continue;
|
|
9964
|
-
}
|
|
9965
|
-
const parts = Array.isArray(message.parts) ? message.parts : [];
|
|
9966
|
-
let allReasoning = "";
|
|
9967
|
-
for (const part of parts) {
|
|
9968
|
-
if (part.type === "reasoning") {
|
|
9969
|
-
allReasoning += part.text;
|
|
9970
|
-
}
|
|
9971
|
-
}
|
|
9972
|
-
if (allReasoning.length === 0) {
|
|
9973
|
-
continue;
|
|
9974
|
-
}
|
|
9975
|
-
let allText = "";
|
|
9976
|
-
for (const part of parts) {
|
|
9977
|
-
if (part.type === "text") {
|
|
9978
|
-
allText += part.text;
|
|
9979
|
-
}
|
|
9980
|
-
}
|
|
9981
|
-
const merged = allText.length > 0 ? `${CANONICAL_OPEN}${allReasoning}${CANONICAL_CLOSE}
|
|
9982
|
-
${allText}` : `${CANONICAL_OPEN}${allReasoning}${CANONICAL_CLOSE}`;
|
|
9983
|
-
const rebuilt = [];
|
|
9984
|
-
let placed = false;
|
|
9985
|
-
const placeMerged = (carrier) => {
|
|
9986
|
-
if (placed) {
|
|
9987
|
-
return;
|
|
9988
|
-
}
|
|
9989
|
-
placed = true;
|
|
9990
|
-
const part = {
|
|
9991
|
-
id: carrier.id,
|
|
9992
|
-
sessionID: message.info.sessionID,
|
|
9993
|
-
messageID: message.info.id,
|
|
9994
|
-
type: "text",
|
|
9995
|
-
text: merged
|
|
9996
|
-
};
|
|
9997
|
-
rebuilt.push(part);
|
|
9998
|
-
};
|
|
9999
|
-
for (const part of parts) {
|
|
10000
|
-
if (part.type === "reasoning") {
|
|
10001
|
-
placeMerged(part);
|
|
10002
|
-
continue;
|
|
10003
|
-
}
|
|
10004
|
-
if (part.type === "text") {
|
|
10005
|
-
placeMerged(part);
|
|
10006
|
-
continue;
|
|
10007
|
-
}
|
|
10008
|
-
rebuilt.push(part);
|
|
10009
|
-
}
|
|
10010
|
-
message.parts = rebuilt;
|
|
10011
|
-
normalized++;
|
|
10012
|
-
}
|
|
10013
|
-
return normalized;
|
|
10014
|
-
}
|
|
10015
|
-
|
|
10016
9956
|
// lib/messages/priority.ts
|
|
10017
9957
|
function buildPriorityMap(_config, _state, _messages) {
|
|
10018
9958
|
return /* @__PURE__ */ new Map();
|
|
@@ -11389,7 +11329,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
11389
11329
|
import { join as join5 } from "path";
|
|
11390
11330
|
import { existsSync as existsSync5 } from "fs";
|
|
11391
11331
|
import { homedir as homedir3 } from "os";
|
|
11392
|
-
var LOG_VERSION = true ? "1.18.4
|
|
11332
|
+
var LOG_VERSION = true ? "1.18.4" : "dev";
|
|
11393
11333
|
var LEVEL_RANK = {
|
|
11394
11334
|
debug: 10,
|
|
11395
11335
|
info: 20,
|
|
@@ -13588,12 +13528,6 @@ function createChatMessageTransformHandler(client, registry4, logger, config, pr
|
|
|
13588
13528
|
});
|
|
13589
13529
|
}
|
|
13590
13530
|
}
|
|
13591
|
-
const canonicalizedReasoning = canonicalizeReasoningShape(output.messages);
|
|
13592
|
-
if (canonicalizedReasoning > 0) {
|
|
13593
|
-
logger.debug("reasoning-canonicalize: pinned historical thinking shape", {
|
|
13594
|
-
messages: canonicalizedReasoning
|
|
13595
|
-
});
|
|
13596
|
-
}
|
|
13597
13531
|
ensureBuiltinFiltersRegistered();
|
|
13598
13532
|
const effectiveLimit = resolveEffectiveContextLimit(state, config);
|
|
13599
13533
|
applyMessageFilters(output.messages, config.messageFilters, logger, {
|
|
@@ -14105,7 +14039,7 @@ var server = (async (ctx) => {
|
|
|
14105
14039
|
}
|
|
14106
14040
|
const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
|
|
14107
14041
|
logger.info("ACP plugin initialized", {
|
|
14108
|
-
version: true ? "1.18.4
|
|
14042
|
+
version: true ? "1.18.4" : "dev",
|
|
14109
14043
|
workspace: ctx.directory,
|
|
14110
14044
|
logLevel: logger.level,
|
|
14111
14045
|
debug: config.debug,
|