@google/gemini-cli-a2a-server 0.51.0-nightly.20260706.gf7af4e518 → 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.
@@ -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 = "f7af4e518";
216169
- CLI_VERSION = "0.51.0-nightly.20260706.gf7af4e518";
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-nightly.20260706.gf7af4e518";
326087
+ return "0.51.0-preview.0";
326088
326088
  })();
326089
326089
  return versionPromise;
326090
326090
  }
@@ -329466,7 +329466,9 @@ async function getCorrectedFileContent(config3, filePath, proposedContent, abort
329466
329466
  return { originalContent, correctedContent, fileExists: fileExists2, error: error2 };
329467
329467
  }
329468
329468
  }
329469
- const aggressiveUnescape = !isGemini3Model(config3.getActiveModel());
329469
+ const activeModel = config3.getActiveModel();
329470
+ const resolvedModel = resolveModel(activeModel, false, false, true, config3);
329471
+ const aggressiveUnescape = !isGemini3Model(resolvedModel, config3) && !isGemini2Model(resolvedModel) && !isCustomModel(resolvedModel, config3);
329470
329472
  correctedContent = await ensureCorrectFileContent(proposedContent, config3.getBaseLlmClient(), abortSignal, config3.getDisableLLMCorrection(), aggressiveUnescape);
329471
329473
  return { originalContent, correctedContent, fileExists: fileExists2 };
329472
329474
  }
@@ -355157,24 +355159,49 @@ function hardenHistory(history, options = {}) {
355157
355159
  if (history.length === 0)
355158
355160
  return history;
355159
355161
  const sentinels = { ...DEFAULT_SENTINELS, ...options.sentinels };
355160
- let coalesced = coalesce(history);
355162
+ const processed = stripThoughts(history);
355163
+ let coalesced = coalesce(processed);
355161
355164
  coalesced = pairToolsAndEnforceSignatures(coalesced, sentinels);
355162
355165
  coalesced = refineToolResponses(coalesced);
355163
355166
  let final = enforceRoleConstraints(coalesced, sentinels);
355164
355167
  final = scrubHistory(final);
355165
355168
  return final;
355166
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
+ }
355167
355190
  function coalesce(history) {
355168
355191
  const result2 = [];
355169
355192
  for (const turn of history) {
355170
355193
  if (!turn.content.parts || turn.content.parts.length === 0)
355171
355194
  continue;
355172
- const last2 = result2[result2.length - 1];
355195
+ const lastIdx = result2.length - 1;
355196
+ const last2 = result2[lastIdx];
355173
355197
  if (last2 && last2.content.role === turn.content.role) {
355174
- last2.content.parts = [
355175
- ...last2.content.parts || [],
355176
- ...turn.content.parts || []
355177
- ];
355198
+ result2[lastIdx] = {
355199
+ id: last2.id,
355200
+ content: {
355201
+ ...last2.content,
355202
+ parts: [...last2.content.parts || [], ...turn.content.parts || []]
355203
+ }
355204
+ };
355178
355205
  } else {
355179
355206
  result2.push({ id: turn.id, content: { ...turn.content } });
355180
355207
  }
@@ -355352,16 +355379,56 @@ function enforceRoleConstraints(history, sentinels) {
355352
355379
  return coalesce(result2);
355353
355380
  }
355354
355381
  function scrubHistory(history) {
355355
- return history.map((turn) => ({
355356
- id: turn.id,
355357
- content: scrubContents([turn.content])[0]
355358
- }));
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;
355359
355409
  }
355360
355410
  function scrubContents(contents) {
355361
- return contents.map((content) => ({
355362
- role: content.role,
355363
- parts: (content.parts || []).map((p2) => scrubPart(p2))
355364
- }));
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;
355365
355432
  }
355366
355433
  function isThoughtPart(part) {
355367
355434
  return "thoughtSignature" in part;