@boldare/askdare 0.3.0 → 0.5.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 (52) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +14 -4
  3. package/dist/cli.js +111 -26
  4. package/dist/define-tool.js +1006 -8
  5. package/dist/embed.d.ts +19 -0
  6. package/dist/embed.js +250 -0
  7. package/dist/{store.d.ts → events.d.ts} +163 -54
  8. package/dist/index.d.ts +28 -2
  9. package/dist/index.js +74 -158
  10. package/dist/next.d.ts +70 -9
  11. package/dist/next.js +767 -169
  12. package/dist/react-marked.js +648 -624
  13. package/dist/react.d.ts +63 -77
  14. package/dist/react.js +148 -1854
  15. package/dist/root.js +2254 -0
  16. package/dist/tool-results.d.ts +140 -0
  17. package/dist/ui/askdare.css +21 -1
  18. package/dist/ui/avatar.tsx +1 -1
  19. package/dist/ui/chat.tsx +1 -1
  20. package/dist/ui/confirm.tsx +1 -1
  21. package/dist/ui/context.ts +1 -1
  22. package/dist/ui/feedback.tsx +1 -1
  23. package/dist/ui/footer.tsx +3 -15
  24. package/dist/ui/header.tsx +1 -1
  25. package/dist/ui/icons.tsx +1 -1
  26. package/dist/ui/index.ts +1 -1
  27. package/dist/ui/message.tsx +6 -4
  28. package/dist/ui/panel.tsx +17 -6
  29. package/dist/ui/welcome.tsx +1 -1
  30. package/docs/accessibility.md +83 -0
  31. package/docs/cli.md +5 -3
  32. package/docs/compliance.md +160 -0
  33. package/docs/configuration.md +58 -2
  34. package/docs/costs.md +8 -1
  35. package/docs/custom-store.md +2 -0
  36. package/docs/embedding.md +104 -0
  37. package/docs/events.md +1 -1
  38. package/docs/feedback.md +1 -1
  39. package/docs/going-public.md +15 -3
  40. package/docs/guardrails.md +128 -0
  41. package/docs/migrating-from-openai-assistant.md +1 -1
  42. package/docs/privacy.md +27 -3
  43. package/docs/protocol.md +15 -1
  44. package/docs/react.md +57 -3
  45. package/docs/styling.md +4 -3
  46. package/docs/support.md +3 -3
  47. package/docs/texts.md +127 -98
  48. package/docs/tools.md +20 -0
  49. package/docs/troubleshooting.md +30 -3
  50. package/llms.txt +14 -11
  51. package/package.json +10 -6
  52. package/skills/askdare/SKILL.md +12 -2
@@ -0,0 +1,140 @@
1
+
2
+ import { ComponentProps, ComponentType, ReactElement } from "react";
3
+ declare const PRESET_NAMES: readonly ["halo", "aura", "sage", "care"];
4
+ type PresetName = (typeof PRESET_NAMES)[number];
5
+ /** Component variants a preset picks; each becomes a `data-ask-*` attribute on the document. */
6
+ interface ThemeVariants {
7
+ readonly avatar: "orb" | "icon" | "initials" | "none";
8
+ readonly welcome: "hero" | "persona" | "intro";
9
+ readonly launcher: "orb" | "circle" | "pill";
10
+ readonly bubbles: "filled" | "plain";
11
+ readonly surface: "solid" | "glass";
12
+ readonly density: "comfortable" | "compact";
13
+ readonly composer: "outline" | "gradient";
14
+ /** Where the latest answer's options show: under it, or in one row above the message field. */
15
+ readonly replies: "answer" | "composer";
16
+ }
17
+ /** What a visitor may attach, as the bot allows it. */
18
+ interface ChatAttachments {
19
+ readonly images: boolean;
20
+ readonly pdf: boolean;
21
+ readonly maxBytes: number;
22
+ readonly maxPerMessage: number;
23
+ readonly maxPdfPages: number;
24
+ }
25
+ /** A bot's public widget settings, in the visitor's language. */
26
+ interface ChatWidget {
27
+ readonly title: string;
28
+ readonly subtitle: string;
29
+ readonly greeting: string;
30
+ readonly placeholder: string;
31
+ /** The language this visitor sees. */
32
+ readonly locale: string;
33
+ readonly starters: readonly string[];
34
+ readonly avatar: string | undefined;
35
+ readonly launcherLabel: string;
36
+ readonly disclosure: false | {
37
+ readonly privacyUrl: string | undefined;
38
+ };
39
+ readonly preset: PresetName;
40
+ readonly variants: ThemeVariants;
41
+ /** `auto` follows the visitor's system setting. */
42
+ readonly colorScheme: "auto" | "light" | "dark";
43
+ /** Every text in the visitor's language, overrides applied; plural keys included. */
44
+ readonly texts: Readonly<Record<string, string>>;
45
+ }
46
+ /** Stylesheets of a chat inside a page, served by the chat route (ADR-0011). */
47
+ interface ChatStyles {
48
+ /** The bot's tokens for both color schemes, then its own `widget.css`. */
49
+ readonly theme: string;
50
+ /** The default look; only `DefaultChat` loads it. */
51
+ readonly skin: string;
52
+ /** `@font-face` rules of the built-in themes; browsers fetch only the fonts in use. */
53
+ readonly fonts: string;
54
+ }
55
+ /** What the browser needs to run one bot's chat. Public: it never holds secrets (ADR-0008). */
56
+ interface ChatConfig {
57
+ readonly protocolVersion: number;
58
+ /** Path of the chat route, such as `/api/chat`. Same origin only (ADR-0011). */
59
+ readonly basePath: string;
60
+ readonly botId: string;
61
+ readonly widget: ChatWidget;
62
+ /** Whether the bot accepts a description of the page it is on. */
63
+ readonly pageContext: boolean;
64
+ /** Whether the bot lets visitors rate answers. Answers carry a handle when the route takes ratings. */
65
+ readonly feedback: boolean;
66
+ /** Absent when attachments are off. */
67
+ readonly attachments?: ChatAttachments;
68
+ /** Absent when voice input is off. The model stays on the server. */
69
+ readonly voice?: {
70
+ readonly maxSeconds: number;
71
+ };
72
+ /** From `getChatConfig`, for a chat inside a page. The iframe links its own stylesheets. */
73
+ readonly styles?: ChatStyles;
74
+ /**
75
+ * Absent unless the bot has `security.humanVerifier`: the challenge the chat shows before a new
76
+ * session starts, rendered by `HumanCheck`.
77
+ */
78
+ readonly humanCheck?: ChatHumanCheck;
79
+ }
80
+ /** A human check the chat must pass before it connects; public, the site key only. */
81
+ interface ChatHumanCheck {
82
+ readonly provider: "turnstile";
83
+ readonly siteKey: string;
84
+ }
85
+ /** What `EmbedRoot` from `@boldare/askdare/embed` needs; `getEmbedConfig` builds it (ADR-0018). */
86
+ interface EmbedChatConfig extends ChatConfig {
87
+ /** Origins whose pages may hand the chat its connection to the loader (ADR-0005). */
88
+ readonly allowedOrigins: readonly string[];
89
+ /** `inline` inside an element of the host page, `floating` in the widget's panel. */
90
+ readonly mode: "floating" | "inline";
91
+ }
92
+ /**
93
+ * What a tool's `ui` returns, read from its type (`typeof myTool`) with `import type`, so no server
94
+ * code reaches the page. Structural, so the page needs only the tool's type.
95
+ */
96
+ type ToolData<T> = T extends {
97
+ readonly ui?: ((output: never) => infer Ui) | undefined;
98
+ } ? Exclude<Ui, null | undefined> : never;
99
+ /** Any tool: without a type argument, a component gets `data: unknown` and any name. */
100
+ interface AnyTool {
101
+ readonly name: string;
102
+ readonly ui?: ((output: never) => unknown) | undefined;
103
+ }
104
+ /** What a component registered for a tool gets (ADR-0017). */
105
+ interface ToolRendererProps<T extends {
106
+ readonly name: string;
107
+ } = AnyTool> {
108
+ /** What the tool's `ui` picked from its result: plain JSON. Render it as text, never as HTML. */
109
+ readonly data: ToolData<T>;
110
+ /** The tool's name. */
111
+ readonly name: T["name"];
112
+ /** The call, stable for the answer. */
113
+ readonly callId: string;
114
+ }
115
+ /**
116
+ * Components by tool name for `Root`'s `toolRenderers`. Without a type argument, any component per
117
+ * name; with your tools, each component checked against its tool's payload:
118
+ * `{ find_slots: SlotList } satisfies ToolRenderers<[typeof findSlots]>`.
119
+ */
120
+ type ToolRenderers<Tools extends readonly {
121
+ readonly name: string;
122
+ }[] = never> = [Tools] extends [never] ? Readonly<Record<string, ComponentType<ToolRendererProps<never>>>> : { readonly [T in Tools[number] as T["name"]]?: ComponentType<ToolRendererProps<T>>; };
123
+ type ToolResultsProps = ComponentProps<"div">;
124
+ /**
125
+ * The current message's tool payloads (ADR-0017), each drawn by the component registered for its
126
+ * tool in `Root`'s `toolRenderers`, in call order: a group (`tool-results`) of cards
127
+ * (`tool-result`, with `data-ask-tool`). A payload without a component shows nothing, and when
128
+ * `toolRenderers` is set the console says so once per tool. Use it inside `MessageList`.
129
+ */
130
+ declare function ToolResults(props: ToolResultsProps): ReactElement | null;
131
+ type LinkProps = Omit<ComponentProps<"a">, "href" | "target" | "rel"> & {
132
+ readonly href: string;
133
+ };
134
+ /**
135
+ * A link for a URL from a tool's payload: only `https:`, `http:` and `mailto:`, opened in a new
136
+ * tab, as links in answers are. Any other URL (`javascript:`, `data:`, a relative path) renders
137
+ * the text alone.
138
+ */
139
+ declare function Link({ href, children, ...props }: LinkProps): ReactElement;
140
+ export { ToolResults as a, ChatConfig as c, ChatWidget as d, EmbedChatConfig as f, ToolRenderers as i, ChatHumanCheck as l, ThemeVariants as m, LinkProps as n, ToolResultsProps as o, PresetName as p, ToolRendererProps as r, ChatAttachments as s, Link as t, ChatStyles as u };
@@ -1,4 +1,4 @@
1
- /* Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change. */
1
+ /* Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change. */
2
2
  /*
3
3
  * Default skin of the chat (ADR-0008, ADR-0011), in the iframe and inside a page. Everything is
4
4
  * built on the public styling API: the --ask-* tokens (set per bot by the theme stylesheet), the
@@ -523,6 +523,18 @@
523
523
  font-size: 0.8rem;
524
524
  }
525
525
 
526
+ /* Tool cards (ADR-0017): the cards are the site's components; the skin only spaces them. */
527
+ [data-ask-part="tool-results"]:where([data-ask-skin] *) {
528
+ display: grid;
529
+ gap: 8px;
530
+ min-width: 0;
531
+ }
532
+
533
+ [data-ask-part="tool-result"]:where([data-ask-skin] *) {
534
+ min-width: 0;
535
+ overflow-wrap: anywhere;
536
+ }
537
+
526
538
  [data-ask-part="citations"]:where([data-ask-skin] *) {
527
539
  display: flex;
528
540
  flex-wrap: wrap;
@@ -1079,6 +1091,14 @@
1079
1091
  }
1080
1092
  }
1081
1093
 
1094
+ /* ---------- Human check (Turnstile draws its own frame inside) ---------- */
1095
+
1096
+ [data-ask-part="human-check"]:where([data-ask-skin] *) {
1097
+ display: flex;
1098
+ justify-content: center;
1099
+ margin: 0 calc(var(--ask-space) * 1.5) var(--ask-space);
1100
+ }
1101
+
1082
1102
  /* ---------- Errors ---------- */
1083
1103
 
1084
1104
  [data-ask-part="error"]:where([data-ask-skin] *) {
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import type { ReactElement } from 'react';
3
3
  import { useSkin } from './context';
4
4
  import { SparkIcon } from './icons';
package/dist/ui/chat.tsx CHANGED
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  'use client';
3
3
 
4
4
  // The entry of an ejected copy (`npx @boldare/askdare add ui`): the same DefaultChat as in
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import { useChat } from '@boldare/askdare/react';
3
3
  import { type KeyboardEvent, type ReactElement, useEffect, useId, useRef } from 'react';
4
4
  import { RestartIcon } from './icons';
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import type { ChatBot, Translate } from '@boldare/askdare/react';
3
3
  import { type Context, createContext, type RefObject, useContext } from 'react';
4
4
 
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import { FeedbackButton, useChat, useChatState, useMessage } from '@boldare/askdare/react';
3
3
  import { type FormEvent, type ReactElement, useEffect, useId, useRef, useState } from 'react';
4
4
  import { useSkin } from './context';
@@ -1,8 +1,9 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import {
3
3
  AttachButton,
4
4
  Composer,
5
5
  DictateButton,
6
+ Disclosure,
6
7
  Files,
7
8
  Input,
8
9
  QuickReplies,
@@ -46,20 +47,7 @@ export function DefaultFooter(): ReactElement {
46
47
  )}
47
48
  </div>
48
49
  </Composer>
49
- {bot.disclosure !== false && (
50
- // The AI notice (EU AI Act, art. 50).
51
- <p data-ask-part="disclosure">
52
- {t('disclosure.text')}
53
- {bot.disclosure.privacyUrl && (
54
- <>
55
- {' '}
56
- <a href={bot.disclosure.privacyUrl} target="_blank" rel="noopener noreferrer">
57
- {t('disclosure.privacy')}
58
- </a>
59
- </>
60
- )}
61
- </p>
62
- )}
50
+ <Disclosure />
63
51
  </>
64
52
  );
65
53
  }
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import { useChat } from '@boldare/askdare/react';
3
3
  import type { ReactElement } from 'react';
4
4
  import { Avatar } from './avatar';
package/dist/ui/icons.tsx CHANGED
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import type { ReactElement, ReactNode } from 'react';
3
3
 
4
4
  /** Line icons on a 24px grid, drawn with the current text color. */
package/dist/ui/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  'use client';
3
3
 
4
4
  // The default look of the chat (ADR-0011): what `npx @boldare/askdare add ui` copies into an app.
@@ -1,10 +1,11 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import {
3
3
  Citations,
4
4
  Message,
5
5
  MessageFiles,
6
6
  MessageText,
7
7
  QuickReplies,
8
+ ToolResults,
8
9
  useMessage,
9
10
  } from '@boldare/askdare/react';
10
11
  import type { ReactElement } from 'react';
@@ -13,9 +14,9 @@ import { useSkin } from './context';
13
14
  import { Feedback } from './feedback';
14
15
 
15
16
  /**
16
- * One message: the assistant's face beside its answers, then text, files, sources, rating and,
17
- * under the latest answer, the options the visitor can click (unless the theme puts them above
18
- * the message field).
17
+ * One message: the assistant's face beside its answers, then text, tool cards, files, sources,
18
+ * rating and, under the latest answer, the options the visitor can click (unless the theme puts
19
+ * them above the message field).
19
20
  */
20
21
  export function DefaultMessage(): ReactElement {
21
22
  const message = useMessage();
@@ -25,6 +26,7 @@ export function DefaultMessage(): ReactElement {
25
26
  {message.role === 'assistant' && <Avatar size="small" />}
26
27
  <div data-ask-part="message-body">
27
28
  <MessageText />
29
+ <ToolResults />
28
30
  <MessageFiles />
29
31
  <Citations />
30
32
  <Feedback />
package/dist/ui/panel.tsx CHANGED
@@ -1,11 +1,13 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import {
3
3
  ErrorMessage,
4
+ HumanCheck,
4
5
  MessageList,
5
6
  Messages,
6
7
  Panel,
7
8
  Status,
8
9
  useChat,
10
+ useFrame,
9
11
  } from '@boldare/askdare/react';
10
12
  import {
11
13
  type ComponentType,
@@ -34,23 +36,31 @@ export interface DefaultChatComponents {
34
36
  }
35
37
 
36
38
  export interface DefaultPanelProps {
37
- /** Level of the chat's title (default 2); 1 makes the chat the page's main landmark. */
39
+ /**
40
+ * Level of the chat's title (default 2, or 1 inside `EmbedRoot`); 1 makes the chat the page's
41
+ * main landmark.
42
+ */
38
43
  readonly headingLevel?: 1 | 2 | 3 | 4 | 5;
39
- /** Shows a close button, and Escape calls it too. */
44
+ /** Shows a close button, and Escape calls it too. Inside `EmbedRoot`, it closes the widget by default. */
40
45
  readonly onClose?: (() => void) | undefined;
41
46
  readonly components?: DefaultChatComponents | undefined;
42
47
  }
43
48
 
44
49
  /** The default look of the chat inside its frame: header, conversation and message field. */
45
50
  export function DefaultPanel({
46
- headingLevel = 2,
47
- onClose,
51
+ headingLevel: level,
52
+ onClose: close,
48
53
  components = {},
49
- ownsDocument = false,
54
+ ownsDocument: owns = false,
50
55
  }: DefaultPanelProps & {
51
56
  /** The chat is the whole document, as in its iframe: Escape works wherever focus is. */
52
57
  readonly ownsDocument?: boolean;
53
58
  }): ReactElement {
59
+ // On a site's own page in the widget's iframe (EmbedRoot), the chat is the document there too.
60
+ const frame = useFrame();
61
+ const headingLevel = level ?? (frame ? 1 : 2);
62
+ const onClose = close ?? frame?.close;
63
+ const ownsDocument = owns || frame !== null;
54
64
  const { state, actions, bot, t } = useChat();
55
65
  const [confirming, setConfirming] = useState(false);
56
66
  /** Accepted, and the server is deleting the conversation: the question stays, busy, until then. */
@@ -119,6 +129,7 @@ export function DefaultPanel({
119
129
  <MessageList>{message}</MessageList>
120
130
  <Status />
121
131
  </Messages>
132
+ <HumanCheck />
122
133
  <ErrorMessage />
123
134
  <Footer />
124
135
  </Panel>
@@ -1,4 +1,4 @@
1
- // Ejected from @boldare/askdare@0.3.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
1
+ // Ejected from @boldare/askdare@0.5.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
2
2
  import { useChat } from '@boldare/askdare/react';
3
3
  import type { ReactElement, ReactNode } from 'react';
4
4
  import { Avatar } from './avatar';
@@ -0,0 +1,83 @@
1
+ # Accessibility
2
+
3
+ This is askdare's accessibility conformance statement. It says what the widget and its default look aim for, how that was checked, and what is known not to work yet. Why askdare cares, and what the European Accessibility Act asks of your site, is in [Compliance](compliance.md#5-accessibility).
4
+
5
+ **Last reviewed: 2026-11-21**, against the 0.5 development line (after 0.4.0). The statement is updated whenever the chat's markup changes.
6
+
7
+ ## Status
8
+
9
+ askdare targets [WCAG 2.2](https://www.w3.org/TR/WCAG22/) Level AA, the level that [ETSI EN 301 549 V4.1.1](https://www.etsi.org/deliver/etsi_en/301500_301599/301549/04.01.01_60/en_301549v040101p.pdf) asks for web content.
10
+
11
+ - **Automated checks:** no failures (axe-core, every built-in theme and state, five browser setups including Safari's engine on an iPhone viewport).
12
+ - **Manual review of the WCAG 2.2 criteria axe can't check:** no failures in the chat. One known limitation, with a fix for full-screen chats; see [2.4.11](#manual-review).
13
+ - **Screen readers:** not tested by hand. askdare doesn't run manual checks with VoiceOver or NVDA; the tests check what screen readers rely on instead (roles, names, live regions, and the finished answer announced once).
14
+
15
+ With the known limitations below and no screen-reader testing, the status is **partially conformant**.
16
+
17
+ ## Scope
18
+
19
+ What this statement covers:
20
+
21
+ - the launcher and the chat in its iframe, as `widget.js` adds them to a page;
22
+ - the default look (`DefaultChat`, `DefaultPanel`) in all four built-in themes (Halo, Aura, Sage, Care), light and dark;
23
+ - the same look inside your page with `@boldare/askdare/react` ([React](react.md));
24
+ - the built-in texts in every built-in language ([Texts](texts.md)).
25
+
26
+ What it doesn't cover, so it is yours to check:
27
+
28
+ - **Your page around the chat**, including where you put the launcher and on which pages.
29
+ - **Your own markup**: headless primitives, an ejected skin (`add ui`), your own components in `components`, and tool cards from `toolRenderers`. The primitives keep their roles, names and live regions; how you lay them out and style them is up to you.
30
+ - **Your theme and CSS**: a custom theme's colors, `widget.css`, and `::part()` rules. In development, askdare warns when a theme's colors miss AA contrast.
31
+ - **What the model writes.** Answers are rendered from Markdown into real headings, lists, tables and links, but their wording, heading order, link text and language come from the model and your instructions.
32
+ - The askdare website.
33
+
34
+ ## Method
35
+
36
+ ### Automated, on every change
37
+
38
+ - **axe-core** (4.14, through `@axe-core/playwright`) with the rules tagged `wcag2a`, `wcag2aa`, `wcag21a`, `wcag21aa`, `wcag22aa` and `best-practice`. Selecting by tag also runs the rules axe leaves off by default, such as `target-size` (2.5.8). It runs on:
39
+ - every built-in theme in both schemes, in every state of the gallery: welcome, conversation, streaming, attachments, error, dictation, rating, reply options under the answer and above the message field;
40
+ - the launcher on a third-party page, and the open chat after a real answer;
41
+ - the chat inside a page.
42
+ - **Browsers:** Chromium, Firefox and WebKit on a desktop viewport, and Chromium emulating a phone (Pixel 7: a 412 px wide touch screen).
43
+ - **Contrast:** axe can't measure text over the themes' gradients (it reports those as "needs review"), so unit tests check every built-in theme's colors instead: AA for all, and AAA for text in Care.
44
+ - **Behaviour tests:**
45
+ - a finished answer is announced once, as rendered text, and not while it streams;
46
+ - a restored conversation is not read out;
47
+ - no control is covered by the rest of the chat when it has focus (2.4.11);
48
+ - focus doesn't go behind a full-screen chat (2.4.11);
49
+ - Escape closes the chat and returns focus to what opened it.
50
+
51
+ ### Manual review
52
+
53
+ The WCAG 2.2 criteria that automated tools can't decide were reviewed by hand on 2026-11-21, against the markup and behaviour of the chat:
54
+
55
+ | Criterion | Result | What was checked |
56
+ | --- | --- | --- |
57
+ | 2.4.11 Focus Not Obscured (Minimum) | Passes in the chat; one limitation on the page | Inside the chat, the header and the message field sit outside the scrolling message list, so they never cover what has focus (also a test). A chat that fills the screen (on a phone, or a desktop page zoomed to 400%) keeps focus inside it until it is closed. On a wider screen, the open chat floats over a corner of your page and isn't modal: see [Known limitations](#known-limitations). |
58
+ | 2.5.7 Dragging Movements | Passes | Nothing needs dragging. Files can be dropped onto the chat, and the attach button does the same with a single click or tap. |
59
+ | 2.5.8 Target Size (Minimum) | Passes | axe's `target-size` rule in every state and on a phone. The launcher is at least 56 by 56 px. |
60
+ | 3.2.6 Consistent Help | Passes for the chat; the rest is your site's | The launcher sits in the same corner of every page that loads `widget.js`, and the chat is the same on each. Which pages load it, and any `::part(launcher)` rule that moves it, are your choice: to meet 3.2.6 on your site, keep it in the same place on every page that has it. |
61
+ | 3.3.8 Accessible Authentication (Minimum) | Passes | The chat asks for no password or code. Signed-in visitors are identified by your backend, without anything for them to type. The optional human check (Cloudflare Turnstile) is not a puzzle: it usually passes without interaction, and at most asks for one click on a checkbox. |
62
+
63
+ ## How the chat works with assistive technology
64
+
65
+ - **The conversation** is a `log`, but not a live region: text that grows inside a message is read in fragments or not at all, so the chat doesn't rely on it. When an answer finishes, its rendered text is announced **once** through a separate, visually hidden `status` region. Answers restored after a reload are not read out.
66
+ - **What the assistant is doing** (loading, thinking, searching, using a tool) is a polite `status`. **Errors** are an `alert`.
67
+ - **The panel** is a labelled `region`, or `main` when the chat is the whole page. The launcher says whether the chat is open (`aria-expanded`), and its name starts with its visible label.
68
+ - **Keyboard:** everything works with the keyboard. Enter sends and Shift+Enter starts a new line. Escape dismisses the "Start over" question if it is open, else cancels a dictation, else closes the chat. Closing returns focus to whatever opened the chat. "Start over" asks in a dialog, and focus comes back to its button.
69
+ - **Motion:** the chat follows `prefers-reduced-motion`: no entrance animations, and the launcher and panel open and close without movement.
70
+ - **Zoom and reflow:** the widget's chat fills the screen at 480 CSS pixels and narrower, which covers phones and a desktop page zoomed to 400%.
71
+
72
+ ## Known limitations
73
+
74
+ - **Screen readers aren't tested by hand.** Problems found with VoiceOver, NVDA or TalkBack are fixed as bugs; please report them.
75
+ - **On a wide screen, the open chat floats over your page.** It is a non-modal dialog in a corner. If a visitor tabs out of it into your page, the element that gets focus may sit behind the chat (2.4.11). Escape closes it while focus is in the chat, and the launcher closes it from the page. A chat that fills the screen doesn't have this problem, since focus stays in it.
76
+ - **The launcher can cover your page's content.** It is fixed to a corner of the window, so an element of your page that scrolls under it can be partly hidden when it gets focus. Leave room for it at the bottom of your page, or move it with `::part(launcher)` ([Styling](styling.md)).
77
+ - **The finished answer is announced in full.** A long answer is long to listen to; a screen reader's own "stop speaking" key interrupts it. Its copy stays in the hidden region until the next answer, so reading the whole page in order meets the latest answer twice.
78
+ - **Answers in another language** than the chat's are not marked with their own `lang`, so a screen reader may read them with the wrong voice (3.1.2).
79
+ - **Dictation needs a microphone.** Typing always works instead.
80
+
81
+ ## Feedback
82
+
83
+ Found an accessibility problem? Please [open an issue](https://github.com/boldare/askdare/issues) with the browser, the assistive technology and what happened. Problems that block a visitor are fixed first.
package/docs/cli.md CHANGED
@@ -113,21 +113,23 @@ Without `--env-file`, `doctor` reads the environment the way `next dev` does: va
113
113
 
114
114
  | Check | Passes when | The key permission it names when it fails |
115
115
  | --- | --- | --- |
116
- | Model | The bot's model is available to the OpenAI project. A key that may not look up models gives a warning instead. | List models: Read |
116
+ | Model | The bot's model is available to the OpenAI project. A key that may not look up models gives a warning instead. So does a model OpenAI has announced a shutdown for: the warning gives the date from the OpenAI API and links to the [deprecations page](https://developers.openai.com/api/docs/deprecations), which names the replacement. | List models: Read |
117
117
  | Responses | The key can create a 16-token response with the bot's model. | Responses API: Write |
118
118
  | Conversations | The key can create and delete a conversation. | Write access to conversations |
119
119
  | Knowledge base | Only with `knowledge`: the vector store exists in the project and hasn't expired. A store without searchable documents, or with documents still indexing or failed, gives a warning. | Vector Stores: Read |
120
- | Voice input | Only with `voice`: the transcription model is available, and the key can transcribe one second of silence. | Model capabilities: Request |
120
+ | Voice input | Only with `voice`: the transcription model is available, and the key can transcribe one second of silence. A transcription model with an announced shutdown gives a warning with the date, like the bot's model. | Model capabilities: Request |
121
121
  | Attachments | Only with `attachments`: the key can upload and delete a small file. | Files: Write |
122
122
  | Headers | `widget.js?bot=<id>` answers with JavaScript, and the chat page answers without a redirect, without `X-Frame-Options` and with exactly one `frame-ancestors`. It lists the sites that may embed the chat, and warns when something sets cookies. | |
123
123
  | `--origin` | The site is the app itself or is in the bot's `security.allowedOrigins`. | |
124
+ | Your own page | Only with `embedPath`: the chat page redirects to it, and the page answers without a redirect (a login or a `proxy.ts` rewrite), renders `EmbedRoot`, has exactly one `frame-ancestors` that lists the app and every allowed origin and nothing more, and keeps the microphone off for a bot without voice input. The fixes name `embedPageHeaders`. | |
124
125
  | Timeout | The route's `maxDuration` is at least the bot's `limits.turnTimeoutMs` plus 15 seconds. Otherwise it's a warning. | |
126
+ | AI notice | A bot with `widget.disclosure: false` gets an information line, neither a warning nor a problem: fine when your page already tells visitors they are talking to an AI ([Compliance](compliance.md#1-telling-visitors-they-talk-to-an-ai)). | |
125
127
 
126
128
  `doctor` also says when OpenAI rejects the key, or when the project is out of credit. Each run makes a few small OpenAI requests per bot, and everything it creates is deleted straight away. The app accepts one run at a time, and at most 3 a minute.
127
129
 
128
130
  ### Output
129
131
 
130
- `✓` is fine, `!` is a warning and `✗` is a problem. A line starting with `→` says what to do:
132
+ `✓` is fine, `i` is information, `!` is a warning and `✗` is a problem. A line starting with `→` says what to do:
131
133
 
132
134
  ```text
133
135
  askdare doctor