@lesliechan721/aw 0.1.0-beta.33 → 0.1.0-beta.35

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 (47) hide show
  1. package/dist/scripts/test-plugin-scripts.js +1 -1
  2. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  3. package/dist/src/commands/aw-capabilities.js +1 -0
  4. package/dist/src/commands/aw-capabilities.js.map +1 -1
  5. package/dist/src/portable/materializer.js +19 -3
  6. package/dist/src/portable/materializer.js.map +1 -1
  7. package/dist/src/review/review-profile.js +19 -2
  8. package/dist/src/review/review-profile.js.map +1 -1
  9. package/dist/src/tui/components.d.ts +20 -0
  10. package/dist/src/tui/components.js +13 -1
  11. package/dist/src/tui/components.js.map +1 -1
  12. package/dist/src/tui/config-array-draft.d.ts +29 -0
  13. package/dist/src/tui/config-array-draft.js +48 -0
  14. package/dist/src/tui/config-array-draft.js.map +1 -0
  15. package/dist/src/tui/config-value-presentation.d.ts +1 -0
  16. package/dist/src/tui/config-value-presentation.js +17 -1
  17. package/dist/src/tui/config-value-presentation.js.map +1 -1
  18. package/dist/src/tui/console-app-v4.js +504 -288
  19. package/dist/src/tui/console-app-v4.js.map +1 -1
  20. package/dist/src/tui/controller-runtime.js +27 -2
  21. package/dist/src/tui/controller-runtime.js.map +1 -1
  22. package/dist/src/tui/controller.d.ts +15 -0
  23. package/dist/src/tui/controller.js +111 -4
  24. package/dist/src/tui/controller.js.map +1 -1
  25. package/dist/src/tui/model.d.ts +9 -0
  26. package/dist/src/tui/model.js +10 -2
  27. package/dist/src/tui/model.js.map +1 -1
  28. package/dist/src/tui/project-inventory.d.ts +68 -0
  29. package/dist/src/tui/project-inventory.js +203 -0
  30. package/dist/src/tui/project-inventory.js.map +1 -0
  31. package/dist/src/tui/router.d.ts +16 -3
  32. package/dist/src/tui/router.js.map +1 -1
  33. package/dist/src/tui/screen-registry.d.ts +7 -1
  34. package/dist/src/tui/screen-registry.js +1 -1
  35. package/dist/src/tui/screen-registry.js.map +1 -1
  36. package/dist/src/tui/theme.d.ts +12 -0
  37. package/dist/src/tui/theme.js +12 -0
  38. package/dist/src/tui/theme.js.map +1 -1
  39. package/dist/src/types.d.ts +2 -0
  40. package/dist/src/types.js.map +1 -1
  41. package/dist/src/utils/catalog-source-references.js +2 -2
  42. package/dist/src/utils/plugin-config-write.js +3 -1
  43. package/dist/src/utils/plugin-config-write.js.map +1 -1
  44. package/dist/src/utils/plugin-config.d.ts +5 -5
  45. package/dist/src/utils/plugin-config.js +47 -23
  46. package/dist/src/utils/plugin-config.js.map +1 -1
  47. package/package.json +3 -3
@@ -945,6 +945,23 @@ export function createTuiControllerDependencies(context, progressFeed, options =
945
945
  || JSON.stringify(batchBase.source) !== JSON.stringify(current.source))) {
946
946
  throw operationReviewStale('准备设置批次期间 Catalog 或来源发生变化。');
947
947
  }
948
+ for (const expected of Object.values(group.editEvidence ?? {})) {
949
+ if (expected.sourceIdentity !== current.source.sourceIdentity
950
+ || expected.schemaIdentity !== current.config.schemaIdentity) {
951
+ throw operationReviewStale('编辑期间插件来源或设置定义已变化,请重新打开列表。');
952
+ }
953
+ for (const scope of ['user', 'project']) {
954
+ if (expected.storeDigests[scope] === undefined)
955
+ continue;
956
+ const currentDigest = await configLayerStoreDigest({
957
+ source: current.source, pluginName: parsePluginId(intent.pluginId).pluginName,
958
+ scope, cwd: context.cwd, env: context.env,
959
+ });
960
+ if (expected.storeDigests[scope] !== currentDigest) {
961
+ throw operationReviewStale('编辑期间设置已被外部修改,请重新打开列表。');
962
+ }
963
+ }
964
+ }
948
965
  batchBase ??= current;
949
966
  batchCatalogOperation ??= catalogOperationByEvidence.get(current);
950
967
  groupEvidence.push({
@@ -2740,7 +2757,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
2740
2757
  ...(sessionContextForPlugin(pluginId)
2741
2758
  ? { operationContext: sessionContextForPlugin(pluginId) }
2742
2759
  : {}),
2743
- consume: async ({ plugin }) => {
2760
+ consume: async ({ plugin, source }) => {
2744
2761
  if (!plugin.manifest.config) {
2745
2762
  throw new TuiOperationBlockedError('configSchemaUnavailable', '这个插件没有设置 schema。');
2746
2763
  }
@@ -2792,7 +2809,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
2792
2809
  const layerStore = layer.scope === 'effective'
2793
2810
  ? undefined
2794
2811
  : layer.scope === 'user' ? userStore : projectStore;
2795
- return buildConfigPage({
2812
+ const page = buildConfigPage({
2796
2813
  pluginId,
2797
2814
  schema: plugin.manifest.config,
2798
2815
  read,
@@ -2808,6 +2825,14 @@ export function createTuiControllerDependencies(context, progressFeed, options =
2808
2825
  ? target.refreshKeys
2809
2826
  : [])),
2810
2827
  });
2828
+ return { ...page, editEvidence: {
2829
+ sourceIdentity: source.sourceIdentity,
2830
+ schemaIdentity: source.manifestDigest,
2831
+ storeDigests: {
2832
+ user: digest({ exists: userStore.exists, rawDigest: userStore.rawDigest }),
2833
+ ...(projectStore ? { project: digest({ exists: projectStore.exists, rawDigest: projectStore.rawDigest }) } : {}),
2834
+ },
2835
+ } };
2811
2836
  },
2812
2837
  });
2813
2838
  },