Skip to content

Commit bf92dc4

Browse files
vividvioletisaacroldan
authored andcommitted
Support intents for ui extensions
1 parent 96d95ba commit bf92dc4

File tree

6 files changed

+363
-153
lines changed

6 files changed

+363
-153
lines changed

packages/app/src/cli/models/extensions/schemas.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ const NewExtensionPointSchema = zod.object({
5151
should_render: ShouldRenderSchema.optional(),
5252
tools: zod.string().optional(),
5353
instructions: zod.string().optional(),
54+
intents: zod
55+
.array(
56+
zod.object({
57+
type: zod.string(),
58+
action: zod.string(),
59+
schema: zod.string(),
60+
name: zod.string().optional(),
61+
description: zod.string().optional(),
62+
}),
63+
)
64+
.optional(),
5465
metafields: zod.array(MetafieldSchema).optional(),
5566
default_placement: zod.string().optional(),
5667
urls: zod

packages/app/src/cli/models/extensions/specification.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export enum AssetIdentifier {
4242
Main = 'main',
4343
Tools = 'tools',
4444
Instructions = 'instructions',
45+
Intents = 'intents',
4546
}
4647

4748
export interface Asset {

packages/app/src/cli/models/extensions/specifications/ui_extension.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,34 @@ const uiExtensionSpec = createExtensionSpecification({
109109
lifecycle: 'deploy',
110110
steps: [
111111
{id: 'bundle-ui', name: 'Bundle UI Extension', type: 'bundle_ui', config: {}},
112-
{id: 'copy-static-assets', name: 'Copy Static Assets', type: 'copy_static_assets', config: {}},
112+
{
113+
id: 'include-ui-extension-assets',
114+
name: 'Include UI Extension Assets',
115+
type: 'include_assets',
116+
config: {
117+
generatesAssetsManifest: true,
118+
inclusions: [
119+
{
120+
type: 'configKey',
121+
anchor: 'extensions[].targeting[]',
122+
groupBy: 'target',
123+
key: 'tools',
124+
},
125+
{
126+
type: 'configKey',
127+
anchor: 'extensions[].targeting[]',
128+
groupBy: 'target',
129+
key: 'instructions',
130+
},
131+
{
132+
type: 'configKey',
133+
anchor: 'extensions[].targeting[]',
134+
groupBy: 'target',
135+
key: 'intents[].schema',
136+
},
137+
],
138+
},
139+
},
113140
],
114141
},
115142
],

0 commit comments

Comments
 (0)