soma-core 2.2.5 → 2.2.7

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 (283) hide show
  1. package/README.md +5 -6
  2. package/bin/soma.cjs +2 -2
  3. package/core/build/compiler/flat-page.ts +16 -0
  4. package/core/build/compiler/full-manifest-builder.ts +0 -3
  5. package/core/build/compiler/page-assets.ts +0 -1
  6. package/core/build/compiler/page-closure.ts +245 -0
  7. package/core/build/compiler/page-declaration-compiler.ts +2 -5
  8. package/core/build/compiler/soma-precompile.js +1972 -3312
  9. package/core/build/compiler/soma-precompile.ts +4 -7
  10. package/core/build/component-tree/artifact-codec.ts +4 -8
  11. package/core/build/lsp/soma-declaration.cjs +1 -1
  12. package/core/build/lsp/std-completion.generated.json +3 -3
  13. package/core/client/a11y/a11y-config.ts +2 -1
  14. package/core/client/a11y/dom-id.ts +1 -1
  15. package/core/client/base/SomaHttpClient.ts +11 -3
  16. package/core/client/base/SomaPageRootBase.ts +6 -0
  17. package/core/client/base/defineSomaView.ts +178 -0
  18. package/core/client/base/index.ts +13 -0
  19. package/core/client/base/view-context.ts +328 -0
  20. package/core/client/behavior/adapter-collection.ts +2 -2
  21. package/core/client/compiler/manifest-compiler.ts +5 -36
  22. package/core/client/component/component-definition.types.ts +2 -1
  23. package/core/client/component/component-manager.ts +110 -20
  24. package/core/client/component/structure-adapter.ts +3 -7
  25. package/core/client/container/IContainerAdapter.ts +4 -0
  26. package/core/client/container/SomaContainerAdapter.ts +52 -3
  27. package/core/client/data/data-object-resolver.ts +523 -184
  28. package/core/client/data/data-write-actions.ts +79 -15
  29. package/core/client/data/format-config.ts +3 -1
  30. package/core/client/data/region-scope-port.ts +11 -0
  31. package/core/client/engine/asset-resolver.ts +2 -5
  32. package/core/client/engine/dom-renderer.ts +7 -40
  33. package/core/client/engine/event-engine.ts +29 -108
  34. package/core/client/engine/property-watcher.ts +1 -1
  35. package/core/client/engine/reactive-proxy.ts +78 -17
  36. package/core/client/engine/runtime-builder.ts +0 -14
  37. package/core/client/engine/scope-resolver.ts +18 -0
  38. package/core/client/engine/soma-bootstrap.ts +387 -99
  39. package/core/client/engine/style-binder.ts +49 -106
  40. package/core/client/engine/timer-engine.ts +11 -1
  41. package/core/client/host-bridge/load-host-domain-class.ts +2 -1
  42. package/core/client/infra/http/SomaHttpService.ts +15 -4
  43. package/core/client/infra/i18n/pack-locales.ts +2 -2
  44. package/core/client/infra/notify/DefaultNotifyService.ts +2 -2
  45. package/core/client/mount/domain-rule.ts +7 -3
  46. package/core/client/mount/mount-page.ts +38 -5
  47. package/core/client/mount/types.ts +2 -0
  48. package/core/client/parser/confirm-spec.ts +100 -7
  49. package/core/client/parser/data-config-parser.ts +28 -211
  50. package/core/client/parser/pipeline-parser.ts +16 -60
  51. package/core/client/parser/style-config-parser.ts +101 -95
  52. package/core/client/parser/timer-parser.ts +21 -0
  53. package/core/client/parser/ui-config-parser.ts +64 -12
  54. package/core/client/registry/declaration-renderer.ts +1 -1
  55. package/core/client/render-ports/hide-transition.ts +9 -0
  56. package/core/client/render-ports/index.ts +4 -0
  57. package/core/client/render-ports/notify-renderer.ts +2 -1
  58. package/core/client/runtime/SomaRuntimeServices.ts +2 -1
  59. package/core/client/runtime/SomaSnapshotStore.ts +5 -0
  60. package/core/client/security/url-guard.ts +71 -11
  61. package/core/client/validation/async-check-registry.ts +2 -1
  62. package/core/client/validation/contract-validator.ts +2 -6
  63. package/core/client/validation/field-rules.ts +3 -13
  64. package/core/client/validation/object-rules.ts +2 -10
  65. package/core/index.ts +17 -39
  66. package/core/inspect/check-product.ts +5 -5
  67. package/core/inspect/runtime.ts +2 -1
  68. package/core/server/api/dispatch-service-api.ts +35 -36
  69. package/core/server/api/load-host-service.ts +8 -4
  70. package/core/server/api/paged-list.ts +259 -0
  71. package/core/server/compile-port.ts +1 -1
  72. package/core/server/host/app-config-composer.ts +2 -1
  73. package/core/server/host/empty-host-bootstrap.mjs +3 -0
  74. package/core/server/host/host-assembly-entry.ts +1 -0
  75. package/core/server/host/host-assembly.ts +50 -3
  76. package/core/server/host/host-caller.ts +2 -1
  77. package/core/server/host/host-dir.ts +9 -0
  78. package/core/server/host/host-response-headers.ts +2 -1
  79. package/core/server/host/invoke-host-request-hook.ts +28 -4
  80. package/core/server/host/published-page-assets.ts +2 -1
  81. package/core/server/host/resolve-host-request-hook.ts +25 -7
  82. package/core/server/host/server-page-assets.ts +4 -4
  83. package/core/server/host/source-aliases.cjs +345 -0
  84. package/core/server/host/source-aliases.ts +32 -0
  85. package/core/server/host/source-packages.cjs +1 -0
  86. package/core/server/host/virtual-pages.ts +3 -2
  87. package/core/server/infra/cache/ServerFileCache.ts +83 -10
  88. package/core/server/node.ts +10 -0
  89. package/core/server/registry/api-registry-store.ts +3 -1
  90. package/core/server/registry/declaration-precompiler.ts +0 -2
  91. package/core/server/registry/page-registry-repository.ts +2 -1
  92. package/core/server/registry/page-registry-store.ts +2 -1
  93. package/core/server/registry/registry-error.ts +6 -1
  94. package/core/server/registry/registry-file-lock.ts +296 -23
  95. package/core/server/registry/request-body-limit.ts +3 -2
  96. package/core/server/registry/validation/declaration-safety-scan.ts +151 -27
  97. package/core/server/runtime-space/access-gate.ts +21 -7
  98. package/core/server/runtime-space/bindings.ts +3 -6
  99. package/core/server/runtime-space/dynamic-pages.ts +181 -49
  100. package/core/server/runtime-space/errors.ts +3 -0
  101. package/core/server/runtime-space/inject.ts +78 -16
  102. package/core/server/runtime-space/page-grants.ts +7 -1
  103. package/core/server/runtime-space/resolve.ts +66 -19
  104. package/core/server/runtime-space/store.ts +32 -3
  105. package/core/server/runtime-space/submit-steps.ts +2 -1
  106. package/core/server/runtime-space/types.ts +3 -1
  107. package/core/shared/component-tree-errors.ts +2 -1
  108. package/core/shared/contract-a11y.ts +1 -1
  109. package/core/shared/contract-sections.ts +2 -2
  110. package/core/shared/core-diagnostic-codes.ts +14 -0
  111. package/core/shared/data-declaration-checks.ts +29 -3
  112. package/core/shared/declaration-keys.ts +1 -1
  113. package/core/shared/engines/engine-error.ts +2 -1
  114. package/core/shared/generation-error.ts +2 -1
  115. package/core/shared/page-envelope.ts +1 -1
  116. package/core/shared/pure-binding.ts +88 -0
  117. package/core/shared/registry-generated/diagnostic-registry-index.ts +21 -19
  118. package/core/shared/registry-generated/diagnostic-registry.ts +170 -177
  119. package/core/shared/registry-generated/limits.ts +65 -13
  120. package/core/shared/registry-generated/std-grammar-completion.ts +0 -4
  121. package/core/shared/registry-generated/std-grammar-views.ts +40 -10
  122. package/core/shared/registry-generated/std-grammar.ts +43 -21
  123. package/core/shared/soma-error.ts +36 -0
  124. package/core/shared/types/compile-port.types.ts +1 -1
  125. package/core/shared/types/data-config.types.ts +20 -18
  126. package/core/shared/types/engine.types.ts +0 -3
  127. package/core/shared/types/event.types.ts +10 -11
  128. package/core/shared/types/generation-error.types.ts +5 -1
  129. package/core/shared/types/host-assembly.types.ts +7 -1
  130. package/core/shared/types/manifest.types.ts +0 -3
  131. package/core/shared/types/region-scope.types.ts +5 -1
  132. package/core/shared/types/scope-manifest.types.ts +0 -2
  133. package/core/shared/types/style-config.types.ts +21 -21
  134. package/core/shared/types/ui-config.types.ts +4 -5
  135. package/core/shared/types/watcher.types.ts +1 -1
  136. package/dist/browser/runtime-bundle.manifest.json +11 -13
  137. package/dist/browser/soma-runtime.js +2733 -2712
  138. package/dist/core/index.cjs +5665 -5534
  139. package/dist/host-native/aot-builder.cjs +330 -1
  140. package/dist/host-native/native-server.cjs +5434 -4726
  141. package/dist/lsp/component-tree.cjs +5868 -7040
  142. package/dist/types/build/compiler/full-manifest-builder.d.ts +0 -2
  143. package/dist/types/build/compiler/page-closure.d.ts +21 -0
  144. package/dist/types/build/compiler/page-declaration-compiler.d.ts +2 -4
  145. package/dist/types/build/compiler/soma-precompile.d.ts +1 -3
  146. package/dist/types/build/component-tree/artifact-codec.d.ts +0 -2
  147. package/dist/types/client/a11y/a11y-config.d.ts +2 -1
  148. package/dist/types/client/base/SomaHttpClient.d.ts +1 -1
  149. package/dist/types/client/base/SomaPageRootBase.d.ts +5 -0
  150. package/dist/types/client/base/defineSomaView.d.ts +46 -0
  151. package/dist/types/client/base/index.d.ts +2 -0
  152. package/dist/types/client/base/view-context.d.ts +136 -0
  153. package/dist/types/client/behavior/adapter-collection.d.ts +1 -1
  154. package/dist/types/client/compiler/manifest-compiler.d.ts +0 -3
  155. package/dist/types/client/component/component-definition.types.d.ts +2 -1
  156. package/dist/types/client/component/component-manager.d.ts +29 -0
  157. package/dist/types/client/container/IContainerAdapter.d.ts +3 -0
  158. package/dist/types/client/container/SomaContainerAdapter.d.ts +5 -0
  159. package/dist/types/client/data/data-object-resolver.d.ts +93 -31
  160. package/dist/types/client/data/format-config.d.ts +2 -1
  161. package/dist/types/client/engine/dom-renderer.d.ts +1 -2
  162. package/dist/types/client/engine/event-engine.d.ts +0 -7
  163. package/dist/types/client/engine/reactive-proxy.d.ts +11 -4
  164. package/dist/types/client/engine/runtime-builder.d.ts +0 -4
  165. package/dist/types/client/engine/soma-bootstrap.d.ts +44 -6
  166. package/dist/types/client/engine/style-binder.d.ts +8 -4
  167. package/dist/types/client/host-bridge/load-host-domain-class.d.ts +2 -1
  168. package/dist/types/client/mount/domain-rule.d.ts +2 -0
  169. package/dist/types/client/mount/mount-page.d.ts +2 -1
  170. package/dist/types/client/mount/types.d.ts +2 -0
  171. package/dist/types/client/parser/confirm-spec.d.ts +27 -3
  172. package/dist/types/client/parser/data-config-parser.d.ts +6 -5
  173. package/dist/types/client/parser/style-config-parser.d.ts +7 -3
  174. package/dist/types/client/parser/timer-parser.d.ts +5 -0
  175. package/dist/types/client/parser/ui-config-parser.d.ts +6 -2
  176. package/dist/types/client/render-ports/hide-transition.d.ts +9 -0
  177. package/dist/types/client/render-ports/index.d.ts +4 -0
  178. package/dist/types/client/render-ports/notify-renderer.d.ts +2 -1
  179. package/dist/types/client/runtime/SomaSnapshotStore.d.ts +2 -0
  180. package/dist/types/client/security/url-guard.d.ts +14 -0
  181. package/dist/types/client/validation/async-check-registry.d.ts +2 -1
  182. package/dist/types/client/validation/object-rules.d.ts +0 -5
  183. package/dist/types/index.d.ts +6 -11
  184. package/dist/types/inspect/runtime.d.ts +2 -1
  185. package/dist/types/server/api/dispatch-service-api.d.ts +5 -0
  186. package/dist/types/server/api/load-host-service.d.ts +1 -1
  187. package/dist/types/server/api/paged-list.d.ts +101 -0
  188. package/dist/types/server/compile-port.d.ts +1 -1
  189. package/dist/types/server/host/host-assembly-entry.d.ts +1 -1
  190. package/dist/types/server/host/host-assembly.d.ts +2 -0
  191. package/dist/types/server/host/host-dir.d.ts +2 -0
  192. package/dist/types/server/host/invoke-host-request-hook.d.ts +10 -3
  193. package/dist/types/server/host/published-page-assets.d.ts +2 -1
  194. package/dist/types/server/host/resolve-host-request-hook.d.ts +18 -5
  195. package/dist/types/server/host/server-page-assets.d.ts +2 -1
  196. package/dist/types/server/host/source-aliases.d.cts +53 -0
  197. package/dist/types/server/host/source-aliases.d.ts +30 -0
  198. package/dist/types/server/host/source-packages.d.cts +2 -0
  199. package/dist/types/server/infra/cache/ServerFileCache.d.ts +8 -0
  200. package/dist/types/server/node.d.ts +1 -0
  201. package/dist/types/server/registry/declaration-precompiler.d.ts +0 -1
  202. package/dist/types/server/registry/registry-error.d.ts +5 -1
  203. package/dist/types/server/registry/registry-file-lock.d.ts +30 -0
  204. package/dist/types/server/registry/request-body-limit.d.ts +3 -2
  205. package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +3 -0
  206. package/dist/types/server/runtime-space/access-gate.d.ts +7 -0
  207. package/dist/types/server/runtime-space/bindings.d.ts +3 -2
  208. package/dist/types/server/runtime-space/dynamic-pages.d.ts +6 -1
  209. package/dist/types/server/runtime-space/errors.d.ts +1 -1
  210. package/dist/types/server/runtime-space/resolve.d.ts +2 -0
  211. package/dist/types/server/runtime-space/store.d.ts +8 -1
  212. package/dist/types/server/runtime-space/submit-steps.d.ts +2 -1
  213. package/dist/types/server/runtime-space/types.d.ts +3 -1
  214. package/dist/types/shared/component-tree-errors.d.ts +2 -1
  215. package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
  216. package/dist/types/shared/declaration-keys.d.ts +1 -1
  217. package/dist/types/shared/engines/engine-error.d.ts +2 -1
  218. package/dist/types/shared/generation-error.d.ts +2 -1
  219. package/dist/types/shared/pure-binding.d.ts +48 -0
  220. package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +149 -158
  221. package/dist/types/shared/registry-generated/limits.d.ts +54 -10
  222. package/dist/types/shared/registry-generated/std-grammar-completion.d.ts +0 -30
  223. package/dist/types/shared/registry-generated/std-grammar-views.d.ts +97 -23
  224. package/dist/types/shared/registry-generated/std-grammar.d.ts +110 -242
  225. package/dist/types/shared/soma-error.d.ts +15 -0
  226. package/dist/types/shared/types/data-config.types.d.ts +17 -17
  227. package/dist/types/shared/types/engine.types.d.ts +0 -3
  228. package/dist/types/shared/types/event.types.d.ts +9 -7
  229. package/dist/types/shared/types/generation-error.types.d.ts +1 -1
  230. package/dist/types/shared/types/host-assembly.types.d.ts +2 -0
  231. package/dist/types/shared/types/manifest.types.d.ts +0 -3
  232. package/dist/types/shared/types/region-scope.types.d.ts +4 -1
  233. package/dist/types/shared/types/scope-manifest.types.d.ts +0 -2
  234. package/dist/types/shared/types/style-config.types.d.ts +17 -19
  235. package/dist/types/shared/types/ui-config.types.d.ts +4 -5
  236. package/host-native/bin/host-native.cjs +22 -1
  237. package/host-native/client/browser-entry.ts +21 -172
  238. package/host-native/src/aot-builder.ts +75 -0
  239. package/host-native/src/host-prepare.ts +39 -5
  240. package/host-native/src/manifest-http.ts +2 -3
  241. package/host-native/src/native-server.ts +812 -174
  242. package/host-native/src/page-http.ts +3 -3
  243. package/host-native/src/public-packages.cjs +0 -1
  244. package/host-native/src/registry-handler.ts +12 -5
  245. package/host-native/src/static-file.ts +203 -53
  246. package/host-native/styles/globals.css +30 -28
  247. package/package.json +14 -2
  248. package/core/client/engine/step-runner.ts +0 -212
  249. package/core/client/engine/trigger-engine.ts +0 -55
  250. package/core/client/format/zoned.ts +0 -10
  251. package/core/client/parser/step-parser.ts +0 -359
  252. package/core/client/parser/trigger-parser.ts +0 -90
  253. package/core/client/parser/value-lang.ts +0 -340
  254. package/core/client/time/instant.ts +0 -2
  255. package/core/shared/calc/coerce.ts +0 -2
  256. package/core/shared/calc/errors.ts +0 -40
  257. package/core/shared/calc/evaluator.ts +0 -113
  258. package/core/shared/calc/index.ts +0 -11
  259. package/core/shared/calc/lexer.ts +0 -189
  260. package/core/shared/calc/parser.ts +0 -193
  261. package/core/shared/calc/typer.ts +0 -171
  262. package/core/shared/date-parts.ts +0 -2
  263. package/core/shared/show-when.ts +0 -77
  264. package/core/shared/types/step.types.ts +0 -91
  265. package/core/shared/types/trigger.types.ts +0 -14
  266. package/dist/types/client/engine/step-runner.d.ts +0 -42
  267. package/dist/types/client/engine/trigger-engine.d.ts +0 -16
  268. package/dist/types/client/format/zoned.d.ts +0 -1
  269. package/dist/types/client/parser/step-parser.d.ts +0 -23
  270. package/dist/types/client/parser/trigger-parser.d.ts +0 -13
  271. package/dist/types/client/parser/value-lang.d.ts +0 -63
  272. package/dist/types/client/time/instant.d.ts +0 -1
  273. package/dist/types/shared/calc/coerce.d.ts +0 -1
  274. package/dist/types/shared/calc/errors.d.ts +0 -14
  275. package/dist/types/shared/calc/evaluator.d.ts +0 -2
  276. package/dist/types/shared/calc/index.d.ts +0 -6
  277. package/dist/types/shared/calc/lexer.d.ts +0 -19
  278. package/dist/types/shared/calc/parser.d.ts +0 -43
  279. package/dist/types/shared/calc/typer.d.ts +0 -11
  280. package/dist/types/shared/date-parts.d.ts +0 -1
  281. package/dist/types/shared/show-when.d.ts +0 -21
  282. package/dist/types/shared/types/step.types.d.ts +0 -76
  283. package/dist/types/shared/types/trigger.types.d.ts +0 -12
@@ -114,12 +114,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
114
114
  readonly contexts: readonly ["state"];
115
115
  readonly writes: "member";
116
116
  readonly complete: true;
117
- }, {
118
- readonly file: "soma-core/core/shared/types/data-config.types.ts";
119
- readonly type: "SomaObjectVariants";
120
- readonly contexts: readonly ["variants"];
121
- readonly writes: "member";
122
- readonly complete: true;
123
117
  }, {
124
118
  readonly file: "soma-core/core/shared/types/session.types.ts";
125
119
  readonly type: "SomaSessionConfig";
@@ -167,11 +161,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
167
161
  readonly type: "SomaObjectConstraint";
168
162
  readonly contexts: readonly ["constraint"];
169
163
  readonly writes: "structural";
170
- }, {
171
- readonly file: "soma-core/core/shared/object-constraints.ts";
172
- readonly type: "SomaObjectConstraintWhen";
173
- readonly contexts: readonly ["constraint.when"];
174
- readonly writes: "structural";
175
164
  }];
176
165
  }, {
177
166
  readonly id: "facts";
@@ -548,11 +537,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
548
537
  readonly ref: "SOMA_VALIDATE_TRIGGERS";
549
538
  readonly values: readonly ["change", "blur", "submit"];
550
539
  readonly note: "写通道 validate_on 的校验时机:非空无重复列表";
551
- }, {
552
- readonly id: "show-when-presence-ops";
553
- readonly ref: "SOMA_SHOW_WHEN_PRESENCE_OPS";
554
- readonly values: readonly ["present", "blank"];
555
- readonly note: "Show when 对象形 { field, op, value? } 在谓词算子(predicate-ops)之外多出的有无值算子,不带 value:present = 非 null / undefined / 空白串 / 空数组(0 与 false 算有值,与动作 available_when.requires 同口径);blank = 相反。谓词里的 empty / not_empty 把 false 当空,口径不同";
556
540
  }, {
557
541
  readonly id: "url-schemes";
558
542
  readonly ref: "SOMA_URL_FIELD_SCHEMES";
@@ -670,7 +654,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
670
654
  readonly code: "ERR-BIZ-002";
671
655
  }];
672
656
  readonly status: "implemented";
673
- readonly note: "from[] 项键:api / params / into / require。require 是必填参数名数组(非空、无重复、都必须出现在同一项 params 里,违者 CORE-DATA-REQUIRE):任一必填参数解析后为 null / undefined / 空串时跳过这次请求,该来源不并入对象(写了 into 的子键落空数组),对象读状态为 idle(数据端口 getObjectStatus),不是错误;每次解析 / 重取重新判定。写入型对象:没有 from 但声明了 write 的 create / update / delete 至少一个端点是合法的(建单表单、登录、导入、联动目标):取数跳过、落空对象 {}、读状态 idle,data.submit 照常,write.reload 点名它时跳过重取;既无 from 也无写端点报「缺少 from 取数来源」(判定 data-config-parser.ts parseObject,测试 data-config-parser.test.ts 含负样本)";
657
+ readonly note: "from[] 项键:api / params / into / require。require 是必填参数名数组(非空、无重复、都必须出现在同一项 params 里,违者 CORE-DATA-REQUIRE);元素也可以是「至少一个」分组:2 个及以上不同参数名的数组,如 [[changeId, deliverableId]],可与单名混写,只此一层、不嵌套、同名不得跨单项与分组或两个分组重复:任一必填单名解析后为 null / undefined / 空串、或任一分组的成员全部为空时跳过这次请求,该来源不并入对象(写了 into 的子键落空数组),对象读状态为 idle(数据端口 getObjectStatus),不是错误;每次解析 / 重取重新判定。写入型对象:没有 from 但声明了 write 的 create / update / delete 至少一个端点是合法的(建单表单、登录、导入、联动目标):取数跳过、落空对象 {}、读状态 idle,data.submit 照常,write.reload 点名它时跳过重取;既无 from 也无写端点报「缺少 from 取数来源」(判定 data-config-parser.ts parseObject,测试 data-config-parser.test.ts 含负样本)";
674
658
  }, {
675
659
  readonly id: "poll.every";
676
660
  readonly context: "poll";
@@ -789,7 +773,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
789
773
  }];
790
774
  readonly terminal: {
791
775
  readonly kind: "consumed";
792
- readonly readers: readonly ["soma-ui/src/data-kit/"];
776
+ readonly readers: readonly ["soma-core/core/client/data/"];
793
777
  };
794
778
  }, {
795
779
  readonly path: readonly [{
@@ -1080,54 +1064,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
1080
1064
  };
1081
1065
  }];
1082
1066
  readonly docSummary: "持久度(memory / runtime / registry)";
1083
- }, {
1084
- readonly id: "object.transform";
1085
- readonly context: "object";
1086
- readonly key: "transform";
1087
- readonly order: 2;
1088
- readonly origin: "base";
1089
- readonly surface: readonly ["standard"];
1090
- readonly value: {
1091
- readonly kind: "map";
1092
- readonly of: "string";
1093
- };
1094
- readonly default: null;
1095
- readonly sample: {
1096
- readonly value: {
1097
- readonly total_text: "total | money";
1098
- };
1099
- };
1100
- readonly carry: {
1101
- readonly transform: "ObjectTransform";
1102
- };
1103
- readonly prop: "transform";
1104
- readonly carriesTo: readonly [{
1105
- readonly path: readonly [{
1106
- readonly stage: "core-config";
1107
- readonly prop: "SomaDataObjectConfig.transform";
1108
- }];
1109
- readonly terminal: {
1110
- readonly kind: "consumed";
1111
- readonly readers: readonly ["soma-core/core/client/data/data-object-resolver.ts"];
1112
- };
1113
- }, {
1114
- readonly path: readonly [{
1115
- readonly stage: "core-config";
1116
- readonly prop: "SomaDataObjectConfig.transform";
1117
- }, {
1118
- readonly stage: "facts";
1119
- readonly prop: "SomaFieldFact.derived";
1120
- }];
1121
- readonly terminal: {
1122
- readonly kind: "consumed";
1123
- readonly readers: readonly ["soma-ui/src/compiler/need/object-facts.ts", "soma-ui/src/compiler/settle/style.ts"];
1124
- };
1125
- }];
1126
- readonly effect: {
1127
- readonly changes: readonly ["artifact"];
1128
- };
1129
- readonly docSummary: "取数后派生";
1130
- readonly status: "implemented";
1131
1067
  }, {
1132
1068
  readonly id: "poll.while";
1133
1069
  readonly context: "poll";
@@ -1251,7 +1187,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
1251
1187
  }];
1252
1188
  readonly terminal: {
1253
1189
  readonly kind: "consumed";
1254
- readonly readers: readonly ["soma-core/core/client/data/", "soma-ui/src/compiler/page/", "soma-ui/src/data-kit/"];
1190
+ readonly readers: readonly ["soma-core/core/client/data/"];
1255
1191
  };
1256
1192
  }, {
1257
1193
  readonly path: readonly [{
@@ -1545,7 +1481,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
1545
1481
  readonly id: "object.fields";
1546
1482
  readonly context: "object";
1547
1483
  readonly key: "fields";
1548
- readonly order: 3;
1484
+ readonly order: 2;
1549
1485
  readonly origin: "base";
1550
1486
  readonly surface: readonly ["standard"];
1551
1487
  readonly value: {
@@ -2124,7 +2060,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2124
2060
  readonly id: "object.write";
2125
2061
  readonly context: "object";
2126
2062
  readonly key: "write";
2127
- readonly order: 5;
2063
+ readonly order: 4;
2128
2064
  readonly origin: "base";
2129
2065
  readonly surface: readonly ["standard"];
2130
2066
  readonly value: {
@@ -2450,57 +2386,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2450
2386
  };
2451
2387
  }];
2452
2388
  readonly docSummary: "导航项描述器 [{ key, text, href, active, forceIntoMore, children, divider, actions, priority, parent, access, available, requires, on_unavailable, route_to, requires_secrets, unavailable_reason }](C54:不可用分流 hide / grey,requires_secrets 点名外部密钥,route_to / unavailable_reason 只在 grey 时有意义)";
2453
- }, {
2454
- readonly id: "object.predicates";
2455
- readonly context: "object";
2456
- readonly key: "predicates";
2457
- readonly order: 6;
2458
- readonly origin: "base";
2459
- readonly surface: readonly ["standard"];
2460
- readonly value: {
2461
- readonly kind: "map";
2462
- readonly of: "shape";
2463
- };
2464
- readonly default: null;
2465
- readonly sample: {
2466
- readonly value: {
2467
- readonly vip: {
2468
- readonly field: "level";
2469
- readonly op: "eq";
2470
- readonly value: "vip";
2471
- };
2472
- };
2473
- readonly root: {
2474
- readonly from: readonly [{
2475
- readonly api: "/api/orders";
2476
- }];
2477
- readonly fields: {
2478
- readonly level: {
2479
- readonly type: "text";
2480
- };
2481
- };
2482
- };
2483
- };
2484
- readonly carry: {
2485
- readonly transform: "ObjectPredicates";
2486
- };
2487
- readonly prop: "predicates";
2488
- readonly carriesTo: readonly [{
2489
- readonly path: readonly [{
2490
- readonly stage: "core-config";
2491
- readonly prop: "SomaDataObjectConfig.predicates";
2492
- }];
2493
- readonly terminal: {
2494
- readonly kind: "consumed";
2495
- readonly readers: readonly ["soma-core/core/client/data/data-object-resolver.ts"];
2496
- };
2497
- }];
2498
- readonly effect: {
2499
- readonly changes: readonly ["runtime"];
2500
- };
2501
- readonly docSummary: "具名条件";
2502
- readonly status: "implemented";
2503
- readonly note: "页内 objects: 不收(编译产物形态)";
2504
2389
  }, {
2505
2390
  readonly id: "field.rule.max";
2506
2391
  readonly context: "field.rule";
@@ -2760,7 +2645,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2760
2645
  readonly id: "write.delete";
2761
2646
  readonly context: "write";
2762
2647
  readonly key: "delete";
2763
- readonly order: 9;
2648
+ readonly order: 7;
2764
2649
  readonly surface: readonly ["standard"];
2765
2650
  readonly value: {
2766
2651
  readonly kind: "shape";
@@ -2790,59 +2675,6 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2790
2675
  readonly lsp: {
2791
2676
  readonly detail: "删除端点 { api, method?: DELETE },不带请求体";
2792
2677
  };
2793
- }, {
2794
- readonly id: "field.rule.when";
2795
- readonly context: "field.rule";
2796
- readonly key: "when";
2797
- readonly order: 9;
2798
- readonly origin: "extra";
2799
- readonly surface: readonly ["standard"];
2800
- readonly value: {
2801
- readonly kind: "shape";
2802
- readonly shape: "predicate";
2803
- };
2804
- readonly default: null;
2805
- readonly sample: {
2806
- readonly value: {
2807
- readonly field: "g";
2808
- readonly op: "eq";
2809
- readonly value: true;
2810
- };
2811
- readonly with: {
2812
- readonly required: true;
2813
- };
2814
- readonly root: {
2815
- readonly from: readonly [{
2816
- readonly api: "/api/orders";
2817
- }];
2818
- readonly fields: {
2819
- readonly g: {
2820
- readonly type: "bool";
2821
- };
2822
- readonly f: {
2823
- readonly type: "int";
2824
- readonly rules: readonly [{
2825
- readonly message: "提示";
2826
- }];
2827
- };
2828
- };
2829
- };
2830
- };
2831
- readonly carriesTo: readonly [{
2832
- readonly path: readonly [{
2833
- readonly stage: "core-config";
2834
- readonly prop: "SomaDataFieldRule.when";
2835
- }];
2836
- readonly terminal: {
2837
- readonly kind: "consumed";
2838
- readonly readers: readonly ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/parser/data-config-parser.ts"];
2839
- };
2840
- }];
2841
- readonly effect: {
2842
- readonly changes: readonly ["runtime"];
2843
- };
2844
- readonly docSummary: "条件规则(谓词成立才参与)";
2845
- readonly status: "implemented";
2846
2678
  }, {
2847
2679
  readonly id: "page.envelope.locale";
2848
2680
  readonly context: "page.envelope";
@@ -2873,7 +2705,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2873
2705
  readonly id: "write.validate_on";
2874
2706
  readonly context: "write";
2875
2707
  readonly key: "validate_on";
2876
- readonly order: 10;
2708
+ readonly order: 8;
2877
2709
  readonly surface: readonly ["standard"];
2878
2710
  readonly value: {
2879
2711
  readonly kind: "list";
@@ -2906,7 +2738,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2906
2738
  readonly id: "write.failWhen";
2907
2739
  readonly context: "write";
2908
2740
  readonly key: "failWhen";
2909
- readonly order: 19;
2741
+ readonly order: 17;
2910
2742
  readonly surface: readonly ["standard"];
2911
2743
  readonly value: {
2912
2744
  readonly kind: "map";
@@ -2958,7 +2790,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
2958
2790
  readonly id: "write.messagePath";
2959
2791
  readonly context: "write";
2960
2792
  readonly key: "messagePath";
2961
- readonly order: 20;
2793
+ readonly order: 18;
2962
2794
  readonly surface: readonly ["standard"];
2963
2795
  readonly value: {
2964
2796
  readonly kind: "string";
@@ -3011,7 +2843,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3011
2843
  readonly id: "write.timeoutMs";
3012
2844
  readonly context: "write";
3013
2845
  readonly key: "timeoutMs";
3014
- readonly order: 21;
2846
+ readonly order: 19;
3015
2847
  readonly surface: readonly ["standard"];
3016
2848
  readonly value: {
3017
2849
  readonly kind: "int";
@@ -3062,7 +2894,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3062
2894
  readonly id: "field.rule.async";
3063
2895
  readonly context: "field.rule";
3064
2896
  readonly key: "async";
3065
- readonly order: 10;
2897
+ readonly order: 9;
3066
2898
  readonly origin: "extra";
3067
2899
  readonly surface: readonly ["standard"];
3068
2900
  readonly value: {
@@ -3125,7 +2957,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3125
2957
  readonly id: "field.rule.severity";
3126
2958
  readonly context: "field.rule";
3127
2959
  readonly key: "severity";
3128
- readonly order: 11;
2960
+ readonly order: 10;
3129
2961
  readonly origin: "base";
3130
2962
  readonly surface: readonly ["standard"];
3131
2963
  readonly value: {
@@ -3215,7 +3047,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3215
3047
  readonly id: "object.name";
3216
3048
  readonly context: "object";
3217
3049
  readonly key: "name";
3218
- readonly order: 13;
3050
+ readonly order: 10;
3219
3051
  readonly origin: "extra";
3220
3052
  readonly surface: readonly ["standard"];
3221
3053
  readonly value: {
@@ -3288,7 +3120,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3288
3120
  readonly id: "object.poll";
3289
3121
  readonly context: "object";
3290
3122
  readonly key: "poll";
3291
- readonly order: 20;
3123
+ readonly order: 17;
3292
3124
  readonly origin: "extra";
3293
3125
  readonly surface: readonly ["standard"];
3294
3126
  readonly value: {
@@ -3342,70 +3174,11 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3342
3174
  };
3343
3175
  readonly docSummary: "自动重取";
3344
3176
  readonly status: "implemented";
3345
- }, {
3346
- readonly id: "field.calc";
3347
- readonly context: "field";
3348
- readonly key: "calc";
3349
- readonly order: 6;
3350
- readonly origin: "base";
3351
- readonly surface: readonly ["standard"];
3352
- readonly value: {
3353
- readonly kind: "string";
3354
- };
3355
- readonly default: null;
3356
- readonly sample: {
3357
- readonly value: "[revenue] - [cost]";
3358
- readonly root: {
3359
- readonly from: readonly [{
3360
- readonly api: "/api/orders";
3361
- }];
3362
- readonly fields: {
3363
- readonly revenue: {
3364
- readonly type: "money";
3365
- };
3366
- readonly cost: {
3367
- readonly type: "money";
3368
- };
3369
- readonly f: {
3370
- readonly type: "money";
3371
- };
3372
- };
3373
- };
3374
- };
3375
- readonly carry: "passthrough";
3376
- readonly prop: "calc";
3377
- readonly carriesTo: readonly [{
3378
- readonly path: readonly [{
3379
- readonly stage: "core-config";
3380
- readonly prop: "SomaDataFieldConfig.calc";
3381
- }];
3382
- readonly terminal: {
3383
- readonly kind: "consumed";
3384
- readonly readers: readonly ["soma-core/core/client/data/", "soma-ui/src/compiler/certify/invariants/edit.ts", "soma-ui/src/compiler/page/region-scope.ts", "soma-ui/src/data-kit/"];
3385
- };
3386
- }, {
3387
- readonly path: readonly [{
3388
- readonly stage: "core-config";
3389
- readonly prop: "SomaDataFieldConfig.calc";
3390
- }, {
3391
- readonly stage: "facts";
3392
- readonly prop: "SomaFieldFact.derived";
3393
- }];
3394
- readonly terminal: {
3395
- readonly kind: "consumed";
3396
- readonly readers: readonly ["soma-ui/src/compiler/need/object-facts.ts", "soma-ui/src/compiler/settle/style.ts"];
3397
- };
3398
- }];
3399
- readonly effect: {
3400
- readonly changes: readonly ["artifact"];
3401
- };
3402
- readonly docSummary: "派生";
3403
- readonly status: "implemented";
3404
3177
  }, {
3405
3178
  readonly id: "field.default";
3406
3179
  readonly context: "field";
3407
3180
  readonly key: "default";
3408
- readonly order: 29;
3181
+ readonly order: 26;
3409
3182
  readonly origin: "extra";
3410
3183
  readonly surface: readonly ["standard"];
3411
3184
  readonly value: {
@@ -3439,6 +3212,101 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
3439
3212
  readonly docSummary: "新建初值";
3440
3213
  readonly status: "implemented";
3441
3214
  }];
3215
+ readonly pageForbiddenLogicKeys: {
3216
+ readonly title: "视觉页面不含逻辑语法:页面语法里禁止出现的逻辑键(三层分工:业务逻辑归业务对象,交互逻辑归展示对象,页面只做纯视觉翻译;见 knowledge/SOMA领域建模与组件编写准则.md §1.0)";
3217
+ readonly decidedAt: "2026-11-09";
3218
+ readonly keys: readonly [{
3219
+ readonly key: "calc";
3220
+ readonly was: "core 字段计算";
3221
+ }, {
3222
+ readonly key: "derive";
3223
+ readonly was: "foundation 字段级派生(K19)/ kit derive 模板";
3224
+ }, {
3225
+ readonly key: "derived";
3226
+ readonly was: "页面声明里的派生写法";
3227
+ }, {
3228
+ readonly key: "showWhen";
3229
+ readonly was: "条件显示";
3230
+ }, {
3231
+ readonly key: "hiddenWhen";
3232
+ readonly was: "条件隐藏";
3233
+ }, {
3234
+ readonly key: "disabledWhen";
3235
+ readonly was: "条件禁用";
3236
+ }, {
3237
+ readonly key: "requiredWhen";
3238
+ readonly was: "条件必填";
3239
+ }, {
3240
+ readonly key: "when";
3241
+ readonly was: "动作 when 条件 / show when 对象谓词 { field, op, value } / rules[].when 条件规则(纯路径字符串形 when 是纯绑定,放行)";
3242
+ readonly forbiddenShape: "object";
3243
+ }, {
3244
+ readonly key: "predicates";
3245
+ readonly scope: "standard";
3246
+ readonly was: "data.<对象>.predicates 具名谓词";
3247
+ }, {
3248
+ readonly key: "transform";
3249
+ readonly scope: "standard";
3250
+ readonly was: "data.<对象>.transform 取数后派生字段";
3251
+ }, {
3252
+ readonly key: "steps";
3253
+ readonly scope: "standard";
3254
+ readonly was: "_event 事件编排(when / switch / for_each / goto)";
3255
+ }, {
3256
+ readonly key: "triggers";
3257
+ readonly scope: "standard";
3258
+ readonly was: "_event triggers 条件触发器(condition + value)";
3259
+ }, {
3260
+ readonly key: "switch";
3261
+ readonly scope: "standard";
3262
+ readonly was: "_event steps 内 switch 条件分支";
3263
+ }, {
3264
+ readonly key: "for_each";
3265
+ readonly scope: "standard";
3266
+ readonly was: "_event steps 内 for_each 循环";
3267
+ }, {
3268
+ readonly key: "parallel";
3269
+ readonly scope: "standard";
3270
+ readonly was: "_event steps 内 parallel 并行编排";
3271
+ }];
3272
+ readonly pureBinding: {
3273
+ readonly title: "展示对象的值对页面只读:页面只做纯路径读取,不在页面里取反、比较、映射;需要判断的地方由展示对象直接给最终值(2026-11-10 裁决)";
3274
+ readonly negatedPath: {
3275
+ readonly code: "CORE-PAGE-NEGATE-FORBIDDEN";
3276
+ readonly prefix: "!";
3277
+ readonly positions: readonly ["show.when", "show.class 值", "show.props 值", "嵌套绑定 when"];
3278
+ readonly pathPattern: "^!\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+\\s*$";
3279
+ readonly was: "`!path` 取反前缀(when / class 条件路径 / 组件 props 值)";
3280
+ readonly remedy: "由展示对象另给相反的成员(如 remarkHidden),页面绑定它";
3281
+ };
3282
+ readonly styleComparison: {
3283
+ readonly code: "CORE-STYLE-COMPARE-FORBIDDEN";
3284
+ readonly keys: readonly ["condition", "value"];
3285
+ readonly positions: readonly ["_style states 条目", "_style transitions.active_state"];
3286
+ readonly was: "_style states 的 `condition: 路径` + `value` 比较 + `apply`,以及 transitions.active_state 的 condition + value";
3287
+ readonly remedy: "改写成类名档位绑定:`bind: page.成员` + `tiers: { 档位名: 类名 }`,成员的值就是档位名";
3288
+ };
3289
+ readonly styleTier: {
3290
+ readonly keys: readonly ["bind", "tiers"];
3291
+ readonly tierNamePattern: "^[a-z][a-z0-9_-]*$";
3292
+ readonly maxTiers: 8;
3293
+ readonly positions: readonly ["_style states.<锚点>", "_style transitions.<锚点>(trigger: active_state)"];
3294
+ readonly note: "bind 是纯路径(点分标识符,无取反 / 管道 / 运算符);tiers 是 档位名 到 类名串 的闭集映射,成员值不在档位内时不加任何类;档位名闭集 pattern 与个数上限读本节,页面不写比较";
3295
+ };
3296
+ readonly roleBy: {
3297
+ readonly code: "CORE-PAGE-ROLE-BY-INVALID";
3298
+ readonly pathPattern: "^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$";
3299
+ readonly positions: readonly ["bind.role_by"];
3300
+ readonly was: "bind.role_by 写了表达式 / 取反 / 管道 / 映射";
3301
+ readonly remedy: "role_by 只许纯路径:行字段的值直接作为模板名,匹配 data-soma-role=\"item:取值\";行数据自带模板名";
3302
+ };
3303
+ };
3304
+ readonly exemptContexts: readonly ["diagnostics", "diagnosticExamples", "rejected", "title", "basis", "was", "summary", "docSummary"];
3305
+ readonly exampleRoots: readonly ["soma-kit-demo/pages", "soma-kit/examples", "soma-ui/tests/fixtures/hosts", "soma-core-demo/ui", "soma-core-demo/pages"];
3306
+ readonly exampleFilePatterns: readonly ["_ui.yaml", ".kit.yaml", "_style.yaml"];
3307
+ readonly exampleSkipDirs: readonly ["node_modules", "negative", "__negative__"];
3308
+ readonly note: "forbiddenShape: 'object' = 只禁对象 / 列表形,值为字符串(纯路径绑定)放行;scope: 'standard' = 只在 core 标准格式(四件套 / 注入口)判定,不进 G83 的跨方言语法源与示例页扫描(方言同名键含义不同,如 steps 页面模式)";
3309
+ };
3442
3310
  readonly views: readonly [{
3443
3311
  readonly name: "SOMA_DATA_OBJECT_KEYS";
3444
3312
  readonly kind: "keys";
@@ -0,0 +1,15 @@
1
+ export declare class SomaError extends Error {
2
+ /**
3
+ * 错误码;由子类声明并赋值,基类不写入。
4
+ * 绝大多数子类用字符串码;注册中心错误(`RegistryError`)沿用 45xx 数字码,故类型放宽到 `string | number`,
5
+ * 子类可收窄为 `string` 或 `number`。读码的统一口径 `somaErrorCodeOf` 仍只认非空字符串(数字码读不出、不会被误当字符串码)。
6
+ */
7
+ readonly code?: string | number;
8
+ constructor(message?: string, options?: {
9
+ cause?: unknown;
10
+ });
11
+ }
12
+ /** 是否 SOMA 受控错误:`instanceof SomaError`,或(跨打包副本时)Error 且带非空字符串码 */
13
+ export declare function isSomaError(value: unknown): value is SomaError;
14
+ /** 读出错误码;不是 Error 或没有非空字符串码时返回 undefined */
15
+ export declare function somaErrorCodeOf(value: unknown): string | undefined;
@@ -1,4 +1,4 @@
1
- import type { SomaFieldPredicate, SomaNamedPredicates } from '../predicates';
1
+ import type { SomaFieldPredicate } from '../predicates';
2
2
  import type { SomaWriteActionName, SomaWriteOutcomeView } from './write-outcome-view.types';
3
3
  import type { SomaWriteOutcomeMeta } from './write.types';
4
4
  import { SOMA_STD_DOMAIN_FIELD_TYPES } from '../registry-generated/std-grammar-views';
@@ -56,8 +56,6 @@ export interface SomaDataFieldRule {
56
56
  severity?: SomaValidationSeverity;
57
57
  /** 校验失败提示文案 */
58
58
  message: string;
59
- /** 条件规则(`rules[].when`):对所在记录求值的字段谓词,成立才执行本条规则;没写 = 恒参与 */
60
- when?: SomaFieldPredicate;
61
59
  }
62
60
  /** 字段字典条目(驱动 UI 的元数据,全部可选) */
63
61
  export interface SomaDataFieldConfig {
@@ -71,12 +69,6 @@ export interface SomaDataFieldConfig {
71
69
  options?: SomaDataFieldOption[];
72
70
  /** 缺省值 */
73
71
  default?: unknown;
74
- /**
75
- * 派生列:`"[revenue] - [cost]"`。受限算式(方括号引用同对象字段、四则、比较、六个函数),
76
- * 解析期推出结果类型并与声明的 `type` 对账;取数收尾时由 core 算出来挂到记录上。
77
- * 派生字段是算出来的,提交时不能写它。
78
- */
79
- calc?: string;
80
72
  }
81
73
  /**
82
74
  * 单个取数来源:一个后端接口 + 参数 + 聚合位置。
@@ -94,8 +86,10 @@ export interface SomaDataSourceConfig {
94
86
  * 必填参数名(都必须出现在同一项的 `params` 里):任一必填参数解析后为 null / undefined / 空串时跳过本次请求,
95
87
  * 该来源不并入对象(写了 `into` 的子键落空数组),对象标 `idle`(数据端口 `getObjectStatus`);不是错误。
96
88
  * 每次解析 / 重取都重新判定,参数补齐后的下一次重取就会发请求。
89
+ * 元素也可以是「至少一个」分组:2 个及以上不同参数名的数组(如 `[[changeId, deliverableId]]`),
90
+ * 组内全部为空才跳过;单名字符串与分组可混写。只此一层,不嵌套、不取反、不表达「恰好一个」。
97
91
  */
98
- require?: string[];
92
+ require?: Array<string | string[]>;
99
93
  /** 响应信封失败判定:HTTP 成功但响应体命中此闭集谓词即按取数失败(字段是响应体顶层键,深取用 `path`) */
100
94
  failWhen?: SomaFieldPredicate;
101
95
  /** 命中 failWhen 时,业务错误信息在响应体里的点路径 */
@@ -181,19 +175,12 @@ export interface SomaDataObjectConfig {
181
175
  displayName?: string;
182
176
  /** 取数来源列表 */
183
177
  from: SomaDataSourceConfig[];
184
- /**
185
- * 派生字段:值为 "源字段路径 | 管道链"(复用 pipe-registry)。
186
- * 解析期已归一化为标准管道语法(`date: 'x'` → `date('x')`)。
187
- */
188
- transform?: Record<string, string>;
189
178
  /** 字段字典(字段名 → 字典条目) */
190
179
  fields?: Record<string, SomaDataFieldConfig>;
191
180
  /** 写通道声明;不给 = 该对象只读 */
192
181
  write?: SomaDataWriteConfig;
193
182
  /** 对象级轮询:服务端状态会自己变的对象(排队 → 生成中 → 已生成) */
194
183
  poll?: SomaObjectPoll;
195
- /** 具名谓词表:`{ 名字: 谓词 }`,条件规则 `{ ref: 名字 }` 复用 */
196
- predicates?: SomaNamedPredicates;
197
184
  /** 解析期提取:params 引用到的其他数据对象名(DAG 拓扑排序输入,不含自引用) */
198
185
  deps: string[];
199
186
  }
@@ -231,6 +218,17 @@ export type SomaCommandResult = {
231
218
  status?: number;
232
219
  fieldErrors?: Record<string, string>;
233
220
  };
221
+ /** 数据对象标准读状态 */
222
+ export type SomaDataReadState = 'idle' | 'loading' | 'ready' | 'error' | 'forbidden' | 'partial';
223
+ /** 数据对象完整读状态视图(同时以非枚举属性挂在数据对象自身上) */
224
+ export interface SomaDataReadStatus {
225
+ readonly readState: SomaDataReadState;
226
+ readonly loading: boolean;
227
+ readonly ready: boolean;
228
+ readonly errorMessage?: string;
229
+ readonly errorStatus?: number;
230
+ readonly retry?: () => Promise<void>;
231
+ }
234
232
  /**
235
233
  * 注入给组件的数据端口(services 白名单里的 `data`)。
236
234
  * 复杂度沉引擎:组件只做「收值 → 调 submit → 渲染返回的 fieldErrors」。
@@ -240,6 +238,8 @@ export interface SomaDataPort {
240
238
  getObject(name: string): unknown;
241
239
  /** 对象读状态:`idle` = 因 `from[].require` 的必填参数缺而跳过过请求;`ready` = 其余;未声明 / 数据层未就绪 = undefined */
242
240
  getObjectStatus?(name: string): 'idle' | 'ready' | undefined;
241
+ /** 对象完整读状态(含 loading / ready / error / forbidden / partial、错误信息、状态码与 retry) */
242
+ getObjectReadStatus?(name: string): SomaDataReadStatus | undefined;
243
243
  /** 字段字典(控件 / 校验来源) */
244
244
  getDict(name: string): Record<string, SomaDataFieldConfig>;
245
245
  /** 提交:剔只读字段、map/only、基础规则校验、version 令牌、构体、发请求、错误逆映射;从不抛 */
@@ -9,9 +9,6 @@ export interface BindingEntry {
9
9
  templateCache?: DocumentFragment;
10
10
  childShowConfig?: ShowMapping;
11
11
  attrName?: string;
12
- negate?: boolean;
13
- /** `when` 对象谓词(来自 SomaCompiledBinding.whenTest) */
14
- whenTest?: import('../show-when').SomaShowWhenTest;
15
12
  classRules?: Record<string, string>;
16
13
  /** 展示格式化管道链(text/attr 绑定,来自 SomaCompiledBinding.pipes) */
17
14
  pipes?: import('./scope-manifest.types').SomaPipeCall[];
@@ -2,9 +2,8 @@
2
2
  * 事件类型枚举
3
3
  * 定义 Pipeline DSL 支持的四种事件处理类型
4
4
  */
5
- import type { SomaStepGraph } from './step.types';
6
5
  import type { SomaScopeEventSpec } from './region-scope.types';
7
- export type EventType = 'NAV_STATIC' | 'NAV_ACTION' | 'UI_REFRESH' | 'UI_INTERACT' | 'ACTION' | 'SCOPE' | 'NOTIFY' | 'STEPS';
6
+ export type EventType = 'NAV_STATIC' | 'NAV_ACTION' | 'UI_REFRESH' | 'UI_INTERACT' | 'ACTION' | 'SCOPE' | 'NOTIFY';
8
7
  /**
9
8
  * UI 交互动作枚举
10
9
  * 用于 UI_INTERACT 类型的动作指令
@@ -33,6 +32,9 @@ export interface NotifyDeclaration {
33
32
  /** 确认分级闭集(R-23 / AD-43):plain 一句话确认 / typed 键入固定词 / consent 先勾选同意 */
34
33
  export declare const SOMA_CONFIRM_LEVELS: readonly ["plain", "typed", "consent"];
35
34
  export type SomaConfirmLevel = (typeof SOMA_CONFIRM_LEVELS)[number];
35
+ /** 确认语气闭集:default 常规 / danger 破坏性(删除等)。中性词,不规定样子;缺省 = default */
36
+ export declare const SOMA_CONFIRM_TONES: readonly ["default", "danger"];
37
+ export type SomaConfirmTone = (typeof SOMA_CONFIRM_TONES)[number];
36
38
  /** 确认规格:`confirm:` 段的标准结构 */
37
39
  export interface SomaConfirmSpec {
38
40
  readonly level: SomaConfirmLevel;
@@ -42,17 +44,17 @@ export interface SomaConfirmSpec {
42
44
  readonly phrase?: string;
43
45
  /** 关联项影响说明;consent 级必写,typed 级可选 */
44
46
  readonly impact?: string;
47
+ /**
48
+ * 语气:只有 `danger` 会出现(`default` / 不写 = 常规,解析时归一为不带本字段)。
49
+ * 渲染端口据它决定确认钮的警示呈现与初始焦点(破坏性确认的初始焦点应在「取消」);typed / consent 的放行规则不受它影响。
50
+ */
51
+ readonly tone?: Exclude<SomaConfirmTone, 'default'>;
45
52
  }
46
53
  /**
47
54
  * 解析后的事件配置
48
55
  * Pipeline DSL 解析器将 YAML 中的事件声明解析为此结构
49
56
  */
50
57
  export interface ParsedEvent {
51
- /**
52
- * 动作编排图(`type === 'STEPS'` 时有)。
53
- * 解析在 `step-parser`,执行在 `step-runner`;不带它的事件走原来的单管道路径。
54
- */
55
- steps?: SomaStepGraph;
56
58
  /** 目标元素的 data-soma-id 值 */
57
59
  somaId: string;
58
60
  /** DOM 事件类型(click, input, change, keydown 等) */