@google/gemini-cli-a2a-server 0.51.0-nightly.20260707.g15a9429b6 → 0.51.0-preview.0
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/a2a-server.mjs +82 -17
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -216165,8 +216165,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
216165
216165
|
var init_git_commit = __esm({
|
|
216166
216166
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
216167
216167
|
"use strict";
|
|
216168
|
-
GIT_COMMIT_INFO = "
|
|
216169
|
-
CLI_VERSION = "0.51.0-
|
|
216168
|
+
GIT_COMMIT_INFO = "27a3da3e8";
|
|
216169
|
+
CLI_VERSION = "0.51.0-preview.0";
|
|
216170
216170
|
}
|
|
216171
216171
|
});
|
|
216172
216172
|
|
|
@@ -326084,7 +326084,7 @@ function getVersion() {
|
|
|
326084
326084
|
}
|
|
326085
326085
|
versionPromise = (async () => {
|
|
326086
326086
|
const pkgJson = await getPackageJson(__dirname4);
|
|
326087
|
-
return "0.51.0-
|
|
326087
|
+
return "0.51.0-preview.0";
|
|
326088
326088
|
})();
|
|
326089
326089
|
return versionPromise;
|
|
326090
326090
|
}
|
|
@@ -355159,24 +355159,49 @@ function hardenHistory(history, options = {}) {
|
|
|
355159
355159
|
if (history.length === 0)
|
|
355160
355160
|
return history;
|
|
355161
355161
|
const sentinels = { ...DEFAULT_SENTINELS, ...options.sentinels };
|
|
355162
|
-
|
|
355162
|
+
const processed = stripThoughts(history);
|
|
355163
|
+
let coalesced = coalesce(processed);
|
|
355163
355164
|
coalesced = pairToolsAndEnforceSignatures(coalesced, sentinels);
|
|
355164
355165
|
coalesced = refineToolResponses(coalesced);
|
|
355165
355166
|
let final = enforceRoleConstraints(coalesced, sentinels);
|
|
355166
355167
|
final = scrubHistory(final);
|
|
355167
355168
|
return final;
|
|
355168
355169
|
}
|
|
355170
|
+
function isInternalThought(part) {
|
|
355171
|
+
return !!part && !!part.thought;
|
|
355172
|
+
}
|
|
355173
|
+
function stripThoughts(history) {
|
|
355174
|
+
return history.map((turn) => {
|
|
355175
|
+
if (!turn.content.parts)
|
|
355176
|
+
return turn;
|
|
355177
|
+
const hasThought = turn.content.parts.some(isInternalThought);
|
|
355178
|
+
if (!hasThought)
|
|
355179
|
+
return turn;
|
|
355180
|
+
const nonThoughtParts = turn.content.parts.filter((p2) => p2 && !isInternalThought(p2));
|
|
355181
|
+
return {
|
|
355182
|
+
id: turn.id,
|
|
355183
|
+
content: {
|
|
355184
|
+
...turn.content,
|
|
355185
|
+
parts: nonThoughtParts
|
|
355186
|
+
}
|
|
355187
|
+
};
|
|
355188
|
+
});
|
|
355189
|
+
}
|
|
355169
355190
|
function coalesce(history) {
|
|
355170
355191
|
const result2 = [];
|
|
355171
355192
|
for (const turn of history) {
|
|
355172
355193
|
if (!turn.content.parts || turn.content.parts.length === 0)
|
|
355173
355194
|
continue;
|
|
355174
|
-
const
|
|
355195
|
+
const lastIdx = result2.length - 1;
|
|
355196
|
+
const last2 = result2[lastIdx];
|
|
355175
355197
|
if (last2 && last2.content.role === turn.content.role) {
|
|
355176
|
-
|
|
355177
|
-
|
|
355178
|
-
|
|
355179
|
-
|
|
355198
|
+
result2[lastIdx] = {
|
|
355199
|
+
id: last2.id,
|
|
355200
|
+
content: {
|
|
355201
|
+
...last2.content,
|
|
355202
|
+
parts: [...last2.content.parts || [], ...turn.content.parts || []]
|
|
355203
|
+
}
|
|
355204
|
+
};
|
|
355180
355205
|
} else {
|
|
355181
355206
|
result2.push({ id: turn.id, content: { ...turn.content } });
|
|
355182
355207
|
}
|
|
@@ -355354,16 +355379,56 @@ function enforceRoleConstraints(history, sentinels) {
|
|
|
355354
355379
|
return coalesce(result2);
|
|
355355
355380
|
}
|
|
355356
355381
|
function scrubHistory(history) {
|
|
355357
|
-
|
|
355358
|
-
|
|
355359
|
-
|
|
355360
|
-
|
|
355382
|
+
const result2 = [];
|
|
355383
|
+
for (const turn of history) {
|
|
355384
|
+
const nonThoughtParts = (turn.content.parts ?? []).filter((p2) => p2 && !isInternalThought(p2));
|
|
355385
|
+
if (nonThoughtParts.length === 0)
|
|
355386
|
+
continue;
|
|
355387
|
+
const scrubbedParts = nonThoughtParts.map((p2) => scrubPart(p2));
|
|
355388
|
+
const lastIdx = result2.length - 1;
|
|
355389
|
+
const last2 = result2[lastIdx];
|
|
355390
|
+
if (last2 && last2.content.role === turn.content.role) {
|
|
355391
|
+
result2[lastIdx] = {
|
|
355392
|
+
id: last2.id,
|
|
355393
|
+
content: {
|
|
355394
|
+
...last2.content,
|
|
355395
|
+
parts: [...last2.content.parts || [], ...scrubbedParts]
|
|
355396
|
+
}
|
|
355397
|
+
};
|
|
355398
|
+
} else {
|
|
355399
|
+
result2.push({
|
|
355400
|
+
id: turn.id,
|
|
355401
|
+
content: {
|
|
355402
|
+
role: turn.content.role,
|
|
355403
|
+
parts: scrubbedParts
|
|
355404
|
+
}
|
|
355405
|
+
});
|
|
355406
|
+
}
|
|
355407
|
+
}
|
|
355408
|
+
return result2;
|
|
355361
355409
|
}
|
|
355362
355410
|
function scrubContents(contents) {
|
|
355363
|
-
|
|
355364
|
-
|
|
355365
|
-
|
|
355366
|
-
|
|
355411
|
+
const result2 = [];
|
|
355412
|
+
for (const content of contents) {
|
|
355413
|
+
const nonThoughtParts = (content.parts ?? []).filter((p2) => p2 && !isInternalThought(p2));
|
|
355414
|
+
if (nonThoughtParts.length === 0)
|
|
355415
|
+
continue;
|
|
355416
|
+
const scrubbedParts = nonThoughtParts.map((p2) => scrubPart(p2));
|
|
355417
|
+
const lastIdx = result2.length - 1;
|
|
355418
|
+
const last2 = result2[lastIdx];
|
|
355419
|
+
if (last2 && last2.role === content.role) {
|
|
355420
|
+
result2[lastIdx] = {
|
|
355421
|
+
role: last2.role,
|
|
355422
|
+
parts: [...last2.parts || [], ...scrubbedParts]
|
|
355423
|
+
};
|
|
355424
|
+
} else {
|
|
355425
|
+
result2.push({
|
|
355426
|
+
role: content.role,
|
|
355427
|
+
parts: scrubbedParts
|
|
355428
|
+
});
|
|
355429
|
+
}
|
|
355430
|
+
}
|
|
355431
|
+
return result2;
|
|
355367
355432
|
}
|
|
355368
355433
|
function isThoughtPart(part) {
|
|
355369
355434
|
return "thoughtSignature" in part;
|