@appsolutely-io/waypoint 0.0.0-stage → 0.1.1-next.1
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/LICENSE +21 -0
- package/README.md +297 -2
- package/dist/block-reply-r8u-DNmZ.d.cts +181 -0
- package/dist/block-reply-z8El20nD.d.ts +181 -0
- package/dist/blocks-2ABWECKG.js +1 -0
- package/dist/blocks-7453YTYJ.cjs +1 -0
- package/dist/chunk-3KV7TDDR.cjs +3 -0
- package/dist/chunk-4BWV3SEL.cjs +1 -0
- package/dist/chunk-5Q3INHKA.js +1 -0
- package/dist/chunk-5TBO732O.js +1 -0
- package/dist/chunk-6OZSKCPT.cjs +1 -0
- package/dist/chunk-A3YOSFLE.cjs +1 -0
- package/dist/chunk-BRUQ75G3.cjs +1 -0
- package/dist/chunk-C3VS33WJ.js +1 -0
- package/dist/chunk-D2EGPBCX.cjs +1 -0
- package/dist/chunk-D4Q46KWA.js +1 -0
- package/dist/chunk-FBADWFRR.cjs +1 -0
- package/dist/chunk-FQSWQLRW.js +1 -0
- package/dist/chunk-GT6PI4CT.cjs +1 -0
- package/dist/chunk-II26UWZM.cjs +1 -0
- package/dist/chunk-IPI4O4LP.js +1 -0
- package/dist/chunk-JFMVVGGB.js +1 -0
- package/dist/chunk-K73VV7KA.js +1 -0
- package/dist/chunk-L4PFFRDE.js +3 -0
- package/dist/chunk-LLPGVQUT.cjs +1 -0
- package/dist/chunk-M63QOANE.js +1 -0
- package/dist/chunk-MEKDQDSV.js +1 -0
- package/dist/chunk-OEPKPDLD.js +1 -0
- package/dist/chunk-OWT55N6J.js +3 -0
- package/dist/chunk-PFR2J5BV.js +1 -0
- package/dist/chunk-Q7BULGQG.cjs +1 -0
- package/dist/chunk-QFBAOEPD.js +1 -0
- package/dist/chunk-QS3MKZOY.cjs +3 -0
- package/dist/chunk-RZ3AGK3U.cjs +1 -0
- package/dist/chunk-RZZDQWC2.js +1 -0
- package/dist/chunk-S73WZWDP.js +1 -0
- package/dist/chunk-T5XF2R74.js +1 -0
- package/dist/chunk-TCFCSGQ3.js +1 -0
- package/dist/chunk-TODYQ3SG.cjs +1 -0
- package/dist/chunk-TVSQHTK2.cjs +1 -0
- package/dist/chunk-VGGJGRNK.cjs +1 -0
- package/dist/chunk-XSHOLIC7.cjs +1 -0
- package/dist/chunk-XTKUDSDK.cjs +1 -0
- package/dist/chunk-XWDB2LS3.cjs +1 -0
- package/dist/cli.js +3 -0
- package/dist/confirmation-view-5BZ2PP7J.cjs +1 -0
- package/dist/confirmation-view-Z5JHY2F5.js +1 -0
- package/dist/conformance.cjs +1 -0
- package/dist/conformance.d.cts +10 -0
- package/dist/conformance.d.ts +10 -0
- package/dist/conformance.js +1 -0
- package/dist/flow-parser.cjs +1 -0
- package/dist/flow-parser.d.cts +3 -0
- package/dist/flow-parser.d.ts +3 -0
- package/dist/flow-parser.js +1 -0
- package/dist/flows-panel-2SCPYZ3X.js +1 -0
- package/dist/flows-panel-HQYJMOP4.cjs +1 -0
- package/dist/form-extras-RNMBCYV7.cjs +1 -0
- package/dist/form-extras-X3B3JCMH.js +1 -0
- package/dist/form-fill-C32AHxSr.d.cts +653 -0
- package/dist/form-fill-Dp3ut1_Y.d.ts +653 -0
- package/dist/form-session.cjs +1 -0
- package/dist/form-session.d.cts +7 -0
- package/dist/form-session.d.ts +7 -0
- package/dist/form-session.js +1 -0
- package/dist/frame-decoder.cjs +3 -0
- package/dist/frame-decoder.d.cts +5 -0
- package/dist/frame-decoder.d.ts +5 -0
- package/dist/frame-decoder.js +3 -0
- package/dist/generated-C9tbjwK0.d.cts +797 -0
- package/dist/generated-C9tbjwK0.d.ts +797 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.d.cts +48 -0
- package/dist/hooks/index.d.ts +48 -0
- package/dist/hooks/index.js +1 -0
- package/dist/i18n-WC9f-h_q.d.cts +151 -0
- package/dist/i18n-WC9f-h_q.d.ts +151 -0
- package/dist/index-B5idIFTx.d.cts +34 -0
- package/dist/index-DPzoKXCK.d.ts +34 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +38 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +3 -0
- package/dist/intent-BQPPows1.d.cts +154 -0
- package/dist/intent-BuvqEU3Q.d.ts +154 -0
- package/dist/intent.cjs +1 -0
- package/dist/intent.d.cts +2 -0
- package/dist/intent.d.ts +2 -0
- package/dist/intent.js +1 -0
- package/dist/markdown-5NUOCOGY.js +23 -0
- package/dist/markdown-CG7NXI7X.cjs +23 -0
- package/dist/message-actions-ORBVYGNE.cjs +1 -0
- package/dist/message-actions-XNBBFHGW.js +1 -0
- package/dist/messages/en/index.cjs +1 -0
- package/dist/messages/en/index.d.cts +3 -0
- package/dist/messages/en/index.d.ts +3 -0
- package/dist/messages/en/index.js +1 -0
- package/dist/messages/index.cjs +1 -0
- package/dist/messages/index.d.cts +14 -0
- package/dist/messages/index.d.ts +14 -0
- package/dist/messages/index.js +1 -0
- package/dist/messages/zh-Hans/index.cjs +1 -0
- package/dist/messages/zh-Hans/index.d.cts +3 -0
- package/dist/messages/zh-Hans/index.d.ts +3 -0
- package/dist/messages/zh-Hans/index.js +1 -0
- package/dist/on-demand.cjs +1 -0
- package/dist/on-demand.d.cts +56 -0
- package/dist/on-demand.d.ts +56 -0
- package/dist/on-demand.js +1 -0
- package/dist/problem-messages-THONMXFZ.cjs +1 -0
- package/dist/problem-messages-Z5QGO6RE.js +1 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.cts +421 -0
- package/dist/react/index.d.ts +421 -0
- package/dist/react/index.js +1 -0
- package/dist/reads-Bk84x_rt.d.ts +38 -0
- package/dist/reads-DlpCt8dE.d.cts +38 -0
- package/dist/recovery-panel-6EBUMANX.js +3 -0
- package/dist/recovery-panel-EQIIV7TT.cjs +3 -0
- package/dist/reply-controls-HUYHUO3W.js +1 -0
- package/dist/reply-controls-LGY2RKRJ.cjs +1 -0
- package/dist/run-XBABOEXK.js +1 -0
- package/dist/schema.json +2900 -0
- package/dist/skin-antd/index.cjs +1 -0
- package/dist/skin-antd/index.d.cts +30 -0
- package/dist/skin-antd/index.d.ts +30 -0
- package/dist/skin-antd/index.js +1 -0
- package/dist/skin-default/index.cjs +1 -0
- package/dist/skin-default/index.d.cts +42 -0
- package/dist/skin-default/index.d.ts +42 -0
- package/dist/skin-default/index.js +1 -0
- package/dist/step-name-BlgVvshf.d.ts +19 -0
- package/dist/step-name-CB3d3kkP.d.cts +19 -0
- package/dist/storage-commit.cjs +1 -0
- package/dist/storage-commit.d.cts +17 -0
- package/dist/storage-commit.d.ts +17 -0
- package/dist/storage-commit.js +1 -0
- package/dist/stream-reads.cjs +1 -0
- package/dist/stream-reads.d.cts +22 -0
- package/dist/stream-reads.d.ts +22 -0
- package/dist/stream-reads.js +1 -0
- package/dist/styles.css +811 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.d.cts +57 -0
- package/dist/testing/index.d.ts +57 -0
- package/dist/testing/index.js +1 -0
- package/docs/examples/message-versions.tsx +74 -0
- package/docs/form-fill-protocol.md +83 -0
- package/docs/message-versions.md +64 -0
- package/docs/plan-protocol.md +83 -0
- package/docs/reply-protocol.md +75 -0
- package/etc/hooks.api.md +2394 -0
- package/etc/index.api.md +2159 -0
- package/etc/messages-en.api.md +13 -0
- package/etc/messages-zh-Hans.api.md +13 -0
- package/etc/messages.api.md +186 -0
- package/etc/react.api.md +2977 -0
- package/etc/skin-antd.api.md +2998 -0
- package/etc/skin-default.api.md +61 -0
- package/etc/testing.api.md +3043 -0
- package/package.json +169 -4
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, Ref, ComponentType } from 'react';
|
|
3
|
+
import { a3 as Message, P as Problem, q as ConfirmationRecord, as as Step, ac as PlanRecord, B as Block, ag as Reply, s as Conversation } from '../generated-C9tbjwK0.cjs';
|
|
4
|
+
export { b as BlockButtons, c as BlockCard, d as BlockChoice, e as BlockDetails, f as BlockDiff, g as BlockForm, h as BlockFormFill, i as BlockList, j as BlockMarkdown, k as BlockNotice, l as BlockPlan, m as BlockRouteLink, n as BlockTable, C as CanonicalRequest, o as CardAnswer, p as ConfirmationItem, r as ConfirmationSchedule, t as CreateConversation, D as DecisionVersions, E as ExecutionAcceptance, u as ExtensionBlock, v as FinalHistory, a as Flow, w as FlowParameter, x as FormFillField, y as FormFillRequest, z as FormFillValue, A as FormSubject, G as FormValidation, F as Frame, H as FrameBlock, I as FrameMessageEnd, J as FrameMessageStart, K as FramePlanDraft, L as FramePlanFinal, N as FramePlanStep, O as FramePlanningRead, Q as FrameProblem, S as FrameStale, U as FrameTextDelta, V as FrameToolCall, W as ImmediateDraft, X as ImmediatePlan, Y as IntentCause, Z as IntentKind, _ as IntentRequest, $ as IntentTarget, a0 as IntentWinner, a1 as KeptFact, a2 as LeaveAcknowledgment, M as ManifestEntry, a4 as Negotiated, a5 as Negotiation, a6 as NegotiationOfferWire, a7 as Outcome, a8 as PatchFlow, a9 as Plan, aa as PlanCommand, ab as PlanIntentReply, ad as PlanState, R as ReadTemplate, ae as RecoveryPhase, af as RecoveryView, ah as ReplyAction, ai as ReplyConfirm, aj as ReplyDecline, ak as ReplyForm, al as ReplyFormFill, am as ReplyMessage, an as ReplyPlanValues, ao as ReplyStop, ap as ReplyToolResult, aq as RunFlow, ar as Source, at as TimedPlan, T as ToolCall, au as WaypointProtocol, av as WinnerKind } from '../generated-C9tbjwK0.cjs';
|
|
5
|
+
import { W as WaypointClient, i as Capability, m as ConversationSummary, l as ConversationSource, d as ConversationReadResult, r as FlowSummary, s as FlowTab, R as ReplyInput, a as FormSession, w as FormSnapshot } from '../form-fill-C32AHxSr.cjs';
|
|
6
|
+
export { A as AttachmentPort, B as BuiltinFlowTab, h as CAPABILITIES, C as ClientConfig, b as ClientSnapshot, j as ComposerContribution, k as ConversationReadError, D as DEFAULT_FLOW_TABS, n as FORM_SESSION_UNAVAILABLE, o as FeedbackInput, p as FeedbackPort, q as FlowSource, t as FormDraft, u as FormField, v as FormMaterial, F as FormSessionConfig, K as KeepChangesReview, x as KeepChangesReviewResult, y as KeepDisabledReason, M as MaybePromise, z as MessageVersionInput, E as MessageVersionPort, N as NegotiationOffer, P as PendingSend, G as PlanReadRefused, H as PlanRunner, I as PlatformPorts, f as ReadPorts, J as ReaderRequestContext, e as ReplyDelivery, L as ReplyOutcome, g as ReplyState, O as RestoredMessage, Q as RunnerPorts, S as StepContext, T as StoragePort, U as ToolStep, V as TransportEvent, X as TransportPort, c as WaypointEvent, Y as asProblem, Z as canTransition, _ as confirmationOf, $ as createMemoryStorage, a0 as createPlanRunner, a1 as createWaypointClient, a2 as flowTabId, a3 as loadFormSession, a4 as readProblem, a5 as replyRow, a6 as versionWalk } from '../form-fill-C32AHxSr.cjs';
|
|
7
|
+
import { ResolvedTheme, Theme } from '../skin-default/index.cjs';
|
|
8
|
+
export { RequiredThemeToken, ThemeToken, darkTheme, lightTheme, themeProperties } from '../skin-default/index.cjs';
|
|
9
|
+
import { d as FormatMessage } from '../i18n-WC9f-h_q.cjs';
|
|
10
|
+
export { B as BlockCatalogue, a as BlockMessageKey, C as ConfirmationCatalogue, b as ConfirmationMessageKey, F as FormCatalogue, c as FormMessageKey, M as MessageKey, e as MessageValues, P as ProblemCatalogue, f as ProblemMessageKey, R as RecoveryCatalogue, g as RecoveryMessageKey, h as ReplyCatalogue, i as ReplyMessageKey, k as addMessages, l as catalogueFor, m as createFormatter, j as english, s as simplifiedChinese } from '../i18n-WC9f-h_q.cjs';
|
|
11
|
+
import { m as BlockSummary, P as PlanView, A as ActionEntry, S as StepStatus, a as ActionId, K as KeepSheet } from '../block-reply-r8u-DNmZ.cjs';
|
|
12
|
+
export { B as BlockAnswer, b as BlockReply, c as KeepSheetView, d as PlanViewAlert, e as PlanViewInput, f as PlanViewStatus, T as Tone, V as ViewMessage, g as cardReplyId, k as keepSheet, n as noticeMessages, p as planView, u as useBlockReply, h as usePlanView, i as useWaypointMessage, j as useWaypointSelector, l as useWaypointSnapshot } from '../block-reply-r8u-DNmZ.cjs';
|
|
13
|
+
import { P as PlanLabels } from '../step-name-CB3d3kkP.cjs';
|
|
14
|
+
export { s as stepName } from '../step-name-CB3d3kkP.cjs';
|
|
15
|
+
export { I as IntentAlert, b as IntentFailure, c as IntentNotice, d as IntentOverlay, a as ScopeSignal } from '../intent-BQPPows1.cjs';
|
|
16
|
+
|
|
17
|
+
interface MarkdownImagePolicy {
|
|
18
|
+
origin?: string;
|
|
19
|
+
allow?: (url: string) => boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type PartName = "bubble" | "composer" | "transcript" | "replyRow" | "stepRow" | "planNode" | "widgetFrame" | "confirmBar" | "confirmation" | "topBar" | "rail" | "flowTabs" | "quotaStrip" | "failedSendControls" | "emptyState" | "messageActions" | "extraPanels" | "actionBar" | "stepUpPrompt" | "fieldAdornment" | "recoveryPanel" | "stepStatusRow" | "recoveryActions";
|
|
23
|
+
/** A message as a bubble or its actions see it. */
|
|
24
|
+
interface PartMessage {
|
|
25
|
+
id: string;
|
|
26
|
+
role: Message["role"];
|
|
27
|
+
status?: Message["status"];
|
|
28
|
+
versionIndex?: number;
|
|
29
|
+
versionCount?: number;
|
|
30
|
+
}
|
|
31
|
+
/** A message still being sent, or not sent. */
|
|
32
|
+
interface PartPending {
|
|
33
|
+
id: string;
|
|
34
|
+
content: string;
|
|
35
|
+
failure: {
|
|
36
|
+
code: Problem["code"];
|
|
37
|
+
} | null;
|
|
38
|
+
}
|
|
39
|
+
/** A plan step as its row sees it. */
|
|
40
|
+
type PartStep = Pick<Step, "id" | "operation" | "resource" | "view" | "tier" | "undo" | "stepUp">;
|
|
41
|
+
/**
|
|
42
|
+
* The data each part is given, by part name: a copy, field by field, never
|
|
43
|
+
* the host's or the client's own objects. A part with `undefined` is given
|
|
44
|
+
* none; it draws from its children and props alone.
|
|
45
|
+
*/
|
|
46
|
+
interface PartDataMap {
|
|
47
|
+
bubble: {
|
|
48
|
+
message: PartMessage & {
|
|
49
|
+
content: string;
|
|
50
|
+
blocks: BlockSummary[];
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
pending: PartPending;
|
|
54
|
+
};
|
|
55
|
+
widgetFrame: {
|
|
56
|
+
block: BlockSummary;
|
|
57
|
+
};
|
|
58
|
+
messageActions: {
|
|
59
|
+
message: PartMessage;
|
|
60
|
+
};
|
|
61
|
+
composer: {
|
|
62
|
+
sending: boolean;
|
|
63
|
+
};
|
|
64
|
+
failedSendControls: {
|
|
65
|
+
pending: PartPending;
|
|
66
|
+
};
|
|
67
|
+
confirmBar: {
|
|
68
|
+
view: PlanView;
|
|
69
|
+
actions: ActionEntry[];
|
|
70
|
+
};
|
|
71
|
+
confirmation: {
|
|
72
|
+
confirmation: ConfirmationRecord;
|
|
73
|
+
};
|
|
74
|
+
planNode: {
|
|
75
|
+
view: PlanView;
|
|
76
|
+
};
|
|
77
|
+
stepRow: {
|
|
78
|
+
step: PartStep;
|
|
79
|
+
};
|
|
80
|
+
stepUpPrompt: {
|
|
81
|
+
stepUpCount: number;
|
|
82
|
+
};
|
|
83
|
+
recoveryPanel: {
|
|
84
|
+
view: PlanView;
|
|
85
|
+
};
|
|
86
|
+
stepStatusRow: {
|
|
87
|
+
step: StepStatus;
|
|
88
|
+
};
|
|
89
|
+
recoveryActions: {
|
|
90
|
+
actions: ActionEntry[];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** Each part's data, `undefined` for a part that is given none. */
|
|
94
|
+
type PartData = {
|
|
95
|
+
[N in PartName]: N extends keyof PartDataMap ? PartDataMap[N] : undefined;
|
|
96
|
+
};
|
|
97
|
+
interface PartProps<N extends PartName = PartName> {
|
|
98
|
+
children?: ReactNode;
|
|
99
|
+
value?: string;
|
|
100
|
+
onChange?: (value: string) => void;
|
|
101
|
+
onPress?: () => void;
|
|
102
|
+
disabled?: boolean;
|
|
103
|
+
/** A guarded part stays focusable and uses describedBy for its reason. */
|
|
104
|
+
"aria-disabled"?: boolean;
|
|
105
|
+
label?: string;
|
|
106
|
+
inputRef?: Ref<HTMLTextAreaElement>;
|
|
107
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
|
|
108
|
+
/** Ids of the text that describes the field (the composer's hints). */
|
|
109
|
+
describedBy?: string;
|
|
110
|
+
/** The part's own data (see `PartData`); absent while there is none. */
|
|
111
|
+
data?: PartData[N];
|
|
112
|
+
}
|
|
113
|
+
interface InputProps {
|
|
114
|
+
value: string;
|
|
115
|
+
onChange(value: string): void;
|
|
116
|
+
label: string;
|
|
117
|
+
type?: string;
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
invalid?: boolean;
|
|
120
|
+
describedBy?: string;
|
|
121
|
+
/** Exposed as `aria-required`; the label carries the visible marker. */
|
|
122
|
+
required?: boolean;
|
|
123
|
+
}
|
|
124
|
+
interface CheckboxProps {
|
|
125
|
+
checked: boolean;
|
|
126
|
+
onChange(checked: boolean): void;
|
|
127
|
+
label: string;
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
invalid?: boolean;
|
|
130
|
+
describedBy?: string;
|
|
131
|
+
}
|
|
132
|
+
interface ButtonProps {
|
|
133
|
+
children?: ReactNode;
|
|
134
|
+
onPress?(): void;
|
|
135
|
+
disabled?: boolean;
|
|
136
|
+
label?: string;
|
|
137
|
+
role?: "tab";
|
|
138
|
+
tabIndex?: number;
|
|
139
|
+
"aria-selected"?: boolean;
|
|
140
|
+
"aria-disabled"?: boolean;
|
|
141
|
+
"aria-describedby"?: string;
|
|
142
|
+
"aria-busy"?: boolean;
|
|
143
|
+
"aria-current"?: "page";
|
|
144
|
+
/** A toggle's state. */
|
|
145
|
+
"aria-pressed"?: boolean;
|
|
146
|
+
id?: string;
|
|
147
|
+
"data-action"?: string;
|
|
148
|
+
/** A disclosure's state and the region it controls. */
|
|
149
|
+
"aria-expanded"?: boolean;
|
|
150
|
+
"aria-controls"?: string;
|
|
151
|
+
}
|
|
152
|
+
interface DrawerProps {
|
|
153
|
+
children?: ReactNode;
|
|
154
|
+
open: boolean;
|
|
155
|
+
label: string;
|
|
156
|
+
onClose(): void;
|
|
157
|
+
/** The close button's name, from the chat's formatter. */
|
|
158
|
+
closeLabel?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Called once the open drawer's element exists; the chat decides there
|
|
161
|
+
* whether focus may move into it. A skin never moves focus itself.
|
|
162
|
+
*/
|
|
163
|
+
focusInto?(element: HTMLElement): void;
|
|
164
|
+
/**
|
|
165
|
+
* Called as the drawer closes or unmounts, with its element. The skin
|
|
166
|
+
* must unmount the dialog on close rather than keep it connected and
|
|
167
|
+
* hidden, so the guarded removal handoff can restore focus.
|
|
168
|
+
*/
|
|
169
|
+
restoreFocus?(element: HTMLElement): void;
|
|
170
|
+
}
|
|
171
|
+
interface PrimitiveComponents {
|
|
172
|
+
button: ComponentType<ButtonProps>;
|
|
173
|
+
textarea: ComponentType<PartProps>;
|
|
174
|
+
input: ComponentType<InputProps>;
|
|
175
|
+
datePicker: ComponentType<InputProps>;
|
|
176
|
+
drawer: ComponentType<DrawerProps>;
|
|
177
|
+
/** A labelled checkbox (a boolean form field); the native one if absent. */
|
|
178
|
+
checkbox?: ComponentType<CheckboxProps>;
|
|
179
|
+
}
|
|
180
|
+
interface WidgetProps {
|
|
181
|
+
block: Block;
|
|
182
|
+
onReply: (reply: Pick<Reply, "kind"> & Record<string, unknown>) => void;
|
|
183
|
+
disabled: boolean;
|
|
184
|
+
}
|
|
185
|
+
interface WidgetRegistration {
|
|
186
|
+
type: string;
|
|
187
|
+
render: ComponentType<WidgetProps>;
|
|
188
|
+
}
|
|
189
|
+
interface WaypointProviderProps {
|
|
190
|
+
client: WaypointClient;
|
|
191
|
+
/** Display names for the plan steps' resources and fields. */
|
|
192
|
+
planLabels?: PlanLabels;
|
|
193
|
+
children?: ReactNode;
|
|
194
|
+
parts?: {
|
|
195
|
+
[N in PartName]?: ComponentType<PartProps<N>>;
|
|
196
|
+
};
|
|
197
|
+
primitives?: Partial<PrimitiveComponents>;
|
|
198
|
+
widgets?: readonly WidgetRegistration[];
|
|
199
|
+
renderers?: {
|
|
200
|
+
markdown?: ComponentType<{
|
|
201
|
+
text: string;
|
|
202
|
+
}>;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Plain text for a message's excerpt (the outline, announcements) when a
|
|
206
|
+
* replaced renderer, bubble or transcript means the chat cannot tell what
|
|
207
|
+
* the message visibly shows. Without it those surfaces name no content.
|
|
208
|
+
* The outline's filter asks once per message object: to change what it
|
|
209
|
+
* finds for a message, pass a new message object.
|
|
210
|
+
*/
|
|
211
|
+
messageExcerpt?: (message: Message) => string | undefined;
|
|
212
|
+
markdownImages?: MarkdownImagePolicy;
|
|
213
|
+
extraUrlSchemes?: readonly string[];
|
|
214
|
+
flowTabLabel?: (labelKey: string) => string;
|
|
215
|
+
/**
|
|
216
|
+
* A host's words for a problem. `context.answeredElsewhere`: a card
|
|
217
|
+
* answer was refused because the read after it shows the card answered
|
|
218
|
+
* elsewhere (another tab, an earlier page).
|
|
219
|
+
*/
|
|
220
|
+
problemText?: (problem: Problem, context?: {
|
|
221
|
+
answeredElsewhere: boolean;
|
|
222
|
+
}) => {
|
|
223
|
+
text: string;
|
|
224
|
+
action?: ReactNode;
|
|
225
|
+
};
|
|
226
|
+
format?: FormatMessage;
|
|
227
|
+
locale?: string;
|
|
228
|
+
dir?: "ltr" | "rtl";
|
|
229
|
+
/**
|
|
230
|
+
* Waypoint's tokens over the scheme's base tokens, in place of a host
|
|
231
|
+
* theme's tokens. It is tokens, not a scheme: without `colorScheme`, the
|
|
232
|
+
* scheme is still the host theme's or the system's, so a theme picked
|
|
233
|
+
* for one scheme should come with that `colorScheme`. Its colours are
|
|
234
|
+
* the host's to check, so under any `theme` prop (whatever its value)
|
|
235
|
+
* the user's bubble keeps the surface, with an accent start edge, rather
|
|
236
|
+
* than the accent-tinted fill.
|
|
237
|
+
*/
|
|
238
|
+
theme?: Partial<Theme>;
|
|
239
|
+
/**
|
|
240
|
+
* The chat's scheme. Without it: the host theme's scheme (a skin's
|
|
241
|
+
* `useThemeTokens`), else the system's (`prefers-color-scheme`, followed
|
|
242
|
+
* live), else light.
|
|
243
|
+
*/
|
|
244
|
+
colorScheme?: "light" | "dark";
|
|
245
|
+
wrapper?: ComponentType<{
|
|
246
|
+
children?: ReactNode;
|
|
247
|
+
colorScheme: "light" | "dark";
|
|
248
|
+
tokens: Theme;
|
|
249
|
+
/**
|
|
250
|
+
* Where the tokens came from: the host's own theme (a skin's
|
|
251
|
+
* `useThemeTokens`), or waypoint's, when a `theme` prop is given
|
|
252
|
+
* (whatever its value) or the skin reads none.
|
|
253
|
+
*/
|
|
254
|
+
tokenSource?: "host" | "waypoint";
|
|
255
|
+
}>;
|
|
256
|
+
/**
|
|
257
|
+
* A skin's hook reading the host's own theme. Its tokens are used unless
|
|
258
|
+
* a `theme` prop is given; its scheme is used unless `colorScheme` is,
|
|
259
|
+
* also under a `theme` prop. It must be present or absent for the
|
|
260
|
+
* provider's whole life.
|
|
261
|
+
*/
|
|
262
|
+
useThemeTokens?: ThemeTokensHook;
|
|
263
|
+
}
|
|
264
|
+
/** A skin's hook reading the host's own theme as waypoint tokens. */
|
|
265
|
+
type ThemeTokensHook = () => {
|
|
266
|
+
tokens: Partial<ResolvedTheme>;
|
|
267
|
+
scheme: "light" | "dark";
|
|
268
|
+
} | undefined;
|
|
269
|
+
declare function WaypointProvider(props: WaypointProviderProps): react.JSX.Element;
|
|
270
|
+
declare function useWaypointClient(): WaypointClient;
|
|
271
|
+
declare function useConversation(client?: WaypointClient): {
|
|
272
|
+
conversationId: string;
|
|
273
|
+
conversation: Conversation | null;
|
|
274
|
+
refresh: () => Promise<ConversationReadResult>;
|
|
275
|
+
editMessage: (messageId: string, content: string) => Promise<void>;
|
|
276
|
+
regenerate: (messageId: string) => Promise<void>;
|
|
277
|
+
selectVersion: (messageId: string, index: number) => Promise<void>;
|
|
278
|
+
switchConversation: (id: string) => Promise<ConversationReadResult>;
|
|
279
|
+
};
|
|
280
|
+
declare function useComposer(client?: WaypointClient): {
|
|
281
|
+
draft: string;
|
|
282
|
+
sending: boolean;
|
|
283
|
+
hints: readonly string[];
|
|
284
|
+
setDraft: (value: string) => Promise<void>;
|
|
285
|
+
send: () => Promise<void>;
|
|
286
|
+
retry: (id: string) => Promise<void>;
|
|
287
|
+
withdraw: (id: string) => Promise<void>;
|
|
288
|
+
dismiss: (id: string) => Promise<void>;
|
|
289
|
+
};
|
|
290
|
+
declare function usePlan(client?: WaypointClient): {
|
|
291
|
+
plan: PlanRecord | null;
|
|
292
|
+
setPlan: (plan: PlanRecord) => void;
|
|
293
|
+
reply: (reply: ReplyInput) => Promise<boolean>;
|
|
294
|
+
view: PlanView | null;
|
|
295
|
+
};
|
|
296
|
+
declare function useFlows(client?: WaypointClient): {
|
|
297
|
+
flows: Partial<Record<string, FlowSummary[]>>;
|
|
298
|
+
tab: string;
|
|
299
|
+
load: () => Promise<void>;
|
|
300
|
+
select: (tab: FlowTab) => void;
|
|
301
|
+
setFavourite: (id: string, favourite: boolean) => Promise<void>;
|
|
302
|
+
run: (id: string, values: Record<string, unknown>) => Promise<string | void>;
|
|
303
|
+
};
|
|
304
|
+
type Slots = {
|
|
305
|
+
[N in PartName]?: (props: PartProps<N>) => ReactNode;
|
|
306
|
+
};
|
|
307
|
+
declare const partNames: readonly PartName[];
|
|
308
|
+
/** The recovery panel of a protected plan (loaded on first use). */
|
|
309
|
+
declare function RecoveryPanel(props: {
|
|
310
|
+
view: PlanView;
|
|
311
|
+
onPress(id: ActionId | "retry"): void;
|
|
312
|
+
slots?: Slots;
|
|
313
|
+
sheet?: KeepSheet | null;
|
|
314
|
+
hide?: readonly ActionId[];
|
|
315
|
+
}): react.JSX.Element;
|
|
316
|
+
declare function defaultProblemText(problem: Problem, format: FormatMessage): {
|
|
317
|
+
text: string;
|
|
318
|
+
action?: ReactNode;
|
|
319
|
+
};
|
|
320
|
+
declare const standardWidgets: readonly WidgetRegistration[];
|
|
321
|
+
declare function Widget(props: WidgetProps): react.JSX.Element;
|
|
322
|
+
/** The steps of a plan record (rendered by the blocks chunk). */
|
|
323
|
+
declare function PlanDiagram(props: PlanDiagramProps): react.JSX.Element;
|
|
324
|
+
interface PlanDiagramProps {
|
|
325
|
+
record: PlanRecord;
|
|
326
|
+
slots?: Slots;
|
|
327
|
+
/** The plan's view; each step's node is given it. */
|
|
328
|
+
view?: PlanView | null;
|
|
329
|
+
/**
|
|
330
|
+
* The host's confirmation beside the steps already lists each change;
|
|
331
|
+
* the steps then leave their before and after values out.
|
|
332
|
+
*/
|
|
333
|
+
changesShown?: boolean;
|
|
334
|
+
}
|
|
335
|
+
interface WaypointChatProps extends Partial<Omit<WaypointProviderProps, "children">> {
|
|
336
|
+
slots?: Slots;
|
|
337
|
+
features?: readonly Capability[];
|
|
338
|
+
layout?: "panel" | "page" | "floating" | "sheet";
|
|
339
|
+
shortcuts?: {
|
|
340
|
+
focusComposer?: string | false;
|
|
341
|
+
send?: string | false;
|
|
342
|
+
/**
|
|
343
|
+
* @deprecated Ignored: a shortcut never moves focus from outside the
|
|
344
|
+
* chat, so there is no page-wide shortcut.
|
|
345
|
+
*/
|
|
346
|
+
global?: boolean;
|
|
347
|
+
};
|
|
348
|
+
conversations?: readonly ConversationSummary[];
|
|
349
|
+
conversationSource?: ConversationSource;
|
|
350
|
+
quota?: ReactNode;
|
|
351
|
+
onStop?: () => void;
|
|
352
|
+
suggestions?: readonly string[];
|
|
353
|
+
}
|
|
354
|
+
declare function WaypointChat(props: WaypointChatProps): react.JSX.Element;
|
|
355
|
+
declare function ConfirmSheet({ title, body, busy, onProceed, onCancel, }: {
|
|
356
|
+
title: string;
|
|
357
|
+
body: string;
|
|
358
|
+
busy?: boolean;
|
|
359
|
+
onProceed(): void;
|
|
360
|
+
onCancel(): void;
|
|
361
|
+
}): react.JSX.Element | null;
|
|
362
|
+
|
|
363
|
+
declare function isSafeUrl(url: string | null | undefined, extraSchemes?: readonly string[]): boolean;
|
|
364
|
+
|
|
365
|
+
interface FieldAdornmentProps {
|
|
366
|
+
children: ReactNode;
|
|
367
|
+
label: string;
|
|
368
|
+
onRegenerate(): void;
|
|
369
|
+
disabled?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Why the action is unavailable now. The stock control stays focusable
|
|
372
|
+
* and is described by this text, and a press does nothing. A replacement
|
|
373
|
+
* `fieldAdornment` part then gets no `onPress`, and `aria-disabled` and
|
|
374
|
+
* `describedBy`; it keeps the control focusable and described only if it
|
|
375
|
+
* passes both on to its control.
|
|
376
|
+
*/
|
|
377
|
+
reason?: string;
|
|
378
|
+
slots?: Slots;
|
|
379
|
+
/** The field's wrapper element, as it mounts and unmounts. */
|
|
380
|
+
wrapper?: (element: HTMLDivElement | null) => void;
|
|
381
|
+
}
|
|
382
|
+
declare function FieldAdornment({ children, label, onRegenerate, disabled, reason, slots, wrapper, }: FieldAdornmentProps): react.JSX.Element;
|
|
383
|
+
|
|
384
|
+
interface PrivateAttachmentPort {
|
|
385
|
+
upload(file: File): Promise<string>;
|
|
386
|
+
remove(reference: string): Promise<void>;
|
|
387
|
+
}
|
|
388
|
+
declare function useFormFill(session: FormSession): FormSnapshot;
|
|
389
|
+
interface FormFillFieldsProps {
|
|
390
|
+
session: FormSession;
|
|
391
|
+
onRegenerate(field: string): void;
|
|
392
|
+
slots?: Slots;
|
|
393
|
+
renderField?: (props: {
|
|
394
|
+
name: string;
|
|
395
|
+
label: string;
|
|
396
|
+
value: unknown;
|
|
397
|
+
onChange(value: unknown): void;
|
|
398
|
+
invalid: boolean;
|
|
399
|
+
describedBy: string;
|
|
400
|
+
}) => ReactNode;
|
|
401
|
+
}
|
|
402
|
+
declare function FormFillFields({ session, onRegenerate, slots, renderField, }: FormFillFieldsProps): react.JSX.Element;
|
|
403
|
+
interface FormFillPopupProps {
|
|
404
|
+
session: FormSession;
|
|
405
|
+
open: boolean;
|
|
406
|
+
onClose(): void;
|
|
407
|
+
field?: string;
|
|
408
|
+
source?: ConversationSource;
|
|
409
|
+
attachments?: PrivateAttachmentPort;
|
|
410
|
+
}
|
|
411
|
+
declare function FormFillPopup({ session, open, onClose, field, source, attachments, }: FormFillPopupProps): react.JSX.Element;
|
|
412
|
+
|
|
413
|
+
interface ConversationRailProps {
|
|
414
|
+
conversations: readonly ConversationSummary[];
|
|
415
|
+
source?: ConversationSource;
|
|
416
|
+
/** Called in the press of a choice, before its switch starts. */
|
|
417
|
+
onChoose?(): void;
|
|
418
|
+
}
|
|
419
|
+
declare function ConversationRail({ conversations, source, onChoose, }: ConversationRailProps): react.JSX.Element;
|
|
420
|
+
|
|
421
|
+
export { ActionEntry, ActionId, Block, BlockSummary, type ButtonProps, Capability, type CheckboxProps, ConfirmSheet, ConfirmationRecord, Conversation, ConversationRail, type ConversationRailProps, ConversationReadResult, ConversationSource, ConversationSummary, type DrawerProps, FieldAdornment, type FieldAdornmentProps, FlowSummary, FlowTab, FormFillFields, type FormFillFieldsProps, FormFillPopup, type FormFillPopupProps, FormSession, FormSnapshot, FormatMessage, type InputProps, KeepSheet, type MarkdownImagePolicy, Message, type PartData, type PartDataMap, type PartMessage, type PartName, type PartPending, type PartProps, type PartStep, PlanDiagram, type PlanDiagramProps, PlanLabels, PlanRecord, PlanView, type PrimitiveComponents, type PrivateAttachmentPort, Problem, RecoveryPanel, Reply, ReplyInput, ResolvedTheme, type Slots, Step, StepStatus, Theme, type ThemeTokensHook, WaypointChat, type WaypointChatProps, WaypointClient, WaypointProvider, type WaypointProviderProps, Widget, type WidgetProps, type WidgetRegistration, defaultProblemText, isSafeUrl, partNames, standardWidgets, useComposer, useConversation, useFlows, useFormFill, usePlan, useWaypointClient };
|