soma-core 1.3.2 → 1.3.4

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 (281) hide show
  1. package/README.md +43 -0
  2. package/app/SomaPageClient.tsx +22 -68
  3. package/app/[...path]/page.tsx +7 -6
  4. package/app/api/[...path]/route.ts +3 -3
  5. package/app/api/soma-registry/[...path]/route.ts +67 -0
  6. package/app/components/SomaHostPage.tsx +3 -8
  7. package/app/components/SomaPageClientBoundary.tsx +13 -0
  8. package/app/layout.tsx +6 -1
  9. package/app/page.tsx +3 -3
  10. package/app/soma/manifest/route.ts +1 -0
  11. package/app/soma/page-object/route.ts +1 -1
  12. package/bin/soma-lsp.cjs +1 -4
  13. package/core/build/compiler/full-manifest-builder.ts +19 -23
  14. package/core/build/compiler/html-include-expander.ts +56 -0
  15. package/core/build/compiler/page-assets.ts +26 -0
  16. package/core/build/compiler/page-declaration-compiler.ts +85 -0
  17. package/core/build/compiler/rollup-plugin-soma.ts +4 -13
  18. package/core/build/compiler/route-builder.ts +0 -2
  19. package/core/build/compiler/rspack-plugin-soma.js +1 -10
  20. package/core/build/compiler/soma-manifest-webpack-plugin.js +54 -9
  21. package/core/build/compiler/soma-precompile.js +3581 -2387
  22. package/core/build/compiler/soma-precompile.ts +44 -2
  23. package/core/build/compiler/soma-rspack-yaml-loader.js +5 -8
  24. package/core/build/compiler/soma-webpack-loader.js +6 -15
  25. package/core/build/compiler/vite-plugin-soma.ts +9 -21
  26. package/core/build/component/pack-from-dir.ts +58 -0
  27. package/core/build/component/package-loader.ts +281 -0
  28. package/core/build/eject/apply-eject.ts +133 -0
  29. package/core/build/eject/plan-eject.ts +133 -0
  30. package/core/build/lsp/cross-file-diagnostics.cjs +82 -113
  31. package/core/build/lsp/extra-completion.cjs +14 -8
  32. package/core/build/lsp/lsp-navigation.cjs +50 -43
  33. package/core/build/lsp/soma-declaration.cjs +85 -0
  34. package/core/build/lsp/ui-yaml-completion.cjs +98 -104
  35. package/core/build/v2/block-compile.ts +200 -0
  36. package/core/build/v2/block-loader.ts +33 -0
  37. package/core/build/v2/html-index.ts +120 -0
  38. package/core/build/v2/migrate-v1.ts +370 -0
  39. package/core/build/v2/soma-file-loader.ts +216 -0
  40. package/core/client/adaptive/flush-scheduler.ts +96 -0
  41. package/core/client/adaptive/hysteresis.ts +56 -0
  42. package/core/client/adaptive/index.ts +23 -0
  43. package/core/client/adaptive/observer-pool.ts +90 -0
  44. package/core/client/base/SomaPageRootBase.ts +50 -0
  45. package/core/client/compiler/adaptive-compile.ts +136 -0
  46. package/core/client/compiler/manifest-compiler.ts +155 -27
  47. package/core/client/component/ai-catalog.ts +277 -0
  48. package/core/client/component/component-definition.types.ts +65 -0
  49. package/core/client/component/component-expander.ts +119 -0
  50. package/core/client/component/component-manager.ts +933 -0
  51. package/core/client/component/component-pack.ts +445 -0
  52. package/core/client/component/component-registry.ts +71 -0
  53. package/core/client/component/contract-compat.ts +132 -0
  54. package/core/client/component/example-v2.ts +132 -0
  55. package/core/client/component/pack-styles.ts +94 -0
  56. package/core/client/component/scoped-adapter.ts +85 -0
  57. package/core/client/component/verify-pack.ts +247 -0
  58. package/core/client/container/MiniProgramContainerAdapter.ts +15 -1
  59. package/core/client/container/ReactNativeContainerAdapter.ts +15 -1
  60. package/core/client/container/SomaContainerAdapter.ts +186 -180
  61. package/core/client/data/data-object-resolver.ts +417 -0
  62. package/core/client/diagnostics/SomaDiagnostics.ts +187 -186
  63. package/core/client/diagnostics/boot-timings.ts +152 -0
  64. package/core/client/engine/asset-resolver.ts +12 -2
  65. package/core/client/engine/dom-renderer.ts +249 -24
  66. package/core/client/engine/emit-event.ts +21 -0
  67. package/core/client/engine/event-engine.ts +34 -4
  68. package/core/client/engine/on-change-engine.ts +1 -1
  69. package/core/client/engine/property-watcher.ts +1 -1
  70. package/core/client/engine/reactive-proxy.ts +11 -10
  71. package/core/client/engine/render-engine.ts +39 -4
  72. package/core/client/engine/runtime-builder.ts +23 -0
  73. package/core/client/engine/soma-bootstrap.ts +380 -7
  74. package/core/client/engine/style-binder.ts +47 -1
  75. package/core/client/observability/error-reporter.ts +173 -0
  76. package/core/client/parser/adaptive-parser.ts +264 -0
  77. package/core/client/parser/data-config-parser.ts +396 -0
  78. package/core/client/parser/pipeline-parser.ts +15 -3
  79. package/core/client/parser/style-config-parser.ts +65 -2
  80. package/core/client/parser/ui-config-parser.ts +52 -3
  81. package/core/client/parser/v2/namespace.ts +182 -0
  82. package/core/client/parser/v2/page-parser.ts +359 -0
  83. package/core/client/parser/v2/use-parser.ts +412 -0
  84. package/core/client/parser/value-lang.ts +340 -0
  85. package/core/client/pipes/pipe-registry.ts +249 -0
  86. package/core/client/quality/SomaQualityRegistry.ts +3 -0
  87. package/core/client/registry/declaration-renderer.ts +161 -0
  88. package/core/client/registry/index.ts +28 -0
  89. package/core/client/registry/page-lifecycle.ts +171 -0
  90. package/core/client/registry/remote-page.ts +139 -0
  91. package/core/client/runtime/SomaRuntimeServices.ts +24 -0
  92. package/core/client/security/attribute-presence.ts +70 -0
  93. package/core/client/security/html-sanitizer.ts +113 -0
  94. package/core/client/security/url-guard.ts +0 -0
  95. package/core/client/theme/harmony.ts +307 -0
  96. package/core/client/theme/scene-tokens.ts +134 -0
  97. package/core/client/theme/theme-axes.ts +228 -0
  98. package/core/client/theme/theme-engine.ts +1196 -0
  99. package/core/client/theme/tone-solver.ts +118 -0
  100. package/core/client/typography/typography-base.ts +34 -0
  101. package/core/client/validation/contract-validator.ts +48 -5
  102. package/core/index.ts +262 -2
  103. package/core/server/api/IService.ts +18 -6
  104. package/core/server/api/load-host-service.ts +3 -3
  105. package/core/server/host/content-security-policy.ts +190 -0
  106. package/core/server/host/csp-nonce-metadata.ts +75 -0
  107. package/core/server/host/resolve-host-request-hook.ts +5 -0
  108. package/core/server/host/server-page-assets.ts +34 -7
  109. package/core/server/host/soma-page-compile.ts +33 -0
  110. package/core/server/index.ts +45 -1
  111. package/core/server/infra/cache/ServerFileCache.ts +1 -1
  112. package/core/server/mock/node/cli.mjs +2 -2
  113. package/core/server/registry/api-registry-store.ts +518 -0
  114. package/core/server/registry/conditional-object-store.ts +29 -0
  115. package/core/server/registry/declaration-precompiler.ts +99 -0
  116. package/core/server/registry/in-memory-conditional-object-store.ts +43 -0
  117. package/core/server/registry/index.ts +142 -0
  118. package/core/server/registry/page-registry-repository.ts +373 -0
  119. package/core/server/registry/page-registry-store.ts +932 -0
  120. package/core/server/registry/registry-error.ts +17 -0
  121. package/core/server/registry/registry-file-lock.ts +173 -0
  122. package/core/server/registry/registry-response.ts +71 -0
  123. package/core/server/registry/registry-subjects.ts +194 -0
  124. package/core/server/registry/registry-write-pipeline.ts +240 -0
  125. package/core/server/registry/request-body-limit.ts +99 -0
  126. package/core/server/registry/services/apis/Get.ts +25 -0
  127. package/core/server/registry/services/apis/List.ts +41 -0
  128. package/core/server/registry/services/apis/Register.ts +39 -0
  129. package/core/server/registry/services/apis/Unregister.ts +24 -0
  130. package/core/server/registry/services/index.ts +40 -0
  131. package/core/server/registry/services/pages/Get.ts +96 -0
  132. package/core/server/registry/services/pages/List.ts +53 -0
  133. package/core/server/registry/services/pages/Register.ts +49 -0
  134. package/core/server/registry/services/pages/Rollback.ts +36 -0
  135. package/core/server/registry/services/pages/Unregister.ts +23 -0
  136. package/core/server/registry/services/service-utils.ts +21 -0
  137. package/core/server/registry/validation/compile-gate.ts +54 -0
  138. package/core/server/registry/validation/component-existence.ts +55 -0
  139. package/core/server/registry/validation/credential-ban.ts +86 -0
  140. package/core/server/registry/validation/cross-check.ts +67 -0
  141. package/core/server/registry/validation/declaration-safety-scan.ts +102 -0
  142. package/core/shared/types/adaptive.types.ts +109 -0
  143. package/core/shared/types/component-contract.types.ts +120 -0
  144. package/core/shared/types/data-config.types.ts +105 -0
  145. package/core/shared/types/domain.types.ts +6 -0
  146. package/core/shared/types/engine.types.ts +41 -35
  147. package/core/shared/types/manifest.types.ts +55 -32
  148. package/core/shared/types/scope-manifest.types.ts +96 -0
  149. package/core/shared/types/style-config.types.ts +9 -0
  150. package/core/shared/types/ui-config.types.ts +118 -98
  151. package/dist/cli/soma.js +20 -5
  152. package/dist/core/index.cjs +7811 -1380
  153. package/dist/types/build/compiler/full-manifest-builder.d.ts +6 -2
  154. package/dist/types/build/compiler/html-include-expander.d.ts +19 -0
  155. package/dist/types/build/compiler/page-assets.d.ts +3 -0
  156. package/dist/types/build/compiler/page-declaration-compiler.d.ts +33 -0
  157. package/dist/types/build/compiler/rollup-plugin-soma.d.ts +0 -2
  158. package/dist/types/build/compiler/route-builder.d.ts +0 -1
  159. package/dist/types/build/compiler/soma-precompile.d.ts +17 -0
  160. package/dist/types/build/compiler/vite-plugin-soma.d.ts +2 -7
  161. package/dist/types/build/component/pack-from-dir.d.ts +17 -0
  162. package/dist/types/build/component/package-loader.d.ts +40 -0
  163. package/dist/types/build/eject/apply-eject.d.ts +22 -0
  164. package/dist/types/build/eject/plan-eject.d.ts +32 -0
  165. package/dist/types/build/v2/block-compile.d.ts +28 -0
  166. package/dist/types/build/v2/block-loader.d.ts +9 -0
  167. package/dist/types/build/v2/html-index.d.ts +37 -0
  168. package/dist/types/build/v2/migrate-v1.d.ts +32 -0
  169. package/dist/types/build/v2/soma-file-loader.d.ts +45 -0
  170. package/dist/types/client/adaptive/flush-scheduler.d.ts +13 -0
  171. package/dist/types/client/adaptive/hysteresis.d.ts +16 -0
  172. package/dist/types/client/adaptive/index.d.ts +5 -0
  173. package/dist/types/client/adaptive/observer-pool.d.ts +15 -0
  174. package/dist/types/client/base/SomaPageRootBase.d.ts +33 -0
  175. package/dist/types/client/compiler/adaptive-compile.d.ts +26 -0
  176. package/dist/types/client/compiler/manifest-compiler.d.ts +13 -2
  177. package/dist/types/client/component/ai-catalog.d.ts +73 -0
  178. package/dist/types/client/component/component-definition.types.d.ts +54 -0
  179. package/dist/types/client/component/component-expander.d.ts +25 -0
  180. package/dist/types/client/component/component-manager.d.ts +160 -0
  181. package/dist/types/client/component/component-pack.d.ts +110 -0
  182. package/dist/types/client/component/component-registry.d.ts +12 -0
  183. package/dist/types/client/component/contract-compat.d.ts +16 -0
  184. package/dist/types/client/component/example-v2.d.ts +9 -0
  185. package/dist/types/client/component/pack-styles.d.ts +22 -0
  186. package/dist/types/client/component/scoped-adapter.d.ts +18 -0
  187. package/dist/types/client/component/verify-pack.d.ts +14 -0
  188. package/dist/types/client/data/data-object-resolver.d.ts +71 -0
  189. package/dist/types/client/diagnostics/SomaDiagnostics.d.ts +2 -1
  190. package/dist/types/client/diagnostics/boot-timings.d.ts +30 -0
  191. package/dist/types/client/engine/asset-resolver.d.ts +7 -1
  192. package/dist/types/client/engine/dom-renderer.d.ts +51 -1
  193. package/dist/types/client/engine/emit-event.d.ts +6 -0
  194. package/dist/types/client/engine/event-engine.d.ts +6 -0
  195. package/dist/types/client/engine/render-engine.d.ts +25 -1
  196. package/dist/types/client/engine/runtime-builder.d.ts +7 -0
  197. package/dist/types/client/engine/soma-bootstrap.d.ts +118 -0
  198. package/dist/types/client/observability/error-reporter.d.ts +51 -0
  199. package/dist/types/client/parser/adaptive-parser.d.ts +28 -0
  200. package/dist/types/client/parser/data-config-parser.d.ts +34 -0
  201. package/dist/types/client/parser/pipeline-parser.d.ts +2 -0
  202. package/dist/types/client/parser/style-config-parser.d.ts +5 -3
  203. package/dist/types/client/parser/ui-config-parser.d.ts +22 -1
  204. package/dist/types/client/parser/v2/namespace.d.ts +52 -0
  205. package/dist/types/client/parser/v2/page-parser.d.ts +21 -0
  206. package/dist/types/client/parser/v2/use-parser.d.ts +72 -0
  207. package/dist/types/client/parser/value-lang.d.ts +63 -0
  208. package/dist/types/client/pipes/pipe-registry.d.ts +38 -0
  209. package/dist/types/client/registry/declaration-renderer.d.ts +50 -0
  210. package/dist/types/client/registry/index.d.ts +10 -0
  211. package/dist/types/client/registry/page-lifecycle.d.ts +61 -0
  212. package/dist/types/client/registry/remote-page.d.ts +52 -0
  213. package/dist/types/client/runtime/SomaRuntimeServices.d.ts +16 -0
  214. package/dist/types/client/security/attribute-presence.d.ts +7 -0
  215. package/dist/types/client/security/html-sanitizer.d.ts +37 -0
  216. package/dist/types/client/security/url-guard.d.ts +11 -0
  217. package/dist/types/client/theme/harmony.d.ts +77 -0
  218. package/dist/types/client/theme/scene-tokens.d.ts +25 -0
  219. package/dist/types/client/theme/theme-axes.d.ts +81 -0
  220. package/dist/types/client/theme/theme-engine.d.ts +77 -0
  221. package/dist/types/client/theme/tone-solver.d.ts +47 -0
  222. package/dist/types/client/typography/typography-base.d.ts +15 -0
  223. package/dist/types/client/validation/contract-validator.d.ts +2 -0
  224. package/dist/types/index.d.ts +47 -2
  225. package/dist/types/server/api/IService.d.ts +18 -6
  226. package/dist/types/server/host/content-security-policy.d.ts +53 -0
  227. package/dist/types/server/host/csp-nonce-metadata.d.ts +32 -0
  228. package/dist/types/server/host/resolve-host-request-hook.d.ts +5 -0
  229. package/dist/types/server/host/server-page-assets.d.ts +2 -0
  230. package/dist/types/server/host/soma-page-compile.d.ts +7 -0
  231. package/dist/types/server/index.d.ts +6 -1
  232. package/dist/types/server/registry/api-registry-store.d.ts +141 -0
  233. package/dist/types/server/registry/conditional-object-store.d.ts +27 -0
  234. package/dist/types/server/registry/declaration-precompiler.d.ts +30 -0
  235. package/dist/types/server/registry/in-memory-conditional-object-store.d.ts +8 -0
  236. package/dist/types/server/registry/index.d.ts +29 -0
  237. package/dist/types/server/registry/page-registry-repository.d.ts +58 -0
  238. package/dist/types/server/registry/page-registry-store.d.ts +259 -0
  239. package/dist/types/server/registry/registry-error.d.ts +12 -0
  240. package/dist/types/server/registry/registry-file-lock.d.ts +20 -0
  241. package/dist/types/server/registry/registry-response.d.ts +18 -0
  242. package/dist/types/server/registry/registry-subjects.d.ts +59 -0
  243. package/dist/types/server/registry/registry-write-pipeline.d.ts +48 -0
  244. package/dist/types/server/registry/request-body-limit.d.ts +31 -0
  245. package/dist/types/server/registry/services/apis/Get.d.ts +10 -0
  246. package/dist/types/server/registry/services/apis/List.d.ts +10 -0
  247. package/dist/types/server/registry/services/apis/Register.d.ts +13 -0
  248. package/dist/types/server/registry/services/apis/Unregister.d.ts +12 -0
  249. package/dist/types/server/registry/services/index.d.ts +3 -0
  250. package/dist/types/server/registry/services/pages/Get.d.ts +10 -0
  251. package/dist/types/server/registry/services/pages/List.d.ts +13 -0
  252. package/dist/types/server/registry/services/pages/Register.d.ts +11 -0
  253. package/dist/types/server/registry/services/pages/Rollback.d.ts +9 -0
  254. package/dist/types/server/registry/services/pages/Unregister.d.ts +9 -0
  255. package/dist/types/server/registry/services/service-utils.d.ts +10 -0
  256. package/dist/types/server/registry/validation/compile-gate.d.ts +12 -0
  257. package/dist/types/server/registry/validation/component-existence.d.ts +14 -0
  258. package/dist/types/server/registry/validation/credential-ban.d.ts +15 -0
  259. package/dist/types/server/registry/validation/cross-check.d.ts +16 -0
  260. package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +15 -0
  261. package/dist/types/shared/types/adaptive.types.d.ts +88 -0
  262. package/dist/types/shared/types/component-contract.types.d.ts +78 -0
  263. package/dist/types/shared/types/data-config.types.d.ts +81 -0
  264. package/dist/types/shared/types/domain.types.d.ts +6 -0
  265. package/dist/types/shared/types/engine.types.d.ts +6 -0
  266. package/dist/types/shared/types/manifest.types.d.ts +23 -0
  267. package/dist/types/shared/types/scope-manifest.types.d.ts +82 -0
  268. package/dist/types/shared/types/style-config.types.d.ts +8 -0
  269. package/dist/types/shared/types/ui-config.types.d.ts +20 -0
  270. package/editor/vscode/package.json +1 -24
  271. package/global.d.ts +5 -11
  272. package/next.config.js +85 -28
  273. package/package.json +33 -11
  274. package/proxy.ts +62 -0
  275. package/tailwind.config.ts +0 -1
  276. package/core/build/lsp/event-yaml-completion.cjs +0 -106
  277. package/core/client/engine/theme-variables.ts +0 -37
  278. package/dist/tsconfig.types.tsbuildinfo +0 -1
  279. package/dist/types/client/engine/theme-variables.d.ts +0 -3
  280. package/editor/vscode/syntaxes/soma-event-yaml.tmLanguage.json +0 -30
  281. package/middleware.ts +0 -33
@@ -3,6 +3,7 @@ import type { ParsedEvent } from '../../shared/types/event.types';
3
3
  import type { PropertyTrigger } from '../../shared/types/trigger.types';
4
4
  import type { ParsedTimer } from '../../shared/types/timer.types';
5
5
  import type { StyleConfig } from '../../shared/types/style-config.types';
6
+ import type { SomaDataConfig } from '../../shared/types/data-config.types';
6
7
  import { type SomaRouteEntry } from './route-builder';
7
8
  export interface SomaPrecompiledPage {
8
9
  path: string;
@@ -12,6 +13,8 @@ export interface SomaPrecompiledPage {
12
13
  timers: ParsedTimer[];
13
14
  styleConfig?: StyleConfig;
14
15
  appConfig?: unknown;
16
+ /** 从统一声明编译出的数据对象资产。 */
17
+ dataConfig?: SomaDataConfig;
15
18
  }
16
19
  export interface SomaPrecompiledManifest {
17
20
  routes: SomaRouteEntry[];
@@ -29,9 +32,10 @@ export declare function precompileAll(inputs: {
29
32
  appConfigYaml: string;
30
33
  pages: Array<{
31
34
  path: string;
35
+ html: string;
32
36
  uiYaml: string;
33
- eventYaml: string;
34
- styleYaml?: string;
35
37
  appConfigYaml?: string;
38
+ externalBlocks?: ReadonlyMap<string, string>;
39
+ includes?: Readonly<Record<string, string>>;
36
40
  }>;
37
41
  }): SomaPrecompiledManifest;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 构建期 HTML include 展开。
3
+ *
4
+ * 浏览器运行时会由 SomaContainerAdapter 把 data-soma-include 的片段填入占位元素。
5
+ * 单文件 DSL 在构建期校验 data-soma-id 时也必须看到同一棵 DOM;否则共享 Shell
6
+ * 里的锚点会被误报为不存在。这里仅按调用方已经收集好的 include 名称表查找,绝不
7
+ * 从声明值拼接或读取文件路径。
8
+ */
9
+ export declare class SomaHtmlIncludeError extends Error {
10
+ constructor(message: string);
11
+ }
12
+ /**
13
+ * 返回供声明编译器做锚点校验的逻辑 HTML。
14
+ *
15
+ * include 容器本身保留,行为与运行时的 element.innerHTML = fragment 一致;目前
16
+ * Shell 的 include 占位节点均为空。嵌套 include 递归展开并检查循环,缺失片段
17
+ * 显式失败,避免运行时出现静默空壳而构建误通过。
18
+ */
19
+ export declare function expandSomaHtmlIncludes(html: string, includes: Readonly<Record<string, string>> | undefined): string;
@@ -0,0 +1,3 @@
1
+ import type { SomaPageAssets } from '../../client/engine/soma-bootstrap';
2
+ /** 把 SOMA DSL 源声明编译成客户端挂载所需的运行时资产。 */
3
+ export declare function compilePageAssets(assets: SomaPageAssets): SomaPageAssets;
@@ -0,0 +1,33 @@
1
+ import type { SomaDataConfig } from '../../shared/types/data-config.types';
2
+ import type { ParsedEvent } from '../../shared/types/event.types';
3
+ import type { PropertyTrigger } from '../../shared/types/trigger.types';
4
+ import type { StyleConfig } from '../../shared/types/style-config.types';
5
+ import type { ParsedTimer } from '../../shared/types/timer.types';
6
+ import type { UiConfig } from '../../shared/types/ui-config.types';
7
+ export interface SomaPageDeclarationInput {
8
+ html: string;
9
+ uiYaml: string;
10
+ eventYaml?: string;
11
+ styleYaml?: string;
12
+ dataYaml?: string;
13
+ externalBlocks?: ReadonlyMap<string, string>;
14
+ /** 与浏览器运行时一致的共享 HTML 片段;仅在构建锚点校验前展开。 */
15
+ includes?: Readonly<Record<string, string>>;
16
+ }
17
+ export interface SomaRuntimeDeclarationAssets {
18
+ uiYaml: string;
19
+ eventYaml: string;
20
+ styleYaml: string;
21
+ dataYaml?: string;
22
+ }
23
+ export interface CompiledPageDeclaration {
24
+ uiConfig: UiConfig;
25
+ eventConfig: ParsedEvent[];
26
+ triggers: PropertyTrigger[];
27
+ timers: ParsedTimer[];
28
+ styleConfig?: StyleConfig;
29
+ dataConfig?: SomaDataConfig;
30
+ runtimeAssets: SomaRuntimeDeclarationAssets;
31
+ }
32
+ /** 编译一整页 SOMA DSL 声明。旧页面形状与页面侧车在唯一入口直接拒绝。 */
33
+ export declare function compilePageDeclaration(input: SomaPageDeclarationInput): CompiledPageDeclaration;
@@ -1,7 +1,5 @@
1
1
  export interface SomaRollupPluginOptions {
2
2
  uiSuffix?: string;
3
- eventSuffix?: string;
4
- styleSuffix?: string;
5
3
  }
6
4
  export declare function somaRollupPlugin(options?: SomaRollupPluginOptions): {
7
5
  name: string;
@@ -2,7 +2,6 @@ export interface SomaRouteEntry {
2
2
  path: string;
3
3
  htmlFile: string;
4
4
  uiFile: string;
5
- eventFile: string;
6
5
  }
7
6
  /**
8
7
  * 从 HTML 文件列表生成路由表。
@@ -1,3 +1,4 @@
1
+ import type { SomaDataConfig } from '../../shared/types/data-config.types';
1
2
  import type { UiConfig } from '../../shared/types/ui-config.types';
2
3
  import type { ParsedEvent } from '../../shared/types/event.types';
3
4
  import type { PropertyTrigger } from '../../shared/types/trigger.types';
@@ -13,6 +14,14 @@ import type { StyleConfig } from '../../shared/types/style-config.types';
13
14
  * 预编译 UI YAML → JSON 字符串
14
15
  */
15
16
  export declare function precompileUiYaml(yamlStr: string): string;
17
+ /**
18
+ * 单文件 bundler 的 UI 模块产物。
19
+ *
20
+ * SOMA DSL 必须拿同页 HTML 做页面级编译,单文件 loader 无权猜锚点上下文;因此
21
+ * 导出 null,让宿主转入 manifest/page-assets 路径。回退前仍完整校验 v2 容器,避免
22
+ * 旧页面形状、未闭合开关或坏 YAML 被伪装成“没有预编译产物”。
23
+ */
24
+ export declare function precompileUiModule(yamlStr: string): string;
16
25
  /**
17
26
  * 预编译 Event YAML → JSON 字符串(含 events + triggers)
18
27
  */
@@ -34,6 +43,14 @@ export declare function compileEventConfigFromRaw(raw: unknown): CompiledEventCo
34
43
  * 预编译 Style YAML → StyleConfig 对象
35
44
  */
36
45
  export declare function compileStyleConfig(yamlStr: string): StyleConfig | undefined;
46
+ /**
47
+ * 预编译 Data YAML(数据对象层声明)→ SomaDataConfig 对象
48
+ */
49
+ export declare function compileDataConfig(yamlStr: string): SomaDataConfig;
50
+ /**
51
+ * 预编译 Data YAML(数据对象层声明)→ JSON 字符串
52
+ */
53
+ export declare function precompileDataYaml(yamlStr: string): string;
37
54
  /**
38
55
  * 预编译任意 YAML → JSON 字符串(locale、app.config 等纯数据配置)
39
56
  */
@@ -2,10 +2,6 @@ import type { Plugin } from 'vite';
2
2
  export interface SomaPluginOptions {
3
3
  /** UI 配置文件后缀,默认 _ui.yaml */
4
4
  uiSuffix?: string;
5
- /** 事件配置文件后缀,默认 _event.yaml */
6
- eventSuffix?: string;
7
- /** 样式配置文件后缀,默认 _style.yaml */
8
- styleSuffix?: string;
9
5
  }
10
6
  /**
11
7
  * SOMA Vite 预编译插件
@@ -14,9 +10,8 @@ export interface SomaPluginOptions {
14
10
  * 移到构建时完成。运行时直接 import 得到已解析的对象。
15
11
  *
16
12
  * 覆盖范围:
17
- * - `_ui.yaml` → UiConfig 对象(parseUiConfig 预编译)
18
- * - `_event.yaml` → ParsedEvent[] 数组(parseEventConfig 预编译)
19
- * - `_style.yaml` → StyleConfig 对象(parseStyleConfig 预编译)
13
+ * - `_ui.yaml` → 校验统一声明容器并导出 null(页面级 manifest 结合 HTML 编译)
14
+ * - 页面事件、样式、数据侧车 → 明确拒绝
20
15
  * - `locale.yaml` → Record<string, unknown>
21
16
  * - `*.config.yaml` → 任意配置对象
22
17
  * - 其他 `.yaml` → 通用 YAML → JS 对象
@@ -0,0 +1,17 @@
1
+ import type { SomaComponentPack } from '../../client/component/component-pack';
2
+ import { type LoadPackagesOptions } from './package-loader';
3
+ export interface LoadPackFromDirOptions extends LoadPackagesOptions {
4
+ /** 包标识:小写字母/数字/连字符 */
5
+ name: string;
6
+ version: string;
7
+ meta?: SomaComponentPack['meta'];
8
+ /** 并进组件目录的写作规范补充(可选) */
9
+ catalogConventions?: string;
10
+ }
11
+ /**
12
+ * 扫描固定目录,产出可直接参与合成的组件包。
13
+ *
14
+ * 文件态只产组件私有分片(styles.components)——共享分片与包基座需要跨组件的
15
+ * 设计决策,仍属 TS 形态组件包的能力,不在目录约定里猜。
16
+ */
17
+ export declare function loadComponentPackFromDir(rootDir: string, options: LoadPackFromDirOptions): SomaComponentPack;
@@ -0,0 +1,40 @@
1
+ import type { SomaComponentDefinition } from '../../client/component/component-definition.types';
2
+ export declare class SomaComponentPackageError extends Error {
3
+ readonly packageDir: string;
4
+ constructor(message: string, packageDir: string);
5
+ }
6
+ /** 扫描期的软问题:不阻断装载,但必须让人看见(都是"不报错但坏掉"的前兆) */
7
+ export interface PackScanWarning {
8
+ kind: 'page-style-filename' | 'dir-name-mismatch';
9
+ packageDir: string;
10
+ message: string;
11
+ }
12
+ export interface LoadPackagesOptions {
13
+ /**
14
+ * 警告汇总回调(缺省时汇总为单块 console.warn)。
15
+ * 刻意做成"扫描结束一次性给全部"而不是逐条打印:dev 服务器的滚动输出里,
16
+ * 逐条 warn 与"没打印"的实际效果差不多。
17
+ */
18
+ onWarning?: (warnings: PackScanWarning[]) => void;
19
+ }
20
+ /** 单目录装载的完整产物(内部形态:definition 之外还带样式与警告) */
21
+ interface PackageEntry {
22
+ definition: SomaComponentDefinition;
23
+ /** style.css 内容;无文件或空文件为 null */
24
+ css: string | null;
25
+ warnings: PackScanWarning[];
26
+ packageDir: string;
27
+ }
28
+ /** 装载单个组件包目录 → 运行时定义(结构校验 fail fast) */
29
+ export declare function loadComponentPackage(packageDir: string): SomaComponentDefinition;
30
+ /** 装载单个组件包目录 → 定义 + 样式 + 警告(供整包装载复用) */
31
+ export declare function loadComponentPackageEntry(packageDir: string): PackageEntry;
32
+ /**
33
+ * 扫描根目录下的全部组件包(含 contract.yaml 的一级子目录)。
34
+ *
35
+ * 组件名撞车抛错并点名两个目录——扫描层与合成层同一条纪律。
36
+ */
37
+ export declare function loadComponentPackages(rootDir: string, options?: LoadPackagesOptions): Record<string, SomaComponentDefinition>;
38
+ /** 扫描并返回完整条目(定义 + 样式 + 目录),整包装载与按需样式装配的共同入口 */
39
+ export declare function scanComponentPackages(rootDir: string, options?: LoadPackagesOptions): PackageEntry[];
40
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { EjectPlan } from './plan-eject';
2
+ export declare class EjectApplyError extends Error {
3
+ }
4
+ export interface ApplyEjectOptions {
5
+ /** 宿主根目录 */
6
+ hostDir: string;
7
+ /** 覆盖既有文件(默认 false:撞名即整体中止) */
8
+ force?: boolean;
9
+ }
10
+ export interface EjectApplyResult {
11
+ /** 实际写入的文件(相对宿主根) */
12
+ written: string[];
13
+ /** 被覆盖的既有文件(force 模式下才可能非空) */
14
+ overwritten: string[];
15
+ /** 撤销这次固化:新建的删掉、覆盖的还原、空目录清理 */
16
+ rollback(): void;
17
+ }
18
+ /**
19
+ * 落盘一个固化计划。返回句柄带 rollback——校验不过时调它,
20
+ * 宿主目录回到固化之前的样子。
21
+ */
22
+ export declare function applyEject(plan: EjectPlan, options: ApplyEjectOptions): EjectApplyResult;
@@ -0,0 +1,32 @@
1
+ /** 页面名:小写字母/数字/连字符——它同时是文件名与 URL 片段 */
2
+ export declare const EJECT_NAME_PATTERN: RegExp;
3
+ export interface EjectDeclaration {
4
+ html: string;
5
+ uiYaml: string;
6
+ eventYaml?: string;
7
+ styleYaml?: string;
8
+ dataYaml?: string;
9
+ }
10
+ export interface EjectFile {
11
+ /** 相对宿主根目录的路径 */
12
+ path: string;
13
+ contents: string;
14
+ }
15
+ export interface EjectPlan {
16
+ /** 页面名(URL 片段与文件名) */
17
+ name: string;
18
+ /** Domain 类名,已写进 html 的 data-soma-host 与 ui 的 bind.obj */
19
+ domainClass: string;
20
+ /** 固化后可访问的 URL */
21
+ url: string;
22
+ files: EjectFile[];
23
+ }
24
+ export declare class EjectPlanError extends Error {
25
+ }
26
+ /** order-board → OrderBoardPage */
27
+ export declare function domainClassNameOf(name: string): string;
28
+ /**
29
+ * 规划一次固化。不碰磁盘——产出"该写哪些文件、内容是什么",
30
+ * 由调用方检查冲突、一次性落盘、失败时整体回滚。
31
+ */
32
+ export declare function planEject(name: string, declaration: EjectDeclaration): EjectPlan;
@@ -0,0 +1,28 @@
1
+ import type { UiConfig } from '../../shared/types/ui-config.types';
2
+ import { type HtmlAnchorIndex } from './html-index';
3
+ import { type UseBlockAst } from '../../client/parser/v2/use-parser';
4
+ export interface CompiledSomaV2 {
5
+ /** v1 等价 UiConfig:直接交既有编译管线 */
6
+ ui: UiConfig;
7
+ /** v1 等价事件声明(DOM 事件 + timers/triggers + 组件 emit 路由) */
8
+ event: Record<string, unknown>;
9
+ /** 数据对象声明(页面级 + 各块私有,已带全局身份) */
10
+ data: Record<string, unknown>;
11
+ /** 各组件块的 AST(供生成器族与诊断消费) */
12
+ blocks: ReadonlyMap<string, UseBlockAst>;
13
+ htmlIndex: HtmlAnchorIndex;
14
+ }
15
+ export interface CompileSomaV2Input {
16
+ html: string;
17
+ uiYamlRaw: string;
18
+ /** 外置块:锚点名 → 块体原文(服务端由 loadExternalBlocks 提供) */
19
+ externalBlocks?: ReadonlyMap<string, string>;
20
+ /** 词典键集合(locale 批量段校验;缺省不校验) */
21
+ localeKeys?: ReadonlySet<string>;
22
+ }
23
+ /**
24
+ * 编译一份 v2 声明。
25
+ *
26
+ * 本函数只接受 canonical 声明,不做旧页面形状回退;旧输入会在开关校验处明确报错。
27
+ */
28
+ export declare function compileSomaV2(input: CompileSomaV2Input): CompiledSomaV2;
@@ -0,0 +1,9 @@
1
+ /** 外置块目录名:与页面同 base */
2
+ export declare function blocksDirOf(uiDir: string, base: string): string;
3
+ /**
4
+ * 扫描外置块目录 → 锚点名 → 块体原文。
5
+ *
6
+ * 只收 `.yaml`;文件名即锚点名(合法性由 loadSomaFile 统一校验,
7
+ * 那里有 HTML 索引,报错能点名"现有实例有哪些")。
8
+ */
9
+ export declare function loadExternalBlocks(uiDir: string, base: string): Map<string, string>;
@@ -0,0 +1,37 @@
1
+ /** 锚点在 HTML 中的位置信息(用于报错定位与行变量可见性判定) */
2
+ export interface HtmlAnchorInfo {
3
+ somaId: string;
4
+ /** 带 data-soma-component 时的组件名;普通锚点为 undefined */
5
+ component?: string;
6
+ /** 所在行号(1 基) */
7
+ line: number;
8
+ /** 是否位于列表行模板 <template data-soma-role="item…"> 之内 */
9
+ inRowTemplate: boolean;
10
+ /** 所属行模板的角色后缀(异构列表用;同构为 'item') */
11
+ rowRole?: string;
12
+ /**
13
+ * 所属列表锚点(位于行模板内时)。
14
+ *
15
+ * 为什么必须有它:一页有多个列表时,"行内实例挂到哪个列表的子作用域"
16
+ * 只能由 HTML 位置回答。曾经按"找到的第一个列表"挂载,cart 页两个列表
17
+ * 就把 QtyStepper 挂进了优惠券列表——不报错,只是行内组件永远收不到行数据。
18
+ */
19
+ ownerList?: string;
20
+ }
21
+ export interface HtmlAnchorIndex {
22
+ /** 全部锚点(含普通锚点) */
23
+ anchors: ReadonlyMap<string, HtmlAnchorInfo>;
24
+ /** 组件实例锚点(可作为块 id) */
25
+ instances: ReadonlySet<string>;
26
+ /** 页面根的 data-soma-host 值 */
27
+ host?: string;
28
+ /** 重复锚点 id(页面内唯一是既有铁律,此处只收集,报错由调用方给措辞) */
29
+ duplicates: readonly string[];
30
+ }
31
+ /**
32
+ * 扫描 HTML 建立锚点索引。
33
+ *
34
+ * 组件判定:同一个标签内既有 data-soma-id 又有 data-soma-component。
35
+ * 按标签切分而不是按行——属性可以换行写,按行会漏。
36
+ */
37
+ export declare function buildHtmlAnchorIndex(html: string): HtmlAnchorIndex;
@@ -0,0 +1,32 @@
1
+ import type { UiConfig } from '../../shared/types/ui-config.types';
2
+ export interface V1PageFiles {
3
+ uiYaml: Record<string, unknown>;
4
+ eventYaml?: Record<string, unknown>;
5
+ styleYaml?: Record<string, unknown>;
6
+ dataYaml?: Record<string, unknown>;
7
+ }
8
+ export interface MigrationReport {
9
+ /** 逐条变换记录(可读,用于 review 迁移结果) */
10
+ changes: string[];
11
+ /** 需要人工处理的残留(迁移器不猜) */
12
+ manual: string[];
13
+ }
14
+ export interface MigrationResult {
15
+ /** v2 文本(含 `{{` 开关) */
16
+ somaText: string;
17
+ /** 结构形态(便于测试与等价比对) */
18
+ blocks: Record<string, unknown>;
19
+ report: MigrationReport;
20
+ }
21
+ /** 迁移一页 v1 声明为 v2 块结构 */
22
+ export declare function migrateV1(files: V1PageFiles): MigrationResult;
23
+ /**
24
+ * 语义等价比对:迁移前后的作用域清单树必须一致。
25
+ *
26
+ * 比对的是**结构**而非文本——文本必然不同(那正是迁移的目的),
27
+ * 但绑定关系、作用域层级、事件路由必须逐条对得上。
28
+ */
29
+ export declare function verifyEquivalence(v1Ui: UiConfig, v2Compiled: {
30
+ ui: UiConfig;
31
+ event: Record<string, unknown>;
32
+ }, v1Event?: Record<string, unknown>): string[];
@@ -0,0 +1,45 @@
1
+ import type { HtmlAnchorIndex } from './html-index';
2
+ export declare class SomaV2ParseError extends Error {
3
+ readonly blockId?: string | undefined;
4
+ readonly line?: number | undefined;
5
+ constructor(message: string, blockId?: string | undefined, line?: number | undefined);
6
+ }
7
+ /** 页面壳块的固定 id */
8
+ export declare const PAGE_BLOCK_ID = "page";
9
+ export interface RawBlock {
10
+ blockId: string;
11
+ /** 块体(YAML 装载后的值;页面壳与组件块各自的 schema 由后续 parser 校验) */
12
+ body: Record<string, unknown>;
13
+ /** 块在 `_ui.yaml` 中的起始行(1 基,含开关行偏移) */
14
+ line: number;
15
+ /** 来源:内联块或外置文件 */
16
+ source: 'inline' | 'external';
17
+ }
18
+ export interface SomaFileLoadInput {
19
+ /** `_ui.yaml` 原文(含首尾开关行) */
20
+ uiYamlRaw: string;
21
+ /** HTML 锚点索引:块 id 合法性以它为源 */
22
+ htmlIndex: HtmlAnchorIndex;
23
+ /** 外置块文件:锚点名 → 块体原文(由 block-loader 提供) */
24
+ externalBlocks?: ReadonlyMap<string, string>;
25
+ }
26
+ interface SomaV2Container {
27
+ doc: Record<string, unknown>;
28
+ inner: string;
29
+ offset: number;
30
+ }
31
+ /**
32
+ * 只校验 v2 单文件容器本身,不依赖 HTML 锚点。
33
+ *
34
+ * Bundler 的单文件 loader 拿不到同页 HTML,只能在这里确认开关成对、内层 YAML
35
+ * 可解析且顶层是块映射;块 id 与 HTML 的对账仍由页面级 compileSomaV2 完成。
36
+ */
37
+ export declare function parseSomaV2Container(uiYamlRaw: string): SomaV2Container;
38
+ /**
39
+ * 装载 v2 声明文件:开关剥离 → YAML 装载 → 块 id 校验 → 外置块合流。
40
+ *
41
+ * 每条校验都对应一种"静默失效":写了不存在的锚点、同一实例声明两遍、
42
+ * 块挂在普通锚点上——不拦的话都表现为"这段声明没生效",而不报错。
43
+ */
44
+ export declare function loadSomaFile(input: SomaFileLoadInput): RawBlock[];
45
+ export {};
@@ -0,0 +1,13 @@
1
+ export interface SomaAdaptiveTask<P = unknown> {
2
+ /** 算相:返回本帧的 plan;返回 null 表示"本帧无意见",一字节不写 */
3
+ decide(): P | null;
4
+ /** 写相:只在 plan 与上一次不同时被调用 */
5
+ write(plan: P): void;
6
+ }
7
+ /**
8
+ * 把若干作用域任务并入本帧的调度批次。
9
+ *
10
+ * 同帧内重复提交同一 task 以最后一次为准(task 对象自带最新状态,Set 去重即合帧)。
11
+ * 无 rAF 环境(SSR)直接返回,不排队也不同步执行——页面以默认档渲染即可(F-14)。
12
+ */
13
+ export declare function scheduleAdaptiveFlush(tasks: readonly SomaAdaptiveTask<any>[]): void;
@@ -0,0 +1,16 @@
1
+ /** 迟滞带默认宽度:档位边界的 ±8%。可覆盖,但不可为负或 ≥ 1 */
2
+ export declare const SOMA_DEFAULT_HYSTERESIS = 0.08;
3
+ /**
4
+ * 带迟滞的档位解算。
5
+ *
6
+ * 每个边界 b 拆成两个阈值:升档须越过 `b·(1+h)`,降档须跌破 `b·(1−h)`。
7
+ * 于是同一取值点上最多存在两个合法档(当前与相邻),走哪个由 `prev` 决定——
8
+ * 这正是"往复拖拽不抖"的来源。
9
+ *
10
+ * @param value 被判定的量(通常是容器宽度);非有限数时返回 prev(ERR-04)
11
+ * @param bounds 升序边界数组;空数组时返回 prev(无档可分)
12
+ * @param prev 上一档位(0 ~ bounds.length);越界时按无迟滞裸档返回
13
+ * @param h 迟滞带宽度,默认 0.08
14
+ * @returns 档位序号,0 ~ bounds.length
15
+ */
16
+ export declare function resolveTierWithHysteresis(value: number, bounds: readonly number[], prev: number, h?: number): number;
@@ -0,0 +1,5 @@
1
+ export { createAdaptiveObserverPool } from './observer-pool';
2
+ export type { SomaAdaptiveObserverPool, SomaAdaptiveSize, SomaAdaptiveSizeCallback, } from './observer-pool';
3
+ export { scheduleAdaptiveFlush } from './flush-scheduler';
4
+ export type { SomaAdaptiveTask } from './flush-scheduler';
5
+ export { resolveTierWithHysteresis, SOMA_DEFAULT_HYSTERESIS } from './hysteresis';
@@ -0,0 +1,15 @@
1
+ export interface SomaAdaptiveSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export type SomaAdaptiveSizeCallback = (size: SomaAdaptiveSize) => void;
6
+ export interface SomaAdaptiveObserverPool {
7
+ /** 订阅元素尺寸;返回退订函数(幂等,重复调用不抛错) */
8
+ observe(target: Element, onSize: SomaAdaptiveSizeCallback): () => void;
9
+ }
10
+ /**
11
+ * 取得观察者池。
12
+ * 多次调用复用同一实例、同一 ResizeObserver——"create" 是使用面的措辞,
13
+ * 语义上是取单例;调用方不需要自己去做全局缓存。
14
+ */
15
+ export declare function createAdaptiveObserverPool(): SomaAdaptiveObserverPool;
@@ -28,6 +28,39 @@ export declare abstract class SomaPageRootBase implements SomaPageRoot {
28
28
  _config: SomaAppConfig;
29
29
  /** 由引擎注入的运行时基础设施(router / http / notify 等) */
30
30
  _services?: SomaRuntimeServices;
31
+ /**
32
+ * 数据对象层(*_data.yaml,可选件)解析产物挂载点。
33
+ * bootstrap 在数据对象解析完成后注入 { 对象名: 数据 },UI 走既有
34
+ * `page.data.<对象>.<字段>` 绑定通道;页面无数据声明时恒为空对象。
35
+ * 以非枚举属性挂载:不进入页面状态序列化/快照,存量行为零变化。
36
+ */
37
+ data: Record<string, unknown>;
38
+ /** 由 bootstrap 注入的数据对象重取钩子(无 *_data.yaml 声明时保持未定义) */
39
+ _reloadData?: () => Promise<void>;
40
+ constructor();
41
+ /**
42
+ * 重新执行数据对象取数(Domain 可在业务动作后调用刷新 page.data)。
43
+ * 页面未声明数据对象时为空操作。
44
+ */
45
+ reloadData(): Promise<void>;
46
+ /**
47
+ * 把此刻改过的页面状态**立刻**推到界面上,不等这次事件处理结束。
48
+ *
49
+ * 什么时候需要它:一次事件 = 一次原子提交是引擎刻意的设计——中间态不闪烁,
50
+ * 出错时未提交的界面变更整体回滚。代价是**长任务的中途进展播不出去**:
51
+ * 实测 AI 生成一次 P50 约 40 秒,期间 Domain 改多少次状态,界面一次都不动,
52
+ * 连"生成中"三个字都不会出现,用户分不清"在想"还是"卡死"。
53
+ *
54
+ * ```ts
55
+ * this.statusText = '正在生成…';
56
+ * await this.publishUi(); // ← 这一帧现在就让用户看见
57
+ * const result = await longTask();
58
+ * ```
59
+ *
60
+ * 代价要写明白:**已经上屏的这部分不再享有失败回滚**。所以它是自愿的——
61
+ * 只有业务知道"这一帧值不值得让用户看见"。不调用则行为与过去完全一致。
62
+ */
63
+ protected publishUi(): Promise<void>;
31
64
  /**
32
65
  * 封装页面级异步操作:自动管理 pageLoading / pageError
33
66
  */
@@ -0,0 +1,26 @@
1
+ import type { IContainerAdapter } from '../container/IContainerAdapter';
2
+ import type { SomaAdaptiveConfig, SomaAdaptiveVocabulary, SomaCompiledAdaptive } from '../../shared/types/adaptive.types';
3
+ /** 宿主根上的画像属性名:CSS 与 ui 决策的共同入口,跨包契约,改名要两边一起改 */
4
+ export declare const SOMA_ADAPTIVE_PROFILE_ATTR = "data-soma-adaptive-profile";
5
+ export interface SomaAdaptiveCompileInput {
6
+ config: SomaAdaptiveConfig;
7
+ /** 已注册词汇表;解析期已断言过声明值在表内,此处只做取值 */
8
+ vocabulary?: SomaAdaptiveVocabulary;
9
+ container: HTMLElement;
10
+ adapter: IContainerAdapter;
11
+ }
12
+ /**
13
+ * 把 `adaptive` 声明展开为确定性编译产物。
14
+ *
15
+ * 锚点存在性在此校验(解析期看不到 DOM,归属仍是 F-08):
16
+ * 槽与 pin 的目标锚点不可解析时快速失败,不静默丢级——
17
+ * 丢一级的后果是页面在某个宽度下悄悄不降级,比报错难查得多。
18
+ */
19
+ export declare function compileAdaptive(input: SomaAdaptiveCompileInput): SomaCompiledAdaptive;
20
+ /**
21
+ * 落地编译产物:宿主根写画像属性 + 断点型级挂作用域类。
22
+ *
23
+ * 测量型执行器配置**不在此消费**——它是交给 soma-ui 接线层的数据,
24
+ * core 落地它就等于把组件行为搬进了引擎。
25
+ */
26
+ export declare function applyCompiledAdaptive(compiled: SomaCompiledAdaptive, container: HTMLElement, adapter: IContainerAdapter): void;
@@ -3,19 +3,30 @@ import type { SomaScopeResolver } from '../engine/scope-resolver';
3
3
  import type { SomaRuntimeManifest } from '../../shared/types/manifest.types';
4
4
  import type { UiConfig } from '../../shared/types/ui-config.types';
5
5
  import type { ParsedEvent } from '../../shared/types/event.types';
6
+ import { type SomaPipeRegistry } from '../pipes/pipe-registry';
7
+ import type { SomaAdaptiveVocabulary } from '../../shared/types/adaptive.types';
6
8
  export interface SomaManifestCompilerInput {
7
9
  container: HTMLElement;
8
10
  adapter: IContainerAdapter;
9
11
  uiConfig: UiConfig;
10
12
  eventConfig: ParsedEvent[];
11
13
  resolver: SomaScopeResolver;
14
+ /** 格式化管道注册表(缺省为内置管道集) */
15
+ pipes?: SomaPipeRegistry;
16
+ /** 阶梯词汇表(F-09);仅当 uiConfig.adaptive 存在时才被读取 */
17
+ adaptiveVocabulary?: SomaAdaptiveVocabulary;
12
18
  }
13
19
  export declare class SomaManifestCompiler {
14
- /** 事件编译缓存:eventConfig 不依赖 DOM,可安全缓存 */
15
- private eventCache;
16
20
  compile(input: SomaManifestCompilerInput): SomaRuntimeManifest;
17
21
  private walkShow;
18
22
  private compileExtendedValue;
23
+ /**
24
+ * 解析并校验展示值上的管道链(编译期白名单,未注册名 fail fast)。
25
+ * 无管道时原样返回(零开销路径)。
26
+ */
27
+ private parsePipes;
28
+ /** 列表/对象子作用域配置的管道预校验(行内解释执行前的编译期 fail fast) */
29
+ private validateScopedPipes;
19
30
  private parseSomaKey;
20
31
  private parseConditionalPath;
21
32
  private resolveBindingType;