@nextclaw/server 0.12.9 → 0.12.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/dist/index.d.ts +6 -0
- package/dist/index.js +25 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -473,6 +473,12 @@ type BootstrapRemoteState = "pending" | "ready" | "conflict" | "disabled" | "err
|
|
|
473
473
|
type BootstrapStatusView = {
|
|
474
474
|
phase: BootstrapPhase;
|
|
475
475
|
shellReadyAt?: string;
|
|
476
|
+
ncpAgent: {
|
|
477
|
+
state: BootstrapStageState;
|
|
478
|
+
startedAt?: string;
|
|
479
|
+
completedAt?: string;
|
|
480
|
+
error?: string;
|
|
481
|
+
};
|
|
476
482
|
pluginHydration: {
|
|
477
483
|
state: BootstrapStageState;
|
|
478
484
|
loadedPluginCount: number;
|
package/dist/index.js
CHANGED
|
@@ -478,6 +478,7 @@ function buildAppMetaView(options) {
|
|
|
478
478
|
function buildFallbackBootstrapStatus() {
|
|
479
479
|
return {
|
|
480
480
|
phase: "kernel-starting",
|
|
481
|
+
ncpAgent: { state: "pending" },
|
|
481
482
|
pluginHydration: {
|
|
482
483
|
state: "pending",
|
|
483
484
|
loadedPluginCount: 0,
|
|
@@ -2862,6 +2863,29 @@ function buildAssetContentUrl(assetUri) {
|
|
|
2862
2863
|
function encodeContentDispositionFileName(fileName) {
|
|
2863
2864
|
return encodeURIComponent(fileName).replace(/\*/g, "%2A");
|
|
2864
2865
|
}
|
|
2866
|
+
function inferMimeTypeFromFileName(fileName) {
|
|
2867
|
+
const normalized = fileName.trim().toLowerCase();
|
|
2868
|
+
if (normalized.endsWith(".mp3")) return "audio/mpeg";
|
|
2869
|
+
if (normalized.endsWith(".m4a")) return "audio/mp4";
|
|
2870
|
+
if (normalized.endsWith(".wav")) return "audio/wav";
|
|
2871
|
+
if (normalized.endsWith(".ogg")) return "audio/ogg";
|
|
2872
|
+
if (normalized.endsWith(".opus")) return "audio/opus";
|
|
2873
|
+
if (normalized.endsWith(".flac")) return "audio/flac";
|
|
2874
|
+
if (normalized.endsWith(".aac")) return "audio/aac";
|
|
2875
|
+
if (normalized.endsWith(".weba")) return "audio/webm";
|
|
2876
|
+
if (normalized.endsWith(".mp4") || normalized.endsWith(".m4v")) return "video/mp4";
|
|
2877
|
+
if (normalized.endsWith(".mov")) return "video/quicktime";
|
|
2878
|
+
if (normalized.endsWith(".webm")) return "video/webm";
|
|
2879
|
+
if (normalized.endsWith(".mkv")) return "video/x-matroska";
|
|
2880
|
+
if (normalized.endsWith(".avi")) return "video/x-msvideo";
|
|
2881
|
+
if (normalized.endsWith(".wmv")) return "video/x-ms-wmv";
|
|
2882
|
+
return null;
|
|
2883
|
+
}
|
|
2884
|
+
function resolveResponseMimeType(fileName, mimeType) {
|
|
2885
|
+
const normalized = mimeType.trim().toLowerCase();
|
|
2886
|
+
if (normalized.length > 0 && normalized !== "application/octet-stream") return normalized;
|
|
2887
|
+
return inferMimeTypeFromFileName(fileName) ?? "application/octet-stream";
|
|
2888
|
+
}
|
|
2865
2889
|
function toAssetView(record) {
|
|
2866
2890
|
return {
|
|
2867
2891
|
id: record.id,
|
|
@@ -2912,7 +2936,7 @@ var NcpAssetRoutesController = class {
|
|
|
2912
2936
|
if (!record || !contentPath) return c.json(err("NOT_FOUND", `asset not found: ${uri}`), 404);
|
|
2913
2937
|
const body = await readFile(contentPath);
|
|
2914
2938
|
return new Response(body, { headers: {
|
|
2915
|
-
"content-type": record.mimeType || "application/octet-stream",
|
|
2939
|
+
"content-type": resolveResponseMimeType(record.fileName, record.mimeType || "application/octet-stream"),
|
|
2916
2940
|
"content-disposition": `inline; filename*=UTF-8''${encodeContentDispositionFileName(record.fileName)}`
|
|
2917
2941
|
} });
|
|
2918
2942
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/server",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Nextclaw UI/API server.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@hono/node-server": "^1.13.3",
|
|
19
19
|
"hono": "^4.6.2",
|
|
20
20
|
"ws": "^8.18.0",
|
|
21
|
-
"@nextclaw/
|
|
22
|
-
"@nextclaw/ncp": "0.5.
|
|
23
|
-
"@nextclaw/
|
|
24
|
-
"@nextclaw/
|
|
25
|
-
"@nextclaw/
|
|
26
|
-
"@nextclaw/
|
|
21
|
+
"@nextclaw/mcp": "0.1.75",
|
|
22
|
+
"@nextclaw/ncp": "0.5.4",
|
|
23
|
+
"@nextclaw/runtime": "0.2.42",
|
|
24
|
+
"@nextclaw/ncp-http-agent-server": "0.3.16",
|
|
25
|
+
"@nextclaw/core": "0.12.10",
|
|
26
|
+
"@nextclaw/openclaw-compat": "1.0.10"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^20.17.6",
|