soma-core 2.2.4 → 2.2.6
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 +1848 -3244
- 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/SomaContainerAdapter.ts +9 -1
- package/core/client/data/data-object-resolver.ts +516 -181
- 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 +1 -105
- 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 +385 -98
- 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/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 +1 -1
- package/core/client/parser/data-config-parser.ts +27 -210
- package/core/client/parser/pipeline-parser.ts +14 -59
- 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/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 +1 -35
- 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 +5 -4
- package/core/server/compile-port.ts +1 -1
- package/core/server/host/app-config-composer.ts +2 -1
- package/core/server/host/host-assembly-entry.ts +1 -0
- package/core/server/host/host-assembly.ts +47 -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/virtual-pages.ts +3 -2
- package/core/server/infra/cache/ServerFileCache.ts +79 -9
- 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 +74 -15
- 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 +8 -0
- 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 +16 -19
- package/core/shared/registry-generated/diagnostic-registry.ts +135 -177
- package/core/shared/registry-generated/limits.ts +49 -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 +42 -20
- 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 +17 -17
- package/core/shared/types/engine.types.ts +0 -3
- package/core/shared/types/event.types.ts +1 -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 +2567 -2696
- package/dist/core/index.cjs +5446 -5486
- package/dist/host-native/aot-builder.cjs +46 -1
- package/dist/host-native/native-server.cjs +4879 -4505
- package/dist/lsp/component-tree.cjs +5814 -7042
- 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/data/data-object-resolver.d.ts +91 -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/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/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 +2 -7
- 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/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/infra/cache/ServerFileCache.d.ts +8 -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 +119 -158
- package/dist/types/shared/registry-generated/limits.d.ts +40 -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 +109 -241
- package/dist/types/shared/soma-error.d.ts +15 -0
- package/dist/types/shared/types/data-config.types.d.ts +14 -16
- package/dist/types/shared/types/engine.types.d.ts +0 -3
- package/dist/types/shared/types/event.types.d.ts +1 -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 +44 -9
- package/host-native/src/aot-builder.ts +52 -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/package.json +3 -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
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/** 会被浏览器当作 URL 加载/跳转的属性 */
|
|
2
|
+
export declare const URL_BEARING_ATTR_NAMES: readonly ["href", "src", "srcset", "action", "formaction", "poster", "data", "xlink:href", "ping", "background"];
|
|
3
|
+
export declare const URL_BEARING_ATTRS: ReadonlySet<string>;
|
|
4
|
+
/** 危险伪协议:命中即阻断 */
|
|
5
|
+
export declare const BLOCKED_SCHEMES: readonly ["javascript:", "vbscript:", "data:", "file:", "blob:"];
|
|
1
6
|
/** 拦截后写入的安全占位值 */
|
|
2
7
|
export declare const BLOCKED_URL_PLACEHOLDER = "about:blank";
|
|
8
|
+
/**
|
|
9
|
+
* 解码基础 HTML 实体(命名实体 : / &tab; / &newline;、十进制 &#...; 与十六进制 &#x...;)
|
|
10
|
+
* 用于防范利用 HTML 实体编码混淆伪协议前缀绕过安全检查。
|
|
11
|
+
*/
|
|
12
|
+
export declare function decodeHtmlEntities(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 归一化 URL 文本:先解码 HTML 实体,再去除所有空白与控制字符,再小写。
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeUrlValue(value: string): string;
|
|
3
17
|
/** URL 的协议名(小写、不含冒号);相对地址或无协议返回 null。判定核:hasBlockedScheme 与 resolveSafeUrl 共用 */
|
|
4
18
|
export declare function urlSchemeOf(value: string): string | null;
|
|
5
19
|
/** 事件处理器属性(onclick/onerror/…):DSL 永不允许通过绑定写入 */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
1
2
|
import type { SomaAsyncFieldChecker } from './async-rules';
|
|
2
3
|
/** 登记表:`{ 检查器名: 检查器 }` */
|
|
3
4
|
export type SomaAsyncCheckTable = Readonly<Record<string, SomaAsyncFieldChecker>>;
|
|
@@ -11,7 +12,7 @@ export interface SomaValidationService {
|
|
|
11
12
|
asyncChecks(): SomaAsyncCheckTable;
|
|
12
13
|
}
|
|
13
14
|
export type SomaAsyncCheckErrorCode = 'CORE-ASYNC-CHECK-TABLE' | 'CORE-ASYNC-CHECK-UNREGISTERED';
|
|
14
|
-
export declare class SomaAsyncCheckError extends
|
|
15
|
+
export declare class SomaAsyncCheckError extends SomaError {
|
|
15
16
|
readonly code: SomaAsyncCheckErrorCode;
|
|
16
17
|
readonly names: readonly string[];
|
|
17
18
|
constructor(code: SomaAsyncCheckErrorCode, message: string, names?: readonly string[]);
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type { SomaDataFieldConfig, SomaDataWriteConfig, SomaValidateTrigger } from '../../shared/types/data-config.types';
|
|
2
|
-
import type { SomaNamedPredicates } from '../../shared/predicates';
|
|
3
2
|
import { type RuleFailure } from './field-rules';
|
|
4
3
|
/** 写通道声明的校验时机里有没有这一个:没声明 `validate_on` 恒为真(时机由调用方决定,存量口径) */
|
|
5
4
|
export declare function shouldValidateOn(write: Pick<SomaDataWriteConfig, 'validate_on'> | undefined, trigger: SomaValidateTrigger): boolean;
|
|
6
5
|
export interface ObjectRecordCheckOptions {
|
|
7
6
|
/** 只校验这些字段(缺省 = 字典里全部字段) */
|
|
8
7
|
readonly keys?: readonly string[];
|
|
9
|
-
/** 对象的具名谓词表(条件规则的 `{ ref }`) */
|
|
10
|
-
readonly named?: SomaNamedPredicates;
|
|
11
|
-
/** 条件规则的求值记录(缺省 = `record` 本身);数据端口传「读态 ∪ 表单值」 */
|
|
12
|
-
readonly context?: Readonly<Record<string, unknown>>;
|
|
13
8
|
/** 方言接入的领域值协议检查(日期粒度、时间型值形状等):非空值逐字段调用,返回失败或 null;缺省不检查 */
|
|
14
9
|
readonly protocolCheck?: (field: SomaDataFieldConfig, value: unknown) => RuleFailure | null;
|
|
15
10
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type { SomaDataHttpLike, SomaDataResolverOptions, SomaDataResolveResult,
|
|
|
15
15
|
export { attachDataSubscriptions, parseInvalidation } from './client/data/data-subscriptions';
|
|
16
16
|
export { attachDataPolling, pollStillRunning } from './client/data/data-polling';
|
|
17
17
|
export type { SomaDataSubscriptionHandle, SomaDataSubscriptionOptions } from './client/data/data-subscriptions';
|
|
18
|
-
export { parseDataConfig, parseDataYaml, parseDataRef,
|
|
18
|
+
export { parseDataConfig, parseDataYaml, parseDataRef, SomaDataConfigError, SOMA_DATA_OBJECT_KEYS, SOMA_DATA_FIELD_KEYS, SOMA_DATA_RULE_KEYS, } from './client/parser/data-config-parser';
|
|
19
19
|
export { isOnStepGrid, stepCountOf, stepOriginOf } from './shared/rule-step';
|
|
20
20
|
export { SOMA_NAV_BACK_KEYS, isExcludedEntry, isInternalPath, matchPathPattern, navBackDiagnostics, navExcludeProblem, navPreviousCountProblem, pathOfUrl, pickBackIndex, } from './shared/nav-back';
|
|
21
21
|
export type { SomaNavBackDecl, SomaNavBackOptions, SomaNavBackResult, SomaNavHistoryEntry, SomaNavHistoryPort, } from './shared/types/nav-context.types';
|
|
@@ -27,13 +27,8 @@ export { SOMA_DATA_FIELD_TYPES, SOMA_DATA_FIELD_TYPE_ALIASES, } from './shared/t
|
|
|
27
27
|
export { SOMA_FIELD_PREDICATE_OPS, evaluatePredicate, validatePredicate, validateNamedPredicates, collectPredicateFields, SOMA_RELATIVE_WINDOW_UNITS, inspectRelativeWindowValue, } from './shared/predicates';
|
|
28
28
|
export type { SomaRelativeWindowUnit } from './shared/predicates';
|
|
29
29
|
export type { SomaFieldPredicateOp, SomaFieldCondition, SomaFieldPredicateRef, SomaFieldPredicateAllOf, SomaFieldPredicateAnyOf, SomaFieldPredicateNoneOf, SomaFieldPredicate, SomaNamedPredicates, SomaPredicateValidateOptions, } from './shared/predicates';
|
|
30
|
-
export { parseSteps } from './client/parser/step-parser';
|
|
31
|
-
export type { StepParseInput, StepParseDeps } from './client/parser/step-parser';
|
|
32
|
-
export { runSteps } from './client/engine/step-runner';
|
|
33
30
|
export { parsePageState, parseStateValue, encodePageState, decodePageState, } from './client/parser/page-state-parser';
|
|
34
31
|
export type { SomaPageState, SomaPageStateConfig, } from './shared/types/page-state.types';
|
|
35
|
-
export type { StepRunContext, StepRunResult } from './client/engine/step-runner';
|
|
36
|
-
export type { SomaStep, SomaDoStep, SomaSwitchStep, SomaParallelStep, SomaForEachStep, SomaStepOnError, SomaStepSlot, SomaCompiledStep, SomaStepGraph, } from './shared/types/step.types';
|
|
37
32
|
export { createObserverPool, scheduleFlush, } from './client/scheduling/index';
|
|
38
33
|
export type { SomaObserverPool, SomaObserverSize, SomaObserverSizeCallback, SomaFlushTask, } from './client/scheduling/index';
|
|
39
34
|
export type { SomaComponentDefinition, SomaComponentControllerContext, SomaComponentControllerFactory, } from './client/component/component-definition.types';
|
|
@@ -110,9 +105,9 @@ export { createSomaDomainLoaderKey, findSomaDomainLoader, loadSomaDomainModuleFr
|
|
|
110
105
|
export { createGeneratedPagePreview, createSomaPageLifecycle, renderPublishedPage, SomaPageLifecycle, type GeneratedPageDeclarations, type GeneratedPagePreviewOptions, type PrecompiledDeclarationAssets, type PreviewHandle, type PreviewObservabilityOptions, type MountedPageInfo, type PublishedPageHandle, type PublishedPageRecord, type RegisterDeclarationOptions, type RenderPublishedPageOptions, type SomaPageLifecycleOptions, PUBLISHED_PAGE_SLUG_PATTERN, RESERVED_PUBLISHED_PAGE_SLUGS, isPublishedPageSlug, normalizePublishedPageSlug, publishedPagePath, publishedPageSlugFromPath, } from './client/registry/index';
|
|
111
106
|
export { composeComponentPacks, ComponentPackError, PACK_NAME_PATTERN, type ComposedComponentPacks, type ComposePacksOptions, type SomaComponentPack, type SomaComponentPackStyles, type PackOverrideEvent, } from './client/component/component-pack';
|
|
112
107
|
export { registerComponentPackLocales, validatePackLocales, type SomaComponentPackLocales, type PackLocalesIssue, } from './client/infra/i18n/pack-locales';
|
|
113
|
-
export { parseValueSegment, evaluateValueNode, isArithSegment, isPlainPath, describeNode, SomaValueLangError, type ValueNode, type PipedValue, type ValuePosition, type HasVarFn, type EvalOptions, } from './client/parser/value-lang';
|
|
114
108
|
export type { CompiledFlatPage, FlatPageInput, SomaFlatDoc } from './build/compiler/flat-page';
|
|
115
109
|
export { SomaDeclarationError } from './shared/declaration-errors';
|
|
110
|
+
export { SomaError, isSomaError, somaErrorCodeOf } from './shared/soma-error';
|
|
116
111
|
export type { HtmlAnchorIndex, HtmlAnchorInfo } from './build/compiler/html-index';
|
|
117
112
|
export { SOMA_ANCHOR_DUPLICATE_CODE, anchorDuplicateMessage, declaredFragmentRegions, type SomaDeclaredFragmentRegion, } from './shared/anchor-space';
|
|
118
113
|
export { attachPackStyles, ensurePackBaseStyles, resetPackStyleInjection, type PackStyleOptions, } from './client/styles/pack-styles';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from '../shared/soma-error';
|
|
1
2
|
import { SomaBootstrap } from '../client/engine/soma-bootstrap';
|
|
2
3
|
import type { RuntimeObservation } from '../shared/types/observation.types';
|
|
3
4
|
import type { SomaLocaleDictionary } from '../shared/types/locale.types';
|
|
@@ -7,7 +8,7 @@ export type { RuntimeObservation, SomaObservedActivation, SomaObservedAdaptive,
|
|
|
7
8
|
export { evaluatePredicate } from '../shared/predicates';
|
|
8
9
|
export type { SomaDataPort } from '../shared/types/data-config.types';
|
|
9
10
|
/** 运行出口的可辨认错误(testkit 据 code 报 ERR-VERIFY-EXIT-MODE) */
|
|
10
|
-
export declare class SomaRuntimeExitError extends
|
|
11
|
+
export declare class SomaRuntimeExitError extends SomaError {
|
|
11
12
|
readonly code: 'CORE-OBSERVE-OFF';
|
|
12
13
|
constructor(code: 'CORE-OBSERVE-OFF', message: string);
|
|
13
14
|
}
|
|
@@ -10,6 +10,11 @@ export interface RequestCookiesAdapter {
|
|
|
10
10
|
export interface DispatchHostServiceApiOptions {
|
|
11
11
|
readonly segments?: readonly string[];
|
|
12
12
|
readonly hostDir?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 内部选项:标记宿主壳是否已经执行过请求钩子。
|
|
15
|
+
* 仅供原生宿主壳(如 native-server)在读请求体前已执行过鉴权钩子时使用,为 true 时避免重复执行钩子。
|
|
16
|
+
*/
|
|
17
|
+
readonly requestHookHandled?: boolean;
|
|
13
18
|
}
|
|
14
19
|
export declare function polyfillServiceRequest<T extends Request>(request: T): T & {
|
|
15
20
|
nextUrl: URL;
|
|
@@ -7,4 +7,4 @@ export declare function clearHostServiceCache(hostDir?: string): void;
|
|
|
7
7
|
/**
|
|
8
8
|
* 按约定从宿主 apiRoot 加载 IService 实例(运行时按需加载,零手动 registry)。
|
|
9
9
|
*/
|
|
10
|
-
export declare function loadHostService(segments: string[]): IService | null;
|
|
10
|
+
export declare function loadHostService(segments: string[], hostDir?: string): IService | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-side compile-port entry (subpath `soma-core/server/compile-port`, 06e §2.10).
|
|
3
3
|
*
|
|
4
|
-
* core 不持有编译器,也不回调方言编译器:方言(soma-ui / soma-
|
|
4
|
+
* core 不持有编译器,也不回调方言编译器:方言(soma-ui / soma-kit)在运行期把自己的页面编译成标准格式后按 URL 注入 core。
|
|
5
5
|
* 这里只剩编译用途闭集与页面生成资产来源的类型。
|
|
6
6
|
*
|
|
7
7
|
* 刻意不 `import 'server-only'`(与 `server/page-declaration.ts` 同一理由):宿主的 `soma.app.ts`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { loadHostAssembly, runHostStartup, isHostAssemblyReady, assertReservedRoutesShape, registerShellRoutes, registeredShellRoutes, resetShellRoutes, resolveHostLoginPath, isSafeLoginPath, SOMA_DEFAULT_LOGIN_PATH, SOMA_HOST_ASSEMBLY_FILE, } from './host-assembly';
|
|
1
|
+
export { loadHostAssembly, invalidateHostAssembly, runHostStartup, isHostAssemblyReady, assertReservedRoutesShape, registerShellRoutes, registeredShellRoutes, resetShellRoutes, resolveHostLoginPath, isSafeLoginPath, SOMA_DEFAULT_LOGIN_PATH, SOMA_HOST_ASSEMBLY_FILE, } from './host-assembly';
|
|
2
2
|
export { resolveHostCaller, readHostCaller } from './host-caller';
|
|
3
3
|
export type { SomaHostCaller } from './host-caller';
|
|
4
4
|
export { withHostResponseHeaders, resolveHostResponseHeaders, classifyHostResponseKind, } from './host-response-headers';
|
|
@@ -60,3 +60,5 @@ export declare function runHostStartup(appRoot: string): Promise<void>;
|
|
|
60
60
|
export declare function isHostAssemblyReady(appRoot: string): boolean;
|
|
61
61
|
/** 只给测试用:清空装配缓存 */
|
|
62
62
|
export declare function resetHostAssemblyCache(): void;
|
|
63
|
+
/** 清除单个应用的装配缓存(热更新重装配用);启动钩子记忆仍按进程保留一次 */
|
|
64
|
+
export declare function invalidateHostAssembly(appRoot: string): void;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { type SomaHostRequestContext, type SomaRequestHook } from './resolve-host-request-hook';
|
|
2
|
-
export type SomaRequestHookResolver = () => Promise<SomaRequestHook | null>;
|
|
1
|
+
import { type ResolveHostRequestHookOptions, type SomaHostRequestContext, type SomaRequestHook } from './resolve-host-request-hook';
|
|
2
|
+
export type SomaRequestHookResolver = (options?: ResolveHostRequestHookOptions) => Promise<SomaRequestHook | null>;
|
|
3
|
+
export interface InvokeHostRequestHookOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 显式传入的主机根目录。
|
|
6
|
+
* 仅当调用方未传时才回退环境变量 process.env.SOMA_HOST_DIR(兼容旧对外导出调用方)。
|
|
7
|
+
*/
|
|
8
|
+
readonly hostDir?: string;
|
|
9
|
+
}
|
|
3
10
|
export declare function isSomaInternalRequestPath(path: string): boolean;
|
|
4
11
|
/**
|
|
5
12
|
* Calls the Host extension exactly once for Host-owned page/API requests.
|
|
6
13
|
* SOMA's reserved /soma namespace never reaches the Host extension.
|
|
7
14
|
*/
|
|
8
|
-
export declare function invokeHostRequestHook(request: Request, context: SomaHostRequestContext,
|
|
15
|
+
export declare function invokeHostRequestHook(request: Request, context: SomaHostRequestContext, resolveHookOrOptions?: SomaRequestHookResolver | InvokeHostRequestHookOptions, maybeOptions?: InvokeHostRequestHookOptions): Promise<Response | undefined>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
1
2
|
import { publishedPageSlugFromPath } from '../../shared/published-page-route';
|
|
2
3
|
import { type PublishedPageArtifactResult } from './published-page-artifact-cache';
|
|
3
4
|
import type { SomaCoreDiagnostic } from '../../shared/core-diagnostic-codes';
|
|
@@ -8,7 +9,7 @@ export declare const registryPageNameFromPath: typeof publishedPageSlugFromPath;
|
|
|
8
9
|
* 整页错误(页面主题整体解析失败等,端口给的整页失败):不存档、不缓存,Host 路由据此回受控文案 + 诊断码,
|
|
9
10
|
* 而不是静默替换成平台默认主题或把整页混成 404。`message` 是对访客的受控文案(不含内部细节),细节在 `diagnostics`。
|
|
10
11
|
*/
|
|
11
|
-
export declare class SomaPublishedPageError extends
|
|
12
|
+
export declare class SomaPublishedPageError extends SomaError {
|
|
12
13
|
readonly code: string;
|
|
13
14
|
readonly diagnostics: readonly SomaGenerationErrorShape[];
|
|
14
15
|
constructor(diagnostics: readonly SomaGenerationErrorShape[]);
|
|
@@ -3,15 +3,28 @@ export interface SomaHostRequestContext {
|
|
|
3
3
|
kind: SomaHostRequestKind;
|
|
4
4
|
path: string;
|
|
5
5
|
pageHref?: string;
|
|
6
|
+
/** 原生宿主可选的惰性 body 入口;一次读取、限流、断连取消,返回独立字节副本。 */
|
|
7
|
+
readBody?: () => Promise<Uint8Array>;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Generic server ingress extension. soma-core does not know authentication,
|
|
9
11
|
* authorization, Admin, or any business application.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* A Host may normalize or add server-only request headers before returning
|
|
14
|
+
* undefined. The native adapter constructs a separate service Request with the
|
|
15
|
+
* same post-hook headers and the same original body bytes; Fetch bodies are
|
|
16
|
+
* one-shot, so the hook Request object itself is not reused for dispatch. On
|
|
17
|
+
* native API requests, use optional context.readBody() to lazily read a copied
|
|
18
|
+
* byte array without changing request.body; other adapters may omit it.
|
|
19
|
+
* Returning a Response still short-circuits the request. Client cancellation
|
|
20
|
+
* stops transport work only; it does not roll back server-side writes.
|
|
15
21
|
*/
|
|
16
22
|
export type SomaRequestHook = (request: Request, context: SomaHostRequestContext) => Response | undefined | Promise<Response | undefined>;
|
|
17
|
-
export
|
|
23
|
+
export interface ResolveHostRequestHookOptions {
|
|
24
|
+
/**
|
|
25
|
+
* 显式传入的主机根目录。
|
|
26
|
+
* 仅当调用方未传时才回退环境变量 process.env.SOMA_HOST_DIR(兼容旧对外导出调用方)。
|
|
27
|
+
*/
|
|
28
|
+
readonly hostDir?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function resolveHostRequestHook(options?: ResolveHostRequestHookOptions | string): Promise<SomaRequestHook | null>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
1
2
|
import { type SomaAssetSource } from './source-packages';
|
|
2
3
|
import type { SomaPageMarkup, TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
3
4
|
import type { TreeArtifact } from '../../shared/types/component-tree-artifact.types';
|
|
@@ -24,7 +25,7 @@ export interface SomaServerPageAssets {
|
|
|
24
25
|
colorScheme?: 'light dark' | 'light' | 'dark';
|
|
25
26
|
titleKey?: string;
|
|
26
27
|
}
|
|
27
|
-
export declare class SomaPageAssetError extends
|
|
28
|
+
export declare class SomaPageAssetError extends SomaError {
|
|
28
29
|
readonly code: string;
|
|
29
30
|
readonly status: number;
|
|
30
31
|
constructor(code: string, status: number, message: string);
|
|
@@ -18,6 +18,10 @@ export declare class ServerFileCache {
|
|
|
18
18
|
private dirCache;
|
|
19
19
|
private watchers;
|
|
20
20
|
private watchedRoots;
|
|
21
|
+
/** 各根连续的监听失败次数(建立失败或运行中 error);建立成功不清零(递归监听的错误是建立之后才异步到达的),只有该根的监听真正投递过一次变更回调才清零;达到 `WATCH_FAIL_LIMIT` 即放弃该根 */
|
|
22
|
+
private watchFailures;
|
|
23
|
+
/** 放弃监听的根:其下的读取绕过缓存直读磁盘(无人失效时,正确性优先于命中率) */
|
|
24
|
+
private unwatchableRoots;
|
|
21
25
|
private currentFileBytes;
|
|
22
26
|
constructor(options?: ServerFileCacheOptions);
|
|
23
27
|
static getInstance(options?: ServerFileCacheOptions): ServerFileCache;
|
|
@@ -40,6 +44,10 @@ export declare class ServerFileCache {
|
|
|
40
44
|
readDirFiles(dirPath: string, ext: string): string[];
|
|
41
45
|
readDirNames(dirPath: string, ext: string): string[];
|
|
42
46
|
private setDirCache;
|
|
47
|
+
private isUnwatchable;
|
|
48
|
+
private recordWatchFailure;
|
|
49
|
+
/** 该根(或其祖先)当前是否有存活的监听;监听出错被移除后为 false,调用方据此重试 `watchAndInvalidate` */
|
|
50
|
+
isWatching(rootDir: string): boolean;
|
|
43
51
|
/**
|
|
44
52
|
* 监听目录变化,自动失效缓存。
|
|
45
53
|
* 使用 fs.watch 递归监听;已监听同一目录或其祖先目录时自动去重。
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
1
2
|
/**
|
|
2
3
|
* 注册中心的错误基类。
|
|
3
4
|
*
|
|
@@ -5,8 +6,11 @@
|
|
|
5
6
|
* 响应映射器。给两者一个共同基类,映射器就只需要认识**一种**错误——
|
|
6
7
|
* 否则每加一张表都要去改一次 `pageRegistryErrorResponse`,漏改的表现是
|
|
7
8
|
* 业务错误原样抛穿成 500(实测:API 表刚接上时 404 变成了未处理异常)。
|
|
9
|
+
*
|
|
10
|
+
* 同时继承 core 统一错误基类 `SomaError`:按 `instanceof SomaError` 统一处理 / 上报的代码能认出它。
|
|
11
|
+
* 数字码 `code`(45xx)原样保留、仍按数字比较;基类的 `code` 类型已放宽为 `string | number`,这里收窄为 `number`。
|
|
8
12
|
*/
|
|
9
|
-
export declare class RegistryError extends
|
|
13
|
+
export declare class RegistryError extends SomaError {
|
|
10
14
|
readonly code: number;
|
|
11
15
|
constructor(code: number, message: string);
|
|
12
16
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** 本进程的 PID 命名空间标识(只读;导出供测试构造锁文件) */
|
|
2
|
+
export declare function getPidNamespaceId(): string;
|
|
1
3
|
/**
|
|
2
4
|
* 锁后端注入点。
|
|
3
5
|
* 默认是本文件的 hardlink 实现;注入点只服务共享文件系统上的互斥测试/替换,
|
|
@@ -12,10 +14,38 @@ export declare function setRegistryLockBackend(next: RegistryLockBackend | null)
|
|
|
12
14
|
* fn 内部必须**重新从磁盘读**——拿锁的意义就是"从现在起看到的是最新状态"。
|
|
13
15
|
*/
|
|
14
16
|
export declare function withRegistryLock<T>(baseDir: string, name: string, fn: () => T): T;
|
|
17
|
+
/**
|
|
18
|
+
* 提交前令牌校验:`filePath` 受本线程已登记的锁保护时,重读锁文件核对 token。
|
|
19
|
+
* 锁已被接管或消失 → 打警告并抛 `PAGE_WRITE_CONFLICT`;未在任何锁内、或不受保护则什么都不做。
|
|
20
|
+
* 导出供临界区内不经 `writeFileAtomic` 的写入(如删除)在落盘前调用。
|
|
21
|
+
*/
|
|
22
|
+
export declare function assertRegistryLockOwned(filePath: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* 统一陈旧判据(@internal,导出仅供测试;`probe` 可注入以打桩进程探测)。
|
|
25
|
+
* a. ageMs ≥ 阈值 → 陈旧;b. 同机 + 命名空间标识非空且相等 + pid 有效 + 进程已不存在(且不是自己)→ 陈旧;c. 其余不陈旧。
|
|
26
|
+
* `selfNamespace` 可注入「本进程命名空间标识」以便测试。
|
|
27
|
+
*/
|
|
28
|
+
export declare function isLockStale(content: string, ageMs: number, probe?: (pid: number) => boolean, selfNamespace?: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 经夺取锁串行化的陈旧锁夺取(@internal,导出仅供测试)。
|
|
31
|
+
* 返回 true = 本轮确有进展(夺取锁/主锁已被移除、已释放或已换新),调用方可重试取主锁;
|
|
32
|
+
* false = 没有进展(夺取锁被别人持有且不陈旧,或陈旧夺取锁/主锁删不掉),调用方应睡眠后再试。
|
|
33
|
+
*/
|
|
34
|
+
export declare function tryStealStaleLock(lock: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 原子夺取陈旧锁(@internal,导出仅供测试构造交错)。
|
|
37
|
+
* 调用方应已持有夺取锁;此处的核对/还回是纵深防御。
|
|
38
|
+
* 不直接 unlink(stat 与 unlink 之间别人可能已换上新锁,会误删):
|
|
39
|
+
* 先 rename 到本次独有的 `.stale.<token>`(同目录 rename 原子,多个等待者只有一个成功),
|
|
40
|
+
* 再核对被移走的内容就是当初判定陈旧的那一把;不是则用 link 还回原路径(目标已存在即失败,失败就丢弃)。
|
|
41
|
+
* 任何路径都不留下自己产生的 `.stale.*` 文件。返回值:原路径上的锁是否确已被移走(rename 失败且非 ENOENT 为 false)。
|
|
42
|
+
*/
|
|
43
|
+
export declare function stealStaleLock(lock: string, observed: string): boolean;
|
|
15
44
|
/**
|
|
16
45
|
* 原子落盘:先写同目录临时文件再 rename。
|
|
17
46
|
* 直接 writeFileSync 覆盖原文件,进程在写一半时被杀会留下**半个 JSON**——
|
|
18
47
|
* 那份页面的全部历史版本就此读不出来。rename 在同一文件系统上是原子的。
|
|
48
|
+
* 受已登记写锁保护时,rename 之前先做提交前令牌校验(见文件头「提交前令牌校验」):锁已被接管则删临时文件并抛冲突错误。
|
|
19
49
|
*/
|
|
20
50
|
export declare function writeFileAtomic(filePath: string, content: string): void;
|
|
21
51
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
2
|
+
/** 请求体超限:调用方负责映射成自己域里的错误码(本类不带 `code`,保持原语义;统一基类 SomaError 便于统一识别与上报) */
|
|
3
|
+
export declare class RequestBodyTooLargeError extends SomaError {
|
|
3
4
|
readonly limitBytes: number;
|
|
4
5
|
/** 已知的实际大小;分块传输在触发时只知道"已经超过 limit",此时给 null */
|
|
5
6
|
readonly seenBytes: number | null;
|
|
@@ -5,6 +5,9 @@ export interface ScannableDeclaration {
|
|
|
5
5
|
eventYaml?: string;
|
|
6
6
|
styleYaml?: string;
|
|
7
7
|
}
|
|
8
|
+
/** html 里一律不许出现的标签:脚本、外链、框架与文档级指令 */
|
|
9
|
+
export declare const FORBIDDEN_TAGS: readonly ["script", "iframe", "object", "embed", "base", "link", "meta", "frame", "frameset"];
|
|
10
|
+
export declare const FORBIDDEN_TAG_SET: ReadonlySet<string>;
|
|
8
11
|
/**
|
|
9
12
|
* 扫描声明的注入面,返回中文问题清单(空数组 = 通过)。
|
|
10
13
|
*
|
|
@@ -29,6 +29,13 @@ export interface SomaAccessPolicy {
|
|
|
29
29
|
readonly grants: readonly SomaHostAssemblyPageGrant[];
|
|
30
30
|
}
|
|
31
31
|
export declare const SOMA_OPEN_ACCESS_POLICY: SomaAccessPolicy;
|
|
32
|
+
/** 只给测试用 */
|
|
33
|
+
export declare function resetAccessPolicyReport(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 读访问策略。失败即关闭:装配加载抛错、或宿主的 `defaultAccess()` / `pageGrants()` 抛错时,
|
|
36
|
+
* 不降级为开放,抛受控内部错误(`CORE-RUNTIME-GRANT-INVALID`,500,不带原始异常文本);原始消息只进服务端日志。
|
|
37
|
+
* 没有 hostDir、无 soma.app.ts、未配 `defaultAccess` 仍是开放策略(正常分支)。
|
|
38
|
+
*/
|
|
32
39
|
export declare function readAccessPolicy(hostDir: string | undefined): SomaAccessPolicy;
|
|
33
40
|
/** 一个绑定适用的全部访问规则(缺省策略、授权下限、信封自带),开放的已滤掉 */
|
|
34
41
|
export declare function accessRulesOf(binding: Pick<SomaRuntimeBinding, 'address' | 'caller'>, envelope: SomaStandardPageEnvelope | null | undefined, policy: SomaAccessPolicy): readonly SomaAccessRule[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { currentHostDir } from '../host/host-dir';
|
|
1
2
|
import { addressShapeKey, compareAddressSpecificity } from '../../shared/runtime-address';
|
|
2
3
|
import { type SomaAccessIdentity, type SomaAccessPolicy } from './access-gate';
|
|
3
4
|
import { SomaRuntimeStore } from './store';
|
|
@@ -53,8 +54,8 @@ export declare function resetRuntimeSpace(): void;
|
|
|
53
54
|
/** 当前进程的 runtime 布局(按环境签名记忆,避免每次调用都读盘) */
|
|
54
55
|
export declare function runtimeLayout(): SomaRuntimeLayout;
|
|
55
56
|
export declare function runtimeStore(layout?: SomaRuntimeLayout): SomaRuntimeStore;
|
|
56
|
-
/**
|
|
57
|
-
export
|
|
57
|
+
/** 宿主根单点实现在 host/host-dir(无依赖,避免底层模块反向引入本文件成环) */
|
|
58
|
+
export { currentHostDir };
|
|
58
59
|
/** 外壳路由 = 宿主壳经 `registerShellRoutes` 登记的 ∪ 宿主装配声明的 `reservedRoutes`(后者只读已装配完的,不触发加载) */
|
|
59
60
|
export declare function currentReservedRoutes(): readonly string[];
|
|
60
61
|
/**
|
|
@@ -34,7 +34,7 @@ export interface SomaPageInput {
|
|
|
34
34
|
/** 方言交给 core 的已编译产物(与注入入口同一形状) */
|
|
35
35
|
export type SomaCompiledPage = SomaPageInput;
|
|
36
36
|
export type SomaPageRegisterOptions = Omit<SomaInjectOptions, 'expectGeneration' | 'fixed' | 'version' | 'owner'> & {
|
|
37
|
-
/** 来源类型(必填):`soma-ui` / `soma-
|
|
37
|
+
/** 来源类型(必填):`soma-ui` / `soma-kit`(原生页由 core 初始化扫描登记,来源类型 `native`) */
|
|
38
38
|
readonly owner: string;
|
|
39
39
|
/** 覆盖产物自带的 version */
|
|
40
40
|
readonly version?: string;
|
|
@@ -49,7 +49,12 @@ export type SomaDslParseResult = {
|
|
|
49
49
|
readonly ok: false;
|
|
50
50
|
readonly diagnostics: readonly {
|
|
51
51
|
readonly message: string;
|
|
52
|
+
readonly line?: number;
|
|
53
|
+
readonly column?: number;
|
|
52
54
|
}[];
|
|
55
|
+
/** YAML 语法错误的位置(1 起始);仅底层异常带 mark 时才有 */
|
|
56
|
+
readonly line?: number;
|
|
57
|
+
readonly column?: number;
|
|
53
58
|
};
|
|
54
59
|
/**
|
|
55
60
|
* 运行期把 core DSL 文本解析成对象(无 fs、无端口、无副作用):四件套都是平铺 YAML,按 YAML 读。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SomaCoreDiagnostic, type SomaCoreDiagnosticCode } from '../../shared/core-diagnostic-codes';
|
|
2
2
|
import { SomaPageAssetError } from '../host/server-page-assets';
|
|
3
|
-
export type SomaRuntimeErrorCode = Extract<SomaCoreDiagnosticCode, 'CORE-RUNTIME-ADDRESS-INVALID' | 'CORE-RUNTIME-ADDRESS-RESERVED' | 'CORE-RUNTIME-ADDRESS-STATIC' | 'CORE-RUNTIME-ADDRESS-CONFLICT' | 'CORE-RUNTIME-ADDRESS-OWNED' | 'CORE-RUNTIME-ADDRESS-MISMATCH' | 'CORE-RUNTIME-ADDRESS-MISSING' | 'CORE-RUNTIME-ADDRESS-EXPIRED' | 'CORE-RUNTIME-GENERATION' | 'CORE-RUNTIME-BATCH' | 'CORE-RUNTIME-GRANT' | 'CORE-RUNTIME-GRANT-INVALID' | 'CORE-RUNTIME-PARAM-INVALID' | 'CORE-RUNTIME-ACCESS-DENIED' | 'CORE-NAV-OVERFLOW' | 'CORE-FORMAT-VERSION-UNSUPPORTED' | 'CORE-FORMAT-VERSION-MISMATCH' | 'CORE-INJECT-NONSTANDARD-KEY' | 'CORE-REG-INPUT-INVALID' | 'CORE-REG-NO-COMPILED-ARTIFACT'>;
|
|
3
|
+
export type SomaRuntimeErrorCode = Extract<SomaCoreDiagnosticCode, 'CORE-RUNTIME-ADDRESS-INVALID' | 'CORE-RUNTIME-ADDRESS-RESERVED' | 'CORE-RUNTIME-ADDRESS-STATIC' | 'CORE-RUNTIME-ADDRESS-CONFLICT' | 'CORE-RUNTIME-ADDRESS-OWNED' | 'CORE-RUNTIME-ADDRESS-MISMATCH' | 'CORE-RUNTIME-ADDRESS-MISSING' | 'CORE-RUNTIME-ADDRESS-EXPIRED' | 'CORE-RUNTIME-GENERATION' | 'CORE-RUNTIME-BATCH' | 'CORE-RUNTIME-GRANT' | 'CORE-RUNTIME-GRANT-INVALID' | 'CORE-RUNTIME-PARAM-INVALID' | 'CORE-RUNTIME-ACCESS-DENIED' | 'CORE-NAV-OVERFLOW' | 'CORE-FORMAT-VERSION-UNSUPPORTED' | 'CORE-FORMAT-VERSION-MISMATCH' | 'CORE-INJECT-NONSTANDARD-KEY' | 'CORE-INJECT-PAGE-LOGIC' | 'CORE-INJECT-PAGE-CLOSURE' | 'CORE-REG-INPUT-INVALID' | 'CORE-REG-NO-COMPILED-ARTIFACT'>;
|
|
4
4
|
/** 批次里一条失败的原因 */
|
|
5
5
|
export interface SomaRuntimeBatchFailure {
|
|
6
6
|
readonly index: number;
|
|
@@ -28,6 +28,8 @@ export declare function runtimeSpaceStats(): {
|
|
|
28
28
|
readonly bindings: number;
|
|
29
29
|
readonly pages: ReturnType<ReturnType<typeof runtimeStore>['stats']>;
|
|
30
30
|
};
|
|
31
|
+
/** 编译结果键 = 摘要 + 页面形态 + core 编译版本 + 编译身份(组件供货 / 设计规则 / 主题指纹)+ 绑定地址(产物带 URL 相关标识,同内容异址不得互相命中);读不到身份就不缓存 */
|
|
32
|
+
export declare function compileKey(digest: string, binding?: SomaRuntimeBinding): string | null;
|
|
31
33
|
/**
|
|
32
34
|
* 路由唯一调用点:按地址取页。未命中抛 404 `SOMA_PAGE_NOT_FOUND`;冲突 409;参数类型不合 404;整页编译失败抛 `SomaPublishedPageError`。
|
|
33
35
|
* 抛出的都是带 `code` / `status` 的错误(`SomaPageAssetError` 子类或 `SomaPublishedPageError`),路由按码回受控响应。
|
|
@@ -7,11 +7,12 @@ export declare function resolveRuntimeCacheEntries(raw: string | undefined): num
|
|
|
7
7
|
/** 简单 LRU:Map 迭代序即最近使用序(命中时删后重插) */
|
|
8
8
|
export declare class RuntimeLru<V> {
|
|
9
9
|
private readonly capacity;
|
|
10
|
+
private readonly onEvict?;
|
|
10
11
|
private readonly map;
|
|
11
12
|
private hits;
|
|
12
13
|
private misses;
|
|
13
14
|
private evictions;
|
|
14
|
-
constructor(capacity: number);
|
|
15
|
+
constructor(capacity: number, onEvict?: ((key: string) => void) | undefined);
|
|
15
16
|
get(key: string): V | undefined;
|
|
16
17
|
set(key: string, value: V): void;
|
|
17
18
|
delete(key: string): boolean;
|
|
@@ -31,6 +32,8 @@ export declare class SomaRuntimeStore {
|
|
|
31
32
|
private readonly pages;
|
|
32
33
|
/** 摘要 → 它的编译结果键(只记键,不持有产物) */
|
|
33
34
|
private readonly compiledKeys;
|
|
35
|
+
/** 编译结果键 → 所属摘要(LRU 淘汰时反查,同步清 compiledKeys) */
|
|
36
|
+
private readonly keyDigest;
|
|
34
37
|
constructor(dirs: Pick<SomaRuntimeDirs, 'artifacts' | 'bindings' | 'prewarm'>, options?: {
|
|
35
38
|
readonly cacheEntries?: number;
|
|
36
39
|
});
|
|
@@ -44,6 +47,8 @@ export declare class SomaRuntimeStore {
|
|
|
44
47
|
hasArtifact(digest: string): boolean;
|
|
45
48
|
/** 记下某摘要产出的编译结果键,供按 URL 替换 / 撤下时一并作废 */
|
|
46
49
|
trackCompiled(digest: string, key: string): void;
|
|
50
|
+
/** LRU 淘汰 / 作废一个编译键后,同步从 compiledKeys 摘掉它(Set 空了连摘要条目一起删) */
|
|
51
|
+
private forgetCompiledKey;
|
|
47
52
|
/** 绑定表装入后丢弃 L1 里的旧摘要(源变化即失效),连同该摘要的编译结果 */
|
|
48
53
|
evictDigest(digest: string): void;
|
|
49
54
|
stats(): {
|
|
@@ -56,6 +61,8 @@ export declare class SomaRuntimeStore {
|
|
|
56
61
|
/** 其他进程改过该绑定文件吗(mtime 比对);文件不在也算变了(被解绑) */
|
|
57
62
|
bindingChanged(address: string, lastMtimeMs: number | null): boolean;
|
|
58
63
|
removeBinding(address: string): boolean;
|
|
64
|
+
/** 严格删除:文件本来就不在返回 false(视为成功);其他失败(权限 / IO)原样抛出,不吞 */
|
|
65
|
+
removeBindingStrict(address: string): boolean;
|
|
59
66
|
/** 读 `bindings/` 下全部绑定(启动装入用);损坏文件跳过 */
|
|
60
67
|
listBindings(): readonly SomaBindingRead[];
|
|
61
68
|
readPrewarmIndex(): SomaPrewarmIndex;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { SomaError } from '../../shared/soma-error';
|
|
1
2
|
import { type ProvenanceCheckOptions } from '../../page-target/provenance';
|
|
2
3
|
import type { SomaGrantDecision } from './page-grants';
|
|
3
4
|
import type { SomaPageBindingView, SomaPageRegisterRequest, SomaProvenanceLedger, SomaRuntimeBinding, SomaStandardPage, SomaSubmitAddressKind, SomaSubmitStepIssue, SomaSubmitStepsRuntime } from './types';
|
|
4
5
|
/** 步骤拒收:三段式 + 位置;message = `situation:problem` */
|
|
5
|
-
export declare class SomaSubmitStepError extends
|
|
6
|
+
export declare class SomaSubmitStepError extends SomaError implements SomaSubmitStepIssue {
|
|
6
7
|
readonly code: string;
|
|
7
8
|
readonly situation: string;
|
|
8
9
|
readonly problem: string;
|
|
@@ -70,7 +70,7 @@ export interface SomaRuntimeBinding {
|
|
|
70
70
|
/** D6:不透明来源标记;无则 null */
|
|
71
71
|
readonly source: SomaRuntimeSource | null;
|
|
72
72
|
/**
|
|
73
|
-
* URL 注册表的来源类型:一个 URL 只挂一个来源类型(`native` / `soma-ui` / `soma-
|
|
73
|
+
* URL 注册表的来源类型:一个 URL 只挂一个来源类型(`native` / `soma-ui` / `soma-kit`)。
|
|
74
74
|
* 同类型再注册 = 覆盖;不同类型 = 冲突(保留先挂的,注册日志记 error);撤下只能同类型。同类型内部的重复由来源自己处理。旧绑定与 Registry 绑定无此字段。
|
|
75
75
|
*/
|
|
76
76
|
readonly owner?: string;
|
|
@@ -99,6 +99,8 @@ export interface SomaInjectOptions {
|
|
|
99
99
|
readonly expiresAt?: number;
|
|
100
100
|
/** D6:不透明来源标记 */
|
|
101
101
|
readonly source?: SomaRuntimeSource;
|
|
102
|
+
/** 页面 `domain:` 指向的展示对象类由 Host 浏览器侧的 `pageRoots` 类表提供(方言所有者声明):注入期不再提示 CORE-RUNTIME-DOMAIN-STATIC-ONLY */
|
|
103
|
+
readonly domainProvided?: boolean;
|
|
102
104
|
}
|
|
103
105
|
/** D6:批量注入的一条 */
|
|
104
106
|
export interface SomaInjectManyEntry {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SomaError } from './soma-error';
|
|
1
2
|
import type { SourceSpan } from './types/component-tree.types';
|
|
2
3
|
export type ComponentTreeErrorCode = 'CT-SYNTAX-ROOT' | 'CT-SYNTAX-ELEMENT' | 'CT-SYNTAX-CLOSE' | 'CT-SYNTAX-ATTRIBUTE' | 'CT-IDENTITY-ID' | 'CT-IDENTITY-HOST' | 'CT-REGISTRY-CONTEXT' | 'CT-REGISTRY-COMPONENT' | 'CT-POLICY-COMPONENT' | 'CT-SLOT-CONTRACT' | 'CT-STRUCTURE-MOUNT' | 'CT-BINDING-SCOPE' | 'CT-BINDING-DUPLICATE' | 'CT-REPEAT-SOURCE' | 'CT-REPEAT-KEY' | 'CT-LIMIT' | 'CT-LAYOUT-PARENT' | 'CT-ARTIFACT-VERSION' | 'CT-ARTIFACT-CAPABILITY' | 'CT-ARTIFACT-INCOMPLETE' | 'CT-SYNTAX-LEAK' | 'CT-MIGRATION-UNSAFE';
|
|
3
4
|
export interface ComponentTreeDiagnostic {
|
|
@@ -14,7 +15,7 @@ export interface ComponentTreeDiagnostic {
|
|
|
14
15
|
fixHint?: string;
|
|
15
16
|
}
|
|
16
17
|
/** Stable, serializable diagnostics without retaining the page source or context. */
|
|
17
|
-
export declare class SomaComponentTreeError extends
|
|
18
|
+
export declare class SomaComponentTreeError extends SomaError {
|
|
18
19
|
readonly code: ComponentTreeErrorCode;
|
|
19
20
|
readonly diagnostic: Readonly<ComponentTreeDiagnostic>;
|
|
20
21
|
constructor(diagnostic: ComponentTreeDiagnostic);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentTreeErrorCode } from './component-tree-errors';
|
|
2
2
|
import type { SomaGenerationErrorShape, SomaGenerationLayer } from './types/generation-error.types';
|
|
3
|
-
export declare const SOMA_CORE_DIAGNOSTIC_CODES: readonly ["CORE-PORT-MISSING", "CORE-PORT-CONFLICT", "CORE-PORT-LEGACY-PACK", "CORE-PORT-IDENTITY-DRIFT", "CORE-PORT-RECOMPILE", "CORE-PORT-PURPOSE", "CORE-STYLE-INVALID", "CORE-HOOK-UNCOMPILED", "CORE-SHELL-SLOT", "CORE-CONTRACT-SHAPE", "CORE-CONTRACT-DEFAULTS", "CORE-LINKAGE-DUPLICATE", "CORE-OBSERVE-FAILED", "CORE-OBSERVE-OFF", "CORE-RUNTIME-ERROR", "CORE-RUNTIME-ROOT-INVALID", "CORE-RUNTIME-ROOT-UNSET", "CORE-FORMAT-VERSION-UNSUPPORTED", "CORE-FORMAT-VERSION-MISMATCH", "CORE-INJECT-NONSTANDARD-KEY", "CORE-RUNTIME-ADDRESS-INVALID", "CORE-RUNTIME-ADDRESS-RESERVED", "CORE-RUNTIME-ADDRESS-STATIC", "CORE-RUNTIME-ADDRESS-CONFLICT", "CORE-RUNTIME-ADDRESS-OWNED", "CORE-RUNTIME-ADDRESS-MISMATCH", "CORE-RUNTIME-ADDRESS-MISSING", "CORE-RUNTIME-ADDRESS-EXPIRED", "CORE-RUNTIME-GENERATION", "CORE-RUNTIME-PROVENANCE", "CORE-RUNTIME-GRANT", "CORE-RUNTIME-GRANT-INVALID", "CORE-RUNTIME-BATCH", "CORE-RUNTIME-PARAM-INVALID", "CORE-RUNTIME-ACCESS-DENIED", "CORE-NAV-PARENT-MISSING", "CORE-NAV-OVERFLOW", "CORE-NAV-BACK-INVALID", "CORE-RUNTIME-DOMAIN-STATIC-ONLY", "CORE-RUNTIME-MOUNT", "CORE-ADAPTER-EMIT", "CORE-ADAPTER-DEFINE", "CORE-DATA-FORBIDDEN", "CORE-DATA-RELATION", "CORE-DATA-REQUIRE", "CORE-LOCALE-UNKNOWN", "CORE-ENGINE-LOAD", "CORE-ENGINE-ADAPTER", "CORE-STYLE-ENGINE-CANDIDATE", "CORE-STYLE-ENGINE-THEME", "CORE-STYLE-ENGINE-COMPILE", "CORE-BEHAVIOR-MACHINE-UNKNOWN", "CORE-BEHAVIOR-LAYER-DETACHED", "CORE-BEHAVIOR-MACHINE-CONFLICT", "CORE-TABLE-COLUMN", "CORE-TABLE-STATE", "CORE-VIRTUAL-SCROLLER", "CORE-CHART-KIND-UNKNOWN", "CORE-CHART-THEME", "CORE-CHART-OPTION", "CORE-TEMPORAL-PARSE", "CORE-TEMPORAL-NOT-READY", "CORE-TEMPORAL-ZONE", "CORE-DND-SPEC", "CORE-ALGO-DIFF-INPUT", "CORE-ALGO-QR-CAPACITY", "CORE-ASYNC-CHECK-TABLE", "CORE-ASYNC-CHECK-UNREGISTERED", "CORE-TOAST-CONFIG", "CORE-FORMAT-LOCALE", "CORE-FORMAT-TIMEZONE", "CORE-FORMAT-CONFIG", "CORE-BEHAVIOR-DECL", "CORE-A11Y-DECL", "CORE-OVERLAY-DECL", "CORE-KEYBOARD-DECL", "CORE-BEHAVIOR-COLLECTION-MISMATCH", "CORE-BEHAVIOR-MACHINE-MISMATCH", "CORE-KEYBOARD-MISSING", "CORE-KEYBOARD-GRID-COLUMNS", "CORE-KEYBOARD-INEFFECTIVE", "CORE-KEYBOARD-UNWIRED", "CORE-A11Y-CONFIG", "CORE-A11Y-OVERLAY-NO-DISMISS", "CORE-A11Y-ROLE-KEYBOARD-MISMATCH", "CORE-A11Y-ROLE-OVERLAY", "CORE-A11Y-ROLE-LANDMARK-CONFLICT", "CORE-A11Y-LANDMARK-NAME-SOURCE", "CORE-A11Y-LANDMARK-UNNAMED", "CORE-A11Y-LANDMARK-DUPLICATE-NAME", "CORE-LOCALE-PACK-SHAPE", "CORE-LOCALE-PACK-LOCALE", "CORE-LOCALE-PACK-POSITION", "CORE-LOCALE-PACK-VALUE", "CORE-SCOPES-CONFLICT", "CORE-FRAGMENTS-CONFLICT", "CORE-ANCHOR-DUPLICATE", "CORE-REG-INPUT-INVALID", "CORE-REG-NO-COMPILED-ARTIFACT", "CORE-CHECK-BLOCKS", "CORE-CHECK-DIALECT", "CORE-CHECK-DATA", "CORE-CHECK-EVENT", "CORE-CHECK-SCOPES", "CORE-CHECK-COMPILE", "CORE-CHECK-RUNTIME", "CORE-ENVELOPE-KEY", "CORE-ENVELOPE-VALUE", "CORE-ENVELOPE-PARAM", "CORE-ENVELOPE-PARAM-IMPLICIT", "CORE-ENVELOPE-QUERY", "CORE-ENVELOPE-NAV", "CORE-ENVELOPE-SOURCE", "CORE-ENVELOPE-LIFECYCLE", "CORE-ENVELOPE-AUTHOR", "CORE-ENVELOPE-COMPAT", "CORE-USER-REF-MISSING", "CORE-USER-REF-UNKNOWN", "CORE-AUTH-SCOPE", "CORE-WRITE-FEEDBACK-SCOPE", "CORE-WRITE-SHORTCUT-DECL", "CORE-WRITE-SHORTCUT-DUP", "ERR-RUN-001", "ERR-RUN-002", "ERR-RUN-003", "ERR-PUB-001", "ERR-PUB-002", "ERR-PUB-003"];
|
|
3
|
+
export declare const SOMA_CORE_DIAGNOSTIC_CODES: readonly ["CORE-PORT-MISSING", "CORE-PORT-CONFLICT", "CORE-PORT-LEGACY-PACK", "CORE-PORT-IDENTITY-DRIFT", "CORE-PORT-RECOMPILE", "CORE-PORT-PURPOSE", "CORE-STYLE-INVALID", "CORE-HOOK-UNCOMPILED", "CORE-SHELL-SLOT", "CORE-CONTRACT-SHAPE", "CORE-CONTRACT-DEFAULTS", "CORE-LINKAGE-DUPLICATE", "CORE-OBSERVE-FAILED", "CORE-OBSERVE-OFF", "CORE-RUNTIME-ERROR", "CORE-RUNTIME-ROOT-INVALID", "CORE-RUNTIME-ROOT-UNSET", "CORE-FORMAT-VERSION-UNSUPPORTED", "CORE-FORMAT-VERSION-MISMATCH", "CORE-INJECT-NONSTANDARD-KEY", "CORE-INJECT-PAGE-LOGIC", "CORE-INJECT-PAGE-CLOSURE", "CORE-PAGE-NEGATE-FORBIDDEN", "CORE-STYLE-COMPARE-FORBIDDEN", "CORE-PAGE-ROLE-BY-INVALID", "CORE-RUNTIME-ADDRESS-INVALID", "CORE-RUNTIME-ADDRESS-RESERVED", "CORE-RUNTIME-ADDRESS-STATIC", "CORE-RUNTIME-ADDRESS-CONFLICT", "CORE-RUNTIME-ADDRESS-OWNED", "CORE-RUNTIME-ADDRESS-MISMATCH", "CORE-RUNTIME-ADDRESS-MISSING", "CORE-RUNTIME-ADDRESS-EXPIRED", "CORE-RUNTIME-GENERATION", "CORE-RUNTIME-PROVENANCE", "CORE-RUNTIME-GRANT", "CORE-RUNTIME-GRANT-INVALID", "CORE-RUNTIME-BATCH", "CORE-RUNTIME-PARAM-INVALID", "CORE-RUNTIME-ACCESS-DENIED", "CORE-NAV-PARENT-MISSING", "CORE-NAV-OVERFLOW", "CORE-NAV-BACK-INVALID", "CORE-VIEW-DEFINE", "CORE-VIEW-CTX", "CORE-REACTIVE-WRITE", "CORE-RUNTIME-DOMAIN-STATIC-ONLY", "CORE-RUNTIME-MOUNT", "CORE-ADAPTER-EMIT", "CORE-ADAPTER-DEFINE", "CORE-DATA-FORBIDDEN", "CORE-DATA-RELATION", "CORE-DATA-REQUIRE", "CORE-LOCALE-UNKNOWN", "CORE-ENGINE-LOAD", "CORE-ENGINE-ADAPTER", "CORE-STYLE-ENGINE-CANDIDATE", "CORE-STYLE-ENGINE-THEME", "CORE-STYLE-ENGINE-COMPILE", "CORE-BEHAVIOR-MACHINE-UNKNOWN", "CORE-BEHAVIOR-LAYER-DETACHED", "CORE-BEHAVIOR-MACHINE-CONFLICT", "CORE-TABLE-COLUMN", "CORE-TABLE-STATE", "CORE-VIRTUAL-SCROLLER", "CORE-CHART-KIND-UNKNOWN", "CORE-CHART-THEME", "CORE-CHART-OPTION", "CORE-TEMPORAL-PARSE", "CORE-TEMPORAL-NOT-READY", "CORE-TEMPORAL-ZONE", "CORE-DND-SPEC", "CORE-ALGO-DIFF-INPUT", "CORE-ALGO-QR-CAPACITY", "CORE-ASYNC-CHECK-TABLE", "CORE-ASYNC-CHECK-UNREGISTERED", "CORE-TOAST-CONFIG", "CORE-FORMAT-LOCALE", "CORE-FORMAT-TIMEZONE", "CORE-FORMAT-CONFIG", "CORE-BEHAVIOR-DECL", "CORE-A11Y-DECL", "CORE-OVERLAY-DECL", "CORE-KEYBOARD-DECL", "CORE-BEHAVIOR-COLLECTION-MISMATCH", "CORE-BEHAVIOR-MACHINE-MISMATCH", "CORE-KEYBOARD-MISSING", "CORE-KEYBOARD-GRID-COLUMNS", "CORE-KEYBOARD-INEFFECTIVE", "CORE-KEYBOARD-UNWIRED", "CORE-A11Y-CONFIG", "CORE-A11Y-OVERLAY-NO-DISMISS", "CORE-A11Y-ROLE-KEYBOARD-MISMATCH", "CORE-A11Y-ROLE-OVERLAY", "CORE-A11Y-ROLE-LANDMARK-CONFLICT", "CORE-A11Y-LANDMARK-NAME-SOURCE", "CORE-A11Y-LANDMARK-UNNAMED", "CORE-A11Y-LANDMARK-DUPLICATE-NAME", "CORE-LOCALE-PACK-SHAPE", "CORE-LOCALE-PACK-LOCALE", "CORE-LOCALE-PACK-POSITION", "CORE-LOCALE-PACK-VALUE", "CORE-SCOPES-CONFLICT", "CORE-FRAGMENTS-CONFLICT", "CORE-ANCHOR-DUPLICATE", "CORE-REG-INPUT-INVALID", "CORE-REG-NO-COMPILED-ARTIFACT", "CORE-CHECK-BLOCKS", "CORE-CHECK-DIALECT", "CORE-CHECK-DATA", "CORE-CHECK-EVENT", "CORE-CHECK-SCOPES", "CORE-CHECK-COMPILE", "CORE-CHECK-RUNTIME", "CORE-ENVELOPE-KEY", "CORE-ENVELOPE-VALUE", "CORE-ENVELOPE-PARAM", "CORE-ENVELOPE-PARAM-IMPLICIT", "CORE-ENVELOPE-QUERY", "CORE-ENVELOPE-NAV", "CORE-ENVELOPE-SOURCE", "CORE-ENVELOPE-LIFECYCLE", "CORE-ENVELOPE-AUTHOR", "CORE-ENVELOPE-COMPAT", "CORE-USER-REF-MISSING", "CORE-USER-REF-UNKNOWN", "CORE-AUTH-SCOPE", "CORE-WRITE-FEEDBACK-SCOPE", "CORE-WRITE-SHORTCUT-DECL", "CORE-WRITE-SHORTCUT-DUP", "ERR-RUN-001", "ERR-RUN-002", "ERR-RUN-003", "ERR-PUB-001", "ERR-PUB-002", "ERR-PUB-003"];
|
|
4
4
|
export type SomaCoreOwnDiagnosticCode = (typeof SOMA_CORE_DIAGNOSTIC_CODES)[number];
|
|
5
5
|
/** core 码全集:自有码 ∪ `CT-*` 组件树码(`CT-*` 闭集仍定义在 `component-tree-errors.ts`) */
|
|
6
6
|
export type SomaCoreDiagnosticCode = SomaCoreOwnDiagnosticCode | ComponentTreeErrorCode;
|
|
@@ -4,6 +4,6 @@ export declare const SOMA_STANDARD_PAGE_KEYS: readonly ["bind", "show", "initPro
|
|
|
4
4
|
export declare function nonStandardPageKeys(doc: unknown): string[];
|
|
5
5
|
/**
|
|
6
6
|
* 文本是不是旧「块声明」容器(首个非空非注释行是 `{{` 开关行)。
|
|
7
|
-
* 块声明已退出 core 原生格式:它由方言(soma-ui / soma-
|
|
7
|
+
* 块声明已退出 core 原生格式:它由方言(soma-ui / soma-kit)自己编译成四件套后再交给 core。
|
|
8
8
|
*/
|
|
9
9
|
export declare function looksLikeBlockDeclaration(text: string): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { SomaError } from '../soma-error';
|
|
1
2
|
import type { SomaCoreOwnDiagnosticCode } from '../core-diagnostic-codes';
|
|
2
3
|
/** 引擎端口抛出的错误:`code` 是 core 自有码;`engine` 是引擎 id(不带文件路径) */
|
|
3
|
-
export declare class SomaEngineError extends
|
|
4
|
+
export declare class SomaEngineError extends SomaError {
|
|
4
5
|
readonly code: SomaCoreOwnDiagnosticCode;
|
|
5
6
|
readonly engine: string;
|
|
6
7
|
constructor(code: SomaCoreOwnDiagnosticCode, engine: string, message: string, options?: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { SomaError } from './soma-error';
|
|
1
2
|
import type { SomaGenerationErrorShape, SomaGenerationErrorCode, SomaGenerationLayer, SomaGenerationNearest, SomaGenerationErrorSource } from './types/generation-error.types';
|
|
2
3
|
/** 三段式文本:`[码] 情况:问题。修法。(路径)`,附最近候选。 */
|
|
3
4
|
export declare function formatGenerationError(shape: SomaGenerationErrorShape): string;
|
|
4
|
-
export declare class SomaGenerationError extends
|
|
5
|
+
export declare class SomaGenerationError extends SomaError implements SomaGenerationErrorShape {
|
|
5
6
|
readonly code: SomaGenerationErrorCode;
|
|
6
7
|
readonly layer: SomaGenerationLayer;
|
|
7
8
|
readonly situation: string;
|