soma-core 2.1.5 → 2.1.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/core/build/compiler/soma-precompile.js +11 -1
- package/core/client/base/SomaHttpClient.ts +85 -12
- package/core/client/data/data-object-resolver.ts +12 -1
- package/core/client/engine/event-engine.ts +3 -3
- package/core/client/engine/soma-bootstrap.ts +30 -30
- package/core/client/host-bridge/load-host-domain-class.ts +74 -20
- package/core/client/host-bridge/resolve-host-bootstrap.ts +125 -23
- package/core/client/infra/http/IHttpClient.ts +3 -1
- package/core/client/infra/http/SomaHttpService.ts +15 -6
- package/core/client/parser/data-config-parser.ts +6 -1
- package/core/shared/registry-generated/error-codes.ts +5 -0
- package/core/shared/registry-generated/limits.ts +5 -0
- package/core/shared/types/data-config.types.ts +2 -0
- package/dist/browser/soma-runtime.js +197 -49
- package/dist/core/index.cjs +284 -64
- package/dist/lsp/component-tree.cjs +11 -1
- package/dist/types/client/base/SomaHttpClient.d.ts +1 -8
- package/dist/types/client/data/data-object-resolver.d.ts +1 -0
- package/dist/types/client/engine/event-engine.d.ts +2 -2
- package/dist/types/client/engine/soma-bootstrap.d.ts +3 -2
- package/dist/types/client/host-bridge/load-host-domain-class.d.ts +1 -0
- package/dist/types/client/host-bridge/resolve-host-bootstrap.d.ts +20 -0
- package/dist/types/client/infra/http/IHttpClient.d.ts +2 -0
- package/dist/types/shared/registry-generated/error-codes.d.ts +4 -0
- package/dist/types/shared/registry-generated/limits.d.ts +4 -0
- package/dist/types/shared/types/data-config.types.d.ts +2 -0
- package/package.json +2 -2
|
@@ -4,6 +4,26 @@ import type { SomaRuntimeServices } from '../runtime/SomaRuntimeServices';
|
|
|
4
4
|
export type SomaBootstrapConfigurator = (ctx: {
|
|
5
5
|
getServices: () => SomaRuntimeServices | undefined;
|
|
6
6
|
}) => Partial<SomaBootstrapOptions>;
|
|
7
|
+
export declare const HOST_BOOTSTRAP_MODULE = "@soma-host/bootstrap/soma-bootstrap";
|
|
8
|
+
/**
|
|
9
|
+
* 解包测试运行器或装载器可能附加的包装错误(如 Error.cause)。
|
|
10
|
+
*/
|
|
11
|
+
export declare function unwrapLoaderError(error: unknown): unknown;
|
|
12
|
+
/**
|
|
13
|
+
* 这个异常是否具备「模块未找到」的特征(CJS/ESM/Webpack/Vite 等运行时形态)。
|
|
14
|
+
*/
|
|
15
|
+
export declare function hasModuleNotFoundSignature(error: unknown): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 从缺模块错误信息中提取被引用的说明符(如 'X' 或 "X")。
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractMissingModuleSpecifier(message: string): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* 精确判定异常是否为「目标可选入口模块自身不存在」。
|
|
22
|
+
* - 若不具备缺模块特征 -> false
|
|
23
|
+
* - 若从 message 中提取出具体说明符 spec -> 仅当 spec 指向 expectedSpecifiers 时返回 true,否则(子依赖缺失)返回 false
|
|
24
|
+
* - 若没有引号包裹的具体模块名(无引号泛化缺模块错误) -> 视为入口自身缺失返回 true
|
|
25
|
+
*/
|
|
26
|
+
export declare function isOptionalEntryAbsent(error: unknown, expectedSpecifiers: string | readonly string[]): boolean;
|
|
7
27
|
/** 分片加载失败的重试退避(由 Host 装配注入,值取自 soma-design 限值表 hostDefaults.chunkLoadBackoffMs;core 不留数字) */
|
|
8
28
|
export interface HostBootstrapRetry {
|
|
9
29
|
/** 第 n 次重试等待 chunkLoadBackoffMs × n 毫秒 */
|
|
@@ -7,6 +7,8 @@ export interface HttpRequestConfig {
|
|
|
7
7
|
onResponse?: (info: {
|
|
8
8
|
readonly status: number;
|
|
9
9
|
}) => void;
|
|
10
|
+
/** 为 true 时非 2xx 响应只抛异常、不触发全局 onHttpError 提示,供上层自带语义错误处理的调用方按需抑制重复弹窗 */
|
|
11
|
+
silentErrorToast?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export interface UploadOptions {
|
|
12
14
|
/** multipart 字段名,默认 file */
|
|
@@ -25,6 +25,10 @@ export declare const SOMA_PIPELINE_ERROR_CODES: {
|
|
|
25
25
|
readonly module: "soma-ai-page";
|
|
26
26
|
readonly file: "src/versions/errors.ts";
|
|
27
27
|
readonly symbol: "SOMA_PIPELINE_ERROR_CODES_AI_PAGE";
|
|
28
|
+
}, {
|
|
29
|
+
readonly module: "soma-robot";
|
|
30
|
+
readonly file: "src/common/errors.ts";
|
|
31
|
+
readonly symbol: "SOMA_PIPELINE_ERROR_CODES_AI_ROBOT";
|
|
28
32
|
}];
|
|
29
33
|
readonly families: {
|
|
30
34
|
readonly pageRegistry: {
|
|
@@ -349,6 +349,10 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
349
349
|
readonly module: "soma-lite";
|
|
350
350
|
readonly file: "src/app/server/provenance-limit.ts";
|
|
351
351
|
readonly symbol: "SOMA_PIPELINE_LIMITS";
|
|
352
|
+
}, {
|
|
353
|
+
readonly module: "soma-robot";
|
|
354
|
+
readonly file: "src/common/limits.ts";
|
|
355
|
+
readonly symbol: "SOMA_PIPELINE_LIMITS_AI_ROBOT";
|
|
352
356
|
}];
|
|
353
357
|
readonly registry: {
|
|
354
358
|
readonly recordMaxBytes: 65536;
|
|
@@ -100,6 +100,8 @@ export interface SomaDataSourceConfig {
|
|
|
100
100
|
failWhen?: SomaFieldPredicate;
|
|
101
101
|
/** 命中 failWhen 时,业务错误信息在响应体里的点路径 */
|
|
102
102
|
messagePath?: string;
|
|
103
|
+
/** 响应体数据点路径(当未指定 into 时,按点路径取出内层载荷并入对象根) */
|
|
104
|
+
dataPath?: string;
|
|
103
105
|
}
|
|
104
106
|
/**
|
|
105
107
|
* 删除端点(`write.delete`):按行删除。`api` 的 `{占位符}` 取自目标记录(只给身份时只能是身份字段),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soma-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "SOMA — Semantic Oriented Modular Architecture. A declarative frontend framework runtime with no UI framework dependency; the Next.js host shell ships in host-next/ (code-isolated from core/, next/react are optional peer dependencies).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"soma",
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
"parse5": "7.3.0",
|
|
323
323
|
"qrcode-generator": "2.0.4",
|
|
324
324
|
"server-only": "0.0.1",
|
|
325
|
-
"soma-foundation": "^0.1.
|
|
325
|
+
"soma-foundation": "^0.1.2",
|
|
326
326
|
"temporal-polyfill": "0.3.2"
|
|
327
327
|
},
|
|
328
328
|
"peerDependencies": {
|