@lesliechan721/aw 0.1.0-beta.61 → 0.1.0-beta.63

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.
Files changed (72) hide show
  1. package/dist/authoring/scripts/validate-plugin.mjs +56 -9
  2. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  3. package/dist/scripts/aw-skill-eval-materializer.js +3 -0
  4. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  5. package/dist/scripts/test-plugin-scripts.js +20 -1
  6. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  7. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  8. package/dist/src/commands/aw-capabilities.js +1 -0
  9. package/dist/src/commands/aw-capabilities.js.map +1 -1
  10. package/dist/src/commands/rebuild-command.js +25 -26
  11. package/dist/src/commands/rebuild-command.js.map +1 -1
  12. package/dist/src/commands/rebuild-integration.d.ts +2 -0
  13. package/dist/src/commands/rebuild-integration.js +23 -7
  14. package/dist/src/commands/rebuild-integration.js.map +1 -1
  15. package/dist/src/commands/review-inspection.js +38 -5
  16. package/dist/src/commands/review-inspection.js.map +1 -1
  17. package/dist/src/commands/review-preparation.js +1 -0
  18. package/dist/src/commands/review-preparation.js.map +1 -1
  19. package/dist/src/portable/materializer.js +3 -0
  20. package/dist/src/portable/materializer.js.map +1 -1
  21. package/dist/src/review/review-profile.d.ts +1 -0
  22. package/dist/src/review/review-profile.js +44 -8
  23. package/dist/src/review/review-profile.js.map +1 -1
  24. package/dist/src/review/review-selection.js +19 -6
  25. package/dist/src/review/review-selection.js.map +1 -1
  26. package/dist/src/review/skill-materialization.d.ts +1 -0
  27. package/dist/src/review/skill-materialization.js +2 -0
  28. package/dist/src/review/skill-materialization.js.map +1 -1
  29. package/dist/src/review/source-binding.d.ts +5 -0
  30. package/dist/src/review/source-binding.js +83 -22
  31. package/dist/src/review/source-binding.js.map +1 -1
  32. package/dist/src/tui/config-leaf-editor.d.ts +24 -0
  33. package/dist/src/tui/config-leaf-editor.js +19 -7
  34. package/dist/src/tui/config-leaf-editor.js.map +1 -1
  35. package/dist/src/tui/config-references.d.ts +1 -0
  36. package/dist/src/tui/config-references.js +8 -1
  37. package/dist/src/tui/config-references.js.map +1 -1
  38. package/dist/src/tui/console-app-v4.js +96 -27
  39. package/dist/src/tui/console-app-v4.js.map +1 -1
  40. package/dist/src/tui/controller-runtime.d.ts +1 -1
  41. package/dist/src/tui/controller-runtime.js +119 -91
  42. package/dist/src/tui/controller-runtime.js.map +1 -1
  43. package/dist/src/tui/controller.d.ts +3 -0
  44. package/dist/src/tui/controller.js +19 -0
  45. package/dist/src/tui/controller.js.map +1 -1
  46. package/dist/src/tui/model.js +1 -1
  47. package/dist/src/tui/model.js.map +1 -1
  48. package/dist/src/tui/operation-review-planner.js +13 -8
  49. package/dist/src/tui/operation-review-planner.js.map +1 -1
  50. package/dist/src/utils/artifact-renderer.d.ts +8 -1
  51. package/dist/src/utils/artifact-renderer.js +25 -7
  52. package/dist/src/utils/artifact-renderer.js.map +1 -1
  53. package/dist/src/utils/managed-command-materialization.d.ts +2 -0
  54. package/dist/src/utils/managed-command-materialization.js +2 -1
  55. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  56. package/dist/src/utils/plugin-config-impact.d.ts +15 -0
  57. package/dist/src/utils/plugin-config-impact.js +132 -24
  58. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  59. package/dist/src/utils/plugin-config-references.d.ts +80 -0
  60. package/dist/src/utils/plugin-config-references.js +340 -0
  61. package/dist/src/utils/plugin-config-references.js.map +1 -0
  62. package/dist/src/utils/plugin-config-write.js +148 -31
  63. package/dist/src/utils/plugin-config-write.js.map +1 -1
  64. package/dist/src/utils/plugin-config.d.ts +10 -2
  65. package/dist/src/utils/plugin-config.js +53 -4
  66. package/dist/src/utils/plugin-config.js.map +1 -1
  67. package/dist/src/utils/plugin-scripts.d.ts +1 -0
  68. package/dist/src/utils/plugin-scripts.js +1 -1
  69. package/dist/src/utils/plugin-scripts.js.map +1 -1
  70. package/dist/src/utils/runtime-config.js +1 -0
  71. package/dist/src/utils/runtime-config.js.map +1 -1
  72. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { configReferenceKey, configReferenceValues, configReferenceScalars, configReferenceSelection, configReferenceMessage, configCrossLayerDependencies } from './config-references.js';
2
+ import { configReferenceKey, configReferenceValues, configReferenceScalars, configReferenceSelection, configReferenceMessage, configReferenceSource, configCrossLayerDependencies } from './config-references.js';
3
3
  import { arrayDraftChanged, arrayDraftValue, createConfigArrayDraft, editConfigArrayDraft } from './config-array-draft.js';
4
4
  import { PLUGIN_CONFIG_ARRAY_MAX_ITEMS } from '@lesliechan721/aw-plugin-core';
5
5
  import { presentConfigValue, safeConfigText } from './config-value-presentation.js';
@@ -524,26 +524,31 @@ function configUnavailableCanRecoverSource(route) {
524
524
  }
525
525
  function configUnavailableDiagnostic(route) {
526
526
  const invalidLayer = (route.invalidStores?.length ?? 0) > 0;
527
+ const memoryExhausted = route.diagnosticCode === 'configValidationMemoryExhausted';
527
528
  const invalidLayerLabel = route.invalidStores?.map((store) => store.scope === 'user' ? '个人默认' : '当前项目').join('、');
528
529
  return {
529
530
  severity: 'error',
530
- title: invalidLayer ? '设置层无效,已阻止编辑' : '插件定义或来源不可用',
531
+ title: invalidLayer ? '设置层无效,已阻止编辑'
532
+ : memoryExhausted ? '设置校验内存不足' : '插件定义或来源不可用',
531
533
  userMessage: invalidLayer
532
534
  ? '高优先级设置层无效,不能静默使用较低层或默认值。'
533
- : '当前无法取得可信的字段定义,因此不能验证新值。',
535
+ : memoryExhausted ? '配置校验引擎的内存已耗尽,当前不能继续校验设置。'
536
+ : '当前无法取得可信的字段定义,因此不能验证新值。',
534
537
  impact: [
535
538
  { state: 'blocked', message: invalidLayer
536
539
  ? `${invalidLayerLabel}设置层、普通 unset 和渲染都已阻止。`
537
- : '恢复可信字段定义前,不能编辑这个插件的字段设置。' },
540
+ : memoryExhausted ? '重新启动 AW 前,不能编辑这个插件的字段设置。'
541
+ : '恢复可信字段定义前,不能编辑这个插件的字段设置。' },
538
542
  { state: 'preserved', message: invalidLayer
539
543
  ? '较低层或默认值只可作为预览;当前无效层仍保持不变。'
540
544
  : '已保存的设置保持不变。' },
541
545
  ],
542
546
  nextStep: invalidLayer
543
547
  ? '确认后重置整个目标设置层;不会创建备份。'
544
- : configUnavailableCanRecoverSource(route)
545
- ? '重新检查来源,然后再次打开设置。'
546
- : '查看技术详情,确认字段定义不可用的原因。',
548
+ : memoryExhausted ? '退出并重新启动 AW,然后再次打开设置。'
549
+ : configUnavailableCanRecoverSource(route)
550
+ ? '重新检查来源,然后再次打开设置。'
551
+ : '查看技术详情,确认字段定义不可用的原因。',
547
552
  technical: {
548
553
  code: safeDiagnosticCode(route.diagnosticCode, 'configUnavailable'),
549
554
  stage: safeDiagnosticCode(route.diagnosticStage, 'read-config'),
@@ -555,7 +560,8 @@ function configUnavailableDiagnostic(route) {
555
560
  ],
556
561
  checks: invalidLayer
557
562
  ? ['只删除所选 user 或 project 设置层。', '重置后重新读取继承值和默认值。']
558
- : ['恢复插件来源和可信插件定义。', '重新检查来源后再次打开设置。'],
563
+ : memoryExhausted ? ['退出并重新启动 AW。', '若问题再次出现,升级 AW 后重试。']
564
+ : ['恢复插件来源和可信插件定义。', '重新检查来源后再次打开设置。'],
559
565
  },
560
566
  };
561
567
  }
@@ -1074,6 +1080,8 @@ export function ConsoleAppV4(props) {
1074
1080
  });
1075
1081
  const externalDraftFlowIds = useRef(new Map());
1076
1082
  const configOverviewAnchors = useRef(new Map());
1083
+ const suspendedConfigDrafts = useRef(new Map());
1084
+ const referenceLeafDrafts = useRef(new Map());
1077
1085
  const exitSent = useRef(false);
1078
1086
  const operationBusy = useRef(false);
1079
1087
  const route = snapshot.router.current.route;
@@ -1384,6 +1392,10 @@ export function ConsoleAppV4(props) {
1384
1392
  if (currentFlowId && sourceDraft)
1385
1393
  externalDraftFlowIds.current.set(sourceDraft.owner, currentFlowId);
1386
1394
  const drafts = [];
1395
+ for (const suspended of suspendedConfigDrafts.current.values()) {
1396
+ if (suspended.externalDraft)
1397
+ drafts.push(suspended.externalDraft);
1398
+ }
1387
1399
  if ((dirty || configCandidate && !configCandidate.selectingScope || nestedPropertyRevision || objectVariantPreview || Object.values(arrayDrafts).some((draft) => draft.initial === undefined ? draft.rows.length > 0 : arrayDraftChanged(draft)) || changedObjectDraftKeys.length > 0) && draftOwner) {
1388
1400
  const flowId = externalDraftFlowIds.current.get(draftOwner);
1389
1401
  drafts.push({
@@ -1410,8 +1422,9 @@ export function ConsoleAppV4(props) {
1410
1422
  configDrafts, configCandidate, arrayDrafts, objectDrafts, nestedPropertyRevision, objectVariantPreview, route.name, snapshot.router.currentFlowId, sourceDraft,
1411
1423
  ]);
1412
1424
  useEffect(() => () => props.controller.setExternalDraftState(), [props.controller]);
1425
+ const currentLayerPage = configRoute && configRoute.layer.scope !== 'effective' ? configLayerPages[configRoute.layer.scope] : undefined;
1413
1426
  const currentConfigPage = configPageMatches(configPage, configRoute) ? configPage
1414
- : configRoute && configRoute.layer.scope !== 'effective' ? configLayerPages[configRoute.layer.scope] : undefined;
1427
+ : configPageMatches(currentLayerPage, configRoute) ? currentLayerPage : undefined;
1415
1428
  const hasReferenceFields = (configPage ?? configLayerPages.user ?? configLayerPages.project)?.groups
1416
1429
  .some((group) => group.fields.some((field) => configReferenceScalars(field.definition).length > 0)) ?? false;
1417
1430
  useEffect(() => {
@@ -1447,9 +1460,16 @@ export function ConsoleAppV4(props) {
1447
1460
  .map((field) => [field.key, field]));
1448
1461
  for (const [key, value] of Object.entries(draft.updates)) {
1449
1462
  const field = fields.get(key);
1463
+ const invalidReferences = field ? configReferenceValues(field.definition, value)
1464
+ .filter(({ scalar, value: selected }) => {
1465
+ const reference = referenceContexts[draftScope]?.selections[configReferenceKey(scalar)];
1466
+ return reference !== undefined && (reference.issues.length > 0
1467
+ || !reference.choices.some((choice) => choice.value === selected));
1468
+ }).map(({ scalar }) => configReferenceSource(scalar)) : [];
1450
1469
  if (!field || !configFieldCanSet(field)
1451
- || validatePluginConfigValue(field.definition, value, key).length > 0) {
1452
- issues.push({ scope: draftScope, key, source: 'update' });
1470
+ || validatePluginConfigValue(field.definition, value, key).length > 0
1471
+ || invalidReferences.length > 0) {
1472
+ issues.push({ scope: draftScope, key, source: 'update', referenceSources: invalidReferences });
1453
1473
  }
1454
1474
  }
1455
1475
  for (const key of draft.removes) {
@@ -1492,13 +1512,17 @@ export function ConsoleAppV4(props) {
1492
1512
  if (draftOwner !== owner) {
1493
1513
  setDraftOwner(owner);
1494
1514
  if (draftOwner !== undefined) {
1495
- setConfigDrafts({});
1496
- setConfigCandidate(undefined);
1497
- setObjectDrafts({});
1498
- setArrayDrafts({});
1499
- setChangedObjectDraftKeys([]);
1515
+ const suspended = suspendedConfigDrafts.current.get(owner);
1516
+ suspendedConfigDrafts.current.delete(owner);
1517
+ setConfigDrafts(suspended?.drafts ?? {});
1518
+ setConfigCandidate(suspended?.candidate);
1519
+ setObjectDrafts(suspended?.objects ?? {});
1520
+ setArrayDrafts(suspended?.arrays ?? {});
1521
+ setChangedObjectDraftKeys(suspended?.changedObjects ?? []);
1522
+ if (suspended)
1523
+ setInputValue(suspended.input);
1500
1524
  setObjectError(undefined);
1501
- setDirty(false);
1525
+ setDirty(suspended?.dirty ?? false);
1502
1526
  setConfigActionError(undefined);
1503
1527
  }
1504
1528
  }
@@ -1553,6 +1577,7 @@ export function ConsoleAppV4(props) {
1553
1577
  }, [configRoute?.pluginId, configRoute?.layer.scope, props.controller]);
1554
1578
  useEffect(() => {
1555
1579
  if (route.name !== 'configUnavailable'
1580
+ || route.diagnosticCode === 'configValidationMemoryExhausted'
1556
1581
  || (!route.invalidStores?.length && !route.storedScopes?.length && !route.layer)) {
1557
1582
  setConfigResetAvailability({});
1558
1583
  return;
@@ -1584,6 +1609,7 @@ export function ConsoleAppV4(props) {
1584
1609
  props.controller,
1585
1610
  route.name,
1586
1611
  route.name === 'configUnavailable' ? route.pluginId : '',
1612
+ route.name === 'configUnavailable' ? route.diagnosticCode : '',
1587
1613
  route.name === 'configUnavailable'
1588
1614
  ? route.invalidStores?.map((store) => `${store.scope}:${store.code}`).join('|') ?? ''
1589
1615
  : '',
@@ -1842,13 +1868,31 @@ export function ConsoleAppV4(props) {
1842
1868
  const activePropertyIsConst = activePropertyDefinition && 'const' in activePropertyDefinition && activePropertyDefinition.const !== undefined;
1843
1869
  const referenceNotice = (scalar, value) => {
1844
1870
  const selection = referenceContext?.selections[configReferenceKey(scalar)];
1845
- const message = referenceContextError && !selection ? referenceContextError : configReferenceMessage(scalar, selection, value);
1871
+ const message = referenceContextError && !selection ? `来源 ${configReferenceSource(scalar)}:${referenceContextError}`
1872
+ : configReferenceMessage(scalar, selection, value);
1846
1873
  const source = 'valueRef' in scalar ? scalar.valueRef.field : '';
1847
- const pendingSource = editingScope === 'project' && selection?.source !== 'project'
1874
+ const pendingSource = !('valueRef' in scalar && scalar.valueRef?.plugin) && editingScope === 'project' && selection?.source !== 'project'
1848
1875
  && (Object.hasOwn(configDrafts.user?.updates ?? {}, source) || configDrafts.user?.removes.includes(source));
1849
1876
  return [message, pendingSource ? `来源 ${source} 在个人默认有未保存修改。请先保存来源配置,再编辑或保存引用配置。` : undefined]
1850
1877
  .filter(Boolean).join(' ') || undefined;
1851
1878
  };
1879
+ const openReferenceSource = (scalar, leaf) => {
1880
+ const ref = 'valueRef' in scalar ? scalar.valueRef : undefined;
1881
+ if (!ref?.plugin || !configRoute || !draftOwner)
1882
+ return;
1883
+ props.controller.updatePageContext({ focusIndex: focus, scrollOffset });
1884
+ if (leaf)
1885
+ referenceLeafDrafts.current.set(snapshot.router.currentFrameId, leaf);
1886
+ suspendedConfigDrafts.current.set(draftOwner, {
1887
+ drafts: configDrafts, candidate: configCandidate, arrays: arrayDrafts, objects: objectDrafts,
1888
+ changedObjects: changedObjectDraftKeys, dirty, input: inputValue,
1889
+ externalDraft: props.controller.externalDrafts.find((draft) => draft.kind === 'configDraft' && draft.owner === draftOwner),
1890
+ });
1891
+ const sourceId = configRoute.pluginId.split('/')[0];
1892
+ props.controller.beginConfigReferenceSource(`${sourceId}/${ref.plugin}`, ref.field);
1893
+ setFocus(0);
1894
+ setScrollOffset(0);
1895
+ };
1852
1896
  useEffect(() => {
1853
1897
  if (route.name !== 'configFieldEditor' || !activeField)
1854
1898
  return;
@@ -3196,6 +3240,16 @@ export function ConsoleAppV4(props) {
3196
3240
  const updateObjectProperty = (propertyKey, value) => {
3197
3241
  if (!activeField || activeField.definition.type !== 'object' || !activeObjectDraft)
3198
3242
  return false;
3243
+ const definition = activeObjectProperties?.[propertyKey] ?? activeField.definition.additionalProperties;
3244
+ if (definition && value !== undefined) {
3245
+ for (const { scalar, value: selected } of configReferenceValues(definition, value)) {
3246
+ const reference = referenceContext?.selections[configReferenceKey(scalar)];
3247
+ if (!reference || reference.issues.length || !reference.choices.some((choice) => choice.value === selected)) {
3248
+ setInputError(referenceNotice(scalar, selected) ?? '引用选项已变化,请重新选择。');
3249
+ return false;
3250
+ }
3251
+ }
3252
+ }
3199
3253
  const candidate = { ...activeObjectDraft, [propertyKey]: value };
3200
3254
  if (value === undefined)
3201
3255
  delete candidate[propertyKey];
@@ -5915,7 +5969,8 @@ export function ConsoleAppV4(props) {
5915
5969
  ? currentConfigPage.groups.find((group) => group.id === activeTab.id)
5916
5970
  : undefined;
5917
5971
  if (configDraftIssues.length > 0) {
5918
- description = `${description ?? ''} 有 ${configDraftIssues.length} 项未保存修改已不适用于当前设置。`;
5972
+ const sources = [...new Set(configDraftIssues.flatMap((issue) => issue.referenceSources ?? []))];
5973
+ description = `${description ?? ''} 有 ${configDraftIssues.length} 项未保存修改已不适用于当前设置。${sources.length ? ` 请检查来源 ${sources.join('、')}。` : ''}`;
5919
5974
  }
5920
5975
  const mutableLayer = { scope: 'effective' };
5921
5976
  const tabActions = activeTab?.kind === 'presets'
@@ -6140,10 +6195,13 @@ export function ConsoleAppV4(props) {
6140
6195
  const selection = configReferenceSelection(referenceContext, scalarReference);
6141
6196
  const current = arrayItem ? itemValue : draftUpdates[activeField.key] ?? activeField.draftValue ?? activeField.value;
6142
6197
  title = `选择${activeField.title}`;
6143
- description = referenceNotice(scalarReference, current) ?? `选项来自 ${scalarReference.valueRef.field};保存到${editingScope === 'user' ? '个人默认' : '当前项目'}。`;
6198
+ description = referenceNotice(scalarReference, current) ?? `选项来自 ${configReferenceSource(scalarReference)};保存到${editingScope === 'user' ? '个人默认' : '当前项目'}。`;
6144
6199
  help = '↑↓ 移动 · Enter 使用 · Esc 返回修复来源';
6145
6200
  actions = selection.choices.map((choice) => ({ label: safeConfigText(choice.title), selected: choice.value === current,
6146
6201
  run: () => updateDraft(activeField.key, choice.value) }));
6202
+ if (scalarReference.valueRef.plugin)
6203
+ actions.push({ label: `编辑来源 ${configReferenceSource(scalarReference)}`,
6204
+ run: () => openReferenceSource(scalarReference) });
6147
6205
  content = _jsx(SemanticRows, { actions: [...actions], focus: focus, kind: "choice", compact: policy.mode === 'compact' });
6148
6206
  }
6149
6207
  else if ('const' in activeField.definition && activeField.definition.const !== undefined) {
@@ -6370,11 +6428,14 @@ export function ConsoleAppV4(props) {
6370
6428
  const selection = configReferenceSelection(referenceContext, definition);
6371
6429
  const current = activeObjectDraft[property];
6372
6430
  title = `选择${propertyTitle}`;
6373
- description = referenceNotice(definition, current) ?? `选项来自 ${definition.valueRef.field}。`;
6431
+ description = referenceNotice(definition, current) ?? `选项来自 ${configReferenceSource(definition)}。`;
6374
6432
  help = '↑↓ 移动 · Enter 使用 · Esc 返回修复来源';
6375
6433
  actions = selection.choices.map((choice) => ({ label: safeConfigText(choice.title), selected: choice.value === current,
6376
6434
  run: () => { if (updateObjectProperty(property, choice.value))
6377
6435
  back(); } }));
6436
+ if (definition.valueRef.plugin)
6437
+ actions.push({ label: `编辑来源 ${configReferenceSource(definition)}`,
6438
+ run: () => openReferenceSource(definition) });
6378
6439
  content = _jsx(SemanticRows, { actions: [...actions], focus: focus, kind: "choice", compact: policy.mode === 'compact' });
6379
6440
  }
6380
6441
  else if (property !== undefined && definition && 'const' in definition && definition.const !== undefined) {
@@ -6477,8 +6538,13 @@ export function ConsoleAppV4(props) {
6477
6538
  title = `编辑${propertyTitle}`;
6478
6539
  description = '确认后更新当前对象草稿;Esc 取消此属性的全部修改。';
6479
6540
  help = '↑↓ 移动 · Enter 编辑 · a 操作 · c 使用 · Esc 取消';
6480
- content = _jsx(ConfigLeafEditor, { definition: definition, value: activeObjectDraft[property], propertyKey: property, referenceContext: referenceContext, referenceNotice: referenceNotice, columns: size.columns, rowBudget: pageActionBudget(1), active: !overlay && !tooSmall && !busy, error: inputError, onDraftChange: setNestedPropertyRevision, onCancel: back, onConfirm: (value) => { if (!updateObjectProperty(property, value))
6481
- return false; back(); return true; } }, `${snapshot.router.currentFrameId}:${property}`);
6541
+ content = _jsx(ConfigLeafEditor, { definition: definition, value: activeObjectDraft[property], propertyKey: property, referenceContext: referenceContext, referenceNotice: referenceNotice, initialDraft: referenceLeafDrafts.current.get(snapshot.router.currentFrameId), onOpenReferenceSource: openReferenceSource, columns: size.columns, rowBudget: pageActionBudget(1), active: !overlay && !tooSmall && !busy, error: inputError, onDraftChange: setNestedPropertyRevision, onCancel: () => { referenceLeafDrafts.current.delete(snapshot.router.currentFrameId); back(); }, onConfirm: (value) => {
6542
+ if (!updateObjectProperty(property, value))
6543
+ return false;
6544
+ referenceLeafDrafts.current.delete(snapshot.router.currentFrameId);
6545
+ back();
6546
+ return true;
6547
+ } }, `${snapshot.router.currentFrameId}:${property}`);
6482
6548
  }
6483
6549
  else if (property !== undefined && definition) {
6484
6550
  title = activePropertySensitive ? '输入敏感值' : `输入${propertyTitle}`;
@@ -6499,9 +6565,10 @@ export function ConsoleAppV4(props) {
6499
6565
  const canRecoverSource = configUnavailableCanRecoverSource(route);
6500
6566
  title = diagnostic.title;
6501
6567
  description = '';
6502
- const resetScopes = route.invalidStores?.map(({ scope }) => scope)
6503
- ?? route.storedScopes
6504
- ?? (route.layer ? [route.layer.scope] : []);
6568
+ const resetScopes = route.diagnosticCode === 'configValidationMemoryExhausted' ? []
6569
+ : route.invalidStores?.map(({ scope }) => scope)
6570
+ ?? route.storedScopes
6571
+ ?? (route.layer ? [route.layer.scope] : []);
6505
6572
  actions = [
6506
6573
  ...resetScopes.flatMap((scope) => {
6507
6574
  const availability = configResetAvailability[scope];
@@ -9427,6 +9494,8 @@ export function ConsoleAppV4(props) {
9427
9494
  }).catch((error) => showSafeUiFailure(error, 'tuiSessionNavigationFailed', 'session-navigation'));
9428
9495
  }
9429
9496
  function clearExternalDraftValues() {
9497
+ suspendedConfigDrafts.current.clear();
9498
+ referenceLeafDrafts.current.clear();
9430
9499
  setDirty(false);
9431
9500
  setConfigDrafts({});
9432
9501
  setConfigCandidate(undefined);