@adhdev/daemon-standalone 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.js CHANGED
@@ -25051,9 +25051,13 @@ ${lastSnapshot}`;
25051
25051
  this.lastScreenChangeAt = 0;
25052
25052
  this.lastScreenSnapshotReadAt = Number.NEGATIVE_INFINITY;
25053
25053
  }
25054
+ getAccumulatedRawBufferCacheKey() {
25055
+ return this.accumulatedRawBuffer.replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[P^_X][\s\S]*?(?:\x07|\x1B\\)/g, "").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
25056
+ }
25054
25057
  getFreshParsedStatusCache() {
25055
25058
  const cached2 = this.parsedStatusCache;
25056
- if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.accumulatedRawBuffer === this.accumulatedRawBuffer && cached2.screenText === this.lastScreenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName) {
25059
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
25060
+ if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.accumulatedRawBufferKey === accumulatedRawBufferKey && cached2.screenText === this.lastScreenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName) {
25057
25061
  return cached2.result;
25058
25062
  }
25059
25063
  return null;
@@ -26145,7 +26149,8 @@ ${lastSnapshot}`;
26145
26149
  const screenText = this.readTerminalScreenText();
26146
26150
  const parseScreenText = this.getParseScreenText(screenText);
26147
26151
  const cached2 = this.parsedStatusCache;
26148
- if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.accumulatedRawBuffer === this.accumulatedRawBuffer && cached2.screenText === parseScreenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName) {
26152
+ const accumulatedRawBufferKey = this.getAccumulatedRawBufferCacheKey();
26153
+ if (cached2 && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.accumulatedRawBufferKey === accumulatedRawBufferKey && cached2.screenText === parseScreenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName) {
26149
26154
  return cached2.result;
26150
26155
  }
26151
26156
  const parsed = this.runParseSession();
@@ -26173,7 +26178,7 @@ ${lastSnapshot}`;
26173
26178
  currentTurnScope: this.currentTurnScope,
26174
26179
  recentOutputBuffer: this.recentOutputBuffer,
26175
26180
  accumulatedBuffer: this.accumulatedBuffer,
26176
- accumulatedRawBuffer: this.accumulatedRawBuffer,
26181
+ accumulatedRawBufferKey,
26177
26182
  screenText: parseScreenText,
26178
26183
  currentStatus: this.currentStatus,
26179
26184
  activeModal: this.activeModal,
@@ -44955,6 +44960,34 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
44955
44960
  const { mcp_servers: _mcpServers, ...baseConfig } = parsed;
44956
44961
  return { config: baseConfig, sourceHome, sourceConfigPath };
44957
44962
  }
44963
+ function stripHermesCoordinatorTempModelProviderOverrides(config2) {
44964
+ const {
44965
+ model: _model,
44966
+ provider: _provider,
44967
+ default_model: _defaultModel,
44968
+ defaultProvider: _defaultProvider,
44969
+ default_provider: _defaultProviderSnake,
44970
+ modelProvider: _modelProvider,
44971
+ model_provider: _modelProviderSnake,
44972
+ ...sanitized
44973
+ } = config2;
44974
+ const delegation = sanitized.delegation;
44975
+ if (delegation && typeof delegation === "object" && !Array.isArray(delegation)) {
44976
+ const {
44977
+ model: _delegationModel,
44978
+ provider: _delegationProvider,
44979
+ modelProvider: _delegationModelProvider,
44980
+ model_provider: _delegationModelProviderSnake,
44981
+ ...delegationRest
44982
+ } = delegation;
44983
+ if (Object.keys(delegationRest).length > 0) {
44984
+ sanitized.delegation = delegationRest;
44985
+ } else {
44986
+ delete sanitized.delegation;
44987
+ }
44988
+ }
44989
+ return sanitized;
44990
+ }
44958
44991
  function copyHermesCoordinatorCredentialFiles(sourceHome, targetHome) {
44959
44992
  if ((0, import_path6.resolve)(sourceHome) === (0, import_path6.resolve)(targetHome)) return;
44960
44993
  for (const fileName of [".env", "auth.json"]) {
@@ -46478,7 +46511,8 @@ ${block}`);
46478
46511
  if (hadExistingMcpConfig) {
46479
46512
  try {
46480
46513
  const parsedExistingMcpConfig = parseMeshCoordinatorMcpConfig(readFileSync17(mcpConfigPath, "utf-8"), configFormat);
46481
- existingMcpConfig = { ...existingMcpConfig, ...parsedExistingMcpConfig };
46514
+ const existingCoordinatorConfig = hermesManualFallback ? stripHermesCoordinatorTempModelProviderOverrides(parsedExistingMcpConfig) : parsedExistingMcpConfig;
46515
+ existingMcpConfig = { ...existingMcpConfig, ...existingCoordinatorConfig };
46482
46516
  copyFileSync4(mcpConfigPath, mcpConfigPath + ".backup");
46483
46517
  } catch (error48) {
46484
46518
  LOG2.error("MeshCoordinator", `Failed to parse existing MCP config ${mcpConfigPath}: ${error48?.message || error48}`);