soma-core 2.2.8 → 2.2.10
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/full-manifest-builder.ts +1 -1
- package/core/build/compiler/host-config-sync.cjs +1 -1
- package/core/build/compiler/soma-manifest-webpack-plugin.js +2 -6
- package/core/build/compiler/soma-precompile.js +84 -4
- package/core/client/a11y/announcer.ts +2 -16
- package/core/client/base/SomaPageRootBase.ts +2 -2
- package/core/client/base/defineSomaView.ts +11 -2
- package/core/client/base/runtime-services.types.ts +57 -0
- package/core/client/data/role-gate.ts +2 -8
- package/core/client/engine/event-engine.ts +1 -0
- package/core/client/engines/diff/adapter-jsdiff.ts +27 -8
- package/core/client/engines/diff/code.ts +205 -0
- package/core/client/engines/diff/index.ts +107 -6
- package/core/client/engines/diff/items.ts +212 -0
- package/core/client/engines/diff/port.ts +215 -3
- package/core/client/engines/diff/prose.ts +443 -0
- package/core/client/engines/engine-adapters.ts +6 -0
- package/core/client/engines/highlight/adapter-lezer.ts +109 -0
- package/core/client/engines/highlight/index.ts +135 -0
- package/core/client/engines/highlight/port.ts +92 -0
- package/core/client/engines/markdown/adapter-markdown-it.ts +65 -0
- package/core/client/engines/markdown/blocks.ts +335 -0
- package/core/client/engines/markdown/index.ts +51 -0
- package/core/client/engines/markdown/port.ts +94 -0
- package/core/client/engines/markdown/vendor-modules.d.ts +6 -0
- package/core/client/engines/structured/adapter-js-yaml.ts +33 -0
- package/core/client/engines/structured/index.ts +139 -0
- package/core/client/engines/structured/port.ts +59 -0
- package/core/client/infra/http/SomaHttpService.ts +2 -4
- package/core/client/infra/notify/DefaultNotifyService.ts +2 -3
- package/core/client/infra/permission/SomaPermission.ts +1 -1
- package/core/client/render-ports/notify-renderer.ts +2 -46
- package/core/client/runtime/SomaRuntimeServices.ts +16 -45
- package/core/server/host/app-config-composer.ts +6 -52
- package/core/server/host/host-config-paths.cjs +2 -100
- package/core/server/host/precompiled-manifest.ts +69 -0
- package/core/server/host/source-packages.cjs +3 -0
- package/core/server/infra/host-config-paths.cjs +100 -0
- package/core/server/page-assets.ts +2 -70
- package/core/server/runtime-space/bindings.ts +33 -4
- package/core/server/runtime-space/store.ts +16 -1
- package/core/shared/app-config-merge.ts +59 -0
- package/core/shared/registry-generated/limits.ts +84 -4
- package/core/shared/types/announcer.types.ts +18 -0
- package/core/shared/types/notify.types.ts +26 -0
- package/core/shared/types/role-gate.types.ts +11 -0
- package/dist/browser/runtime-bundle.manifest.json +51 -7
- package/dist/browser/soma-runtime.js +120952 -104762
- package/dist/core/index.cjs +113613 -97412
- package/dist/host-native/aot-builder.cjs +582 -371
- package/dist/host-native/native-server.cjs +203 -72
- package/dist/lsp/component-tree.cjs +84 -4
- package/dist/types/build/compiler/full-manifest-builder.d.ts +1 -1
- package/dist/types/client/a11y/announcer.d.ts +2 -14
- package/dist/types/client/base/SomaPageRootBase.d.ts +2 -2
- package/dist/types/client/base/runtime-services.types.d.ts +50 -0
- package/dist/types/client/data/role-gate.d.ts +2 -8
- package/dist/types/client/engines/diff/code.d.ts +27 -0
- package/dist/types/client/engines/diff/index.d.ts +2 -1
- package/dist/types/client/engines/diff/items.d.ts +24 -0
- package/dist/types/client/engines/diff/port.d.ts +201 -2
- package/dist/types/client/engines/diff/prose.d.ts +80 -0
- package/dist/types/client/engines/engine-adapters.d.ts +6 -0
- package/dist/types/client/engines/highlight/adapter-lezer.d.ts +6 -0
- package/dist/types/client/engines/highlight/index.d.ts +15 -0
- package/dist/types/client/engines/highlight/port.d.ts +64 -0
- package/dist/types/client/engines/markdown/adapter-markdown-it.d.ts +6 -0
- package/dist/types/client/engines/markdown/blocks.d.ts +29 -0
- package/dist/types/client/engines/markdown/index.d.ts +9 -0
- package/dist/types/client/engines/markdown/port.d.ts +166 -0
- package/dist/types/client/engines/structured/adapter-js-yaml.d.ts +6 -0
- package/dist/types/client/engines/structured/index.d.ts +29 -0
- package/dist/types/client/engines/structured/port.d.ts +45 -0
- package/dist/types/client/infra/http/SomaHttpService.d.ts +1 -1
- package/dist/types/client/infra/notify/DefaultNotifyService.d.ts +2 -3
- package/dist/types/client/infra/permission/SomaPermission.d.ts +1 -1
- package/dist/types/client/render-ports/notify-renderer.d.ts +1 -56
- package/dist/types/client/runtime/SomaRuntimeServices.d.ts +9 -44
- package/dist/types/server/host/app-config-composer.d.ts +2 -3
- package/dist/types/server/host/host-config-paths.d.cts +2 -7
- package/dist/types/server/host/precompiled-manifest.d.ts +5 -0
- package/dist/types/server/host/source-packages.d.cts +5 -0
- package/dist/types/server/infra/host-config-paths.d.cts +7 -0
- package/dist/types/server/page-assets.d.ts +2 -5
- package/dist/types/server/runtime-space/store.d.ts +4 -0
- package/dist/types/shared/app-config-merge.d.ts +3 -0
- package/dist/types/shared/registry-generated/limits.d.ts +82 -4
- package/dist/types/shared/types/announcer.types.d.ts +14 -0
- package/dist/types/shared/types/notify.types.d.ts +36 -0
- package/dist/types/shared/types/role-gate.types.d.ts +8 -0
- package/host-native/src/aot-builder.ts +159 -96
- package/host-native/src/dev-chunk-gc.ts +104 -0
- package/host-native/src/host-prepare.ts +1 -1
- package/host-native/src/manifest-http.ts +1 -1
- package/host-native/src/page-http.ts +2 -67
- package/host-native/src/page-payload-cache.ts +68 -0
- package/host-native/src/public-packages.cjs +147 -50
- package/package.json +16 -2
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// core/server/
|
|
33
|
+
// core/server/infra/host-config-paths.cjs
|
|
34
34
|
var require_host_config_paths = __commonJS({
|
|
35
|
-
"core/server/
|
|
35
|
+
"core/server/infra/host-config-paths.cjs"(exports2, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var fs16 = require("node:fs");
|
|
38
38
|
var path18 = require("node:path");
|
|
@@ -121,13 +121,21 @@ var require_host_config_paths = __commonJS({
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
+
// core/server/host/host-config-paths.cjs
|
|
125
|
+
var require_host_config_paths2 = __commonJS({
|
|
126
|
+
"core/server/host/host-config-paths.cjs"(exports2, module2) {
|
|
127
|
+
"use strict";
|
|
128
|
+
module2.exports = require_host_config_paths();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
124
132
|
// core/server/host/source-packages.cjs
|
|
125
133
|
var require_source_packages = __commonJS({
|
|
126
134
|
"core/server/host/source-packages.cjs"(exports2, module2) {
|
|
127
135
|
"use strict";
|
|
128
136
|
var fs16 = require("node:fs");
|
|
129
137
|
var path18 = require("node:path");
|
|
130
|
-
var { getSomaHostConfigRoot: getSomaHostConfigRoot2 } =
|
|
138
|
+
var { getSomaHostConfigRoot: getSomaHostConfigRoot2 } = require_host_config_paths2();
|
|
131
139
|
var SOMA_SOURCE_PACKAGES_ENV = "SOMA_SOURCE_PACKAGES";
|
|
132
140
|
var MAX_ASSET_SOURCE_CACHE = 64;
|
|
133
141
|
var assetSourcesCache = /* @__PURE__ */ new Map();
|
|
@@ -309,6 +317,9 @@ var require_source_packages = __commonJS({
|
|
|
309
317
|
}
|
|
310
318
|
module2.exports = {
|
|
311
319
|
SOMA_SOURCE_PACKAGES_ENV,
|
|
320
|
+
isSomaSourcePackage,
|
|
321
|
+
readExplicitSourcePackages,
|
|
322
|
+
resolvePackageRoot,
|
|
312
323
|
getSomaHostSourceRoot: getSomaHostSourceRoot4,
|
|
313
324
|
getSomaHostApiRoot: getSomaHostApiRoot4,
|
|
314
325
|
resolveSafeChildRoot: resolveSafeChildRoot2,
|
|
@@ -2468,6 +2479,16 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2468
2479
|
"file": "core/server/registry/api-registry-store.ts",
|
|
2469
2480
|
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2470
2481
|
},
|
|
2482
|
+
{
|
|
2483
|
+
"module": "soma-core",
|
|
2484
|
+
"file": "core/client/engines/diff/index.ts",
|
|
2485
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
"module": "soma-core",
|
|
2489
|
+
"file": "core/client/engines/highlight/index.ts",
|
|
2490
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2491
|
+
},
|
|
2471
2492
|
{
|
|
2472
2493
|
"module": "soma-core",
|
|
2473
2494
|
"file": "core/server/registry/page-registry-store.ts",
|
|
@@ -2770,17 +2791,17 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2770
2791
|
},
|
|
2771
2792
|
{
|
|
2772
2793
|
"module": "soma-ai",
|
|
2773
|
-
"file": "src/
|
|
2794
|
+
"file": "src/server/common/RateLimitBackend.ts",
|
|
2774
2795
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2775
2796
|
},
|
|
2776
2797
|
{
|
|
2777
2798
|
"module": "soma-ai",
|
|
2778
|
-
"file": "src/
|
|
2799
|
+
"file": "src/server/common/RequestBodyLimit.ts",
|
|
2779
2800
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2780
2801
|
},
|
|
2781
2802
|
{
|
|
2782
2803
|
"module": "soma-ai",
|
|
2783
|
-
"file": "src/
|
|
2804
|
+
"file": "src/server/services/ai-assistant/Chat.ts",
|
|
2784
2805
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2785
2806
|
},
|
|
2786
2807
|
{
|
|
@@ -2795,7 +2816,7 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2795
2816
|
},
|
|
2796
2817
|
{
|
|
2797
2818
|
"module": "soma-ai",
|
|
2798
|
-
"file": "src/
|
|
2819
|
+
"file": "src/domain/ai-shared/TrustedRequestContext.ts",
|
|
2799
2820
|
"symbol": "SOMA_PIPELINE_LIMITS_AI_RUNTIME"
|
|
2800
2821
|
},
|
|
2801
2822
|
{
|
|
@@ -2968,6 +2989,76 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2968
2989
|
"tokensBytes": 40960,
|
|
2969
2990
|
"componentBytesPerPage": 163840,
|
|
2970
2991
|
"overrideBlockBytes": 8192
|
|
2992
|
+
},
|
|
2993
|
+
"contentEngines": {
|
|
2994
|
+
"diff": {
|
|
2995
|
+
"basis": {
|
|
2996
|
+
"maxChars": "\u5355\u4E2A\u5DEE\u5F02\u8BA1\u7B97\u4E24\u4FA7\u5408\u8BA1\u5B57\u6570\u4E0A\u9650\uFF1B\u8D85\u9650\u4E0D\u8BA1\u7B97\u3001\u6574\u6BB5\u66FF\u6362\uFF08\u53C2\u8003\u6587\u672C\u5DEE\u5F02\u7EC4\u4EF6\u7B14\u8BB0 C.5\u300C\u5355\u4E2A\u5DEE\u5F02\u7EC4\u4EF6\u603B\u91CF 200 000 \u5B57\u300D\uFF0C\u5B9E\u6D4B 4\uFF1A\u4E07\u5B57\u7EA7\u9010\u5B57\u6BD4\u8F83\u9700\u8D85\u65F6\u4E0E\u9000\u5316\uFF09",
|
|
2997
|
+
"maxCharsPerCompare": "\u5355\u6B21\u8BCD\u7EA7\u6BD4\u8F83\uFF08\u4E00\u5BF9\u53E5\u5B50 / \u4E00\u6B21 diff \u8C03\u7528\uFF09\u4E24\u4FA7\u5408\u8BA1\u5B57\u6570\u4E0A\u9650\uFF08\u7B14\u8BB0 C.2 BaseOpts maxChars 20 000\uFF09",
|
|
2998
|
+
"timeoutMs": "\u4E00\u6B21 diffProse / diffItems \u7684\u603B\u65F6\u9650\uFF08\u6BEB\u79D2\uFF09\uFF0C\u540C VisualEditor timeout 1000\uFF08\u7B14\u8BB0 C.2\uFF09",
|
|
2999
|
+
"maxItems": "\u6761\u76EE\u5217\u8868\u5355\u4FA7\u6761\u76EE\u6570\u4E0A\u9650\uFF1B\u8D85\u9650\u4E0D\u9010\u6761\u6BD4\u8F83\uFF08\u7B14\u8BB0 C.5\u300C\u6761\u76EE 2 000 \u4E2A\u300D\uFF09",
|
|
3000
|
+
"moveDetectMaxChanged": "\u53D8\u5316\u6761\u76EE\uFF08\u589E + \u5220\uFF09\u8D85\u8FC7\u6B64\u6570\u4E0D\u505A\u79FB\u52A8\u68C0\u6D4B\uFF08\u7B14\u8BB0 C.2\uFF0Cwikidiff2 \u589E\u5220\u5408\u8BA1 > 100 \u4E0D\u68C0\u6D4B\u7684\u653E\u5BBD\u7248\uFF0C\u7ECF\u9A8C\u503C\uFF09",
|
|
3001
|
+
"pairAt": "\u53E5 / \u6BB5\u914D\u5BF9\u9608\u503C\uFF1A\u5B57\u7B26\u591A\u91CD\u96C6 Dice \u2265 \u6B64\u503C\u89C6\u4E3A\u6539\u5199\uFF08VisualEditor diffThreshold 0.5\uFF1B\u5B9E\u6D4B 3 \u7684\u6539\u5199\u53E5\u4E3A 0.84\u20130.89\uFF09",
|
|
3002
|
+
"rewriteBelow": "\u6574\u4F53\u76F8\u4F3C\u5EA6\u4F4E\u4E8E\u6B64\u503C\u6574\u6BB5\u66FF\u6362\uFF08\u7B49\u6548 VE keep < 0.5 \xD7 diff\uFF1B\u5B9E\u6D4B 2 \u7684 C3 \u6574\u53E5\u91CD\u5199\u7EA6 0.16\uFF09",
|
|
3003
|
+
"absorbOrphan": "\u5B64\u5B57\u5438\u6536\uFF1A\u5939\u5728\u4E24\u5904\u6539\u52A8\u95F4\u3001\u957F\u5EA6 \u2264 \u6B64\u503C\uFF08\u5B57\uFF09\u7684\u975E\u6807\u70B9\u76F8\u540C\u7247\u6BB5\u5E76\u5165\u6539\u52A8\uFF08\u5B9E\u6D4B 2 \u7684 C5\u300C\u671F\u300D\uFF09",
|
|
3004
|
+
"absorbOrphanMax": "\u8C03\u7528\u65B9\u53EF\u8C03\u7684\u5B64\u5B57\u5438\u6536\u4E0A\u9650\uFF08\u5B57\uFF09\uFF0C\u9632\u6B62\u628A\u6574\u53E5\u5438\u6210\u6539\u52A8",
|
|
3005
|
+
"titleAt": "\u65E0 key \u6761\u76EE\u6309\u6807\u9898\u914D\u5BF9\u7684\u76F8\u4F3C\u5EA6\u9608\u503C\uFF08\u7B14\u8BB0 C.2 ItemOpts.match.titleAt 0.6\uFF09",
|
|
3006
|
+
"bodyAt": "\u65E0 key \u6761\u76EE\u6309\u6B63\u6587\u914D\u5BF9\u7684\u76F8\u4F3C\u5EA6\u9608\u503C\uFF08\u7B14\u8BB0 C.2 ItemOpts.match.bodyAt 0.5\uFF09",
|
|
3007
|
+
"maxAlignTokens": "\u5E8F\u5217\u5BF9\u9F50\u7684\u4E0D\u540C\u952E\u6570\u4E0A\u9650\uFF08\u6BCF\u4E2A\u952E\u6620\u5C04\u4E3A\u4E00\u4E2A BMP \u79C1\u7528\u533A\u5B57\u7B26\uFF0CU+E000\u2013U+F8FF \u5171 6400 \u4E2A\uFF09",
|
|
3008
|
+
"maxPairMatrix": "\u4E00\u6BB5\u5220\u589E\u533A\u95F4\u5185\u53E5 / \u6BB5\u914D\u5BF9\u7684\u5019\u9009\u77E9\u9635\u4E0A\u9650\uFF08\u5220\u6570 \xD7 \u589E\u6570\uFF09\uFF0C\u8D85\u51FA\u4E0D\u914D\u5BF9\u3001\u6309\u5220 + \u589E\u5448\u73B0\uFF1B\u7ECF\u9A8C\u503C\uFF0C\u8BC1\u636E\u5F31",
|
|
3009
|
+
"maxPairCandidates": "\u65E0 key \u6761\u76EE\u6309\u76F8\u4F3C\u5EA6\u914D\u5BF9\u7684\u5019\u9009\u77E9\u9635\u4E0A\u9650\uFF08\u5269\u4F59\u65E7\u6761\u76EE \xD7 \u5269\u4F59\u65B0\u6761\u76EE\uFF09\uFF1B\u7ECF\u9A8C\u503C\uFF0C\u8BC1\u636E\u5F31",
|
|
3010
|
+
"codeContext": "\u4EE3\u7801\u5DEE\u5F02\u6BCF\u5757\u7684\u4E0A\u4E0B\u6587\u884C\u6570\uFF08\u7B14\u8BB0 C.5\u300C\u4E0A\u4E0B\u6587 3 \u884C\u300D\uFF0C\u540C git diff -U3 / VS Code\uFF09",
|
|
3011
|
+
"codeIntraMaxLine": "\u4EE3\u7801\u6539\u884C\u505A\u884C\u5185\u5B57\u7B26\u5DEE\u5F02\u7684\u5355\u884C\u957F\u5EA6\u4E0A\u9650\uFF08\u5B57\u7B26\uFF09\uFF1B\u66F4\u957F\u7684\u884C\u53EA\u6807\u6574\u884C\u589E\u5220\uFF08\u7ECF\u9A8C\u503C\uFF1A\u538B\u7F29\u540E\u7684\u957F\u884C\u9010\u5B57\u6BD4\u8F83\u65E0\u610F\u4E49\u4E14\u8017\u65F6\uFF09"
|
|
3012
|
+
},
|
|
3013
|
+
"maxChars": 2e5,
|
|
3014
|
+
"maxCharsPerCompare": 2e4,
|
|
3015
|
+
"timeoutMs": 1e3,
|
|
3016
|
+
"maxItems": 2e3,
|
|
3017
|
+
"moveDetectMaxChanged": 500,
|
|
3018
|
+
"pairAt": 0.5,
|
|
3019
|
+
"rewriteBelow": 0.4,
|
|
3020
|
+
"absorbOrphan": 1,
|
|
3021
|
+
"absorbOrphanMax": 4,
|
|
3022
|
+
"titleAt": 0.6,
|
|
3023
|
+
"bodyAt": 0.5,
|
|
3024
|
+
"maxAlignTokens": 6400,
|
|
3025
|
+
"maxPairMatrix": 2500,
|
|
3026
|
+
"maxPairCandidates": 25e4,
|
|
3027
|
+
"codeContext": 3,
|
|
3028
|
+
"codeIntraMaxLine": 500
|
|
3029
|
+
},
|
|
3030
|
+
"highlight": {
|
|
3031
|
+
"basis": {
|
|
3032
|
+
"maxLines": "\u9AD8\u4EAE\u7684\u6700\u591A\u884C\u6570\uFF1B\u8D85\u51FA\u90E8\u5206\u6309\u7EAF\u6587\u672C\uFF08\u53C2\u8003\u6587\u672C\u5DEE\u5F02\u7EC4\u4EF6\u7B14\u8BB0 C.2 \u7AEF\u53E3 2 maxLines 5 000\uFF09",
|
|
3033
|
+
"maxLineLength": "\u5355\u884C\u8D85\u8FC7\u6B64\u5B57\u7B26\u6570\u6574\u884C\u6309\u7EAF\u6587\u672C\uFF08\u7B14\u8BB0 C.2 maxLineLength 2 000\uFF0C\u538B\u7F29\u540E\u7684\u5355\u884C JS / JSON \u5E38\u89C1\uFF09",
|
|
3034
|
+
"timeoutMs": "\u4E00\u6B21\u89E3\u6790\u7684\u65F6\u9650\uFF08\u6BEB\u79D2\uFF09\uFF1BLezer \u6309 advance() \u5206\u6B65\u89E3\u6790\uFF0C\u8D85\u65F6\u6574\u6BB5\u6309\u7EAF\u6587\u672C\uFF08\u7ECF\u9A8C\u503C\uFF0C\u4E0E\u5DEE\u5F02\u7AEF\u53E3\u540C\u53D6 1 000\uFF09",
|
|
3035
|
+
"maxChars": "\u6574\u6BB5\u8D85\u8FC7\u6B64\u5B57\u7B26\u6570\u4E0D\u89E3\u6790\u3001\u6309\u7EAF\u6587\u672C\uFF08\u7ECF\u9A8C\u503C\uFF0C\u8BC1\u636E\u5F31\uFF1A\u7EA6 1 MB \u6587\u672C\uFF09",
|
|
3036
|
+
"jsonSniffMaxChars": "\u8BED\u8A00\u63A8\u65AD\u300C\u6574\u4F53\u80FD JSON.parse\u300D\u53EA\u5BF9\u4E0D\u8D85\u8FC7\u6B64\u5B57\u7B26\u6570\u7684\u6837\u672C\u505A\uFF08\u907F\u514D\u5BF9\u5927\u6587\u672C\u53CD\u590D\u89E3\u6790\uFF1B\u7ECF\u9A8C\u503C\uFF09"
|
|
3037
|
+
},
|
|
3038
|
+
"maxLines": 5e3,
|
|
3039
|
+
"maxLineLength": 2e3,
|
|
3040
|
+
"timeoutMs": 1e3,
|
|
3041
|
+
"maxChars": 1e6,
|
|
3042
|
+
"jsonSniffMaxChars": 2e5
|
|
3043
|
+
},
|
|
3044
|
+
"structured": {
|
|
3045
|
+
"basis": {
|
|
3046
|
+
"maxChars": "JSON / YAML \u539F\u6587\u8D85\u8FC7\u6B64\u5B57\u7B26\u6570\u4E0D\u89E3\u6790\u3001\u6309\u539F\u6587\u663E\u793A\uFF08\u4E0E\u4EE3\u7801\u9AD8\u4EAE\u7AEF\u53E3 maxChars \u540C\u53D6\u7EA6 1 MB\uFF1B\u7ECF\u9A8C\u503C\uFF0C\u8BC1\u636E\u5F31\uFF09",
|
|
3047
|
+
"maxNodes": "\u89E3\u6790\u540E\u503C\u7684\u8282\u70B9\u603B\u6570\u4E0A\u9650\uFF08\u5BF9\u8C61 / \u6570\u7EC4 / \u53F6\u5B50\u5404\u8BA1 1\uFF09\uFF1BYAML \u522B\u540D\u5C55\u5F00\u8D85\u9650\u5373\u6309 too-many-nodes \u964D\u7EA7\uFF0C\u9632\u300C\u5341\u4EBF\u7B11\u58F0\u300D\u5F0F\u522B\u540D\u70B8\u5F39\uFF08\u7ECF\u9A8C\u503C\uFF1A20 \u4E07\u8282\u70B9\u7EA6\u4E3A 1 MB \u7D27\u51D1 JSON \u7684\u91CF\u7EA7\uFF09"
|
|
3048
|
+
},
|
|
3049
|
+
"maxChars": 1e6,
|
|
3050
|
+
"maxNodes": 2e5
|
|
3051
|
+
},
|
|
3052
|
+
"markdown": {
|
|
3053
|
+
"basis": {
|
|
3054
|
+
"maxChars": "Markdown \u539F\u6587\u8D85\u8FC7\u6B64\u5B57\u7B26\u6570\u4E0D\u89E3\u6790\u3001\u6309\u7EAF\u6587\u672C\u663E\u793A\uFF08\u53C2\u8003\u6587\u672C\u5DEE\u5F02\u7EC4\u4EF6\u7B14\u8BB0 C.2 \u7AEF\u53E3 1 limits.maxChars 200 000\uFF09",
|
|
3055
|
+
"maxBlocks": "\u5757\u6570\u4E0A\u9650\uFF0C\u8D85\u51FA\u622A\u65AD\u5E76\u6807 truncated\uFF08\u7B14\u8BB0 C.2 maxBlocks 5 000\uFF09",
|
|
3056
|
+
"summaryChars": "meta.summary \u53D6\u53BB\u6807\u8BB0\u5168\u6587\u7684\u524D N \u5B57\uFF08\u7B14\u8BB0 C.2\u300C\u524D 80 \u5B57\u300D\uFF09"
|
|
3057
|
+
},
|
|
3058
|
+
"maxChars": 2e5,
|
|
3059
|
+
"maxBlocks": 5e3,
|
|
3060
|
+
"summaryChars": 80
|
|
3061
|
+
}
|
|
2971
3062
|
}
|
|
2972
3063
|
};
|
|
2973
3064
|
|
|
@@ -6703,16 +6794,10 @@ var ServerFileCache = class _ServerFileCache {
|
|
|
6703
6794
|
|
|
6704
6795
|
// core/server/host/app-config-composer.ts
|
|
6705
6796
|
var import_node_fs3 = __toESM(require("node:fs"));
|
|
6706
|
-
var
|
|
6707
|
-
|
|
6708
|
-
// core/server/host/host-dir.ts
|
|
6709
|
-
var import_node_path3 = __toESM(require("node:path"));
|
|
6710
|
-
function currentHostDir() {
|
|
6711
|
-
const configured = process.env.SOMA_HOST_DIR;
|
|
6712
|
-
return configured !== void 0 && configured.trim() !== "" ? import_node_path3.default.resolve(configured) : void 0;
|
|
6713
|
-
}
|
|
6797
|
+
var import_js_yaml4 = __toESM(require("js-yaml"));
|
|
6714
6798
|
|
|
6715
|
-
// core/
|
|
6799
|
+
// core/shared/app-config-merge.ts
|
|
6800
|
+
var import_js_yaml3 = __toESM(require("js-yaml"));
|
|
6716
6801
|
var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
6717
6802
|
function isRecord5(value2) {
|
|
6718
6803
|
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
@@ -6755,12 +6840,24 @@ function mergeSourcePackageAppConfig(sourcePackageConfig, hostConfig) {
|
|
|
6755
6840
|
}
|
|
6756
6841
|
return cloneValue(sourcePackageConfig ?? {});
|
|
6757
6842
|
}
|
|
6843
|
+
|
|
6844
|
+
// core/server/host/host-dir.ts
|
|
6845
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
6846
|
+
function currentHostDir() {
|
|
6847
|
+
const configured = process.env.SOMA_HOST_DIR;
|
|
6848
|
+
return configured !== void 0 && configured.trim() !== "" ? import_node_path3.default.resolve(configured) : void 0;
|
|
6849
|
+
}
|
|
6850
|
+
|
|
6851
|
+
// core/server/host/app-config-composer.ts
|
|
6852
|
+
function isRecord6(value2) {
|
|
6853
|
+
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
6854
|
+
}
|
|
6758
6855
|
function composeAppConfigYaml(sourcePackageConfigYaml, hostConfigYaml) {
|
|
6759
6856
|
const merged = mergeSourcePackageAppConfig(
|
|
6760
6857
|
parseAppConfigYaml(sourcePackageConfigYaml),
|
|
6761
6858
|
parseAppConfigYaml(hostConfigYaml)
|
|
6762
6859
|
);
|
|
6763
|
-
return
|
|
6860
|
+
return import_js_yaml4.default.dump(merged, { noRefs: true, lineWidth: -1 });
|
|
6764
6861
|
}
|
|
6765
6862
|
function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
6766
6863
|
if (!hostDir) {
|
|
@@ -6772,7 +6869,7 @@ function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
|
6772
6869
|
}
|
|
6773
6870
|
try {
|
|
6774
6871
|
const config = parseAppConfigYaml(import_node_fs3.default.readFileSync(configPath, "utf8"));
|
|
6775
|
-
if (!
|
|
6872
|
+
if (!isRecord6(config) || typeof config.displayName !== "string") {
|
|
6776
6873
|
return "";
|
|
6777
6874
|
}
|
|
6778
6875
|
return config.displayName.trim();
|
|
@@ -6782,7 +6879,7 @@ function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
|
6782
6879
|
}
|
|
6783
6880
|
|
|
6784
6881
|
// core/build/compiler/page-declaration-compiler.ts
|
|
6785
|
-
var
|
|
6882
|
+
var import_js_yaml6 = __toESM(require("js-yaml"));
|
|
6786
6883
|
|
|
6787
6884
|
// core/build/compiler/html-include-expander.ts
|
|
6788
6885
|
var SomaHtmlIncludeError = class extends Error {
|
|
@@ -6872,12 +6969,12 @@ var SomaGenerationAggregateError = class extends SomaGenerationError {
|
|
|
6872
6969
|
};
|
|
6873
6970
|
|
|
6874
6971
|
// core/build/compiler/soma-precompile.ts
|
|
6875
|
-
var
|
|
6972
|
+
var import_js_yaml5 = __toESM(require("js-yaml"));
|
|
6876
6973
|
function compileEventConfig(yamlStr) {
|
|
6877
6974
|
if (!yamlStr.trim()) {
|
|
6878
6975
|
return { events: [], timers: [] };
|
|
6879
6976
|
}
|
|
6880
|
-
return compileEventConfigFromRaw(
|
|
6977
|
+
return compileEventConfigFromRaw(import_js_yaml5.default.load(yamlStr));
|
|
6881
6978
|
}
|
|
6882
6979
|
function compileEventConfigFromRaw(raw) {
|
|
6883
6980
|
const { eventsRaw, timers } = splitEventConfigRaw(raw);
|
|
@@ -6890,7 +6987,7 @@ function compileDataConfig(yamlStr) {
|
|
|
6890
6987
|
if (!yamlStr.trim()) {
|
|
6891
6988
|
return { objects: {} };
|
|
6892
6989
|
}
|
|
6893
|
-
return parseDataConfig(
|
|
6990
|
+
return parseDataConfig(import_js_yaml5.default.load(yamlStr));
|
|
6894
6991
|
}
|
|
6895
6992
|
|
|
6896
6993
|
// core/build/component-tree/source-preflight.ts
|
|
@@ -6959,7 +7056,7 @@ function assertNoComponentTreeSyntax(html) {
|
|
|
6959
7056
|
|
|
6960
7057
|
// core/build/compiler/page-declaration-compiler.ts
|
|
6961
7058
|
var SOMA_UNKNOWN_COMPILE_IDENTITY = "";
|
|
6962
|
-
var dump = (value2) =>
|
|
7059
|
+
var dump = (value2) => import_js_yaml6.default.dump(value2, { lineWidth: 120, noRefs: true, quotingType: '"' });
|
|
6963
7060
|
var DEFAULT_OPTIONS = { purpose: "static" };
|
|
6964
7061
|
function compilePageDeclaration(source2, options = DEFAULT_OPTIONS) {
|
|
6965
7062
|
try {
|
|
@@ -7146,7 +7243,7 @@ function compileSomaPageAssets(quartet, base, includes, options = {}) {
|
|
|
7146
7243
|
}
|
|
7147
7244
|
|
|
7148
7245
|
// core/server/host/locale-yaml.ts
|
|
7149
|
-
var
|
|
7246
|
+
var import_js_yaml7 = __toESM(require("js-yaml"));
|
|
7150
7247
|
|
|
7151
7248
|
// core/shared/types/locale.types.ts
|
|
7152
7249
|
var SOMA_LOCALE_BUNDLE_FORMAT = "soma.locale-bundle";
|
|
@@ -7176,7 +7273,7 @@ function stringEntries(value2) {
|
|
|
7176
7273
|
}
|
|
7177
7274
|
function mergeLocaleYaml(hostYaml, compiled) {
|
|
7178
7275
|
if (compiled === void 0) return hostYaml;
|
|
7179
|
-
const hostRaw = hostYaml.trim() === "" ? void 0 :
|
|
7276
|
+
const hostRaw = hostYaml.trim() === "" ? void 0 : import_js_yaml7.default.load(hostYaml);
|
|
7180
7277
|
const hostEmpty = hostRaw === void 0 || hostRaw === null || typeof hostRaw === "object" && !Array.isArray(hostRaw) && Object.keys(hostRaw).length === 0;
|
|
7181
7278
|
if (!hostEmpty && !isLocaleBundle(hostRaw)) {
|
|
7182
7279
|
throw new Error("[soma-core][\u8BCD\u8868] Host \u7684 locale.yaml \u5FC5\u987B\u662F { format: soma.locale-bundle, defaultLocale, <\u8BED\u8A00>: { \u952E: \u6587\u6848 } } \u4FE1\u5C01\uFF1B\u4E0D\u63A5\u53D7\u6241\u5E73\u5355\u5B57\u5178");
|
|
@@ -7196,17 +7293,17 @@ function mergeLocaleYaml(hostYaml, compiled) {
|
|
|
7196
7293
|
...defaultLocale !== void 0 ? { defaultLocale } : {},
|
|
7197
7294
|
...merged
|
|
7198
7295
|
};
|
|
7199
|
-
return
|
|
7296
|
+
return import_js_yaml7.default.dump(result, { lineWidth: -1, noRefs: true });
|
|
7200
7297
|
}
|
|
7201
7298
|
|
|
7202
7299
|
// core/server/host/page-markup-config.ts
|
|
7203
7300
|
var import_node_fs4 = require("node:fs");
|
|
7204
7301
|
var import_node_path4 = require("node:path");
|
|
7205
|
-
var
|
|
7302
|
+
var import_js_yaml8 = __toESM(require("js-yaml"));
|
|
7206
7303
|
function loadPageMarkupConfig(configRoot, base) {
|
|
7207
7304
|
const file = (0, import_node_path4.join)(configRoot, "page-markup.config.yaml");
|
|
7208
7305
|
if (!(0, import_node_fs4.existsSync)(file)) return {};
|
|
7209
|
-
const raw =
|
|
7306
|
+
const raw = import_js_yaml8.default.load((0, import_node_fs4.readFileSync)(file, "utf8"));
|
|
7210
7307
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
7211
7308
|
throw new Error("[soma-core][\u9875\u9762\u683C\u5F0F] page-markup.config.yaml \u5FC5\u987B\u5305\u542B pages \u5BF9\u8C61");
|
|
7212
7309
|
}
|
|
@@ -7534,12 +7631,12 @@ function isStatusError(error) {
|
|
|
7534
7631
|
// core/server/runtime-space/access-gate.ts
|
|
7535
7632
|
var SOMA_ANONYMOUS_ACCESS_IDENTITY = Object.freeze({ signedIn: false, roles: /* @__PURE__ */ new Set() });
|
|
7536
7633
|
var SOMA_FORBIDDEN_TEXT_KEY = SOMA_PAGE_FORBIDDEN_I18N_KEY;
|
|
7537
|
-
function
|
|
7634
|
+
function isRecord7(value2) {
|
|
7538
7635
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7539
7636
|
}
|
|
7540
7637
|
function readAccessIdentity(raw) {
|
|
7541
7638
|
if (raw === null || raw === void 0 || raw === false) return SOMA_ANONYMOUS_ACCESS_IDENTITY;
|
|
7542
|
-
if (!
|
|
7639
|
+
if (!isRecord7(raw)) return { signedIn: true, roles: /* @__PURE__ */ new Set() };
|
|
7543
7640
|
if (raw.signedIn === false) return SOMA_ANONYMOUS_ACCESS_IDENTITY;
|
|
7544
7641
|
const roles = /* @__PURE__ */ new Set();
|
|
7545
7642
|
if (Array.isArray(raw.roles)) {
|
|
@@ -7552,14 +7649,14 @@ function rolesScopeOf(rule) {
|
|
|
7552
7649
|
return resolveScope({ scope: rule.roles_scope, items: Array.isArray(rule.roles) ? rule.roles : void 0 });
|
|
7553
7650
|
}
|
|
7554
7651
|
function isOpenAccessRule(rule) {
|
|
7555
|
-
if (rule === void 0 || rule === null || !
|
|
7652
|
+
if (rule === void 0 || rule === null || !isRecord7(rule)) return true;
|
|
7556
7653
|
const roles = rolesScopeOf(rule);
|
|
7557
7654
|
return roles.problem === null && roles.scope === "all" && rule.signed_in !== true;
|
|
7558
7655
|
}
|
|
7559
7656
|
function evaluateAccessRule(rule, identity) {
|
|
7560
7657
|
if (isOpenAccessRule(rule)) return "allow";
|
|
7561
7658
|
if (!identity.signedIn) return "unauthenticated";
|
|
7562
|
-
const roles =
|
|
7659
|
+
const roles = isRecord7(rule) ? rolesScopeOf(rule) : null;
|
|
7563
7660
|
if (roles !== null && roles.problem !== null) return "forbidden";
|
|
7564
7661
|
if (roles !== null && roles.scope === "specific" && !roles.items.some((role) => identity.roles.has(role))) return "forbidden";
|
|
7565
7662
|
return "allow";
|
|
@@ -7613,7 +7710,7 @@ function readAccessPolicy(hostDir) {
|
|
|
7613
7710
|
}
|
|
7614
7711
|
}
|
|
7615
7712
|
function accessRulesOf(binding, envelope, policy) {
|
|
7616
|
-
const own =
|
|
7713
|
+
const own = isRecord7(envelope?.access) ? envelope?.access : void 0;
|
|
7617
7714
|
const floor = grantFor(policy.grants, binding.caller, binding.address)?.access;
|
|
7618
7715
|
return [policy.defaultAccess, floor, own].filter((rule) => !isOpenAccessRule(rule));
|
|
7619
7716
|
}
|
|
@@ -7650,21 +7747,21 @@ async function gateAccess(binding, envelope, policy, resolveIdentity, requestedP
|
|
|
7650
7747
|
|
|
7651
7748
|
// core/server/runtime-space/nav-catalog.ts
|
|
7652
7749
|
var LIMITS = SOMA_PIPELINE_LIMITS2.envelope;
|
|
7653
|
-
function
|
|
7750
|
+
function isRecord8(value2) {
|
|
7654
7751
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7655
7752
|
}
|
|
7656
7753
|
function navSlotOf(source2) {
|
|
7657
7754
|
const { binding, envelope } = source2;
|
|
7658
7755
|
if (binding.origin === "static" || binding.kind !== "exact" || binding.purpose === "preview") return null;
|
|
7659
7756
|
const nav = envelope?.nav;
|
|
7660
|
-
if (!
|
|
7757
|
+
if (!isRecord8(nav)) return null;
|
|
7661
7758
|
const typed = nav;
|
|
7662
7759
|
return { group: typed.group ?? LIMITS.navDefaultGroup, nav: typed };
|
|
7663
7760
|
}
|
|
7664
7761
|
function titleOf(source2) {
|
|
7665
7762
|
const raw = source2.envelope?.title;
|
|
7666
7763
|
if (typeof raw === "string" && raw !== "") return raw;
|
|
7667
|
-
if (
|
|
7764
|
+
if (isRecord8(raw) && typeof raw.t === "string") return { t: raw.t };
|
|
7668
7765
|
return source2.binding.title ?? source2.binding.address;
|
|
7669
7766
|
}
|
|
7670
7767
|
var reportedParents = /* @__PURE__ */ new Set();
|
|
@@ -7869,7 +7966,7 @@ var SOMA_DEFAULT_PAGE_GRANTS = Object.freeze([
|
|
|
7869
7966
|
var PERSIST_RANK = Object.freeze(
|
|
7870
7967
|
Object.fromEntries(SOMA_ENVELOPE_PERSIST_LEVELS.map((level, index) => [level, index]))
|
|
7871
7968
|
);
|
|
7872
|
-
function
|
|
7969
|
+
function isRecord9(value2) {
|
|
7873
7970
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7874
7971
|
}
|
|
7875
7972
|
function invalidGrant(index, problem, remedy = "\u6309\u300A\u9875\u9762\u7EA7\u63CF\u8FF0\u4E0E\u6309 URL \u6CE8\u518C\u300B\xA74.6 \u4FEE\u6B63 pageGrants") {
|
|
@@ -7887,7 +7984,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7887
7984
|
const seen = /* @__PURE__ */ new Map();
|
|
7888
7985
|
const out = [];
|
|
7889
7986
|
grants.forEach((raw, index) => {
|
|
7890
|
-
if (!
|
|
7987
|
+
if (!isRecord9(raw)) invalidGrant(index, "\u6761\u76EE\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7891
7988
|
for (const key2 of Object.keys(raw)) {
|
|
7892
7989
|
if (!GRANT_KEYS.has(key2)) invalidGrant(index, `\u672A\u77E5\u952E ${JSON.stringify(key2)}`, `\u53EA\u8BA4 ${[...GRANT_KEYS].join(" / ")}`);
|
|
7893
7990
|
}
|
|
@@ -7908,7 +8005,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7908
8005
|
}
|
|
7909
8006
|
if (raw.max !== void 0 && (!Number.isInteger(raw.max) || raw.max < 1)) invalidGrant(index, "max \u5FC5\u987B\u662F\u6B63\u6574\u6570");
|
|
7910
8007
|
if (raw.access !== void 0) {
|
|
7911
|
-
if (!
|
|
8008
|
+
if (!isRecord9(raw.access)) invalidGrant(index, "access \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7912
8009
|
for (const key2 of Object.keys(raw.access)) if (!ACCESS_KEYS.has(key2)) invalidGrant(index, `access \u542B\u672A\u77E5\u952E ${JSON.stringify(key2)}`);
|
|
7913
8010
|
const { roles, signed_in: signedIn } = raw.access;
|
|
7914
8011
|
if (roles !== void 0 && (!Array.isArray(roles) || roles.length === 0 || roles.some((role) => typeof role !== "string" || role === ""))) {
|
|
@@ -7917,7 +8014,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7917
8014
|
if (signedIn !== void 0 && typeof signedIn !== "boolean") invalidGrant(index, "access.signed_in \u5FC5\u987B\u662F\u5E03\u5C14\u503C");
|
|
7918
8015
|
}
|
|
7919
8016
|
if (raw.nav !== void 0) {
|
|
7920
|
-
if (!
|
|
8017
|
+
if (!isRecord9(raw.nav)) invalidGrant(index, "nav \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7921
8018
|
for (const key2 of Object.keys(raw.nav)) if (!NAV_KEYS.has(key2)) invalidGrant(index, `nav \u542B\u672A\u77E5\u952E ${JSON.stringify(key2)}`, "\u6388\u6743\u53EA\u76D6 group / order / icon");
|
|
7922
8019
|
if (raw.nav.order !== void 0 && !Number.isFinite(raw.nav.order)) invalidGrant(index, "nav.order \u5FC5\u987B\u662F\u6570\u5B57");
|
|
7923
8020
|
if (shape.kind !== "exact" && shape.kind !== "all" && Object.keys(raw.nav).length > 0) {
|
|
@@ -8469,6 +8566,17 @@ var SomaRuntimeStore = class {
|
|
|
8469
8566
|
this.pages.set(digest, page);
|
|
8470
8567
|
return page;
|
|
8471
8568
|
}
|
|
8569
|
+
/** 删除产物文件(升级丢弃旧产物后清理用;调用方保证没有别的绑定引用它);返回是否真删了文件 */
|
|
8570
|
+
removeArtifact(digest) {
|
|
8571
|
+
if (!isRuntimeDigest(digest)) return false;
|
|
8572
|
+
this.pages.delete(digest);
|
|
8573
|
+
try {
|
|
8574
|
+
import_node_fs8.default.unlinkSync(artifactFilePath(this.dirs.artifacts, digest));
|
|
8575
|
+
return true;
|
|
8576
|
+
} catch {
|
|
8577
|
+
return false;
|
|
8578
|
+
}
|
|
8579
|
+
}
|
|
8472
8580
|
hasArtifact(digest) {
|
|
8473
8581
|
return isRuntimeDigest(digest) && import_node_fs8.default.existsSync(artifactFilePath(this.dirs.artifacts, digest));
|
|
8474
8582
|
}
|
|
@@ -8544,6 +8652,8 @@ var SomaRuntimeStore = class {
|
|
|
8544
8652
|
return false;
|
|
8545
8653
|
}
|
|
8546
8654
|
}
|
|
8655
|
+
/** 本进程读绑定时因落盘格式版本不符而丢弃的旧绑定个数(启动汇总日志用) */
|
|
8656
|
+
legacyDiscarded = 0;
|
|
8547
8657
|
/** 严格删除:文件本来就不在返回 false(视为成功);其他失败(权限 / IO)原样抛出,不吞 */
|
|
8548
8658
|
removeBindingStrict(address) {
|
|
8549
8659
|
try {
|
|
@@ -8570,7 +8680,10 @@ var SomaRuntimeStore = class {
|
|
|
8570
8680
|
const stat = import_node_fs8.default.statSync(file);
|
|
8571
8681
|
const record3 = JSON.parse(import_node_fs8.default.readFileSync(file, "utf8"));
|
|
8572
8682
|
if (record3.schemaVersion === SOMA_RUNTIME_STORE_FORMAT && record3.binding) out.push({ binding: record3.binding, mtimeMs: stat.mtimeMs });
|
|
8573
|
-
else
|
|
8683
|
+
else {
|
|
8684
|
+
import_node_fs8.default.unlinkSync(file);
|
|
8685
|
+
this.legacyDiscarded += 1;
|
|
8686
|
+
}
|
|
8574
8687
|
} catch {
|
|
8575
8688
|
}
|
|
8576
8689
|
}
|
|
@@ -8657,6 +8770,9 @@ function ensureLoaded() {
|
|
|
8657
8770
|
state2.loadedRoots.add(layout.root);
|
|
8658
8771
|
const store = runtimeStore(layout);
|
|
8659
8772
|
const now = Date.now();
|
|
8773
|
+
const dropped = { format: 0, owner: 0 };
|
|
8774
|
+
const droppedDigests = /* @__PURE__ */ new Set();
|
|
8775
|
+
const legacyBefore = store.legacyDiscarded;
|
|
8660
8776
|
for (const read of store.listBindings()) {
|
|
8661
8777
|
const binding = read.binding;
|
|
8662
8778
|
if (binding.origin !== "inject" || binding.digest === null || binding.kind === "prefix") continue;
|
|
@@ -8674,12 +8790,15 @@ function ensureLoaded() {
|
|
|
8674
8790
|
const envelope = page.envelope ?? readFlatEnvelope(page.uiYaml);
|
|
8675
8791
|
if (page.format !== SOMA_PAGE_FORMAT_VERSION) {
|
|
8676
8792
|
store.removeBinding(binding.address);
|
|
8677
|
-
|
|
8793
|
+
dropped.format += 1;
|
|
8794
|
+
droppedDigests.add(binding.digest);
|
|
8678
8795
|
continue;
|
|
8679
8796
|
}
|
|
8680
8797
|
const guard = binding.owner === void 0 ? void 0 : state2.ownerGuards.get(binding.owner);
|
|
8681
8798
|
if (guard !== void 0 && !guard(binding.version)) {
|
|
8682
8799
|
store.removeBinding(binding.address);
|
|
8800
|
+
dropped.owner += 1;
|
|
8801
|
+
droppedDigests.add(binding.digest);
|
|
8683
8802
|
continue;
|
|
8684
8803
|
}
|
|
8685
8804
|
state2.generations.set(key, Math.max(state2.generations.get(key) ?? 0, binding.generation));
|
|
@@ -8692,6 +8811,14 @@ function ensureLoaded() {
|
|
|
8692
8811
|
mtimeMs: read.mtimeMs
|
|
8693
8812
|
});
|
|
8694
8813
|
}
|
|
8814
|
+
const legacy = store.legacyDiscarded - legacyBefore;
|
|
8815
|
+
dropped.format += legacy;
|
|
8816
|
+
if (dropped.format + dropped.owner > 0) {
|
|
8817
|
+
const live = new Set([...state2.entries.values()].flatMap((entry) => entry.binding.digest !== null ? [entry.binding.digest] : []));
|
|
8818
|
+
let cleaned = 0;
|
|
8819
|
+
for (const digest of droppedDigests) if (!live.has(digest) && store.removeArtifact(digest)) cleaned += 1;
|
|
8820
|
+
console.warn(`[soma-core][\u5F15\u64CE] \u5347\u7EA7\u540E\u4E22\u5F03\u65E7\u9875\u9762\u4EA7\u7269 ${dropped.format + dropped.owner} \u4E2A\uFF08\u683C\u5F0F\u7248\u672C\u4E0D\u7B26 ${dropped.format}\uFF0C\u4EA7\u51FA\u65B9\u7248\u672C\u4E0D\u7B26 ${dropped.owner}\uFF09\uFF0C\u5DF2\u6E05\u7406\u4EA7\u7269\u6587\u4EF6 ${cleaned} \u4E2A\uFF1B\u7531\u4EA7\u51FA\u65B9\u91CD\u65B0\u7F16\u8BD1\u6CE8\u5165\u3002`);
|
|
8821
|
+
}
|
|
8695
8822
|
if (process.env.SOMA_RUNTIME_GC !== "off") {
|
|
8696
8823
|
try {
|
|
8697
8824
|
const referenced = [...state2.entries.values()].flatMap((entry) => entry.binding.digest !== null ? [entry.binding.digest] : []);
|
|
@@ -8934,14 +9061,14 @@ function assertAddress(address, kinds) {
|
|
|
8934
9061
|
}
|
|
8935
9062
|
return { normalized: check.normalized, kind: check.kind };
|
|
8936
9063
|
}
|
|
8937
|
-
function
|
|
9064
|
+
function isRecord10(value2) {
|
|
8938
9065
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
8939
9066
|
}
|
|
8940
9067
|
function invalid(situation, problem, remedy) {
|
|
8941
9068
|
return runtimeError("CORE-RUNTIME-ADDRESS-INVALID", situation, problem, remedy);
|
|
8942
9069
|
}
|
|
8943
9070
|
function assertStandardPageShape(page, address) {
|
|
8944
|
-
if (!
|
|
9071
|
+
if (!isRecord10(page)) throw invalid(`\u6CE8\u5165 ${address}`, "\u8F7D\u8377\u4E0D\u662F\u5BF9\u8C61", "\u4F20 { format: 1, html, uiYaml, eventYaml?, styleYaml?, \u2026 }");
|
|
8945
9072
|
if (page.format !== SOMA_PAGE_FORMAT_VERSION) {
|
|
8946
9073
|
throw runtimeError(
|
|
8947
9074
|
"CORE-FORMAT-VERSION-UNSUPPORTED",
|
|
@@ -8950,12 +9077,12 @@ function assertStandardPageShape(page, address) {
|
|
|
8950
9077
|
"\u6309\u5F53\u524D\u4E3B\u7248\u672C\u4EA7\u51FA\u6807\u51C6\u683C\u5F0F"
|
|
8951
9078
|
);
|
|
8952
9079
|
}
|
|
8953
|
-
if (typeof page.html !== "string" || !(typeof page.uiYaml === "string" ||
|
|
9080
|
+
if (typeof page.html !== "string" || !(typeof page.uiYaml === "string" || isRecord10(page.uiYaml))) {
|
|
8954
9081
|
throw invalid(`\u6CE8\u5165 ${address}`, "\u8F7D\u8377\u7F3A html \u6216 uiYaml\uFF08html \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\uFF0CuiYaml \u662F\u5E73\u94FA\u6587\u672C\u6216\u5BF9\u8C61\uFF09", "\u6807\u51C6\u683C\u5F0F\u8F7D\u8377\u662F\u56DB\u4EF6\u5957\uFF1Ahtml + uiYaml\uFF08\u5FC5\u9700\uFF09+ eventYaml / styleYaml\uFF08\u53EF\u9009\uFF09");
|
|
8955
9082
|
}
|
|
8956
9083
|
for (const key of ["eventYaml", "styleYaml"]) {
|
|
8957
9084
|
const value2 = page[key];
|
|
8958
|
-
if (value2 !== void 0 && !(typeof value2 === "string" ||
|
|
9085
|
+
if (value2 !== void 0 && !(typeof value2 === "string" || isRecord10(value2))) {
|
|
8959
9086
|
throw invalid(`\u6CE8\u5165 ${address}`, `\u8F7D\u8377\u7684 ${key} \u5F62\u72B6\u4E0D\u5408\u6CD5\uFF08\u5FC5\u987B\u662F\u5E73\u94FA\u6587\u672C\u6216\u5BF9\u8C61\uFF09`, `${key} \u7F3A\u7701\u8868\u793A\u6CA1\u6709\u8BE5\u4EF6\uFF1B\u7ED9\u4E86\u5C31\u5FC5\u987B\u662F\u5E73\u94FA YAML \u6587\u672C\u6216\u5DF2\u89E3\u6790\u5BF9\u8C61`);
|
|
8960
9087
|
}
|
|
8961
9088
|
}
|
|
@@ -8983,7 +9110,7 @@ function checkOptions(address, options, now) {
|
|
|
8983
9110
|
throw invalid(`\u6CE8\u5165 ${address}`, `owner ${JSON.stringify(options.owner)} \u4E0D\u5408\uFF08\u6765\u6E90\u7C7B\u578B\uFF0C\u5F62\u5982 soma-ui / soma-kit / native\uFF09`, "owner \u662F\u6765\u6E90\u7C7B\u578B\uFF1A\u539F\u751F\u9875 native\uFF0C\u65B9\u8A00\u5199\u65B9\u8A00\u540D");
|
|
8984
9111
|
}
|
|
8985
9112
|
const source2 = options.source;
|
|
8986
|
-
if (source2 !== void 0 && (!
|
|
9113
|
+
if (source2 !== void 0 && (!isRecord10(source2) || typeof source2.format !== "string" || !LABEL3.test(source2.format) || typeof source2.digest !== "string" || source2.digest === "" || source2.digest.length > 128)) {
|
|
8987
9114
|
throw invalid(`\u6CE8\u5165 ${address}`, "source \u5FC5\u987B\u662F { format: \u5C0F\u5199\u6807\u7B7E, digest: \u975E\u7A7A\u4E32 }", "format \u662F\u4E0D\u900F\u660E\u6765\u6E90\u6807\u7B7E\uFF0Cdigest \u662F\u6765\u6E90\u6E90\u7801\u6458\u8981");
|
|
8988
9115
|
}
|
|
8989
9116
|
}
|
|
@@ -9054,10 +9181,10 @@ function unbindRegistryPage(address) {
|
|
|
9054
9181
|
}
|
|
9055
9182
|
|
|
9056
9183
|
// core/server/runtime-space/dynamic-pages.ts
|
|
9057
|
-
var
|
|
9184
|
+
var import_js_yaml10 = __toESM(require("js-yaml"));
|
|
9058
9185
|
|
|
9059
9186
|
// core/server/registry/validation/declaration-safety-scan.ts
|
|
9060
|
-
var
|
|
9187
|
+
var import_js_yaml9 = __toESM(require("js-yaml"));
|
|
9061
9188
|
|
|
9062
9189
|
// core/shared/inert-data-element.ts
|
|
9063
9190
|
var ALLOWED_ATTRS = /* @__PURE__ */ new Set(["type", "id"]);
|
|
@@ -9179,7 +9306,7 @@ function hasDangerousSchemeInRawText(source2) {
|
|
|
9179
9306
|
function hasDangerousSchemeInYaml(source2) {
|
|
9180
9307
|
let document;
|
|
9181
9308
|
try {
|
|
9182
|
-
document =
|
|
9309
|
+
document = import_js_yaml9.default.load(source2);
|
|
9183
9310
|
} catch {
|
|
9184
9311
|
return hasDangerousSchemeInRawText(source2);
|
|
9185
9312
|
}
|
|
@@ -9360,7 +9487,7 @@ function isStandardDeclaration(declaration) {
|
|
|
9360
9487
|
|
|
9361
9488
|
// core/server/runtime-space/resolve.ts
|
|
9362
9489
|
var import_node_path13 = __toESM(require("node:path"));
|
|
9363
|
-
var
|
|
9490
|
+
var import_js_yaml12 = __toESM(require("js-yaml"));
|
|
9364
9491
|
var import_node_crypto7 = require("node:crypto");
|
|
9365
9492
|
|
|
9366
9493
|
// core/shared/published-page-route.ts
|
|
@@ -10351,7 +10478,7 @@ function digestTreeData(value2) {
|
|
|
10351
10478
|
}
|
|
10352
10479
|
|
|
10353
10480
|
// core/build/component-tree/artifact-codec.ts
|
|
10354
|
-
var
|
|
10481
|
+
var import_js_yaml11 = __toESM(require("js-yaml"));
|
|
10355
10482
|
var TREE_COMPILER_VERSION = "component-tree:1.0.0";
|
|
10356
10483
|
function fail2(path18) {
|
|
10357
10484
|
throw new SomaComponentTreeError({
|
|
@@ -10384,7 +10511,7 @@ function normalizeRuntimeConfig(input) {
|
|
|
10384
10511
|
const safe = record2(canonicalTreeData(input));
|
|
10385
10512
|
if (safe.styleYaml?.trim() || safe.styleConfig !== void 0 && safe.styleConfig !== null && Object.keys(record2(safe.styleConfig)).length > 0) fail2("style");
|
|
10386
10513
|
const objectUi = safe.uiConfig === void 0 ? void 0 : normalizeUi(safe.uiConfig, safe);
|
|
10387
|
-
const yamlUi = safe.uiYaml === void 0 ? void 0 : normalizeUi(
|
|
10514
|
+
const yamlUi = safe.uiYaml === void 0 ? void 0 : normalizeUi(import_js_yaml11.default.load(safe.uiYaml), safe);
|
|
10388
10515
|
const ui = same(objectUi, yamlUi, "ui");
|
|
10389
10516
|
if (ui === void 0) fail2("ui");
|
|
10390
10517
|
const timers = same(safe.timers, safe.timerConfig, "event.timers");
|
|
@@ -10548,7 +10675,7 @@ function message2(error) {
|
|
|
10548
10675
|
var import_node_path11 = __toESM(require("node:path"));
|
|
10549
10676
|
|
|
10550
10677
|
// core/shared/std-auth-scan.ts
|
|
10551
|
-
function
|
|
10678
|
+
function isRecord11(value2) {
|
|
10552
10679
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
10553
10680
|
}
|
|
10554
10681
|
function apiText(value2) {
|
|
@@ -10559,7 +10686,7 @@ function nameOf(entry, names) {
|
|
|
10559
10686
|
}
|
|
10560
10687
|
function scanApiRefsAt(context, node, names) {
|
|
10561
10688
|
const refs = [];
|
|
10562
|
-
if (!
|
|
10689
|
+
if (!isRecord11(node)) return refs;
|
|
10563
10690
|
for (const point of SOMA_STD_AUTH_SCAN.points) {
|
|
10564
10691
|
if (point.context !== context) continue;
|
|
10565
10692
|
const value2 = node[nameOf(point, names)];
|
|
@@ -10590,7 +10717,7 @@ function scanApiRefsAt(context, node, names) {
|
|
|
10590
10717
|
function readPath(value2, path18) {
|
|
10591
10718
|
let node = value2;
|
|
10592
10719
|
for (const segment of path18) {
|
|
10593
|
-
if (!
|
|
10720
|
+
if (!isRecord11(node)) return void 0;
|
|
10594
10721
|
node = node[segment];
|
|
10595
10722
|
}
|
|
10596
10723
|
return node;
|
|
@@ -10608,7 +10735,7 @@ function collectGrammarApiRefs(object, options) {
|
|
|
10608
10735
|
for (const ref of scanApiRefsAt(context, node, options.names)) {
|
|
10609
10736
|
out.push({ path: apiRefPath(base, ref, options), api: ref.api, ...ref.bare ? { bare: true } : {} });
|
|
10610
10737
|
}
|
|
10611
|
-
if (!
|
|
10738
|
+
if (!isRecord11(node)) return;
|
|
10612
10739
|
for (const container of SOMA_STD_AUTH_SCAN.containers) {
|
|
10613
10740
|
if (container.context !== context) continue;
|
|
10614
10741
|
const child = node[nameOf(container, options.names)];
|
|
@@ -10616,7 +10743,7 @@ function collectGrammarApiRefs(object, options) {
|
|
|
10616
10743
|
const target = container.contains;
|
|
10617
10744
|
const run = () => {
|
|
10618
10745
|
if (container.shape === "map") {
|
|
10619
|
-
if (!
|
|
10746
|
+
if (!isRecord11(child)) return;
|
|
10620
10747
|
const keys = options.sortFields === true ? Object.keys(child).sort() : Object.keys(child);
|
|
10621
10748
|
for (const name of keys) visit(target, child[name], options.keyPath(childBase, name), false);
|
|
10622
10749
|
} else if (Array.isArray(child)) {
|
|
@@ -12549,13 +12676,13 @@ var SOMA_GENERATION_ERROR_CODES = [
|
|
|
12549
12676
|
];
|
|
12550
12677
|
|
|
12551
12678
|
// core/shared/generation-diagnostics.ts
|
|
12552
|
-
function
|
|
12679
|
+
function isRecord12(value2) {
|
|
12553
12680
|
return typeof value2 === "object" && value2 !== null;
|
|
12554
12681
|
}
|
|
12555
12682
|
function isGenerationErrorShape(value2) {
|
|
12556
|
-
if (!
|
|
12683
|
+
if (!isRecord12(value2)) return false;
|
|
12557
12684
|
const src = value2.src;
|
|
12558
|
-
return typeof value2.code === "string" && SOMA_GENERATION_ERROR_CODES.includes(value2.code) && typeof value2.layer === "string" && typeof value2.situation === "string" && typeof value2.problem === "string" && typeof value2.remedy === "string" &&
|
|
12685
|
+
return typeof value2.code === "string" && SOMA_GENERATION_ERROR_CODES.includes(value2.code) && typeof value2.layer === "string" && typeof value2.situation === "string" && typeof value2.problem === "string" && typeof value2.remedy === "string" && isRecord12(src) && typeof src.file === "string" && typeof src.path === "string";
|
|
12559
12686
|
}
|
|
12560
12687
|
function toPlainErrorShape(shape) {
|
|
12561
12688
|
return {
|
|
@@ -12569,7 +12696,7 @@ function toPlainErrorShape(shape) {
|
|
|
12569
12696
|
};
|
|
12570
12697
|
}
|
|
12571
12698
|
function readGenerationDiagnostics(error) {
|
|
12572
|
-
if (!
|
|
12699
|
+
if (!isRecord12(error)) return null;
|
|
12573
12700
|
const list2 = error.diagnostics;
|
|
12574
12701
|
if (Array.isArray(list2) && list2.length > 0 && list2.every(isGenerationErrorShape)) {
|
|
12575
12702
|
return list2.map(toPlainErrorShape);
|
|
@@ -13185,7 +13312,7 @@ function readHostFiles(hostDir) {
|
|
|
13185
13312
|
function pageLocaleBundle(page) {
|
|
13186
13313
|
if (page.locale === void 0 || page.locale.trim() === "") return void 0;
|
|
13187
13314
|
try {
|
|
13188
|
-
const parsed =
|
|
13315
|
+
const parsed = import_js_yaml12.default.load(page.locale);
|
|
13189
13316
|
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : void 0;
|
|
13190
13317
|
} catch {
|
|
13191
13318
|
return void 0;
|
|
@@ -13974,11 +14101,8 @@ function clearTailwindCompilerCache() {
|
|
|
13974
14101
|
// host-native/src/page-http.ts
|
|
13975
14102
|
var import_node_crypto9 = require("node:crypto");
|
|
13976
14103
|
var import_node_zlib = __toESM(require("node:zlib"));
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
}
|
|
13980
|
-
var VARY_DEFAULT = "Cookie, Authorization";
|
|
13981
|
-
var VARY_ENCODING = "Cookie, Authorization, Accept-Encoding";
|
|
14104
|
+
|
|
14105
|
+
// host-native/src/page-payload-cache.ts
|
|
13982
14106
|
var MAX_CACHE_ENTRIES = 256;
|
|
13983
14107
|
var MAX_CACHE_BYTES = 64 * 1024 * 1024;
|
|
13984
14108
|
var PagePayloadBufferLRU = class {
|
|
@@ -14025,6 +14149,13 @@ var PagePayloadBufferCache = new PagePayloadBufferLRU();
|
|
|
14025
14149
|
function clearPagePayloadBufferCache() {
|
|
14026
14150
|
PagePayloadBufferCache.clear();
|
|
14027
14151
|
}
|
|
14152
|
+
|
|
14153
|
+
// host-native/src/page-http.ts
|
|
14154
|
+
function resolveLoginPath(assembly) {
|
|
14155
|
+
return resolveHostLoginPath(assembly);
|
|
14156
|
+
}
|
|
14157
|
+
var VARY_DEFAULT = "Cookie, Authorization";
|
|
14158
|
+
var VARY_ENCODING = "Cookie, Authorization, Accept-Encoding";
|
|
14028
14159
|
function weakEtag(body) {
|
|
14029
14160
|
return `W/"${(0, import_node_crypto9.createHash)("sha1").update(body).digest("hex").slice(0, 20)}"`;
|
|
14030
14161
|
}
|
|
@@ -14267,7 +14398,7 @@ function readPrewarmCompiled(layout) {
|
|
|
14267
14398
|
return { pages, meta };
|
|
14268
14399
|
}
|
|
14269
14400
|
|
|
14270
|
-
// core/server/
|
|
14401
|
+
// core/server/host/precompiled-manifest.ts
|
|
14271
14402
|
function validatePages(raw) {
|
|
14272
14403
|
if (!raw?.pages || !Array.isArray(raw.pages)) return null;
|
|
14273
14404
|
for (const page of raw.pages) {
|
|
@@ -14401,12 +14532,12 @@ function buildRouteTable(htmlFiles) {
|
|
|
14401
14532
|
}
|
|
14402
14533
|
|
|
14403
14534
|
// core/build/compiler/full-manifest-builder.ts
|
|
14404
|
-
var
|
|
14535
|
+
var import_js_yaml13 = __toESM(require("js-yaml"));
|
|
14405
14536
|
function precompileAll(inputs) {
|
|
14406
14537
|
const hostAppConfig = parseAppConfigYaml(inputs.appConfigYaml);
|
|
14407
14538
|
return {
|
|
14408
14539
|
routes: buildRouteTable(inputs.htmlFiles),
|
|
14409
|
-
locale:
|
|
14540
|
+
locale: import_js_yaml13.default.load(inputs.localeYaml) || {},
|
|
14410
14541
|
appConfig: hostAppConfig,
|
|
14411
14542
|
pages: inputs.pages.map((p) => precompilePage(p, {
|
|
14412
14543
|
hostAppConfig,
|
|
@@ -14448,7 +14579,7 @@ function precompilePage(p, context) {
|
|
|
14448
14579
|
}
|
|
14449
14580
|
|
|
14450
14581
|
// host-native/src/host-prepare.ts
|
|
14451
|
-
var import_host_config_paths5 = __toESM(
|
|
14582
|
+
var import_host_config_paths5 = __toESM(require_host_config_paths2());
|
|
14452
14583
|
var SOMA_SHELL_ROUTES_ENV = "SOMA_SHELL_ROUTES";
|
|
14453
14584
|
var coreIdentityMemo = null;
|
|
14454
14585
|
function coreCompilerIdentity() {
|