@adhdev/daemon-core 0.9.77-rc.40 → 0.9.77-rc.41

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/index.mjs CHANGED
@@ -2926,9 +2926,13 @@ ${lastSnapshot}`;
2926
2926
  this.lastScreenChangeAt = 0;
2927
2927
  this.lastScreenSnapshotReadAt = Number.NEGATIVE_INFINITY;
2928
2928
  }
2929
+ getAccumulatedRawBufferCacheKey() {
2930
+ return this.accumulatedRawBuffer.replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[P^_X][\s\S]*?(?:\x07|\x1B\\)/g, "").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
2931
+ }
2929
2932
  getFreshParsedStatusCache() {
2930
2933
  const cached = this.parsedStatusCache;
2931
- if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBuffer === this.accumulatedRawBuffer && cached.screenText === this.lastScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
2934
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
2935
+ if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBufferKey === accumulatedRawBufferKey && cached.screenText === this.lastScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
2932
2936
  return cached.result;
2933
2937
  }
2934
2938
  return null;
@@ -4020,7 +4024,8 @@ ${lastSnapshot}`;
4020
4024
  const screenText = this.readTerminalScreenText();
4021
4025
  const parseScreenText = this.getParseScreenText(screenText);
4022
4026
  const cached = this.parsedStatusCache;
4023
- if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBuffer === this.accumulatedRawBuffer && cached.screenText === parseScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
4027
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
4028
+ if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBufferKey === accumulatedRawBufferKey && cached.screenText === parseScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
4024
4029
  return cached.result;
4025
4030
  }
4026
4031
  const parsed = this.runParseSession();
@@ -4048,7 +4053,7 @@ ${lastSnapshot}`;
4048
4053
  currentTurnScope: this.currentTurnScope,
4049
4054
  recentOutputBuffer: this.recentOutputBuffer,
4050
4055
  accumulatedBuffer: this.accumulatedBuffer,
4051
- accumulatedRawBuffer: this.accumulatedRawBuffer,
4056
+ accumulatedRawBufferKey,
4052
4057
  screenText: parseScreenText,
4053
4058
  currentStatus: this.currentStatus,
4054
4059
  activeModal: this.activeModal,
@@ -22786,6 +22791,34 @@ function loadHermesCoordinatorBaseConfig(targetConfigPath) {
22786
22791
  const { mcp_servers: _mcpServers, ...baseConfig } = parsed;
22787
22792
  return { config: baseConfig, sourceHome, sourceConfigPath };
22788
22793
  }
22794
+ function stripHermesCoordinatorTempModelProviderOverrides(config) {
22795
+ const {
22796
+ model: _model,
22797
+ provider: _provider,
22798
+ default_model: _defaultModel,
22799
+ defaultProvider: _defaultProvider,
22800
+ default_provider: _defaultProviderSnake,
22801
+ modelProvider: _modelProvider,
22802
+ model_provider: _modelProviderSnake,
22803
+ ...sanitized
22804
+ } = config;
22805
+ const delegation = sanitized.delegation;
22806
+ if (delegation && typeof delegation === "object" && !Array.isArray(delegation)) {
22807
+ const {
22808
+ model: _delegationModel,
22809
+ provider: _delegationProvider,
22810
+ modelProvider: _delegationModelProvider,
22811
+ model_provider: _delegationModelProviderSnake,
22812
+ ...delegationRest
22813
+ } = delegation;
22814
+ if (Object.keys(delegationRest).length > 0) {
22815
+ sanitized.delegation = delegationRest;
22816
+ } else {
22817
+ delete sanitized.delegation;
22818
+ }
22819
+ }
22820
+ return sanitized;
22821
+ }
22789
22822
  function copyHermesCoordinatorCredentialFiles(sourceHome, targetHome) {
22790
22823
  if (pathResolve(sourceHome) === pathResolve(targetHome)) return;
22791
22824
  for (const fileName of [".env", "auth.json"]) {
@@ -24309,7 +24342,8 @@ ${block}`);
24309
24342
  if (hadExistingMcpConfig) {
24310
24343
  try {
24311
24344
  const parsedExistingMcpConfig = parseMeshCoordinatorMcpConfig(readFileSync17(mcpConfigPath, "utf-8"), configFormat);
24312
- existingMcpConfig = { ...existingMcpConfig, ...parsedExistingMcpConfig };
24345
+ const existingCoordinatorConfig = hermesManualFallback ? stripHermesCoordinatorTempModelProviderOverrides(parsedExistingMcpConfig) : parsedExistingMcpConfig;
24346
+ existingMcpConfig = { ...existingMcpConfig, ...existingCoordinatorConfig };
24313
24347
  copyFileSync4(mcpConfigPath, mcpConfigPath + ".backup");
24314
24348
  } catch (error) {
24315
24349
  LOG.error("MeshCoordinator", `Failed to parse existing MCP config ${mcpConfigPath}: ${error?.message || error}`);