@assistant-ui/react-generative-ui 0.0.24 → 0.1.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.
- package/README.md +2 -0
- package/dist/a2ui.d.ts +1 -4
- package/dist/a2ui.d.ts.map +1 -1
- package/dist/a2ui.js +1 -4
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.server.d.ts +1 -2
- package/dist/index.server.d.ts.map +1 -1
- package/dist/index.server.js +1 -10
- package/dist/ir.d.ts +1 -111
- package/dist/ir.d.ts.map +1 -1
- package/dist/ir.js +1 -175
- package/dist/slack.d.ts +1 -4
- package/dist/slack.d.ts.map +1 -1
- package/dist/slack.js +1 -4
- package/dist/teams.d.ts +1 -4
- package/dist/teams.d.ts.map +1 -1
- package/dist/teams.js +1 -4
- package/package.json +4 -5
- package/src/a2ui.ts +1 -22
- package/src/index.server.ts +1 -2
- package/src/index.test.ts +75 -0
- package/src/index.ts +1 -2
- package/src/ir.ts +1 -279
- package/src/slack.ts +1 -39
- package/src/teams.ts +1 -35
- package/dist/JSONGenerativeUI.client.d.ts +0 -28
- package/dist/JSONGenerativeUI.client.d.ts.map +0 -1
- package/dist/JSONGenerativeUI.client.js +0 -101
- package/dist/JSONGenerativeUI.client.js.map +0 -1
- package/dist/JSONGenerativeUI.server.d.ts +0 -21
- package/dist/JSONGenerativeUI.server.d.ts.map +0 -1
- package/dist/JSONGenerativeUI.server.js +0 -32
- package/dist/JSONGenerativeUI.server.js.map +0 -1
- package/dist/JSONGenerativeUI.shared.d.ts +0 -63
- package/dist/JSONGenerativeUI.shared.d.ts.map +0 -1
- package/dist/JSONGenerativeUI.shared.js +0 -31
- package/dist/JSONGenerativeUI.shared.js.map +0 -1
- package/dist/RadioGroupScope.d.ts +0 -6
- package/dist/RadioGroupScope.d.ts.map +0 -1
- package/dist/RadioGroupScope.js +0 -25
- package/dist/RadioGroupScope.js.map +0 -1
- package/dist/a2ui/BindingContext.d.ts +0 -11
- package/dist/a2ui/BindingContext.d.ts.map +0 -1
- package/dist/a2ui/BindingContext.js +0 -12
- package/dist/a2ui/BindingContext.js.map +0 -1
- package/dist/a2ui/PresentRenderer.d.ts +0 -11
- package/dist/a2ui/PresentRenderer.d.ts.map +0 -1
- package/dist/a2ui/PresentRenderer.js +0 -39
- package/dist/a2ui/PresentRenderer.js.map +0 -1
- package/dist/a2ui/convert.d.ts +0 -15
- package/dist/a2ui/convert.d.ts.map +0 -1
- package/dist/a2ui/convert.js +0 -728
- package/dist/a2ui/convert.js.map +0 -1
- package/dist/a2ui/dataModel.d.ts +0 -9
- package/dist/a2ui/dataModel.d.ts.map +0 -1
- package/dist/a2ui/dataModel.js +0 -44
- package/dist/a2ui/dataModel.js.map +0 -1
- package/dist/a2ui/reducer.d.ts +0 -8
- package/dist/a2ui/reducer.d.ts.map +0 -1
- package/dist/a2ui/reducer.js +0 -242
- package/dist/a2ui/reducer.js.map +0 -1
- package/dist/a2ui/snapshot.d.ts +0 -3
- package/dist/a2ui/snapshot.d.ts.map +0 -1
- package/dist/a2ui/snapshot.js +0 -33
- package/dist/a2ui/snapshot.js.map +0 -1
- package/dist/a2ui/types.d.ts +0 -88
- package/dist/a2ui/types.d.ts.map +0 -1
- package/dist/a2ui/types.js +0 -6
- package/dist/a2ui/types.js.map +0 -1
- package/dist/a2ui/valueFunctions.d.ts +0 -16
- package/dist/a2ui/valueFunctions.d.ts.map +0 -1
- package/dist/a2ui/valueFunctions.js +0 -332
- package/dist/a2ui/valueFunctions.js.map +0 -1
- package/dist/actionRegistry.d.ts +0 -29
- package/dist/actionRegistry.d.ts.map +0 -1
- package/dist/actionRegistry.js +0 -41
- package/dist/actionRegistry.js.map +0 -1
- package/dist/answeredValues.d.ts +0 -16
- package/dist/answeredValues.d.ts.map +0 -1
- package/dist/answeredValues.js +0 -37
- package/dist/answeredValues.js.map +0 -1
- package/dist/buildPresentParameters.d.ts +0 -21
- package/dist/buildPresentParameters.d.ts.map +0 -1
- package/dist/buildPresentParameters.js +0 -95
- package/dist/buildPresentParameters.js.map +0 -1
- package/dist/constants.d.ts +0 -15
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -19
- package/dist/constants.js.map +0 -1
- package/dist/convert/boundSpec.d.ts +0 -48
- package/dist/convert/boundSpec.d.ts.map +0 -1
- package/dist/convert/boundSpec.js +0 -108
- package/dist/convert/boundSpec.js.map +0 -1
- package/dist/convert/copyBounded.d.ts +0 -25
- package/dist/convert/copyBounded.d.ts.map +0 -1
- package/dist/convert/copyBounded.js +0 -38
- package/dist/convert/copyBounded.js.map +0 -1
- package/dist/convert/isElement.d.ts +0 -3
- package/dist/convert/isElement.d.ts.map +0 -1
- package/dist/convert/isElement.js +0 -6
- package/dist/convert/isElement.js.map +0 -1
- package/dist/convert/takeRun.d.ts +0 -6
- package/dist/convert/takeRun.d.ts.map +0 -1
- package/dist/convert/takeRun.js +0 -20
- package/dist/convert/takeRun.js.map +0 -1
- package/dist/defineGenerativeComponents.d.ts +0 -29
- package/dist/defineGenerativeComponents.d.ts.map +0 -1
- package/dist/defineGenerativeComponents.js +0 -34
- package/dist/defineGenerativeComponents.js.map +0 -1
- package/dist/fieldReferences.d.ts +0 -9
- package/dist/fieldReferences.d.ts.map +0 -1
- package/dist/fieldReferences.js +0 -53
- package/dist/fieldReferences.js.map +0 -1
- package/dist/generativeUIToJSX.d.ts +0 -18
- package/dist/generativeUIToJSX.d.ts.map +0 -1
- package/dist/generativeUIToJSX.js +0 -76
- package/dist/generativeUIToJSX.js.map +0 -1
- package/dist/index.shared.d.ts +0 -15
- package/dist/index.shared.d.ts.map +0 -1
- package/dist/index.shared.js +0 -9
- package/dist/ir.js.map +0 -1
- package/dist/renderGenerativeUI.d.ts +0 -14
- package/dist/renderGenerativeUI.d.ts.map +0 -1
- package/dist/renderGenerativeUI.js +0 -83
- package/dist/renderGenerativeUI.js.map +0 -1
- package/dist/scopeSchema.d.ts +0 -6
- package/dist/scopeSchema.d.ts.map +0 -1
- package/dist/scopeSchema.js +0 -56
- package/dist/scopeSchema.js.map +0 -1
- package/dist/slack/constants.d.ts +0 -93
- package/dist/slack/constants.d.ts.map +0 -1
- package/dist/slack/constants.js +0 -146
- package/dist/slack/constants.js.map +0 -1
- package/dist/slack/decodeBlockAction.d.ts +0 -10
- package/dist/slack/decodeBlockAction.d.ts.map +0 -1
- package/dist/slack/decodeBlockAction.js +0 -129
- package/dist/slack/decodeBlockAction.js.map +0 -1
- package/dist/slack/fromSlackBlocks.d.ts +0 -27
- package/dist/slack/fromSlackBlocks.d.ts.map +0 -1
- package/dist/slack/fromSlackBlocks.js +0 -483
- package/dist/slack/fromSlackBlocks.js.map +0 -1
- package/dist/slack/toSlackBlocks.d.ts +0 -4
- package/dist/slack/toSlackBlocks.d.ts.map +0 -1
- package/dist/slack/toSlackBlocks.js +0 -901
- package/dist/slack/toSlackBlocks.js.map +0 -1
- package/dist/slack/types.d.ts +0 -204
- package/dist/slack/types.d.ts.map +0 -1
- package/dist/slack/types.js +0 -0
- package/dist/teams/constants.d.ts +0 -34
- package/dist/teams/constants.d.ts.map +0 -1
- package/dist/teams/constants.js +0 -68
- package/dist/teams/constants.js.map +0 -1
- package/dist/teams/decodeSubmitData.d.ts +0 -26
- package/dist/teams/decodeSubmitData.d.ts.map +0 -1
- package/dist/teams/decodeSubmitData.js +0 -70
- package/dist/teams/decodeSubmitData.js.map +0 -1
- package/dist/teams/temporalId.d.ts +0 -5
- package/dist/teams/temporalId.d.ts.map +0 -1
- package/dist/teams/temporalId.js +0 -28
- package/dist/teams/temporalId.js.map +0 -1
- package/dist/teams/toAdaptiveCard.d.ts +0 -45
- package/dist/teams/toAdaptiveCard.d.ts.map +0 -1
- package/dist/teams/toAdaptiveCard.js +0 -642
- package/dist/teams/toAdaptiveCard.js.map +0 -1
- package/dist/teams/toTeamsAttachments.d.ts +0 -10
- package/dist/teams/toTeamsAttachments.d.ts.map +0 -1
- package/dist/teams/toTeamsAttachments.js +0 -99
- package/dist/teams/toTeamsAttachments.js.map +0 -1
- package/dist/teams/types.d.ts +0 -224
- package/dist/teams/types.d.ts.map +0 -1
- package/dist/teams/types.js +0 -0
- package/dist/temporal.d.ts +0 -33
- package/dist/temporal.d.ts.map +0 -1
- package/dist/temporal.js +0 -153
- package/dist/temporal.js.map +0 -1
- package/dist/types.d.ts +0 -99
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -0
- package/dist/vocabulary/alert.d.ts +0 -32
- package/dist/vocabulary/alert.d.ts.map +0 -1
- package/dist/vocabulary/alert.js +0 -160
- package/dist/vocabulary/alert.js.map +0 -1
- package/dist/vocabulary/collectFormValues.d.ts +0 -23
- package/dist/vocabulary/collectFormValues.d.ts.map +0 -1
- package/dist/vocabulary/collectFormValues.js +0 -44
- package/dist/vocabulary/collectFormValues.js.map +0 -1
- package/dist/vocabulary/data.d.ts +0 -66
- package/dist/vocabulary/data.d.ts.map +0 -1
- package/dist/vocabulary/data.js +0 -503
- package/dist/vocabulary/data.js.map +0 -1
- package/dist/vocabulary/dispatch.d.ts +0 -9
- package/dist/vocabulary/dispatch.d.ts.map +0 -1
- package/dist/vocabulary/dispatch.js +0 -50
- package/dist/vocabulary/dispatch.js.map +0 -1
- package/dist/vocabulary/fact.d.ts +0 -19
- package/dist/vocabulary/fact.d.ts.map +0 -1
- package/dist/vocabulary/fact.js +0 -51
- package/dist/vocabulary/fact.js.map +0 -1
- package/dist/vocabulary/form.d.ts +0 -11
- package/dist/vocabulary/form.d.ts.map +0 -1
- package/dist/vocabulary/form.js +0 -23
- package/dist/vocabulary/form.js.map +0 -1
- package/dist/vocabulary/formatValue.d.ts +0 -7
- package/dist/vocabulary/formatValue.d.ts.map +0 -1
- package/dist/vocabulary/formatValue.js +0 -76
- package/dist/vocabulary/formatValue.js.map +0 -1
- package/dist/vocabulary/icon.d.ts +0 -41
- package/dist/vocabulary/icon.d.ts.map +0 -1
- package/dist/vocabulary/icon.js +0 -272
- package/dist/vocabulary/icon.js.map +0 -1
- package/dist/vocabulary/index.d.ts +0 -12
- package/dist/vocabulary/index.d.ts.map +0 -1
- package/dist/vocabulary/index.js +0 -36
- package/dist/vocabulary/index.js.map +0 -1
- package/dist/vocabulary/interactive.d.ts +0 -230
- package/dist/vocabulary/interactive.d.ts.map +0 -1
- package/dist/vocabulary/interactive.js +0 -584
- package/dist/vocabulary/interactive.js.map +0 -1
- package/dist/vocabulary/layout.d.ts +0 -79
- package/dist/vocabulary/layout.d.ts.map +0 -1
- package/dist/vocabulary/layout.js +0 -139
- package/dist/vocabulary/layout.js.map +0 -1
- package/dist/vocabulary/list.d.ts +0 -14
- package/dist/vocabulary/list.d.ts.map +0 -1
- package/dist/vocabulary/list.js +0 -50
- package/dist/vocabulary/list.js.map +0 -1
- package/dist/vocabulary/media.d.ts +0 -25
- package/dist/vocabulary/media.d.ts.map +0 -1
- package/dist/vocabulary/media.js +0 -42
- package/dist/vocabulary/media.js.map +0 -1
- package/dist/vocabulary/text.d.ts +0 -57
- package/dist/vocabulary/text.d.ts.map +0 -1
- package/dist/vocabulary/text.js +0 -49
- package/dist/vocabulary/text.js.map +0 -1
- package/dist/vocabulary/toTextContent.d.ts +0 -2
- package/dist/vocabulary/toTextContent.d.ts.map +0 -1
- package/dist/vocabulary/toTextContent.js +0 -6
- package/dist/vocabulary/toTextContent.js.map +0 -1
- package/src/JSONGenerativeUI.client.tsx +0 -168
- package/src/JSONGenerativeUI.server.tsx +0 -39
- package/src/JSONGenerativeUI.shared.ts +0 -90
- package/src/JSONGenerativeUI.test.tsx +0 -1298
- package/src/RadioGroupScope.server.test.tsx +0 -24
- package/src/RadioGroupScope.tsx +0 -34
- package/src/a2ui/BindingContext.ts +0 -26
- package/src/a2ui/PresentRenderer.tsx +0 -83
- package/src/a2ui/convert.test.ts +0 -2923
- package/src/a2ui/convert.ts +0 -1207
- package/src/a2ui/dataModel.ts +0 -69
- package/src/a2ui/reducer.test.ts +0 -422
- package/src/a2ui/reducer.ts +0 -363
- package/src/a2ui/snapshot.test.ts +0 -52
- package/src/a2ui/snapshot.ts +0 -52
- package/src/a2ui/types.ts +0 -114
- package/src/a2ui/valueFunctions.test.ts +0 -271
- package/src/a2ui/valueFunctions.ts +0 -523
- package/src/actionRegistry.test.ts +0 -90
- package/src/actionRegistry.ts +0 -88
- package/src/answeredValues.test.ts +0 -33
- package/src/answeredValues.tsx +0 -70
- package/src/buildPresentParameters.test.ts +0 -246
- package/src/buildPresentParameters.ts +0 -130
- package/src/constants.ts +0 -17
- package/src/convert/boundSpec.test.ts +0 -192
- package/src/convert/boundSpec.ts +0 -134
- package/src/convert/copyBounded.test.ts +0 -131
- package/src/convert/copyBounded.ts +0 -38
- package/src/convert/isElement.ts +0 -6
- package/src/convert/takeRun.test.ts +0 -64
- package/src/convert/takeRun.ts +0 -19
- package/src/defineGenerativeComponents.ts +0 -38
- package/src/fieldReferences.test.ts +0 -66
- package/src/fieldReferences.ts +0 -83
- package/src/generativeUIToJSX.test.ts +0 -268
- package/src/generativeUIToJSX.ts +0 -152
- package/src/index.server.test.ts +0 -106
- package/src/index.shared.ts +0 -61
- package/src/ir.test.ts +0 -203
- package/src/renderGenerativeUI.test.tsx +0 -373
- package/src/renderGenerativeUI.tsx +0 -165
- package/src/scopeSchema.test.ts +0 -72
- package/src/scopeSchema.ts +0 -71
- package/src/slack/a2uiSlack.test.ts +0 -198
- package/src/slack/constants.ts +0 -194
- package/src/slack/datePicker.test.ts +0 -612
- package/src/slack/decodeBlockAction.test.ts +0 -233
- package/src/slack/decodeBlockAction.ts +0 -232
- package/src/slack/fromSlackBlocks.test.ts +0 -1465
- package/src/slack/fromSlackBlocks.ts +0 -789
- package/src/slack/toSlackBlocks.test.ts +0 -3065
- package/src/slack/toSlackBlocks.ts +0 -1818
- package/src/slack/types.ts +0 -264
- package/src/teams/constants.ts +0 -93
- package/src/teams/decodeSubmitData.test.ts +0 -397
- package/src/teams/decodeSubmitData.ts +0 -110
- package/src/teams/temporal.test.ts +0 -766
- package/src/teams/temporalId.ts +0 -56
- package/src/teams/toAdaptiveCard.test.ts +0 -1897
- package/src/teams/toAdaptiveCard.ts +0 -1057
- package/src/teams/toTeamsAttachments.test.ts +0 -74
- package/src/teams/toTeamsAttachments.ts +0 -133
- package/src/teams/types.ts +0 -266
- package/src/temporal.test.ts +0 -337
- package/src/temporal.ts +0 -263
- package/src/types.ts +0 -119
- package/src/vocabulary/alert.test.tsx +0 -427
- package/src/vocabulary/alert.tsx +0 -217
- package/src/vocabulary/collectFormValues.test.ts +0 -389
- package/src/vocabulary/collectFormValues.ts +0 -116
- package/src/vocabulary/data.test.tsx +0 -858
- package/src/vocabulary/data.tsx +0 -819
- package/src/vocabulary/datepicker.dom.test.tsx +0 -1457
- package/src/vocabulary/dispatch.ts +0 -83
- package/src/vocabulary/fact.test.tsx +0 -94
- package/src/vocabulary/fact.tsx +0 -54
- package/src/vocabulary/form.test.tsx +0 -113
- package/src/vocabulary/form.tsx +0 -39
- package/src/vocabulary/formatValue.test.ts +0 -72
- package/src/vocabulary/formatValue.ts +0 -127
- package/src/vocabulary/icon.test.tsx +0 -64
- package/src/vocabulary/icon.tsx +0 -174
- package/src/vocabulary/index.test.ts +0 -65
- package/src/vocabulary/index.ts +0 -33
- package/src/vocabulary/interactive.dispatch.test.tsx +0 -454
- package/src/vocabulary/interactive.dom.test.tsx +0 -1747
- package/src/vocabulary/interactive.test.tsx +0 -377
- package/src/vocabulary/interactive.tsx +0 -1109
- package/src/vocabulary/layout.test.tsx +0 -323
- package/src/vocabulary/layout.tsx +0 -247
- package/src/vocabulary/list.test.tsx +0 -222
- package/src/vocabulary/list.tsx +0 -50
- package/src/vocabulary/media.test.tsx +0 -85
- package/src/vocabulary/media.tsx +0 -56
- package/src/vocabulary/text.test.tsx +0 -102
- package/src/vocabulary/text.tsx +0 -60
- package/src/vocabulary/toTextContent.ts +0 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @assistant-ui/react-generative-ui
|
|
2
2
|
|
|
3
|
+
This package re-exports [`@assistant-ui/generative-ui`](https://www.npmjs.com/package/@assistant-ui/generative-ui), the framework-neutral home of assistant-ui's generative UI. Existing imports keep working unchanged; new code should depend on `@assistant-ui/generative-ui` directly and import the React renderer from `@assistant-ui/generative-ui/react`.
|
|
4
|
+
|
|
3
5
|
Generative UI tools for assistant-ui.
|
|
4
6
|
|
|
5
7
|
## Installation
|
package/dist/a2ui.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { convertSurfaceToUISpec } from "./a2ui/convert.js";
|
|
3
|
-
export { surfaceToOperations } from "./a2ui/snapshot.js";
|
|
4
|
-
export type { A2uiCreateSurfaceOperation, A2uiCreateSurfaceV09Payload, A2uiCreateSurfaceV10Payload, A2uiDeleteSurfaceOperation, A2uiDeleteSurfacePayload, A2uiOperation, A2uiOperationResult, A2uiState, A2uiSurfaceSnapshotOperation, A2uiSurfaceState, A2uiTemplateChildren, A2uiUpdateComponentsOperation, A2uiUpdateComponentsPayload, A2uiUpdateDataModelOperation, A2uiUpdateDataModelPayload, A2uiVersion, ComponentNode, } from "./a2ui/types.js";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/a2ui";
|
|
5
2
|
//# sourceMappingURL=a2ui.d.ts.map
|
package/dist/a2ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2ui.d.ts","sourceRoot":"","sources":["../src/a2ui.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"a2ui.d.ts","sourceRoot":"","sources":["../src/a2ui.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
package/dist/a2ui.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { convertSurfaceToUISpec } from "./a2ui/convert.js";
|
|
3
|
-
import { surfaceToOperations } from "./a2ui/snapshot.js";
|
|
4
|
-
export { applyA2uiOperations, convertSurfaceToUISpec, surfaceToOperations };
|
|
1
|
+
export * from "@assistant-ui/generative-ui/a2ui";
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode } from "./ir.js";
|
|
3
|
-
import { renderGenerativeUI } from "./renderGenerativeUI.js";
|
|
4
|
-
import { buildPresentParameters } from "./buildPresentParameters.js";
|
|
5
|
-
import { createActionRegistry, emptyActionRegistry } from "./actionRegistry.js";
|
|
6
|
-
import { JSONGenerativeUI } from "./JSONGenerativeUI.client.js";
|
|
7
|
-
import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
|
|
8
|
-
import { generativeUIToJSX } from "./generativeUIToJSX.js";
|
|
9
|
-
import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
|
|
10
|
-
export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JSONGenerativeUI, JUSTIFIES, TEXT_SIZES, TYPE_KEY, WEIGHTS, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
|
|
1
|
+
export * from "@assistant-ui/generative-ui/react";
|
package/dist/index.server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/dist/index.server.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode } from "./ir.js";
|
|
3
|
-
import { renderGenerativeUI } from "./renderGenerativeUI.js";
|
|
4
|
-
import { buildPresentParameters } from "./buildPresentParameters.js";
|
|
5
|
-
import { createActionRegistry, emptyActionRegistry } from "./actionRegistry.js";
|
|
6
|
-
import { JSONGenerativeUI } from "./JSONGenerativeUI.server.js";
|
|
7
|
-
import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
|
|
8
|
-
import { generativeUIToJSX } from "./generativeUIToJSX.js";
|
|
9
|
-
import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
|
|
10
|
-
export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JSONGenerativeUI, JUSTIFIES, TEXT_SIZES, TYPE_KEY, WEIGHTS, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
|
|
1
|
+
export * from "@assistant-ui/generative-ui/react";
|
package/dist/ir.d.ts
CHANGED
|
@@ -1,112 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The generative-ui intermediate representation: a model-emitted, cross-platform
|
|
3
|
-
* UI tree. React-free, so converters and non-web runtimes consume it without
|
|
4
|
-
* pulling React. The flat `$type` shape is the canonical form; the legacy
|
|
5
|
-
* `component` shape is accepted as a backward-compatible alias.
|
|
6
|
-
*
|
|
7
|
-
* Reserved keys are partitioned off from component props so the component prop
|
|
8
|
-
* namespace stays fully free:
|
|
9
|
-
*
|
|
10
|
-
* - `$`-prefixed keys are framework-reserved (`$type`, `$key`, `$action`,
|
|
11
|
-
* `$status`). Components never declare `$`-prefixed props, so a component
|
|
12
|
-
* can use `type`, `status`, `variant`, etc. as ordinary props without
|
|
13
|
-
* colliding with the framework.
|
|
14
|
-
* - `children` is additionally reserved (the JSX convention).
|
|
15
|
-
* - every other key is an inline prop passed straight to the component.
|
|
16
|
-
*/
|
|
17
|
-
export declare const TEXT_SIZES: readonly ["sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
18
|
-
export type TextSize = (typeof TEXT_SIZES)[number];
|
|
19
|
-
export declare const IMAGE_SIZE_TOKENS: readonly ["sm", "md", "lg"];
|
|
20
|
-
export type ImageSize = (typeof IMAGE_SIZE_TOKENS)[number] | number;
|
|
21
|
-
export declare const WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
|
|
22
|
-
export type Weight = (typeof WEIGHTS)[number];
|
|
23
|
-
export declare const COLORS: readonly ["emphasis", "secondary", "alpha-70", "white", "white-70", "white-50"];
|
|
24
|
-
export type Color = (typeof COLORS)[number];
|
|
25
|
-
export declare const ALIGNS: readonly ["start", "center", "end"];
|
|
26
|
-
export type Align = (typeof ALIGNS)[number];
|
|
27
|
-
export declare const JUSTIFIES: readonly ["start", "center", "end", "between"];
|
|
28
|
-
export type Justify = (typeof JUSTIFIES)[number];
|
|
29
|
-
export declare const BUTTON_STYLES: readonly ["primary", "secondary", "outline", "ghost", "danger"];
|
|
30
|
-
export type ButtonStyle = (typeof BUTTON_STYLES)[number];
|
|
31
|
-
export declare const ALERT_TONES: readonly ["info", "success", "warning", "danger"];
|
|
32
|
-
/** A severity level, from informational to destructive. */
|
|
33
|
-
export type AlertTone = (typeof ALERT_TONES)[number];
|
|
34
|
-
export declare const ICON_NAMES: readonly ["sun", "moon", "cloud", "rain", "snow", "wind", "play", "pause", "check", "x", "star", "heart", "arrow-right", "arrow-up-right", "chevron-right", "calendar", "clock", "map-pin", "plane", "truck", "credit-card", "user", "search", "bell"];
|
|
35
|
-
/** A name from the built-in icon set; the closed enum lets the model see exactly which icons exist. */
|
|
36
|
-
export type IconName = (typeof ICON_NAMES)[number];
|
|
37
|
-
/**
|
|
38
|
-
* Behavior payload carried by an interactive node. `type` is resolved by the host's action registry, not the renderer; keeping behavior as data keeps the tree serializable, so the same node renders on web while converters may bind the type to a native action id on other platforms. A `{ "$field": name }` value anywhere in the payload refers to the current value of the control with that `name`, resolved when the action fires, and `{ "$field": name, "fallback": value }` resolves to `fallback` when no control holds a value.
|
|
39
|
-
*/
|
|
40
|
-
export interface Action {
|
|
41
|
-
readonly type: string;
|
|
42
|
-
readonly [payload: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Anything renderable as generative UI, as the model emits it. The renderer
|
|
46
|
-
* also accepts `number`, `boolean`, `null`, `undefined`, and arrays at the
|
|
47
|
-
* input boundary (numbers render as text, falsy/boolean as nothing, arrays as
|
|
48
|
-
* lists); {@link normalizeUINode} accepts that full range.
|
|
49
|
-
*/
|
|
50
|
-
export type UINode = string | number | UIElement | LegacyComponentNode;
|
|
51
|
-
export type UIChildren = UINode | readonly UINode[];
|
|
52
|
-
/** The flat node shape: inline props keep the tree compact and natural for a
|
|
53
|
-
* model to emit, instead of a nested `{ type, props }` bag. Reserved keys are
|
|
54
|
-
* stripped before props reach the component (see the module header). */
|
|
55
|
-
export interface UIElement {
|
|
56
|
-
readonly $type: string;
|
|
57
|
-
readonly $key?: string | number;
|
|
58
|
-
readonly children?: UIChildren;
|
|
59
|
-
readonly $action?: Action;
|
|
60
|
-
readonly [prop: string]: unknown;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The legacy node shape: a `component` name plus a nested `props` bag. Kept
|
|
64
|
-
* for backward compatibility. New code authors the flat {@link UIElement}
|
|
65
|
-
* shape instead.
|
|
66
|
-
*/
|
|
67
|
-
export interface LegacyComponentNode {
|
|
68
|
-
readonly component: string;
|
|
69
|
-
readonly props?: Record<string, unknown>;
|
|
70
|
-
readonly children?: UIChildren;
|
|
71
|
-
readonly key?: string;
|
|
72
|
-
}
|
|
73
|
-
export type UISpec = UINode | readonly UINode[];
|
|
74
|
-
/**
|
|
75
|
-
* A node normalized to a single canonical shape: a `type` string, an inline
|
|
76
|
-
* `props` bag, recursive `children`, an optional `key`, and an optional
|
|
77
|
-
* `action`. Renderers and platform converters consume this form, so they never
|
|
78
|
-
* branch on whether the model emitted the flat `$type` shape or the legacy
|
|
79
|
-
* `component` shape, and they never see the reserved `$`-prefixed keys leak
|
|
80
|
-
* into component props.
|
|
81
|
-
*/
|
|
82
|
-
export interface NormalizedUIElement {
|
|
83
|
-
readonly type: string;
|
|
84
|
-
readonly props: Readonly<Record<string, unknown>>;
|
|
85
|
-
readonly children?: NormalizedUINode | undefined;
|
|
86
|
-
readonly key?: string | number | undefined;
|
|
87
|
-
readonly action?: Action | undefined;
|
|
88
|
-
}
|
|
89
|
-
export type NormalizedUINode = string | number | readonly NormalizedUINode[] | NormalizedUIElement | null;
|
|
90
|
-
/**
|
|
91
|
-
* Normalizes a generative-ui input to {@link NormalizedUINode}. The flat
|
|
92
|
-
* `$type` shape and the legacy `component` shape both map to the same canonical
|
|
93
|
-
* element, with reserved keys (`$type`, `$key`, `$action`, `children`) stripped
|
|
94
|
-
* from the prop bag. A node that carries neither a `$type` nor a `component`
|
|
95
|
-
* string is not renderable and resolves to `null` rather than throwing, so a
|
|
96
|
-
* partially-streamed or malformed node degrades to "render nothing".
|
|
97
|
-
*
|
|
98
|
-
* `partialPath` carries streaming state from the tool-args parse meta: a node
|
|
99
|
-
* whose `$type` is still mid-arrival is held back (resolves to `null`) until it
|
|
100
|
-
* completes, and the path is threaded into `children` so a nested streaming
|
|
101
|
-
* node is held back while completed siblings render. Omit it for a
|
|
102
|
-
* non-streaming (converter) normalize.
|
|
103
|
-
*/
|
|
104
|
-
export declare function normalizeUINode(node: unknown, partialPath?: readonly string[] | undefined, depth?: number): NormalizedUINode;
|
|
105
|
-
/**
|
|
106
|
-
* Normalizes the root of a {@link UISpec}, preserving whether the root was a
|
|
107
|
-
* single node or a list.
|
|
108
|
-
*/
|
|
109
|
-
export declare function normalizeSpec(spec: UISpec): {
|
|
110
|
-
readonly root: NormalizedUINode | readonly NormalizedUINode[];
|
|
111
|
-
};
|
|
1
|
+
export * from "@assistant-ui/generative-ui";
|
|
112
2
|
//# sourceMappingURL=ir.d.ts.map
|
package/dist/ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
|
package/dist/ir.js
CHANGED
|
@@ -1,175 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/ir.ts
|
|
3
|
-
/**
|
|
4
|
-
* The generative-ui intermediate representation: a model-emitted, cross-platform
|
|
5
|
-
* UI tree. React-free, so converters and non-web runtimes consume it without
|
|
6
|
-
* pulling React. The flat `$type` shape is the canonical form; the legacy
|
|
7
|
-
* `component` shape is accepted as a backward-compatible alias.
|
|
8
|
-
*
|
|
9
|
-
* Reserved keys are partitioned off from component props so the component prop
|
|
10
|
-
* namespace stays fully free:
|
|
11
|
-
*
|
|
12
|
-
* - `$`-prefixed keys are framework-reserved (`$type`, `$key`, `$action`,
|
|
13
|
-
* `$status`). Components never declare `$`-prefixed props, so a component
|
|
14
|
-
* can use `type`, `status`, `variant`, etc. as ordinary props without
|
|
15
|
-
* colliding with the framework.
|
|
16
|
-
* - `children` is additionally reserved (the JSX convention).
|
|
17
|
-
* - every other key is an inline prop passed straight to the component.
|
|
18
|
-
*/
|
|
19
|
-
const TEXT_SIZES = [
|
|
20
|
-
"sm",
|
|
21
|
-
"md",
|
|
22
|
-
"lg",
|
|
23
|
-
"xl",
|
|
24
|
-
"2xl",
|
|
25
|
-
"3xl"
|
|
26
|
-
];
|
|
27
|
-
const IMAGE_SIZE_TOKENS = [
|
|
28
|
-
"sm",
|
|
29
|
-
"md",
|
|
30
|
-
"lg"
|
|
31
|
-
];
|
|
32
|
-
const WEIGHTS = [
|
|
33
|
-
"normal",
|
|
34
|
-
"medium",
|
|
35
|
-
"semibold",
|
|
36
|
-
"bold"
|
|
37
|
-
];
|
|
38
|
-
const COLORS = [
|
|
39
|
-
"emphasis",
|
|
40
|
-
"secondary",
|
|
41
|
-
"alpha-70",
|
|
42
|
-
"white",
|
|
43
|
-
"white-70",
|
|
44
|
-
"white-50"
|
|
45
|
-
];
|
|
46
|
-
const ALIGNS = [
|
|
47
|
-
"start",
|
|
48
|
-
"center",
|
|
49
|
-
"end"
|
|
50
|
-
];
|
|
51
|
-
const JUSTIFIES = [
|
|
52
|
-
"start",
|
|
53
|
-
"center",
|
|
54
|
-
"end",
|
|
55
|
-
"between"
|
|
56
|
-
];
|
|
57
|
-
const BUTTON_STYLES = [
|
|
58
|
-
"primary",
|
|
59
|
-
"secondary",
|
|
60
|
-
"outline",
|
|
61
|
-
"ghost",
|
|
62
|
-
"danger"
|
|
63
|
-
];
|
|
64
|
-
const ALERT_TONES = [
|
|
65
|
-
"info",
|
|
66
|
-
"success",
|
|
67
|
-
"warning",
|
|
68
|
-
"danger"
|
|
69
|
-
];
|
|
70
|
-
const ICON_NAMES = [
|
|
71
|
-
"sun",
|
|
72
|
-
"moon",
|
|
73
|
-
"cloud",
|
|
74
|
-
"rain",
|
|
75
|
-
"snow",
|
|
76
|
-
"wind",
|
|
77
|
-
"play",
|
|
78
|
-
"pause",
|
|
79
|
-
"check",
|
|
80
|
-
"x",
|
|
81
|
-
"star",
|
|
82
|
-
"heart",
|
|
83
|
-
"arrow-right",
|
|
84
|
-
"arrow-up-right",
|
|
85
|
-
"chevron-right",
|
|
86
|
-
"calendar",
|
|
87
|
-
"clock",
|
|
88
|
-
"map-pin",
|
|
89
|
-
"plane",
|
|
90
|
-
"truck",
|
|
91
|
-
"credit-card",
|
|
92
|
-
"user",
|
|
93
|
-
"search",
|
|
94
|
-
"bell"
|
|
95
|
-
];
|
|
96
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97
|
-
const isLegacyNode = (node) => typeof node["component"] === "string";
|
|
98
|
-
const isTypeNode = (node) => typeof node[TYPE_KEY] === "string";
|
|
99
|
-
/** Bounds recursion so a runaway or adversarial model response cannot overflow
|
|
100
|
-
* the stack; past this depth (far beyond any real UI) we stop. */
|
|
101
|
-
const MAX_DEPTH = 64;
|
|
102
|
-
/**
|
|
103
|
-
* Steps a streaming partial path down into `key`. `partialPath` is the remaining
|
|
104
|
-
* segment of the parse meta's partial path relative to `node` (`undefined` once
|
|
105
|
-
* the walk leaves the partial frontier, i.e. everything below is complete).
|
|
106
|
-
*/
|
|
107
|
-
function descend(partialPath, key) {
|
|
108
|
-
return partialPath?.[0] === key ? partialPath.slice(1) : void 0;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Normalizes a generative-ui input to {@link NormalizedUINode}. The flat
|
|
112
|
-
* `$type` shape and the legacy `component` shape both map to the same canonical
|
|
113
|
-
* element, with reserved keys (`$type`, `$key`, `$action`, `children`) stripped
|
|
114
|
-
* from the prop bag. A node that carries neither a `$type` nor a `component`
|
|
115
|
-
* string is not renderable and resolves to `null` rather than throwing, so a
|
|
116
|
-
* partially-streamed or malformed node degrades to "render nothing".
|
|
117
|
-
*
|
|
118
|
-
* `partialPath` carries streaming state from the tool-args parse meta: a node
|
|
119
|
-
* whose `$type` is still mid-arrival is held back (resolves to `null`) until it
|
|
120
|
-
* completes, and the path is threaded into `children` so a nested streaming
|
|
121
|
-
* node is held back while completed siblings render. Omit it for a
|
|
122
|
-
* non-streaming (converter) normalize.
|
|
123
|
-
*/
|
|
124
|
-
function normalizeUINode(node, partialPath, depth = 0) {
|
|
125
|
-
if (depth > MAX_DEPTH) return null;
|
|
126
|
-
if (node == null || typeof node === "boolean") return null;
|
|
127
|
-
if (typeof node === "string" || typeof node === "number") return node;
|
|
128
|
-
if (Array.isArray(node)) return node.map((child, index) => normalizeUINode(child, descend(partialPath, String(index)), depth + 1));
|
|
129
|
-
if (!isRecord(node)) return null;
|
|
130
|
-
if (isTypeNode(node)) {
|
|
131
|
-
if (partialPath?.length === 1 && partialPath[0] === "$type") return null;
|
|
132
|
-
const { [TYPE_KEY]: type, $key, $action, children, ...rest } = node;
|
|
133
|
-
return {
|
|
134
|
-
type,
|
|
135
|
-
props: stripReservedProps(rest),
|
|
136
|
-
children: normalizeChildren(children, partialPath, depth),
|
|
137
|
-
key: $key,
|
|
138
|
-
action: $action
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
if (isLegacyNode(node)) {
|
|
142
|
-
const props = stripReservedProps(node.props ?? {});
|
|
143
|
-
return {
|
|
144
|
-
type: node.component,
|
|
145
|
-
props,
|
|
146
|
-
children: normalizeChildren(node.children, partialPath, depth),
|
|
147
|
-
key: node.key
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
function stripReservedProps(props) {
|
|
153
|
-
let out;
|
|
154
|
-
for (const key of Object.keys(props)) if (key.startsWith("$")) {
|
|
155
|
-
out ??= { ...props };
|
|
156
|
-
delete out[key];
|
|
157
|
-
}
|
|
158
|
-
return out ?? props;
|
|
159
|
-
}
|
|
160
|
-
function normalizeChildren(children, partialPath, depth) {
|
|
161
|
-
if (children === void 0) return void 0;
|
|
162
|
-
return normalizeUINode(children, descend(partialPath, "children"), depth + 1);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Normalizes the root of a {@link UISpec}, preserving whether the root was a
|
|
166
|
-
* single node or a list.
|
|
167
|
-
*/
|
|
168
|
-
function normalizeSpec(spec) {
|
|
169
|
-
if (Array.isArray(spec)) return { root: spec.map((node) => normalizeUINode(node)) };
|
|
170
|
-
return { root: normalizeUINode(spec) };
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode };
|
|
174
|
-
|
|
175
|
-
//# sourceMappingURL=ir.js.map
|
|
1
|
+
export * from "@assistant-ui/generative-ui";
|
package/dist/slack.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { fromSlackBlocks } from "./slack/fromSlackBlocks.js";
|
|
3
|
-
export { toSlackBlocks } from "./slack/toSlackBlocks.js";
|
|
4
|
-
export type { FromSlackBlocksResult, SlackActionElement, SlackActionsBlock, SlackAlertBlock, SlackAlertLevel, SlackBlock, SlackBlocksResult, SlackButtonElement, SlackCardBlock, SlackCarouselBlock, SlackCheckboxesElement, SlackContextBlock, SlackConversionWarning, SlackDataTableBlock, SlackDataTableCell, SlackDataTableRawNumberCell, SlackDataTableRawTextCell, SlackDatePickerElement, SlackDateTimePickerElement, SlackDividerBlock, SlackHeaderBlock, SlackImageBlock, SlackInputBlock, SlackMarkdownBlock, SlackMrkdwnText, SlackOption, SlackPlainText, SlackPlainTextInputElement, SlackRadioButtonsElement, SlackSectionBlock, SlackStaticSelectElement, SlackTextObject, SlackTimePickerElement, ToSlackBlocksOptions, } from "./slack/types.js";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/slack";
|
|
5
2
|
//# sourceMappingURL=slack.d.ts.map
|
package/dist/slack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/dist/slack.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { fromSlackBlocks } from "./slack/fromSlackBlocks.js";
|
|
3
|
-
import { toSlackBlocks } from "./slack/toSlackBlocks.js";
|
|
4
|
-
export { decodeBlockAction, fromSlackBlocks, toSlackBlocks };
|
|
1
|
+
export * from "@assistant-ui/generative-ui/slack";
|
package/dist/teams.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { toAdaptiveCard } from "./teams/toAdaptiveCard.js";
|
|
3
|
-
export { toTeamsAttachments } from "./teams/toTeamsAttachments.js";
|
|
4
|
-
export type { AdaptiveCardResult, TeamsAdaptiveCard, TeamsActionSet, TeamsAttachmentsResult, TeamsCardAction, TeamsCardAttachment, TeamsCardElement, TeamsColumn, TeamsColumnSet, TeamsContainer, TeamsContainerStyle, TeamsConversionWarning, TeamsFact, TeamsFactSet, TeamsImage, TeamsInputChoice, TeamsInputChoiceSet, TeamsInputDate, TeamsInputText, TeamsInputTime, TeamsInputToggle, TeamsSubmitAction, TeamsSubmitData, TeamsTable, TeamsTableCell, TeamsTableColumnDefinition, TeamsTableRow, TeamsTextBlock, TeamsTextSize, ToAdaptiveCardOptions, } from "./teams/types.js";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/teams";
|
|
5
2
|
//# sourceMappingURL=teams.d.ts.map
|
package/dist/teams.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/dist/teams.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { toAdaptiveCard } from "./teams/toAdaptiveCard.js";
|
|
3
|
-
import { toTeamsAttachments } from "./teams/toTeamsAttachments.js";
|
|
4
|
-
export { decodeSubmitData, toAdaptiveCard, toTeamsAttachments };
|
|
1
|
+
export * from "@assistant-ui/generative-ui/teams";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-generative-ui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Generative UI components for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generative-ui",
|
|
@@ -50,8 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"assistant-stream": "^0.3.48"
|
|
53
|
+
"@assistant-ui/generative-ui": "^0.0.1"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
57
56
|
"@assistant-ui/react": "^0.15.0",
|
|
@@ -65,11 +64,11 @@
|
|
|
65
64
|
}
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
|
-
"@assistant-ui/react": "0.15.
|
|
67
|
+
"@assistant-ui/react": "0.15.26",
|
|
69
68
|
"@assistant-ui/x-buildutils": "0.0.30",
|
|
70
69
|
"@assistant-ui/x-react18": "0.0.0",
|
|
71
70
|
"@types/react": "^19.3.0",
|
|
72
|
-
"jsdom": "^30.
|
|
71
|
+
"jsdom": "^30.1.2",
|
|
73
72
|
"react": "^19.3.0",
|
|
74
73
|
"react-dom": "^19.3.0",
|
|
75
74
|
"vitest": "^5.0.3",
|
package/src/a2ui.ts
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { convertSurfaceToUISpec } from "./a2ui/convert";
|
|
3
|
-
export { surfaceToOperations } from "./a2ui/snapshot";
|
|
4
|
-
export type {
|
|
5
|
-
A2uiCreateSurfaceOperation,
|
|
6
|
-
A2uiCreateSurfaceV09Payload,
|
|
7
|
-
A2uiCreateSurfaceV10Payload,
|
|
8
|
-
A2uiDeleteSurfaceOperation,
|
|
9
|
-
A2uiDeleteSurfacePayload,
|
|
10
|
-
A2uiOperation,
|
|
11
|
-
A2uiOperationResult,
|
|
12
|
-
A2uiState,
|
|
13
|
-
A2uiSurfaceSnapshotOperation,
|
|
14
|
-
A2uiSurfaceState,
|
|
15
|
-
A2uiTemplateChildren,
|
|
16
|
-
A2uiUpdateComponentsOperation,
|
|
17
|
-
A2uiUpdateComponentsPayload,
|
|
18
|
-
A2uiUpdateDataModelOperation,
|
|
19
|
-
A2uiUpdateDataModelPayload,
|
|
20
|
-
A2uiVersion,
|
|
21
|
-
ComponentNode,
|
|
22
|
-
} from "./a2ui/types";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/a2ui";
|
package/src/index.server.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./index.shared";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/react";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import * as upstreamRoot from "@assistant-ui/generative-ui";
|
|
6
|
+
import * as upstreamA2ui from "@assistant-ui/generative-ui/a2ui";
|
|
7
|
+
import * as upstreamReact from "@assistant-ui/generative-ui/react";
|
|
8
|
+
import * as upstreamSlack from "@assistant-ui/generative-ui/slack";
|
|
9
|
+
import * as upstreamTeams from "@assistant-ui/generative-ui/teams";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import * as a2ui from "./a2ui";
|
|
12
|
+
import * as index from "./index";
|
|
13
|
+
import * as indexServer from "./index.server";
|
|
14
|
+
import * as ir from "./ir";
|
|
15
|
+
import * as slack from "./slack";
|
|
16
|
+
import * as teams from "./teams";
|
|
17
|
+
|
|
18
|
+
const PACKAGE_DIR = fileURLToPath(new URL("..", import.meta.url));
|
|
19
|
+
|
|
20
|
+
describe("@assistant-ui/react-generative-ui", () => {
|
|
21
|
+
it.each([
|
|
22
|
+
["index", index, upstreamReact],
|
|
23
|
+
["index.server", indexServer, upstreamReact],
|
|
24
|
+
["ir", ir, upstreamRoot],
|
|
25
|
+
["a2ui", a2ui, upstreamA2ui],
|
|
26
|
+
["slack", slack, upstreamSlack],
|
|
27
|
+
["teams", teams, upstreamTeams],
|
|
28
|
+
])(
|
|
29
|
+
"%s exports exactly what its @assistant-ui/generative-ui entry exports",
|
|
30
|
+
(_, entry, upstream) => {
|
|
31
|
+
const exported: Record<string, unknown> = { ...entry };
|
|
32
|
+
const expected: Record<string, unknown> = { ...upstream };
|
|
33
|
+
|
|
34
|
+
expect(Object.keys(exported).sort()).toEqual(
|
|
35
|
+
Object.keys(expected).sort(),
|
|
36
|
+
);
|
|
37
|
+
for (const name of Object.keys(expected)) {
|
|
38
|
+
expect(exported[name]).toBe(expected[name]);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
it.each([
|
|
44
|
+
[[], ["react-generative-ui/dist/index.js", "generative-ui/dist/react.js"]],
|
|
45
|
+
[
|
|
46
|
+
["react-server"],
|
|
47
|
+
[
|
|
48
|
+
"react-generative-ui/dist/index.server.js",
|
|
49
|
+
"generative-ui/dist/react.server.js",
|
|
50
|
+
],
|
|
51
|
+
],
|
|
52
|
+
])(
|
|
53
|
+
"resolves the root and @assistant-ui/generative-ui/react under conditions %j",
|
|
54
|
+
(conditions, expected) => {
|
|
55
|
+
const result = spawnSync(
|
|
56
|
+
process.execPath,
|
|
57
|
+
[
|
|
58
|
+
...conditions.map((condition) => `--conditions=${condition}`),
|
|
59
|
+
"--input-type=module",
|
|
60
|
+
"--eval",
|
|
61
|
+
'for (const id of ["@assistant-ui/react-generative-ui", "@assistant-ui/generative-ui/react"]) console.log(import.meta.resolve(id));',
|
|
62
|
+
],
|
|
63
|
+
{ cwd: PACKAGE_DIR, encoding: "utf8" },
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(result.status, result.stderr).toBe(0);
|
|
67
|
+
expect(
|
|
68
|
+
result.stdout
|
|
69
|
+
.trim()
|
|
70
|
+
.split("\n")
|
|
71
|
+
.map((url) => url.split("/").slice(-3).join("/")),
|
|
72
|
+
).toEqual(expected);
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./index.shared";
|
|
1
|
+
export * from "@assistant-ui/generative-ui/react";
|