@assistant-ui/react-generative-ui 0.0.17 → 0.0.19
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/dist/JSONGenerativeUI.client.d.ts +1 -2
- package/dist/JSONGenerativeUI.client.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.server.d.ts +1 -2
- package/dist/JSONGenerativeUI.server.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.shared.d.ts +8 -9
- package/dist/JSONGenerativeUI.shared.d.ts.map +1 -1
- package/dist/a2ui/convert.d.ts +1 -2
- package/dist/a2ui/convert.d.ts.map +1 -1
- package/dist/a2ui/convert.js +11 -2
- package/dist/a2ui/convert.js.map +1 -1
- package/dist/a2ui/reducer.d.ts +1 -2
- package/dist/a2ui/reducer.d.ts.map +1 -1
- package/dist/a2ui/reducer.js +63 -10
- package/dist/a2ui/reducer.js.map +1 -1
- package/dist/a2ui/types.d.ts +17 -18
- package/dist/a2ui/types.d.ts.map +1 -1
- package/dist/actionRegistry.d.ts +5 -6
- package/dist/actionRegistry.d.ts.map +1 -1
- package/dist/buildPresentParameters.d.ts +2 -3
- package/dist/buildPresentParameters.d.ts.map +1 -1
- package/dist/buildPresentParameters.js +4 -3
- package/dist/buildPresentParameters.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/convert/boundSpec.d.ts +7 -8
- package/dist/convert/boundSpec.d.ts.map +1 -1
- package/dist/convert/copyBounded.d.ts +1 -2
- package/dist/convert/copyBounded.d.ts.map +1 -1
- package/dist/convert/isElement.d.ts +1 -2
- package/dist/convert/isElement.d.ts.map +1 -1
- package/dist/convert/takeRun.d.ts +1 -2
- package/dist/convert/takeRun.d.ts.map +1 -1
- package/dist/defineGenerativeComponents.d.ts +1 -2
- package/dist/defineGenerativeComponents.d.ts.map +1 -1
- package/dist/generativeUIToJSX.d.ts +2 -3
- package/dist/generativeUIToJSX.d.ts.map +1 -1
- package/dist/ir.d.ts +28 -29
- package/dist/ir.d.ts.map +1 -1
- package/dist/renderGenerativeUI.d.ts +1 -2
- package/dist/renderGenerativeUI.d.ts.map +1 -1
- package/dist/renderGenerativeUI.js +1 -1
- package/dist/renderGenerativeUI.js.map +1 -1
- package/dist/slack/constants.d.ts +35 -36
- package/dist/slack/constants.d.ts.map +1 -1
- package/dist/slack/decodeBlockAction.d.ts +1 -2
- package/dist/slack/decodeBlockAction.d.ts.map +1 -1
- package/dist/slack/fromSlackBlocks.d.ts +1 -2
- package/dist/slack/fromSlackBlocks.d.ts.map +1 -1
- package/dist/slack/toSlackBlocks.d.ts +1 -2
- package/dist/slack/toSlackBlocks.d.ts.map +1 -1
- package/dist/slack/types.d.ts +32 -33
- package/dist/slack/types.d.ts.map +1 -1
- package/dist/teams/constants.d.ts +14 -15
- package/dist/teams/constants.d.ts.map +1 -1
- package/dist/teams/decodeSubmitData.d.ts +1 -2
- package/dist/teams/decodeSubmitData.d.ts.map +1 -1
- package/dist/teams/toAdaptiveCard.d.ts +6 -7
- package/dist/teams/toAdaptiveCard.d.ts.map +1 -1
- package/dist/teams/toTeamsAttachments.d.ts +1 -2
- package/dist/teams/toTeamsAttachments.d.ts.map +1 -1
- package/dist/teams/types.d.ts +29 -30
- package/dist/teams/types.d.ts.map +1 -1
- package/dist/types.d.ts +9 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/vocabulary/alert.d.ts +2 -3
- package/dist/vocabulary/alert.d.ts.map +1 -1
- package/dist/vocabulary/alert.js +21 -16
- package/dist/vocabulary/alert.js.map +1 -1
- package/dist/vocabulary/collectFormValues.d.ts +6 -5
- package/dist/vocabulary/collectFormValues.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.js +3 -2
- package/dist/vocabulary/collectFormValues.js.map +1 -1
- package/dist/vocabulary/data.d.ts +1 -2
- package/dist/vocabulary/data.d.ts.map +1 -1
- package/dist/vocabulary/data.js +20 -12
- package/dist/vocabulary/data.js.map +1 -1
- package/dist/vocabulary/dispatch.d.ts +2 -3
- package/dist/vocabulary/dispatch.d.ts.map +1 -1
- package/dist/vocabulary/fact.d.ts +1 -2
- package/dist/vocabulary/fact.d.ts.map +1 -1
- package/dist/vocabulary/fact.js +3 -2
- package/dist/vocabulary/fact.js.map +1 -1
- package/dist/vocabulary/form.d.ts +1 -2
- package/dist/vocabulary/form.d.ts.map +1 -1
- package/dist/vocabulary/icon.d.ts +1 -2
- package/dist/vocabulary/icon.d.ts.map +1 -1
- package/dist/vocabulary/index.d.ts +1 -2
- package/dist/vocabulary/index.d.ts.map +1 -1
- package/dist/vocabulary/interactive.d.ts +10 -9
- package/dist/vocabulary/interactive.d.ts.map +1 -1
- package/dist/vocabulary/interactive.js +30 -23
- package/dist/vocabulary/interactive.js.map +1 -1
- package/dist/vocabulary/layout.d.ts +1 -2
- package/dist/vocabulary/layout.d.ts.map +1 -1
- package/dist/vocabulary/layout.js +7 -5
- package/dist/vocabulary/layout.js.map +1 -1
- package/dist/vocabulary/list.d.ts +1 -2
- package/dist/vocabulary/list.d.ts.map +1 -1
- package/dist/vocabulary/media.d.ts +1 -2
- package/dist/vocabulary/media.d.ts.map +1 -1
- package/dist/vocabulary/text.d.ts +2 -3
- package/dist/vocabulary/text.d.ts.map +1 -1
- package/dist/vocabulary/text.js +4 -3
- package/dist/vocabulary/text.js.map +1 -1
- package/dist/vocabulary/toTextContent.d.ts +4 -0
- package/dist/vocabulary/toTextContent.d.ts.map +1 -0
- package/dist/vocabulary/toTextContent.js +6 -0
- package/dist/vocabulary/toTextContent.js.map +1 -0
- package/package.json +12 -10
- package/src/a2ui/convert.test.ts +36 -0
- package/src/a2ui/convert.ts +21 -2
- package/src/a2ui/reducer.test.ts +223 -0
- package/src/a2ui/reducer.ts +76 -12
- package/src/buildPresentParameters.ts +7 -4
- package/src/constants.ts +2 -0
- package/src/renderGenerativeUI.test.tsx +57 -0
- package/src/renderGenerativeUI.tsx +3 -1
- package/src/slack/fromSlackBlocks.test.ts +4 -1
- package/src/slack/toSlackBlocks.test.ts +8 -4
- package/src/teams/toAdaptiveCard.test.ts +5 -3
- package/src/vocabulary/alert.test.tsx +10 -0
- package/src/vocabulary/alert.tsx +16 -7
- package/src/vocabulary/collectFormValues.test.ts +38 -0
- package/src/vocabulary/collectFormValues.ts +11 -2
- package/src/vocabulary/data.test.tsx +40 -0
- package/src/vocabulary/data.tsx +47 -26
- package/src/vocabulary/fact.test.tsx +12 -0
- package/src/vocabulary/fact.tsx +3 -2
- package/src/vocabulary/form.test.tsx +1 -0
- package/src/vocabulary/interactive.test.tsx +55 -1
- package/src/vocabulary/interactive.tsx +50 -29
- package/src/vocabulary/layout.test.tsx +17 -0
- package/src/vocabulary/layout.tsx +8 -4
- package/src/vocabulary/list.test.tsx +5 -4
- package/src/vocabulary/text.test.tsx +29 -0
- package/src/vocabulary/text.tsx +4 -3
- package/src/vocabulary/toTextContent.ts +2 -0
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +0 -141
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +0 -1
package/dist/slack/types.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { UIElement } from "../ir.js";
|
|
2
2
|
//#region src/slack/types.d.ts
|
|
3
3
|
/** A Slack plain-text composition object. */
|
|
4
|
-
interface SlackPlainText {
|
|
4
|
+
export interface SlackPlainText {
|
|
5
5
|
readonly type: "plain_text";
|
|
6
6
|
readonly text: string;
|
|
7
7
|
}
|
|
8
8
|
/** A Slack mrkdwn composition object. */
|
|
9
|
-
interface SlackMrkdwnText {
|
|
9
|
+
export interface SlackMrkdwnText {
|
|
10
10
|
readonly type: "mrkdwn";
|
|
11
11
|
readonly text: string;
|
|
12
12
|
}
|
|
13
13
|
/** A text composition object accepted by card and alert text fields. */
|
|
14
|
-
type SlackTextObject = SlackPlainText | SlackMrkdwnText;
|
|
14
|
+
export type SlackTextObject = SlackPlainText | SlackMrkdwnText;
|
|
15
15
|
/** A selectable Slack option. */
|
|
16
|
-
interface SlackOption {
|
|
16
|
+
export interface SlackOption {
|
|
17
17
|
readonly text: SlackPlainText;
|
|
18
18
|
readonly value: string;
|
|
19
19
|
}
|
|
20
20
|
/** A Slack button element. */
|
|
21
|
-
interface SlackButtonElement {
|
|
21
|
+
export interface SlackButtonElement {
|
|
22
22
|
readonly type: "button";
|
|
23
23
|
readonly text: SlackPlainText;
|
|
24
24
|
readonly action_id: string;
|
|
@@ -26,98 +26,98 @@ interface SlackButtonElement {
|
|
|
26
26
|
readonly style?: "primary" | "danger";
|
|
27
27
|
}
|
|
28
28
|
/** A Slack static-select element. */
|
|
29
|
-
interface SlackStaticSelectElement {
|
|
29
|
+
export interface SlackStaticSelectElement {
|
|
30
30
|
readonly type: "static_select";
|
|
31
31
|
readonly action_id: string;
|
|
32
32
|
readonly options: readonly SlackOption[];
|
|
33
33
|
readonly placeholder?: SlackPlainText;
|
|
34
34
|
}
|
|
35
35
|
/** A Slack date-picker element. */
|
|
36
|
-
interface SlackDatePickerElement {
|
|
36
|
+
export interface SlackDatePickerElement {
|
|
37
37
|
readonly type: "datepicker";
|
|
38
38
|
readonly action_id: string;
|
|
39
39
|
readonly initial_date?: string;
|
|
40
40
|
}
|
|
41
41
|
/** A Slack checkbox-group element. */
|
|
42
|
-
interface SlackCheckboxesElement {
|
|
42
|
+
export interface SlackCheckboxesElement {
|
|
43
43
|
readonly type: "checkboxes";
|
|
44
44
|
readonly action_id: string;
|
|
45
45
|
readonly options: readonly SlackOption[];
|
|
46
46
|
readonly initial_options?: readonly SlackOption[];
|
|
47
47
|
}
|
|
48
48
|
/** A Slack radio-button element. */
|
|
49
|
-
interface SlackRadioButtonsElement {
|
|
49
|
+
export interface SlackRadioButtonsElement {
|
|
50
50
|
readonly type: "radio_buttons";
|
|
51
51
|
readonly action_id: string;
|
|
52
52
|
readonly options: readonly SlackOption[];
|
|
53
53
|
readonly initial_option?: SlackOption;
|
|
54
54
|
}
|
|
55
55
|
/** A Slack plain-text input element. */
|
|
56
|
-
interface SlackPlainTextInputElement {
|
|
56
|
+
export interface SlackPlainTextInputElement {
|
|
57
57
|
readonly type: "plain_text_input";
|
|
58
58
|
readonly action_id: string;
|
|
59
59
|
readonly multiline?: boolean;
|
|
60
60
|
readonly placeholder?: SlackPlainText;
|
|
61
61
|
}
|
|
62
62
|
/** An element accepted by a Slack actions block. */
|
|
63
|
-
type SlackActionElement = SlackButtonElement | SlackStaticSelectElement | SlackDatePickerElement | SlackCheckboxesElement | SlackRadioButtonsElement;
|
|
63
|
+
export type SlackActionElement = SlackButtonElement | SlackStaticSelectElement | SlackDatePickerElement | SlackCheckboxesElement | SlackRadioButtonsElement;
|
|
64
64
|
/** A Slack header block. */
|
|
65
|
-
interface SlackHeaderBlock {
|
|
65
|
+
export interface SlackHeaderBlock {
|
|
66
66
|
readonly type: "header";
|
|
67
67
|
readonly text: SlackPlainText;
|
|
68
68
|
}
|
|
69
69
|
/** A Slack section block. */
|
|
70
|
-
interface SlackSectionBlock {
|
|
70
|
+
export interface SlackSectionBlock {
|
|
71
71
|
readonly type: "section";
|
|
72
72
|
readonly text?: SlackMrkdwnText;
|
|
73
73
|
readonly fields?: readonly SlackMrkdwnText[];
|
|
74
74
|
readonly accessory?: SlackButtonElement;
|
|
75
75
|
}
|
|
76
76
|
/** A Slack context block. */
|
|
77
|
-
interface SlackContextBlock {
|
|
77
|
+
export interface SlackContextBlock {
|
|
78
78
|
readonly type: "context";
|
|
79
79
|
readonly elements: readonly SlackMrkdwnText[];
|
|
80
80
|
}
|
|
81
81
|
/** A Slack image block. */
|
|
82
|
-
interface SlackImageBlock {
|
|
82
|
+
export interface SlackImageBlock {
|
|
83
83
|
readonly type: "image";
|
|
84
84
|
readonly image_url: string;
|
|
85
85
|
readonly alt_text: string;
|
|
86
86
|
}
|
|
87
87
|
/** A Slack divider block. */
|
|
88
|
-
interface SlackDividerBlock {
|
|
88
|
+
export interface SlackDividerBlock {
|
|
89
89
|
readonly type: "divider";
|
|
90
90
|
}
|
|
91
91
|
/** A Slack actions block. */
|
|
92
|
-
interface SlackActionsBlock {
|
|
92
|
+
export interface SlackActionsBlock {
|
|
93
93
|
readonly type: "actions";
|
|
94
94
|
readonly elements: readonly SlackActionElement[];
|
|
95
95
|
}
|
|
96
96
|
/** A Slack input block. */
|
|
97
|
-
interface SlackInputBlock {
|
|
97
|
+
export interface SlackInputBlock {
|
|
98
98
|
readonly type: "input";
|
|
99
99
|
readonly label: SlackPlainText;
|
|
100
100
|
readonly element: SlackPlainTextInputElement;
|
|
101
101
|
}
|
|
102
102
|
/** A text cell in a Slack data-table block. */
|
|
103
|
-
interface SlackDataTableRawTextCell {
|
|
103
|
+
export interface SlackDataTableRawTextCell {
|
|
104
104
|
readonly type: "raw_text";
|
|
105
105
|
readonly text: string;
|
|
106
106
|
}
|
|
107
107
|
/** A numeric cell in a Slack data-table block. */
|
|
108
|
-
interface SlackDataTableRawNumberCell {
|
|
108
|
+
export interface SlackDataTableRawNumberCell {
|
|
109
109
|
readonly type: "raw_number";
|
|
110
110
|
readonly text: string;
|
|
111
111
|
}
|
|
112
112
|
/** A cell value in a Slack data-table block. */
|
|
113
|
-
type SlackDataTableCell = SlackDataTableRawTextCell | SlackDataTableRawNumberCell;
|
|
113
|
+
export type SlackDataTableCell = SlackDataTableRawTextCell | SlackDataTableRawNumberCell;
|
|
114
114
|
/**
|
|
115
115
|
* A Slack card block. A card does not nest arbitrary blocks: content is
|
|
116
116
|
* limited to a hero image, title, subtitle, body, subtext, and up to three
|
|
117
117
|
* action buttons. At least one of `hero_image`, `title`, `actions`, or `body`
|
|
118
118
|
* is required.
|
|
119
119
|
*/
|
|
120
|
-
interface SlackCardBlock {
|
|
120
|
+
export interface SlackCardBlock {
|
|
121
121
|
readonly type: "card";
|
|
122
122
|
readonly hero_image?: SlackImageBlock;
|
|
123
123
|
readonly title?: SlackTextObject;
|
|
@@ -127,34 +127,34 @@ interface SlackCardBlock {
|
|
|
127
127
|
readonly actions?: readonly SlackButtonElement[];
|
|
128
128
|
}
|
|
129
129
|
/** A Slack carousel block: a horizontally scrollable group of card blocks. */
|
|
130
|
-
interface SlackCarouselBlock {
|
|
130
|
+
export interface SlackCarouselBlock {
|
|
131
131
|
readonly type: "carousel";
|
|
132
132
|
readonly elements: readonly SlackCardBlock[];
|
|
133
133
|
}
|
|
134
134
|
/** A Slack data-table block. The first entry in `rows` is the header row. */
|
|
135
|
-
interface SlackDataTableBlock {
|
|
135
|
+
export interface SlackDataTableBlock {
|
|
136
136
|
readonly type: "data_table";
|
|
137
137
|
readonly caption: string;
|
|
138
138
|
readonly rows: readonly (readonly SlackDataTableCell[])[];
|
|
139
139
|
readonly page_size?: number;
|
|
140
140
|
}
|
|
141
141
|
/** A Slack markdown block. */
|
|
142
|
-
interface SlackMarkdownBlock {
|
|
142
|
+
export interface SlackMarkdownBlock {
|
|
143
143
|
readonly type: "markdown";
|
|
144
144
|
readonly text: string;
|
|
145
145
|
}
|
|
146
146
|
/** The severity level accepted by a Slack alert block. */
|
|
147
|
-
type SlackAlertLevel = "default" | "info" | "warning" | "error" | "success";
|
|
147
|
+
export type SlackAlertLevel = "default" | "info" | "warning" | "error" | "success";
|
|
148
148
|
/** A Slack alert block. Alert blocks are only supported in modals. */
|
|
149
|
-
interface SlackAlertBlock {
|
|
149
|
+
export interface SlackAlertBlock {
|
|
150
150
|
readonly type: "alert";
|
|
151
151
|
readonly text: SlackTextObject;
|
|
152
152
|
readonly level?: SlackAlertLevel;
|
|
153
153
|
}
|
|
154
154
|
/** A block emitted by the Slack converter. */
|
|
155
|
-
type SlackBlock = SlackHeaderBlock | SlackSectionBlock | SlackContextBlock | SlackImageBlock | SlackDividerBlock | SlackActionsBlock | SlackInputBlock | SlackCardBlock | SlackCarouselBlock | SlackDataTableBlock | SlackMarkdownBlock | SlackAlertBlock;
|
|
155
|
+
export type SlackBlock = SlackHeaderBlock | SlackSectionBlock | SlackContextBlock | SlackImageBlock | SlackDividerBlock | SlackActionsBlock | SlackInputBlock | SlackCardBlock | SlackCarouselBlock | SlackDataTableBlock | SlackMarkdownBlock | SlackAlertBlock;
|
|
156
156
|
/** Options that select the target Slack surface. */
|
|
157
|
-
interface ToSlackBlocksOptions {
|
|
157
|
+
export interface ToSlackBlocksOptions {
|
|
158
158
|
readonly surface?: "message" | "modal";
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
@@ -164,21 +164,20 @@ interface ToSlackBlocksOptions {
|
|
|
164
164
|
* of its props and may leave a placeholder note behind, and `fallback` emitted
|
|
165
165
|
* the node in a different form than requested.
|
|
166
166
|
*/
|
|
167
|
-
interface SlackConversionWarning {
|
|
167
|
+
export interface SlackConversionWarning {
|
|
168
168
|
readonly code: "clamped" | "dropped" | "fallback";
|
|
169
169
|
readonly component: string;
|
|
170
170
|
readonly detail: string;
|
|
171
171
|
}
|
|
172
172
|
/** The blocks and non-fatal warnings produced by Slack conversion. */
|
|
173
|
-
interface SlackBlocksResult {
|
|
173
|
+
export interface SlackBlocksResult {
|
|
174
174
|
readonly blocks: SlackBlock[];
|
|
175
175
|
readonly warnings: SlackConversionWarning[];
|
|
176
176
|
}
|
|
177
177
|
/** The IR nodes and non-fatal warnings produced by converting Slack Block Kit JSON back into generative UI. */
|
|
178
|
-
interface FromSlackBlocksResult {
|
|
178
|
+
export interface FromSlackBlocksResult {
|
|
179
179
|
readonly nodes: UIElement[];
|
|
180
180
|
readonly warnings: SlackConversionWarning[];
|
|
181
181
|
}
|
|
182
182
|
//#endregion
|
|
183
|
-
export { FromSlackBlocksResult, SlackActionElement, SlackActionsBlock, SlackAlertBlock, SlackAlertLevel, SlackBlock, SlackBlocksResult, SlackButtonElement, SlackCardBlock, SlackCarouselBlock, SlackCheckboxesElement, SlackContextBlock, SlackConversionWarning, SlackDataTableBlock, SlackDataTableCell, SlackDataTableRawNumberCell, SlackDataTableRawTextCell, SlackDatePickerElement, SlackDividerBlock, SlackHeaderBlock, SlackImageBlock, SlackInputBlock, SlackMarkdownBlock, SlackMrkdwnText, SlackOption, SlackPlainText, SlackPlainTextInputElement, SlackRadioButtonsElement, SlackSectionBlock, SlackStaticSelectElement, SlackTextObject, ToSlackBlocksOptions };
|
|
184
183
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/slack/types.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/slack/types.ts"],"mappings":";;;iBAGiB;WACN;WACA;;;iBAIM;WACN;WACA;;;YAIC,kBAAkB,iBAAiB;;iBAG9B;WACN,MAAM;WACN;;;iBAIM;WACN;WACA,MAAM;WACN;WACA;WACA;;;iBAIM;WACN;WACA;WACA,kBAAkB;WAClB,cAAc;;;iBAIR;WACN;WACA;WACA;;;iBAIM;WACN;WACA;WACA,kBAAkB;WAClB,2BAA2B;;;iBAIrB;WACN;WACA;WACA,kBAAkB;WAClB,iBAAiB;;;iBAIX;WACN;WACA;WACA;WACA,cAAc;;;YAIb,qBACR,qBACA,2BACA,yBACA,yBACA;;iBAGa;WACN;WACA,MAAM;;;iBAIA;WACN;WACA,OAAO;WACP,kBAAkB;WAClB,YAAY;;;iBAIN;WACN;WACA,mBAAmB;;;iBAIb;WACN;WACA;WACA;;;iBAIM;WACN;;;iBAIM;WACN;WACA,mBAAmB;;;iBAIb;WACN;WACA,OAAO;WACP,SAAS;;;iBAIH;WACN;WACA;;;iBAIM;WACN;WACA;;;YAIC,qBACR,4BACA;;;;;;;iBAQa;WACN;WACA,aAAa;WACb,QAAQ;WACR,WAAW;WACX,OAAO;WACP,UAAU;WACV,mBAAmB;;;iBAIb;WACN;WACA,mBAAmB;;;iBAIb;WACN;WACA;WACA,yBAAyB;WACzB;;;iBAIM;WACN;WACA;;;YAIC;;iBAQK;WACN;WACA,MAAM;WACN,QAAQ;;;YAIP,aACR,mBACA,oBACA,oBACA,kBACA,oBACA,oBACA,kBACA,iBACA,qBACA,sBACA,qBACA;;iBAGa;WACN;;;;;;;;;iBAUM;WACN;WACA;WACA;;;iBAIM;WACN,QAAQ;WACR,UAAU;;;iBAIJ;WACN,OAAO;WACP,UAAU"}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { TeamsAdaptiveCard, TeamsCardAttachment, TeamsCardElement, TeamsSubmitAction, TeamsSubmitData } from "./types.js";
|
|
2
2
|
//#region src/teams/constants.d.ts
|
|
3
3
|
/** The Adaptive Card schema version emitted by {@link toAdaptiveCard}: the Teams desktop/web cap (mobile clients cap at 1.2). */
|
|
4
|
-
declare const AC_VERSION = "1.5";
|
|
4
|
+
export declare const AC_VERSION = "1.5";
|
|
5
5
|
/** The `$schema` URL stamped on every emitted card. */
|
|
6
|
-
declare const ADAPTIVE_CARD_SCHEMA = "http://adaptivecards.io/schemas/adaptive-card.json";
|
|
6
|
+
export declare const ADAPTIVE_CARD_SCHEMA = "http://adaptivecards.io/schemas/adaptive-card.json";
|
|
7
7
|
/** The `contentType` stamped on every emitted attachment. */
|
|
8
|
-
declare const ATTACHMENT_CONTENT_TYPE = "application/vnd.microsoft.card.adaptive";
|
|
8
|
+
export declare const ATTACHMENT_CONTENT_TYPE = "application/vnd.microsoft.card.adaptive";
|
|
9
9
|
/** The maximum number of attachments produced from a root-level Carousel. */
|
|
10
|
-
declare const CAROUSEL_ATTACHMENT_CAP = 10;
|
|
10
|
+
export declare const CAROUSEL_ATTACHMENT_CAP = 10;
|
|
11
11
|
/** The maximum number of primary-mode actions in one ActionSet; extras are set to secondary mode instead of being dropped. */
|
|
12
|
-
declare const PRIMARY_ACTION_CAP = 6;
|
|
12
|
+
export declare const PRIMARY_ACTION_CAP = 6;
|
|
13
13
|
/** The maximum number of data rows in a Table. */
|
|
14
|
-
declare const TABLE_ROW_CAP = 100;
|
|
14
|
+
export declare const TABLE_ROW_CAP = 100;
|
|
15
15
|
/** The maximum number of columns in a Table. */
|
|
16
|
-
declare const TABLE_COLUMN_CAP = 20;
|
|
16
|
+
export declare const TABLE_COLUMN_CAP = 20;
|
|
17
17
|
/** The maximum number of choices in a Select or RadioGroup. */
|
|
18
|
-
declare const CHOICE_OPTION_CAP = 100;
|
|
18
|
+
export declare const CHOICE_OPTION_CAP = 100;
|
|
19
19
|
/** The soft byte-count budget for a serialized card, past which a warning notes Teams' 100 KB bot message limit (the card is never truncated to fit it). */
|
|
20
|
-
declare const PAYLOAD_SOFT_CAP = 80000;
|
|
20
|
+
export declare const PAYLOAD_SOFT_CAP = 80000;
|
|
21
21
|
/** Measures the wire size of `value` in UTF-8 bytes rather than UTF-16 code units. */
|
|
22
|
-
declare function utf8ByteLength(value: string): number;
|
|
22
|
+
export declare function utf8ByteLength(value: string): number;
|
|
23
23
|
/** Builds the fixed-shape Adaptive Card envelope around a converted body. */
|
|
24
|
-
declare function buildCard(body: TeamsCardElement[]): TeamsAdaptiveCard;
|
|
24
|
+
export declare function buildCard(body: TeamsCardElement[]): TeamsAdaptiveCard;
|
|
25
25
|
/** Wraps a card as a bot-framework message attachment. */
|
|
26
|
-
declare function buildAttachment(card: TeamsAdaptiveCard): TeamsCardAttachment;
|
|
26
|
+
export declare function buildAttachment(card: TeamsAdaptiveCard): TeamsCardAttachment;
|
|
27
27
|
/**
|
|
28
28
|
* Nests an IR action under an `aui` key so `decodeSubmitData` can invert it
|
|
29
29
|
* back out of the merged `activity.value` object a Teams bot receives,
|
|
30
30
|
* alongside whatever other named inputs shared the card.
|
|
31
31
|
*/
|
|
32
|
-
declare function buildSubmitData(action: unknown): TeamsSubmitData;
|
|
32
|
+
export declare function buildSubmitData(action: unknown): TeamsSubmitData;
|
|
33
33
|
/** Builds an Action.Submit carrying `action` in the `aui` envelope. */
|
|
34
|
-
declare function buildSubmitAction(title: string, action: unknown, mode?: "secondary"): TeamsSubmitAction;
|
|
34
|
+
export declare function buildSubmitAction(title: string, action: unknown, mode?: "secondary"): TeamsSubmitAction;
|
|
35
35
|
//#endregion
|
|
36
|
-
export { AC_VERSION, ADAPTIVE_CARD_SCHEMA, ATTACHMENT_CONTENT_TYPE, CAROUSEL_ATTACHMENT_CAP, CHOICE_OPTION_CAP, PAYLOAD_SOFT_CAP, PRIMARY_ACTION_CAP, TABLE_COLUMN_CAP, TABLE_ROW_CAP, buildAttachment, buildCard, buildSubmitAction, buildSubmitData, utf8ByteLength };
|
|
37
36
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../src/teams/constants.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../src/teams/constants.ts"],"mappings":";;;qBASa;;qBAGA;;qBAIA;;qBAIA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;wBAKG,eAAe;;wBAKf,UAAU,MAAM,qBAAqB;;wBAWrC,gBAAgB,MAAM,oBAAoB;;;;;;wBAY1C,gBAAgB,kBAAkB;;wBAalC,kBACd,eACA,iBACA,qBACC"}
|
|
@@ -19,7 +19,6 @@ import { Action } from "../ir.js";
|
|
|
19
19
|
* prototype-inherited `aui`, `type`, or `payload` values never dispatch.
|
|
20
20
|
* Returns `undefined` for a missing or malformed `aui` envelope; never throws.
|
|
21
21
|
*/
|
|
22
|
-
declare function decodeSubmitData(value: unknown): Action | undefined;
|
|
22
|
+
export declare function decodeSubmitData(value: unknown): Action | undefined;
|
|
23
23
|
//#endregion
|
|
24
|
-
export { decodeSubmitData };
|
|
25
24
|
//# sourceMappingURL=decodeSubmitData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeSubmitData.d.ts","names":[],"sources":["../../src/teams/decodeSubmitData.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"decodeSubmitData.d.ts","names":[],"sources":["../../src/teams/decodeSubmitData.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAwBgB,iBAAiB,iBAAiB"}
|
|
@@ -2,7 +2,7 @@ import { NormalizedUIElement, NormalizedUINode } from "../ir.js";
|
|
|
2
2
|
import { AdaptiveCardResult, TeamsAdaptiveCard, TeamsCardElement, TeamsConversionWarning, ToAdaptiveCardOptions } from "./types.js";
|
|
3
3
|
//#region src/teams/toAdaptiveCard.d.ts
|
|
4
4
|
/** Shared mutable conversion state threaded through one top-level conversion. */
|
|
5
|
-
interface ConversionContext {
|
|
5
|
+
export interface ConversionContext {
|
|
6
6
|
readonly warnings: TeamsConversionWarning[];
|
|
7
7
|
usedInputIds: Set<string>;
|
|
8
8
|
}
|
|
@@ -13,8 +13,8 @@ interface ConversionContext {
|
|
|
13
13
|
* are forwarded, because those describe the tree the caller wrote, while a
|
|
14
14
|
* clamp or a rename would describe content never delivered.
|
|
15
15
|
*/
|
|
16
|
-
declare const discardedChild: (child: NormalizedUINode, context: ConversionContext, depth: number) => boolean;
|
|
17
|
-
declare function convertElement(element: NormalizedUIElement, context: ConversionContext, depth: number): TeamsCardElement[];
|
|
16
|
+
export declare const discardedChild: (child: NormalizedUINode, context: ConversionContext, depth: number) => boolean;
|
|
17
|
+
export declare function convertElement(element: NormalizedUIElement, context: ConversionContext, depth: number): TeamsCardElement[];
|
|
18
18
|
/**
|
|
19
19
|
* Walks a normalized sequence into card body elements. Nested arrays are
|
|
20
20
|
* flattened into one flat sibling sequence first (via {@link normalizedList}),
|
|
@@ -29,9 +29,9 @@ declare function convertElement(element: NormalizedUIElement, context: Conversio
|
|
|
29
29
|
* sibling element is not a descent; only a container's own recursive
|
|
30
30
|
* `convertSequence(children, depth + 1)` call is.
|
|
31
31
|
*/
|
|
32
|
-
declare function convertSequence(node: NormalizedUINode | undefined, context: ConversionContext, depth: number): TeamsCardElement[];
|
|
32
|
+
export declare function convertSequence(node: NormalizedUINode | undefined, context: ConversionContext, depth: number): TeamsCardElement[];
|
|
33
33
|
/** Builds a full card (schema envelope plus body) from an already-normalized root, checking the soft payload budget. */
|
|
34
|
-
declare function convertRootToCard(root: NormalizedUINode | readonly NormalizedUINode[], context: ConversionContext): TeamsAdaptiveCard;
|
|
34
|
+
export declare function convertRootToCard(root: NormalizedUINode | readonly NormalizedUINode[], context: ConversionContext): TeamsAdaptiveCard;
|
|
35
35
|
/**
|
|
36
36
|
* Converts a generative-ui tree into a Microsoft Teams Adaptive Card and
|
|
37
37
|
* non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive
|
|
@@ -41,7 +41,6 @@ declare function convertRootToCard(root: NormalizedUINode | readonly NormalizedU
|
|
|
41
41
|
* unknown `$type` is skipped with a "dropped" warning, and a malformed input
|
|
42
42
|
* resolves to an empty card plus a "dropped" warning instead of throwing.
|
|
43
43
|
*/
|
|
44
|
-
declare function toAdaptiveCard(node: unknown, _options?: ToAdaptiveCardOptions): AdaptiveCardResult;
|
|
44
|
+
export declare function toAdaptiveCard(node: unknown, _options?: ToAdaptiveCardOptions): AdaptiveCardResult;
|
|
45
45
|
//#endregion
|
|
46
|
-
export { ConversionContext, convertElement, convertRootToCard, convertSequence, discardedChild, toAdaptiveCard };
|
|
47
46
|
//# sourceMappingURL=toAdaptiveCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAdaptiveCard.d.ts","names":[],"sources":["../../src/teams/toAdaptiveCard.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"toAdaptiveCard.d.ts","names":[],"sources":["../../src/teams/toAdaptiveCard.ts"],"mappings":";;;;iBA2CiB;WACN,UAAU;EACnB,cAAc;;;;;;;;;qBAgVH,iBACX,OAAO,kBACP,SAAS,mBACT;wBAac,eACd,SAAS,qBACT,SAAS,mBACT,gBACC;;;;;;;;;;;;;;;wBAuSa,gBACd,MAAM,8BACN,SAAS,mBACT,gBACC;;wBAgEa,kBACd,MAAM,4BAA4B,oBAClC,SAAS,oBACR;;;;;;;;;;wBAyBa,eACd,eACA,WAAW,wBACV"}
|
|
@@ -7,7 +7,6 @@ import { TeamsAttachmentsResult, ToAdaptiveCardOptions } from "./types.js";
|
|
|
7
7
|
* anything else converts through {@link toAdaptiveCard}'s engine into a
|
|
8
8
|
* single attachment. Never throws.
|
|
9
9
|
*/
|
|
10
|
-
declare function toTeamsAttachments(node: unknown, _options?: ToAdaptiveCardOptions): TeamsAttachmentsResult;
|
|
10
|
+
export declare function toTeamsAttachments(node: unknown, _options?: ToAdaptiveCardOptions): TeamsAttachmentsResult;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { toTeamsAttachments };
|
|
13
12
|
//# sourceMappingURL=toTeamsAttachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toTeamsAttachments.d.ts","names":[],"sources":["../../src/teams/toTeamsAttachments.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toTeamsAttachments.d.ts","names":[],"sources":["../../src/teams/toTeamsAttachments.ts"],"mappings":";;;;;;;;;wBA0EgB,mBACd,eACA,WAAW,wBACV"}
|
package/dist/teams/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/teams/types.d.ts
|
|
2
2
|
/** A TextBlock size, from Adaptive Card's closed size enum. */
|
|
3
|
-
type TeamsTextSize = "small" | "medium" | "large" | "extraLarge";
|
|
3
|
+
export type TeamsTextSize = "small" | "medium" | "large" | "extraLarge";
|
|
4
4
|
/** A Container's style, driving its accent color in Teams' renderer. */
|
|
5
|
-
type TeamsContainerStyle = "default" | "emphasis" | "good" | "attention" | "warning" | "accent";
|
|
5
|
+
export type TeamsContainerStyle = "default" | "emphasis" | "good" | "attention" | "warning" | "accent";
|
|
6
6
|
/** A run of wrapped text. Every TextBlock we emit sets `wrap: true`. */
|
|
7
|
-
interface TeamsTextBlock {
|
|
7
|
+
export interface TeamsTextBlock {
|
|
8
8
|
readonly type: "TextBlock";
|
|
9
9
|
readonly text: string;
|
|
10
10
|
readonly wrap: true;
|
|
@@ -16,7 +16,7 @@ interface TeamsTextBlock {
|
|
|
16
16
|
readonly spacing?: "large";
|
|
17
17
|
}
|
|
18
18
|
/** An image element. */
|
|
19
|
-
interface TeamsImage {
|
|
19
|
+
export interface TeamsImage {
|
|
20
20
|
readonly type: "Image";
|
|
21
21
|
readonly url: string;
|
|
22
22
|
readonly altText?: string;
|
|
@@ -25,19 +25,19 @@ interface TeamsImage {
|
|
|
25
25
|
readonly spacing?: "large";
|
|
26
26
|
}
|
|
27
27
|
/** One label/value entry inside a {@link TeamsFactSet}. */
|
|
28
|
-
interface TeamsFact {
|
|
28
|
+
export interface TeamsFact {
|
|
29
29
|
readonly title: string;
|
|
30
30
|
readonly value: string;
|
|
31
31
|
}
|
|
32
32
|
/** A set of label/value facts, rendered as an aligned two-column list. */
|
|
33
|
-
interface TeamsFactSet {
|
|
33
|
+
export interface TeamsFactSet {
|
|
34
34
|
readonly type: "FactSet";
|
|
35
35
|
readonly facts: readonly TeamsFact[];
|
|
36
36
|
readonly separator?: true;
|
|
37
37
|
readonly spacing?: "large";
|
|
38
38
|
}
|
|
39
39
|
/** The `aui` envelope nested inside every {@link TeamsSubmitAction}'s `data`. */
|
|
40
|
-
interface TeamsSubmitData {
|
|
40
|
+
export interface TeamsSubmitData {
|
|
41
41
|
readonly aui: {
|
|
42
42
|
readonly type: string;
|
|
43
43
|
readonly payload?: Record<string, unknown>;
|
|
@@ -48,23 +48,23 @@ interface TeamsSubmitData {
|
|
|
48
48
|
* {@link decodeSubmitData} can invert it out of the merged `activity.value`
|
|
49
49
|
* a Teams bot receives, alongside whatever other named inputs shared the card.
|
|
50
50
|
*/
|
|
51
|
-
interface TeamsSubmitAction {
|
|
51
|
+
export interface TeamsSubmitAction {
|
|
52
52
|
readonly type: "Action.Submit";
|
|
53
53
|
readonly title: string;
|
|
54
54
|
readonly data: TeamsSubmitData;
|
|
55
55
|
readonly mode?: "secondary";
|
|
56
56
|
}
|
|
57
57
|
/** The action shape accepted at the card's top-level `actions` field. */
|
|
58
|
-
type TeamsCardAction = TeamsSubmitAction;
|
|
58
|
+
export type TeamsCardAction = TeamsSubmitAction;
|
|
59
59
|
/** A bar of submit actions, rendered inline in the body flow. */
|
|
60
|
-
interface TeamsActionSet {
|
|
60
|
+
export interface TeamsActionSet {
|
|
61
61
|
readonly type: "ActionSet";
|
|
62
62
|
readonly actions: readonly TeamsSubmitAction[];
|
|
63
63
|
readonly separator?: true;
|
|
64
64
|
readonly spacing?: "large";
|
|
65
65
|
}
|
|
66
66
|
/** A bordered grouping container. */
|
|
67
|
-
interface TeamsContainer {
|
|
67
|
+
export interface TeamsContainer {
|
|
68
68
|
readonly type: "Container";
|
|
69
69
|
readonly style?: TeamsContainerStyle;
|
|
70
70
|
readonly items: readonly TeamsCardElement[];
|
|
@@ -73,25 +73,25 @@ interface TeamsContainer {
|
|
|
73
73
|
readonly spacing?: "large";
|
|
74
74
|
}
|
|
75
75
|
/** One column inside a {@link TeamsColumnSet}. */
|
|
76
|
-
interface TeamsColumn {
|
|
76
|
+
export interface TeamsColumn {
|
|
77
77
|
readonly type: "Column";
|
|
78
78
|
readonly width: "auto";
|
|
79
79
|
readonly items: readonly TeamsCardElement[];
|
|
80
80
|
}
|
|
81
81
|
/** A horizontal row of columns. */
|
|
82
|
-
interface TeamsColumnSet {
|
|
82
|
+
export interface TeamsColumnSet {
|
|
83
83
|
readonly type: "ColumnSet";
|
|
84
84
|
readonly columns: readonly TeamsColumn[];
|
|
85
85
|
readonly separator?: true;
|
|
86
86
|
readonly spacing?: "large";
|
|
87
87
|
}
|
|
88
88
|
/** One selectable choice inside a {@link TeamsInputChoiceSet}. */
|
|
89
|
-
interface TeamsInputChoice {
|
|
89
|
+
export interface TeamsInputChoice {
|
|
90
90
|
readonly title: string;
|
|
91
91
|
readonly value: string;
|
|
92
92
|
}
|
|
93
93
|
/** A dropdown (`compact`) or radio group (`expanded`) input. */
|
|
94
|
-
interface TeamsInputChoiceSet {
|
|
94
|
+
export interface TeamsInputChoiceSet {
|
|
95
95
|
readonly type: "Input.ChoiceSet";
|
|
96
96
|
readonly id: string;
|
|
97
97
|
readonly style: "compact" | "expanded";
|
|
@@ -103,7 +103,7 @@ interface TeamsInputChoiceSet {
|
|
|
103
103
|
readonly spacing?: "large";
|
|
104
104
|
}
|
|
105
105
|
/** A checkbox-shaped boolean input. */
|
|
106
|
-
interface TeamsInputToggle {
|
|
106
|
+
export interface TeamsInputToggle {
|
|
107
107
|
readonly type: "Input.Toggle";
|
|
108
108
|
readonly id: string;
|
|
109
109
|
readonly title: string;
|
|
@@ -114,7 +114,7 @@ interface TeamsInputToggle {
|
|
|
114
114
|
readonly spacing?: "large";
|
|
115
115
|
}
|
|
116
116
|
/** A single or multi-line text input. */
|
|
117
|
-
interface TeamsInputText {
|
|
117
|
+
export interface TeamsInputText {
|
|
118
118
|
readonly type: "Input.Text";
|
|
119
119
|
readonly id: string;
|
|
120
120
|
readonly label?: string;
|
|
@@ -124,7 +124,7 @@ interface TeamsInputText {
|
|
|
124
124
|
readonly spacing?: "large";
|
|
125
125
|
}
|
|
126
126
|
/** A date input, restricted to `YYYY-MM-DD` values. */
|
|
127
|
-
interface TeamsInputDate {
|
|
127
|
+
export interface TeamsInputDate {
|
|
128
128
|
readonly type: "Input.Date";
|
|
129
129
|
readonly id: string;
|
|
130
130
|
readonly label?: string;
|
|
@@ -135,21 +135,21 @@ interface TeamsInputDate {
|
|
|
135
135
|
readonly spacing?: "large";
|
|
136
136
|
}
|
|
137
137
|
/** One cell inside a {@link TeamsTableRow}. */
|
|
138
|
-
interface TeamsTableCell {
|
|
138
|
+
export interface TeamsTableCell {
|
|
139
139
|
readonly type: "TableCell";
|
|
140
140
|
readonly items: readonly TeamsTextBlock[];
|
|
141
141
|
}
|
|
142
142
|
/** One row inside a {@link TeamsTable}. */
|
|
143
|
-
interface TeamsTableRow {
|
|
143
|
+
export interface TeamsTableRow {
|
|
144
144
|
readonly type: "TableRow";
|
|
145
145
|
readonly cells: readonly TeamsTableCell[];
|
|
146
146
|
}
|
|
147
147
|
/** A column width definition inside a {@link TeamsTable}. */
|
|
148
|
-
interface TeamsTableColumnDefinition {
|
|
148
|
+
export interface TeamsTableColumnDefinition {
|
|
149
149
|
readonly width: 1;
|
|
150
150
|
}
|
|
151
151
|
/** A native table. `rows[0]` is the header row when `firstRowAsHeaders` is true. */
|
|
152
|
-
interface TeamsTable {
|
|
152
|
+
export interface TeamsTable {
|
|
153
153
|
readonly type: "Table";
|
|
154
154
|
readonly firstRowAsHeaders: boolean;
|
|
155
155
|
readonly columns: readonly TeamsTableColumnDefinition[];
|
|
@@ -158,9 +158,9 @@ interface TeamsTable {
|
|
|
158
158
|
readonly spacing?: "large";
|
|
159
159
|
}
|
|
160
160
|
/** A body element emitted by {@link toAdaptiveCard}. */
|
|
161
|
-
type TeamsCardElement = TeamsTextBlock | TeamsImage | TeamsFactSet | TeamsActionSet | TeamsContainer | TeamsColumnSet | TeamsInputChoiceSet | TeamsInputToggle | TeamsInputText | TeamsInputDate | TeamsTable;
|
|
161
|
+
export type TeamsCardElement = TeamsTextBlock | TeamsImage | TeamsFactSet | TeamsActionSet | TeamsContainer | TeamsColumnSet | TeamsInputChoiceSet | TeamsInputToggle | TeamsInputText | TeamsInputDate | TeamsTable;
|
|
162
162
|
/** A Microsoft Teams Adaptive Card, pinned to schema version 1.5 (the Teams desktop/web cap; mobile clients cap at 1.2). */
|
|
163
|
-
interface TeamsAdaptiveCard {
|
|
163
|
+
export interface TeamsAdaptiveCard {
|
|
164
164
|
readonly $schema: "http://adaptivecards.io/schemas/adaptive-card.json";
|
|
165
165
|
readonly type: "AdaptiveCard";
|
|
166
166
|
readonly version: "1.5";
|
|
@@ -168,7 +168,7 @@ interface TeamsAdaptiveCard {
|
|
|
168
168
|
readonly actions: readonly TeamsCardAction[];
|
|
169
169
|
}
|
|
170
170
|
/** An Adaptive Card wrapped as a bot-framework message attachment. */
|
|
171
|
-
interface TeamsCardAttachment {
|
|
171
|
+
export interface TeamsCardAttachment {
|
|
172
172
|
readonly contentType: "application/vnd.microsoft.card.adaptive";
|
|
173
173
|
readonly content: TeamsAdaptiveCard;
|
|
174
174
|
}
|
|
@@ -182,24 +182,23 @@ interface TeamsCardAttachment {
|
|
|
182
182
|
* such as a payload over the byte budget or a `Row` past the recommended
|
|
183
183
|
* column count.
|
|
184
184
|
*/
|
|
185
|
-
interface TeamsConversionWarning {
|
|
185
|
+
export interface TeamsConversionWarning {
|
|
186
186
|
readonly code: "clamped" | "dropped" | "fallback" | "advisory";
|
|
187
187
|
readonly component: string;
|
|
188
188
|
readonly detail: string;
|
|
189
189
|
}
|
|
190
190
|
/** Options accepted by {@link toAdaptiveCard} and {@link toTeamsAttachments}. Reserved for future extension; no options are currently defined. */
|
|
191
|
-
interface ToAdaptiveCardOptions {}
|
|
191
|
+
export interface ToAdaptiveCardOptions {}
|
|
192
192
|
/** The card and non-fatal warnings produced by {@link toAdaptiveCard}. */
|
|
193
|
-
interface AdaptiveCardResult {
|
|
193
|
+
export interface AdaptiveCardResult {
|
|
194
194
|
readonly card: TeamsAdaptiveCard;
|
|
195
195
|
readonly warnings: TeamsConversionWarning[];
|
|
196
196
|
}
|
|
197
197
|
/** The attachments and non-fatal warnings produced by {@link toTeamsAttachments}. */
|
|
198
|
-
interface TeamsAttachmentsResult {
|
|
198
|
+
export interface TeamsAttachmentsResult {
|
|
199
199
|
readonly attachments: TeamsCardAttachment[];
|
|
200
200
|
readonly attachmentLayout?: "carousel";
|
|
201
201
|
readonly warnings: TeamsConversionWarning[];
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
|
-
export { AdaptiveCardResult, TeamsActionSet, TeamsAdaptiveCard, TeamsAttachmentsResult, TeamsCardAction, TeamsCardAttachment, TeamsCardElement, TeamsColumn, TeamsColumnSet, TeamsContainer, TeamsContainerStyle, TeamsConversionWarning, TeamsFact, TeamsFactSet, TeamsImage, TeamsInputChoice, TeamsInputChoiceSet, TeamsInputDate, TeamsInputText, TeamsInputToggle, TeamsSubmitAction, TeamsSubmitData, TeamsTable, TeamsTableCell, TeamsTableColumnDefinition, TeamsTableRow, TeamsTextBlock, TeamsTextSize, ToAdaptiveCardOptions };
|
|
205
204
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/teams/types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/teams/types.ts"],"mappings":";;YACY;;YAGA;;iBASK;WACN;WACA;WACA;WACA,OAAO;WACP;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;;;iBAIM;WACN;WACA,gBAAgB;WAChB;WACA;;;iBAIM;WACN;aACE;aACA,UAAU;;;;;;;;iBASN;WACN;WACA;WACA,MAAM;WACN;;;YAIC,kBAAkB;;iBAGb;WACN;WACA,kBAAkB;WAClB;WACA;;;iBAIM;WACN;WACA,QAAQ;WACR,gBAAgB;WAChB,eAAe;WACf;WACA;;;iBAIM;WACN;WACA;WACA,gBAAgB;;;iBAIV;WACN;WACA,kBAAkB;WAClB;WACA;;;iBAIM;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA,kBAAkB;WAClB;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA,gBAAgB;;;iBAIV;WACN;WACA,gBAAgB;;;iBAIV;WACN;;;iBAIM;WACN;WACA;WACA,kBAAkB;WAClB,eAAe;WACf;WACA;;;YAIC,mBACR,iBACA,aACA,eACA,iBACA,iBACA,iBACA,sBACA,mBACA,iBACA,iBACA;;iBAGa;WACN;WACA;WACA;WACA,eAAe;WACf,kBAAkB;;;iBAIZ;WACN;WACA,SAAS;;;;;;;;;;;;iBAaH;WACN;WACA;WACA;;;iBAIM;;iBAGA;WACN,MAAM;WACN,UAAU;;;iBAIJ;WACN,aAAa;WACb;WACA,UAAU"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,22 +9,22 @@ import { ZodType } from "zod";
|
|
|
9
9
|
* `props`. Alias of {@link NormalizedUIElement}; kept under its old name so the
|
|
10
10
|
* package's public surface stays append-only.
|
|
11
11
|
*/
|
|
12
|
-
type GenerativeUIElement = NormalizedUIElement;
|
|
13
|
-
type GenerativeUIProps = NormalizedUIElement["props"];
|
|
12
|
+
export type GenerativeUIElement = NormalizedUIElement;
|
|
13
|
+
export type GenerativeUIProps = NormalizedUIElement["props"];
|
|
14
14
|
/**
|
|
15
15
|
* Anything renderable as generative UI — mirrors React's `ReactNode`: an
|
|
16
16
|
* element, primitive text, a list of nodes, or nothing. Widened beyond the
|
|
17
17
|
* model payload (a {@link GenerativeUIElement}) with the renderer's
|
|
18
18
|
* null/boolean/undefined inputs.
|
|
19
19
|
*/
|
|
20
|
-
type GenerativeUINode = GenerativeUIElement | string | number | boolean | null | undefined | GenerativeUINode[];
|
|
21
|
-
type GenerativeUIAction = Action;
|
|
20
|
+
export type GenerativeUINode = GenerativeUIElement | string | number | boolean | null | undefined | GenerativeUINode[];
|
|
21
|
+
export type GenerativeUIAction = Action;
|
|
22
22
|
/** Whether a node's props are still streaming in or have fully arrived. */
|
|
23
|
-
type GenerativeUIStatus = "streaming" | "done";
|
|
23
|
+
export type GenerativeUIStatus = "streaming" | "done";
|
|
24
24
|
/** The dispatcher an interactive component calls to fire its `$action`. */
|
|
25
|
-
type GenerativeUIDispatch = (action: Action) => unknown;
|
|
25
|
+
export type GenerativeUIDispatch = (action: Action) => unknown;
|
|
26
26
|
/** The render context threaded through {@link renderGenerativeUI}. */
|
|
27
|
-
type GenerativeUIRenderContext = {
|
|
27
|
+
export type GenerativeUIRenderContext = {
|
|
28
28
|
/** Whether the tool call's arguments are still streaming or are complete. */
|
|
29
29
|
status: GenerativeUIStatus;
|
|
30
30
|
dispatch?: GenerativeUIDispatch;
|
|
@@ -68,7 +68,7 @@ type StaticRenderProps<P> = P & {
|
|
|
68
68
|
* fine (each node is mounted on its own fiber), but a given node must keep its
|
|
69
69
|
* `type` across renders for hook identity to be stable.
|
|
70
70
|
*/
|
|
71
|
-
type GenerativeUIComponent<P = any> = {
|
|
71
|
+
export type GenerativeUIComponent<P = any> = {
|
|
72
72
|
/** Natural-language description shown to the model when selecting the component. */
|
|
73
73
|
description: string;
|
|
74
74
|
/** Schema for the props the model must provide. Drives the tool parameters. */
|
|
@@ -95,7 +95,6 @@ type GenerativeUIComponent<P = any> = {
|
|
|
95
95
|
*
|
|
96
96
|
* This registry is the security boundary — any `type` not present is rejected.
|
|
97
97
|
*/
|
|
98
|
-
type GenerativeUILibrary = Record<string, GenerativeUIComponent>;
|
|
98
|
+
export type GenerativeUILibrary = Record<string, GenerativeUIComponent>;
|
|
99
99
|
//#endregion
|
|
100
|
-
export { GenerativeUIAction, GenerativeUIComponent, GenerativeUIDispatch, GenerativeUIElement, GenerativeUILibrary, GenerativeUINode, GenerativeUIProps, GenerativeUIRenderContext, GenerativeUIStatus };
|
|
101
100
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;YAWY,sBAAsB;YAEtB,oBAAoB;;;;;;;YAQpB,mBACR,qEAMA;YAEQ,qBAAqB;;YAGrB;;YAGA,wBAAwB,QAAQ;;YAGhC;;EAEV,QAAQ;EACR,WAAW;;;;;;;;;;;KAYR,qBAAqB,MACrB,QAAQ;EACP,WAAW;EACX;EACA,UAAU;EACV,YAAY;MAEb;EACC,WAAW;EACX;EACA,UAAU;EACV,YAAY;;;KAIb,kBAAkB,KAAK;EAC1B,WAAW;EACX;EACA,UAAU;EACV,YAAY;;;;;;;;;;;;;;YAeF,sBAAsB;;EAG5B;;EAEA,YAAY,QAAQ;;;;;;;EAOpB;EACA,SAAS,OAAO,qBAAqB,OAAO;;EAG5C;EACA,YAAY,QAAQ;;EAEpB;EACA,SAAS,OAAO,kBAAkB,OAAO;;;;;;;;;YAUnC,sBAAsB,eAAe"}
|