soma-core 2.2.8 → 2.2.9
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 +80 -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/index.ts +81 -6
- package/core/client/engines/diff/items.ts +212 -0
- package/core/client/engines/diff/port.ts +140 -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/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 +80 -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 +50 -7
- package/dist/browser/soma-runtime.js +120741 -104799
- package/dist/core/index.cjs +113807 -97854
- package/dist/host-native/aot-builder.cjs +277 -189
- package/dist/host-native/native-server.cjs +196 -72
- package/dist/lsp/component-tree.cjs +80 -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/index.d.ts +1 -1
- package/dist/types/client/engines/diff/items.d.ts +24 -0
- package/dist/types/client/engines/diff/port.d.ts +124 -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/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 +78 -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 +12 -5
- 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/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();
|
|
@@ -2468,6 +2476,16 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2468
2476
|
"file": "core/server/registry/api-registry-store.ts",
|
|
2469
2477
|
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2470
2478
|
},
|
|
2479
|
+
{
|
|
2480
|
+
"module": "soma-core",
|
|
2481
|
+
"file": "core/client/engines/diff/index.ts",
|
|
2482
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
"module": "soma-core",
|
|
2486
|
+
"file": "core/client/engines/highlight/index.ts",
|
|
2487
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
2488
|
+
},
|
|
2471
2489
|
{
|
|
2472
2490
|
"module": "soma-core",
|
|
2473
2491
|
"file": "core/server/registry/page-registry-store.ts",
|
|
@@ -2770,17 +2788,17 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2770
2788
|
},
|
|
2771
2789
|
{
|
|
2772
2790
|
"module": "soma-ai",
|
|
2773
|
-
"file": "src/
|
|
2791
|
+
"file": "src/server/common/RateLimitBackend.ts",
|
|
2774
2792
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2775
2793
|
},
|
|
2776
2794
|
{
|
|
2777
2795
|
"module": "soma-ai",
|
|
2778
|
-
"file": "src/
|
|
2796
|
+
"file": "src/server/common/RequestBodyLimit.ts",
|
|
2779
2797
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2780
2798
|
},
|
|
2781
2799
|
{
|
|
2782
2800
|
"module": "soma-ai",
|
|
2783
|
-
"file": "src/
|
|
2801
|
+
"file": "src/server/services/ai-assistant/Chat.ts",
|
|
2784
2802
|
"symbol": "SOMA_PIPELINE_LIMITS_AI"
|
|
2785
2803
|
},
|
|
2786
2804
|
{
|
|
@@ -2795,7 +2813,7 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2795
2813
|
},
|
|
2796
2814
|
{
|
|
2797
2815
|
"module": "soma-ai",
|
|
2798
|
-
"file": "src/
|
|
2816
|
+
"file": "src/domain/ai-shared/TrustedRequestContext.ts",
|
|
2799
2817
|
"symbol": "SOMA_PIPELINE_LIMITS_AI_RUNTIME"
|
|
2800
2818
|
},
|
|
2801
2819
|
{
|
|
@@ -2968,6 +2986,72 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
2968
2986
|
"tokensBytes": 40960,
|
|
2969
2987
|
"componentBytesPerPage": 163840,
|
|
2970
2988
|
"overrideBlockBytes": 8192
|
|
2989
|
+
},
|
|
2990
|
+
"contentEngines": {
|
|
2991
|
+
"diff": {
|
|
2992
|
+
"basis": {
|
|
2993
|
+
"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",
|
|
2994
|
+
"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",
|
|
2995
|
+
"timeoutMs": "\u4E00\u6B21 diffProse / diffItems \u7684\u603B\u65F6\u9650\uFF08\u6BEB\u79D2\uFF09\uFF0C\u540C VisualEditor timeout 1000\uFF08\u7B14\u8BB0 C.2\uFF09",
|
|
2996
|
+
"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",
|
|
2997
|
+
"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",
|
|
2998
|
+
"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",
|
|
2999
|
+
"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",
|
|
3000
|
+
"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",
|
|
3001
|
+
"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",
|
|
3002
|
+
"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",
|
|
3003
|
+
"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",
|
|
3004
|
+
"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",
|
|
3005
|
+
"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",
|
|
3006
|
+
"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"
|
|
3007
|
+
},
|
|
3008
|
+
"maxChars": 2e5,
|
|
3009
|
+
"maxCharsPerCompare": 2e4,
|
|
3010
|
+
"timeoutMs": 1e3,
|
|
3011
|
+
"maxItems": 2e3,
|
|
3012
|
+
"moveDetectMaxChanged": 500,
|
|
3013
|
+
"pairAt": 0.5,
|
|
3014
|
+
"rewriteBelow": 0.4,
|
|
3015
|
+
"absorbOrphan": 1,
|
|
3016
|
+
"absorbOrphanMax": 4,
|
|
3017
|
+
"titleAt": 0.6,
|
|
3018
|
+
"bodyAt": 0.5,
|
|
3019
|
+
"maxAlignTokens": 6400,
|
|
3020
|
+
"maxPairMatrix": 2500,
|
|
3021
|
+
"maxPairCandidates": 25e4
|
|
3022
|
+
},
|
|
3023
|
+
"highlight": {
|
|
3024
|
+
"basis": {
|
|
3025
|
+
"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",
|
|
3026
|
+
"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",
|
|
3027
|
+
"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",
|
|
3028
|
+
"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",
|
|
3029
|
+
"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"
|
|
3030
|
+
},
|
|
3031
|
+
"maxLines": 5e3,
|
|
3032
|
+
"maxLineLength": 2e3,
|
|
3033
|
+
"timeoutMs": 1e3,
|
|
3034
|
+
"maxChars": 1e6,
|
|
3035
|
+
"jsonSniffMaxChars": 2e5
|
|
3036
|
+
},
|
|
3037
|
+
"structured": {
|
|
3038
|
+
"basis": {
|
|
3039
|
+
"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",
|
|
3040
|
+
"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"
|
|
3041
|
+
},
|
|
3042
|
+
"maxChars": 1e6,
|
|
3043
|
+
"maxNodes": 2e5
|
|
3044
|
+
},
|
|
3045
|
+
"markdown": {
|
|
3046
|
+
"basis": {
|
|
3047
|
+
"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",
|
|
3048
|
+
"maxBlocks": "\u5757\u6570\u4E0A\u9650\uFF0C\u8D85\u51FA\u622A\u65AD\u5E76\u6807 truncated\uFF08\u7B14\u8BB0 C.2 maxBlocks 5 000\uFF09",
|
|
3049
|
+
"summaryChars": "meta.summary \u53D6\u53BB\u6807\u8BB0\u5168\u6587\u7684\u524D N \u5B57\uFF08\u7B14\u8BB0 C.2\u300C\u524D 80 \u5B57\u300D\uFF09"
|
|
3050
|
+
},
|
|
3051
|
+
"maxChars": 2e5,
|
|
3052
|
+
"maxBlocks": 5e3,
|
|
3053
|
+
"summaryChars": 80
|
|
3054
|
+
}
|
|
2971
3055
|
}
|
|
2972
3056
|
};
|
|
2973
3057
|
|
|
@@ -6703,16 +6787,10 @@ var ServerFileCache = class _ServerFileCache {
|
|
|
6703
6787
|
|
|
6704
6788
|
// core/server/host/app-config-composer.ts
|
|
6705
6789
|
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
|
-
}
|
|
6790
|
+
var import_js_yaml4 = __toESM(require("js-yaml"));
|
|
6714
6791
|
|
|
6715
|
-
// core/
|
|
6792
|
+
// core/shared/app-config-merge.ts
|
|
6793
|
+
var import_js_yaml3 = __toESM(require("js-yaml"));
|
|
6716
6794
|
var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
6717
6795
|
function isRecord5(value2) {
|
|
6718
6796
|
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
@@ -6755,12 +6833,24 @@ function mergeSourcePackageAppConfig(sourcePackageConfig, hostConfig) {
|
|
|
6755
6833
|
}
|
|
6756
6834
|
return cloneValue(sourcePackageConfig ?? {});
|
|
6757
6835
|
}
|
|
6836
|
+
|
|
6837
|
+
// core/server/host/host-dir.ts
|
|
6838
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
6839
|
+
function currentHostDir() {
|
|
6840
|
+
const configured = process.env.SOMA_HOST_DIR;
|
|
6841
|
+
return configured !== void 0 && configured.trim() !== "" ? import_node_path3.default.resolve(configured) : void 0;
|
|
6842
|
+
}
|
|
6843
|
+
|
|
6844
|
+
// core/server/host/app-config-composer.ts
|
|
6845
|
+
function isRecord6(value2) {
|
|
6846
|
+
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
6847
|
+
}
|
|
6758
6848
|
function composeAppConfigYaml(sourcePackageConfigYaml, hostConfigYaml) {
|
|
6759
6849
|
const merged = mergeSourcePackageAppConfig(
|
|
6760
6850
|
parseAppConfigYaml(sourcePackageConfigYaml),
|
|
6761
6851
|
parseAppConfigYaml(hostConfigYaml)
|
|
6762
6852
|
);
|
|
6763
|
-
return
|
|
6853
|
+
return import_js_yaml4.default.dump(merged, { noRefs: true, lineWidth: -1 });
|
|
6764
6854
|
}
|
|
6765
6855
|
function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
6766
6856
|
if (!hostDir) {
|
|
@@ -6772,7 +6862,7 @@ function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
|
6772
6862
|
}
|
|
6773
6863
|
try {
|
|
6774
6864
|
const config = parseAppConfigYaml(import_node_fs3.default.readFileSync(configPath, "utf8"));
|
|
6775
|
-
if (!
|
|
6865
|
+
if (!isRecord6(config) || typeof config.displayName !== "string") {
|
|
6776
6866
|
return "";
|
|
6777
6867
|
}
|
|
6778
6868
|
return config.displayName.trim();
|
|
@@ -6782,7 +6872,7 @@ function readHostAppDisplayName(hostDir = currentHostDir()) {
|
|
|
6782
6872
|
}
|
|
6783
6873
|
|
|
6784
6874
|
// core/build/compiler/page-declaration-compiler.ts
|
|
6785
|
-
var
|
|
6875
|
+
var import_js_yaml6 = __toESM(require("js-yaml"));
|
|
6786
6876
|
|
|
6787
6877
|
// core/build/compiler/html-include-expander.ts
|
|
6788
6878
|
var SomaHtmlIncludeError = class extends Error {
|
|
@@ -6872,12 +6962,12 @@ var SomaGenerationAggregateError = class extends SomaGenerationError {
|
|
|
6872
6962
|
};
|
|
6873
6963
|
|
|
6874
6964
|
// core/build/compiler/soma-precompile.ts
|
|
6875
|
-
var
|
|
6965
|
+
var import_js_yaml5 = __toESM(require("js-yaml"));
|
|
6876
6966
|
function compileEventConfig(yamlStr) {
|
|
6877
6967
|
if (!yamlStr.trim()) {
|
|
6878
6968
|
return { events: [], timers: [] };
|
|
6879
6969
|
}
|
|
6880
|
-
return compileEventConfigFromRaw(
|
|
6970
|
+
return compileEventConfigFromRaw(import_js_yaml5.default.load(yamlStr));
|
|
6881
6971
|
}
|
|
6882
6972
|
function compileEventConfigFromRaw(raw) {
|
|
6883
6973
|
const { eventsRaw, timers } = splitEventConfigRaw(raw);
|
|
@@ -6890,7 +6980,7 @@ function compileDataConfig(yamlStr) {
|
|
|
6890
6980
|
if (!yamlStr.trim()) {
|
|
6891
6981
|
return { objects: {} };
|
|
6892
6982
|
}
|
|
6893
|
-
return parseDataConfig(
|
|
6983
|
+
return parseDataConfig(import_js_yaml5.default.load(yamlStr));
|
|
6894
6984
|
}
|
|
6895
6985
|
|
|
6896
6986
|
// core/build/component-tree/source-preflight.ts
|
|
@@ -6959,7 +7049,7 @@ function assertNoComponentTreeSyntax(html) {
|
|
|
6959
7049
|
|
|
6960
7050
|
// core/build/compiler/page-declaration-compiler.ts
|
|
6961
7051
|
var SOMA_UNKNOWN_COMPILE_IDENTITY = "";
|
|
6962
|
-
var dump = (value2) =>
|
|
7052
|
+
var dump = (value2) => import_js_yaml6.default.dump(value2, { lineWidth: 120, noRefs: true, quotingType: '"' });
|
|
6963
7053
|
var DEFAULT_OPTIONS = { purpose: "static" };
|
|
6964
7054
|
function compilePageDeclaration(source2, options = DEFAULT_OPTIONS) {
|
|
6965
7055
|
try {
|
|
@@ -7146,7 +7236,7 @@ function compileSomaPageAssets(quartet, base, includes, options = {}) {
|
|
|
7146
7236
|
}
|
|
7147
7237
|
|
|
7148
7238
|
// core/server/host/locale-yaml.ts
|
|
7149
|
-
var
|
|
7239
|
+
var import_js_yaml7 = __toESM(require("js-yaml"));
|
|
7150
7240
|
|
|
7151
7241
|
// core/shared/types/locale.types.ts
|
|
7152
7242
|
var SOMA_LOCALE_BUNDLE_FORMAT = "soma.locale-bundle";
|
|
@@ -7176,7 +7266,7 @@ function stringEntries(value2) {
|
|
|
7176
7266
|
}
|
|
7177
7267
|
function mergeLocaleYaml(hostYaml, compiled) {
|
|
7178
7268
|
if (compiled === void 0) return hostYaml;
|
|
7179
|
-
const hostRaw = hostYaml.trim() === "" ? void 0 :
|
|
7269
|
+
const hostRaw = hostYaml.trim() === "" ? void 0 : import_js_yaml7.default.load(hostYaml);
|
|
7180
7270
|
const hostEmpty = hostRaw === void 0 || hostRaw === null || typeof hostRaw === "object" && !Array.isArray(hostRaw) && Object.keys(hostRaw).length === 0;
|
|
7181
7271
|
if (!hostEmpty && !isLocaleBundle(hostRaw)) {
|
|
7182
7272
|
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 +7286,17 @@ function mergeLocaleYaml(hostYaml, compiled) {
|
|
|
7196
7286
|
...defaultLocale !== void 0 ? { defaultLocale } : {},
|
|
7197
7287
|
...merged
|
|
7198
7288
|
};
|
|
7199
|
-
return
|
|
7289
|
+
return import_js_yaml7.default.dump(result, { lineWidth: -1, noRefs: true });
|
|
7200
7290
|
}
|
|
7201
7291
|
|
|
7202
7292
|
// core/server/host/page-markup-config.ts
|
|
7203
7293
|
var import_node_fs4 = require("node:fs");
|
|
7204
7294
|
var import_node_path4 = require("node:path");
|
|
7205
|
-
var
|
|
7295
|
+
var import_js_yaml8 = __toESM(require("js-yaml"));
|
|
7206
7296
|
function loadPageMarkupConfig(configRoot, base) {
|
|
7207
7297
|
const file = (0, import_node_path4.join)(configRoot, "page-markup.config.yaml");
|
|
7208
7298
|
if (!(0, import_node_fs4.existsSync)(file)) return {};
|
|
7209
|
-
const raw =
|
|
7299
|
+
const raw = import_js_yaml8.default.load((0, import_node_fs4.readFileSync)(file, "utf8"));
|
|
7210
7300
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
7211
7301
|
throw new Error("[soma-core][\u9875\u9762\u683C\u5F0F] page-markup.config.yaml \u5FC5\u987B\u5305\u542B pages \u5BF9\u8C61");
|
|
7212
7302
|
}
|
|
@@ -7534,12 +7624,12 @@ function isStatusError(error) {
|
|
|
7534
7624
|
// core/server/runtime-space/access-gate.ts
|
|
7535
7625
|
var SOMA_ANONYMOUS_ACCESS_IDENTITY = Object.freeze({ signedIn: false, roles: /* @__PURE__ */ new Set() });
|
|
7536
7626
|
var SOMA_FORBIDDEN_TEXT_KEY = SOMA_PAGE_FORBIDDEN_I18N_KEY;
|
|
7537
|
-
function
|
|
7627
|
+
function isRecord7(value2) {
|
|
7538
7628
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7539
7629
|
}
|
|
7540
7630
|
function readAccessIdentity(raw) {
|
|
7541
7631
|
if (raw === null || raw === void 0 || raw === false) return SOMA_ANONYMOUS_ACCESS_IDENTITY;
|
|
7542
|
-
if (!
|
|
7632
|
+
if (!isRecord7(raw)) return { signedIn: true, roles: /* @__PURE__ */ new Set() };
|
|
7543
7633
|
if (raw.signedIn === false) return SOMA_ANONYMOUS_ACCESS_IDENTITY;
|
|
7544
7634
|
const roles = /* @__PURE__ */ new Set();
|
|
7545
7635
|
if (Array.isArray(raw.roles)) {
|
|
@@ -7552,14 +7642,14 @@ function rolesScopeOf(rule) {
|
|
|
7552
7642
|
return resolveScope({ scope: rule.roles_scope, items: Array.isArray(rule.roles) ? rule.roles : void 0 });
|
|
7553
7643
|
}
|
|
7554
7644
|
function isOpenAccessRule(rule) {
|
|
7555
|
-
if (rule === void 0 || rule === null || !
|
|
7645
|
+
if (rule === void 0 || rule === null || !isRecord7(rule)) return true;
|
|
7556
7646
|
const roles = rolesScopeOf(rule);
|
|
7557
7647
|
return roles.problem === null && roles.scope === "all" && rule.signed_in !== true;
|
|
7558
7648
|
}
|
|
7559
7649
|
function evaluateAccessRule(rule, identity) {
|
|
7560
7650
|
if (isOpenAccessRule(rule)) return "allow";
|
|
7561
7651
|
if (!identity.signedIn) return "unauthenticated";
|
|
7562
|
-
const roles =
|
|
7652
|
+
const roles = isRecord7(rule) ? rolesScopeOf(rule) : null;
|
|
7563
7653
|
if (roles !== null && roles.problem !== null) return "forbidden";
|
|
7564
7654
|
if (roles !== null && roles.scope === "specific" && !roles.items.some((role) => identity.roles.has(role))) return "forbidden";
|
|
7565
7655
|
return "allow";
|
|
@@ -7613,7 +7703,7 @@ function readAccessPolicy(hostDir) {
|
|
|
7613
7703
|
}
|
|
7614
7704
|
}
|
|
7615
7705
|
function accessRulesOf(binding, envelope, policy) {
|
|
7616
|
-
const own =
|
|
7706
|
+
const own = isRecord7(envelope?.access) ? envelope?.access : void 0;
|
|
7617
7707
|
const floor = grantFor(policy.grants, binding.caller, binding.address)?.access;
|
|
7618
7708
|
return [policy.defaultAccess, floor, own].filter((rule) => !isOpenAccessRule(rule));
|
|
7619
7709
|
}
|
|
@@ -7650,21 +7740,21 @@ async function gateAccess(binding, envelope, policy, resolveIdentity, requestedP
|
|
|
7650
7740
|
|
|
7651
7741
|
// core/server/runtime-space/nav-catalog.ts
|
|
7652
7742
|
var LIMITS = SOMA_PIPELINE_LIMITS2.envelope;
|
|
7653
|
-
function
|
|
7743
|
+
function isRecord8(value2) {
|
|
7654
7744
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7655
7745
|
}
|
|
7656
7746
|
function navSlotOf(source2) {
|
|
7657
7747
|
const { binding, envelope } = source2;
|
|
7658
7748
|
if (binding.origin === "static" || binding.kind !== "exact" || binding.purpose === "preview") return null;
|
|
7659
7749
|
const nav = envelope?.nav;
|
|
7660
|
-
if (!
|
|
7750
|
+
if (!isRecord8(nav)) return null;
|
|
7661
7751
|
const typed = nav;
|
|
7662
7752
|
return { group: typed.group ?? LIMITS.navDefaultGroup, nav: typed };
|
|
7663
7753
|
}
|
|
7664
7754
|
function titleOf(source2) {
|
|
7665
7755
|
const raw = source2.envelope?.title;
|
|
7666
7756
|
if (typeof raw === "string" && raw !== "") return raw;
|
|
7667
|
-
if (
|
|
7757
|
+
if (isRecord8(raw) && typeof raw.t === "string") return { t: raw.t };
|
|
7668
7758
|
return source2.binding.title ?? source2.binding.address;
|
|
7669
7759
|
}
|
|
7670
7760
|
var reportedParents = /* @__PURE__ */ new Set();
|
|
@@ -7869,7 +7959,7 @@ var SOMA_DEFAULT_PAGE_GRANTS = Object.freeze([
|
|
|
7869
7959
|
var PERSIST_RANK = Object.freeze(
|
|
7870
7960
|
Object.fromEntries(SOMA_ENVELOPE_PERSIST_LEVELS.map((level, index) => [level, index]))
|
|
7871
7961
|
);
|
|
7872
|
-
function
|
|
7962
|
+
function isRecord9(value2) {
|
|
7873
7963
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
7874
7964
|
}
|
|
7875
7965
|
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 +7977,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7887
7977
|
const seen = /* @__PURE__ */ new Map();
|
|
7888
7978
|
const out = [];
|
|
7889
7979
|
grants.forEach((raw, index) => {
|
|
7890
|
-
if (!
|
|
7980
|
+
if (!isRecord9(raw)) invalidGrant(index, "\u6761\u76EE\u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7891
7981
|
for (const key2 of Object.keys(raw)) {
|
|
7892
7982
|
if (!GRANT_KEYS.has(key2)) invalidGrant(index, `\u672A\u77E5\u952E ${JSON.stringify(key2)}`, `\u53EA\u8BA4 ${[...GRANT_KEYS].join(" / ")}`);
|
|
7893
7983
|
}
|
|
@@ -7908,7 +7998,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7908
7998
|
}
|
|
7909
7999
|
if (raw.max !== void 0 && (!Number.isInteger(raw.max) || raw.max < 1)) invalidGrant(index, "max \u5FC5\u987B\u662F\u6B63\u6574\u6570");
|
|
7910
8000
|
if (raw.access !== void 0) {
|
|
7911
|
-
if (!
|
|
8001
|
+
if (!isRecord9(raw.access)) invalidGrant(index, "access \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7912
8002
|
for (const key2 of Object.keys(raw.access)) if (!ACCESS_KEYS.has(key2)) invalidGrant(index, `access \u542B\u672A\u77E5\u952E ${JSON.stringify(key2)}`);
|
|
7913
8003
|
const { roles, signed_in: signedIn } = raw.access;
|
|
7914
8004
|
if (roles !== void 0 && (!Array.isArray(roles) || roles.length === 0 || roles.some((role) => typeof role !== "string" || role === ""))) {
|
|
@@ -7917,7 +8007,7 @@ function validatePageGrants(grants, context = { staticAddresses: [], fixedAddres
|
|
|
7917
8007
|
if (signedIn !== void 0 && typeof signedIn !== "boolean") invalidGrant(index, "access.signed_in \u5FC5\u987B\u662F\u5E03\u5C14\u503C");
|
|
7918
8008
|
}
|
|
7919
8009
|
if (raw.nav !== void 0) {
|
|
7920
|
-
if (!
|
|
8010
|
+
if (!isRecord9(raw.nav)) invalidGrant(index, "nav \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
7921
8011
|
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
8012
|
if (raw.nav.order !== void 0 && !Number.isFinite(raw.nav.order)) invalidGrant(index, "nav.order \u5FC5\u987B\u662F\u6570\u5B57");
|
|
7923
8013
|
if (shape.kind !== "exact" && shape.kind !== "all" && Object.keys(raw.nav).length > 0) {
|
|
@@ -8469,6 +8559,17 @@ var SomaRuntimeStore = class {
|
|
|
8469
8559
|
this.pages.set(digest, page);
|
|
8470
8560
|
return page;
|
|
8471
8561
|
}
|
|
8562
|
+
/** 删除产物文件(升级丢弃旧产物后清理用;调用方保证没有别的绑定引用它);返回是否真删了文件 */
|
|
8563
|
+
removeArtifact(digest) {
|
|
8564
|
+
if (!isRuntimeDigest(digest)) return false;
|
|
8565
|
+
this.pages.delete(digest);
|
|
8566
|
+
try {
|
|
8567
|
+
import_node_fs8.default.unlinkSync(artifactFilePath(this.dirs.artifacts, digest));
|
|
8568
|
+
return true;
|
|
8569
|
+
} catch {
|
|
8570
|
+
return false;
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8472
8573
|
hasArtifact(digest) {
|
|
8473
8574
|
return isRuntimeDigest(digest) && import_node_fs8.default.existsSync(artifactFilePath(this.dirs.artifacts, digest));
|
|
8474
8575
|
}
|
|
@@ -8544,6 +8645,8 @@ var SomaRuntimeStore = class {
|
|
|
8544
8645
|
return false;
|
|
8545
8646
|
}
|
|
8546
8647
|
}
|
|
8648
|
+
/** 本进程读绑定时因落盘格式版本不符而丢弃的旧绑定个数(启动汇总日志用) */
|
|
8649
|
+
legacyDiscarded = 0;
|
|
8547
8650
|
/** 严格删除:文件本来就不在返回 false(视为成功);其他失败(权限 / IO)原样抛出,不吞 */
|
|
8548
8651
|
removeBindingStrict(address) {
|
|
8549
8652
|
try {
|
|
@@ -8570,7 +8673,10 @@ var SomaRuntimeStore = class {
|
|
|
8570
8673
|
const stat = import_node_fs8.default.statSync(file);
|
|
8571
8674
|
const record3 = JSON.parse(import_node_fs8.default.readFileSync(file, "utf8"));
|
|
8572
8675
|
if (record3.schemaVersion === SOMA_RUNTIME_STORE_FORMAT && record3.binding) out.push({ binding: record3.binding, mtimeMs: stat.mtimeMs });
|
|
8573
|
-
else
|
|
8676
|
+
else {
|
|
8677
|
+
import_node_fs8.default.unlinkSync(file);
|
|
8678
|
+
this.legacyDiscarded += 1;
|
|
8679
|
+
}
|
|
8574
8680
|
} catch {
|
|
8575
8681
|
}
|
|
8576
8682
|
}
|
|
@@ -8657,6 +8763,9 @@ function ensureLoaded() {
|
|
|
8657
8763
|
state2.loadedRoots.add(layout.root);
|
|
8658
8764
|
const store = runtimeStore(layout);
|
|
8659
8765
|
const now = Date.now();
|
|
8766
|
+
const dropped = { format: 0, owner: 0 };
|
|
8767
|
+
const droppedDigests = /* @__PURE__ */ new Set();
|
|
8768
|
+
const legacyBefore = store.legacyDiscarded;
|
|
8660
8769
|
for (const read of store.listBindings()) {
|
|
8661
8770
|
const binding = read.binding;
|
|
8662
8771
|
if (binding.origin !== "inject" || binding.digest === null || binding.kind === "prefix") continue;
|
|
@@ -8674,12 +8783,15 @@ function ensureLoaded() {
|
|
|
8674
8783
|
const envelope = page.envelope ?? readFlatEnvelope(page.uiYaml);
|
|
8675
8784
|
if (page.format !== SOMA_PAGE_FORMAT_VERSION) {
|
|
8676
8785
|
store.removeBinding(binding.address);
|
|
8677
|
-
|
|
8786
|
+
dropped.format += 1;
|
|
8787
|
+
droppedDigests.add(binding.digest);
|
|
8678
8788
|
continue;
|
|
8679
8789
|
}
|
|
8680
8790
|
const guard = binding.owner === void 0 ? void 0 : state2.ownerGuards.get(binding.owner);
|
|
8681
8791
|
if (guard !== void 0 && !guard(binding.version)) {
|
|
8682
8792
|
store.removeBinding(binding.address);
|
|
8793
|
+
dropped.owner += 1;
|
|
8794
|
+
droppedDigests.add(binding.digest);
|
|
8683
8795
|
continue;
|
|
8684
8796
|
}
|
|
8685
8797
|
state2.generations.set(key, Math.max(state2.generations.get(key) ?? 0, binding.generation));
|
|
@@ -8692,6 +8804,14 @@ function ensureLoaded() {
|
|
|
8692
8804
|
mtimeMs: read.mtimeMs
|
|
8693
8805
|
});
|
|
8694
8806
|
}
|
|
8807
|
+
const legacy = store.legacyDiscarded - legacyBefore;
|
|
8808
|
+
dropped.format += legacy;
|
|
8809
|
+
if (dropped.format + dropped.owner > 0) {
|
|
8810
|
+
const live = new Set([...state2.entries.values()].flatMap((entry) => entry.binding.digest !== null ? [entry.binding.digest] : []));
|
|
8811
|
+
let cleaned = 0;
|
|
8812
|
+
for (const digest of droppedDigests) if (!live.has(digest) && store.removeArtifact(digest)) cleaned += 1;
|
|
8813
|
+
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`);
|
|
8814
|
+
}
|
|
8695
8815
|
if (process.env.SOMA_RUNTIME_GC !== "off") {
|
|
8696
8816
|
try {
|
|
8697
8817
|
const referenced = [...state2.entries.values()].flatMap((entry) => entry.binding.digest !== null ? [entry.binding.digest] : []);
|
|
@@ -8934,14 +9054,14 @@ function assertAddress(address, kinds) {
|
|
|
8934
9054
|
}
|
|
8935
9055
|
return { normalized: check.normalized, kind: check.kind };
|
|
8936
9056
|
}
|
|
8937
|
-
function
|
|
9057
|
+
function isRecord10(value2) {
|
|
8938
9058
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
8939
9059
|
}
|
|
8940
9060
|
function invalid(situation, problem, remedy) {
|
|
8941
9061
|
return runtimeError("CORE-RUNTIME-ADDRESS-INVALID", situation, problem, remedy);
|
|
8942
9062
|
}
|
|
8943
9063
|
function assertStandardPageShape(page, address) {
|
|
8944
|
-
if (!
|
|
9064
|
+
if (!isRecord10(page)) throw invalid(`\u6CE8\u5165 ${address}`, "\u8F7D\u8377\u4E0D\u662F\u5BF9\u8C61", "\u4F20 { format: 1, html, uiYaml, eventYaml?, styleYaml?, \u2026 }");
|
|
8945
9065
|
if (page.format !== SOMA_PAGE_FORMAT_VERSION) {
|
|
8946
9066
|
throw runtimeError(
|
|
8947
9067
|
"CORE-FORMAT-VERSION-UNSUPPORTED",
|
|
@@ -8950,12 +9070,12 @@ function assertStandardPageShape(page, address) {
|
|
|
8950
9070
|
"\u6309\u5F53\u524D\u4E3B\u7248\u672C\u4EA7\u51FA\u6807\u51C6\u683C\u5F0F"
|
|
8951
9071
|
);
|
|
8952
9072
|
}
|
|
8953
|
-
if (typeof page.html !== "string" || !(typeof page.uiYaml === "string" ||
|
|
9073
|
+
if (typeof page.html !== "string" || !(typeof page.uiYaml === "string" || isRecord10(page.uiYaml))) {
|
|
8954
9074
|
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
9075
|
}
|
|
8956
9076
|
for (const key of ["eventYaml", "styleYaml"]) {
|
|
8957
9077
|
const value2 = page[key];
|
|
8958
|
-
if (value2 !== void 0 && !(typeof value2 === "string" ||
|
|
9078
|
+
if (value2 !== void 0 && !(typeof value2 === "string" || isRecord10(value2))) {
|
|
8959
9079
|
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
9080
|
}
|
|
8961
9081
|
}
|
|
@@ -8983,7 +9103,7 @@ function checkOptions(address, options, now) {
|
|
|
8983
9103
|
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
9104
|
}
|
|
8985
9105
|
const source2 = options.source;
|
|
8986
|
-
if (source2 !== void 0 && (!
|
|
9106
|
+
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
9107
|
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
9108
|
}
|
|
8989
9109
|
}
|
|
@@ -9054,10 +9174,10 @@ function unbindRegistryPage(address) {
|
|
|
9054
9174
|
}
|
|
9055
9175
|
|
|
9056
9176
|
// core/server/runtime-space/dynamic-pages.ts
|
|
9057
|
-
var
|
|
9177
|
+
var import_js_yaml10 = __toESM(require("js-yaml"));
|
|
9058
9178
|
|
|
9059
9179
|
// core/server/registry/validation/declaration-safety-scan.ts
|
|
9060
|
-
var
|
|
9180
|
+
var import_js_yaml9 = __toESM(require("js-yaml"));
|
|
9061
9181
|
|
|
9062
9182
|
// core/shared/inert-data-element.ts
|
|
9063
9183
|
var ALLOWED_ATTRS = /* @__PURE__ */ new Set(["type", "id"]);
|
|
@@ -9179,7 +9299,7 @@ function hasDangerousSchemeInRawText(source2) {
|
|
|
9179
9299
|
function hasDangerousSchemeInYaml(source2) {
|
|
9180
9300
|
let document;
|
|
9181
9301
|
try {
|
|
9182
|
-
document =
|
|
9302
|
+
document = import_js_yaml9.default.load(source2);
|
|
9183
9303
|
} catch {
|
|
9184
9304
|
return hasDangerousSchemeInRawText(source2);
|
|
9185
9305
|
}
|
|
@@ -9360,7 +9480,7 @@ function isStandardDeclaration(declaration) {
|
|
|
9360
9480
|
|
|
9361
9481
|
// core/server/runtime-space/resolve.ts
|
|
9362
9482
|
var import_node_path13 = __toESM(require("node:path"));
|
|
9363
|
-
var
|
|
9483
|
+
var import_js_yaml12 = __toESM(require("js-yaml"));
|
|
9364
9484
|
var import_node_crypto7 = require("node:crypto");
|
|
9365
9485
|
|
|
9366
9486
|
// core/shared/published-page-route.ts
|
|
@@ -10351,7 +10471,7 @@ function digestTreeData(value2) {
|
|
|
10351
10471
|
}
|
|
10352
10472
|
|
|
10353
10473
|
// core/build/component-tree/artifact-codec.ts
|
|
10354
|
-
var
|
|
10474
|
+
var import_js_yaml11 = __toESM(require("js-yaml"));
|
|
10355
10475
|
var TREE_COMPILER_VERSION = "component-tree:1.0.0";
|
|
10356
10476
|
function fail2(path18) {
|
|
10357
10477
|
throw new SomaComponentTreeError({
|
|
@@ -10384,7 +10504,7 @@ function normalizeRuntimeConfig(input) {
|
|
|
10384
10504
|
const safe = record2(canonicalTreeData(input));
|
|
10385
10505
|
if (safe.styleYaml?.trim() || safe.styleConfig !== void 0 && safe.styleConfig !== null && Object.keys(record2(safe.styleConfig)).length > 0) fail2("style");
|
|
10386
10506
|
const objectUi = safe.uiConfig === void 0 ? void 0 : normalizeUi(safe.uiConfig, safe);
|
|
10387
|
-
const yamlUi = safe.uiYaml === void 0 ? void 0 : normalizeUi(
|
|
10507
|
+
const yamlUi = safe.uiYaml === void 0 ? void 0 : normalizeUi(import_js_yaml11.default.load(safe.uiYaml), safe);
|
|
10388
10508
|
const ui = same(objectUi, yamlUi, "ui");
|
|
10389
10509
|
if (ui === void 0) fail2("ui");
|
|
10390
10510
|
const timers = same(safe.timers, safe.timerConfig, "event.timers");
|
|
@@ -10548,7 +10668,7 @@ function message2(error) {
|
|
|
10548
10668
|
var import_node_path11 = __toESM(require("node:path"));
|
|
10549
10669
|
|
|
10550
10670
|
// core/shared/std-auth-scan.ts
|
|
10551
|
-
function
|
|
10671
|
+
function isRecord11(value2) {
|
|
10552
10672
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
10553
10673
|
}
|
|
10554
10674
|
function apiText(value2) {
|
|
@@ -10559,7 +10679,7 @@ function nameOf(entry, names) {
|
|
|
10559
10679
|
}
|
|
10560
10680
|
function scanApiRefsAt(context, node, names) {
|
|
10561
10681
|
const refs = [];
|
|
10562
|
-
if (!
|
|
10682
|
+
if (!isRecord11(node)) return refs;
|
|
10563
10683
|
for (const point of SOMA_STD_AUTH_SCAN.points) {
|
|
10564
10684
|
if (point.context !== context) continue;
|
|
10565
10685
|
const value2 = node[nameOf(point, names)];
|
|
@@ -10590,7 +10710,7 @@ function scanApiRefsAt(context, node, names) {
|
|
|
10590
10710
|
function readPath(value2, path18) {
|
|
10591
10711
|
let node = value2;
|
|
10592
10712
|
for (const segment of path18) {
|
|
10593
|
-
if (!
|
|
10713
|
+
if (!isRecord11(node)) return void 0;
|
|
10594
10714
|
node = node[segment];
|
|
10595
10715
|
}
|
|
10596
10716
|
return node;
|
|
@@ -10608,7 +10728,7 @@ function collectGrammarApiRefs(object, options) {
|
|
|
10608
10728
|
for (const ref of scanApiRefsAt(context, node, options.names)) {
|
|
10609
10729
|
out.push({ path: apiRefPath(base, ref, options), api: ref.api, ...ref.bare ? { bare: true } : {} });
|
|
10610
10730
|
}
|
|
10611
|
-
if (!
|
|
10731
|
+
if (!isRecord11(node)) return;
|
|
10612
10732
|
for (const container of SOMA_STD_AUTH_SCAN.containers) {
|
|
10613
10733
|
if (container.context !== context) continue;
|
|
10614
10734
|
const child = node[nameOf(container, options.names)];
|
|
@@ -10616,7 +10736,7 @@ function collectGrammarApiRefs(object, options) {
|
|
|
10616
10736
|
const target = container.contains;
|
|
10617
10737
|
const run = () => {
|
|
10618
10738
|
if (container.shape === "map") {
|
|
10619
|
-
if (!
|
|
10739
|
+
if (!isRecord11(child)) return;
|
|
10620
10740
|
const keys = options.sortFields === true ? Object.keys(child).sort() : Object.keys(child);
|
|
10621
10741
|
for (const name of keys) visit(target, child[name], options.keyPath(childBase, name), false);
|
|
10622
10742
|
} else if (Array.isArray(child)) {
|
|
@@ -12549,13 +12669,13 @@ var SOMA_GENERATION_ERROR_CODES = [
|
|
|
12549
12669
|
];
|
|
12550
12670
|
|
|
12551
12671
|
// core/shared/generation-diagnostics.ts
|
|
12552
|
-
function
|
|
12672
|
+
function isRecord12(value2) {
|
|
12553
12673
|
return typeof value2 === "object" && value2 !== null;
|
|
12554
12674
|
}
|
|
12555
12675
|
function isGenerationErrorShape(value2) {
|
|
12556
|
-
if (!
|
|
12676
|
+
if (!isRecord12(value2)) return false;
|
|
12557
12677
|
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" &&
|
|
12678
|
+
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
12679
|
}
|
|
12560
12680
|
function toPlainErrorShape(shape) {
|
|
12561
12681
|
return {
|
|
@@ -12569,7 +12689,7 @@ function toPlainErrorShape(shape) {
|
|
|
12569
12689
|
};
|
|
12570
12690
|
}
|
|
12571
12691
|
function readGenerationDiagnostics(error) {
|
|
12572
|
-
if (!
|
|
12692
|
+
if (!isRecord12(error)) return null;
|
|
12573
12693
|
const list2 = error.diagnostics;
|
|
12574
12694
|
if (Array.isArray(list2) && list2.length > 0 && list2.every(isGenerationErrorShape)) {
|
|
12575
12695
|
return list2.map(toPlainErrorShape);
|
|
@@ -13185,7 +13305,7 @@ function readHostFiles(hostDir) {
|
|
|
13185
13305
|
function pageLocaleBundle(page) {
|
|
13186
13306
|
if (page.locale === void 0 || page.locale.trim() === "") return void 0;
|
|
13187
13307
|
try {
|
|
13188
|
-
const parsed =
|
|
13308
|
+
const parsed = import_js_yaml12.default.load(page.locale);
|
|
13189
13309
|
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : void 0;
|
|
13190
13310
|
} catch {
|
|
13191
13311
|
return void 0;
|
|
@@ -13974,11 +14094,8 @@ function clearTailwindCompilerCache() {
|
|
|
13974
14094
|
// host-native/src/page-http.ts
|
|
13975
14095
|
var import_node_crypto9 = require("node:crypto");
|
|
13976
14096
|
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";
|
|
14097
|
+
|
|
14098
|
+
// host-native/src/page-payload-cache.ts
|
|
13982
14099
|
var MAX_CACHE_ENTRIES = 256;
|
|
13983
14100
|
var MAX_CACHE_BYTES = 64 * 1024 * 1024;
|
|
13984
14101
|
var PagePayloadBufferLRU = class {
|
|
@@ -14025,6 +14142,13 @@ var PagePayloadBufferCache = new PagePayloadBufferLRU();
|
|
|
14025
14142
|
function clearPagePayloadBufferCache() {
|
|
14026
14143
|
PagePayloadBufferCache.clear();
|
|
14027
14144
|
}
|
|
14145
|
+
|
|
14146
|
+
// host-native/src/page-http.ts
|
|
14147
|
+
function resolveLoginPath(assembly) {
|
|
14148
|
+
return resolveHostLoginPath(assembly);
|
|
14149
|
+
}
|
|
14150
|
+
var VARY_DEFAULT = "Cookie, Authorization";
|
|
14151
|
+
var VARY_ENCODING = "Cookie, Authorization, Accept-Encoding";
|
|
14028
14152
|
function weakEtag(body) {
|
|
14029
14153
|
return `W/"${(0, import_node_crypto9.createHash)("sha1").update(body).digest("hex").slice(0, 20)}"`;
|
|
14030
14154
|
}
|
|
@@ -14267,7 +14391,7 @@ function readPrewarmCompiled(layout) {
|
|
|
14267
14391
|
return { pages, meta };
|
|
14268
14392
|
}
|
|
14269
14393
|
|
|
14270
|
-
// core/server/
|
|
14394
|
+
// core/server/host/precompiled-manifest.ts
|
|
14271
14395
|
function validatePages(raw) {
|
|
14272
14396
|
if (!raw?.pages || !Array.isArray(raw.pages)) return null;
|
|
14273
14397
|
for (const page of raw.pages) {
|
|
@@ -14401,12 +14525,12 @@ function buildRouteTable(htmlFiles) {
|
|
|
14401
14525
|
}
|
|
14402
14526
|
|
|
14403
14527
|
// core/build/compiler/full-manifest-builder.ts
|
|
14404
|
-
var
|
|
14528
|
+
var import_js_yaml13 = __toESM(require("js-yaml"));
|
|
14405
14529
|
function precompileAll(inputs) {
|
|
14406
14530
|
const hostAppConfig = parseAppConfigYaml(inputs.appConfigYaml);
|
|
14407
14531
|
return {
|
|
14408
14532
|
routes: buildRouteTable(inputs.htmlFiles),
|
|
14409
|
-
locale:
|
|
14533
|
+
locale: import_js_yaml13.default.load(inputs.localeYaml) || {},
|
|
14410
14534
|
appConfig: hostAppConfig,
|
|
14411
14535
|
pages: inputs.pages.map((p) => precompilePage(p, {
|
|
14412
14536
|
hostAppConfig,
|
|
@@ -14448,7 +14572,7 @@ function precompilePage(p, context) {
|
|
|
14448
14572
|
}
|
|
14449
14573
|
|
|
14450
14574
|
// host-native/src/host-prepare.ts
|
|
14451
|
-
var import_host_config_paths5 = __toESM(
|
|
14575
|
+
var import_host_config_paths5 = __toESM(require_host_config_paths2());
|
|
14452
14576
|
var SOMA_SHELL_ROUTES_ENV = "SOMA_SHELL_ROUTES";
|
|
14453
14577
|
var coreIdentityMemo = null;
|
|
14454
14578
|
function coreCompilerIdentity() {
|