@vercel/geistdocs 2.7.10 → 2.8.0
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/assets/icons/icon-thumb-down.d.ts +26 -0
- package/dist/assets/icons/icon-thumb-down.d.ts.map +1 -0
- package/dist/assets/icons/icon-thumb-down.js +25 -0
- package/dist/assets/icons/index.d.ts +1 -0
- package/dist/assets/icons/index.d.ts.map +1 -1
- package/dist/assets/icons/index.js +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/config.d.ts +67 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.d.ts +23 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +44 -3
- package/dist/footer.js +1 -1
- package/dist/internal/chat/activity.d.ts +5 -1
- package/dist/internal/chat/activity.d.ts.map +1 -1
- package/dist/internal/chat/activity.js +11 -4
- package/dist/internal/chat/chat-user.d.ts +12 -0
- package/dist/internal/chat/chat-user.d.ts.map +1 -0
- package/dist/internal/chat/chat-user.js +27 -0
- package/dist/internal/chat/commands.d.ts +91 -0
- package/dist/internal/chat/commands.d.ts.map +1 -0
- package/dist/internal/chat/commands.js +165 -0
- package/dist/internal/chat/context.d.ts +46 -2
- package/dist/internal/chat/context.d.ts.map +1 -1
- package/dist/internal/chat/context.js +50 -4
- package/dist/internal/chat/message-actions.d.ts +15 -0
- package/dist/internal/chat/message-actions.d.ts.map +1 -0
- package/dist/internal/chat/message-actions.js +113 -0
- package/dist/internal/chat/message-feedback.d.ts +68 -0
- package/dist/internal/chat/message-feedback.d.ts.map +1 -0
- package/dist/internal/chat/message-feedback.js +188 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -1
- package/dist/internal/chat/message-metadata.js +7 -1
- package/dist/internal/chat/message-text.d.ts +9 -0
- package/dist/internal/chat/message-text.d.ts.map +1 -0
- package/dist/internal/chat/message-text.js +15 -0
- package/dist/internal/chat/message.d.ts +4 -2
- package/dist/internal/chat/message.d.ts.map +1 -1
- package/dist/internal/chat/message.js +8 -1
- package/dist/internal/chat/options.d.ts +94 -0
- package/dist/internal/chat/options.d.ts.map +1 -0
- package/dist/internal/chat/options.js +171 -0
- package/dist/internal/chat/page-attachment.d.ts +12 -0
- package/dist/internal/chat/page-attachment.d.ts.map +1 -0
- package/dist/internal/chat/page-attachment.js +18 -0
- package/dist/internal/chat/session-provider.d.ts +33 -0
- package/dist/internal/chat/session-provider.d.ts.map +1 -0
- package/dist/internal/chat/session-provider.js +138 -0
- package/dist/internal/chat/session.d.ts +60 -0
- package/dist/internal/chat/session.d.ts.map +1 -0
- package/dist/internal/chat/session.js +85 -0
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +81 -157
- package/dist/internal/chat/use-chat-commands.d.ts +28 -0
- package/dist/internal/chat/use-chat-commands.d.ts.map +1 -0
- package/dist/internal/chat/use-chat-commands.js +62 -0
- package/dist/internal/chat/user-avatar.d.ts +7 -0
- package/dist/internal/chat/user-avatar.d.ts.map +1 -0
- package/dist/internal/chat/user-avatar.js +27 -0
- package/dist/internal/eve-agent-session-cookie.d.ts +68 -0
- package/dist/internal/eve-agent-session-cookie.d.ts.map +1 -0
- package/dist/internal/eve-agent-session-cookie.js +164 -0
- package/dist/internal/eve-agent-session.d.ts +9 -7
- package/dist/internal/eve-agent-session.d.ts.map +1 -1
- package/dist/internal/eve-agent-session.js +10 -13
- package/dist/internal/eve-agent.d.ts +96 -24
- package/dist/internal/eve-agent.d.ts.map +1 -1
- package/dist/internal/eve-agent.js +74 -51
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -1
- package/dist/internal/feedback-action.js +37 -5
- package/dist/internal/page-actions-client.d.ts +9 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +8 -4
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +2 -2
- package/dist/internal/use-mobile.d.ts +7 -0
- package/dist/internal/use-mobile.d.ts.map +1 -1
- package/dist/internal/use-mobile.js +17 -1
- package/dist/internal/webmcp-client.d.ts.map +1 -1
- package/dist/internal/webmcp-client.js +13 -3
- package/dist/internal/webmcp.d.ts +5 -1
- package/dist/internal/webmcp.d.ts.map +1 -1
- package/dist/internal/webmcp.js +31 -1
- package/dist/pages/changelog.d.ts.map +1 -1
- package/dist/pages/changelog.js +4 -0
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +2 -0
- package/dist/routes/chat.d.ts +83 -5
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +517 -80
- package/dist/routes/discovery.d.ts +1 -1
- package/dist/routes/discovery.d.ts.map +1 -1
- package/dist/routes/discovery.js +7 -11
- package/dist/routes/openapi.d.ts.map +1 -1
- package/dist/routes/openapi.js +47 -25
- package/docs/agents.md +3 -3
- package/docs/llms.txt +631 -35
- package/docs/manifest.json +3 -3
- package/docs/pages/agent-readiness.md +1 -1
- package/docs/pages/ask-ai.md +567 -24
- package/docs/pages/configuration.md +21 -1
- package/docs/pages/env.md +17 -3
- package/docs/pages/feedback.md +4 -0
- package/docs/pages/webmcp.md +18 -3
- package/docs/sitemap.md +1 -1
- package/package.json +1 -2
- package/template/.env.example +5 -0
- package/template/AGENTS.md +2 -0
- package/template/content/docs/agent-readiness.mdx +1 -1
- package/template/content/docs/ask-ai.cn.mdx +466 -15
- package/template/content/docs/ask-ai.mdx +567 -24
- package/template/content/docs/configuration.cn.mdx +39 -0
- package/template/content/docs/configuration.mdx +21 -1
- package/template/content/docs/env.cn.mdx +15 -1
- package/template/content/docs/env.mdx +18 -4
- package/template/content/docs/feedback.cn.mdx +4 -0
- package/template/content/docs/feedback.mdx +4 -0
- package/template/content/docs/webmcp.mdx +18 -3
- package/template/package.json +1 -2
package/dist/pages/docs.js
CHANGED
|
@@ -171,10 +171,12 @@ export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions =
|
|
|
171
171
|
}), _jsxs("div", { className: cn("flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", data.description === undefined && "mb-8"), children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, only: "desktop", page: {
|
|
172
172
|
markdownUrl,
|
|
173
173
|
path: page.path,
|
|
174
|
+
title: data.title,
|
|
174
175
|
url: publicPageUrl,
|
|
175
176
|
} })] }), _jsx(DocsDescription, { children: data.description }), _jsx("div", { className: "-mt-6 mb-4 @min-[961px]:hidden", children: _jsx(GeistdocsPageActions, { config: pageActions.config, only: "mobile", page: {
|
|
176
177
|
markdownUrl,
|
|
177
178
|
path: page.path,
|
|
179
|
+
title: data.title,
|
|
178
180
|
url: publicPageUrl,
|
|
179
181
|
} }) }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
|
|
180
182
|
...createMdxComponents({ a: link }),
|
package/dist/routes/chat.d.ts
CHANGED
|
@@ -4,23 +4,96 @@ import { type ChatMixedbreadOptions } from "../internal/chat-retrieval";
|
|
|
4
4
|
import { type GeistdocsPageFilter } from "../page-visibility";
|
|
5
5
|
import type { GeistdocsSourceBundle } from "../source";
|
|
6
6
|
type SourceBundle = GeistdocsSourceBundle;
|
|
7
|
+
/**
|
|
8
|
+
* Headers for upstream requests: a static value, or a function that receives
|
|
9
|
+
* the incoming chat `Request` (for per-request values) and may be async.
|
|
10
|
+
*/
|
|
11
|
+
type ChatUpstreamHeaders = HeadersInit | ((request: Request) => HeadersInit | Promise<HeadersInit>);
|
|
7
12
|
interface ChatProxyConfig {
|
|
8
|
-
headers?:
|
|
13
|
+
headers?: ChatUpstreamHeaders;
|
|
9
14
|
url: string;
|
|
10
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* What proxy and eve agent modes add to the message they forward.
|
|
18
|
+
* - `"auto"`: on the first user message, the attached page (or the page at
|
|
19
|
+
* `currentRoute`) excerpt plus related docs from retrieval, emitted as
|
|
20
|
+
* source citations.
|
|
21
|
+
* - `"page-only"`: only a page the request attaches with `pageContext`, in
|
|
22
|
+
* full, and no citations; every other message is forwarded as sent.
|
|
23
|
+
*/
|
|
24
|
+
type ChatContextInjection = "auto" | "page-only";
|
|
11
25
|
interface ChatEveAgentOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Send eve's turn-scoped `clientContext: { currentPage: { url, title } }`
|
|
28
|
+
* with every message, including the message that starts a replacement
|
|
29
|
+
* session; prewarm requests carry no message, so they never send it.
|
|
30
|
+
* `url` is the absolute public URL of `currentRoute`
|
|
31
|
+
* (on `config.siteUrl`, or the request origin); `title` is included when
|
|
32
|
+
* the route is a page Ask AI may see. @default false
|
|
33
|
+
*/
|
|
34
|
+
clientContext?: boolean;
|
|
12
35
|
/**
|
|
13
36
|
* Extra headers for requests to the eve agent, replacing the default
|
|
14
37
|
* `Authorization: Bearer <Vercel OIDC token>` when an `authorization`
|
|
15
|
-
* header is provided.
|
|
38
|
+
* header is provided. A function receives the incoming chat `Request` and
|
|
39
|
+
* may be async, for per-request tokens or forwarded values.
|
|
16
40
|
* Server-only: never expose auth material through `geistdocs.tsx`.
|
|
17
41
|
*/
|
|
18
|
-
headers?:
|
|
42
|
+
headers?: ChatUpstreamHeaders;
|
|
43
|
+
/**
|
|
44
|
+
* Secret used to sign the httpOnly cookie that binds a browser to its eve
|
|
45
|
+
* session. Defaults to the `GEISTDOCS_CHAT_SECRET` environment variable
|
|
46
|
+
* and must be at least 32 bytes (`openssl rand -base64 32`). Without a
|
|
47
|
+
* secret, every turn starts a fresh eve session with the conversation
|
|
48
|
+
* inlined, and prewarm requests are refused. Server-only.
|
|
49
|
+
*/
|
|
50
|
+
secret?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Forward the agent's tool outputs to the client and show the URLs found
|
|
53
|
+
* in them as source citations. When `false`, tool calls still show as
|
|
54
|
+
* activity, but their outputs reach the client as `null` and produce no
|
|
55
|
+
* citations. @default true
|
|
56
|
+
*/
|
|
57
|
+
toolCitations?: boolean;
|
|
19
58
|
/** Overrides `config.ai.eveAgent.url` (e.g. for a staging agent). */
|
|
20
59
|
url?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Names of the agent tools whose calls the client sees. Calls to any
|
|
62
|
+
* other tool, with their results and citations, are not forwarded.
|
|
63
|
+
* Omit to forward every tool call.
|
|
64
|
+
*/
|
|
65
|
+
visibleTools?: string[];
|
|
66
|
+
}
|
|
67
|
+
interface ChatRequestLimits {
|
|
68
|
+
/**
|
|
69
|
+
* Most messages accepted in one request. Larger requests receive 400.
|
|
70
|
+
* @default 200
|
|
71
|
+
*/
|
|
72
|
+
maxMessages?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Longest legacy `pageContext.content` accepted, in characters. Longer
|
|
75
|
+
* requests receive 400. Pages referenced by `pageContext.url` alone are
|
|
76
|
+
* read from the site's sources and are not rejected; with
|
|
77
|
+
* `contextInjection: "page-only"`, their Markdown is truncated to this
|
|
78
|
+
* length before it is forwarded.
|
|
79
|
+
* @default 200_000
|
|
80
|
+
*/
|
|
81
|
+
maxPageContextChars?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Largest request body accepted, in bytes. Larger requests receive 413.
|
|
84
|
+
* @default 1_000_000
|
|
85
|
+
*/
|
|
86
|
+
maxRequestBytes?: number;
|
|
21
87
|
}
|
|
22
88
|
interface CreateChatRouteOptions {
|
|
23
|
-
config: Pick<GeistdocsConfig, "ai" | "basePath" | "defaultLanguage" | "siteId" | "translations">;
|
|
89
|
+
config: Pick<GeistdocsConfig, "ai" | "basePath" | "defaultLanguage" | "siteId" | "siteUrl" | "translations">;
|
|
90
|
+
/**
|
|
91
|
+
* Docs context proxy and eve agent modes add to forwarded messages.
|
|
92
|
+
* `"page-only"` forwards messages as sent unless the request attaches a
|
|
93
|
+
* page with `pageContext`. Ignored in the default AI Gateway mode, which
|
|
94
|
+
* retrieves docs with its own tools. @default "auto"
|
|
95
|
+
*/
|
|
96
|
+
contextInjection?: ChatContextInjection;
|
|
24
97
|
/**
|
|
25
98
|
* Server-side options for the eve agent responder configured through
|
|
26
99
|
* `config.ai.eveAgent`. Mutually exclusive with `proxy`.
|
|
@@ -28,6 +101,11 @@ interface CreateChatRouteOptions {
|
|
|
28
101
|
eveAgent?: ChatEveAgentOptions;
|
|
29
102
|
/** Narrows the stable public corpus available to Ask AI. */
|
|
30
103
|
filterPage?: GeistdocsPageFilter;
|
|
104
|
+
/**
|
|
105
|
+
* Request size caps applied before any model, proxy, or agent call. Rate
|
|
106
|
+
* limiting is not included; wrap the route with your own.
|
|
107
|
+
*/
|
|
108
|
+
limits?: ChatRequestLimits;
|
|
31
109
|
/**
|
|
32
110
|
* Server-only Mixedbread overrides. Environment variables are used when
|
|
33
111
|
* these values are omitted.
|
|
@@ -45,7 +123,7 @@ interface CreateChatRouteOptions {
|
|
|
45
123
|
source?: SourceBundle;
|
|
46
124
|
sources?: SourceBundle[];
|
|
47
125
|
}
|
|
48
|
-
export declare const createChatRoute: ({ config, eveAgent, filterPage, mixedbread, model, proxy, source, sources, }: CreateChatRouteOptions) => {
|
|
126
|
+
export declare const createChatRoute: ({ config, contextInjection, eveAgent, filterPage, limits, mixedbread, model, proxy, source, sources, }: CreateChatRouteOptions) => {
|
|
49
127
|
POST: (req: Request) => Promise<Response>;
|
|
50
128
|
maxDuration: 800;
|
|
51
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/routes/chat.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,aAAa,EAQnB,MAAM,IAAI,CAAC;AAGZ,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAKhE,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/routes/chat.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,aAAa,EAQnB,MAAM,IAAI,CAAC;AAGZ,OAAO,EAAE,KAAK,eAA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