acp-kernel 0.0.75 → 0.0.76-pr.325.190
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/compress-tools.d.ts +191 -0
- package/dist/compress-tools.d.ts.map +1 -1
- package/dist/compress.d.ts.map +1 -1
- package/dist/index.js +164 -44
- package/dist/index.js.map +1 -1
- package/dist/recommend.d.ts.map +1 -1
- package/dist/turn-integrity.d.ts +28 -0
- package/dist/turn-integrity.d.ts.map +1 -1
- package/dist/wire/bili-message.d.ts +10 -0
- package/dist/wire/bili-message.d.ts.map +1 -1
- package/dist/wire/formats.d.ts +1 -1
- package/dist/wire/formats.d.ts.map +1 -1
- package/dist/wire/google.d.ts +96 -0
- package/dist/wire/google.d.ts.map +1 -0
- package/dist/wire/index.d.ts +1 -0
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +310 -1
- package/dist/wire/index.js.map +1 -1
- package/dist/wire/strip-images.d.ts +1 -1
- package/dist/wire/strip-images.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/compress-tools.d.ts
CHANGED
|
@@ -813,4 +813,195 @@ export declare const ABSORB_TOOL_OPENAI: {
|
|
|
813
813
|
};
|
|
814
814
|
};
|
|
815
815
|
};
|
|
816
|
+
export declare const COMPRESS_TOOL_GOOGLE: {
|
|
817
|
+
name: string;
|
|
818
|
+
description: string;
|
|
819
|
+
parameters: {
|
|
820
|
+
type: string;
|
|
821
|
+
properties: {
|
|
822
|
+
topic: {
|
|
823
|
+
type: string;
|
|
824
|
+
description: string;
|
|
825
|
+
};
|
|
826
|
+
content: {
|
|
827
|
+
type: string;
|
|
828
|
+
description: string;
|
|
829
|
+
items: {
|
|
830
|
+
type: string;
|
|
831
|
+
properties: {
|
|
832
|
+
topic: {
|
|
833
|
+
type: string;
|
|
834
|
+
};
|
|
835
|
+
startId: {
|
|
836
|
+
type: string;
|
|
837
|
+
description: string;
|
|
838
|
+
};
|
|
839
|
+
endId: {
|
|
840
|
+
type: string;
|
|
841
|
+
description: string;
|
|
842
|
+
};
|
|
843
|
+
summary: {
|
|
844
|
+
type: string;
|
|
845
|
+
description: string;
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
required: string[];
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
required: string[];
|
|
853
|
+
};
|
|
854
|
+
};
|
|
855
|
+
export declare const DECOMPRESS_TOOL_GOOGLE: {
|
|
856
|
+
name: string;
|
|
857
|
+
description: string;
|
|
858
|
+
parameters: {
|
|
859
|
+
type: string;
|
|
860
|
+
properties: {
|
|
861
|
+
blockId: {
|
|
862
|
+
type: string;
|
|
863
|
+
description: string;
|
|
864
|
+
};
|
|
865
|
+
toFile: {
|
|
866
|
+
type: string;
|
|
867
|
+
description: string;
|
|
868
|
+
};
|
|
869
|
+
full: {
|
|
870
|
+
type: string;
|
|
871
|
+
description: string;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
required: string[];
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
export declare const SEARCH_CONTEXT_TOOL_GOOGLE: {
|
|
878
|
+
name: string;
|
|
879
|
+
description: string;
|
|
880
|
+
parameters: {
|
|
881
|
+
type: string;
|
|
882
|
+
properties: {
|
|
883
|
+
query: {
|
|
884
|
+
type: string;
|
|
885
|
+
description: string;
|
|
886
|
+
};
|
|
887
|
+
limit: {
|
|
888
|
+
type: string;
|
|
889
|
+
description: string;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
required: string[];
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
export declare const ACP_STATUS_TOOL_GOOGLE: {
|
|
896
|
+
name: string;
|
|
897
|
+
description: string;
|
|
898
|
+
parameters: {
|
|
899
|
+
type: string;
|
|
900
|
+
properties: {};
|
|
901
|
+
};
|
|
902
|
+
};
|
|
903
|
+
/** All ACP tools in Gemini flat format, matching ACP_TOOL_NAMES. */
|
|
904
|
+
export declare const ACP_TOOLS_GOOGLE: readonly [{
|
|
905
|
+
name: string;
|
|
906
|
+
description: string;
|
|
907
|
+
parameters: {
|
|
908
|
+
type: string;
|
|
909
|
+
properties: {
|
|
910
|
+
topic: {
|
|
911
|
+
type: string;
|
|
912
|
+
description: string;
|
|
913
|
+
};
|
|
914
|
+
content: {
|
|
915
|
+
type: string;
|
|
916
|
+
description: string;
|
|
917
|
+
items: {
|
|
918
|
+
type: string;
|
|
919
|
+
properties: {
|
|
920
|
+
topic: {
|
|
921
|
+
type: string;
|
|
922
|
+
};
|
|
923
|
+
startId: {
|
|
924
|
+
type: string;
|
|
925
|
+
description: string;
|
|
926
|
+
};
|
|
927
|
+
endId: {
|
|
928
|
+
type: string;
|
|
929
|
+
description: string;
|
|
930
|
+
};
|
|
931
|
+
summary: {
|
|
932
|
+
type: string;
|
|
933
|
+
description: string;
|
|
934
|
+
};
|
|
935
|
+
};
|
|
936
|
+
required: string[];
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
required: string[];
|
|
941
|
+
};
|
|
942
|
+
}, {
|
|
943
|
+
name: string;
|
|
944
|
+
description: string;
|
|
945
|
+
parameters: {
|
|
946
|
+
type: string;
|
|
947
|
+
properties: {
|
|
948
|
+
blockId: {
|
|
949
|
+
type: string;
|
|
950
|
+
description: string;
|
|
951
|
+
};
|
|
952
|
+
toFile: {
|
|
953
|
+
type: string;
|
|
954
|
+
description: string;
|
|
955
|
+
};
|
|
956
|
+
full: {
|
|
957
|
+
type: string;
|
|
958
|
+
description: string;
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
required: string[];
|
|
962
|
+
};
|
|
963
|
+
}, {
|
|
964
|
+
name: string;
|
|
965
|
+
description: string;
|
|
966
|
+
parameters: {
|
|
967
|
+
type: string;
|
|
968
|
+
properties: {
|
|
969
|
+
query: {
|
|
970
|
+
type: string;
|
|
971
|
+
description: string;
|
|
972
|
+
};
|
|
973
|
+
limit: {
|
|
974
|
+
type: string;
|
|
975
|
+
description: string;
|
|
976
|
+
};
|
|
977
|
+
};
|
|
978
|
+
required: string[];
|
|
979
|
+
};
|
|
980
|
+
}, {
|
|
981
|
+
name: string;
|
|
982
|
+
description: string;
|
|
983
|
+
parameters: {
|
|
984
|
+
type: string;
|
|
985
|
+
properties: {};
|
|
986
|
+
};
|
|
987
|
+
}];
|
|
988
|
+
/** Opt-in absorb tool in Gemini flat format (config.absorb.enabled). */
|
|
989
|
+
export declare const ABSORB_TOOL_GOOGLE: {
|
|
990
|
+
name: string;
|
|
991
|
+
description: string;
|
|
992
|
+
parameters: {
|
|
993
|
+
type: "object";
|
|
994
|
+
properties: {
|
|
995
|
+
ref: {
|
|
996
|
+
type: string;
|
|
997
|
+
description: string;
|
|
998
|
+
};
|
|
999
|
+
summary: {
|
|
1000
|
+
type: string;
|
|
1001
|
+
description: string;
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
required: string[];
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
816
1007
|
//# sourceMappingURL=compress-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress-tools.d.ts","sourceRoot":"","sources":["../src/compress-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC;;;6DAG6D;AAC7D,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,e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C;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,EAAE,CAAC;IACJ,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnC;AA2DD,wBAAgB,UAAU,CAAC,KAAK,GAAE,KAAU,GAAG,eAAe,CA+U7D;AA0jCD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1391,6 +1391,73 @@ var ABSORB_TOOL_OPENAI = {
|
|
|
1391
1391
|
parameters: ABSORB_PARAMETERS
|
|
1392
1392
|
}
|
|
1393
1393
|
};
|
|
1394
|
+
var COMPRESS_TOOL_GOOGLE = {
|
|
1395
|
+
name: COMPRESS_TOOL_NAME,
|
|
1396
|
+
description: COMPRESS_TOOL.description,
|
|
1397
|
+
// `anyOf` is rejected by older API revisions, so `content` declares the
|
|
1398
|
+
// object form; a JSON-encoded string of that array is still accepted by
|
|
1399
|
+
// parseCompressInput, and the line form (a summary whose first line is
|
|
1400
|
+
// 'm00150–m00220 optional topic') is documented in the description.
|
|
1401
|
+
parameters: {
|
|
1402
|
+
type: "object",
|
|
1403
|
+
properties: {
|
|
1404
|
+
topic: {
|
|
1405
|
+
type: "string",
|
|
1406
|
+
description: "Optional short title for the compressed range"
|
|
1407
|
+
},
|
|
1408
|
+
content: {
|
|
1409
|
+
type: "array",
|
|
1410
|
+
description: "One or more ranges to compress into separate summary blocks. Object form: {startId,endId,summary,topic?}. A JSON-encoded string of that array is also accepted; in the line form the summary begins with its own first line 'm00150\u2013m00220 optional topic', the rest being the summary markdown verbatim. REQUIRED \u2014 compress without content is invalid.",
|
|
1411
|
+
items: {
|
|
1412
|
+
type: "object",
|
|
1413
|
+
properties: {
|
|
1414
|
+
topic: { type: "string" },
|
|
1415
|
+
startId: {
|
|
1416
|
+
type: "string",
|
|
1417
|
+
description: "mNNNNN ref at the start of the range"
|
|
1418
|
+
},
|
|
1419
|
+
endId: {
|
|
1420
|
+
type: "string",
|
|
1421
|
+
description: "mNNNNN ref at the end of the range"
|
|
1422
|
+
},
|
|
1423
|
+
summary: {
|
|
1424
|
+
type: "string",
|
|
1425
|
+
description: "Self-contained summary replacing the range"
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
required: ["startId", "endId", "summary"]
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
},
|
|
1432
|
+
required: ["content"]
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
var DECOMPRESS_TOOL_GOOGLE = {
|
|
1436
|
+
name: DECOMPRESS_TOOL_NAME,
|
|
1437
|
+
description: DECOMPRESS_TOOL_OPENAI.function.description,
|
|
1438
|
+
parameters: DECOMPRESS_TOOL_OPENAI.function.parameters
|
|
1439
|
+
};
|
|
1440
|
+
var SEARCH_CONTEXT_TOOL_GOOGLE = {
|
|
1441
|
+
name: SEARCH_CONTEXT_TOOL_NAME,
|
|
1442
|
+
description: SEARCH_CONTEXT_TOOL_OPENAI.function.description,
|
|
1443
|
+
parameters: SEARCH_CONTEXT_TOOL_OPENAI.function.parameters
|
|
1444
|
+
};
|
|
1445
|
+
var ACP_STATUS_TOOL_GOOGLE = {
|
|
1446
|
+
name: ACP_STATUS_TOOL_NAME,
|
|
1447
|
+
description: ACP_STATUS_TOOL_OPENAI.function.description,
|
|
1448
|
+
parameters: ACP_STATUS_TOOL_OPENAI.function.parameters
|
|
1449
|
+
};
|
|
1450
|
+
var ACP_TOOLS_GOOGLE = [
|
|
1451
|
+
COMPRESS_TOOL_GOOGLE,
|
|
1452
|
+
DECOMPRESS_TOOL_GOOGLE,
|
|
1453
|
+
SEARCH_CONTEXT_TOOL_GOOGLE,
|
|
1454
|
+
ACP_STATUS_TOOL_GOOGLE
|
|
1455
|
+
];
|
|
1456
|
+
var ABSORB_TOOL_GOOGLE = {
|
|
1457
|
+
name: ABSORB_TOOL_NAME,
|
|
1458
|
+
description: ABSORB_TOOL_DESCRIPTION,
|
|
1459
|
+
parameters: ABSORB_PARAMETERS
|
|
1460
|
+
};
|
|
1394
1461
|
|
|
1395
1462
|
// src/protected.ts
|
|
1396
1463
|
var ALWAYS_PROTECTED_TOOLS = ["compress"];
|
|
@@ -2002,6 +2069,73 @@ function computeTurnGroups(messages) {
|
|
|
2002
2069
|
}
|
|
2003
2070
|
return groups;
|
|
2004
2071
|
}
|
|
2072
|
+
function computeIntegrityWithdrawals(messages, foldedIds) {
|
|
2073
|
+
const remaining = new Set(foldedIds);
|
|
2074
|
+
const withdrawn = /* @__PURE__ */ new Set();
|
|
2075
|
+
const handledTurns = /* @__PURE__ */ new Set();
|
|
2076
|
+
const handledPairs = /* @__PURE__ */ new Set();
|
|
2077
|
+
const reasoningIds = /* @__PURE__ */ new Set();
|
|
2078
|
+
const callIds = /* @__PURE__ */ new Set();
|
|
2079
|
+
const callIdByMessageId = /* @__PURE__ */ new Map();
|
|
2080
|
+
const resultIdByCallId = /* @__PURE__ */ new Map();
|
|
2081
|
+
for (const m of messages) {
|
|
2082
|
+
if (!m.id) continue;
|
|
2083
|
+
if (m.contentType === "reasoning") reasoningIds.add(m.id);
|
|
2084
|
+
if (m.role === "assistant" && m.contentType === "tool-call") {
|
|
2085
|
+
callIds.add(m.id);
|
|
2086
|
+
if (typeof m.toolCallId === "string") {
|
|
2087
|
+
callIdByMessageId.set(m.id, m.toolCallId);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
if (m.contentType === "tool-result" && typeof m.toolCallId === "string") {
|
|
2091
|
+
if (!resultIdByCallId.has(m.toolCallId)) {
|
|
2092
|
+
resultIdByCallId.set(m.toolCallId, m.id);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
const groups = computeTurnGroups(messages);
|
|
2097
|
+
let changed = true;
|
|
2098
|
+
while (changed) {
|
|
2099
|
+
changed = false;
|
|
2100
|
+
for (let g = 0; g < groups.length; g++) {
|
|
2101
|
+
if (handledTurns.has(g)) continue;
|
|
2102
|
+
const group = groups[g];
|
|
2103
|
+
const foldHasReasoning = group.some(
|
|
2104
|
+
(id) => remaining.has(id) && reasoningIds.has(id)
|
|
2105
|
+
);
|
|
2106
|
+
if (!foldHasReasoning) continue;
|
|
2107
|
+
const keptHasCall = group.some(
|
|
2108
|
+
(id) => !remaining.has(id) && callIds.has(id)
|
|
2109
|
+
);
|
|
2110
|
+
if (!keptHasCall) continue;
|
|
2111
|
+
handledTurns.add(g);
|
|
2112
|
+
for (const id of group) {
|
|
2113
|
+
remaining.delete(id);
|
|
2114
|
+
withdrawn.add(id);
|
|
2115
|
+
}
|
|
2116
|
+
changed = true;
|
|
2117
|
+
}
|
|
2118
|
+
for (const m of messages) {
|
|
2119
|
+
if (!m.id || !callIds.has(m.id)) continue;
|
|
2120
|
+
const callId = callIdByMessageId.get(m.id);
|
|
2121
|
+
if (callId === void 0 || handledPairs.has(callId)) continue;
|
|
2122
|
+
const resultId = resultIdByCallId.get(callId);
|
|
2123
|
+
if (resultId === void 0) continue;
|
|
2124
|
+
if (remaining.has(m.id) === remaining.has(resultId)) continue;
|
|
2125
|
+
handledPairs.add(callId);
|
|
2126
|
+
remaining.delete(m.id);
|
|
2127
|
+
remaining.delete(resultId);
|
|
2128
|
+
withdrawn.add(m.id);
|
|
2129
|
+
withdrawn.add(resultId);
|
|
2130
|
+
changed = true;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
return {
|
|
2134
|
+
withdrawn,
|
|
2135
|
+
splitTurnCount: handledTurns.size,
|
|
2136
|
+
splitPairCount: handledPairs.size
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2005
2139
|
|
|
2006
2140
|
// src/recommend.ts
|
|
2007
2141
|
function estimateTextTokens(text) {
|
|
@@ -2053,7 +2187,7 @@ function computeProtectedRefs(messages, state, config, countTokens = estimateTex
|
|
|
2053
2187
|
return result;
|
|
2054
2188
|
}
|
|
2055
2189
|
function buildCompressibleRanges(messages, state, config, protectedZoneRefs, countTokens = estimateTextTokens) {
|
|
2056
|
-
|
|
2190
|
+
let compressibleMsgs = [];
|
|
2057
2191
|
const protectedMsgs = [];
|
|
2058
2192
|
const protectedCallIds = collectProtectedToolCallIds(messages, config);
|
|
2059
2193
|
let skipSinceCompressible = false;
|
|
@@ -2083,6 +2217,7 @@ function buildCompressibleRanges(messages, state, config, protectedZoneRefs, cou
|
|
|
2083
2217
|
continue;
|
|
2084
2218
|
}
|
|
2085
2219
|
compressibleMsgs.push({
|
|
2220
|
+
id: msg.id,
|
|
2086
2221
|
ref,
|
|
2087
2222
|
gapBefore: skipSinceCompressible,
|
|
2088
2223
|
tokens: countMessageTokens(msg, countTokens),
|
|
@@ -2093,6 +2228,23 @@ function buildCompressibleRanges(messages, state, config, protectedZoneRefs, cou
|
|
|
2093
2228
|
skipSinceCompressible = false;
|
|
2094
2229
|
skipSinceProtected = true;
|
|
2095
2230
|
}
|
|
2231
|
+
const unfoldedIds = computeIntegrityWithdrawals(
|
|
2232
|
+
messages,
|
|
2233
|
+
new Set(compressibleMsgs.map((info) => info.id))
|
|
2234
|
+
).withdrawn;
|
|
2235
|
+
if (unfoldedIds.size > 0) {
|
|
2236
|
+
let gapPending = false;
|
|
2237
|
+
const kept = [];
|
|
2238
|
+
for (const info of compressibleMsgs) {
|
|
2239
|
+
if (unfoldedIds.has(info.id)) {
|
|
2240
|
+
gapPending = true;
|
|
2241
|
+
continue;
|
|
2242
|
+
}
|
|
2243
|
+
kept.push(gapPending ? { ...info, gapBefore: true } : info);
|
|
2244
|
+
gapPending = false;
|
|
2245
|
+
}
|
|
2246
|
+
compressibleMsgs = kept;
|
|
2247
|
+
}
|
|
2096
2248
|
const compressible = [];
|
|
2097
2249
|
let cur = null;
|
|
2098
2250
|
for (const info of compressibleMsgs) {
|
|
@@ -2764,49 +2916,11 @@ function applySingleRange(input) {
|
|
|
2764
2916
|
);
|
|
2765
2917
|
}
|
|
2766
2918
|
{
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
if (m.role === "assistant" && m.contentType === "tool-call")
|
|
2773
|
-
callIds.add(m.id);
|
|
2774
|
-
}
|
|
2775
|
-
const withdrawIds = /* @__PURE__ */ new Set();
|
|
2776
|
-
let splitTurnCount = 0;
|
|
2777
|
-
for (const group of computeTurnGroups(input.messages)) {
|
|
2778
|
-
const foldHasReasoning = group.some(
|
|
2779
|
-
(id) => effectiveMessageIds.has(id) && reasoningIds.has(id)
|
|
2780
|
-
);
|
|
2781
|
-
if (!foldHasReasoning) continue;
|
|
2782
|
-
const keptHasCall = group.some(
|
|
2783
|
-
(id) => !effectiveMessageIds.has(id) && callIds.has(id)
|
|
2784
|
-
);
|
|
2785
|
-
if (!keptHasCall) continue;
|
|
2786
|
-
splitTurnCount++;
|
|
2787
|
-
for (const id of group) withdrawIds.add(id);
|
|
2788
|
-
}
|
|
2789
|
-
const resultIdByCallId = /* @__PURE__ */ new Map();
|
|
2790
|
-
for (const m of input.messages) {
|
|
2791
|
-
if (!m.id || m.contentType !== "tool-result") continue;
|
|
2792
|
-
if (typeof m.toolCallId !== "string") continue;
|
|
2793
|
-
if (!resultIdByCallId.has(m.toolCallId)) {
|
|
2794
|
-
resultIdByCallId.set(m.toolCallId, m.id);
|
|
2795
|
-
}
|
|
2796
|
-
}
|
|
2797
|
-
let splitPairCount = 0;
|
|
2798
|
-
for (const m of input.messages) {
|
|
2799
|
-
if (!m.id || m.contentType !== "tool-call") continue;
|
|
2800
|
-
if (typeof m.toolCallId !== "string") continue;
|
|
2801
|
-
const resultId = resultIdByCallId.get(m.toolCallId);
|
|
2802
|
-
if (resultId === void 0) continue;
|
|
2803
|
-
if (effectiveMessageIds.has(m.id) === effectiveMessageIds.has(resultId)) {
|
|
2804
|
-
continue;
|
|
2805
|
-
}
|
|
2806
|
-
withdrawIds.add(m.id);
|
|
2807
|
-
withdrawIds.add(resultId);
|
|
2808
|
-
splitPairCount++;
|
|
2809
|
-
}
|
|
2919
|
+
const {
|
|
2920
|
+
withdrawn: withdrawIds,
|
|
2921
|
+
splitTurnCount,
|
|
2922
|
+
splitPairCount
|
|
2923
|
+
} = computeIntegrityWithdrawals(input.messages, effectiveMessageIds);
|
|
2810
2924
|
if (withdrawIds.size > 0) {
|
|
2811
2925
|
for (const id of withdrawIds) effectiveMessageIds.delete(id);
|
|
2812
2926
|
const beforeWithdraw = filteredIds.length;
|
|
@@ -5110,6 +5224,7 @@ export {
|
|
|
5110
5224
|
ABSORB_PROMPT_MARKER,
|
|
5111
5225
|
ABSORB_TOOL,
|
|
5112
5226
|
ABSORB_TOOL_DESCRIPTION,
|
|
5227
|
+
ABSORB_TOOL_GOOGLE,
|
|
5113
5228
|
ABSORB_TOOL_NAME,
|
|
5114
5229
|
ABSORB_TOOL_OPENAI,
|
|
5115
5230
|
ACP_CACHE_TOOL,
|
|
@@ -5127,12 +5242,14 @@ export {
|
|
|
5127
5242
|
ACP_STATUS_CLOSE,
|
|
5128
5243
|
ACP_STATUS_OPEN,
|
|
5129
5244
|
ACP_STATUS_TOOL,
|
|
5245
|
+
ACP_STATUS_TOOL_GOOGLE,
|
|
5130
5246
|
ACP_STATUS_TOOL_NAME,
|
|
5131
5247
|
ACP_STATUS_TOOL_OPENAI,
|
|
5132
5248
|
ACP_STATUS_TOOL_RESPONSES,
|
|
5133
5249
|
ACP_TEXT_CLOSE,
|
|
5134
5250
|
ACP_TEXT_OPEN,
|
|
5135
5251
|
ACP_TOOLS_ANTHROPIC,
|
|
5252
|
+
ACP_TOOLS_GOOGLE,
|
|
5136
5253
|
ACP_TOOLS_OPENAI,
|
|
5137
5254
|
ACP_TOOLS_RESPONSES,
|
|
5138
5255
|
ACP_TOOL_NAMES,
|
|
@@ -5140,10 +5257,12 @@ export {
|
|
|
5140
5257
|
BoundaryNotFoundError,
|
|
5141
5258
|
COMPRESS_PHILOSOPHY,
|
|
5142
5259
|
COMPRESS_TOOL,
|
|
5260
|
+
COMPRESS_TOOL_GOOGLE,
|
|
5143
5261
|
COMPRESS_TOOL_NAME,
|
|
5144
5262
|
COMPRESS_TOOL_OPENAI,
|
|
5145
5263
|
COMPRESS_TOOL_RESPONSES,
|
|
5146
5264
|
DECOMPRESS_TOOL,
|
|
5265
|
+
DECOMPRESS_TOOL_GOOGLE,
|
|
5147
5266
|
DECOMPRESS_TOOL_NAME,
|
|
5148
5267
|
DECOMPRESS_TOOL_OPENAI,
|
|
5149
5268
|
DECOMPRESS_TOOL_RESPONSES,
|
|
@@ -5153,6 +5272,7 @@ export {
|
|
|
5153
5272
|
HOW_TO_COMPRESS_RULES,
|
|
5154
5273
|
LEAN_HOW_TO_COMPRESS,
|
|
5155
5274
|
SEARCH_CONTEXT_TOOL,
|
|
5275
|
+
SEARCH_CONTEXT_TOOL_GOOGLE,
|
|
5156
5276
|
SEARCH_CONTEXT_TOOL_NAME,
|
|
5157
5277
|
SEARCH_CONTEXT_TOOL_OPENAI,
|
|
5158
5278
|
SEARCH_CONTEXT_TOOL_RESPONSES,
|