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.
- package/README.md +5 -6
- package/bin/soma.cjs +2 -2
- package/core/build/compiler/flat-page.ts +16 -0
- package/core/build/compiler/full-manifest-builder.ts +0 -3
- package/core/build/compiler/page-assets.ts +0 -1
- package/core/build/compiler/page-closure.ts +245 -0
- package/core/build/compiler/page-declaration-compiler.ts +2 -5
- package/core/build/compiler/soma-precompile.js +1972 -3312
- package/core/build/compiler/soma-precompile.ts +4 -7
- package/core/build/component-tree/artifact-codec.ts +4 -8
- package/core/build/lsp/soma-declaration.cjs +1 -1
- package/core/build/lsp/std-completion.generated.json +3 -3
- package/core/client/a11y/a11y-config.ts +2 -1
- package/core/client/a11y/dom-id.ts +1 -1
- package/core/client/base/SomaHttpClient.ts +11 -3
- package/core/client/base/SomaPageRootBase.ts +6 -0
- package/core/client/base/defineSomaView.ts +178 -0
- package/core/client/base/index.ts +13 -0
- package/core/client/base/view-context.ts +328 -0
- package/core/client/behavior/adapter-collection.ts +2 -2
- package/core/client/compiler/manifest-compiler.ts +5 -36
- package/core/client/component/component-definition.types.ts +2 -1
- package/core/client/component/component-manager.ts +110 -20
- package/core/client/component/structure-adapter.ts +3 -7
- package/core/client/container/IContainerAdapter.ts +4 -0
- package/core/client/container/SomaContainerAdapter.ts +52 -3
- package/core/client/data/data-object-resolver.ts +523 -184
- package/core/client/data/data-write-actions.ts +79 -15
- package/core/client/data/format-config.ts +3 -1
- package/core/client/data/region-scope-port.ts +11 -0
- package/core/client/engine/asset-resolver.ts +2 -5
- package/core/client/engine/dom-renderer.ts +7 -40
- package/core/client/engine/event-engine.ts +29 -108
- package/core/client/engine/property-watcher.ts +1 -1
- package/core/client/engine/reactive-proxy.ts +78 -17
- package/core/client/engine/runtime-builder.ts +0 -14
- package/core/client/engine/scope-resolver.ts +18 -0
- package/core/client/engine/soma-bootstrap.ts +387 -99
- package/core/client/engine/style-binder.ts +49 -106
- package/core/client/engine/timer-engine.ts +11 -1
- package/core/client/host-bridge/load-host-domain-class.ts +2 -1
- package/core/client/infra/http/SomaHttpService.ts +15 -4
- package/core/client/infra/i18n/pack-locales.ts +2 -2
- package/core/client/infra/notify/DefaultNotifyService.ts +2 -2
- package/core/client/mount/domain-rule.ts +7 -3
- package/core/client/mount/mount-page.ts +38 -5
- package/core/client/mount/types.ts +2 -0
- package/core/client/parser/confirm-spec.ts +100 -7
- package/core/client/parser/data-config-parser.ts +28 -211
- package/core/client/parser/pipeline-parser.ts +16 -60
- package/core/client/parser/style-config-parser.ts +101 -95
- package/core/client/parser/timer-parser.ts +21 -0
- package/core/client/parser/ui-config-parser.ts +64 -12
- package/core/client/registry/declaration-renderer.ts +1 -1
- package/core/client/render-ports/hide-transition.ts +9 -0
- package/core/client/render-ports/index.ts +4 -0
- package/core/client/render-ports/notify-renderer.ts +2 -1
- package/core/client/runtime/SomaRuntimeServices.ts +2 -1
- package/core/client/runtime/SomaSnapshotStore.ts +5 -0
- package/core/client/security/url-guard.ts +71 -11
- package/core/client/validation/async-check-registry.ts +2 -1
- package/core/client/validation/contract-validator.ts +2 -6
- package/core/client/validation/field-rules.ts +3 -13
- package/core/client/validation/object-rules.ts +2 -10
- package/core/index.ts +17 -39
- package/core/inspect/check-product.ts +5 -5
- package/core/inspect/runtime.ts +2 -1
- package/core/server/api/dispatch-service-api.ts +35 -36
- package/core/server/api/load-host-service.ts +8 -4
- package/core/server/api/paged-list.ts +259 -0
- package/core/server/compile-port.ts +1 -1
- package/core/server/host/app-config-composer.ts +2 -1
- package/core/server/host/empty-host-bootstrap.mjs +3 -0
- package/core/server/host/host-assembly-entry.ts +1 -0
- package/core/server/host/host-assembly.ts +50 -3
- package/core/server/host/host-caller.ts +2 -1
- package/core/server/host/host-dir.ts +9 -0
- package/core/server/host/host-response-headers.ts +2 -1
- package/core/server/host/invoke-host-request-hook.ts +28 -4
- package/core/server/host/published-page-assets.ts +2 -1
- package/core/server/host/resolve-host-request-hook.ts +25 -7
- package/core/server/host/server-page-assets.ts +4 -4
- package/core/server/host/source-aliases.cjs +345 -0
- package/core/server/host/source-aliases.ts +32 -0
- package/core/server/host/source-packages.cjs +1 -0
- package/core/server/host/virtual-pages.ts +3 -2
- package/core/server/infra/cache/ServerFileCache.ts +83 -10
- package/core/server/node.ts +10 -0
- package/core/server/registry/api-registry-store.ts +3 -1
- package/core/server/registry/declaration-precompiler.ts +0 -2
- package/core/server/registry/page-registry-repository.ts +2 -1
- package/core/server/registry/page-registry-store.ts +2 -1
- package/core/server/registry/registry-error.ts +6 -1
- package/core/server/registry/registry-file-lock.ts +296 -23
- package/core/server/registry/request-body-limit.ts +3 -2
- package/core/server/registry/validation/declaration-safety-scan.ts +151 -27
- package/core/server/runtime-space/access-gate.ts +21 -7
- package/core/server/runtime-space/bindings.ts +3 -6
- package/core/server/runtime-space/dynamic-pages.ts +181 -49
- package/core/server/runtime-space/errors.ts +3 -0
- package/core/server/runtime-space/inject.ts +78 -16
- package/core/server/runtime-space/page-grants.ts +7 -1
- package/core/server/runtime-space/resolve.ts +66 -19
- package/core/server/runtime-space/store.ts +32 -3
- package/core/server/runtime-space/submit-steps.ts +2 -1
- package/core/server/runtime-space/types.ts +3 -1
- package/core/shared/component-tree-errors.ts +2 -1
- package/core/shared/contract-a11y.ts +1 -1
- package/core/shared/contract-sections.ts +2 -2
- package/core/shared/core-diagnostic-codes.ts +14 -0
- package/core/shared/data-declaration-checks.ts +29 -3
- package/core/shared/declaration-keys.ts +1 -1
- package/core/shared/engines/engine-error.ts +2 -1
- package/core/shared/generation-error.ts +2 -1
- package/core/shared/page-envelope.ts +1 -1
- package/core/shared/pure-binding.ts +88 -0
- package/core/shared/registry-generated/diagnostic-registry-index.ts +21 -19
- package/core/shared/registry-generated/diagnostic-registry.ts +170 -177
- package/core/shared/registry-generated/limits.ts +65 -13
- package/core/shared/registry-generated/std-grammar-completion.ts +0 -4
- package/core/shared/registry-generated/std-grammar-views.ts +40 -10
- package/core/shared/registry-generated/std-grammar.ts +43 -21
- package/core/shared/soma-error.ts +36 -0
- package/core/shared/types/compile-port.types.ts +1 -1
- package/core/shared/types/data-config.types.ts +20 -18
- package/core/shared/types/engine.types.ts +0 -3
- package/core/shared/types/event.types.ts +10 -11
- package/core/shared/types/generation-error.types.ts +5 -1
- package/core/shared/types/host-assembly.types.ts +7 -1
- package/core/shared/types/manifest.types.ts +0 -3
- package/core/shared/types/region-scope.types.ts +5 -1
- package/core/shared/types/scope-manifest.types.ts +0 -2
- package/core/shared/types/style-config.types.ts +21 -21
- package/core/shared/types/ui-config.types.ts +4 -5
- package/core/shared/types/watcher.types.ts +1 -1
- package/dist/browser/runtime-bundle.manifest.json +11 -13
- package/dist/browser/soma-runtime.js +2733 -2712
- package/dist/core/index.cjs +5665 -5534
- package/dist/host-native/aot-builder.cjs +330 -1
- package/dist/host-native/native-server.cjs +5434 -4726
- package/dist/lsp/component-tree.cjs +5868 -7040
- package/dist/types/build/compiler/full-manifest-builder.d.ts +0 -2
- package/dist/types/build/compiler/page-closure.d.ts +21 -0
- package/dist/types/build/compiler/page-declaration-compiler.d.ts +2 -4
- package/dist/types/build/compiler/soma-precompile.d.ts +1 -3
- package/dist/types/build/component-tree/artifact-codec.d.ts +0 -2
- package/dist/types/client/a11y/a11y-config.d.ts +2 -1
- package/dist/types/client/base/SomaHttpClient.d.ts +1 -1
- package/dist/types/client/base/SomaPageRootBase.d.ts +5 -0
- package/dist/types/client/base/defineSomaView.d.ts +46 -0
- package/dist/types/client/base/index.d.ts +2 -0
- package/dist/types/client/base/view-context.d.ts +136 -0
- package/dist/types/client/behavior/adapter-collection.d.ts +1 -1
- package/dist/types/client/compiler/manifest-compiler.d.ts +0 -3
- package/dist/types/client/component/component-definition.types.d.ts +2 -1
- package/dist/types/client/component/component-manager.d.ts +29 -0
- package/dist/types/client/container/IContainerAdapter.d.ts +3 -0
- package/dist/types/client/container/SomaContainerAdapter.d.ts +5 -0
- package/dist/types/client/data/data-object-resolver.d.ts +93 -31
- package/dist/types/client/data/format-config.d.ts +2 -1
- package/dist/types/client/engine/dom-renderer.d.ts +1 -2
- package/dist/types/client/engine/event-engine.d.ts +0 -7
- package/dist/types/client/engine/reactive-proxy.d.ts +11 -4
- package/dist/types/client/engine/runtime-builder.d.ts +0 -4
- package/dist/types/client/engine/soma-bootstrap.d.ts +44 -6
- package/dist/types/client/engine/style-binder.d.ts +8 -4
- package/dist/types/client/host-bridge/load-host-domain-class.d.ts +2 -1
- package/dist/types/client/mount/domain-rule.d.ts +2 -0
- package/dist/types/client/mount/mount-page.d.ts +2 -1
- package/dist/types/client/mount/types.d.ts +2 -0
- package/dist/types/client/parser/confirm-spec.d.ts +27 -3
- package/dist/types/client/parser/data-config-parser.d.ts +6 -5
- package/dist/types/client/parser/style-config-parser.d.ts +7 -3
- package/dist/types/client/parser/timer-parser.d.ts +5 -0
- package/dist/types/client/parser/ui-config-parser.d.ts +6 -2
- package/dist/types/client/render-ports/hide-transition.d.ts +9 -0
- package/dist/types/client/render-ports/index.d.ts +4 -0
- package/dist/types/client/render-ports/notify-renderer.d.ts +2 -1
- package/dist/types/client/runtime/SomaSnapshotStore.d.ts +2 -0
- package/dist/types/client/security/url-guard.d.ts +14 -0
- package/dist/types/client/validation/async-check-registry.d.ts +2 -1
- package/dist/types/client/validation/object-rules.d.ts +0 -5
- package/dist/types/index.d.ts +6 -11
- package/dist/types/inspect/runtime.d.ts +2 -1
- package/dist/types/server/api/dispatch-service-api.d.ts +5 -0
- package/dist/types/server/api/load-host-service.d.ts +1 -1
- package/dist/types/server/api/paged-list.d.ts +101 -0
- package/dist/types/server/compile-port.d.ts +1 -1
- package/dist/types/server/host/host-assembly-entry.d.ts +1 -1
- package/dist/types/server/host/host-assembly.d.ts +2 -0
- package/dist/types/server/host/host-dir.d.ts +2 -0
- package/dist/types/server/host/invoke-host-request-hook.d.ts +10 -3
- package/dist/types/server/host/published-page-assets.d.ts +2 -1
- package/dist/types/server/host/resolve-host-request-hook.d.ts +18 -5
- package/dist/types/server/host/server-page-assets.d.ts +2 -1
- package/dist/types/server/host/source-aliases.d.cts +53 -0
- package/dist/types/server/host/source-aliases.d.ts +30 -0
- package/dist/types/server/host/source-packages.d.cts +2 -0
- package/dist/types/server/infra/cache/ServerFileCache.d.ts +8 -0
- package/dist/types/server/node.d.ts +1 -0
- package/dist/types/server/registry/declaration-precompiler.d.ts +0 -1
- package/dist/types/server/registry/registry-error.d.ts +5 -1
- package/dist/types/server/registry/registry-file-lock.d.ts +30 -0
- package/dist/types/server/registry/request-body-limit.d.ts +3 -2
- package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +3 -0
- package/dist/types/server/runtime-space/access-gate.d.ts +7 -0
- package/dist/types/server/runtime-space/bindings.d.ts +3 -2
- package/dist/types/server/runtime-space/dynamic-pages.d.ts +6 -1
- package/dist/types/server/runtime-space/errors.d.ts +1 -1
- package/dist/types/server/runtime-space/resolve.d.ts +2 -0
- package/dist/types/server/runtime-space/store.d.ts +8 -1
- package/dist/types/server/runtime-space/submit-steps.d.ts +2 -1
- package/dist/types/server/runtime-space/types.d.ts +3 -1
- package/dist/types/shared/component-tree-errors.d.ts +2 -1
- package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
- package/dist/types/shared/declaration-keys.d.ts +1 -1
- package/dist/types/shared/engines/engine-error.d.ts +2 -1
- package/dist/types/shared/generation-error.d.ts +2 -1
- package/dist/types/shared/pure-binding.d.ts +48 -0
- package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +149 -158
- package/dist/types/shared/registry-generated/limits.d.ts +54 -10
- package/dist/types/shared/registry-generated/std-grammar-completion.d.ts +0 -30
- package/dist/types/shared/registry-generated/std-grammar-views.d.ts +97 -23
- package/dist/types/shared/registry-generated/std-grammar.d.ts +110 -242
- package/dist/types/shared/soma-error.d.ts +15 -0
- package/dist/types/shared/types/data-config.types.d.ts +17 -17
- package/dist/types/shared/types/engine.types.d.ts +0 -3
- package/dist/types/shared/types/event.types.d.ts +9 -7
- package/dist/types/shared/types/generation-error.types.d.ts +1 -1
- package/dist/types/shared/types/host-assembly.types.d.ts +2 -0
- package/dist/types/shared/types/manifest.types.d.ts +0 -3
- package/dist/types/shared/types/region-scope.types.d.ts +4 -1
- package/dist/types/shared/types/scope-manifest.types.d.ts +0 -2
- package/dist/types/shared/types/style-config.types.d.ts +17 -19
- package/dist/types/shared/types/ui-config.types.d.ts +4 -5
- package/host-native/bin/host-native.cjs +22 -1
- package/host-native/client/browser-entry.ts +21 -172
- package/host-native/src/aot-builder.ts +75 -0
- package/host-native/src/host-prepare.ts +39 -5
- package/host-native/src/manifest-http.ts +2 -3
- package/host-native/src/native-server.ts +812 -174
- package/host-native/src/page-http.ts +3 -3
- package/host-native/src/public-packages.cjs +0 -1
- package/host-native/src/registry-handler.ts +12 -5
- package/host-native/src/static-file.ts +203 -53
- package/host-native/styles/globals.css +30 -28
- package/package.json +14 -2
- package/core/client/engine/step-runner.ts +0 -212
- package/core/client/engine/trigger-engine.ts +0 -55
- package/core/client/format/zoned.ts +0 -10
- package/core/client/parser/step-parser.ts +0 -359
- package/core/client/parser/trigger-parser.ts +0 -90
- package/core/client/parser/value-lang.ts +0 -340
- package/core/client/time/instant.ts +0 -2
- package/core/shared/calc/coerce.ts +0 -2
- package/core/shared/calc/errors.ts +0 -40
- package/core/shared/calc/evaluator.ts +0 -113
- package/core/shared/calc/index.ts +0 -11
- package/core/shared/calc/lexer.ts +0 -189
- package/core/shared/calc/parser.ts +0 -193
- package/core/shared/calc/typer.ts +0 -171
- package/core/shared/date-parts.ts +0 -2
- package/core/shared/show-when.ts +0 -77
- package/core/shared/types/step.types.ts +0 -91
- package/core/shared/types/trigger.types.ts +0 -14
- package/dist/types/client/engine/step-runner.d.ts +0 -42
- package/dist/types/client/engine/trigger-engine.d.ts +0 -16
- package/dist/types/client/format/zoned.d.ts +0 -1
- package/dist/types/client/parser/step-parser.d.ts +0 -23
- package/dist/types/client/parser/trigger-parser.d.ts +0 -13
- package/dist/types/client/parser/value-lang.d.ts +0 -63
- package/dist/types/client/time/instant.d.ts +0 -1
- package/dist/types/shared/calc/coerce.d.ts +0 -1
- package/dist/types/shared/calc/errors.d.ts +0 -14
- package/dist/types/shared/calc/evaluator.d.ts +0 -2
- package/dist/types/shared/calc/index.d.ts +0 -6
- package/dist/types/shared/calc/lexer.d.ts +0 -19
- package/dist/types/shared/calc/parser.d.ts +0 -43
- package/dist/types/shared/calc/typer.d.ts +0 -11
- package/dist/types/shared/date-parts.d.ts +0 -1
- package/dist/types/shared/show-when.d.ts +0 -21
- package/dist/types/shared/types/step.types.d.ts +0 -76
- package/dist/types/shared/types/trigger.types.d.ts +0 -12
|
@@ -13,7 +13,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
13
13
|
"stages": [
|
|
14
14
|
{ "id": "surface", "title": "作者书写的键", "describes": "YAML(biz / ui / app 文件)与 AI 蓝图 JSON 里的键;本身没有类型,是每条路径的起点" },
|
|
15
15
|
{ "id": "page-block", "title": "平铺 _ui.yaml(页面声明)", "describes": "平铺 _ui.yaml 的顶层键(bind / show / initProps 与保留键 envelope / data / state / scopes / session / fragments / domain / locale / watch);类型登记(UiConfig 容纳哪些上下文)由方言叠加" },
|
|
16
|
-
{ "id": "core-config", "title": "核心层对象配置(数据对象解析器的产物)", "writers": ["soma-core/core/client/parser/", "soma-core/core/server/registry/", "soma-ui/src/compiler/bdl/", "soma-ui/src/compiler/page/session-synthesis.ts", "soma-ui/src/compiler/need/build-need.ts", "soma-core/core/build/compiler/"], "readers": ["soma-core/core/client/data/", "soma-core/core/client/engine/", "soma-core/core/shared/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/forms/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/contract/", "soma-ui/src/compiler/styling/", "soma-ui/src/data-kit/"], "relays": ["soma-core/core/client/parser/", "soma-ui/src/compiler/bdl/", "soma-core/core/server/registry/"], "relayToFacts": ["soma-ui/src/compiler/need/object-facts.ts"], "closure": { "id": "bdl→object", "title": "BDL 解析 → 对象描述(业务对象声明交给 M2 / 生成 / 运行期数据层)", "produce": [{ "file": "soma-ui/src/compiler/contract/biz-declaration.types.ts", "type": "SomaBizDeclaration" }], "producers": [{ "file": "soma-ui/src/compiler/bdl/object/parse.ts", "symbol": "readBizDeclaration" }, { "file": "soma-ui/src/compiler/bdl/pins/biz-table.ts", "symbol": "resolvePageBiz" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/certify/", "soma-ui/src/data-kit/", "soma-core/core/client/", "soma-core/core/server/"], "exclude": ["soma-ui/src/compiler/bdl/", "soma-core/core/client/parser/"] }, "types": [{ "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectConfig", "contexts": ["object"], "writes": "member", "complete": true, "closure": true, "internal": [{ "member": "name", "why": "对象名取自声明映射的键,不是 BDL 的 name 键(那个落在 displayName)" }, { "member": "deps", "why": "依赖对象名集合,由解析器从 from / 关系 / 选项来源推导,作者不写" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldConfig", "contexts": ["field"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldOption", "contexts": ["field.option"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldRule", "contexts": ["field.rule"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectRelation", "contexts": ["relation"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataActionConfig", "contexts": ["action"], "writes": "structural", "complete": true, "closure": true, "internal": [{ "member": "icon", "why": "图标仅由页面合成的会话动作与应用级管道动作带,BDL 动作条目没有 icon 键" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectPoll", "contexts": ["poll", "poll.while"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectState", "contexts": ["state"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/
|
|
16
|
+
{ "id": "core-config", "title": "核心层对象配置(数据对象解析器的产物)", "writers": ["soma-core/core/client/parser/", "soma-core/core/server/registry/", "soma-ui/src/compiler/bdl/", "soma-ui/src/compiler/page/session-synthesis.ts", "soma-ui/src/compiler/need/build-need.ts", "soma-core/core/build/compiler/"], "readers": ["soma-core/core/client/data/", "soma-core/core/client/engine/", "soma-core/core/shared/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/forms/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/contract/", "soma-ui/src/compiler/styling/", "soma-ui/src/data-kit/"], "relays": ["soma-core/core/client/parser/", "soma-ui/src/compiler/bdl/", "soma-core/core/server/registry/"], "relayToFacts": ["soma-ui/src/compiler/need/object-facts.ts"], "closure": { "id": "bdl→object", "title": "BDL 解析 → 对象描述(业务对象声明交给 M2 / 生成 / 运行期数据层)", "produce": [{ "file": "soma-ui/src/compiler/contract/biz-declaration.types.ts", "type": "SomaBizDeclaration" }], "producers": [{ "file": "soma-ui/src/compiler/bdl/object/parse.ts", "symbol": "readBizDeclaration" }, { "file": "soma-ui/src/compiler/bdl/pins/biz-table.ts", "symbol": "resolvePageBiz" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/certify/", "soma-ui/src/data-kit/", "soma-core/core/client/", "soma-core/core/server/"], "exclude": ["soma-ui/src/compiler/bdl/", "soma-core/core/client/parser/"] }, "types": [{ "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectConfig", "contexts": ["object"], "writes": "member", "complete": true, "closure": true, "internal": [{ "member": "name", "why": "对象名取自声明映射的键,不是 BDL 的 name 键(那个落在 displayName)" }, { "member": "deps", "why": "依赖对象名集合,由解析器从 from / 关系 / 选项来源推导,作者不写" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldConfig", "contexts": ["field"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldOption", "contexts": ["field.option"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldRule", "contexts": ["field.rule"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectRelation", "contexts": ["relation"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataActionConfig", "contexts": ["action"], "writes": "structural", "complete": true, "closure": true, "internal": [{ "member": "icon", "why": "图标仅由页面合成的会话动作与应用级管道动作带,BDL 动作条目没有 icon 键" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectPoll", "contexts": ["poll", "poll.while"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectState", "contexts": ["state"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionConfig", "contexts": ["session", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionActionConfig", "contexts": ["session.action"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionChildConfig", "contexts": ["session.child", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionLimits", "contexts": ["session.limits"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionSearch", "contexts": ["session.search"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataWriteConfig", "contexts": ["write"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/object-declaration.types.ts", "type": "SomaObjectTheme", "contexts": ["object.theme"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/object-constraints.ts", "type": "SomaObjectConstraint", "contexts": ["constraint"], "writes": "structural" }] },
|
|
17
17
|
{ "id": "facts", "title": "对象事实(需求推导的输入)", "writers": ["soma-ui/src/compiler/need/object-facts.ts"], "readers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/settle/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/"], "relays": ["soma-ui/src/compiler/need/object-facts.ts"], "types": [{ "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaObjectFacts", "contexts": ["object"], "writes": "member", "closure": true }, { "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaFieldFact", "contexts": ["field"], "writes": "member", "closure": true }, { "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaRelationFact", "contexts": ["relation"], "writes": "member", "closure": true }], "closure": { "id": "object→m2", "title": "对象描述 → M2 对象事实(字段 / 关系事实交给需求推导与生成)", "producers": [{ "file": "soma-ui/src/compiler/need/object-facts.ts", "symbol": "buildObjectFacts" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/settle/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/"], "exclude": ["soma-ui/src/compiler/need/object-facts.ts"] } },
|
|
18
18
|
{ "id": "linkage", "title": "联动规格里的动作视图", "writers": ["soma-ui/src/compiler/need/object-facts.ts"], "readers": ["soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/need/families/", "soma-ui/src/data-kit/"], "relays": ["soma-ui/src/compiler/need/object-facts.ts"], "types": [{ "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaActionFact", "contexts": ["action"], "writes": "member" }] }
|
|
19
19
|
],
|
|
@@ -46,7 +46,6 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
46
46
|
{ "id": "predicate-ops", "ref": "SOMA_FIELD_PREDICATE_OPS", "values": ["eq", "ne", "in", "not_in", "empty", "not_empty", "gt", "gte", "lt", "lte", "between", "matches", "starts_with", "ends_with", "contains", "in_last", "in_next"], "note": "in_last / in_next(D8 / C22)是相对日期算子,值形如 { n, unit },只属 date / datetime 的 dated 运算符族(data-selection#/fieldTypeCaps/opFamilies/dated),求值归 core 时间能力;不在文本 / 比较 / 列表子集内,只进规则子集 predicate-rule-ops" },
|
|
47
47
|
{ "id": "command-methods", "ref": "WRITE_METHODS", "values": ["POST", "PUT", "PATCH"], "note": "写通道 create / update 的方法;大小写不敏感,解析后统一大写" },
|
|
48
48
|
{ "id": "validate-triggers", "ref": "SOMA_VALIDATE_TRIGGERS", "values": ["change", "blur", "submit"], "note": "写通道 validate_on 的校验时机:非空无重复列表" },
|
|
49
|
-
{ "id": "show-when-presence-ops", "ref": "SOMA_SHOW_WHEN_PRESENCE_OPS", "values": ["present", "blank"], "note": "Show when 对象形 { field, op, value? } 在谓词算子(predicate-ops)之外多出的有无值算子,不带 value:present = 非 null / undefined / 空白串 / 空数组(0 与 false 算有值,与动作 available_when.requires 同口径);blank = 相反。谓词里的 empty / not_empty 把 false 当空,口径不同" },
|
|
50
49
|
{ "id": "url-schemes", "ref": "SOMA_URL_FIELD_SCHEMES", "values": ["http", "https", "mailto", "tel", "sms", "ftp"], "note": "url / image 字段 schemes 的协议闭集(S8);缺省只放行 http / https" },
|
|
51
50
|
{ "id": "envelope-param-types", "ref": "SOMA_ENVELOPE_PARAM_TYPES", "values": ["int", "string", "slug", "uuid", "enum"], "note": "信封 params.<名>.type" },
|
|
52
51
|
{ "id": "envelope-query-types", "ref": "SOMA_ENVELOPE_QUERY_TYPES", "values": ["string", "int", "bool", "enum", "slug"], "note": "信封 query.<名>.type" },
|
|
@@ -61,11 +60,11 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
61
60
|
{ "id": "predicate-rule-ops", "domain": "predicate-ops", "values": ["eq", "ne", "gt", "gte", "lt", "lte", "contains", "starts_with", "ends_with", "matches", "empty", "not_empty", "between", "in", "not_in", "in_last", "in_next"], "note": "规则编辑表达得了的算子(AD-83):单值、无值、区间(between,值是两端 [lo, hi])、多值(in / not_in,值是列表);业界规则构建器都有区间与多值。in_last / in_next 的值是单个 { n, unit } 窗口(O17 需求,只对 dated 族字段出现)" }
|
|
62
61
|
],
|
|
63
62
|
"keys": [
|
|
64
|
-
{ "id": "object.from", "context": "object", "key": "from", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "list", "of": "shape" }, "default": null, "sample": { "value": [{ "api": "/api/orders" }], "with": { "mock": { "items": [{ "no": "A1" }] } } }, "carry": { "transform": "ObjectFrom" }, "prop": "from", "authScan": [{ "path": ["api"], "each": true, "bareString": true, "rank": 1 }], "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.from" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.from" }, { "stage": "facts", "prop": "SomaObjectFacts.hasSource" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/need/verb-resolver.ts"] } }], "effect": { "changes": ["fact"] }, "docSummary": "集合读取", "violations": [{ "kind": "api-unregistered", "code": "ERR-BIZ-002" }], "status": "implemented", "note": "from[] 项键:api / params / into / require。require 是必填参数名数组(非空、无重复、都必须出现在同一项 params 里,违者 CORE-DATA-REQUIRE
|
|
63
|
+
{ "id": "object.from", "context": "object", "key": "from", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "list", "of": "shape" }, "default": null, "sample": { "value": [{ "api": "/api/orders" }], "with": { "mock": { "items": [{ "no": "A1" }] } } }, "carry": { "transform": "ObjectFrom" }, "prop": "from", "authScan": [{ "path": ["api"], "each": true, "bareString": true, "rank": 1 }], "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.from" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.from" }, { "stage": "facts", "prop": "SomaObjectFacts.hasSource" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/need/verb-resolver.ts"] } }], "effect": { "changes": ["fact"] }, "docSummary": "集合读取", "violations": [{ "kind": "api-unregistered", "code": "ERR-BIZ-002" }], "status": "implemented", "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 含负样本)" },
|
|
65
64
|
{ "id": "poll.every", "context": "poll", "key": "every", "order": 1, "surface": ["standard"], "value": { "kind": "int", "min": 2, "max": 300, "unit": "秒" }, "default": null, "sample": { "value": 5 }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaObjectPoll.every" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "轮询间隔(2..300 的整数秒)" },
|
|
66
65
|
{ "id": "poll.while.field", "context": "poll.while", "key": "field", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "status" }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "carrier": "SomaObjectPoll.while", "name": "field" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/data-kit/poll.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "看哪个字段(roles.status 字段或枚举字段)" },
|
|
67
66
|
{ "id": "write.create", "context": "write", "key": "create", "order": 1, "surface": ["standard"], "value": { "kind": "shape", "shape": "write-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o", "method": "post" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.create" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/compose/families/"] } }], "effect": { "changes": ["artifact", "runtime"] }, "docSummary": "写通道", "lsp": { "detail": "新建端点 { api, method: POST | PUT | PATCH }" } },
|
|
68
|
-
{ "id": "field.name", "context": "field", "key": "name", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "客户" }, "carry": "passthrough", "prop": "name", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }], "terminal": { "kind": "consumed", "readers": ["soma-
|
|
67
|
+
{ "id": "field.name", "context": "field", "key": "name", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "客户" }, "carry": "passthrough", "prop": "name", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }, { "stage": "facts", "prop": "SomaFieldFact.name" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/region-env.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段显示名", "status": "implemented" },
|
|
69
68
|
{ "id": "field.option.key", "context": "field.option", "key": "key", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "open" }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldOption.key" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "候选键", "status": "implemented" },
|
|
70
69
|
{ "id": "field.rule.required", "context": "field.rule", "key": "required", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "bool" }, "default": null, "sample": { "value": true }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.required" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "必填", "status": "implemented" },
|
|
71
70
|
{ "id": "page.envelope.url", "context": "page.envelope", "key": "url", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.url" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeUrl" } } }], "docSummary": "页面地址(精确 / 模式 :参数 / 前缀 /*)" },
|
|
@@ -76,11 +75,10 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
76
75
|
{ "id": "page.envelope.meta.description", "context": "page.envelope.meta", "key": "description", "order": 1, "surface": ["standard"], "value": { "kind": "string", "maxCodepoints": 160 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta.description" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "页面描述(字面量)" },
|
|
77
76
|
{ "id": "page.envelope.source.format", "context": "page.envelope.source", "key": "format", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source.format" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源格式标签" },
|
|
78
77
|
{ "id": "page.envelope.lifecycle.persist", "context": "page.envelope.lifecycle", "key": "persist", "order": 1, "surface": ["standard"], "value": { "kind": "enum", "domain": "envelope-persist-levels" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle.persist" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "持久度(memory / runtime / registry)" },
|
|
79
|
-
{ "id": "object.transform", "context": "object", "key": "transform", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "string" }, "default": null, "sample": { "value": { "total_text": "total | money" } }, "carry": { "transform": "ObjectTransform" }, "prop": "transform", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.transform" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/data-object-resolver.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.transform" }, { "stage": "facts", "prop": "SomaFieldFact.derived" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/object-facts.ts", "soma-ui/src/compiler/settle/style.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "取数后派生", "status": "implemented" },
|
|
80
78
|
{ "id": "poll.while", "context": "poll", "key": "while", "order": 2, "surface": ["standard"], "value": { "kind": "shape", "contains": "poll.while" }, "default": null, "sample": { "value": { "field": "status", "in": ["running"] } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaObjectPoll.while" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "继续轮询的条件" },
|
|
81
79
|
{ "id": "poll.while.in", "context": "poll.while", "key": "in", "order": 2, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "sample": { "value": ["running"] }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "carrier": "SomaObjectPoll.while", "name": "in" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/data-kit/poll.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段取这些候选键时继续轮询" },
|
|
82
80
|
{ "id": "write.update", "context": "write", "key": "update", "order": 2, "surface": ["standard"], "value": { "kind": "shape", "shape": "write-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o/{no}", "method": "put" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.update" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/compose/families/"] } }], "effect": { "changes": ["artifact", "runtime"] }, "docSummary": "写通道", "lsp": { "detail": "更新端点 { api, method: POST | PUT | PATCH }" } },
|
|
83
|
-
{ "id": "field.type", "context": "field", "key": "type", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "field-types" }, "default": null, "sample": { "value": "money" }, "carry": { "transform": "FieldType" }, "prop": "type", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"
|
|
81
|
+
{ "id": "field.type", "context": "field", "key": "type", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "field-types" }, "default": null, "sample": { "value": "money" }, "carry": { "transform": "FieldType" }, "prop": "type", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }, { "stage": "facts", "prop": "SomaFieldFact.type" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "类型(二十六种)", "status": "implemented" },
|
|
84
82
|
{ "id": "field.option.label", "context": "field.option", "key": "label", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "待处理" }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldOption.label" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "候选显示名", "status": "implemented" },
|
|
85
83
|
{ "id": "field.rule.max_len", "context": "field.rule", "key": "max_len", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "int" }, "default": null, "sample": { "value": 20 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.max_len" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/compiler/need/region-env.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最大长度", "status": "implemented" },
|
|
86
84
|
{ "id": "page.envelope.params", "context": "page.envelope", "key": "params", "order": 2, "surface": ["standard"], "value": { "kind": "map", "contains": "page.envelope.params" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeParams" } } }], "docSummary": "地址参数规格(名与 url 的 :名 对应)" },
|
|
@@ -91,7 +89,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
91
89
|
{ "id": "page.envelope.meta.tags", "context": "page.envelope.meta", "key": "tags", "order": 2, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta.tags" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "标签(≤8 个)" },
|
|
92
90
|
{ "id": "page.envelope.source.author", "context": "page.envelope.source", "key": "author", "order": 2, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source.author" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源作者标签" },
|
|
93
91
|
{ "id": "page.envelope.lifecycle.expires", "context": "page.envelope.lifecycle", "key": "expires", "order": 2, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle.expires" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "有效期(<n>m|h|d,≤30d)" },
|
|
94
|
-
{ "id": "object.fields", "context": "object", "key": "fields", "order":
|
|
92
|
+
{ "id": "object.fields", "context": "object", "key": "fields", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "shape", "contains": "field" }, "default": null, "sample": { "value": { "no": { "type": "text" } } }, "carry": { "transform": "ObjectFields" }, "prop": "fields", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/certify/invariants/", "soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/page/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }, { "stage": "facts", "prop": "SomaObjectFacts.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/settle/subtree.ts", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/need/region-env.ts", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段字典", "status": "implemented", "note": "字段字典:每个字段的键见 field 上下文" },
|
|
95
93
|
{ "id": "write.reload", "context": "write", "key": "reload", "order": 6, "surface": ["standard"], "value": { "kind": "list", "of": "string", "also": ["self", "all"] }, "default": null, "sample": { "value": "self" }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.reload" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "提交后重取", "lsp": { "detail": "提交成功后重取:self / all / 本页数据对象名列表" } },
|
|
96
94
|
{ "id": "write.version", "context": "write", "key": "version", "order": 3, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "rev", "root": { "from": [{ "api": "/api/orders" }], "fields": { "rev": { "type": "int" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.version" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "乐观锁 / 白名单 / 改名", "lsp": { "detail": "乐观锁字段(必须在字典里,随请求体上行)" } },
|
|
97
95
|
{ "id": "field.rule.min_len", "context": "field.rule", "key": "min_len", "order": 3, "origin": "base", "surface": ["standard"], "value": { "kind": "int" }, "default": null, "sample": { "value": 2 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.min_len" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最小长度", "status": "implemented" },
|
|
@@ -108,7 +106,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
108
106
|
{ "id": "page.envelope.params.max", "context": "page.envelope.params", "key": "max", "order": 4, "surface": ["standard"], "value": { "kind": "int" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.max" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "int 上界" },
|
|
109
107
|
{ "id": "page.envelope.query.values", "context": "page.envelope.query", "key": "values", "order": 4, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.query.values" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkQuerySpec" } } }], "docSummary": "enum 候选(1–32 个)" },
|
|
110
108
|
{ "id": "page.envelope.nav.parent", "context": "page.envelope.nav", "key": "parent", "order": 4, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.parent" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "导航高亮的父页精确地址" },
|
|
111
|
-
{ "id": "object.write", "context": "object", "key": "write", "order":
|
|
109
|
+
{ "id": "object.write", "context": "object", "key": "write", "order": 4, "origin": "base", "surface": ["standard"], "value": { "kind": "shape", "contains": "write" }, "default": null, "sample": { "value": { "update": { "api": "/api/o/{no}", "method": "put" } } }, "carry": { "transform": "ObjectWrite" }, "prop": "write", "authScan": [{ "path": ["create", "api"], "rank": 3 }, { "path": ["update", "api"], "rank": 4 }, { "path": ["delete", "api"], "rank": 5 }], "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/forms/verb-events.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/page/region-scope.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canCreate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canUpdate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/edit.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "写通道", "violations": [{ "kind": "api-unregistered", "code": "ERR-BIZ-002" }], "status": "implemented" },
|
|
112
110
|
{ "id": "write.only", "context": "write", "key": "only", "order": 5, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "sample": { "value": ["title"], "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.only" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "乐观锁 / 白名单 / 改名", "lsp": { "detail": "请求体字段白名单(非空字段名列表)" } },
|
|
113
111
|
{ "id": "field.options", "context": "field", "key": "options", "order": 5, "origin": "base", "surface": ["standard"], "value": { "kind": "list", "of": "shape", "contains": "field.option" }, "default": null, "sample": { "value": [{ "key": "open", "label": "待处理", "class": "waiting" }], "with": { "type": "enum" } }, "carry": { "transform": "FieldOptions" }, "prop": "options", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }, { "stage": "facts", "prop": "SomaFieldFact.options" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/settle/control-form.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/styling/state-variants.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }, { "stage": "facts", "prop": "SomaFieldFact.optionCount" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/settle/control-form.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "枚举候选", "status": "implemented" },
|
|
114
112
|
{ "id": "field.rule.min", "context": "field.rule", "key": "min", "order": 5, "origin": "base", "surface": ["standard"], "value": { "kind": "number" }, "default": null, "sample": { "value": 0 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.min" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/shared/field-components.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最小值", "status": "implemented" },
|
|
@@ -116,7 +114,6 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
116
114
|
{ "id": "page.envelope.params.max_len", "context": "page.envelope.params", "key": "max_len", "order": 5, "surface": ["standard"], "value": { "kind": "int", "min": 1, "max": 200 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.max_len" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "string / slug 最大长度" },
|
|
117
115
|
{ "id": "page.envelope.query.max_len", "context": "page.envelope.query", "key": "max_len", "order": 5, "surface": ["standard"], "value": { "kind": "int", "min": 1, "max": 200 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.query.max_len" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkQuerySpec" } } }], "docSummary": "string / slug 最大长度" },
|
|
118
116
|
{ "id": "page.envelope.nav.items", "context": "page.envelope.nav", "key": "items", "order": 5, "surface": ["standard"], "value": { "kind": "list", "of": "shape" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.items" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,导航项形状判据 navItemsProblem(core/shared/region-query.ts)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "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 时有意义)" },
|
|
119
|
-
{ "id": "object.predicates", "context": "object", "key": "predicates", "order": 6, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "shape" }, "default": null, "sample": { "value": { "vip": { "field": "level", "op": "eq", "value": "vip" } }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "level": { "type": "text" } } } }, "carry": { "transform": "ObjectPredicates" }, "prop": "predicates", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.predicates" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "具名条件", "status": "implemented", "note": "页内 objects: 不收(编译产物形态)" },
|
|
120
117
|
{ "id": "field.rule.max", "context": "field.rule", "key": "max", "order": 6, "origin": "base", "surface": ["standard"], "value": { "kind": "number" }, "default": null, "sample": { "value": 100 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.max" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/shared/field-components.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最大值", "status": "implemented" },
|
|
121
118
|
{ "id": "page.envelope.nav", "context": "page.envelope", "key": "nav", "order": 6, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.nav", "also": ["false"] }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "导航(false,或 group / order / icon / parent)" },
|
|
122
119
|
{ "id": "page.envelope.params.values", "context": "page.envelope.params", "key": "values", "order": 6, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.values" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "enum 候选(1–32 个)" },
|
|
@@ -126,24 +123,49 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
|
|
|
126
123
|
{ "id": "page.envelope.nav.list", "context": "page.envelope.nav", "key": "list", "order": 7, "surface": ["standard"], "value": { "kind": "any" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.list" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);形状判据 listUrlDiagnostics(core/shared/list-origin.ts),来源还原见 parseListUrl", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "来源列表声明(list.url: prefix / keys / staticFilters)" },
|
|
127
124
|
{ "id": "field.rule.message", "context": "field.rule", "key": "message", "order": 8, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "提示", "with": { "max_len": 20 } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.message" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "校验失败提示", "status": "implemented" },
|
|
128
125
|
{ "id": "page.envelope.frame", "context": "page.envelope", "key": "frame", "order": 8, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.frame" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeFrame" } } }], "docSummary": "逻辑外壳名(或 none)" },
|
|
129
|
-
{ "id": "write.delete", "context": "write", "key": "delete", "order":
|
|
130
|
-
{ "id": "field.rule.when", "context": "field.rule", "key": "when", "order": 9, "origin": "extra", "surface": ["standard"], "value": { "kind": "shape", "shape": "predicate" }, "default": null, "sample": { "value": { "field": "g", "op": "eq", "value": true }, "with": { "required": true }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "g": { "type": "bool" }, "f": { "type": "int", "rules": [{ "message": "提示" }] } } } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.when" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/parser/data-config-parser.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "条件规则(谓词成立才参与)", "status": "implemented" },
|
|
126
|
+
{ "id": "write.delete", "context": "write", "key": "delete", "order": 7, "surface": ["standard"], "value": { "kind": "shape", "shape": "delete-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o/{no}" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.delete" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "删除端点(DELETE,不带请求体)", "lsp": { "detail": "删除端点 { api, method?: DELETE },不带请求体" } },
|
|
131
127
|
{ "id": "page.envelope.locale", "context": "page.envelope", "key": "locale", "order": 9, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.locale" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLocale" } } }], "docSummary": "本页字面量所用语言(BCP 47)" },
|
|
132
|
-
{ "id": "write.validate_on", "context": "write", "key": "validate_on", "order":
|
|
133
|
-
{ "id": "write.failWhen", "context": "write", "key": "failWhen", "order":
|
|
134
|
-
{ "id": "write.messagePath", "context": "write", "key": "messagePath", "order":
|
|
135
|
-
{ "id": "write.timeoutMs", "context": "write", "key": "timeoutMs", "order":
|
|
136
|
-
{ "id": "field.rule.async", "context": "field.rule", "key": "async", "order":
|
|
128
|
+
{ "id": "write.validate_on", "context": "write", "key": "validate_on", "order": 8, "surface": ["standard"], "value": { "kind": "list", "of": "string", "domain": "validate-triggers" }, "default": null, "sample": { "value": ["blur", "submit"] }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.validate_on" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验时机 / 离开守卫", "lsp": { "detail": "校验时机:change / blur / submit 的非空无重复列表" } },
|
|
129
|
+
{ "id": "write.failWhen", "context": "write", "key": "failWhen", "order": 17, "surface": ["standard"], "value": { "kind": "map" }, "default": null, "sample": { "value": { "field": "success", "op": "eq", "value": false }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.failWhen" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败判定", "lsp": { "detail": "HTTP 成功但响应体命中此闭集谓词即按失败落账(字段是响应体顶层键,深取用 path);core 不预设后端字段约定" } },
|
|
130
|
+
{ "id": "write.messagePath", "context": "write", "key": "messagePath", "order": 18, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "message", "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" }, "failWhen": { "field": "success", "op": "eq", "value": false } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.messagePath" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败信息路径", "lsp": { "detail": "命中 failWhen 时业务错误信息在响应体里的点路径" } },
|
|
131
|
+
{ "id": "write.timeoutMs", "context": "write", "key": "timeoutMs", "order": 19, "surface": ["standard"], "value": { "kind": "int", "min": 1000, "max": 600000, "unit": "毫秒" }, "default": null, "sample": { "value": 120000, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.timeoutMs" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "写请求超时(毫秒)", "lsp": { "detail": "本写通道各端点(create / update / delete)单次请求的超时毫秒数,1000..600000 的整数;不写 = 沿用 Host http 服务的缺省超时。用于耗时长的后端调用,超时按网络失败落账" } },
|
|
132
|
+
{ "id": "field.rule.async", "context": "field.rule", "key": "async", "order": 9, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": { "check": "order_no_free", "on_error": "pass" } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.async" }], "terminal": { "kind": "validate-only", "why": "async 规则由 parseAsyncRule 核形状(检查器名 / { check, on_error? },闭集外键拒收)并携带;合并规则与防抖在 client/validation/async-rules.ts,检查器由应用注册(R-22 / R-23)", "check": { "file": "soma-core/core/client/parser/data-config-parser.ts", "contains": "function parseAsyncRule" } } }], "status": "implemented", "docSummary": "异步校验位(向服务端查重)", "lsp": { "detail": "异步校验 检查器名 | { check, on_error: pass | block }" } },
|
|
137
133
|
{ "id": "page.envelope.meta", "context": "page.envelope", "key": "meta", "order": 10, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.meta" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "页面元信息(description / tags)" },
|
|
138
|
-
{ "id": "field.rule.severity", "context": "field.rule", "key": "severity", "order":
|
|
134
|
+
{ "id": "field.rule.severity", "context": "field.rule", "key": "severity", "order": 10, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "validation-severities" }, "default": null, "sample": { "value": "hint", "with": { "required": true } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.severity" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/validation/soft-once.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验强度(hard / soft-once / hint / discourage)", "violations": [{ "kind": "severity-declaration", "code": "CORE-OBJ-DECLARATION-INVALID" }], "status": "implemented" },
|
|
139
135
|
{ "id": "page.envelope.version", "context": "page.envelope", "key": "version", "order": 11, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.version" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeVersion" } } }], "docSummary": "作者修订标签" },
|
|
140
136
|
{ "id": "page.envelope.source", "context": "page.envelope", "key": "source", "order": 12, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.source" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源盖章(format / author)" },
|
|
141
|
-
{ "id": "object.name", "context": "object", "key": "name", "order":
|
|
137
|
+
{ "id": "object.name", "context": "object", "key": "name", "order": 10, "origin": "extra", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "订单" }, "carry": { "transform": "ObjectName" }, "prop": "displayName", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/inspect.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }, { "stage": "facts", "prop": "SomaObjectFacts.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/families/browse.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "显示名", "status": "implemented", "note": "解析产物里叫 displayName:config.name 是对象键名" },
|
|
142
138
|
{ "id": "page.envelope.lifecycle", "context": "page.envelope", "key": "lifecycle", "order": 13, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.lifecycle" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "生命周期(persist / expires / warm)" },
|
|
143
|
-
{ "id": "object.poll", "context": "object", "key": "poll", "order":
|
|
144
|
-
{ "id": "field.
|
|
145
|
-
{ "id": "field.default", "context": "field", "key": "default", "order": 29, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": "open", "with": { "type": "text", "permission": "w" } }, "carry": { "transform": "FieldDefault" }, "prop": "default", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.default" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/form-draft.ts", "soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "新建初值", "status": "implemented" }
|
|
139
|
+
{ "id": "object.poll", "context": "object", "key": "poll", "order": 17, "origin": "extra", "surface": ["standard"], "value": { "kind": "shape", "contains": "poll" }, "default": null, "sample": { "value": { "every": 5, "while": { "field": "status", "in": ["running"] } }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "status": { "type": "enum", "options": [{ "key": "running", "label": "运行中", "class": "active" }] } }, "roles": { "status": "status" } } }, "carry": { "transform": "ObjectPoll" }, "prop": "poll", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.poll" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/parser/data-config-parser.ts", "soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "自动重取", "status": "implemented" },
|
|
140
|
+
{ "id": "field.default", "context": "field", "key": "default", "order": 26, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": "open", "with": { "type": "text", "permission": "w" } }, "carry": { "transform": "FieldDefault" }, "prop": "default", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.default" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/form-draft.ts", "soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "新建初值", "status": "implemented" }
|
|
146
141
|
],
|
|
142
|
+
"pageForbiddenLogicKeys": {
|
|
143
|
+
"title": "视觉页面不含逻辑语法:页面语法里禁止出现的逻辑键(三层分工:业务逻辑归业务对象,交互逻辑归展示对象,页面只做纯视觉翻译;见 knowledge/SOMA领域建模与组件编写准则.md §1.0)",
|
|
144
|
+
"decidedAt": "2026-11-09",
|
|
145
|
+
"keys": [
|
|
146
|
+
{ "key": "calc", "was": "core 字段计算" },
|
|
147
|
+
{ "key": "derive", "was": "foundation 字段级派生(K19)/ kit derive 模板" },
|
|
148
|
+
{ "key": "derived", "was": "页面声明里的派生写法" },
|
|
149
|
+
{ "key": "showWhen", "was": "条件显示" },
|
|
150
|
+
{ "key": "hiddenWhen", "was": "条件隐藏" },
|
|
151
|
+
{ "key": "disabledWhen", "was": "条件禁用" },
|
|
152
|
+
{ "key": "requiredWhen", "was": "条件必填" },
|
|
153
|
+
{ "key": "when", "was": "动作 when 条件 / show when 对象谓词 { field, op, value } / rules[].when 条件规则(纯路径字符串形 when 是纯绑定,放行)", "forbiddenShape": "object" },
|
|
154
|
+
{ "key": "predicates", "scope": "standard", "was": "data.<对象>.predicates 具名谓词" },
|
|
155
|
+
{ "key": "transform", "scope": "standard", "was": "data.<对象>.transform 取数后派生字段" },
|
|
156
|
+
{ "key": "steps", "scope": "standard", "was": "_event 事件编排(when / switch / for_each / goto)" },
|
|
157
|
+
{ "key": "triggers", "scope": "standard", "was": "_event triggers 条件触发器(condition + value)" },
|
|
158
|
+
{ "key": "switch", "scope": "standard", "was": "_event steps 内 switch 条件分支" },
|
|
159
|
+
{ "key": "for_each", "scope": "standard", "was": "_event steps 内 for_each 循环" },
|
|
160
|
+
{ "key": "parallel", "scope": "standard", "was": "_event steps 内 parallel 并行编排" }
|
|
161
|
+
],
|
|
162
|
+
"pureBinding": { "title": "展示对象的值对页面只读:页面只做纯路径读取,不在页面里取反、比较、映射;需要判断的地方由展示对象直接给最终值(2026-11-10 裁决)", "negatedPath": { "code": "CORE-PAGE-NEGATE-FORBIDDEN", "prefix": "!", "positions": ["show.when", "show.class 值", "show.props 值", "嵌套绑定 when"], "pathPattern": "^!\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+\\s*$", "was": "`!path` 取反前缀(when / class 条件路径 / 组件 props 值)", "remedy": "由展示对象另给相反的成员(如 remarkHidden),页面绑定它" }, "styleComparison": { "code": "CORE-STYLE-COMPARE-FORBIDDEN", "keys": ["condition", "value"], "positions": ["_style states 条目", "_style transitions.active_state"], "was": "_style states 的 `condition: 路径` + `value` 比较 + `apply`,以及 transitions.active_state 的 condition + value", "remedy": "改写成类名档位绑定:`bind: page.成员` + `tiers: { 档位名: 类名 }`,成员的值就是档位名" }, "styleTier": { "keys": ["bind", "tiers"], "tierNamePattern": "^[a-z][a-z0-9_-]*$", "maxTiers": 8, "positions": ["_style states.<锚点>", "_style transitions.<锚点>(trigger: active_state)"], "note": "bind 是纯路径(点分标识符,无取反 / 管道 / 运算符);tiers 是 档位名 到 类名串 的闭集映射,成员值不在档位内时不加任何类;档位名闭集 pattern 与个数上限读本节,页面不写比较" }, "roleBy": { "code": "CORE-PAGE-ROLE-BY-INVALID", "pathPattern": "^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$", "positions": ["bind.role_by"], "was": "bind.role_by 写了表达式 / 取反 / 管道 / 映射", "remedy": "role_by 只许纯路径:行字段的值直接作为模板名,匹配 data-soma-role=\"item:取值\";行数据自带模板名" } },
|
|
163
|
+
"exemptContexts": ["diagnostics", "diagnosticExamples", "rejected", "title", "basis", "was", "summary", "docSummary"],
|
|
164
|
+
"exampleRoots": ["soma-kit-demo/pages", "soma-kit/examples", "soma-ui/tests/fixtures/hosts", "soma-core-demo/ui", "soma-core-demo/pages"],
|
|
165
|
+
"exampleFilePatterns": ["_ui.yaml", ".kit.yaml", "_style.yaml"],
|
|
166
|
+
"exampleSkipDirs": ["node_modules", "negative", "__negative__"],
|
|
167
|
+
"note": "forbiddenShape: 'object' = 只禁对象 / 列表形,值为字符串(纯路径绑定)放行;scope: 'standard' = 只在 core 标准格式(四件套 / 注入口)判定,不进 G83 的跨方言语法源与示例页扫描(方言同名键含义不同,如 steps 页面模式)"
|
|
168
|
+
},
|
|
147
169
|
"views": [
|
|
148
170
|
{ "name": "SOMA_DATA_OBJECT_KEYS", "kind": "keys", "context": "object", "type": "strings", "reconcilesWith": "soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_OBJECT_KEYS" },
|
|
149
171
|
{ "name": "SOMA_DATA_FIELD_KEYS", "kind": "keys", "context": "field", "type": "strings", "reconcilesWith": "soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_FIELD_KEYS" },
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SOMA 受控错误的公共基类(两端共用,无任何内部依赖)。
|
|
2
|
+
//
|
|
3
|
+
// 只给「带码的 SOMA 错误」一个统一的判断与读码方式;不统一码的命名空间,
|
|
4
|
+
// 不改错误响应体形状。基类自身不往实例写任何属性:`code` 由子类照旧声明与赋值,
|
|
5
|
+
// 这里只在类型上声明它(`declare` 不产生运行时字段),所以子类的可枚举属性集合不变。
|
|
6
|
+
// `code` 声明为可选:个别子类的码只在特定拒收时才有。
|
|
7
|
+
|
|
8
|
+
export class SomaError extends Error {
|
|
9
|
+
/**
|
|
10
|
+
* 错误码;由子类声明并赋值,基类不写入。
|
|
11
|
+
* 绝大多数子类用字符串码;注册中心错误(`RegistryError`)沿用 45xx 数字码,故类型放宽到 `string | number`,
|
|
12
|
+
* 子类可收窄为 `string` 或 `number`。读码的统一口径 `somaErrorCodeOf` 仍只认非空字符串(数字码读不出、不会被误当字符串码)。
|
|
13
|
+
*/
|
|
14
|
+
declare readonly code?: string | number;
|
|
15
|
+
|
|
16
|
+
constructor(message?: string, options?: { cause?: unknown }) {
|
|
17
|
+
super(message, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 结构口径:是 Error 且 `code` 为非空字符串(兼容跨打包副本、同口径于 `(error as { code?: unknown })?.code`) */
|
|
22
|
+
function hasStringCode(value: unknown): value is Error & { code: string } {
|
|
23
|
+
if (!(value instanceof Error)) return false;
|
|
24
|
+
const code = (value as { code?: unknown }).code;
|
|
25
|
+
return typeof code === 'string' && code !== '';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 是否 SOMA 受控错误:`instanceof SomaError`,或(跨打包副本时)Error 且带非空字符串码 */
|
|
29
|
+
export function isSomaError(value: unknown): value is SomaError {
|
|
30
|
+
return value instanceof SomaError || hasStringCode(value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** 读出错误码;不是 Error 或没有非空字符串码时返回 undefined */
|
|
34
|
+
export function somaErrorCodeOf(value: unknown): string | undefined {
|
|
35
|
+
return hasStringCode(value) ? value.code : undefined;
|
|
36
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 编译用途与页面生成资产来源的类型(06b KC15;06e §2.10 / AD-CORE-04 / AD-CORE-21)。
|
|
2
2
|
//
|
|
3
|
-
// core 不持有编译器端口:方言(soma-ui / soma-
|
|
3
|
+
// core 不持有编译器端口:方言(soma-ui / soma-kit)在运行期把自己的页面编译成标准格式,再按 URL 注入 core。
|
|
4
4
|
// 这里只剩 core 自己用得上的几个形状。
|
|
5
5
|
//
|
|
6
6
|
// 为什么只放类型:本文件住 shared,无 DOM、无 Node 专属 API、不 import core 其他运行代码(KI-8 规则 1)。
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// 对应《soma 数据对象层》:core 的数据对象最小形状。
|
|
2
2
|
// 数据对象是命名数据(如 order),来源是一个或多个后端接口;组件与页面只认对象与字段,不认接口协议。
|
|
3
|
-
// core 只认:取数(from /
|
|
3
|
+
// core 只认:取数(from / into / poll / subscribe)、写通道(create / update / delete / map / only /
|
|
4
4
|
// validate_on / version)、字段字典(name / type / options / default / rules)。键集真源是 std-grammar.json。
|
|
5
5
|
// 其余业务声明不在 core。
|
|
6
6
|
|
|
7
|
-
import type { SomaFieldPredicate
|
|
7
|
+
import type { SomaFieldPredicate } from '../predicates';
|
|
8
8
|
import type { SomaWriteActionName, SomaWriteOutcomeView } from './write-outcome-view.types';
|
|
9
9
|
import type { SomaWriteOutcomeMeta } from './write.types';
|
|
10
10
|
import {
|
|
@@ -79,8 +79,6 @@ export interface SomaDataFieldRule {
|
|
|
79
79
|
severity?: SomaValidationSeverity;
|
|
80
80
|
/** 校验失败提示文案 */
|
|
81
81
|
message: string;
|
|
82
|
-
/** 条件规则(`rules[].when`):对所在记录求值的字段谓词,成立才执行本条规则;没写 = 恒参与 */
|
|
83
|
-
when?: SomaFieldPredicate;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/** 字段字典条目(驱动 UI 的元数据,全部可选) */
|
|
@@ -95,12 +93,6 @@ export interface SomaDataFieldConfig {
|
|
|
95
93
|
options?: SomaDataFieldOption[];
|
|
96
94
|
/** 缺省值 */
|
|
97
95
|
default?: unknown;
|
|
98
|
-
/**
|
|
99
|
-
* 派生列:`"[revenue] - [cost]"`。受限算式(方括号引用同对象字段、四则、比较、六个函数),
|
|
100
|
-
* 解析期推出结果类型并与声明的 `type` 对账;取数收尾时由 core 算出来挂到记录上。
|
|
101
|
-
* 派生字段是算出来的,提交时不能写它。
|
|
102
|
-
*/
|
|
103
|
-
calc?: string;
|
|
104
96
|
}
|
|
105
97
|
|
|
106
98
|
/**
|
|
@@ -119,8 +111,10 @@ export interface SomaDataSourceConfig {
|
|
|
119
111
|
* 必填参数名(都必须出现在同一项的 `params` 里):任一必填参数解析后为 null / undefined / 空串时跳过本次请求,
|
|
120
112
|
* 该来源不并入对象(写了 `into` 的子键落空数组),对象标 `idle`(数据端口 `getObjectStatus`);不是错误。
|
|
121
113
|
* 每次解析 / 重取都重新判定,参数补齐后的下一次重取就会发请求。
|
|
114
|
+
* 元素也可以是「至少一个」分组:2 个及以上不同参数名的数组(如 `[[changeId, deliverableId]]`),
|
|
115
|
+
* 组内全部为空才跳过;单名字符串与分组可混写。只此一层,不嵌套、不取反、不表达「恰好一个」。
|
|
122
116
|
*/
|
|
123
|
-
require?: string[]
|
|
117
|
+
require?: Array<string | string[]>;
|
|
124
118
|
/** 响应信封失败判定:HTTP 成功但响应体命中此闭集谓词即按取数失败(字段是响应体顶层键,深取用 `path`) */
|
|
125
119
|
failWhen?: SomaFieldPredicate;
|
|
126
120
|
/** 命中 failWhen 时,业务错误信息在响应体里的点路径 */
|
|
@@ -212,19 +206,12 @@ export interface SomaDataObjectConfig {
|
|
|
212
206
|
displayName?: string;
|
|
213
207
|
/** 取数来源列表 */
|
|
214
208
|
from: SomaDataSourceConfig[];
|
|
215
|
-
/**
|
|
216
|
-
* 派生字段:值为 "源字段路径 | 管道链"(复用 pipe-registry)。
|
|
217
|
-
* 解析期已归一化为标准管道语法(`date: 'x'` → `date('x')`)。
|
|
218
|
-
*/
|
|
219
|
-
transform?: Record<string, string>;
|
|
220
209
|
/** 字段字典(字段名 → 字典条目) */
|
|
221
210
|
fields?: Record<string, SomaDataFieldConfig>;
|
|
222
211
|
/** 写通道声明;不给 = 该对象只读 */
|
|
223
212
|
write?: SomaDataWriteConfig;
|
|
224
213
|
/** 对象级轮询:服务端状态会自己变的对象(排队 → 生成中 → 已生成) */
|
|
225
214
|
poll?: SomaObjectPoll;
|
|
226
|
-
/** 具名谓词表:`{ 名字: 谓词 }`,条件规则 `{ ref: 名字 }` 复用 */
|
|
227
|
-
predicates?: SomaNamedPredicates;
|
|
228
215
|
/** 解析期提取:params 引用到的其他数据对象名(DAG 拓扑排序输入,不含自引用) */
|
|
229
216
|
deps: string[];
|
|
230
217
|
}
|
|
@@ -249,6 +236,19 @@ export type SomaCommandResult =
|
|
|
249
236
|
| { ok: true; data?: unknown; refreshError?: string; status?: number }
|
|
250
237
|
| { ok: false; message: string; status?: number; fieldErrors?: Record<string, string> };
|
|
251
238
|
|
|
239
|
+
/** 数据对象标准读状态 */
|
|
240
|
+
export type SomaDataReadState = 'idle' | 'loading' | 'ready' | 'error' | 'forbidden' | 'partial';
|
|
241
|
+
|
|
242
|
+
/** 数据对象完整读状态视图(同时以非枚举属性挂在数据对象自身上) */
|
|
243
|
+
export interface SomaDataReadStatus {
|
|
244
|
+
readonly readState: SomaDataReadState;
|
|
245
|
+
readonly loading: boolean;
|
|
246
|
+
readonly ready: boolean;
|
|
247
|
+
readonly errorMessage?: string;
|
|
248
|
+
readonly errorStatus?: number;
|
|
249
|
+
readonly retry?: () => Promise<void>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
252
|
/**
|
|
253
253
|
* 注入给组件的数据端口(services 白名单里的 `data`)。
|
|
254
254
|
* 复杂度沉引擎:组件只做「收值 → 调 submit → 渲染返回的 fieldErrors」。
|
|
@@ -258,6 +258,8 @@ export interface SomaDataPort {
|
|
|
258
258
|
getObject(name: string): unknown;
|
|
259
259
|
/** 对象读状态:`idle` = 因 `from[].require` 的必填参数缺而跳过过请求;`ready` = 其余;未声明 / 数据层未就绪 = undefined */
|
|
260
260
|
getObjectStatus?(name: string): 'idle' | 'ready' | undefined;
|
|
261
|
+
/** 对象完整读状态(含 loading / ready / error / forbidden / partial、错误信息、状态码与 retry) */
|
|
262
|
+
getObjectReadStatus?(name: string): SomaDataReadStatus | undefined;
|
|
261
263
|
/** 字段字典(控件 / 校验来源) */
|
|
262
264
|
getDict(name: string): Record<string, SomaDataFieldConfig>;
|
|
263
265
|
/** 提交:剔只读字段、map/only、基础规则校验、version 令牌、构体、发请求、错误逆映射;从不抛 */
|
|
@@ -19,9 +19,6 @@ export interface BindingEntry {
|
|
|
19
19
|
templateCache?: DocumentFragment;
|
|
20
20
|
childShowConfig?: ShowMapping;
|
|
21
21
|
attrName?: string;
|
|
22
|
-
negate?: boolean;
|
|
23
|
-
/** `when` 对象谓词(来自 SomaCompiledBinding.whenTest) */
|
|
24
|
-
whenTest?: import('../show-when').SomaShowWhenTest;
|
|
25
22
|
classRules?: Record<string, string>;
|
|
26
23
|
/** 展示格式化管道链(text/attr 绑定,来自 SomaCompiledBinding.pipes) */
|
|
27
24
|
pipes?: import('./scope-manifest.types').SomaPipeCall[];
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* 事件类型枚举
|
|
6
6
|
* 定义 Pipeline DSL 支持的四种事件处理类型
|
|
7
7
|
*/
|
|
8
|
-
import type { SomaStepGraph } from './step.types';
|
|
9
8
|
import type { SomaScopeEventSpec } from './region-scope.types';
|
|
10
9
|
|
|
11
10
|
export type EventType =
|
|
@@ -27,10 +26,7 @@ export type EventType =
|
|
|
27
26
|
// 声明式提示(《core 标准声明面审计》S3 / S7):`NOTIFY | <级别> | <文案key> [| sticky] [| polite|assertive]`。
|
|
28
27
|
// 级别闭集见 NOTIFY_LEVELS;落点由 core 实现(INotifyService / announcer),不经 Host 注册表。
|
|
29
28
|
| 'NOTIFY'
|
|
30
|
-
|
|
31
|
-
// 它不能写成管道串——一串步骤没法压进一行竖线分隔的文本,硬压只会得到
|
|
32
|
-
// 一门新的微型语法。所以它只从对象形态来,`parsePipelineBody` 不认它。
|
|
33
|
-
| 'STEPS';
|
|
29
|
+
;
|
|
34
30
|
|
|
35
31
|
/**
|
|
36
32
|
* UI 交互动作枚举
|
|
@@ -69,6 +65,10 @@ export interface NotifyDeclaration {
|
|
|
69
65
|
export const SOMA_CONFIRM_LEVELS = ['plain', 'typed', 'consent'] as const;
|
|
70
66
|
export type SomaConfirmLevel = (typeof SOMA_CONFIRM_LEVELS)[number];
|
|
71
67
|
|
|
68
|
+
/** 确认语气闭集:default 常规 / danger 破坏性(删除等)。中性词,不规定样子;缺省 = default */
|
|
69
|
+
export const SOMA_CONFIRM_TONES = ['default', 'danger'] as const;
|
|
70
|
+
export type SomaConfirmTone = (typeof SOMA_CONFIRM_TONES)[number];
|
|
71
|
+
|
|
72
72
|
/** 确认规格:`confirm:` 段的标准结构 */
|
|
73
73
|
export interface SomaConfirmSpec {
|
|
74
74
|
readonly level: SomaConfirmLevel;
|
|
@@ -78,6 +78,11 @@ export interface SomaConfirmSpec {
|
|
|
78
78
|
readonly phrase?: string;
|
|
79
79
|
/** 关联项影响说明;consent 级必写,typed 级可选 */
|
|
80
80
|
readonly impact?: string;
|
|
81
|
+
/**
|
|
82
|
+
* 语气:只有 `danger` 会出现(`default` / 不写 = 常规,解析时归一为不带本字段)。
|
|
83
|
+
* 渲染端口据它决定确认钮的警示呈现与初始焦点(破坏性确认的初始焦点应在「取消」);typed / consent 的放行规则不受它影响。
|
|
84
|
+
*/
|
|
85
|
+
readonly tone?: Exclude<SomaConfirmTone, 'default'>;
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
/**
|
|
@@ -85,12 +90,6 @@ export interface SomaConfirmSpec {
|
|
|
85
90
|
* Pipeline DSL 解析器将 YAML 中的事件声明解析为此结构
|
|
86
91
|
*/
|
|
87
92
|
export interface ParsedEvent {
|
|
88
|
-
/**
|
|
89
|
-
* 动作编排图(`type === 'STEPS'` 时有)。
|
|
90
|
-
* 解析在 `step-parser`,执行在 `step-runner`;不带它的事件走原来的单管道路径。
|
|
91
|
-
*/
|
|
92
|
-
steps?: SomaStepGraph;
|
|
93
|
-
|
|
94
93
|
/** 目标元素的 data-soma-id 值 */
|
|
95
94
|
somaId: string;
|
|
96
95
|
|