@appsolutely-io/waypoint 0.0.0-stage → 0.1.1-next.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 (161) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +260 -2
  3. package/dist/block-reply-DN4RiLL0.d.cts +169 -0
  4. package/dist/block-reply-Dtof9ild.d.ts +169 -0
  5. package/dist/blocks-25YOJ5SS.cjs +1 -0
  6. package/dist/blocks-UJ7GUJHD.js +1 -0
  7. package/dist/chunk-3KV7TDDR.cjs +3 -0
  8. package/dist/chunk-4BWV3SEL.cjs +1 -0
  9. package/dist/chunk-4ZGW4HM4.cjs +1 -0
  10. package/dist/chunk-5TBO732O.js +1 -0
  11. package/dist/chunk-6OZSKCPT.cjs +1 -0
  12. package/dist/chunk-C3VS33WJ.js +1 -0
  13. package/dist/chunk-D2EGPBCX.cjs +1 -0
  14. package/dist/chunk-FBADWFRR.cjs +1 -0
  15. package/dist/chunk-FQSWQLRW.js +1 -0
  16. package/dist/chunk-GT6PI4CT.cjs +1 -0
  17. package/dist/chunk-II26UWZM.cjs +1 -0
  18. package/dist/chunk-JFMVVGGB.js +1 -0
  19. package/dist/chunk-K73VV7KA.js +1 -0
  20. package/dist/chunk-L4PFFRDE.js +3 -0
  21. package/dist/chunk-LLPGVQUT.cjs +1 -0
  22. package/dist/chunk-M3UENQ6L.cjs +1 -0
  23. package/dist/chunk-M63QOANE.js +1 -0
  24. package/dist/chunk-MEKDQDSV.js +1 -0
  25. package/dist/chunk-OEPKPDLD.js +1 -0
  26. package/dist/chunk-OWT55N6J.js +3 -0
  27. package/dist/chunk-PFR2J5BV.js +1 -0
  28. package/dist/chunk-Q6BD2YL3.cjs +1 -0
  29. package/dist/chunk-Q7BULGQG.cjs +1 -0
  30. package/dist/chunk-QS3MKZOY.cjs +3 -0
  31. package/dist/chunk-RHBDQGD4.js +1 -0
  32. package/dist/chunk-RZZDQWC2.js +1 -0
  33. package/dist/chunk-S73WZWDP.js +1 -0
  34. package/dist/chunk-SD2KAIVE.js +1 -0
  35. package/dist/chunk-T5XF2R74.js +1 -0
  36. package/dist/chunk-TCFCSGQ3.js +1 -0
  37. package/dist/chunk-TGL3DR2K.js +1 -0
  38. package/dist/chunk-TODYQ3SG.cjs +1 -0
  39. package/dist/chunk-TVSQHTK2.cjs +1 -0
  40. package/dist/chunk-UYR3UEIW.cjs +1 -0
  41. package/dist/chunk-VGGJGRNK.cjs +1 -0
  42. package/dist/chunk-W6Y7H56X.js +1 -0
  43. package/dist/chunk-XSHOLIC7.cjs +1 -0
  44. package/dist/chunk-XWDB2LS3.cjs +1 -0
  45. package/dist/cli.js +3 -0
  46. package/dist/confirmation-view-CICNJJIO.js +1 -0
  47. package/dist/confirmation-view-OMWHUYVC.cjs +1 -0
  48. package/dist/conformance.cjs +1 -0
  49. package/dist/conformance.d.cts +10 -0
  50. package/dist/conformance.d.ts +10 -0
  51. package/dist/conformance.js +1 -0
  52. package/dist/flow-parser.cjs +1 -0
  53. package/dist/flow-parser.d.cts +3 -0
  54. package/dist/flow-parser.d.ts +3 -0
  55. package/dist/flow-parser.js +1 -0
  56. package/dist/flows-panel-AIULKYOS.cjs +1 -0
  57. package/dist/flows-panel-YEJ36RTY.js +1 -0
  58. package/dist/form-extras-QYE32TUY.cjs +1 -0
  59. package/dist/form-extras-SBBOMJS2.js +1 -0
  60. package/dist/form-fill-C32AHxSr.d.cts +653 -0
  61. package/dist/form-fill-Dp3ut1_Y.d.ts +653 -0
  62. package/dist/form-session.cjs +1 -0
  63. package/dist/form-session.d.cts +7 -0
  64. package/dist/form-session.d.ts +7 -0
  65. package/dist/form-session.js +1 -0
  66. package/dist/frame-decoder.cjs +3 -0
  67. package/dist/frame-decoder.d.cts +5 -0
  68. package/dist/frame-decoder.d.ts +5 -0
  69. package/dist/frame-decoder.js +3 -0
  70. package/dist/generated-C9tbjwK0.d.cts +797 -0
  71. package/dist/generated-C9tbjwK0.d.ts +797 -0
  72. package/dist/hooks/index.cjs +1 -0
  73. package/dist/hooks/index.d.cts +48 -0
  74. package/dist/hooks/index.d.ts +48 -0
  75. package/dist/hooks/index.js +1 -0
  76. package/dist/i18n-DPNfYTMG.d.cts +148 -0
  77. package/dist/i18n-DPNfYTMG.d.ts +148 -0
  78. package/dist/index-B5idIFTx.d.cts +34 -0
  79. package/dist/index-DPzoKXCK.d.ts +34 -0
  80. package/dist/index.cjs +3 -0
  81. package/dist/index.d.cts +38 -0
  82. package/dist/index.d.ts +38 -0
  83. package/dist/index.js +3 -0
  84. package/dist/intent-BQPPows1.d.cts +154 -0
  85. package/dist/intent-BuvqEU3Q.d.ts +154 -0
  86. package/dist/intent.cjs +1 -0
  87. package/dist/intent.d.cts +2 -0
  88. package/dist/intent.d.ts +2 -0
  89. package/dist/intent.js +1 -0
  90. package/dist/markdown-BSRKJFFE.cjs +17 -0
  91. package/dist/markdown-ETLB66BK.js +17 -0
  92. package/dist/message-actions-3HGE6VTS.js +1 -0
  93. package/dist/message-actions-F6SPLTT7.cjs +1 -0
  94. package/dist/messages/en/index.cjs +1 -0
  95. package/dist/messages/en/index.d.cts +3 -0
  96. package/dist/messages/en/index.d.ts +3 -0
  97. package/dist/messages/en/index.js +1 -0
  98. package/dist/messages/index.cjs +1 -0
  99. package/dist/messages/index.d.cts +14 -0
  100. package/dist/messages/index.d.ts +14 -0
  101. package/dist/messages/index.js +1 -0
  102. package/dist/messages/zh-Hans/index.cjs +1 -0
  103. package/dist/messages/zh-Hans/index.d.cts +3 -0
  104. package/dist/messages/zh-Hans/index.d.ts +3 -0
  105. package/dist/messages/zh-Hans/index.js +1 -0
  106. package/dist/on-demand.cjs +1 -0
  107. package/dist/on-demand.d.cts +56 -0
  108. package/dist/on-demand.d.ts +56 -0
  109. package/dist/on-demand.js +1 -0
  110. package/dist/problem-messages-THONMXFZ.cjs +1 -0
  111. package/dist/problem-messages-Z5QGO6RE.js +1 -0
  112. package/dist/react/index.cjs +1 -0
  113. package/dist/react/index.d.cts +419 -0
  114. package/dist/react/index.d.ts +419 -0
  115. package/dist/react/index.js +1 -0
  116. package/dist/reads-Bk84x_rt.d.ts +38 -0
  117. package/dist/reads-DlpCt8dE.d.cts +38 -0
  118. package/dist/recovery-panel-OWY2CWOH.cjs +3 -0
  119. package/dist/recovery-panel-VOKVDDZD.js +3 -0
  120. package/dist/reply-controls-5CWIAKIG.js +1 -0
  121. package/dist/reply-controls-CPWB4VBK.cjs +1 -0
  122. package/dist/run-XBABOEXK.js +1 -0
  123. package/dist/schema.json +2900 -0
  124. package/dist/skin-antd/index.cjs +1 -0
  125. package/dist/skin-antd/index.d.cts +30 -0
  126. package/dist/skin-antd/index.d.ts +30 -0
  127. package/dist/skin-antd/index.js +1 -0
  128. package/dist/skin-default/index.cjs +1 -0
  129. package/dist/skin-default/index.d.cts +42 -0
  130. package/dist/skin-default/index.d.ts +42 -0
  131. package/dist/skin-default/index.js +1 -0
  132. package/dist/step-name-3hQ6CCGr.d.cts +19 -0
  133. package/dist/step-name-BdkYnb5g.d.ts +19 -0
  134. package/dist/storage-commit.cjs +1 -0
  135. package/dist/storage-commit.d.cts +17 -0
  136. package/dist/storage-commit.d.ts +17 -0
  137. package/dist/storage-commit.js +1 -0
  138. package/dist/stream-reads.cjs +1 -0
  139. package/dist/stream-reads.d.cts +22 -0
  140. package/dist/stream-reads.d.ts +22 -0
  141. package/dist/stream-reads.js +1 -0
  142. package/dist/styles.css +796 -0
  143. package/dist/testing/index.cjs +1 -0
  144. package/dist/testing/index.d.cts +57 -0
  145. package/dist/testing/index.d.ts +57 -0
  146. package/dist/testing/index.js +1 -0
  147. package/docs/examples/message-versions.tsx +74 -0
  148. package/docs/form-fill-protocol.md +83 -0
  149. package/docs/message-versions.md +64 -0
  150. package/docs/plan-protocol.md +83 -0
  151. package/docs/reply-protocol.md +75 -0
  152. package/etc/hooks.api.md +2385 -0
  153. package/etc/index.api.md +2159 -0
  154. package/etc/messages-en.api.md +13 -0
  155. package/etc/messages-zh-Hans.api.md +13 -0
  156. package/etc/messages.api.md +183 -0
  157. package/etc/react.api.md +2968 -0
  158. package/etc/skin-antd.api.md +2989 -0
  159. package/etc/skin-default.api.md +61 -0
  160. package/etc/testing.api.md +3034 -0
  161. package/package.json +168 -4
@@ -0,0 +1,419 @@
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-DPNfYTMG.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-DPNfYTMG.cjs';
11
+ import { j as BlockSummary, P as PlanView, A as ActionEntry, S as StepStatus, a as ActionId, K as KeepSheet } from '../block-reply-DN4RiLL0.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 useWaypointSnapshot } from '../block-reply-DN4RiLL0.cjs';
13
+ import { P as PlanLabels } from '../step-name-3hQ6CCGr.cjs';
14
+ export { s as stepName } from '../step-name-3hQ6CCGr.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
+ */
209
+ messageExcerpt?: (message: Message) => string | undefined;
210
+ markdownImages?: MarkdownImagePolicy;
211
+ extraUrlSchemes?: readonly string[];
212
+ flowTabLabel?: (labelKey: string) => string;
213
+ /**
214
+ * A host's words for a problem. `context.answeredElsewhere`: a card
215
+ * answer was refused because the read after it shows the card answered
216
+ * elsewhere (another tab, an earlier page).
217
+ */
218
+ problemText?: (problem: Problem, context?: {
219
+ answeredElsewhere: boolean;
220
+ }) => {
221
+ text: string;
222
+ action?: ReactNode;
223
+ };
224
+ format?: FormatMessage;
225
+ locale?: string;
226
+ dir?: "ltr" | "rtl";
227
+ /**
228
+ * Waypoint's tokens over the scheme's base tokens, in place of a host
229
+ * theme's tokens. It is tokens, not a scheme: without `colorScheme`, the
230
+ * scheme is still the host theme's or the system's, so a theme picked
231
+ * for one scheme should come with that `colorScheme`. Its colours are
232
+ * the host's to check, so under any `theme` prop (whatever its value)
233
+ * the user's bubble keeps the surface, with an accent start edge, rather
234
+ * than the accent-tinted fill.
235
+ */
236
+ theme?: Partial<Theme>;
237
+ /**
238
+ * The chat's scheme. Without it: the host theme's scheme (a skin's
239
+ * `useThemeTokens`), else the system's (`prefers-color-scheme`, followed
240
+ * live), else light.
241
+ */
242
+ colorScheme?: "light" | "dark";
243
+ wrapper?: ComponentType<{
244
+ children?: ReactNode;
245
+ colorScheme: "light" | "dark";
246
+ tokens: Theme;
247
+ /**
248
+ * Where the tokens came from: the host's own theme (a skin's
249
+ * `useThemeTokens`), or waypoint's, when a `theme` prop is given
250
+ * (whatever its value) or the skin reads none.
251
+ */
252
+ tokenSource?: "host" | "waypoint";
253
+ }>;
254
+ /**
255
+ * A skin's hook reading the host's own theme. Its tokens are used unless
256
+ * a `theme` prop is given; its scheme is used unless `colorScheme` is,
257
+ * also under a `theme` prop. It must be present or absent for the
258
+ * provider's whole life.
259
+ */
260
+ useThemeTokens?: ThemeTokensHook;
261
+ }
262
+ /** A skin's hook reading the host's own theme as waypoint tokens. */
263
+ type ThemeTokensHook = () => {
264
+ tokens: Partial<ResolvedTheme>;
265
+ scheme: "light" | "dark";
266
+ } | undefined;
267
+ declare function WaypointProvider(props: WaypointProviderProps): react.JSX.Element;
268
+ declare function useWaypointClient(): WaypointClient;
269
+ declare function useConversation(client?: WaypointClient): {
270
+ conversationId: string;
271
+ conversation: Conversation | null;
272
+ refresh: () => Promise<ConversationReadResult>;
273
+ editMessage: (messageId: string, content: string) => Promise<void>;
274
+ regenerate: (messageId: string) => Promise<void>;
275
+ selectVersion: (messageId: string, index: number) => Promise<void>;
276
+ switchConversation: (id: string) => Promise<ConversationReadResult>;
277
+ };
278
+ declare function useComposer(client?: WaypointClient): {
279
+ draft: string;
280
+ sending: boolean;
281
+ hints: readonly string[];
282
+ setDraft: (value: string) => Promise<void>;
283
+ send: () => Promise<void>;
284
+ retry: (id: string) => Promise<void>;
285
+ withdraw: (id: string) => Promise<void>;
286
+ dismiss: (id: string) => Promise<void>;
287
+ };
288
+ declare function usePlan(client?: WaypointClient): {
289
+ plan: PlanRecord | null;
290
+ setPlan: (plan: PlanRecord) => void;
291
+ reply: (reply: ReplyInput) => Promise<boolean>;
292
+ view: PlanView | null;
293
+ };
294
+ declare function useFlows(client?: WaypointClient): {
295
+ flows: Partial<Record<string, FlowSummary[]>>;
296
+ tab: string;
297
+ load: () => Promise<void>;
298
+ select: (tab: FlowTab) => void;
299
+ setFavourite: (id: string, favourite: boolean) => Promise<void>;
300
+ run: (id: string, values: Record<string, unknown>) => Promise<string | void>;
301
+ };
302
+ type Slots = {
303
+ [N in PartName]?: (props: PartProps<N>) => ReactNode;
304
+ };
305
+ declare const partNames: readonly PartName[];
306
+ /** The recovery panel of a protected plan (loaded on first use). */
307
+ declare function RecoveryPanel(props: {
308
+ view: PlanView;
309
+ onPress(id: ActionId | "retry"): void;
310
+ slots?: Slots;
311
+ sheet?: KeepSheet | null;
312
+ hide?: readonly ActionId[];
313
+ }): react.JSX.Element;
314
+ declare function defaultProblemText(problem: Problem, format: FormatMessage): {
315
+ text: string;
316
+ action?: ReactNode;
317
+ };
318
+ declare const standardWidgets: readonly WidgetRegistration[];
319
+ declare function Widget(props: WidgetProps): react.JSX.Element;
320
+ /** The steps of a plan record (rendered by the blocks chunk). */
321
+ declare function PlanDiagram(props: PlanDiagramProps): react.JSX.Element;
322
+ interface PlanDiagramProps {
323
+ record: PlanRecord;
324
+ slots?: Slots;
325
+ /** The plan's view; each step's node is given it. */
326
+ view?: PlanView | null;
327
+ /**
328
+ * The host's confirmation beside the steps already lists each change;
329
+ * the steps then leave their before and after values out.
330
+ */
331
+ changesShown?: boolean;
332
+ }
333
+ interface WaypointChatProps extends Partial<Omit<WaypointProviderProps, "children">> {
334
+ slots?: Slots;
335
+ features?: readonly Capability[];
336
+ layout?: "panel" | "page" | "floating" | "sheet";
337
+ shortcuts?: {
338
+ focusComposer?: string | false;
339
+ send?: string | false;
340
+ /**
341
+ * @deprecated Ignored: a shortcut never moves focus from outside the
342
+ * chat, so there is no page-wide shortcut.
343
+ */
344
+ global?: boolean;
345
+ };
346
+ conversations?: readonly ConversationSummary[];
347
+ conversationSource?: ConversationSource;
348
+ quota?: ReactNode;
349
+ onStop?: () => void;
350
+ suggestions?: readonly string[];
351
+ }
352
+ declare function WaypointChat(props: WaypointChatProps): react.JSX.Element;
353
+ declare function ConfirmSheet({ title, body, busy, onProceed, onCancel, }: {
354
+ title: string;
355
+ body: string;
356
+ busy?: boolean;
357
+ onProceed(): void;
358
+ onCancel(): void;
359
+ }): react.JSX.Element | null;
360
+
361
+ declare function isSafeUrl(url: string | null | undefined, extraSchemes?: readonly string[]): boolean;
362
+
363
+ interface FieldAdornmentProps {
364
+ children: ReactNode;
365
+ label: string;
366
+ onRegenerate(): void;
367
+ disabled?: boolean;
368
+ /**
369
+ * Why the action is unavailable now. The stock control stays focusable
370
+ * and is described by this text, and a press does nothing. A replacement
371
+ * `fieldAdornment` part then gets no `onPress`, and `aria-disabled` and
372
+ * `describedBy`; it keeps the control focusable and described only if it
373
+ * passes both on to its control.
374
+ */
375
+ reason?: string;
376
+ slots?: Slots;
377
+ /** The field's wrapper element, as it mounts and unmounts. */
378
+ wrapper?: (element: HTMLDivElement | null) => void;
379
+ }
380
+ declare function FieldAdornment({ children, label, onRegenerate, disabled, reason, slots, wrapper, }: FieldAdornmentProps): react.JSX.Element;
381
+
382
+ interface PrivateAttachmentPort {
383
+ upload(file: File): Promise<string>;
384
+ remove(reference: string): Promise<void>;
385
+ }
386
+ declare function useFormFill(session: FormSession): FormSnapshot;
387
+ interface FormFillFieldsProps {
388
+ session: FormSession;
389
+ onRegenerate(field: string): void;
390
+ slots?: Slots;
391
+ renderField?: (props: {
392
+ name: string;
393
+ label: string;
394
+ value: unknown;
395
+ onChange(value: unknown): void;
396
+ invalid: boolean;
397
+ describedBy: string;
398
+ }) => ReactNode;
399
+ }
400
+ declare function FormFillFields({ session, onRegenerate, slots, renderField, }: FormFillFieldsProps): react.JSX.Element;
401
+ interface FormFillPopupProps {
402
+ session: FormSession;
403
+ open: boolean;
404
+ onClose(): void;
405
+ field?: string;
406
+ source?: ConversationSource;
407
+ attachments?: PrivateAttachmentPort;
408
+ }
409
+ declare function FormFillPopup({ session, open, onClose, field, source, attachments, }: FormFillPopupProps): react.JSX.Element;
410
+
411
+ interface ConversationRailProps {
412
+ conversations: readonly ConversationSummary[];
413
+ source?: ConversationSource;
414
+ /** Called in the press of a choice, before its switch starts. */
415
+ onChoose?(): void;
416
+ }
417
+ declare function ConversationRail({ conversations, source, onChoose, }: ConversationRailProps): react.JSX.Element;
418
+
419
+ 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 };