@google/gemini-cli-a2a-server 0.26.0-preview.3 → 0.26.0-preview.5

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.
@@ -103364,6 +103364,7 @@ var init_events = __esm({
103364
103364
  CoreEvent2["Output"] = "output";
103365
103365
  CoreEvent2["MemoryChanged"] = "memory-changed";
103366
103366
  CoreEvent2["ExternalEditorClosed"] = "external-editor-closed";
103367
+ CoreEvent2["McpClientUpdate"] = "mcp-client-update";
103367
103368
  CoreEvent2["SettingsChanged"] = "settings-changed";
103368
103369
  CoreEvent2["HookStart"] = "hook-start";
103369
103370
  CoreEvent2["HookEnd"] = "hook-end";
@@ -338807,12 +338808,18 @@ async function readPackageUp(options2) {
338807
338808
  }
338808
338809
 
338809
338810
  // packages/core/dist/src/utils/package.js
338811
+ init_debugLogger();
338810
338812
  async function getPackageJson(cwd) {
338811
- const result2 = await readPackageUp({ cwd });
338812
- 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);
338813
338821
  return void 0;
338814
338822
  }
338815
- return result2.packageJson;
338816
338823
  }
338817
338824
 
338818
338825
  // packages/core/dist/src/utils/channel.js
@@ -338852,7 +338859,7 @@ var __filename = fileURLToPath4(import.meta.url);
338852
338859
  var __dirname3 = path20.dirname(__filename);
338853
338860
  async function getVersion() {
338854
338861
  const pkgJson = await getPackageJson(__dirname3);
338855
- return "0.26.0-preview.3";
338862
+ return "0.26.0-preview.5";
338856
338863
  }
338857
338864
 
338858
338865
  // packages/core/dist/src/code_assist/experiments/client_metadata.js
@@ -341851,8 +341858,8 @@ var Float64Vector = import_vector.default.Float64Vector;
341851
341858
  var PointerVector = import_vector.default.PointerVector;
341852
341859
 
341853
341860
  // packages/core/dist/src/generated/git-commit.js
341854
- var GIT_COMMIT_INFO = "ee87c98f4";
341855
- var CLI_VERSION = "0.26.0-preview.3";
341861
+ var GIT_COMMIT_INFO = "31c6fef1e";
341862
+ var CLI_VERSION = "0.26.0-preview.5";
341856
341863
 
341857
341864
  // packages/core/dist/src/ide/detect-ide.js
341858
341865
  var IDE_DEFINITIONS = {
@@ -391651,6 +391658,8 @@ function createHookOutput(eventName, data) {
391651
391658
  return new BeforeToolSelectionHookOutput(data);
391652
391659
  case "BeforeTool":
391653
391660
  return new BeforeToolHookOutput(data);
391661
+ case "AfterAgent":
391662
+ return new AfterAgentHookOutput(data);
391654
391663
  default:
391655
391664
  return new DefaultHookOutput(data);
391656
391665
  }
@@ -391724,6 +391733,12 @@ var DefaultHookOutput = class {
391724
391733
  }
391725
391734
  return { blocked: false, reason: "" };
391726
391735
  }
391736
+ /**
391737
+ * Check if context clearing was requested by hook.
391738
+ */
391739
+ shouldClearContext() {
391740
+ return false;
391741
+ }
391727
391742
  };
391728
391743
  var BeforeToolHookOutput = class extends DefaultHookOutput {
391729
391744
  /**
@@ -391802,6 +391817,17 @@ var AfterModelHookOutput = class extends DefaultHookOutput {
391802
391817
  return void 0;
391803
391818
  }
391804
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
+ };
391805
391831
  var NotificationType;
391806
391832
  (function(NotificationType2) {
391807
391833
  NotificationType2["ToolPermission"] = "ToolPermission";
@@ -395872,25 +395898,36 @@ ${responseText}` : responseText;
395872
395898
  turn = yield* this.processTurn(request3, signal, prompt_id, boundedTurns, isInvalidStreamRetry);
395873
395899
  if (hooksEnabled && messageBus) {
395874
395900
  const hookOutput = await this.fireAfterAgentHookSafe(request3, prompt_id, turn);
395875
- if (hookOutput?.shouldStopExecution()) {
395901
+ const afterAgentOutput = hookOutput;
395902
+ if (afterAgentOutput?.shouldStopExecution()) {
395903
+ const contextCleared = afterAgentOutput.shouldClearContext();
395876
395904
  yield {
395877
395905
  type: GeminiEventType.AgentExecutionStopped,
395878
395906
  value: {
395879
- reason: hookOutput.getEffectiveReason(),
395880
- systemMessage: hookOutput.systemMessage
395907
+ reason: afterAgentOutput.getEffectiveReason(),
395908
+ systemMessage: afterAgentOutput.systemMessage,
395909
+ contextCleared
395881
395910
  }
395882
395911
  };
395912
+ if (contextCleared) {
395913
+ await this.resetChat();
395914
+ }
395883
395915
  return turn;
395884
395916
  }
395885
- if (hookOutput?.isBlockingDecision()) {
395886
- const continueReason = hookOutput.getEffectiveReason();
395917
+ if (afterAgentOutput?.isBlockingDecision()) {
395918
+ const continueReason = afterAgentOutput.getEffectiveReason();
395919
+ const contextCleared = afterAgentOutput.shouldClearContext();
395887
395920
  yield {
395888
395921
  type: GeminiEventType.AgentExecutionBlocked,
395889
395922
  value: {
395890
395923
  reason: continueReason,
395891
- systemMessage: hookOutput.systemMessage
395924
+ systemMessage: afterAgentOutput.systemMessage,
395925
+ contextCleared
395892
395926
  }
395893
395927
  };
395928
+ if (contextCleared) {
395929
+ await this.resetChat();
395930
+ }
395894
395931
  const continueRequest = [{ text: continueReason }];
395895
395932
  yield* this.sendMessageStream(continueRequest, signal, prompt_id, boundedTurns - 1);
395896
395933
  }
@@ -403059,10 +403096,17 @@ var HookAggregator = class {
403059
403096
  if (output.suppressOutput) {
403060
403097
  merged.suppressOutput = true;
403061
403098
  }
403099
+ if (output.hookSpecificOutput?.["clearContext"] === true) {
403100
+ merged.hookSpecificOutput = {
403101
+ ...merged.hookSpecificOutput || {},
403102
+ clearContext: true
403103
+ };
403104
+ }
403062
403105
  if (output.hookSpecificOutput) {
403106
+ const { clearContext: _clearContext, ...restSpecificOutput } = output.hookSpecificOutput;
403063
403107
  merged.hookSpecificOutput = {
403064
403108
  ...merged.hookSpecificOutput || {},
403065
- ...output.hookSpecificOutput
403109
+ ...restSpecificOutput
403066
403110
  };
403067
403111
  }
403068
403112
  this.extractAdditionalContext(output, additionalContexts);
@@ -403182,6 +403226,8 @@ var HookAggregator = class {
403182
403226
  return new BeforeToolSelectionHookOutput(output);
403183
403227
  case HookEventName.AfterModel:
403184
403228
  return new AfterModelHookOutput(output);
403229
+ case HookEventName.AfterAgent:
403230
+ return new AfterAgentHookOutput(output);
403185
403231
  default:
403186
403232
  return new DefaultHookOutput(output);
403187
403233
  }
@@ -413112,6 +413158,7 @@ var McpClientManager = class {
413112
413158
  if (currentPromise === this.discoveryPromise) {
413113
413159
  this.discoveryPromise = void 0;
413114
413160
  this.discoveryState = MCPDiscoveryState.COMPLETED;
413161
+ this.eventEmitter?.emit("mcp-client-update", this.clients);
413115
413162
  }
413116
413163
  }).catch(() => {
413117
413164
  });
@@ -413134,6 +413181,11 @@ var McpClientManager = class {
413134
413181
  return;
413135
413182
  }
413136
413183
  const servers = populateMcpServerCommand(this.cliConfig.getMcpServers() || {}, this.cliConfig.getMcpServerCommand());
413184
+ if (Object.keys(servers).length === 0) {
413185
+ this.discoveryState = MCPDiscoveryState.COMPLETED;
413186
+ this.eventEmitter?.emit("mcp-client-update", this.clients);
413187
+ return;
413188
+ }
413137
413189
  this.eventEmitter?.emit("mcp-client-update", this.clients);
413138
413190
  await Promise.all(Object.entries(servers).map(([name4, config3]) => this.maybeDiscoverMcpServer(name4, config3)));
413139
413191
  await this.cliConfig.refreshMcpContext();
@@ -413428,7 +413480,7 @@ var Config = class {
413428
413480
  this.disableLLMCorrection = params.disableLLMCorrection ?? false;
413429
413481
  this.planEnabled = params.plan ?? false;
413430
413482
  this.enableEventDrivenScheduler = params.enableEventDrivenScheduler ?? false;
413431
- this.skillsSupport = params.skillsSupport ?? false;
413483
+ this.skillsSupport = params.skillsSupport ?? true;
413432
413484
  this.disabledSkills = params.disabledSkills ?? [];
413433
413485
  this.adminSkillsEnabled = params.adminSkillsEnabled ?? true;
413434
413486
  this.modelAvailabilityService = new ModelAvailabilityService();
@@ -414915,6 +414967,9 @@ function parseAndFormatApiError(error2, authType, userTier, currentModel, fallba
414915
414967
  init_debugLogger();
414916
414968
  init_events();
414917
414969
 
414970
+ // packages/core/dist/src/utils/constants.js
414971
+ var REFERENCE_CONTENT_END = "--- End of content ---";
414972
+
414918
414973
  // packages/core/dist/src/services/sessionSummaryService.js
414919
414974
  init_debugLogger();
414920
414975
 
@@ -414934,6 +414989,8 @@ init_memoryTool();
414934
414989
  init_tools();
414935
414990
  init_tool_error();
414936
414991
  init_tool_names();
414992
+ var DEFAULT_OUTPUT_TERMINATOR = `
414993
+ ${REFERENCE_CONTENT_END}`;
414937
414994
 
414938
414995
  // packages/core/dist/src/utils/session.js
414939
414996
  import { randomUUID as randomUUID8 } from "node:crypto";