@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.
Files changed (120) hide show
  1. package/dist/assets/icons/icon-thumb-down.d.ts +26 -0
  2. package/dist/assets/icons/icon-thumb-down.d.ts.map +1 -0
  3. package/dist/assets/icons/icon-thumb-down.js +25 -0
  4. package/dist/assets/icons/index.d.ts +1 -0
  5. package/dist/assets/icons/index.d.ts.map +1 -1
  6. package/dist/assets/icons/index.js +1 -0
  7. package/dist/cli/index.js +1 -1
  8. package/dist/config.d.ts +67 -3
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/controls.d.ts +23 -1
  11. package/dist/controls.d.ts.map +1 -1
  12. package/dist/controls.js +44 -3
  13. package/dist/footer.js +1 -1
  14. package/dist/internal/chat/activity.d.ts +5 -1
  15. package/dist/internal/chat/activity.d.ts.map +1 -1
  16. package/dist/internal/chat/activity.js +11 -4
  17. package/dist/internal/chat/chat-user.d.ts +12 -0
  18. package/dist/internal/chat/chat-user.d.ts.map +1 -0
  19. package/dist/internal/chat/chat-user.js +27 -0
  20. package/dist/internal/chat/commands.d.ts +91 -0
  21. package/dist/internal/chat/commands.d.ts.map +1 -0
  22. package/dist/internal/chat/commands.js +165 -0
  23. package/dist/internal/chat/context.d.ts +46 -2
  24. package/dist/internal/chat/context.d.ts.map +1 -1
  25. package/dist/internal/chat/context.js +50 -4
  26. package/dist/internal/chat/message-actions.d.ts +15 -0
  27. package/dist/internal/chat/message-actions.d.ts.map +1 -0
  28. package/dist/internal/chat/message-actions.js +113 -0
  29. package/dist/internal/chat/message-feedback.d.ts +68 -0
  30. package/dist/internal/chat/message-feedback.d.ts.map +1 -0
  31. package/dist/internal/chat/message-feedback.js +188 -0
  32. package/dist/internal/chat/message-metadata.d.ts.map +1 -1
  33. package/dist/internal/chat/message-metadata.js +7 -1
  34. package/dist/internal/chat/message-text.d.ts +9 -0
  35. package/dist/internal/chat/message-text.d.ts.map +1 -0
  36. package/dist/internal/chat/message-text.js +15 -0
  37. package/dist/internal/chat/message.d.ts +4 -2
  38. package/dist/internal/chat/message.d.ts.map +1 -1
  39. package/dist/internal/chat/message.js +8 -1
  40. package/dist/internal/chat/options.d.ts +94 -0
  41. package/dist/internal/chat/options.d.ts.map +1 -0
  42. package/dist/internal/chat/options.js +171 -0
  43. package/dist/internal/chat/page-attachment.d.ts +12 -0
  44. package/dist/internal/chat/page-attachment.d.ts.map +1 -0
  45. package/dist/internal/chat/page-attachment.js +18 -0
  46. package/dist/internal/chat/session-provider.d.ts +33 -0
  47. package/dist/internal/chat/session-provider.d.ts.map +1 -0
  48. package/dist/internal/chat/session-provider.js +138 -0
  49. package/dist/internal/chat/session.d.ts +60 -0
  50. package/dist/internal/chat/session.d.ts.map +1 -0
  51. package/dist/internal/chat/session.js +85 -0
  52. package/dist/internal/chat/shell.d.ts.map +1 -1
  53. package/dist/internal/chat/shell.js +81 -157
  54. package/dist/internal/chat/use-chat-commands.d.ts +28 -0
  55. package/dist/internal/chat/use-chat-commands.d.ts.map +1 -0
  56. package/dist/internal/chat/use-chat-commands.js +62 -0
  57. package/dist/internal/chat/user-avatar.d.ts +7 -0
  58. package/dist/internal/chat/user-avatar.d.ts.map +1 -0
  59. package/dist/internal/chat/user-avatar.js +27 -0
  60. package/dist/internal/eve-agent-session-cookie.d.ts +68 -0
  61. package/dist/internal/eve-agent-session-cookie.d.ts.map +1 -0
  62. package/dist/internal/eve-agent-session-cookie.js +164 -0
  63. package/dist/internal/eve-agent-session.d.ts +9 -7
  64. package/dist/internal/eve-agent-session.d.ts.map +1 -1
  65. package/dist/internal/eve-agent-session.js +10 -13
  66. package/dist/internal/eve-agent.d.ts +96 -24
  67. package/dist/internal/eve-agent.d.ts.map +1 -1
  68. package/dist/internal/eve-agent.js +74 -51
  69. package/dist/internal/feedback-action.d.ts +14 -0
  70. package/dist/internal/feedback-action.d.ts.map +1 -1
  71. package/dist/internal/feedback-action.js +37 -5
  72. package/dist/internal/page-actions-client.d.ts +9 -0
  73. package/dist/internal/page-actions-client.d.ts.map +1 -1
  74. package/dist/internal/page-actions-client.js +8 -4
  75. package/dist/internal/provider-client.d.ts.map +1 -1
  76. package/dist/internal/provider-client.js +2 -2
  77. package/dist/internal/use-mobile.d.ts +7 -0
  78. package/dist/internal/use-mobile.d.ts.map +1 -1
  79. package/dist/internal/use-mobile.js +17 -1
  80. package/dist/internal/webmcp-client.d.ts.map +1 -1
  81. package/dist/internal/webmcp-client.js +13 -3
  82. package/dist/internal/webmcp.d.ts +5 -1
  83. package/dist/internal/webmcp.d.ts.map +1 -1
  84. package/dist/internal/webmcp.js +31 -1
  85. package/dist/pages/changelog.d.ts.map +1 -1
  86. package/dist/pages/changelog.js +4 -0
  87. package/dist/pages/docs.d.ts.map +1 -1
  88. package/dist/pages/docs.js +2 -0
  89. package/dist/routes/chat.d.ts +83 -5
  90. package/dist/routes/chat.d.ts.map +1 -1
  91. package/dist/routes/chat.js +517 -80
  92. package/dist/routes/discovery.d.ts +1 -1
  93. package/dist/routes/discovery.d.ts.map +1 -1
  94. package/dist/routes/discovery.js +7 -11
  95. package/dist/routes/openapi.d.ts.map +1 -1
  96. package/dist/routes/openapi.js +47 -25
  97. package/docs/agents.md +3 -3
  98. package/docs/llms.txt +631 -35
  99. package/docs/manifest.json +3 -3
  100. package/docs/pages/agent-readiness.md +1 -1
  101. package/docs/pages/ask-ai.md +567 -24
  102. package/docs/pages/configuration.md +21 -1
  103. package/docs/pages/env.md +17 -3
  104. package/docs/pages/feedback.md +4 -0
  105. package/docs/pages/webmcp.md +18 -3
  106. package/docs/sitemap.md +1 -1
  107. package/package.json +1 -2
  108. package/template/.env.example +5 -0
  109. package/template/AGENTS.md +2 -0
  110. package/template/content/docs/agent-readiness.mdx +1 -1
  111. package/template/content/docs/ask-ai.cn.mdx +466 -15
  112. package/template/content/docs/ask-ai.mdx +567 -24
  113. package/template/content/docs/configuration.cn.mdx +39 -0
  114. package/template/content/docs/configuration.mdx +21 -1
  115. package/template/content/docs/env.cn.mdx +15 -1
  116. package/template/content/docs/env.mdx +18 -4
  117. package/template/content/docs/feedback.cn.mdx +4 -0
  118. package/template/content/docs/feedback.mdx +4 -0
  119. package/template/content/docs/webmcp.mdx +18 -3
  120. package/template/package.json +1 -2
@@ -1,4 +1,3 @@
1
- import { isEveAgentSessionHandle, } from "./eve-agent-session.js";
2
1
  /**
3
2
  * Client for the eve framework's session HTTP API, translating eve's NDJSON
4
3
  * event stream into AI SDK UI message chunks.
@@ -9,6 +8,10 @@ import { isEveAgentSessionHandle, } from "./eve-agent-session.js";
9
8
  * - `POST {url}/eve/v1/session/:sessionId` sends a follow-up with `{ message }`
10
9
  * to that fixed session. An inactive session responds with
11
10
  * `{ code: "session_not_active" }` and status 409.
11
+ * - `message` is a string or an array of `{ type: "text", text }` parts. Both
12
+ * message routes accept an optional top-level `clientContext` JSON object
13
+ * next to `message`; eve turns it into turn-scoped model context that is
14
+ * not stored in session history.
12
15
  * - `GET {url}/eve/v1/session/:sessionId/stream?startIndex=N` streams
13
16
  * newline-delimited JSON events. The stream stays open after
14
17
  * `session.waiting`, so the client disconnects at turn boundaries and
@@ -25,30 +28,43 @@ const MAX_TRANSCRIPT_TOTAL_CHARS = 8000;
25
28
  const MAX_SOURCES_PER_ACTION = 5;
26
29
  const TRAILING_SLASH_PATTERN = /\/+$/;
27
30
  const HTTP_URL_PATTERN = /^https?:\/\//;
31
+ /** JSON body for eve's message routes; `clientContext` only when set. */
32
+ const createMessageBody = (message, clientContext) => JSON.stringify(clientContext ? { message, clientContext } : { message });
28
33
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
29
- const normalizeAgentUrl = (url) => url.replace(TRAILING_SLASH_PATTERN, "");
34
+ export const normalizeAgentUrl = (url) => url.replace(TRAILING_SLASH_PATTERN, "");
30
35
  const getMessageText = (message) => message.parts
31
36
  .filter((part) => part.type === "text")
32
37
  .map((part) => part.text)
33
38
  .join("\n");
39
+ const isEveAgentMessageMetadata = (value) => isRecord(value) &&
40
+ typeof value.session === "string" &&
41
+ value.session.length > 0 &&
42
+ Number.isSafeInteger(value.streamIndex) &&
43
+ value.streamIndex >= 0;
44
+ const readEveAgentMetadata = (message) => message?.metadata?.eveAgent;
34
45
  /**
35
- * Read the eve session handle persisted on the most recent assistant
36
- * message. The handle round-trips through the client: it is written to
37
- * message metadata by the `finish` chunk and sent back with the full
38
- * message history on the next request.
46
+ * Stream position on the most recent assistant message before the trailing
47
+ * user message. Only the most recent assistant message counts: a turn that
48
+ * failed or was stopped carries no position, and resuming from an older one
49
+ * would replay events. Legacy shapes (`{ sessionId, streamIndex }` objects
50
+ * and opaque string tokens) read as no position.
39
51
  */
40
- export const getEveAgentSessionHandle = (messages) => {
41
- for (let index = messages.length - 1; index >= 0; index--) {
52
+ export const getEveAgentMessageMetadata = (messages) => {
53
+ for (let index = messages.length - 2; index >= 0; index--) {
42
54
  const message = messages[index];
43
55
  if (message?.role !== "assistant") {
44
56
  continue;
45
57
  }
46
- const handle = message.metadata
47
- ?.eveAgent;
48
- return isEveAgentSessionHandle(handle) ? handle : null;
58
+ const metadata = readEveAgentMetadata(message);
59
+ return isEveAgentMessageMetadata(metadata) ? metadata : null;
49
60
  }
50
61
  return null;
51
62
  };
63
+ /** Whether any earlier assistant message records an eve turn. */
64
+ export const hasPriorEveAgentTurn = (messages) => messages
65
+ .slice(0, -1)
66
+ .some((message) => message.role === "assistant" &&
67
+ isEveAgentMessageMetadata(readEveAgentMetadata(message)));
52
68
  const truncate = (value, limit) => value.length > limit ? `${value.slice(0, limit)}...` : value;
53
69
  /**
54
70
  * Resolve the eve agent URL from the route option and site config, and
@@ -86,8 +102,8 @@ export const capLastUserMessageText = (messages, limit) => {
86
102
  };
87
103
  /**
88
104
  * Inline prior conversation turns into a single message for a fresh eve
89
- * session. Used when history exists but no (valid) session handle does —
90
- * for example after the client's daily history reset.
105
+ * session. Used when history exists but the browser holds no session for
106
+ * this conversation — for example after the session cookie expired.
91
107
  */
92
108
  export const buildEveAgentTranscript = (messages, currentMessage) => {
93
109
  const priorMessages = messages.slice(0, -1);
@@ -163,7 +179,7 @@ const parseSessionResponse = async (response) => {
163
179
  return { sessionId: body.sessionId };
164
180
  };
165
181
  /** Start an eve session without a turn so the first message can reuse it. */
166
- export const prewarmEveAgentSession = async ({ agentUrl, fetchImpl = fetch, headers, signal, }) => {
182
+ export const createEmptyEveAgentSession = async ({ agentUrl, fetchImpl = fetch, headers, signal, }) => {
167
183
  const response = await fetchImpl(`${normalizeAgentUrl(agentUrl)}${EVE_SESSION_PATH}`, {
168
184
  method: "POST",
169
185
  body: JSON.stringify({}),
@@ -173,13 +189,12 @@ export const prewarmEveAgentSession = async ({ agentUrl, fetchImpl = fetch, head
173
189
  if (!response.ok) {
174
190
  throw new Error(`eve agent session prewarm failed with status ${response.status}.`);
175
191
  }
176
- const session = await parseSessionResponse(response);
177
- return { sessionId: session.sessionId, streamIndex: 0 };
192
+ return await parseSessionResponse(response);
178
193
  };
179
194
  const isTurnBoundaryEvent = (type) => type === "session.waiting" ||
180
195
  type === "session.completed" ||
181
196
  type === "session.failed";
182
- const createEveEventTranslator = (writer) => {
197
+ const createEveEventTranslator = (writer, { toolCitations, visibleTools }) => {
183
198
  let blockCounter = 0;
184
199
  let openTextId = null;
185
200
  let openReasoningId = null;
@@ -236,6 +251,11 @@ const createEveEventTranslator = (writer) => {
236
251
  continue;
237
252
  }
238
253
  const toolName = getActionName(action);
254
+ // Hidden tools never become known calls, so their results and any
255
+ // citations in them are dropped too.
256
+ if (visibleTools && !visibleTools.has(toolName)) {
257
+ continue;
258
+ }
239
259
  knownToolCalls.set(action.callId, toolName);
240
260
  writer.write({
241
261
  type: "tool-input-available",
@@ -289,10 +309,12 @@ const createEveEventTranslator = (writer) => {
289
309
  writer.write({
290
310
  type: "tool-output-available",
291
311
  toolCallId: result.callId,
292
- output: result.output ?? null,
312
+ output: toolCitations ? (result.output ?? null) : null,
293
313
  dynamic: true,
294
314
  });
295
- writeSourceChunks(result.output);
315
+ if (toolCitations) {
316
+ writeSourceChunks(result.output);
317
+ }
296
318
  };
297
319
  const handleInputRequested = (data) => {
298
320
  if (!Array.isArray(data.requests)) {
@@ -378,13 +400,13 @@ const waitForRetry = (delayMs, signal) => new Promise((resolve, reject) => {
378
400
  }
379
401
  signal?.addEventListener("abort", onAbort, { once: true });
380
402
  });
381
- const postSessionMessage = async ({ agentUrl, fetchImpl, handle, headers, message, signal, }) => {
403
+ const postSessionMessage = async ({ agentUrl, clientContext, fetchImpl, headers, message, sessionId, signal, }) => {
382
404
  const readyDeadline = Date.now() + SESSION_SEND_READY_TIMEOUT_MS;
383
405
  let retryDelayMs = SESSION_SEND_RETRY_BASE_DELAY_MS;
384
406
  for (;;) {
385
- const response = await fetchImpl(`${agentUrl}${EVE_SESSION_PATH}/${encodeURIComponent(handle.sessionId)}`, {
407
+ const response = await fetchImpl(`${agentUrl}${EVE_SESSION_PATH}/${encodeURIComponent(sessionId)}`, {
386
408
  method: "POST",
387
- body: JSON.stringify({ message }),
409
+ body: createMessageBody(message, clientContext),
388
410
  headers,
389
411
  signal,
390
412
  });
@@ -401,22 +423,31 @@ const postSessionMessage = async ({ agentUrl, fetchImpl, handle, headers, messag
401
423
  retryDelayMs = Math.min(retryDelayMs * 2, SESSION_SEND_RETRY_MAX_DELAY_MS);
402
424
  }
403
425
  };
404
- const startOrContinueSession = async ({ agentUrl, fallbackMessage, fetchImpl, handle, headers, message, signal, }) => {
405
- if (handle) {
426
+ /**
427
+ * Send the turn's message to the agent: as a follow-up to `continuation`
428
+ * when given, otherwise (or when that session is no longer active) as the
429
+ * first message of a new session. Resolves once the agent has accepted the
430
+ * message, before any event is streamed, so the caller can bind the
431
+ * resulting session to the response.
432
+ */
433
+ export const startOrContinueEveAgentSession = async ({ agentUrl, clientContext, continuation = null, fallbackMessage, fetchImpl = fetch, headers, message, signal, }) => {
434
+ const normalizedUrl = normalizeAgentUrl(agentUrl);
435
+ if (continuation) {
406
436
  const { code, response } = await postSessionMessage({
407
- agentUrl,
437
+ agentUrl: normalizedUrl,
438
+ clientContext,
408
439
  fetchImpl,
409
- handle,
410
440
  headers,
411
441
  message,
442
+ sessionId: continuation.sessionId,
412
443
  signal,
413
444
  });
414
445
  if (response.ok) {
415
446
  const session = await parseSessionResponse(response);
416
- if (session.sessionId !== handle.sessionId) {
447
+ if (session.sessionId !== continuation.sessionId) {
417
448
  throw new Error("eve agent follow-up returned a different session id.");
418
449
  }
419
- return { sessionId: session.sessionId, startIndex: handle.streamIndex };
450
+ return continuation;
420
451
  }
421
452
  // Ask AI recovers from an inactive session by explicitly creating a new
422
453
  // one with the bounded transcript.
@@ -424,9 +455,9 @@ const startOrContinueSession = async ({ agentUrl, fallbackMessage, fetchImpl, ha
424
455
  throw new Error(`eve agent follow-up failed with status ${response.status}.`);
425
456
  }
426
457
  }
427
- const response = await fetchImpl(`${agentUrl}${EVE_SESSION_PATH}`, {
458
+ const response = await fetchImpl(`${normalizedUrl}${EVE_SESSION_PATH}`, {
428
459
  method: "POST",
429
- body: JSON.stringify({ message: handle ? fallbackMessage : message }),
460
+ body: createMessageBody(continuation ? (fallbackMessage ?? message) : message, clientContext),
430
461
  headers,
431
462
  signal,
432
463
  });
@@ -510,29 +541,24 @@ const cancelSession = ({ agentUrl, fetchImpl, headers, sessionId, }) => fetchImp
510
541
  // the cancel request fails.
511
542
  });
512
543
  /**
513
- * Run a single Ask AI turn against a hosted eve agent, writing AI SDK UI
514
- * message chunks to the provided writer.
544
+ * Stream one Ask AI turn from a session that already accepted the turn's
545
+ * message, writing AI SDK UI message chunks to the provided writer.
515
546
  */
516
- export const runEveAgentTurn = async ({ agentUrl, fallbackMessage, fetchImpl = fetch, handle = null, headers, initialChunks = [], message, signal, writer, }) => {
547
+ export const streamEveAgentTurn = async ({ agentUrl, fetchImpl = fetch, headers, initialChunks = [], session, sessionTag = null, signal, toolCitations = true, visibleTools, writer, }) => {
517
548
  const normalizedUrl = normalizeAgentUrl(agentUrl);
549
+ const { sessionId, startIndex } = session;
518
550
  // A bare `start` chunk does not flush client state; providing a message
519
551
  // id makes the assistant message render immediately, so the chat shows
520
- // the "Thinking..." indicator during session creation and model startup
521
- // instead of a blank panel.
552
+ // the "Thinking..." indicator during model startup instead of a blank
553
+ // panel.
522
554
  writer.write({ type: "start", messageId: `eve-${crypto.randomUUID()}` });
523
555
  for (const chunk of initialChunks) {
524
556
  writer.write(chunk);
525
557
  }
526
- const { sessionId, startIndex } = await startOrContinueSession({
527
- agentUrl: normalizedUrl,
528
- fallbackMessage: fallbackMessage ?? message,
529
- fetchImpl,
530
- handle,
531
- headers,
532
- message,
533
- signal,
558
+ const translator = createEveEventTranslator(writer, {
559
+ toolCitations,
560
+ visibleTools: visibleTools ? new Set(visibleTools) : null,
534
561
  });
535
- const translator = createEveEventTranslator(writer);
536
562
  let consumed = 0;
537
563
  try {
538
564
  consumed = await streamSessionEvents({
@@ -564,15 +590,12 @@ export const runEveAgentTurn = async ({ agentUrl, fallbackMessage, fetchImpl = f
564
590
  throw error;
565
591
  }
566
592
  translator.finalize();
567
- if (translator.isSessionWaiting()) {
568
- const nextHandle = {
569
- sessionId,
593
+ if (sessionTag && translator.isSessionWaiting()) {
594
+ const eveAgent = {
595
+ session: sessionTag,
570
596
  streamIndex: startIndex + consumed,
571
597
  };
572
- writer.write({
573
- type: "finish",
574
- messageMetadata: { eveAgent: nextHandle },
575
- });
598
+ writer.write({ type: "finish", messageMetadata: { eveAgent } });
576
599
  return;
577
600
  }
578
601
  writer.write({ type: "finish" });
@@ -1,3 +1,4 @@
1
+ import { type ChatMessageFeedback } from "./chat/message-feedback";
1
2
  export interface FeedbackPayload {
2
3
  emotion: string;
3
4
  message: string;
@@ -7,8 +8,21 @@ interface SendFeedbackOptions {
7
8
  siteId?: string;
8
9
  url: string;
9
10
  }
11
+ interface SendChatMessageFeedbackOptions {
12
+ feedback: ChatMessageFeedback;
13
+ siteId?: string;
14
+ }
10
15
  export declare const sendFeedback: ({ url, feedback, siteId, }: SendFeedbackOptions) => Promise<{
11
16
  success: boolean;
12
17
  }>;
18
+ /**
19
+ * Send a thumbs up or down on an Ask AI answer to the central feedback
20
+ * service. The note starts with `[Ask AI]` and carries the question,
21
+ * the sources shown, and the answer; `url` is the page the reader was on and
22
+ * `thumbs` is the vote.
23
+ */
24
+ export declare const sendChatMessageFeedback: ({ feedback, siteId, }: SendChatMessageFeedbackOptions) => Promise<{
25
+ success: boolean;
26
+ }>;
13
27
  export {};
14
28
  //# sourceMappingURL=feedback-action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feedback-action.d.ts","sourceRoot":"","sources":["../../src/internal/feedback-action.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAYD,eAAO,MAAM,YAAY,GAAU,4BAIhC,mBAAmB,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAiCpD,CAAC"}
1
+ {"version":3,"file":"feedback-action.d.ts","sourceRoot":"","sources":["../../src/internal/feedback-action.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,8BAA8B;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA6DD,eAAO,MAAM,YAAY,GAAU,4BAIhC,mBAAmB,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAWpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAU,uBAG3C,8BAA8B,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAiB/D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use server";
2
2
  import { headers } from "next/headers";
3
+ import { CHAT_FEEDBACK_URL_LIMIT, formatChatMessageFeedbackNote, normalizeChatMessageFeedback, } from "./chat/message-feedback";
3
4
  const emotions = [
4
5
  { name: "cry", emoji: "😭" },
5
6
  { name: "sad", emoji: "😕" },
@@ -8,8 +9,7 @@ const emotions = [
8
9
  ];
9
10
  const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
10
11
  const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
11
- export const sendFeedback = async ({ url, feedback, siteId, }) => {
12
- const emoji = emotions.find((emotion) => emotion.name === feedback.emotion)?.emoji;
12
+ const postFeedback = async ({ emotion, maxUrlLength, note, siteId, thumbs, url, }) => {
13
13
  const endpoint = new URL("/feedback", "https://geistdocs.com/feedback");
14
14
  const headersList = await headers();
15
15
  try {
@@ -19,9 +19,10 @@ export const sendFeedback = async ({ url, feedback, siteId, }) => {
19
19
  "Content-Type": "application/json",
20
20
  },
21
21
  body: JSON.stringify({
22
- note: feedback.message,
23
- url: new URL(url, baseUrl).toString(),
24
- emotion: emoji,
22
+ note,
23
+ url: new URL(url, baseUrl).toString().slice(0, maxUrlLength),
24
+ emotion,
25
+ thumbs,
25
26
  ua: headersList.get("user-agent") ?? undefined,
26
27
  ip: headersList.get("x-real-ip") || headersList.get("x-forwarded-for"),
27
28
  label: siteId,
@@ -38,3 +39,34 @@ export const sendFeedback = async ({ url, feedback, siteId, }) => {
38
39
  return { success: false };
39
40
  }
40
41
  };
42
+ export const sendFeedback = async ({ url, feedback, siteId, }) => {
43
+ const emoji = emotions.find((emotion) => emotion.name === feedback.emotion)?.emoji;
44
+ return await postFeedback({
45
+ emotion: emoji,
46
+ note: feedback.message,
47
+ siteId,
48
+ url,
49
+ });
50
+ };
51
+ /**
52
+ * Send a thumbs up or down on an Ask AI answer to the central feedback
53
+ * service. The note starts with `[Ask AI]` and carries the question,
54
+ * the sources shown, and the answer; `url` is the page the reader was on and
55
+ * `thumbs` is the vote.
56
+ */
57
+ export const sendChatMessageFeedback = async ({ feedback, siteId, }) => {
58
+ // Server actions accept any input, so re-validate and re-cap here.
59
+ const normalized = normalizeChatMessageFeedback(feedback);
60
+ if (!normalized) {
61
+ return { success: false };
62
+ }
63
+ // The service labels `thumbs` votes; it only maps the four page-feedback
64
+ // emoji in `emotion`, so the vote emoji goes in the note instead.
65
+ return await postFeedback({
66
+ maxUrlLength: CHAT_FEEDBACK_URL_LIMIT,
67
+ note: formatChatMessageFeedbackNote(normalized),
68
+ siteId: typeof siteId === "string" ? siteId : undefined,
69
+ thumbs: normalized.vote,
70
+ url: normalized.pageUrl,
71
+ });
72
+ };
@@ -11,6 +11,15 @@ interface PageActionsProps {
11
11
  page: {
12
12
  markdownUrl: string;
13
13
  path?: string;
14
+ /**
15
+ * Whether "Ask AI about this page" attaches the page to the next Ask AI
16
+ * message. Pages the chat route cannot resolve, such as changelog
17
+ * entries, set `false` to pre-fill a prompt with the page URL instead.
18
+ * @default true
19
+ */
20
+ attachToChat?: boolean;
21
+ /** Page title, shown when the page is attached to an Ask AI message. */
22
+ title?: string;
14
23
  url: string;
15
24
  };
16
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBjD,UAAU,gBAAgB;IACxB,M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,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAqrBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDA8GlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
@@ -8,7 +8,7 @@ import { LogoIconGithub, LogoIconV0 } from "#geistdocs-assets/logos";
8
8
  import { Button } from "#geistdocs-ui/components/button";
9
9
  import { Textarea } from "#geistdocs-ui/components/textarea";
10
10
  import { cn } from "#geistdocs-ui/utils";
11
- import { useGeistdocsChat } from "./chat/context";
11
+ import { useGeistdocsChatContext } from "./chat/context";
12
12
  import { sendFeedback } from "./feedback-action";
13
13
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./ui/dropdown-menu";
14
14
  import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
@@ -198,7 +198,7 @@ const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnab
198
198
  };
199
199
  export const GeistdocsPageActions = ({ config, page, only, }) => {
200
200
  const isMobile = useIsMobile();
201
- const { enabled: chatEnabled, preloadChat, setIsOpen, setPrompt, } = useGeistdocsChat();
201
+ const { enabled: chatEnabled, openWithPage, preloadChat, setIsOpen, setPrompt, } = useGeistdocsChatContext();
202
202
  const [menuView, setMenuView] = useState("main");
203
203
  const openInChatRef = useRef(null);
204
204
  const providersBackRef = useRef(null);
@@ -233,8 +233,12 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
233
233
  const showMobile = only !== "desktop";
234
234
  const onAskAI = () => {
235
235
  preloadChat();
236
- setPrompt(getPageQuery(page.url, window.location.origin));
237
- setIsOpen(true);
236
+ if (page.attachToChat === false) {
237
+ setPrompt(getPageQuery(page.url, window.location.origin));
238
+ setIsOpen(true);
239
+ return;
240
+ }
241
+ openWithPage({ title: page.title, url: page.url });
238
242
  };
239
243
  // Desktop variant aligns beside the title (self-end); the mobile variant is
240
244
  // rendered below the description and left-aligned.
@@ -1 +1 @@
1
- {"version":3,"file":"provider-client.d.ts","sourceRoot":"","sources":["../../src/internal/provider-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAKjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAUjD,KAAK,kBAAkB,GAAG,WAAW,CACnC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,QAAQ,CAAC;IAC3D,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;KACjE,CAAC;CACH;AAmFD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
1
+ {"version":3,"file":"provider-client.d.ts","sourceRoot":"","sources":["../../src/internal/provider-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAKjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAUjD,KAAK,kBAAkB,GAAG,WAAW,CACnC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,QAAQ,CAAC;IAC3D,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;KACjE,CAAC;CACH;AAoFD,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAQ9D,CAAC"}
@@ -5,7 +5,7 @@ import { lazy, Suspense, useCallback, useEffect, } from "react";
5
5
  import { Toasts } from "#geistdocs-ui/components/toasts";
6
6
  import { GeistProvider } from "#geistdocs-ui/core";
7
7
  import { cn } from "#geistdocs-ui/utils";
8
- import { GeistdocsChatProvider, useGeistdocsChat } from "./chat/context";
8
+ import { GeistdocsChatProvider, useGeistdocsChatContext } from "./chat/context";
9
9
  import { ChatLoadingSkeleton } from "./chat/loading-skeleton";
10
10
  import { GeistdocsConfigProvider } from "./config-context";
11
11
  import { createGeistdocsI18n } from "./i18n";
@@ -17,7 +17,7 @@ const GeistdocsChatShell = lazy(() => import("./chat/shell").then(({ GeistdocsCh
17
17
  })));
18
18
  const GeistdocsProviderInner = ({ config, search, theme: _theme, lang, ...props }) => {
19
19
  const { i18n, i18nProvider } = createGeistdocsI18n(config);
20
- const { enabled, hasBeenOpened, isOpen, setIsOpen } = useGeistdocsChat();
20
+ const { enabled, hasBeenOpened, isOpen, setIsOpen } = useGeistdocsChatContext();
21
21
  const isMobile = useIsMobile();
22
22
  useEffect(() => {
23
23
  if (!enabled) {
@@ -1,2 +1,9 @@
1
1
  export declare const useIsMobile: () => boolean;
2
+ /**
3
+ * `useIsMobile` for components that only mount on the client after
4
+ * hydration, such as the lazily loaded chat shell: the first render already
5
+ * has the live value instead of `false`. During server rendering and
6
+ * hydration it returns `false`, like `useIsMobile`.
7
+ */
8
+ export declare const useIsMobileAfterHydration: () => boolean;
2
9
  //# sourceMappingURL=use-mobile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/internal/use-mobile.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,eAEvB,CAAC"}
1
+ {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/internal/use-mobile.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,eAEvB,CAAC;AAYF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eAKnC,CAAC"}
@@ -1,6 +1,22 @@
1
1
  "use client";
2
2
  import { useMediaQuery } from "phase/react";
3
+ import { useSyncExternalStore } from "react";
3
4
  const MOBILE_BREAKPOINT = 768;
5
+ const MOBILE_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`;
4
6
  export const useIsMobile = () => {
5
- return useMediaQuery(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
7
+ return useMediaQuery(MOBILE_QUERY);
6
8
  };
9
+ const subscribeToMobileQuery = (onChange) => {
10
+ const query = window.matchMedia(MOBILE_QUERY);
11
+ query.addEventListener("change", onChange);
12
+ return () => query.removeEventListener("change", onChange);
13
+ };
14
+ const getMobileSnapshot = () => window.matchMedia(MOBILE_QUERY).matches;
15
+ const getServerMobileSnapshot = () => false;
16
+ /**
17
+ * `useIsMobile` for components that only mount on the client after
18
+ * hydration, such as the lazily loaded chat shell: the first render already
19
+ * has the live value instead of `false`. During server rendering and
20
+ * hydration it returns `false`, like `useIsMobile`.
21
+ */
22
+ export const useIsMobileAfterHydration = () => useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);
@@ -1 +1 @@
1
- {"version":3,"file":"webmcp-client.d.ts","sourceRoot":"","sources":["../../src/internal/webmcp-client.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAOhE,eAAO,MAAM,eAAe,GAAI,YAAY;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,mDAqBtE,CAAC"}
1
+ {"version":3,"file":"webmcp-client.d.ts","sourceRoot":"","sources":["../../src/internal/webmcp-client.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAQhE,eAAO,MAAM,eAAe,GAAI,YAAY;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,mDA+BtE,CAAC"}
@@ -1,18 +1,28 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import Script from "next/script";
4
- import { useEffect } from "react";
4
+ import { useEffect, useRef } from "react";
5
5
  import { getPublicPath } from "../config";
6
+ import { useGeistdocsChatContext } from "./chat/context";
6
7
  import { createWebMCPTools, registerWebMCPTools, } from "./webmcp";
7
8
  export const GeistdocsWebMCP = ({ config }) => {
8
9
  const enabled = config.webmcp?.enabled;
10
+ const chat = useGeistdocsChatContext();
11
+ const askAI = Boolean(enabled && config.webmcp?.askAI && chat.enabled);
12
+ // Registered tools outlive renders; the ref keeps `ask_ai` on the current
13
+ // controller without re-registering.
14
+ const askRef = useRef(chat.ask);
15
+ askRef.current = chat.ask;
9
16
  useEffect(() => {
10
17
  const context = document
11
18
  .modelContext;
12
19
  if (!(enabled && context?.registerTool)) {
13
20
  return;
14
21
  }
15
- return registerWebMCPTools(context, createWebMCPTools({ location: window.location }), (error) => console.warn("Geistdocs WebMCP registration failed:", error));
16
- }, [enabled]);
22
+ return registerWebMCPTools(context, createWebMCPTools({
23
+ ask: askAI ? (question) => askRef.current(question) : undefined,
24
+ location: window.location,
25
+ }), (error) => console.warn("Geistdocs WebMCP registration failed:", error));
26
+ }, [askAI, enabled]);
17
27
  return enabled ? (_jsx(Script, { id: "geistdocs-webmcp", src: `${getPublicPath("/api/mcp", config.basePath)}?webmcp-script` })) : null;
18
28
  };
@@ -16,7 +16,11 @@ export interface WebMCPContext {
16
16
  signal: AbortSignal;
17
17
  }) => Promise<void>;
18
18
  }
19
- export declare const createWebMCPTools: ({ fetcher, location, requestTimeoutMs, }: {
19
+ export declare const ASK_AI_QUESTION_MIN_CHARS = 2;
20
+ export declare const ASK_AI_QUESTION_MAX_CHARS = 2000;
21
+ export declare const createWebMCPTools: ({ ask, fetcher, location, requestTimeoutMs, }: {
22
+ /** Registers `ask_ai` when provided; receives the trimmed question. */
23
+ ask?: (question: string) => void;
20
24
  fetcher?: typeof fetch;
21
25
  location: Pick<Location, "href">;
22
26
  requestTimeoutMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"webmcp.d.ts","sourceRoot":"","sources":["../../src/internal/webmcp.ts"],"names":[],"mappings":"AAAA,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,UAAU;IAClB,WAAW,EAAE;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,oBAAoB,EAAE,OAAO,CAAA;KAAE,CAAC;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CACP,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,oBAAoB,KAC3B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,CACZ,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,KAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,GAAI,0CAI/B;I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IACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,KAAG,UAAU,EAmCb,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,aAAa,EACtB,OAAO,UAAU,EAAE,EACnB,SAAS,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,eAoBlC,CAAC"}
@@ -1,4 +1,33 @@
1
- export const createWebMCPTools = ({ fetcher = fetch, location, requestTimeoutMs = 15_000, }) => [
1
+ export const ASK_AI_QUESTION_MIN_CHARS = 2;
2
+ export const ASK_AI_QUESTION_MAX_CHARS = 2000;
3
+ const createAskAITool = (ask) => ({
4
+ name: "ask_ai",
5
+ description: "Ask a question in this documentation site's Ask AI chat. The question is submitted on the user's behalf and the answer streams into the chat panel on the page; this tool does not return the answer.",
6
+ annotations: { readOnlyHint: false, untrustedContentHint: false },
7
+ inputSchema: {
8
+ type: "object",
9
+ properties: {
10
+ question: {
11
+ type: "string",
12
+ description: "The question to ask about this documentation.",
13
+ minLength: ASK_AI_QUESTION_MIN_CHARS,
14
+ maxLength: ASK_AI_QUESTION_MAX_CHARS,
15
+ },
16
+ },
17
+ required: ["question"],
18
+ additionalProperties: false,
19
+ },
20
+ execute: (input) => {
21
+ const question = typeof input?.question === "string" ? input.question.trim() : "";
22
+ if (question.length < ASK_AI_QUESTION_MIN_CHARS ||
23
+ question.length > ASK_AI_QUESTION_MAX_CHARS) {
24
+ return Promise.reject(new Error(`question must be a string of ${ASK_AI_QUESTION_MIN_CHARS} to ${ASK_AI_QUESTION_MAX_CHARS} characters after trimming whitespace.`));
25
+ }
26
+ ask(question);
27
+ return Promise.resolve("Submitted the question to this site's Ask AI chat. The answer appears in the chat panel on the page.");
28
+ },
29
+ });
30
+ export const createWebMCPTools = ({ ask, fetcher = fetch, location, requestTimeoutMs = 15_000, }) => [
2
31
  {
3
32
  name: "read_current_page",
4
33
  description: "Read the current documentation page as Markdown. Navigate to a documentation page before calling this tool.",
@@ -27,6 +56,7 @@ export const createWebMCPTools = ({ fetcher = fetch, location, requestTimeoutMs
27
56
  return response.text();
28
57
  },
29
58
  },
59
+ ...(ask ? [createAskAITool(ask)] : []),
30
60
  ];
31
61
  export const registerWebMCPTools = (context, tools, onError) => {
32
62
  const controller = new AbortController();
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/pages/changelog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,oBAAoB,EAM1B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAID,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B;kBA4G1C,kBAAkB;2BAgBT,kBAAkB;8BAdf,kBAAkB;uCAkBT,kBAAkB;;;;uCAO/D;QACD,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5B;;;;CAUF,CAAC"}
1
+ {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/pages/changelog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,oBAAoB,EAM1B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAID,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B;kBAgH1C,kBAAkB;2BAgBT,kBAAkB;8BAdf,kBAAkB;uCAkBT,kBAAkB;;;;uCAO/D;QACD,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5B;;;;CAUF,CAAC"}
@@ -47,7 +47,11 @@ export const createChangelogPage = (options) => {
47
47
  notFound();
48
48
  }
49
49
  const actionPage = {
50
+ // The chat route does not index changelog entries, so Ask AI pre-fills
51
+ // a prompt with the entry URL instead of attaching the page.
52
+ attachToChat: false,
50
53
  markdownUrl: markdownHref(lang, page),
54
+ title,
51
55
  url: getChangelogPagePath(config, path, lang, page),
52
56
  };
53
57
  return (_jsxs("main", { className: "mx-auto w-full max-w-[1080px] px-6 pt-16 pb-32 font-sans sm:px-10 lg:pt-24", id: "geistdocs-changelog", children: [_jsxs("header", { className: "border-gray-400 border-b pb-12 lg:pb-16", children: [_jsxs("div", { className: "flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", children: [_jsx("h1", { className: "text-gray-1000 text-heading-40 tracking-tighter", children: title }), markdownPath ? (_jsx(GeistdocsPageActions, { config: config, only: "desktop", page: actionPage })) : null] }), _jsx("p", { className: "mt-5 max-w-xl text-balance text-gray-900 text-lg leading-8", children: description }), markdownPath ? (_jsx("div", { className: "mt-5 @min-[961px]:hidden", children: _jsx(GeistdocsPageActions, { config: config, only: "mobile", page: actionPage }) })) : null, page > 1 ? (_jsxs("p", { className: "mt-5 text-gray-900 text-sm", children: ["Page ", page] })) : null] }), _jsx(ChangelogFeed, { dataPath: getChangelogPath(config, dataPath ?? `${path.replace(TRAILING_SLASH_PATTERN, "")}/data`, lang), initialPage: data, lang: lang, path: getChangelogPath(config, path, lang) }, `${lang}:${page}`)] }));
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,QAAQ,IAAI,gBAAgB,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAA+B,MAAM,WAAW,CAAC;AAgB9E,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,KAAK,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACvC,KAAK,qBAAqB,GAAG,WAAW,CACtC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAC1D,CAAC;AACF,MAAM,WAAW,cACf,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB,CACpC,MAAM,SAAS,cAAc,GAAG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