@junejs/server 1.0.0-dev.29 → 1.0.0-dev.42
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/dist/agent-compile.d.ts +8 -9
- package/dist/agent-discover.d.ts +3 -4
- package/dist/agent-durable.d.ts +38 -20
- package/dist/agent-durable.js +159 -13
- package/dist/agent-native.d.ts +15 -12
- package/dist/agent-native.js +72 -8
- package/dist/app.d.ts +4 -5
- package/dist/app.js +2 -1
- package/dist/blob.d.ts +4 -5
- package/dist/build.d.ts +6 -6
- package/dist/build.js +38 -7
- package/dist/client-bundle.d.ts +8 -9
- package/dist/{config-freeze-DwI-Rmvq.d.ts → config-freeze-ZWC_Qd4h.d.ts} +1 -1
- package/dist/config-freeze.d.ts +1 -1
- package/dist/config-loader.d.ts +3 -4
- package/dist/connection-auth.d.ts +8 -9
- package/dist/content.d.ts +9 -10
- package/dist/core-version.d.ts +3 -4
- package/dist/core-version.js +1 -1
- package/dist/css-modules-ambient.d.ts +2 -1
- package/dist/css-modules.d.ts +10 -11
- package/dist/css.d.ts +9 -10
- package/dist/d1-migrate.d.ts +6 -7
- package/dist/d1-migrate.js +3 -2
- package/dist/db.d.ts +2 -2
- package/dist/deploy.d.ts +3 -4
- package/dist/deploy.js +3 -2
- package/dist/dev-reload.d.ts +3 -4
- package/dist/dev.d.ts +4 -5
- package/dist/favicon.d.ts +16 -17
- package/dist/host.d.ts +5 -5
- package/dist/icon-letter.d.ts +2 -3
- package/dist/index.d.ts +4 -4
- package/dist/instrumentation.d.ts +2 -3
- package/dist/instrumentation.js +2 -1
- package/dist/island-registry.d.ts +6 -7
- package/dist/isolate-local.d.ts +4 -5
- package/dist/kv.d.ts +3 -4
- package/dist/llms-links.d.ts +8 -5
- package/dist/llms-links.js +31 -1
- package/dist/{manifest-gcNWqWoI.d.ts → manifest-DSNX4I-G.d.ts} +2 -2
- package/dist/manifest.d.ts +1 -1
- package/dist/negotiate.d.ts +4 -3
- package/dist/negotiate.js +24 -14
- package/dist/{pipeline-cCR6MGNK.d.ts → pipeline-BHUjBO0G.d.ts} +5 -1
- package/dist/pipeline.d.ts +2 -2
- package/dist/pipeline.js +260 -41
- package/dist/resources.d.ts +5 -6
- package/dist/router.d.ts +12 -13
- package/dist/rsc-build.d.ts +6 -7
- package/dist/rsc-bundle.d.ts +6 -7
- package/dist/rsc-manifest.d.ts +5 -6
- package/dist/rsc-runtime/flight-render-routes.d.ts +3 -4
- package/dist/rsc-runtime/flight-render.d.ts +2 -3
- package/dist/rsc-runtime/flight-to-html.d.ts +2 -3
- package/dist/rsc-runtime/flight-to-html.js +3 -2
- package/dist/rsc-runtime/rsdw-shims.d.ts +2 -1
- package/dist/segment.d.ts +4 -5
- package/dist/sqlite-driver.d.ts +10 -11
- package/dist/static-files.d.ts +4 -5
- package/dist/tsconfig-jsx.d.ts +4 -5
- package/dist/turn-events.d.ts +2 -3
- package/dist/web-manifest.d.ts +3 -4
- package/dist/web-manifest.js +2 -6
- package/dist/{worker-BkFHGtxp.d.ts → worker-Dv4l6Ybs.d.ts} +4 -2
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +35 -18
- package/package.json +5 -5
- package/src/agent-durable.ts +203 -21
- package/src/agent-native.ts +94 -7
- package/src/build.ts +67 -5
- package/src/core-version.ts +1 -1
- package/src/llms-links.ts +46 -1
- package/src/negotiate.ts +39 -15
- package/src/pipeline.ts +433 -45
- package/src/web-manifest.ts +2 -6
- package/src/worker.ts +55 -17
package/dist/sqlite-driver.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JuneDb } from "@junejs/core/resources";
|
|
2
2
|
//#region src/sqlite-driver.d.ts
|
|
3
|
-
type SyncStatement = {
|
|
3
|
+
export type SyncStatement = {
|
|
4
4
|
all(...params: unknown[]): unknown[];
|
|
5
5
|
get(...params: unknown[]): unknown;
|
|
6
6
|
run(...params: unknown[]): {
|
|
@@ -8,18 +8,17 @@ type SyncStatement = {
|
|
|
8
8
|
lastInsertRowid?: number | bigint;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
type SyncSqlite = {
|
|
11
|
+
export type SyncSqlite = {
|
|
12
12
|
query(sql: string): SyncStatement;
|
|
13
13
|
exec(sql: string): void;
|
|
14
14
|
close(): void;
|
|
15
15
|
};
|
|
16
|
-
declare const NODE_SQLITE_MIN_LTS = "22.13.0";
|
|
17
|
-
declare const NODE_SQLITE_MIN_ODD = "23.4.0";
|
|
18
|
-
declare function nodeSqliteHelp(nodeVersion: string): string;
|
|
19
|
-
declare function isNodeSqliteExperimentalWarning(type: unknown, message: string): boolean;
|
|
16
|
+
export declare const NODE_SQLITE_MIN_LTS = "22.13.0";
|
|
17
|
+
export declare const NODE_SQLITE_MIN_ODD = "23.4.0";
|
|
18
|
+
export declare function nodeSqliteHelp(nodeVersion: string): string;
|
|
19
|
+
export declare function isNodeSqliteExperimentalWarning(type: unknown, message: string): boolean;
|
|
20
20
|
type EmitWarning = (warning: string | Error, ...rest: unknown[]) => void;
|
|
21
|
-
declare function makeWarningFilter(original: EmitWarning): EmitWarning;
|
|
22
|
-
declare function openLocalSqliteSync(path: string): Promise<SyncSqlite>;
|
|
23
|
-
declare function openLocalSqlite(path: string): Promise<JuneDb>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { NODE_SQLITE_MIN_LTS, NODE_SQLITE_MIN_ODD, SyncSqlite, SyncStatement, isNodeSqliteExperimentalWarning, makeWarningFilter, nodeSqliteHelp, openLocalSqlite, openLocalSqliteSync };
|
|
21
|
+
export declare function makeWarningFilter(original: EmitWarning): EmitWarning;
|
|
22
|
+
export declare function openLocalSqliteSync(path: string): Promise<SyncSqlite>;
|
|
23
|
+
export declare function openLocalSqlite(path: string): Promise<JuneDb>;
|
|
24
|
+
//#endregion
|
package/dist/static-files.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/static-files.d.ts
|
|
2
|
-
declare const RESERVED_PREFIX = "_june";
|
|
3
|
-
declare function contentTypeFor(pathname: string): string;
|
|
4
|
-
declare function safeRelativePath(pathname: string): string | null;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { RESERVED_PREFIX, contentTypeFor, safeRelativePath };
|
|
2
|
+
export declare const RESERVED_PREFIX = "_june";
|
|
3
|
+
export declare function contentTypeFor(pathname: string): string;
|
|
4
|
+
export declare function safeRelativePath(pathname: string): string | null;
|
|
5
|
+
//#endregion
|
package/dist/tsconfig-jsx.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
//#region src/tsconfig-jsx.d.ts
|
|
2
|
-
declare const stripJsonc: (s: string) => string;
|
|
2
|
+
export declare const stripJsonc: (s: string) => string;
|
|
3
3
|
/** Read the app's tsconfig.json and return compilerOptions.jsxImportSource.
|
|
4
4
|
* Follows one level of `extends` so apps that inherit from a base tsconfig
|
|
5
5
|
* (e.g. "@kurajs/docs/tsconfig.kura.json") are handled correctly.
|
|
6
6
|
* Returns undefined when absent or unreadable. */
|
|
7
|
-
declare function appJsxImportSource(appRoot: string): Promise<string | undefined>;
|
|
7
|
+
export declare function appJsxImportSource(appRoot: string): Promise<string | undefined>;
|
|
8
8
|
/** The transform.jsx both bundles use: June's island JSX runtime, with the explicit importSource
|
|
9
9
|
* skipped when the app's tsconfig already declares it — rolldown then reads it from tsconfig
|
|
10
10
|
* silently instead of warning about the (same-value) override. */
|
|
11
|
-
declare function jsxTransform(appRoot: string): Promise<{
|
|
11
|
+
export declare function jsxTransform(appRoot: string): Promise<{
|
|
12
12
|
runtime: "automatic";
|
|
13
13
|
importSource?: string;
|
|
14
14
|
}>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { appJsxImportSource, jsxTransform, stripJsonc };
|
|
15
|
+
//#endregion
|
package/dist/turn-events.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentSession, TurnEvent } from "@junejs/core/agent-runtime";
|
|
2
2
|
//#region src/turn-events.d.ts
|
|
3
|
-
declare function observeTurnEvents(session: AgentSession, turnId: string): AsyncIterable<TurnEvent>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { observeTurnEvents };
|
|
3
|
+
export declare function observeTurnEvents(session: AgentSession, turnId: string): AsyncIterable<TurnEvent>;
|
|
4
|
+
//#endregion
|
package/dist/web-manifest.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DocumentConfig } from "@junejs/core/document";
|
|
2
2
|
//#region src/web-manifest.d.ts
|
|
3
|
-
declare
|
|
4
|
-
declare function webManifest(config: DocumentConfig): string;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { shortName, webManifest };
|
|
3
|
+
export declare const shortName: (site: DocumentConfig["site"]) => string | undefined;
|
|
4
|
+
export declare function webManifest(config: DocumentConfig): string;
|
|
5
|
+
//#endregion
|
package/dist/web-manifest.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { siteShortName } from "@junejs/core/config";
|
|
1
2
|
import { resolveThemeColor } from "@junejs/core/document";
|
|
2
3
|
//#region src/web-manifest.ts
|
|
3
|
-
|
|
4
|
-
if (site.shortName) return site.shortName;
|
|
5
|
-
const name = site.name?.trim();
|
|
6
|
-
if (!name) return void 0;
|
|
7
|
-
return name.split(/\s+[—–|-]\s+|:\s+/)[0].trim() || name;
|
|
8
|
-
}
|
|
4
|
+
const shortName = (site) => siteShortName(site);
|
|
9
5
|
function webManifest(config) {
|
|
10
6
|
const base = config.basePath ?? "";
|
|
11
7
|
const theme = resolveThemeColor(config);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as ResourceHandler, n as LayoutComponent, r as LoadingComponent, t as ExtraHandler } from "./pipeline-
|
|
1
|
+
import { l as ResourceHandler, n as LayoutComponent, r as LoadingComponent, t as ExtraHandler } from "./pipeline-BHUjBO0G.js";
|
|
2
2
|
import { Channel, ChannelFactory } from "@junejs/core/agent-config";
|
|
3
3
|
import { BrandedRoute } from "@junejs/core/route";
|
|
4
4
|
import { AgentConfig } from "@junejs/core/config";
|
|
@@ -40,7 +40,9 @@ type WorkerManifest = {
|
|
|
40
40
|
resources?: (env?: unknown) => Promise<Resources> | Resources;
|
|
41
41
|
services?: (env?: unknown) => unknown;
|
|
42
42
|
};
|
|
43
|
-
declare function createWorker(manifest: WorkerManifest
|
|
43
|
+
declare function createWorker(manifest: WorkerManifest, opts?: {
|
|
44
|
+
staticBuild?: boolean;
|
|
45
|
+
}): {
|
|
44
46
|
fetch(request: Request, env?: unknown, ctx?: WorkerExecutionContext): Promise<Response>;
|
|
45
47
|
};
|
|
46
48
|
type AssetEnv = {
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as withDenoAssets, i as withAssets, n as WorkerManifest, r as createWorker, t as WorkerExecutionContext } from "./worker-
|
|
1
|
+
import { a as withDenoAssets, i as withAssets, n as WorkerManifest, r as createWorker, t as WorkerExecutionContext } from "./worker-Dv4l6Ybs.js";
|
|
2
2
|
export { WorkerExecutionContext, WorkerManifest, createWorker, withAssets, withDenoAssets };
|
package/dist/worker.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { durableAgentSurface, durableChannelSurface } from "./agent-durable.js";
|
|
2
|
+
import { acceptTarget } from "./negotiate.js";
|
|
2
3
|
import { createPipeline } from "./pipeline.js";
|
|
3
4
|
import { RESERVED_PREFIX, contentTypeFor, safeRelativePath } from "./static-files.js";
|
|
4
5
|
//#region src/worker.ts
|
|
@@ -45,7 +46,7 @@ function compilePattern(pattern) {
|
|
|
45
46
|
names
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
function createWorker(manifest) {
|
|
49
|
+
function createWorker(manifest, opts = {}) {
|
|
49
50
|
const dynamic = (manifest.dynamicRoutes ?? []).map((d) => ({
|
|
50
51
|
...compilePattern(d.pattern),
|
|
51
52
|
def: d.def,
|
|
@@ -92,6 +93,7 @@ function createWorker(manifest) {
|
|
|
92
93
|
agentSurface,
|
|
93
94
|
i18n: manifest.i18n,
|
|
94
95
|
routeList: () => routeList,
|
|
96
|
+
staticBuild: opts.staticBuild,
|
|
95
97
|
earlyHints: manifest.earlyHints,
|
|
96
98
|
htmlCacheControl: manifest.htmlCacheControl,
|
|
97
99
|
notFoundComponent: manifest.notFound,
|
|
@@ -155,28 +157,41 @@ function createWorker(manifest) {
|
|
|
155
157
|
} };
|
|
156
158
|
}
|
|
157
159
|
const estimateTokens = (s) => String(Math.ceil(s.length / 4));
|
|
160
|
+
function varyAccept(headers) {
|
|
161
|
+
const vary = headers.get("vary");
|
|
162
|
+
if (!vary) headers.set("vary", "accept");
|
|
163
|
+
else if (vary.trim() !== "*" && !vary.split(",").some((v) => v.trim().toLowerCase() === "accept")) headers.set("vary", `${vary}, accept`);
|
|
164
|
+
}
|
|
158
165
|
function withAssets(pipeline, opts = {}) {
|
|
159
166
|
return { async fetch(request, env, ctx) {
|
|
160
167
|
const assets = env?.ASSETS;
|
|
161
168
|
const url = new URL(request.url);
|
|
162
169
|
const isPagePath = !/\.[a-z0-9]+$/i.test(url.pathname);
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
const target = isPagePath ? acceptTarget(request.headers.get("accept") ?? "") : null;
|
|
171
|
+
if (target && (request.method === "GET" || request.method === "HEAD")) {
|
|
172
|
+
if (assets && request.method === "GET" && (target === "md" || target === "json")) {
|
|
173
|
+
const base = url.pathname === "/" ? "/index" : url.pathname.replace(/\/+$/, "");
|
|
174
|
+
const assetUrl = new URL(url);
|
|
175
|
+
assetUrl.pathname = `${base}.${target}`;
|
|
176
|
+
const a = await assets.fetch(new Request(assetUrl.toString(), { headers: request.headers }));
|
|
177
|
+
if (a.ok) {
|
|
178
|
+
const headers = new Headers(a.headers);
|
|
179
|
+
if (opts.link) headers.set("link", opts.link);
|
|
180
|
+
varyAccept(headers);
|
|
181
|
+
if (target === "json") return new Response(a.body, {
|
|
182
|
+
status: 200,
|
|
183
|
+
headers
|
|
184
|
+
});
|
|
185
|
+
const body = await a.text();
|
|
186
|
+
headers.set("content-type", "text/markdown; charset=utf-8");
|
|
187
|
+
headers.set("x-markdown-tokens", estimateTokens(body));
|
|
188
|
+
return new Response(body, {
|
|
189
|
+
status: 200,
|
|
190
|
+
headers
|
|
191
|
+
});
|
|
192
|
+
}
|
|
179
193
|
}
|
|
194
|
+
return pipeline.fetch(request, env, ctx);
|
|
180
195
|
}
|
|
181
196
|
if (assets && (request.method === "GET" || request.method === "HEAD")) {
|
|
182
197
|
const a = await assets.fetch(request);
|
|
@@ -184,10 +199,12 @@ function withAssets(pipeline, opts = {}) {
|
|
|
184
199
|
const ct = a.headers.get("content-type") ?? "";
|
|
185
200
|
const addLink = !!opts.link && ct.includes("text/html") && !a.headers.has("link");
|
|
186
201
|
const immutable = /\.[a-f0-9]{8,}\.(css|js)$/.test(url.pathname);
|
|
187
|
-
|
|
202
|
+
const negotiated = isPagePath && ct.includes("text/html");
|
|
203
|
+
if (addLink || immutable || negotiated) {
|
|
188
204
|
const headers = new Headers(a.headers);
|
|
189
205
|
if (addLink) headers.set("link", opts.link);
|
|
190
206
|
if (immutable) headers.set("cache-control", "public, max-age=31536000, immutable");
|
|
207
|
+
if (negotiated) varyAccept(headers);
|
|
191
208
|
return new Response(a.body, {
|
|
192
209
|
status: a.status,
|
|
193
210
|
headers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junejs/server",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.42",
|
|
4
4
|
"description": "June host adapters + dev server. Host-coupled; depends on the pure @junejs/core contract layer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -136,14 +136,14 @@
|
|
|
136
136
|
"@momiji-rs/sparkdown": "^0.0.4",
|
|
137
137
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
138
138
|
"lightningcss": "^1.27.0",
|
|
139
|
-
"oxc-parser": "^0.
|
|
139
|
+
"oxc-parser": "^0.151.0",
|
|
140
140
|
"rolldown": "^1.1.0"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@junejs/core": ">=0.2.0-dev.
|
|
143
|
+
"@junejs/core": ">=0.2.0-dev.63",
|
|
144
144
|
"react": "^19.2.0",
|
|
145
145
|
"react-dom": "^19.2.0",
|
|
146
|
-
"react-server-dom-webpack": "19.
|
|
146
|
+
"react-server-dom-webpack": "19.3.0",
|
|
147
147
|
"pg": "^8.0.0",
|
|
148
148
|
"mysql2": "^3.0.0",
|
|
149
149
|
"@libsql/client": "^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0",
|
|
@@ -176,6 +176,6 @@
|
|
|
176
176
|
"@types/pg": "^8.20.0",
|
|
177
177
|
"mysql2": "^3.22.5",
|
|
178
178
|
"pg": "^8.21.0",
|
|
179
|
-
"react-server-dom-webpack": "19.
|
|
179
|
+
"react-server-dom-webpack": "19.3.0"
|
|
180
180
|
}
|
|
181
181
|
}
|