@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.
@@ -114,6 +114,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
114
114
  private getParseScreenText;
115
115
  private shouldReadTerminalScreenSnapshot;
116
116
  private resetTerminalScreen;
117
+ private getAccumulatedRawBufferCacheKey;
117
118
  private getFreshParsedStatusCache;
118
119
  private providerOwnsTranscript;
119
120
  private shouldUseFullProviderTranscriptContext;
package/dist/index.js CHANGED
@@ -2930,9 +2930,13 @@ ${lastSnapshot}`;
2930
2930
  this.lastScreenChangeAt = 0;
2931
2931
  this.lastScreenSnapshotReadAt = Number.NEGATIVE_INFINITY;
2932
2932
  }
2933
+ getAccumulatedRawBufferCacheKey() {
2934
+ return this.accumulatedRawBuffer.replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[P^_X][\s\S]*?(?:\x07|\x1B\\)/g, "").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
2935
+ }
2933
2936
  getFreshParsedStatusCache() {
2934
2937
  const cached = this.parsedStatusCache;
2935
- 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) {
2938
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
2939
+ 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) {
2936
2940
  return cached.result;
2937
2941
  }
2938
2942
  return null;
@@ -4024,7 +4028,8 @@ ${lastSnapshot}`;
4024
4028
  const screenText = this.readTerminalScreenText();
4025
4029
  const parseScreenText = this.getParseScreenText(screenText);
4026
4030
  const cached = this.parsedStatusCache;
4027
- 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) {
4031
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
4032
+ 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) {
4028
4033
  return cached.result;
4029
4034
  }
4030
4035
  const parsed = this.runParseSession();
@@ -4052,7 +4057,7 @@ ${lastSnapshot}`;
4052
4057
  currentTurnScope: this.currentTurnScope,
4053
4058
  recentOutputBuffer: this.recentOutputBuffer,
4054
4059
  accumulatedBuffer: this.accumulatedBuffer,
4055
- accumulatedRawBuffer: this.accumulatedRawBuffer,
4060
+ accumulatedRawBufferKey,
4056
4061
  screenText: parseScreenText,
4057
4062
  currentStatus: this.currentStatus,
4058
4063
  activeModal: this.activeModal,
@@ -23006,6 +23011,34 @@ function loadHermesCoordinatorBaseConfig(targetConfigPath) {
23006
23011
  const { mcp_servers: _mcpServers, ...baseConfig } = parsed;
23007
23012
  return { config: baseConfig, sourceHome, sourceConfigPath };
23008
23013
  }
23014
+ function stripHermesCoordinatorTempModelProviderOverrides(config) {
23015
+ const {
23016
+ model: _model,
23017
+ provider: _provider,
23018
+ default_model: _defaultModel,
23019
+ defaultProvider: _defaultProvider,
23020
+ default_provider: _defaultProviderSnake,
23021
+ modelProvider: _modelProvider,
23022
+ model_provider: _modelProviderSnake,
23023
+ ...sanitized
23024
+ } = config;
23025
+ const delegation = sanitized.delegation;
23026
+ if (delegation && typeof delegation === "object" && !Array.isArray(delegation)) {
23027
+ const {
23028
+ model: _delegationModel,
23029
+ provider: _delegationProvider,
23030
+ modelProvider: _delegationModelProvider,
23031
+ model_provider: _delegationModelProviderSnake,
23032
+ ...delegationRest
23033
+ } = delegation;
23034
+ if (Object.keys(delegationRest).length > 0) {
23035
+ sanitized.delegation = delegationRest;
23036
+ } else {
23037
+ delete sanitized.delegation;
23038
+ }
23039
+ }
23040
+ return sanitized;
23041
+ }
23009
23042
  function copyHermesCoordinatorCredentialFiles(sourceHome, targetHome) {
23010
23043
  if ((0, import_path6.resolve)(sourceHome) === (0, import_path6.resolve)(targetHome)) return;
23011
23044
  for (const fileName of [".env", "auth.json"]) {
@@ -24529,7 +24562,8 @@ ${block}`);
24529
24562
  if (hadExistingMcpConfig) {
24530
24563
  try {
24531
24564
  const parsedExistingMcpConfig = parseMeshCoordinatorMcpConfig(readFileSync17(mcpConfigPath, "utf-8"), configFormat);
24532
- existingMcpConfig = { ...existingMcpConfig, ...parsedExistingMcpConfig };
24565
+ const existingCoordinatorConfig = hermesManualFallback ? stripHermesCoordinatorTempModelProviderOverrides(parsedExistingMcpConfig) : parsedExistingMcpConfig;
24566
+ existingMcpConfig = { ...existingMcpConfig, ...existingCoordinatorConfig };
24533
24567
  copyFileSync4(mcpConfigPath, mcpConfigPath + ".backup");
24534
24568
  } catch (error) {
24535
24569
  LOG.error("MeshCoordinator", `Failed to parse existing MCP config ${mcpConfigPath}: ${error?.message || error}`);