@google/gemini-cli-a2a-server 0.26.0-preview.4 → 0.26.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.
@@ -338808,12 +338808,18 @@ async function readPackageUp(options2) {
338808
338808
  }
338809
338809
 
338810
338810
  // packages/core/dist/src/utils/package.js
338811
+ init_debugLogger();
338811
338812
  async function getPackageJson(cwd) {
338812
- const result2 = await readPackageUp({ cwd });
338813
- if (!result2) {
338813
+ try {
338814
+ const result2 = await readPackageUp({ cwd, normalize: false });
338815
+ if (!result2) {
338816
+ return void 0;
338817
+ }
338818
+ return result2.packageJson;
338819
+ } catch (error2) {
338820
+ debugLogger.error("Error occurred while reading package.json", error2);
338814
338821
  return void 0;
338815
338822
  }
338816
- return result2.packageJson;
338817
338823
  }
338818
338824
 
338819
338825
  // packages/core/dist/src/utils/channel.js
@@ -338853,7 +338859,7 @@ var __filename = fileURLToPath4(import.meta.url);
338853
338859
  var __dirname3 = path20.dirname(__filename);
338854
338860
  async function getVersion() {
338855
338861
  const pkgJson = await getPackageJson(__dirname3);
338856
- return "0.26.0-preview.4";
338862
+ return "0.26.0";
338857
338863
  }
338858
338864
 
338859
338865
  // packages/core/dist/src/code_assist/experiments/client_metadata.js
@@ -341852,8 +341858,8 @@ var Float64Vector = import_vector.default.Float64Vector;
341852
341858
  var PointerVector = import_vector.default.PointerVector;
341853
341859
 
341854
341860
  // packages/core/dist/src/generated/git-commit.js
341855
- var GIT_COMMIT_INFO = "cebe386d7";
341856
- var CLI_VERSION = "0.26.0-preview.4";
341861
+ var GIT_COMMIT_INFO = "a380b4219";
341862
+ var CLI_VERSION = "0.26.0";
341857
341863
 
341858
341864
  // packages/core/dist/src/ide/detect-ide.js
341859
341865
  var IDE_DEFINITIONS = {
@@ -391652,6 +391658,8 @@ function createHookOutput(eventName, data) {
391652
391658
  return new BeforeToolSelectionHookOutput(data);
391653
391659
  case "BeforeTool":
391654
391660
  return new BeforeToolHookOutput(data);
391661
+ case "AfterAgent":
391662
+ return new AfterAgentHookOutput(data);
391655
391663
  default:
391656
391664
  return new DefaultHookOutput(data);
391657
391665
  }
@@ -391725,6 +391733,12 @@ var DefaultHookOutput = class {
391725
391733
  }
391726
391734
  return { blocked: false, reason: "" };
391727
391735
  }
391736
+ /**
391737
+ * Check if context clearing was requested by hook.
391738
+ */
391739
+ shouldClearContext() {
391740
+ return false;
391741
+ }
391728
391742
  };
391729
391743
  var BeforeToolHookOutput = class extends DefaultHookOutput {
391730
391744
  /**
@@ -391803,6 +391817,17 @@ var AfterModelHookOutput = class extends DefaultHookOutput {
391803
391817
  return void 0;
391804
391818
  }
391805
391819
  };
391820
+ var AfterAgentHookOutput = class extends DefaultHookOutput {
391821
+ /**
391822
+ * Check if context clearing was requested by hook
391823
+ */
391824
+ shouldClearContext() {
391825
+ if (this.hookSpecificOutput && "clearContext" in this.hookSpecificOutput) {
391826
+ return this.hookSpecificOutput["clearContext"] === true;
391827
+ }
391828
+ return false;
391829
+ }
391830
+ };
391806
391831
  var NotificationType;
391807
391832
  (function(NotificationType2) {
391808
391833
  NotificationType2["ToolPermission"] = "ToolPermission";
@@ -395873,25 +395898,36 @@ ${responseText}` : responseText;
395873
395898
  turn = yield* this.processTurn(request3, signal, prompt_id, boundedTurns, isInvalidStreamRetry);
395874
395899
  if (hooksEnabled && messageBus) {
395875
395900
  const hookOutput = await this.fireAfterAgentHookSafe(request3, prompt_id, turn);
395876
- if (hookOutput?.shouldStopExecution()) {
395901
+ const afterAgentOutput = hookOutput;
395902
+ if (afterAgentOutput?.shouldStopExecution()) {
395903
+ const contextCleared = afterAgentOutput.shouldClearContext();
395877
395904
  yield {
395878
395905
  type: GeminiEventType.AgentExecutionStopped,
395879
395906
  value: {
395880
- reason: hookOutput.getEffectiveReason(),
395881
- systemMessage: hookOutput.systemMessage
395907
+ reason: afterAgentOutput.getEffectiveReason(),
395908
+ systemMessage: afterAgentOutput.systemMessage,
395909
+ contextCleared
395882
395910
  }
395883
395911
  };
395912
+ if (contextCleared) {
395913
+ await this.resetChat();
395914
+ }
395884
395915
  return turn;
395885
395916
  }
395886
- if (hookOutput?.isBlockingDecision()) {
395887
- const continueReason = hookOutput.getEffectiveReason();
395917
+ if (afterAgentOutput?.isBlockingDecision()) {
395918
+ const continueReason = afterAgentOutput.getEffectiveReason();
395919
+ const contextCleared = afterAgentOutput.shouldClearContext();
395888
395920
  yield {
395889
395921
  type: GeminiEventType.AgentExecutionBlocked,
395890
395922
  value: {
395891
395923
  reason: continueReason,
395892
- systemMessage: hookOutput.systemMessage
395924
+ systemMessage: afterAgentOutput.systemMessage,
395925
+ contextCleared
395893
395926
  }
395894
395927
  };
395928
+ if (contextCleared) {
395929
+ await this.resetChat();
395930
+ }
395895
395931
  const continueRequest = [{ text: continueReason }];
395896
395932
  yield* this.sendMessageStream(continueRequest, signal, prompt_id, boundedTurns - 1);
395897
395933
  }
@@ -403060,10 +403096,17 @@ var HookAggregator = class {
403060
403096
  if (output.suppressOutput) {
403061
403097
  merged.suppressOutput = true;
403062
403098
  }
403099
+ if (output.hookSpecificOutput?.["clearContext"] === true) {
403100
+ merged.hookSpecificOutput = {
403101
+ ...merged.hookSpecificOutput || {},
403102
+ clearContext: true
403103
+ };
403104
+ }
403063
403105
  if (output.hookSpecificOutput) {
403106
+ const { clearContext: _clearContext, ...restSpecificOutput } = output.hookSpecificOutput;
403064
403107
  merged.hookSpecificOutput = {
403065
403108
  ...merged.hookSpecificOutput || {},
403066
- ...output.hookSpecificOutput
403109
+ ...restSpecificOutput
403067
403110
  };
403068
403111
  }
403069
403112
  this.extractAdditionalContext(output, additionalContexts);
@@ -403183,6 +403226,8 @@ var HookAggregator = class {
403183
403226
  return new BeforeToolSelectionHookOutput(output);
403184
403227
  case HookEventName.AfterModel:
403185
403228
  return new AfterModelHookOutput(output);
403229
+ case HookEventName.AfterAgent:
403230
+ return new AfterAgentHookOutput(output);
403186
403231
  default:
403187
403232
  return new DefaultHookOutput(output);
403188
403233
  }
@@ -413435,7 +413480,7 @@ var Config = class {
413435
413480
  this.disableLLMCorrection = params.disableLLMCorrection ?? false;
413436
413481
  this.planEnabled = params.plan ?? false;
413437
413482
  this.enableEventDrivenScheduler = params.enableEventDrivenScheduler ?? false;
413438
- this.skillsSupport = params.skillsSupport ?? false;
413483
+ this.skillsSupport = params.skillsSupport ?? true;
413439
413484
  this.disabledSkills = params.disabledSkills ?? [];
413440
413485
  this.adminSkillsEnabled = params.adminSkillsEnabled ?? true;
413441
413486
  this.modelAvailabilityService = new ModelAvailabilityService();
@@ -414922,6 +414967,9 @@ function parseAndFormatApiError(error2, authType, userTier, currentModel, fallba
414922
414967
  init_debugLogger();
414923
414968
  init_events();
414924
414969
 
414970
+ // packages/core/dist/src/utils/constants.js
414971
+ var REFERENCE_CONTENT_END = "--- End of content ---";
414972
+
414925
414973
  // packages/core/dist/src/services/sessionSummaryService.js
414926
414974
  init_debugLogger();
414927
414975
 
@@ -414941,6 +414989,8 @@ init_memoryTool();
414941
414989
  init_tools();
414942
414990
  init_tool_error();
414943
414991
  init_tool_names();
414992
+ var DEFAULT_OUTPUT_TERMINATOR = `
414993
+ ${REFERENCE_CONTENT_END}`;
414944
414994
 
414945
414995
  // packages/core/dist/src/utils/session.js
414946
414996
  import { randomUUID as randomUUID8 } from "node:crypto";