inline-chat-kit 0.54.3 → 0.55.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.
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ import { InlineAnimConfig } from '../ChatInput/ChatInput';
3
+ import { FoldMotion } from '../QuestionGroup/QuestionGroup';
4
+ import { IntroMotion } from './IntroLanding';
5
+ export interface ChatExperienceDemoProps {
6
+ /** The host's mark, on the landing page. */
7
+ logo?: ReactNode;
8
+ /** The way back out of the landing page — an `<a>`, or a framework `<Link>`,
9
+ which renders one. Styled by the kit; the destination is the host's. */
10
+ back?: ReactNode;
11
+ /** Where the header's back control goes, once you are in the chat. */
12
+ backHref?: string;
13
+ backLabel?: string;
14
+ /** Start in the chat rather than on the landing page. */
15
+ skipIntro?: boolean;
16
+ /** The theme, if the host keeps it. Left off, the header's own toggle does. */
17
+ theme?: "light" | "dark" | null;
18
+ onThemeChange?: (theme: "light" | "dark") => void;
19
+ /** Development chrome the playground turns on and nobody else does. */
20
+ cursor?: boolean;
21
+ /** Motion, opened up so a tuning panel can reach it. */
22
+ animationConfig?: InlineAnimConfig;
23
+ foldMotion?: FoldMotion;
24
+ feedDelay?: number;
25
+ introMotion?: IntroMotion;
26
+ }
27
+ export declare function ChatExperienceDemo({ logo, back, backHref, backLabel, skipIntro, theme, onThemeChange, cursor, animationConfig, foldMotion, feedDelay, introMotion, }: ChatExperienceDemoProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { InlineChatFeatureStatus } from './featureStatus';
2
+ interface InlineChatBannerProps {
3
+ status: InlineChatFeatureStatus;
4
+ }
5
+ export declare function InlineChatBanner({ status }: InlineChatBannerProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,43 @@
1
+ import { ReactNode } from 'react';
2
+ import { INLINE_CHAT_FEATURE_STATUS } from './featureStatus';
3
+ /**
4
+ * The page in front of the demo: what this is, what works, and a way in.
5
+ *
6
+ * Two copies of it before this, in the playground and on the website, along
7
+ * with two copies of its stylesheet. The stylesheet is the reason it is worth
8
+ * moving rather than leaving: it reached for `--color-bg-page`,
9
+ * `--font-geist-sans` and `--font-jetbrains-mono`, none of which the kit
10
+ * defines — so it rendered correctly only in a host that happened to have
11
+ * them, and silently fell back to a serif on a white page in one that did
12
+ * not. It is on `--ick-` tokens now, which the kit ships.
13
+ *
14
+ * What a host still gives it: the logo, and where "back" goes. Its identity.
15
+ */
16
+ /** How the intro arrives, and how it leaves for the chat. Exposed so a tuning
17
+ panel can reach it; every number has a default that works. */
18
+ export interface IntroMotion {
19
+ staggerIn?: number;
20
+ stiffness?: number;
21
+ damping?: number;
22
+ offsetIn?: number;
23
+ blurIn?: number;
24
+ staggerOut?: number;
25
+ durationOut?: number;
26
+ offsetOut?: number;
27
+ blurOut?: number;
28
+ }
29
+ export interface IntroLandingProps {
30
+ /** The host's mark. Nothing is drawn in its place if it is left off. */
31
+ logo?: ReactNode;
32
+ /** The way back out, rendered as given — an `<a>`, a framework `<Link>`. */
33
+ back?: ReactNode;
34
+ onStart: () => void;
35
+ welcome?: string;
36
+ title?: string;
37
+ version?: string;
38
+ description?: string;
39
+ /** What the demo can actually do. Defaults to the kit's own list. */
40
+ status?: typeof INLINE_CHAT_FEATURE_STATUS;
41
+ motionConfig?: IntroMotion;
42
+ }
43
+ export declare function IntroLanding({ logo, back, onStart, welcome, title, version, description, status, motionConfig, }: IntroLandingProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ export interface InlineChatFeatureStatus {
2
+ works: string[];
3
+ notWorking: string[];
4
+ soon: string[];
5
+ }
6
+ /**
7
+ * What this demo can actually do, checked rather than remembered.
8
+ *
9
+ * It had drifted in both directions at once: threads sat under "Soon" while
10
+ * working, and copy sat under "Not working" while putting 434 characters on
11
+ * the clipboard. A list nobody trusts is worse than no list, because the one
12
+ * thing it is for is telling a visitor what to try.
13
+ *
14
+ * Everything under `works` was driven in a browser before it was written here.
15
+ * Everything under `notWorking` is simulated on purpose — this page has no
16
+ * model behind it and says so above. `soon` is tier I of the roadmap.
17
+ */
18
+ export declare const INLINE_CHAT_FEATURE_STATUS: InlineChatFeatureStatus;
@@ -0,0 +1,8 @@
1
+ export { ChatExperienceDemo } from './ChatExperienceDemo';
2
+ export type { ChatExperienceDemoProps } from './ChatExperienceDemo';
3
+ export { IntroLanding } from './IntroLanding';
4
+ export type { IntroLandingProps, IntroMotion } from './IntroLanding';
5
+ export { InlineChatBanner } from './InlineChatBanner';
6
+ export { INLINE_CHAT_FEATURE_STATUS } from './featureStatus';
7
+ export type { InlineChatFeatureStatus } from './featureStatus';
8
+ export { QUESTIONS, RUNNING_PLAN, scriptedApi, threadReply, scriptedTranscript, } from './scriptedApi';
@@ -0,0 +1,49 @@
1
+ import { Attachment, Question, TurnPartUpdate } from '../index';
2
+ /**
3
+ * Three questions, one of each type, about the experiment the rest of this
4
+ * demo is about.
5
+ *
6
+ * They used to be about arranging care for somebody — carried over from
7
+ * another product, and the one thing in a chat headed "ask me about particle
8
+ * physics" that had nothing to do with it. A demo that changes subject
9
+ * halfway is a demo somebody has to explain.
10
+ */
11
+ export declare const QUESTIONS: Question[];
12
+ /**
13
+ * A plan, written out. The demo's artifact.
14
+ *
15
+ * Long enough that pouring it into the answer would bury the answer, which is
16
+ * the whole argument for a pane: the card in the transcript is a window and
17
+ * this is what is behind it.
18
+ */
19
+ export declare const RUNNING_PLAN = "Week 1 \u2014 base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 \u00D7 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 \u2014 base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 \u00D7 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 \u2014 build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 \u00D7 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 \u2014 cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 \u00D7 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 \u2014 build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 \u00D7 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 \u2014 sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 \u00D7 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 \u2014 sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 \u00D7 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 \u2014 taper and race\nMon rest\nTue 4 km easy with 4 \u00D7 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
20
+ export declare function scriptedApi(message: string, { attachments, turnId }: {
21
+ attachments: Attachment[];
22
+ turnId: string;
23
+ }): AsyncGenerator<string | TurnPartUpdate>;
24
+ /**
25
+ * A reply inside a thread on a passage.
26
+ *
27
+ * Prose only. A thread is a follow-up on something already said, and a tool
28
+ * call inside a popover over the answer would be absurd.
29
+ */
30
+ export declare function threadReply(): AsyncGenerator<string>;
31
+ /**
32
+ * A transcript, without a transcriber.
33
+ *
34
+ * The kit records for real — permission, `MediaRecorder`, the level ring all
35
+ * come from the microphone — and then hands the audio here, where there is
36
+ * nowhere to send it. This demo has no backend and the browser's own
37
+ * `SpeechRecognition` cannot be reached through `onTranscribe`, because it
38
+ * insists on holding the microphone itself rather than taking a recording.
39
+ *
40
+ * So the words are scripted, like every other answer in this demo, and the
41
+ * feature list says so. Everything around them is not: refuse the permission
42
+ * prompt and the refusal is real, talk louder and the ring is reading your
43
+ * room, press stop halfway and the abort signal fires.
44
+ *
45
+ * A real handler is this shape with a `fetch` in it.
46
+ */
47
+ export declare function scriptedTranscript(audio: Blob, { signal }: {
48
+ signal: AbortSignal;
49
+ }): AsyncGenerator<string>;