feat(webui): support document attachments with ingress safeguards (#4771)

* feat: support document attachments in webui

* fix(webui): normalize document attachment MIME

* refactor(webui): move attachment policy out of channel

* fix(webui): reject oversized attachments before send

* fix(webui): align Portuguese attachment errors

* refactor(webui): separate ingress and transport limits

* fix(webui): reject malformed attachment payloads
This commit is contained in:
chengyongru
2026-07-14 14:47:42 +08:00
committed by GitHub
parent b2759e8a6b
commit b7048cf76a
36 changed files with 1398 additions and 332 deletions
+5
View File
@@ -38,6 +38,7 @@ import { deriveTitle } from "@/lib/format";
import { NanobotClient } from "@/lib/nanobot-client";
import { ClientProvider, useClient } from "@/providers/ClientProvider";
import type {
BootstrapResponse,
ChatSummary,
RuntimeSurface,
PairingRequestInfo,
@@ -71,6 +72,7 @@ type BootState =
token: string;
tokenExpiresAt: number;
modelName: string | null;
ingressLimits: BootstrapResponse["limits"] | null;
runtimeSurface: RuntimeSurface;
};
@@ -801,6 +803,7 @@ export default function App() {
token: boot.api_token,
tokenExpiresAt,
modelName: boot.model_name ?? current.modelName,
ingressLimits: boot.limits ?? current.ingressLimits,
runtimeSurface,
}
: current,
@@ -842,6 +845,7 @@ export default function App() {
token: boot.api_token,
tokenExpiresAt: bootstrapTokenExpiresAt(boot.expires_in),
modelName: boot.model_name ?? null,
ingressLimits: boot.limits ?? null,
runtimeSurface,
});
} catch (e) {
@@ -964,6 +968,7 @@ export default function App() {
client={state.client}
token={state.token}
modelName={state.modelName}
ingressLimits={state.ingressLimits}
>
<Shell
runtimeSurface={state.runtimeSurface}