@belonguniverseai/react-sdk 0.6.15-teams.1 → 0.6.16

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 (80) hide show
  1. package/dist/api/agent-grant-status.d.ts +4 -0
  2. package/dist/api/agent-grants.d.ts +92 -8
  3. package/dist/api/client.d.ts +304 -92
  4. package/dist/api/connectors.d.ts +0 -8
  5. package/dist/api/query-keys.d.ts +0 -1
  6. package/dist/api/questions.d.ts +41 -0
  7. package/dist/api/task-schedules.d.ts +1 -33
  8. package/dist/component/{abnfDiagram-N423BO3Z-CWpleAha.js → abnfDiagram-N423BO3Z-OROjdfGy.js} +4 -4
  9. package/dist/component/{arc-B_b5cvCE.js → arc-BV89erXj.js} +2 -2
  10. package/dist/component/{architectureDiagram-T3A2C74G-CjxSulY8.js → architectureDiagram-T3A2C74G-DvC153Pa.js} +3 -3
  11. package/dist/component/{blockDiagram-VBNYF7ZC-DUz0K7l9.js → blockDiagram-VBNYF7ZC-BhY_gBxr.js} +4 -4
  12. package/dist/component/{c4Diagram-5PPSVZJV-BSHKcbgg.js → c4Diagram-5PPSVZJV-l_KLeHXr.js} +3 -3
  13. package/dist/component/{channel-ul0OKf-Y.js → channel-C04d5zF_.js} +2 -2
  14. package/dist/component/{chunk-2GRJ4B5K-DWWubQIc.js → chunk-2GRJ4B5K-CEWW_4Iw.js} +2 -2
  15. package/dist/component/{chunk-2Q5K7J3B-Bf95TKrA.js → chunk-2Q5K7J3B-CB6VkgEJ.js} +2 -2
  16. package/dist/component/{chunk-5RXB4S5H-yt2pRekp.js → chunk-5RXB4S5H-FAQX8NS6.js} +5 -5
  17. package/dist/component/{chunk-5VM5RSS4-DC-Dhh2F.js → chunk-5VM5RSS4-L_UXpqco.js} +2 -2
  18. package/dist/component/{chunk-6Q2QTUOP-BYQUMWPa.js → chunk-6Q2QTUOP-Dodzsg9f.js} +2 -2
  19. package/dist/component/{chunk-GF5L2VYU-DCL5XslZ.js → chunk-GF5L2VYU-B6YkOr2d.js} +6 -6
  20. package/dist/component/{chunk-JWPE2WC7-CTNjfyTd.js → chunk-JWPE2WC7-BzhR8Ja-.js} +2 -2
  21. package/dist/component/{chunk-KBJHAD2P-BzFOsNsS.js → chunk-KBJHAD2P-D7S_ui4V.js} +2 -2
  22. package/dist/component/{chunk-RYQCIY6F-CxHVl87G.js → chunk-RYQCIY6F-BRnTO8_F.js} +2 -2
  23. package/dist/component/{chunk-XXDRQBXY-CybjH6JT.js → chunk-XXDRQBXY-C7_5LZDu.js} +2 -2
  24. package/dist/component/{classDiagram-JCYQIIEL-CUfortSf.js → classDiagram-JCYQIIEL-D3MdI_KC.js} +3 -3
  25. package/dist/component/{classDiagram-v2-OCEON4UE-CUfortSf.js → classDiagram-v2-OCEON4UE-D3MdI_KC.js} +3 -3
  26. package/dist/component/{cose-bilkent-JH36ORCC-gAMaOS_x.js → cose-bilkent-JH36ORCC-BEuo9qsi.js} +2 -2
  27. package/dist/component/{cynefinDiagram-MW4NZA55-Cqq2ciOe.js → cynefinDiagram-MW4NZA55-BfhAjv0p.js} +3 -3
  28. package/dist/component/{dagre-VZM6K2ZE-gUatRBAz.js → dagre-VZM6K2ZE-DdaRxW4J.js} +3 -3
  29. package/dist/component/{diagram-7IWD3JNH-HVoXgPnd.js → diagram-7IWD3JNH-BFbU8Ovo.js} +4 -4
  30. package/dist/component/{diagram-B4RE2ZJO-C3oEDsJq.js → diagram-B4RE2ZJO-CdPb_acC.js} +3 -3
  31. package/dist/component/{diagram-LBJQPF4R-F8VLVhYE.js → diagram-LBJQPF4R-Bo8o8x70.js} +3 -3
  32. package/dist/component/{diagram-Q27KOJAE-ByrpCxab.js → diagram-Q27KOJAE-CugDzXxZ.js} +4 -4
  33. package/dist/component/{diagram-UB23O5K3-DuounLWf.js → diagram-UB23O5K3-CYHh9d2Z.js} +3 -3
  34. package/dist/component/{ebnfDiagram-BXEA7PRR-cSRIjmQ1.js → ebnfDiagram-BXEA7PRR-CdqVlgbh.js} +4 -4
  35. package/dist/component/{erDiagram-JOGREHBK-bgcT-Jvh.js → erDiagram-JOGREHBK-CMh6xOk6.js} +5 -5
  36. package/dist/component/{flowDiagram-UKHOOZJN-DnUXqvIy.js → flowDiagram-UKHOOZJN-ttP65F-a.js} +7 -7
  37. package/dist/component/{ganttDiagram-PKOTCBZU-DLWRL_xy.js → ganttDiagram-PKOTCBZU-CSTsjgxH.js} +3 -3
  38. package/dist/component/{gitGraphDiagram-DS77QQ5N-CZTzj16I.js → gitGraphDiagram-DS77QQ5N-BtXqSxkQ.js} +4 -4
  39. package/dist/component/{highlighted-body-OFNGDK62-BHENhjL0.js → highlighted-body-OFNGDK62-CIltS1BE.js} +2 -2
  40. package/dist/component/index.js +2 -2
  41. package/dist/component/{infoDiagram-6WML65LV-XO0w0gDi.js → infoDiagram-6WML65LV-FqIIsY32.js} +2 -2
  42. package/dist/component/{ishikawaDiagram-WSZJBQD7-DxLtBuST.js → ishikawaDiagram-WSZJBQD7-BA78Hm4p.js} +2 -2
  43. package/dist/component/{journeyDiagram-NVQOT4AX-CzkQhFXA.js → journeyDiagram-NVQOT4AX-Bu99yxhx.js} +5 -5
  44. package/dist/component/{kanban-definition-27J2QSJJ-BiXQYLTj.js → kanban-definition-27J2QSJJ-CTf66i07.js} +3 -3
  45. package/dist/component/{linear-dC8sen1J.js → linear-Cr5nCYH-.js} +2 -2
  46. package/dist/component/{mermaid-GHXKKRXX-Cf2opCv2.js → mermaid-GHXKKRXX-Da5y0Kes.js} +36506 -36516
  47. package/dist/component/{mindmap-definition-FAOFIHXS-BY0E7zzr.js → mindmap-definition-FAOFIHXS-CQ5erfft.js} +4 -4
  48. package/dist/component/{pegDiagram-VL7TDLO6-D9kAit8B.js → pegDiagram-VL7TDLO6-BP4d3yNS.js} +4 -4
  49. package/dist/component/{pieDiagram-7S7Q4E2Y-dLT0WWrb.js → pieDiagram-7S7Q4E2Y-BvhLQABG.js} +4 -4
  50. package/dist/component/{quadrantDiagram-CIZ2JOQS-BH5V9bJL.js → quadrantDiagram-CIZ2JOQS-DEtpNVeI.js} +3 -3
  51. package/dist/component/{railroadDiagram-AXF67PYL-CR6KpTxS.js → railroadDiagram-AXF67PYL-BQ1Tz2JD.js} +4 -4
  52. package/dist/component/{requirementDiagram-LRYGKXZP-BUT_vUQr.js → requirementDiagram-LRYGKXZP-DaubiNmJ.js} +4 -4
  53. package/dist/component/{sankeyDiagram-W5VNT64P-BJSC_sO5.js → sankeyDiagram-W5VNT64P-BHuCT4HV.js} +2 -2
  54. package/dist/component/{sequenceDiagram-SI44F4Z6-Dru3TnX4.js → sequenceDiagram-SI44F4Z6-Dds6EZRB.js} +4 -4
  55. package/dist/component/{sizeCapture-X5ZJPWSS-BayO20TJ.js → sizeCapture-X5ZJPWSS-DgUmHwfK.js} +2 -2
  56. package/dist/component/{stateDiagram-OKZ733FA-BbteUIbr.js → stateDiagram-OKZ733FA-DIKGff3C.js} +3 -3
  57. package/dist/component/{stateDiagram-v2-UEYNNEHI-DvS2V3Sy.js → stateDiagram-v2-UEYNNEHI-D-W1YrbI.js} +3 -3
  58. package/dist/component/{swimlanes-SLNWSIFB-CUTDOFkf.js → swimlanes-SLNWSIFB-B0g61P7R.js} +4 -4
  59. package/dist/component/{swimlanesDiagram-ULZ7WXOC-rwbZUP9Q.js → swimlanesDiagram-ULZ7WXOC-4-qQ_GG9.js} +3 -3
  60. package/dist/component/{timeline-definition-Z64GVDOM-GmP2iBR1.js → timeline-definition-Z64GVDOM-Df_xk-8z.js} +3 -3
  61. package/dist/component/{vennDiagram-T6HMQDX7-jV3XP4p2.js → vennDiagram-T6HMQDX7-Ce74weIb.js} +2 -2
  62. package/dist/component/{wardleyDiagram-T6FBY63Y-CZJ-vYBr.js → wardleyDiagram-T6FBY63Y-CMZ9e32m.js} +3 -3
  63. package/dist/component/{xychartDiagram-ELKLHX3M-x6JPK6Pc.js → xychartDiagram-ELKLHX3M-DgbdZWSQ.js} +3 -3
  64. package/dist/components/connectors/ConnectorBrandLogo.d.ts +1 -1
  65. package/dist/components/connectors/ConnectorMarketplaceDialog.d.ts +1 -2
  66. package/dist/components/connectors/NewConnectorDialog.d.ts +2 -2
  67. package/dist/components/embed/EmbedComposer.d.ts +6 -1
  68. package/dist/components/embed/QuestionCard.d.ts +25 -0
  69. package/dist/components/scheduled/ScheduledDetailSurface.d.ts +0 -3
  70. package/dist/embed/copy.d.ts +3 -0
  71. package/dist/i18n/messages/en.d.ts +19 -27
  72. package/dist/i18n/messages/surfaces/connectors.d.ts +0 -45
  73. package/dist/i18n/messages/surfaces/scheduled.d.ts +0 -33
  74. package/dist/i18n/messages/surfaces/stream.d.ts +58 -3
  75. package/dist/stream/belong-chat-transport.d.ts +44 -52
  76. package/dist/stream/belong-data-parts.d.ts +36 -44
  77. package/dist/stream/pending-question-store.d.ts +22 -0
  78. package/package.json +1 -1
  79. package/dist/api/microsoft-teams.d.ts +0 -66
  80. package/dist/components/connectors/MicrosoftTeamsConnectionDialog.d.ts +0 -4
@@ -29,9 +29,26 @@ export declare const streamEn: {
29
29
  readonly submitError: "That didn't go through — {{message}}. Try again.";
30
30
  readonly errorServerAnswered: "the server answered {{status}}";
31
31
  readonly errorRequestUnreachable: "the request didn't reach the server";
32
- readonly answered: "answered";
33
32
  readonly alreadyAnswered: "already answered";
33
+ readonly questionPending: "Waiting for your answer";
34
+ readonly questionSkipped: "skipped";
35
+ readonly questionClosed: "closed without answering";
36
+ readonly questionDetached: "still open — answer it or reply in the chat";
37
+ readonly questionCancelled: "cancelled";
38
+ readonly youReplied: "You replied: {{reply}}";
34
39
  readonly submit: "Submit";
40
+ readonly questionOf: "{{n}} of {{total}}";
41
+ readonly previousQuestion: "Previous question";
42
+ readonly nextQuestion: "Next question";
43
+ readonly close: "Close";
44
+ readonly somethingElse: "Something else";
45
+ readonly typeYourAnswer: "Type your answer…";
46
+ readonly skip: "Skip";
47
+ readonly selectedCount_one: "{{count}} selected";
48
+ readonly selectedCount_other: "{{count}} selected";
49
+ readonly answer: "Answer";
50
+ readonly next: "Next";
51
+ readonly questionDetachedHint: "Belong moved on — your answer will be sent as a new message";
35
52
  readonly toolShellRunning: "Running a command";
36
53
  readonly toolShellDone: "Ran a command";
37
54
  readonly toolShellFailed: "A command didn't complete";
@@ -71,6 +88,8 @@ export declare const streamEn: {
71
88
  readonly actionMadePlan: "Put a plan together";
72
89
  readonly actionCheckedRules: "Checked the rules";
73
90
  readonly actionScheduledTask: "Set up a scheduled task";
91
+ /** Plan 013 — `ask_user_question` / `AskUserQuestion`. */
92
+ readonly actionAskedQuestion: "Asked a question";
74
93
  /** A tool this build has no copy for — a neutral line, never its name. */
75
94
  readonly actionGeneric: "Worked on it";
76
95
  readonly executingTasks: "Working on it…";
@@ -120,9 +139,26 @@ export declare const streamEs: {
120
139
  submitError: string;
121
140
  errorServerAnswered: string;
122
141
  errorRequestUnreachable: string;
123
- answered: string;
124
142
  alreadyAnswered: string;
143
+ questionPending: string;
144
+ questionSkipped: string;
145
+ questionClosed: string;
146
+ questionDetached: string;
147
+ questionCancelled: string;
148
+ youReplied: string;
125
149
  submit: string;
150
+ questionOf: string;
151
+ previousQuestion: string;
152
+ nextQuestion: string;
153
+ close: string;
154
+ somethingElse: string;
155
+ typeYourAnswer: string;
156
+ skip: string;
157
+ selectedCount_one: string;
158
+ selectedCount_other: string;
159
+ answer: string;
160
+ next: string;
161
+ questionDetachedHint: string;
126
162
  toolShellRunning: string;
127
163
  toolShellDone: string;
128
164
  toolShellFailed: string;
@@ -162,6 +198,7 @@ export declare const streamEs: {
162
198
  actionMadePlan: string;
163
199
  actionCheckedRules: string;
164
200
  actionScheduledTask: string;
201
+ actionAskedQuestion: string;
165
202
  actionGeneric: string;
166
203
  executingTasks: string;
167
204
  workedSteps_one: string;
@@ -209,9 +246,26 @@ export declare const streamPt: {
209
246
  submitError: string;
210
247
  errorServerAnswered: string;
211
248
  errorRequestUnreachable: string;
212
- answered: string;
213
249
  alreadyAnswered: string;
250
+ questionPending: string;
251
+ questionSkipped: string;
252
+ questionClosed: string;
253
+ questionDetached: string;
254
+ questionCancelled: string;
255
+ youReplied: string;
214
256
  submit: string;
257
+ questionOf: string;
258
+ previousQuestion: string;
259
+ nextQuestion: string;
260
+ close: string;
261
+ somethingElse: string;
262
+ typeYourAnswer: string;
263
+ skip: string;
264
+ selectedCount_one: string;
265
+ selectedCount_other: string;
266
+ answer: string;
267
+ next: string;
268
+ questionDetachedHint: string;
215
269
  toolShellRunning: string;
216
270
  toolShellDone: string;
217
271
  toolShellFailed: string;
@@ -251,6 +305,7 @@ export declare const streamPt: {
251
305
  actionMadePlan: string;
252
306
  actionCheckedRules: string;
253
307
  actionScheduledTask: string;
308
+ actionAskedQuestion: string;
254
309
  actionGeneric: string;
255
310
  executingTasks: string;
256
311
  workedSteps_one: string;
@@ -9,6 +9,23 @@ declare const cancelRunResponseSchema: z.ZodObject<{
9
9
  }, z.core.$strip>>>;
10
10
  }, z.core.$strip>;
11
11
  export type RecalledQueuedMessage = z.infer<typeof cancelRunResponseSchema>["recalledMessages"][number];
12
+ export declare const choiceAnswerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"options">;
14
+ optionIds: z.ZodArray<z.ZodString>;
15
+ text: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ kind: z.ZodLiteral<"text">;
18
+ text: z.ZodString;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ kind: z.ZodLiteral<"skipped">;
21
+ }, z.core.$strip>], "kind">;
22
+ export declare const choiceStateSchema: z.ZodEnum<{
23
+ pending: "pending";
24
+ detached: "detached";
25
+ answered: "answered";
26
+ dismissed: "dismissed";
27
+ cancelled: "cancelled";
28
+ }>;
12
29
  /**
13
30
  * The wire/stored part union. Exported so the history loader (chat.tsx) can
14
31
  * validate persisted assistant parts against the SAME shapes the live stream
@@ -58,22 +75,6 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
58
75
  expired: "expired";
59
76
  }>;
60
77
  toolName: z.ZodOptional<z.ZodString>;
61
- preview: z.ZodOptional<z.ZodObject<{
62
- heading: z.ZodString;
63
- fields: z.ZodArray<z.ZodObject<{
64
- label: z.ZodString;
65
- value: z.ZodString;
66
- emphasis: z.ZodOptional<z.ZodEnum<{
67
- normal: "normal";
68
- warning: "warning";
69
- }>>;
70
- }, z.core.$strip>>;
71
- body: z.ZodNullable<z.ZodObject<{
72
- label: z.ZodString;
73
- content: z.ZodString;
74
- }, z.core.$strip>>;
75
- }, z.core.$strip>>;
76
- persistentConsentAllowed: z.ZodOptional<z.ZodBoolean>;
77
78
  subagentId: z.ZodOptional<z.ZodString>;
78
79
  }, z.core.$strip>;
79
80
  }, z.core.$strip>, z.ZodObject<{
@@ -204,47 +205,38 @@ export declare const wireStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
204
205
  }, z.core.$strip>, z.ZodObject<{
205
206
  type: z.ZodLiteral<"data-choice-request">;
206
207
  id: z.ZodString;
207
- data: z.ZodDiscriminatedUnion<[z.ZodObject<{
208
- mode: z.ZodLiteral<"single">;
209
- uiActionRequestId: z.ZodString;
210
- question: z.ZodString;
211
- options: z.ZodArray<z.ZodObject<{
212
- id: z.ZodString;
213
- label: z.ZodString;
214
- description: z.ZodOptional<z.ZodString>;
215
- }, z.core.$strip>>;
208
+ data: z.ZodObject<{
209
+ questionRequestId: z.ZodString;
216
210
  state: z.ZodEnum<{
217
211
  pending: "pending";
218
- expired: "expired";
219
- resolved: "resolved";
212
+ detached: "detached";
213
+ answered: "answered";
214
+ dismissed: "dismissed";
215
+ cancelled: "cancelled";
220
216
  }>;
221
- }, z.core.$strip>, z.ZodObject<{
222
- mode: z.ZodLiteral<"multi">;
223
- uiActionRequestId: z.ZodString;
224
- question: z.ZodString;
225
- options: z.ZodArray<z.ZodObject<{
217
+ questions: z.ZodArray<z.ZodObject<{
226
218
  id: z.ZodString;
227
- label: z.ZodString;
228
- description: z.ZodOptional<z.ZodString>;
219
+ question: z.ZodString;
220
+ header: z.ZodString;
221
+ multiSelect: z.ZodBoolean;
222
+ options: z.ZodArray<z.ZodObject<{
223
+ id: z.ZodString;
224
+ label: z.ZodString;
225
+ description: z.ZodString;
226
+ }, z.core.$strip>>;
229
227
  }, z.core.$strip>>;
230
- state: z.ZodEnum<{
231
- pending: "pending";
232
- expired: "expired";
233
- resolved: "resolved";
234
- }>;
235
- minChoicesCount: z.ZodOptional<z.ZodNumber>;
236
- maxChoicesCount: z.ZodOptional<z.ZodNumber>;
237
- }, z.core.$strip>, z.ZodObject<{
238
- mode: z.ZodLiteral<"open">;
239
- uiActionRequestId: z.ZodString;
240
- question: z.ZodString;
241
- state: z.ZodEnum<{
242
- pending: "pending";
243
- expired: "expired";
244
- resolved: "resolved";
245
- }>;
246
- placeholder: z.ZodOptional<z.ZodString>;
247
- }, z.core.$strip>], "mode">;
228
+ answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
229
+ kind: z.ZodLiteral<"options">;
230
+ optionIds: z.ZodArray<z.ZodString>;
231
+ text: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strip>, z.ZodObject<{
233
+ kind: z.ZodLiteral<"text">;
234
+ text: z.ZodString;
235
+ }, z.core.$strip>, z.ZodObject<{
236
+ kind: z.ZodLiteral<"skipped">;
237
+ }, z.core.$strip>], "kind">>>;
238
+ reply: z.ZodOptional<z.ZodString>;
239
+ }, z.core.$strip>;
248
240
  }, z.core.$strip>], "type">;
249
241
  /** A request was 401'd twice (once with a freshly re-read token): the host
250
242
  * session is expired — the dock must surface re-auth, not retry forever. */
@@ -15,7 +15,7 @@ export type PlanStep = {
15
15
  };
16
16
  export type ApprovalState = "pending" | "approved" | "rejected" | "amend_requested" | "expired";
17
17
  export type ToolCallState = "started" | "completed" | "failed";
18
- export type ChoiceState = "pending" | "resolved" | "expired";
18
+ export type ChoiceState = "pending" | "answered" | "dismissed" | "detached" | "cancelled";
19
19
  export type SandboxCommandState = "started" | "output" | "completed" | "failed";
20
20
  export type SandboxStream = "stdout" | "stderr";
21
21
  export type UiActionState = "requested" | "completed" | "failed";
@@ -28,18 +28,6 @@ export type PlanData = {
28
28
  readonly summary: string;
29
29
  readonly steps: readonly PlanStep[];
30
30
  };
31
- export type ApprovalPreview = {
32
- readonly heading: string;
33
- readonly fields: readonly {
34
- readonly label: string;
35
- readonly value: string;
36
- readonly emphasis?: "normal" | "warning" | undefined;
37
- }[];
38
- readonly body: {
39
- readonly label: string;
40
- readonly content: string;
41
- } | null;
42
- };
43
31
  export type ApprovalRequestData = {
44
32
  readonly approvalId: string;
45
33
  readonly reason: string;
@@ -52,9 +40,6 @@ export type ApprovalRequestData = {
52
40
  * messages; render the generic label when undefined.
53
41
  */
54
42
  readonly toolName?: string | undefined;
55
- readonly preview?: ApprovalPreview | undefined;
56
- /** False for exact-action approvals that must never become standing consent. */
57
- readonly persistentConsentAllowed?: boolean | undefined;
58
43
  /**
59
44
  * BEL-199 attribution — the `data-subagent` part id whose gated call raised this
60
45
  * card. The resolution event (`approval_state_changed`) carries no subagentId, so
@@ -63,44 +48,51 @@ export type ApprovalRequestData = {
63
48
  readonly subagentId?: string | undefined;
64
49
  };
65
50
  /**
66
- * BEL-93 — a friendly question widget the agent emits instead of dumping a wall
67
- * of questions as prose. Discriminated on `mode`:
68
- * - "single": choose exactly one option (radio group)
69
- * - "multi": choose several options (checkbox list), bounded by
70
- * min/maxChoicesCount when present
71
- * - "open": free-text answer (textarea)
72
- * The user answers in-dock; the SDK posts the answer back through the same
73
- * `ui-actions/:uiActionRequestId/result` endpoint the UI-action renderer uses,
74
- * so no new backend route is needed. `state` mirrors the approval lifecycle
75
- * (see ChoiceState) so a resolved/expired question survives a reload.
51
+ * Plan 013 (supersedes BEL-93's single-question shape) — the agent's
52
+ * `AskUserQuestion` call as ONE part: 1–4 questions, each single- or
53
+ * multi-select with 2–4 options (label + description). The dock adds its own
54
+ * "Something else" free-text row and a per-question Skip. Answers post to
55
+ * `POST /v1/questions/:questionRequestId/answer` by option id; `answers` /
56
+ * `reply` are filled in by the backend on resolution (live) or by the history
57
+ * patch (reload) so the transcript record renders identically either way.
76
58
  */
77
59
  export type ChoiceOption = {
78
60
  readonly id: string;
79
61
  readonly label: string;
80
- readonly description?: string | undefined;
62
+ readonly description: string;
81
63
  };
82
- export type ChoiceRequestData = {
83
- readonly mode: "single";
84
- readonly uiActionRequestId: string;
64
+ export type ChoiceQuestion = {
65
+ readonly id: string;
85
66
  readonly question: string;
67
+ /** Chip label, ≤ 12 chars. */
68
+ readonly header: string;
69
+ readonly multiSelect: boolean;
86
70
  readonly options: readonly ChoiceOption[];
87
- readonly state: ChoiceState;
71
+ };
72
+ /**
73
+ * One question's answer. On a MULTI-select question `text` alongside
74
+ * `optionIds` is the "Something else" free text combined with the ticks — the
75
+ * agent gets both. A single-select answer is exactly one option OR `text`
76
+ * (the server rejects options + text there).
77
+ */
78
+ export type ChoiceAnswer = {
79
+ readonly kind: "options";
80
+ readonly optionIds: readonly string[];
81
+ readonly text?: string | undefined;
88
82
  } | {
89
- readonly mode: "multi";
90
- readonly uiActionRequestId: string;
91
- readonly question: string;
92
- readonly options: readonly ChoiceOption[];
93
- readonly state: ChoiceState;
94
- /** Inclusive lower bound on selected options. Absent ⇒ at least one (1). */
95
- readonly minChoicesCount?: number | undefined;
96
- /** Inclusive upper bound on selected options. Absent ⇒ no maximum. */
97
- readonly maxChoicesCount?: number | undefined;
83
+ readonly kind: "text";
84
+ readonly text: string;
98
85
  } | {
99
- readonly mode: "open";
100
- readonly uiActionRequestId: string;
101
- readonly question: string;
86
+ readonly kind: "skipped";
87
+ };
88
+ export type ChoiceRequestData = {
89
+ readonly questionRequestId: string;
102
90
  readonly state: ChoiceState;
103
- readonly placeholder?: string | undefined;
91
+ readonly questions: readonly ChoiceQuestion[];
92
+ /** Keyed by question id. Present once answered. */
93
+ readonly answers?: Readonly<Record<string, ChoiceAnswer>> | undefined;
94
+ /** The composer text when the user replied in chat instead of choosing. */
95
+ readonly reply?: string | undefined;
104
96
  };
105
97
  /**
106
98
  * Optional fields declared with explicit `| undefined` so Zod's
@@ -0,0 +1,22 @@
1
+ import { BelongUIMessage, ChoiceRequestData } from './belong-data-parts.ts';
2
+ /** Snapshot — identity is stable until the set changes (useSyncExternalStore). */
3
+ export declare const peekHiddenQuestions: () => ReadonlySet<string>;
4
+ export declare const subscribeHiddenQuestions: (listener: () => void) => (() => void);
5
+ export declare const isQuestionHidden: (questionRequestId: string) => boolean;
6
+ export declare const hideQuestion: (questionRequestId: string) => void;
7
+ export declare const unhideQuestion: (questionRequestId: string) => void;
8
+ export declare const __resetPendingQuestionStoreForTest: () => void;
9
+ /**
10
+ * The question the bottom card should show: the NEWEST answerable
11
+ * `data-choice-request` part across the conversation that is not hidden, or
12
+ * null. Same-id parts replace each other in `useChat` (a resolution arrives
13
+ * as the same part id with a terminal state), so a question that was answered
14
+ * — from this tab, another tab, or a reload's history patch — un-arms the card
15
+ * from the wire without any local bookkeeping.
16
+ *
17
+ * The LAST occurrence of each question id wins before "newest" is decided: a
18
+ * restored history part and a resumed stream's re-emit of the same question
19
+ * (§40 re-attach) can sit in different messages, and only the later one
20
+ * carries the current state.
21
+ */
22
+ export declare const selectActiveQuestion: (messages: readonly BelongUIMessage[], hiddenIds: ReadonlySet<string>) => ChoiceRequestData | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belonguniverseai/react-sdk",
3
- "version": "0.6.15-teams.1",
3
+ "version": "0.6.16",
4
4
  "description": "Belong — embeddable React AI assistant dock. Mount <BelongWidget> in your app tree with getToken dependency-injection auth.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,66 +0,0 @@
1
- import { z } from 'zod';
2
- import { ApiClient } from './client.ts';
3
- declare const microsoftTeamsConnectionSchema: z.ZodObject<{
4
- connected: z.ZodBoolean;
5
- status: z.ZodEnum<{
6
- error: "error";
7
- needs_auth: "needs_auth";
8
- connected: "connected";
9
- disconnected: "disconnected";
10
- }>;
11
- account: z.ZodNullable<z.ZodObject<{
12
- displayName: z.ZodString;
13
- userPrincipalName: z.ZodString;
14
- }, z.core.$strip>>;
15
- capabilities: z.ZodObject<{
16
- baseline: z.ZodEnum<{
17
- error: "error";
18
- needs_auth: "needs_auth";
19
- ready: "ready";
20
- }>;
21
- channelHistory: z.ZodEnum<{
22
- error: "error";
23
- ready: "ready";
24
- needs_admin_consent: "needs_admin_consent";
25
- }>;
26
- transcripts: z.ZodEnum<{
27
- error: "error";
28
- ready: "ready";
29
- needs_admin_consent: "needs_admin_consent";
30
- transcript_access_disabled: "transcript_access_disabled";
31
- }>;
32
- messageSearch: z.ZodEnum<{
33
- error: "error";
34
- needs_auth: "needs_auth";
35
- ready: "ready";
36
- disabled: "disabled";
37
- }>;
38
- }, z.core.$strip>;
39
- }, z.core.$strip>;
40
- export type MicrosoftTeamsConnection = z.infer<typeof microsoftTeamsConnectionSchema>;
41
- export type MicrosoftTeamsConnectionResult = {
42
- readonly status: "ready";
43
- readonly connection: MicrosoftTeamsConnection;
44
- } | {
45
- readonly status: "featureAbsent";
46
- };
47
- export type MicrosoftTeamsAuthorizationOutcome = {
48
- readonly status: "started";
49
- readonly authorizationUrl: string;
50
- } | {
51
- readonly status: "invalid_return_path" | "connection_not_found" | "provider_unavailable" | "forbidden" | "featureAbsent" | "error";
52
- };
53
- export type DisconnectMicrosoftTeamsOutcome = {
54
- readonly status: "disconnected";
55
- } | {
56
- readonly status: "forbidden" | "featureAbsent" | "error";
57
- };
58
- export declare const getMicrosoftTeamsConnectionRequest: (api: ApiClient, signal?: AbortSignal) => Promise<MicrosoftTeamsConnectionResult>;
59
- export declare const startMicrosoftTeamsOAuthRequest: (api: ApiClient, returnPath: string) => Promise<MicrosoftTeamsAuthorizationOutcome>;
60
- export declare const startMicrosoftTeamsAdminConsentRequest: (api: ApiClient, returnPath: string) => Promise<MicrosoftTeamsAuthorizationOutcome>;
61
- export declare const disconnectMicrosoftTeamsRequest: (api: ApiClient) => Promise<DisconnectMicrosoftTeamsOutcome>;
62
- export declare const useMicrosoftTeamsConnection: () => import('@tanstack/react-query').UseQueryResult<NoInfer<MicrosoftTeamsConnectionResult>, Error>;
63
- export declare const useStartMicrosoftTeamsOAuth: () => import('@tanstack/react-query').UseMutationResult<MicrosoftTeamsAuthorizationOutcome, Error, string, unknown>;
64
- export declare const useStartMicrosoftTeamsAdminConsent: () => import('@tanstack/react-query').UseMutationResult<MicrosoftTeamsAuthorizationOutcome, Error, string, unknown>;
65
- export declare const useDisconnectMicrosoftTeams: () => import('@tanstack/react-query').UseMutationResult<DisconnectMicrosoftTeamsOutcome, Error, void, unknown>;
66
- export {};
@@ -1,4 +0,0 @@
1
- export declare const MicrosoftTeamsConnectionDialog: ({ open, onOpenChange, }: {
2
- readonly open: boolean;
3
- readonly onOpenChange: (open: boolean) => void;
4
- }) => import("react").JSX.Element;