soma-core 2.1.6 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/soma.cjs +1 -1
- package/bin/soma.ts +64 -15
- package/core/server/api/dispatch-service-api.ts +212 -0
- package/core/server/api/load-host-service.ts +230 -56
- package/core/server/api/service-path.ts +79 -14
- package/core/server/engines/style/candidate-guard.ts +57 -0
- package/core/server/engines/style/index.ts +1 -1
- package/core/server/engines/style/tailwind-adapter.ts +83 -16
- package/core/server/host/source-packages.cjs +98 -30
- package/core/server/host/source-packages.ts +12 -5
- package/core/server/index.ts +39 -17
- package/core/server/infra/cache/ServerFileCache.ts +138 -25
- package/core/server/node.ts +32 -8
- package/dist/cli/soma.js +68 -14
- package/dist/host-native/aot-builder.cjs +852 -0
- package/dist/host-native/native-server.cjs +15341 -0
- package/dist/types/server/api/dispatch-service-api.d.ts +18 -0
- package/dist/types/server/api/load-host-service.d.ts +7 -2
- package/dist/types/server/api/service-path.d.ts +21 -1
- package/dist/types/server/engines/style/candidate-guard.d.ts +10 -0
- package/dist/types/server/engines/style/index.d.ts +1 -1
- package/dist/types/server/engines/style/tailwind-adapter.d.ts +12 -0
- package/dist/types/server/host/source-packages.d.cts +13 -1
- package/dist/types/server/host/source-packages.d.ts +7 -4
- package/dist/types/server/index.d.ts +18 -17
- package/dist/types/server/infra/cache/ServerFileCache.d.ts +28 -5
- package/dist/types/server/node.d.ts +10 -7
- package/host-native/bin/host-native.cjs +204 -0
- package/host-native/client/browser-entry.ts +499 -0
- package/{host-next/app → host-native/client}/page-access.ts +12 -0
- package/host-native/client/router-bridge.ts +120 -0
- package/host-native/src/aot-builder.ts +486 -0
- package/host-native/src/csp-headers.ts +75 -0
- package/host-native/src/host-prepare.ts +123 -0
- package/{host-next/app/soma/manifest/route.ts → host-native/src/manifest-http.ts} +10 -10
- package/host-native/src/native-server.ts +691 -0
- package/host-native/src/page-http.ts +223 -0
- package/host-native/src/public-packages.cjs +167 -0
- package/{host-next/app/api/soma-registry/[...path]/route.ts → host-native/src/registry-handler.ts} +17 -19
- package/{host-next → host-native}/src/shell-routes.cjs +23 -13
- package/host-native/src/static-file.ts +172 -0
- package/host-native/src/workspace.ts +185 -0
- package/{host-next/app → host-native/styles}/globals.css +2 -2
- package/package.json +12 -31
- package/tsconfig.json +1 -1
- package/host-next/app/SomaPageClient.tsx +0 -359
- package/host-next/app/[...path]/page.tsx +0 -22
- package/host-next/app/api/[...path]/route.ts +0 -98
- package/host-next/app/components/SomaHostPage.tsx +0 -128
- package/host-next/app/components/SomaHydrationShell.tsx +0 -20
- package/host-next/app/components/SomaPageClientBoundary.tsx +0 -13
- package/host-next/app/components/SomaPageForbidden.tsx +0 -19
- package/host-next/app/favicon.ico/route.ts +0 -13
- package/host-next/app/layout.tsx +0 -27
- package/host-next/app/page.tsx +0 -9
- package/host-next/app/router-bridge.ts +0 -42
- package/host-next/app/soma/[...path]/route.ts +0 -9
- package/host-next/app/soma/_shared/host-prepare.ts +0 -33
- package/host-next/app/soma/_shared/page-http.ts +0 -86
- package/host-next/app/soma/page/route.ts +0 -36
- package/host-next/app/soma/route.ts +0 -9
- package/host-next/app/soma-runtime/[...file]/route.ts +0 -21
- package/host-next/app/soma-runtime/_shared/static-file.ts +0 -89
- package/host-next/bin/host-next.cjs +0 -60
- package/host-next/instrumentation.ts +0 -18
- package/host-next/next-env.d.ts +0 -7
- package/host-next/next.config.js +0 -410
- package/host-next/proxy.ts +0 -43
- package/host-next/src/workspace.ts +0 -543
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { loadPrecompiledManifest, findPrecompiledPage } from '
|
|
2
|
-
import { listBindings } from '
|
|
3
|
-
import { resolveSomaRuntimeLayout } from '
|
|
4
|
-
import { SomaRuntimeStore } from '
|
|
5
|
-
import { normalizeAddress } from '
|
|
6
|
-
import type { SomaRuntimeBinding } from '
|
|
7
|
-
|
|
8
|
-
export const runtime = 'nodejs';
|
|
9
|
-
export const dynamic = 'force-dynamic';
|
|
1
|
+
import { loadPrecompiledManifest, findPrecompiledPage } from '../../core/server/page-assets';
|
|
2
|
+
import { listBindings } from '../../core/server/runtime-space';
|
|
3
|
+
import { resolveSomaRuntimeLayout } from '../../core/server/runtime-space/root';
|
|
4
|
+
import { SomaRuntimeStore } from '../../core/server/runtime-space/store';
|
|
5
|
+
import { normalizeAddress } from '../../core/shared/runtime-address';
|
|
6
|
+
import type { SomaRuntimeBinding } from '../../core/server/runtime-space/types';
|
|
10
7
|
|
|
11
8
|
/** 绑定的公开视图:只有地址、类别、来源类别、缓存、代次与摘要(不带 caller / source / 到期等产生方信息) */
|
|
12
9
|
function bindingView(binding: SomaRuntimeBinding) {
|
|
@@ -40,7 +37,7 @@ function findExactBinding(bindings: readonly SomaRuntimeBinding[], address: stri
|
|
|
40
37
|
* 客户端走 /soma/page)。命中后产物来自预热(`<root>/prewarm/`)。
|
|
41
38
|
* GET /soma/manifest?index=1 - 绑定清单 + 预热索引(地址 → 摘要)。
|
|
42
39
|
*/
|
|
43
|
-
export async function
|
|
40
|
+
export async function handleManifestGet(request: Request): Promise<Response> {
|
|
44
41
|
const hostDir = process.env.SOMA_HOST_DIR;
|
|
45
42
|
if (!hostDir) {
|
|
46
43
|
return Response.json({ error: 'SOMA_HOST_DIR not set' }, { status: 500 });
|
|
@@ -96,3 +93,6 @@ export async function GET(request: Request): Promise<Response> {
|
|
|
96
93
|
manifestVersion: '1.0.0',
|
|
97
94
|
});
|
|
98
95
|
}
|
|
96
|
+
|
|
97
|
+
// 别名导出,兼容原 route.ts 导出风格
|
|
98
|
+
export { handleManifestGet as GET };
|