veryfront 0.1.867 → 0.1.869
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/esm/cli/commands/demo/steps.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +6 -1
- package/esm/cli/commands/start/command.d.ts +12 -0
- package/esm/cli/commands/start/command.d.ts.map +1 -1
- package/esm/cli/commands/start/command.js +32 -6
- package/esm/cli/shared/runtime-auth.d.ts +12 -0
- package/esm/cli/shared/runtime-auth.d.ts.map +1 -0
- package/esm/cli/shared/runtime-auth.js +34 -0
- package/esm/deno.js +1 -1
- package/esm/src/agent/ag-ui/handler.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/handler.js +17 -5
- package/esm/src/agent/react/index.d.ts +1 -1
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +2 -10
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +3 -4
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +16 -107
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +7 -12
- package/esm/src/agent/runtime/model-resolution.d.ts +2 -2
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-resolution.js +59 -13
- package/esm/src/agent/types.d.ts +2 -2
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/embedding/upload-handler.d.ts +2 -1
- package/esm/src/embedding/upload-handler.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.js +2 -1
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +2 -12
- package/esm/src/integrations/feature-flags.d.ts.map +1 -1
- package/esm/src/integrations/feature-flags.js +2 -10
- package/esm/src/platform/compat/dns.d.ts +6 -0
- package/esm/src/platform/compat/dns.d.ts.map +1 -0
- package/esm/src/platform/compat/dns.js +34 -0
- package/esm/src/platform/compat/opaque-dependency-versions.d.ts +1 -1
- package/esm/src/platform/compat/opaque-dependency-versions.js +1 -1
- package/esm/src/platform/index.d.ts +1 -0
- package/esm/src/platform/index.d.ts.map +1 -1
- package/esm/src/platform/index.js +2 -0
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/local/env.d.ts +3 -0
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +31 -0
- package/esm/src/provider/local/local-engine.d.ts +38 -5
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +191 -19
- package/esm/src/provider/local/model-catalog.d.ts +8 -4
- package/esm/src/provider/local/model-catalog.d.ts.map +1 -1
- package/esm/src/provider/local/model-catalog.js +36 -41
- package/esm/src/provider/local/model-runtime-adapter.js +5 -5
- package/esm/src/provider/model-registry.d.ts +2 -12
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +4 -92
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +3 -31
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +1 -2
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +5 -11
- package/esm/src/react/components/chat/chat/index.d.ts +2 -4
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +4 -6
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -1
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-with-sidebar.js +0 -1
- package/esm/src/react/components/chat/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.d.ts +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.js +4 -17
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +3 -54
- package/esm/src/tool/project-scoped-remote-tools.d.ts.map +1 -1
- package/esm/src/tool/project-scoped-remote-tools.js +17 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/worker/dynamic-run-entrypoint.d.ts +3 -2
- package/esm/src/workflow/worker/dynamic-run-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/run-entrypoint.d.ts +6 -4
- package/esm/src/workflow/worker/run-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/run-entrypoint.js +3 -2
- package/package.json +2 -2
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +0 -18
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +0 -62
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +0 -44
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/types.js +0 -4
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +0 -30
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.js +0 -66
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts +0 -8
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.js +0 -97
- package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts +0 -9
- package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/components/upgrade-cta.js +0 -35
|
@@ -12,21 +12,14 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
|
-
import { createError,
|
|
15
|
+
import { createError, toError } from "../errors/veryfront-error.js";
|
|
16
16
|
import { getAnthropicEnvConfig, getGoogleGenAIEnvConfig, getMistralEnvConfig, getOpenAIEnvConfig, } from "../config/env.js";
|
|
17
17
|
import { ensureBuiltinLLMProviders } from "../extensions/builtin-extensions.js";
|
|
18
|
-
import { tryResolve } from "../extensions/contracts.js";
|
|
19
|
-
import { LLMProviderRegistryName } from "../extensions/llm/index.js";
|
|
20
18
|
import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
|
|
21
|
-
import { serverLogger } from "../utils/index.js";
|
|
22
|
-
import { DEFAULT_LOCAL_MODEL } from "./local/model-catalog.js";
|
|
23
19
|
import { createLocalModel } from "./local/model-runtime-adapter.js";
|
|
24
|
-
import { throwIfLocalAIDisabled } from "./local/env.js";
|
|
25
20
|
import { verifyLocalRuntime } from "./local/local-engine.js";
|
|
26
|
-
import { getDefaultVeryfrontCloudModel, isVeryfrontCloudEnabled, } from "../platform/cloud/resolver.js";
|
|
27
21
|
import { createVeryfrontCloudModel } from "./veryfront-cloud/provider.js";
|
|
28
22
|
import { getModelRuntimeId, hasLocalModelRuntimeMarker } from "./runtime-inspection.js";
|
|
29
|
-
const localLogger = serverLogger.component("local-llm");
|
|
30
23
|
const manager = new ProjectScopedRegistryManager("model-provider");
|
|
31
24
|
let autoInitialized = false;
|
|
32
25
|
/**
|
|
@@ -163,69 +156,6 @@ function autoInitializeFromEnv() {
|
|
|
163
156
|
});
|
|
164
157
|
}
|
|
165
158
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Default cloud models to try when auto-upgrading from a local model.
|
|
168
|
-
* Ordered by preference: Veryfront Cloud → Anthropic → OpenAI → Google.
|
|
169
|
-
*
|
|
170
|
-
* NOTE: model IDs are hardcoded — update when default models change.
|
|
171
|
-
*/
|
|
172
|
-
const CLOUD_UPGRADE_CANDIDATES = [
|
|
173
|
-
{
|
|
174
|
-
provider: "veryfront-cloud",
|
|
175
|
-
model: () => getDefaultVeryfrontCloudModel().replace(/^veryfront-cloud\//, ""),
|
|
176
|
-
hasKey: () => isVeryfrontCloudEnabled(),
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
provider: "anthropic",
|
|
180
|
-
model: "claude-sonnet-4-20250514",
|
|
181
|
-
hasKey: () => !!getAnthropicEnvConfig().apiKey,
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
provider: "openai",
|
|
185
|
-
model: "gpt-4o-mini",
|
|
186
|
-
hasKey: () => !!getOpenAIEnvConfig().apiKey,
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
provider: "google",
|
|
190
|
-
model: "gemini-2.0-flash",
|
|
191
|
-
hasKey: () => !!getGoogleGenAIEnvConfig().apiKey,
|
|
192
|
-
},
|
|
193
|
-
];
|
|
194
|
-
function isMissingProviderConfiguration(errorData) {
|
|
195
|
-
if (errorData?.type !== "config")
|
|
196
|
-
return false;
|
|
197
|
-
const message = errorData.message.toLowerCase();
|
|
198
|
-
return message.includes("not set") ||
|
|
199
|
-
message.includes("missing credentials") ||
|
|
200
|
-
message.includes("missing configuration");
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Find the first cloud provider with a valid API key.
|
|
204
|
-
*
|
|
205
|
-
* Returns a "provider/model" string that can be passed to `resolveModel`,
|
|
206
|
-
* or `null` if no cloud provider is available.
|
|
207
|
-
*
|
|
208
|
-
* This is intentionally a **query** — it does NOT resolve the model.
|
|
209
|
-
* The caller (agent runtime) decides whether to use it.
|
|
210
|
-
*/
|
|
211
|
-
export function findAvailableCloudModel() {
|
|
212
|
-
autoInitializeFromEnv();
|
|
213
|
-
const registry = tryResolve(LLMProviderRegistryName);
|
|
214
|
-
for (const { provider, model, hasKey } of CLOUD_UPGRADE_CANDIDATES) {
|
|
215
|
-
if (!hasKey())
|
|
216
|
-
continue;
|
|
217
|
-
if (!manager.has(provider))
|
|
218
|
-
continue;
|
|
219
|
-
if (registry && !registry.has(provider) && !isBuiltinProvider(provider))
|
|
220
|
-
continue;
|
|
221
|
-
const resolvedModel = typeof model === "function" ? model() : model;
|
|
222
|
-
return `${provider}/${resolvedModel}`;
|
|
223
|
-
}
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
function isBuiltinProvider(provider) {
|
|
227
|
-
return provider === "google" || provider === "veryfront-cloud";
|
|
228
|
-
}
|
|
229
159
|
/**
|
|
230
160
|
* Resolve a "provider/model" string to a framework-compatible model runtime.
|
|
231
161
|
*
|
|
@@ -261,25 +191,7 @@ export function resolveModel(modelString) {
|
|
|
261
191
|
message: `Model provider "${providerName}" not registered. Available: ${available}`,
|
|
262
192
|
}));
|
|
263
193
|
}
|
|
264
|
-
|
|
265
|
-
return factory(modelId);
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
// Auto-fallback: when a cloud provider fails due to missing API key,
|
|
269
|
-
// transparently switch to the local model so chat works out of the box.
|
|
270
|
-
const errorData = fromError(error);
|
|
271
|
-
if (isMissingProviderConfiguration(errorData) &&
|
|
272
|
-
providerName !== "local" &&
|
|
273
|
-
manager.has("local")) {
|
|
274
|
-
// Check if local AI is explicitly disabled (e.g., for testing)
|
|
275
|
-
throwIfLocalAIDisabled();
|
|
276
|
-
localLogger.info(`⚡ "${providerName}" unavailable (missing credentials or configuration). ` +
|
|
277
|
-
"Falling back to local model.");
|
|
278
|
-
const localFactory = manager.get("local");
|
|
279
|
-
return localFactory(DEFAULT_LOCAL_MODEL);
|
|
280
|
-
}
|
|
281
|
-
throw error;
|
|
282
|
-
}
|
|
194
|
+
return factory(modelId);
|
|
283
195
|
}
|
|
284
196
|
/**
|
|
285
197
|
* Check if a model provider is registered (project-scoped or shared).
|
|
@@ -301,8 +213,8 @@ export function getRegisteredModelProviders() {
|
|
|
301
213
|
* For real local-engine models (created by `createLocalModel()`) this
|
|
302
214
|
* eagerly loads the ONNX pipeline to surface `no_ai_available` errors
|
|
303
215
|
* **before** the HTTP response stream is created. Must happen before the
|
|
304
|
-
* ReadableStream so the chat handler can return a proper 503
|
|
305
|
-
*
|
|
216
|
+
* ReadableStream so the chat handler can return a proper 503 rather than a
|
|
217
|
+
* 200 with an in-band SSE error.
|
|
306
218
|
*
|
|
307
219
|
* Uses the `_isVfLocalModel` marker set by `createLocalModel()` to
|
|
308
220
|
* distinguish real local-engine models from mock/custom providers that
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "../../../../../../react/react.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { InferenceMode } from "../../../../../agent/react/index.js";
|
|
3
3
|
/** Props accepted by inference badge. */
|
|
4
4
|
export interface InferenceBadgeProps {
|
|
5
5
|
inferenceMode: InferenceMode;
|
|
6
|
-
browserStatus?: BrowserInferenceStatus | null;
|
|
7
6
|
}
|
|
8
7
|
/** Render inference badge. */
|
|
9
|
-
export declare function InferenceBadge({ inferenceMode
|
|
8
|
+
export declare function InferenceBadge({ inferenceMode }: InferenceBadgeProps): React.ReactElement | null;
|
|
10
9
|
//# sourceMappingURL=inference-badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/inference-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAC1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"inference-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/inference-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,8BAA8B;AAC9B,wBAAgB,cAAc,CAAC,EAAE,aAAa,EAAE,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAShG"}
|
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
import * as React from "../../../../../../react/react.js";
|
|
2
2
|
/** Render inference badge. */
|
|
3
|
-
export function InferenceBadge({ inferenceMode
|
|
3
|
+
export function InferenceBadge({ inferenceMode }) {
|
|
4
4
|
if (inferenceMode === "cloud")
|
|
5
5
|
return null;
|
|
6
|
-
let label;
|
|
7
|
-
let dotColor;
|
|
8
|
-
let showProgress = false;
|
|
9
|
-
if (inferenceMode === "server-local") {
|
|
10
|
-
label = "Running locally";
|
|
11
|
-
dotColor = "bg-green-500";
|
|
12
|
-
}
|
|
13
|
-
else if (browserStatus === "downloading-model") {
|
|
14
|
-
label = "Downloading model...";
|
|
15
|
-
dotColor = "bg-amber-500";
|
|
16
|
-
showProgress = true;
|
|
17
|
-
}
|
|
18
|
-
else if (browserStatus === "loading-runtime") {
|
|
19
|
-
label = "Loading runtime...";
|
|
20
|
-
dotColor = "bg-amber-500";
|
|
21
|
-
}
|
|
22
|
-
else if (browserStatus === "generating") {
|
|
23
|
-
label = "Running in browser";
|
|
24
|
-
dotColor = "bg-green-500";
|
|
25
|
-
}
|
|
26
|
-
else if (browserStatus === "error") {
|
|
27
|
-
label = "Local model failed";
|
|
28
|
-
dotColor = "bg-red-500";
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
label = "Running locally";
|
|
32
|
-
dotColor = "bg-green-500";
|
|
33
|
-
}
|
|
34
6
|
return (React.createElement("div", { className: "flex items-center gap-1.5 px-3 py-1 text-xs text-[var(--muted-foreground)]" },
|
|
35
|
-
React.createElement("span", { className:
|
|
36
|
-
React.createElement("span", null,
|
|
7
|
+
React.createElement("span", { className: "size-1.5 rounded-full bg-green-500" }),
|
|
8
|
+
React.createElement("span", null, "Running locally")));
|
|
37
9
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module react/components/chat/composition/chat-message-list
|
|
8
8
|
*/
|
|
9
9
|
import * as React from "../../../../../../react/react.js";
|
|
10
|
-
import type { BranchInfo,
|
|
10
|
+
import type { BranchInfo, ChatDynamicToolPart, ChatMessage, ChatToolPart, InferenceMode } from "../../../../../agent/react/index.js";
|
|
11
11
|
import type { ChatTheme } from "../../theme.js";
|
|
12
12
|
import type { Source } from "../components/sources.js";
|
|
13
13
|
import type { FeedbackValue } from "../components/message-feedback.js";
|
|
@@ -25,7 +25,6 @@ export interface ChatMessageListProps {
|
|
|
25
25
|
showScrollButton?: boolean;
|
|
26
26
|
onSourceClick?: (source: Source, index: number) => void;
|
|
27
27
|
inferenceMode?: InferenceMode;
|
|
28
|
-
browserStatus?: BrowserInferenceStatus | null;
|
|
29
28
|
editMessage?: (messageId: string, newText: string) => Promise<void>;
|
|
30
29
|
getBranches?: (messageId: string) => BranchInfo;
|
|
31
30
|
switchBranch?: (messageId: string, branchIndex: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA;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AAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gCAAgC;AAChC,eAAO,MAAM,eAAe,6FA0G3B,CAAC"}
|
|
@@ -23,7 +23,7 @@ import { MessageFeedback } from "../components/message-feedback.js";
|
|
|
23
23
|
import { StepIndicator } from "../components/step-indicator.js";
|
|
24
24
|
import { ModelAvatar } from "./model-avatar.js";
|
|
25
25
|
/** Render chat message list. */
|
|
26
|
-
export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading, theme, renderMessage, renderTool, model, showMessageActions = true, showSources = false, showSteps = false, showScrollButton = false, onSourceClick, inferenceMode: _inferenceMode,
|
|
26
|
+
export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading, theme, renderMessage, renderTool, model, showMessageActions = true, showSources = false, showSteps = false, showScrollButton = false, onSourceClick, inferenceMode: _inferenceMode, editMessage, getBranches, switchBranch, onFeedback, className, children, }, ref) {
|
|
27
27
|
const messagesEndRef = React.useRef(null);
|
|
28
28
|
const [editingMessageId, setEditingMessageId] = React.useState(null);
|
|
29
29
|
const [feedbackMap, setFeedbackMap] = React.useState({});
|
|
@@ -48,16 +48,10 @@ export const ChatMessageList = React.forwardRef(function ChatMessageList({ messa
|
|
|
48
48
|
}),
|
|
49
49
|
isLoading && messages[messages.length - 1]?.role !== "assistant" && (React.createElement("div", { className: "flex items-start gap-3" },
|
|
50
50
|
React.createElement(ModelAvatar, { model: model }),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
? "Downloading model..."
|
|
56
|
-
: "Loading runtime...")))
|
|
57
|
-
: (React.createElement("div", { className: "flex gap-1.5 items-center py-3" },
|
|
58
|
-
React.createElement("span", { className: cn(theme?.loading) }),
|
|
59
|
-
React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.15s" } }),
|
|
60
|
-
React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.3s" } }))))),
|
|
51
|
+
React.createElement("div", { className: "flex gap-1.5 items-center py-3" },
|
|
52
|
+
React.createElement("span", { className: cn(theme?.loading) }),
|
|
53
|
+
React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.15s" } }),
|
|
54
|
+
React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.3s" } })))),
|
|
61
55
|
React.createElement("div", { ref: messagesEndRef })),
|
|
62
56
|
children,
|
|
63
57
|
showScrollButton && (React.createElement(ConversationScrollButton, { onClick: () => messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) }))));
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* @module react/components/chat
|
|
45
45
|
*/
|
|
46
46
|
import * as React from "../../../../../react/react.js";
|
|
47
|
-
import type { BranchInfo,
|
|
47
|
+
import type { BranchInfo, ChatDynamicToolPart, ChatMessage, ChatToolPart, InferenceMode } from "../../../../agent/react/index.js";
|
|
48
48
|
import { type ChatTheme } from "../theme.js";
|
|
49
49
|
import type { ModelOption } from "../model-selector.js";
|
|
50
50
|
import type { Source } from "./components/sources.js";
|
|
@@ -70,7 +70,6 @@ export { DropZoneOverlay, type DropZoneOverlayProps } from "./components/drop-zo
|
|
|
70
70
|
export { SkillBadge, type SkillBadgeProps } from "./components/skill-badge.js";
|
|
71
71
|
export { ToolCallCard, ToolStatusBadge } from "./components/tool-ui.js";
|
|
72
72
|
export { InferenceBadge, type InferenceBadgeProps } from "./components/inference-badge.js";
|
|
73
|
-
export { UpgradeCTA, type UpgradeCTAProps } from "./components/upgrade-cta.js";
|
|
74
73
|
export { type Source, Sources, type SourcesProps } from "./components/sources.js";
|
|
75
74
|
export { InlineCitation, type InlineCitationProps } from "./components/inline-citation.js";
|
|
76
75
|
export { type FeedbackValue, MessageFeedback, type MessageFeedbackProps, } from "./components/message-feedback.js";
|
|
@@ -114,11 +113,10 @@ export interface ChatProps {
|
|
|
114
113
|
showMessageActions?: boolean;
|
|
115
114
|
models?: ModelOption[];
|
|
116
115
|
model?: string;
|
|
117
|
-
/** The actual resolved model
|
|
116
|
+
/** The actual resolved model used for avatar display. */
|
|
118
117
|
activeModel?: string;
|
|
119
118
|
onModelChange?: (model: string) => void;
|
|
120
119
|
inferenceMode?: InferenceMode;
|
|
121
|
-
browserStatus?: BrowserInferenceStatus | null;
|
|
122
120
|
showSources?: boolean;
|
|
123
121
|
onSourceClick?: (source: Source, index: number) => void;
|
|
124
122
|
onAttach?: (files: FileList) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/chat/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAEvD,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/chat/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAEvD,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,KAAK,SAAS,EAAiC,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE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K,EAAE,OAAO,SAAS,CAAC;IACxB,EAAE,EAAE,OAAO,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,WAAW,CAAC;CACjC,CAAC;AAEF,8BAA8B;AAC9B,eAAO,MAAM,cAAc,EAAE,kBAQ3B,CAAC"}
|
|
@@ -58,7 +58,6 @@ import { DropZoneOverlay } from "./components/drop-zone.js";
|
|
|
58
58
|
import { TabSwitcher } from "./components/tab-switcher.js";
|
|
59
59
|
import { UploadsPanel } from "./components/uploads-panel.js";
|
|
60
60
|
import { InferenceBadge } from "./components/inference-badge.js";
|
|
61
|
-
import { UpgradeCTA } from "./components/upgrade-cta.js";
|
|
62
61
|
import { QuickActions as QuickActionsComponent } from "./components/quick-actions.js";
|
|
63
62
|
// ---------------------------------------------------------------------------
|
|
64
63
|
// Re-exports — sub-components
|
|
@@ -73,7 +72,6 @@ export { DropZoneOverlay } from "./components/drop-zone.js";
|
|
|
73
72
|
export { SkillBadge } from "./components/skill-badge.js";
|
|
74
73
|
export { ToolCallCard, ToolStatusBadge } from "./components/tool-ui.js";
|
|
75
74
|
export { InferenceBadge } from "./components/inference-badge.js";
|
|
76
|
-
export { UpgradeCTA } from "./components/upgrade-cta.js";
|
|
77
75
|
export { Sources } from "./components/sources.js";
|
|
78
76
|
export { InlineCitation } from "./components/inline-citation.js";
|
|
79
77
|
export { MessageFeedback, } from "./components/message-feedback.js";
|
|
@@ -101,7 +99,7 @@ export { ChatContextProvider, ComposerContextProvider, MessageContextProvider, T
|
|
|
101
99
|
// building blocks directly.
|
|
102
100
|
// ---------------------------------------------------------------------------
|
|
103
101
|
/** Render chat. */
|
|
104
|
-
export const Chat = React.forwardRef(function Chat({ messages, input, onChange, onSubmit, stop, reload, enableVoice = false, onVoice, setInput, isLoading, error, placeholder = "Type a message...", maxHeight = "100%", className, theme: userTheme, renderMessage, renderTool, suggestions, onSuggestionClick, emptyState, showScrollButton = false, showMessageActions = true, models, model, activeModel, onModelChange, inferenceMode,
|
|
102
|
+
export const Chat = React.forwardRef(function Chat({ messages, input, onChange, onSubmit, stop, reload, enableVoice = false, onVoice, setInput, isLoading, error, placeholder = "Type a message...", maxHeight = "100%", className, theme: userTheme, renderMessage, renderTool, suggestions, onSuggestionClick, emptyState, showScrollButton = false, showMessageActions = true, models, model, activeModel, onModelChange, inferenceMode, showSources = false, onSourceClick, onAttach, onSelectAttachment, onDrop, attachAccept, attachments, onRemoveAttachment, showExport = false, onFeedback, editMessage, getBranches, switchBranch, showSteps = false, showTabs = false, activeTab: controlledTab, onTabChange: controlledTabChange, uploads, onRemoveUpload, quickActions, onQuickAction, hideTabSwitcher = false, children, }, ref) {
|
|
105
103
|
const theme = React.useMemo(() => mergeThemes(defaultChatTheme, userTheme), [userTheme]);
|
|
106
104
|
// --- Drag-and-drop ---
|
|
107
105
|
const dropHandler = onDrop ?? onAttach;
|
|
@@ -169,11 +167,11 @@ export const Chat = React.forwardRef(function Chat({ messages, input, onChange,
|
|
|
169
167
|
isDocsTab
|
|
170
168
|
? (React.createElement(UploadsPanel, { uploads: uploads, onRemoveUpload: onRemoveUpload, onAttach: onAttach, attachAccept: attachAccept, className: "flex-1 min-h-0" }))
|
|
171
169
|
: isEmpty
|
|
172
|
-
? (React.createElement(ChatEmpty, { icon: emptyState?.icon, title: emptyState?.title, description: emptyState?.description, suggestions: suggestions, onSuggestionClick: onSuggestionClick }
|
|
173
|
-
: (React.createElement(ChatMessageList, { messages: messages, isLoading: isLoading, theme: theme, renderMessage: renderMessage, renderTool: renderTool, model: activeModel || model, showMessageActions: showMessageActions, showSources: showSources, showSteps: showSteps, showScrollButton: showScrollButton, onSourceClick: onSourceClick, inferenceMode: inferenceMode,
|
|
170
|
+
? (React.createElement(ChatEmpty, { icon: emptyState?.icon, title: emptyState?.title, description: emptyState?.description, suggestions: suggestions, onSuggestionClick: onSuggestionClick }))
|
|
171
|
+
: (React.createElement(ChatMessageList, { messages: messages, isLoading: isLoading, theme: theme, renderMessage: renderMessage, renderTool: renderTool, model: activeModel || model, showMessageActions: showMessageActions, showSources: showSources, showSteps: showSteps, showScrollButton: showScrollButton, onSourceClick: onSourceClick, inferenceMode: inferenceMode, editMessage: editMessage, getBranches: getBranches, switchBranch: switchBranch, onFeedback: onFeedback })),
|
|
174
172
|
error && React.createElement(ErrorBanner, { error: error, onRetry: reload }),
|
|
175
173
|
!isDocsTab && (React.createElement(ChatComposer, { input: voice.isListening ? voice.transcript || input : input, onChange: onChange, onSubmit: onSubmit, isLoading: isLoading, placeholder: voice.isListening ? "Listening..." : placeholder, theme: theme, stop: voice.isListening ? undefined : stop, onVoice: voiceHandler, isListening: voice.isListening, transcript: voice.transcript, models: models, model: model, onModelChange: onModelChange, onAttach: onAttach, onSelectAttachment: onSelectAttachment, attachAccept: attachAccept, attachments: attachments, onRemoveAttachment: onRemoveAttachment, showExport: showExport, messages: messages },
|
|
176
|
-
inferenceMode && inferenceMode !== "cloud" && (React.createElement(InferenceBadge, { inferenceMode: inferenceMode
|
|
174
|
+
inferenceMode && inferenceMode !== "cloud" && (React.createElement(InferenceBadge, { inferenceMode: inferenceMode })),
|
|
177
175
|
isEmpty && quickActions && quickActions.length > 0 && (React.createElement(QuickActionsComponent, { actions: quickActions, onActionClick: onQuickAction })))),
|
|
178
176
|
children));
|
|
179
177
|
});
|
|
@@ -17,7 +17,6 @@ export interface ChatWithSidebarChatController {
|
|
|
17
17
|
activeModel?: ChatProps["activeModel"];
|
|
18
18
|
onModelChange?: ChatProps["onModelChange"];
|
|
19
19
|
inferenceMode?: ChatProps["inferenceMode"];
|
|
20
|
-
browserStatus?: ChatProps["browserStatus"];
|
|
21
20
|
editMessage?: ChatProps["editMessage"];
|
|
22
21
|
getBranches?: ChatProps["getBranches"];
|
|
23
22
|
switchBranch?: ChatProps["switchBranch"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-with-sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat-with-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AC,EAAE,0BAA0B,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,2CAA2C;AAC3C,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,gCAAgC;AAChC,eAAO,MAAM,eAAe,oGAqP3B,CAAC"}
|
|
@@ -40,7 +40,6 @@ export const ChatWithSidebar = React.forwardRef(function ChatWithSidebar({ chat,
|
|
|
40
40
|
models: models?.options,
|
|
41
41
|
activeModel: chat.activeModel,
|
|
42
42
|
inferenceMode: chat.inferenceMode,
|
|
43
|
-
browserStatus: chat.browserStatus,
|
|
44
43
|
showSources: features?.sources,
|
|
45
44
|
onSourceClick: message?.onSourceClick,
|
|
46
45
|
onAttach: attachments?.onAttach,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export { Chat, ChatComponents, type ChatProps } from "./chat/index.js";
|
|
7
7
|
export { ChatComposer, type ChatComposerProps, ChatEmpty, type ChatEmptyProps, ChatIf, type ChatIfProps, ChatMessageList, type ChatMessageListProps, ChatRoot, type ChatRootProps, ErrorBanner, type ErrorBannerProps, Message, type MessageRootProps, ModelAvatar, type ModelAvatarProps, } from "./chat/index.js";
|
|
8
8
|
export { ChatContextProvider, type ChatContextValue, ComposerContextProvider, type ComposerContextValue, MessageContextProvider, type MessageContextValue, ThreadListContextProvider, type ThreadListContextValue, useChatContext, useChatContextOptional, useComposerContext, useComposerContextOptional, useMessageContext, useMessageContextOptional, useThreadListContext, useThreadListContextOptional, } from "./chat/index.js";
|
|
9
|
-
export { type AttachmentInfo, AttachmentPill, type AttachmentPillProps, BranchPicker, type BranchPickerProps, ChatSidebar, type ChatSidebarProps, type ChatTab, type CodeBlockProps, ConversationEmptyState, type ConversationEmptyStateProps, ConversationScrollButton, type ConversationScrollButtonProps, downloadMarkdown, DropZoneOverlay, type DropZoneOverlayProps, exportAsMarkdown, extractSourcesFromParts, FadeIn, type FeedbackValue, getTextContent, groupPartsInOrder, InferenceBadge, type InferenceBadgeProps, InlineCitation, type InlineCitationProps, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, type MessageActionsProps, MessageEditForm, type MessageEditFormProps, MessageFeedback, type MessageFeedbackProps, type PartGroup, type QuickAction, QuickActions, type QuickActionsProps, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, type SkillBadgeProps, type Source, Sources, type SourcesProps, StepIndicator, type StepIndicatorProps, Suggestion, type SuggestionProps, Suggestions, type SuggestionsProps, TabSwitcher, type TabSwitcherProps, type Thread, ToolCallCard, ToolStatusBadge,
|
|
9
|
+
export { type AttachmentInfo, AttachmentPill, type AttachmentPillProps, BranchPicker, type BranchPickerProps, ChatSidebar, type ChatSidebarProps, type ChatTab, type CodeBlockProps, ConversationEmptyState, type ConversationEmptyStateProps, ConversationScrollButton, type ConversationScrollButtonProps, downloadMarkdown, DropZoneOverlay, type DropZoneOverlayProps, exportAsMarkdown, extractSourcesFromParts, FadeIn, type FeedbackValue, getTextContent, groupPartsInOrder, InferenceBadge, type InferenceBadgeProps, InlineCitation, type InlineCitationProps, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, type MessageActionsProps, MessageEditForm, type MessageEditFormProps, MessageFeedback, type MessageFeedbackProps, type PartGroup, type QuickAction, QuickActions, type QuickActionsProps, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, type SkillBadgeProps, type Source, Sources, type SourcesProps, StepIndicator, type StepIndicatorProps, Suggestion, type SuggestionProps, Suggestions, type SuggestionsProps, TabSwitcher, type TabSwitcherProps, type Thread, ToolCallCard, ToolStatusBadge, type UploadedFile, UploadsPanel, type UploadsPanelProps, useThreads, type UseThreadsOptions, type UseThreadsResult, } from "./chat/index.js";
|
|
10
10
|
export { type ModelOption, ModelSelector, type ModelSelectorProps } from "./model-selector.js";
|
|
11
11
|
export { ChatWithSidebar, type ChatWithSidebarAttachmentConfig, type ChatWithSidebarChatController, type ChatWithSidebarFeatureConfig, type ChatWithSidebarGroupedProps, type ChatWithSidebarMessageConfig, type ChatWithSidebarModelConfig, type ChatWithSidebarProps, type ChatWithSidebarQuickActionsConfig, type ChatWithSidebarSidebarConfig, type ChatWithSidebarTabsConfig, type ChatWithSidebarVoiceConfig, } from "./chat-with-sidebar.js";
|
|
12
12
|
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKvE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,SAAS,EACT,KAAK,cAAc,EACnB,MAAM,EACN,KAAK,WAAW,EAChB,eAAe,EACf,KAAK,oBAAoB,EACzB,QAAQ,EACR,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,gBAAgB,EACrB,OAAO,EACP,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACL,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACL,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,mBAAmB,EACxB,YAAY,EACZ,KAAK,iBAAiB,EACtB,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,wBAAwB,EACxB,KAAK,6BAA6B,EAClC,gBAAgB,EAChB,eAAe,EACf,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,MAAM,EACN,KAAK,aAAa,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAK,mBAAmB,EACxB,cAAc,EACd,KAAK,mBAAmB,EACxB,eAAe,EACf,eAAe,EACf,UAAU,EACV,MAAM,EACN,cAAc,EACd,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,oBAAoB,EACzB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,YAAY,EACZ,KAAK,iBAAiB,EACtB,aAAa,EACb,aAAa,EACb,OAAO,EACP,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,OAAO,EACP,KAAK,YAAY,EACjB,aAAa,EACb,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,YAAY,EACZ,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKvE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,SAAS,EACT,KAAK,cAAc,EACnB,MAAM,EACN,KAAK,WAAW,EAChB,eAAe,EACf,KAAK,oBAAoB,EACzB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,EACpB,WAAW,EACX,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,YAAY,EACZ,eAAe,EACf,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,iBAAiB,EACtB,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACL,eAAe,EACf,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,GAChC,MAAM,wBAAwB,CAAC"}
|
|
@@ -18,7 +18,7 @@ export { ChatContextProvider, ComposerContextProvider, MessageContextProvider, T
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Sub-components
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
|
-
export { AttachmentPill, BranchPicker, ChatSidebar, ConversationEmptyState, ConversationScrollButton, downloadMarkdown, DropZoneOverlay, exportAsMarkdown, extractSourcesFromParts, FadeIn, getTextContent, groupPartsInOrder, InferenceBadge, InlineCitation, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, MessageEditForm, MessageFeedback, QuickActions, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, Sources, StepIndicator, Suggestion, Suggestions, TabSwitcher, ToolCallCard, ToolStatusBadge,
|
|
21
|
+
export { AttachmentPill, BranchPicker, ChatSidebar, ConversationEmptyState, ConversationScrollButton, downloadMarkdown, DropZoneOverlay, exportAsMarkdown, extractSourcesFromParts, FadeIn, getTextContent, groupPartsInOrder, InferenceBadge, InlineCitation, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, MessageEditForm, MessageFeedback, QuickActions, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, Sources, StepIndicator, Suggestion, Suggestions, TabSwitcher, ToolCallCard, ToolStatusBadge, UploadsPanel, useThreads, } from "./chat/index.js";
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
// Adjacent components
|
|
24
24
|
// ---------------------------------------------------------------------------
|
|
@@ -30,6 +30,6 @@ export interface GuardedEgressFetchDeps {
|
|
|
30
30
|
* follows manually after re-checking. Credential headers are stripped on a
|
|
31
31
|
* cross-origin hop, matching the platform fetch the guard wraps.
|
|
32
32
|
*/
|
|
33
|
-
export declare function guardedEgressFetch(input:
|
|
33
|
+
export declare function guardedEgressFetch(input: RequestInfo | URL, init?: RequestInit, deps?: GuardedEgressFetchDeps): Promise<Response>;
|
|
34
34
|
export declare function installWorkerEgressGuard(options?: WorkerEgressGuardOptions): void;
|
|
35
35
|
//# sourceMappingURL=worker-egress-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-egress-guard.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/worker-egress-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker-egress-guard.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/worker-egress-guard.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,mCAAmC,2CAA2C,CAAC;AAE5F,qBAAa,wBAAyB,SAAQ,KAAK;IACxC,IAAI,SAA8B;CAC5C;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAExE,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAWD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAWlF;AAuDD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAK3D;AAiCD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAC9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAeD,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,wEAAwE;IACxE,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AASD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,EAClB,IAAI,GAAE,sBAA2B,GAChC,OAAO,CAAC,QAAQ,CAAC,CAqGnB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,wBAA6B,GAAG,IAAI,CAmDrF"}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* @module security/sandbox/worker-egress-guard
|
|
8
8
|
*/
|
|
9
9
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
10
|
+
import { getHostEnv } from "../../platform/compat/process.js";
|
|
11
|
+
import { resolveHostAddresses } from "../../platform/compat/dns.js";
|
|
10
12
|
export const WORKER_INTERNAL_EGRESS_OVERRIDE_ENV = "VERYFRONT_WORKER_ALLOW_INTERNAL_EGRESS";
|
|
11
13
|
export class WorkerEgressBlockedError extends Error {
|
|
12
14
|
name = "WorkerEgressBlockedError";
|
|
@@ -94,17 +96,7 @@ function isLocalhostName(hostname) {
|
|
|
94
96
|
return normalized === "localhost" || normalized.endsWith(".localhost");
|
|
95
97
|
}
|
|
96
98
|
async function defaultResolveHost(hostname) {
|
|
97
|
-
|
|
98
|
-
const resolver = dntShim.Deno.resolveDns;
|
|
99
|
-
for (const recordType of ["A", "AAAA"]) {
|
|
100
|
-
try {
|
|
101
|
-
results.push(...await resolver(hostname, recordType));
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
// A host may legitimately have only one address family.
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return results;
|
|
99
|
+
return await resolveHostAddresses(hostname);
|
|
108
100
|
}
|
|
109
101
|
function getUrlHostname(input) {
|
|
110
102
|
const url = input instanceof URL
|
|
@@ -153,12 +145,7 @@ function getConnectHostname(options) {
|
|
|
153
145
|
return typeof hostname === "string" ? hostname : null;
|
|
154
146
|
}
|
|
155
147
|
function getAllowInternalEgress() {
|
|
156
|
-
|
|
157
|
-
return isInternalEgressOverrideEnabled(dntShim.Deno.env.get(WORKER_INTERNAL_EGRESS_OVERRIDE_ENV));
|
|
158
|
-
}
|
|
159
|
-
catch {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
148
|
+
return isInternalEgressOverrideEnabled(getHostEnv(WORKER_INTERNAL_EGRESS_OVERRIDE_ENV));
|
|
162
149
|
}
|
|
163
150
|
const REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
|
|
164
151
|
const MAX_EGRESS_REDIRECTS = 20;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-candidates.generated.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/dev/framework-candidates.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"framework-candidates.generated.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/dev/framework-candidates.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAwpLjD,CAAC"}
|