@atlaskit/a2ui-catalog 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +1 -27
  2. package/catalogs/agentic-forge-v0_9-v1/catalog.json +127 -2
  3. package/dist/cjs/agentic-forge-v0_9/apis.js +2 -1
  4. package/dist/cjs/agentic-forge-v0_9/catalog-component-apis.js +1 -1
  5. package/dist/cjs/agentic-forge-v0_9/schemas.js +65 -2
  6. package/dist/cjs/catalog-json/catalog-definitions.js +2 -2
  7. package/dist/cjs/entry-points/agentic-forge-v0_9-apis.js +6 -0
  8. package/dist/cjs/entry-points/agentic-forge-v0_9-schemas.js +6 -0
  9. package/dist/es2019/agentic-forge-v0_9/apis.js +2 -1
  10. package/dist/es2019/agentic-forge-v0_9/catalog-component-apis.js +2 -2
  11. package/dist/es2019/agentic-forge-v0_9/schemas.js +64 -1
  12. package/dist/es2019/catalog-json/catalog-definitions.js +2 -2
  13. package/dist/es2019/entry-points/agentic-forge-v0_9-apis.js +1 -1
  14. package/dist/es2019/entry-points/agentic-forge-v0_9-schemas.js +1 -1
  15. package/dist/esm/agentic-forge-v0_9/apis.js +2 -1
  16. package/dist/esm/agentic-forge-v0_9/catalog-component-apis.js +2 -2
  17. package/dist/esm/agentic-forge-v0_9/schemas.js +64 -1
  18. package/dist/esm/catalog-json/catalog-definitions.js +2 -2
  19. package/dist/esm/entry-points/agentic-forge-v0_9-apis.js +1 -1
  20. package/dist/esm/entry-points/agentic-forge-v0_9-schemas.js +1 -1
  21. package/dist/types/agentic-forge-v0_9/apis.d.ts +2 -1
  22. package/dist/types/agentic-forge-v0_9/schemas.d.ts +29 -0
  23. package/dist/types/agentic-forge-v0_9/types.d.ts +8 -5
  24. package/dist/types/entry-points/agentic-forge-v0_9-apis.d.ts +1 -1
  25. package/dist/types/entry-points/agentic-forge-v0_9-schemas.d.ts +1 -1
  26. package/dist/types/entry-points/agentic-forge-v0_9-types.d.ts +1 -1
  27. package/package.json +1 -1
package/README.md CHANGED
@@ -49,9 +49,6 @@ Choose the catalog implemented by your host:
49
49
  - `@atlaskit/a2ui-catalog/catalogs/agentic-jira-v0_9-v1/catalog.json` extends ADS with CodeDiff,
50
50
  MultipleChoiceQuestions, RepositoryPicker, and ToolApproval. Use it only when the host supports
51
51
  those components.
52
- - `@atlaskit/a2ui-catalog/catalogs/agentic-forge-v0_9-v1/catalog.json` is a dedicated Forge catalog
53
- with `ResultPanel`. `title` and `summary` are literal strings. Use it only when the host supports
54
- that catalog.
55
52
 
56
53
  ### What the agent should emit
57
54
 
@@ -97,8 +94,7 @@ components to another renderer automatically.
97
94
 
98
95
  Have the host declare which catalog IDs and version it supports; choose a compatible pinned package
99
96
  version. An npm version and a wire catalog ID are different: changing the npm scope does not change
100
- `com.atlassian.ads/v0_9`, `com.atlassian.agentic-jira/v0_9/v1`, or
101
- `com.atlassian.agentic-forge/v0_9/v1`. Catalog IDs are identifiers, not
97
+ `com.atlassian.ads/v0_9` or `com.atlassian.agentic-jira/v0_9/v1`. Catalog IDs are identifiers, not
102
98
  URLs to fetch. Handle user actions in the host, validate and authorize them before executing work,
103
99
  and return resulting surface/data updates. Client-side functions such as `openUrl` are not currently
104
100
  included in these JSON documents; do not invent function signatures or assume host support.
@@ -122,13 +118,11 @@ surfaces against it:
122
118
  | --------------------------------------- | ------------------------------------------------ |
123
119
  | `com.atlassian.ads/v0_9` | `catalogs/ads-v0_9/catalog.json` |
124
120
  | `com.atlassian.agentic-jira/v0_9/v1` | `catalogs/agentic-jira-v0_9-v1/catalog.json` |
125
- | `com.atlassian.agentic-forge/v0_9/v1` | `catalogs/agentic-forge-v0_9-v1/catalog.json` |
126
121
 
127
122
  The files are generated from the Zod schemas with `@a2ui/web_core`'s own inline-catalog
128
123
  conversion. Common types are bundled under `$defs`, so every `$ref` is local. The catalog
129
124
  package's Atlaskit documentation shows each public catalog with a JSON preview and copy
130
125
  button. Catalogs marked `isPrivate` are still published here and omitted from that page.
131
- The Agentic Forge catalog is private.
132
126
 
133
127
  Each document contains `catalogId`, `instructions` for the agent, `components` (one schema per
134
128
  component name), and `$defs`. Client-side functions (for example `openUrl`) are not included yet,
@@ -275,23 +269,3 @@ The trailing `/v1` in the ID is the catalog's own major version: breaking
275
269
  schema changes mint a new ID (`…/v2`) registered alongside `v1`, letting
276
270
  catalog negotiation migrate surfaces with zero downtime (see the versioning
277
271
  policy in `catalog-id.ts`).
278
-
279
- ## Agentic Forge v0.9 catalog (`com.atlassian.agentic-forge/v0_9/v1`)
280
-
281
- A dedicated catalog shipped from `src/agentic-forge-v0_9/`. It is not a
282
- superset of the ADS base catalog. Props are literal strings, not `{ path }`
283
- bindings.
284
-
285
- | Component | Modelled on |
286
- |-----------|-------------|
287
- | `ResultPanel` | Completed result with a heading and a summary. No actions. |
288
-
289
- `title` and `summary` are required. `summary` keeps authored line breaks.
290
- There is no action prop. The published document is
291
- `@atlaskit/a2ui-catalog/catalogs/agentic-forge-v0_9-v1/catalog.json`.
292
-
293
- Import via the `./agentic-forge-v0_9/*` subpaths (`schemas`, `apis`, `types`,
294
- `catalog-id`, `catalog-component-apis`). The rendering catalog is assembled by
295
- `@atlassian/a2ui-renderer-next/agentic-forge-v0_9/catalog` →
296
- `createAgenticForgeCatalog()`. It is opt-in and is not registered on the
297
- default Rovo catalog set.
@@ -2,10 +2,135 @@
2
2
  "$schema": "https://json-schema.org/draft/2019-09/schema",
3
3
  "$comment": "Generated from @atlaskit/a2ui-catalog by `yarn workspace @atlaskit/a2ui-catalog codegen:catalog-json`. Do not edit by hand.",
4
4
  "title": "Atlassian Agentic Forge A2UI catalog",
5
- "description": "A dedicated Forge result surface. ResultPanel shows a completed result from a literal title and summary. It is not a superset of the ADS catalog.",
5
+ "description": "A dedicated Forge catalog. ResultPanel shows a completed result from a literal title and summary. MultipleChoice selects one or more options. It is not a superset of the ADS catalog.",
6
6
  "catalogId": "com.atlassian.agentic-forge/v0_9/v1",
7
- "instructions": "Send A2UI v0.9 messages, each with \"version\": \"v0.9\". Start with createSurface using this catalogId, then send updateComponents. This catalog contains only ResultPanel and is not a superset of the ADS catalog. ResultPanel is a completed result: set id to \"root\", component to \"ResultPanel\", and provide title and summary as literal strings. summary keeps authored line breaks. Do not use data-binding path objects, updateDataModel, child component ids, or action props.",
7
+ "instructions": "Send A2UI v0.9 messages, each with \"version\": \"v0.9\". Start with createSurface using this catalogId, then send updateComponents. This catalog contains ResultPanel and MultipleChoice. It is not a superset of the ADS catalog. ResultPanel is a completed result: set component to \"ResultPanel\" and provide title and summary as literal strings. summary keeps authored line breaks. Do not add actions, data-binding path objects, or child component ids to ResultPanel. MultipleChoice chooses one or more options. Set options to an array of { label, value }. Set value to a string array or a { \"path\": \"/json/pointer\" } binding; the renderer writes the selected values back to that path. style is \"select\" (default) or \"action\". Use updateDataModel to seed a bound MultipleChoice value. Do not invent other component names.",
8
8
  "components": {
9
+ "MultipleChoice": {
10
+ "allOf": [
11
+ { "$ref": "#/$defs/ComponentCommon" },
12
+ {
13
+ "properties": {
14
+ "component": { "const": "MultipleChoice" },
15
+ "options": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "label": {
21
+ "anyOf": [
22
+ { "type": "string" },
23
+ {
24
+ "type": "object",
25
+ "properties": { "path": { "type": "string" } },
26
+ "required": ["path"],
27
+ "additionalProperties": false
28
+ }
29
+ ],
30
+ "description": "A literal string OR a `{ path }` JSON-pointer binding into the surface data model."
31
+ },
32
+ "value": {
33
+ "type": "string",
34
+ "description": "Stable identifier persisted to the data model."
35
+ }
36
+ },
37
+ "required": ["label", "value"],
38
+ "additionalProperties": false
39
+ },
40
+ "description": "Available options."
41
+ },
42
+ "value": {
43
+ "anyOf": [
44
+ { "type": "array", "items": { "type": "string" } },
45
+ {
46
+ "type": "object",
47
+ "properties": { "path": { "type": "string" } },
48
+ "required": ["path"],
49
+ "additionalProperties": false
50
+ }
51
+ ],
52
+ "description": "Selected values. A string array, or { \"path\": \"/pointer\" } so the selection is written back. Read that path to see what was picked."
53
+ },
54
+ "label": {
55
+ "$ref": "#/components/MultipleChoice/allOf/1/properties/options/items/properties/label",
56
+ "description": "Visible group label."
57
+ },
58
+ "multiple": {
59
+ "type": "boolean",
60
+ "description": "Allow more than one selection. Defaults to false. Ignored when style is \"action\"."
61
+ },
62
+ "style": {
63
+ "type": "string",
64
+ "enum": ["select", "action"],
65
+ "description": "\"select\" (default) is a dropdown. \"action\" is a menu. Picking an item writes value and fires onChange."
66
+ },
67
+ "placeholder": {
68
+ "$ref": "#/components/MultipleChoice/allOf/1/properties/options/items/properties/label",
69
+ "description": "A literal string OR a `{ path }` JSON-pointer binding into the surface data model."
70
+ },
71
+ "disabled": {
72
+ "anyOf": [
73
+ { "type": "boolean" },
74
+ {
75
+ "type": "object",
76
+ "properties": { "path": { "type": "string" } },
77
+ "required": ["path"],
78
+ "additionalProperties": false
79
+ }
80
+ ],
81
+ "description": "A literal boolean OR a `{ path }` JSON-pointer binding into the surface data model."
82
+ },
83
+ "invalid": {
84
+ "$ref": "#/components/MultipleChoice/allOf/1/properties/disabled",
85
+ "description": "A literal boolean OR a `{ path }` JSON-pointer binding into the surface data model."
86
+ },
87
+ "filterable": {
88
+ "type": "boolean",
89
+ "description": "Show a search box in the dropdown. Defaults to true. Ignored when style is \"action\"."
90
+ },
91
+ "onChange": {
92
+ "anyOf": [
93
+ {
94
+ "type": "object",
95
+ "properties": {
96
+ "event": {
97
+ "type": "object",
98
+ "properties": {
99
+ "name": { "type": "string" },
100
+ "context": { "type": "object", "additionalProperties": {} }
101
+ },
102
+ "required": ["name"],
103
+ "additionalProperties": false
104
+ }
105
+ },
106
+ "required": ["event"],
107
+ "additionalProperties": false
108
+ },
109
+ {
110
+ "type": "object",
111
+ "properties": {
112
+ "functionCall": {
113
+ "type": "object",
114
+ "properties": {
115
+ "call": { "type": "string" },
116
+ "args": { "type": "object", "additionalProperties": {} },
117
+ "returnType": { "type": "string" }
118
+ },
119
+ "required": ["call", "args"],
120
+ "additionalProperties": false
121
+ }
122
+ },
123
+ "required": ["functionCall"],
124
+ "additionalProperties": false
125
+ }
126
+ ],
127
+ "description": "Fired after the selection is written to value. It has no arguments. Read the value path to see the choice, or put context on the action, for example { \"event\": { \"name\": \"picked\", \"context\": { \"from\": \"fruit-menu\" } } }."
128
+ }
129
+ },
130
+ "required": ["component", "options", "value"]
131
+ }
132
+ ]
133
+ },
9
134
  "ResultPanel": {
10
135
  "allOf": [
11
136
  { "$ref": "#/$defs/ComponentCommon" },
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ResultPanelApi = void 0;
6
+ exports.ResultPanelApi = exports.MultipleChoiceApi = void 0;
7
7
  var _schemas = require("./schemas");
8
8
  /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports -- Catalog binding file: one named `XxxApi` export per component is the entire point (mirrors `../v0_9/apis.ts`). */
9
9
 
@@ -27,4 +27,5 @@ var apiOf = function apiOf(name, schema) {
27
27
  schema: schema
28
28
  };
29
29
  };
30
+ var MultipleChoiceApi = exports.MultipleChoiceApi = apiOf('MultipleChoice', _schemas.MultipleChoiceSchema);
30
31
  var ResultPanelApi = exports.ResultPanelApi = apiOf('ResultPanel', _schemas.ResultPanelSchema);
@@ -14,4 +14,4 @@ var _apis = require("./apis");
14
14
  * `catalog.json` is generated from this list.
15
15
  */
16
16
 
17
- var AGENTIC_FORGE_CATALOG_COMPONENT_APIS = exports.AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [_apis.ResultPanelApi];
17
+ var AGENTIC_FORGE_CATALOG_COMPONENT_APIS = exports.AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [_apis.MultipleChoiceApi, _apis.ResultPanelApi];
@@ -3,8 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ResultPanelSchema = void 0;
6
+ exports.ResultPanelSchema = exports.MultipleChoiceSchema = void 0;
7
7
  var _zod = require("zod");
8
+ /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports -- Catalog schema file: one named `XxxSchema` export per component. Shared binding helpers stay co-located. */
9
+
8
10
  /**
9
11
  * Zod schemas for the Agentic Forge v0.9 catalog
10
12
  * (`com.atlassian.agentic-forge/v0_9/v1`).
@@ -12,8 +14,42 @@ var _zod = require("zod");
12
14
  * `ResultPanel` is a completed result: a heading and a summary. Both values
13
15
  * are literals. There is no action prop. The host's tool-result envelope
14
16
  * (`text`, `ui`, `completed`) stays outside this schema.
17
+ *
18
+ * `MultipleChoice` is a copy of the ADS v0.9 `MultipleChoice` contract so a
19
+ * Forge surface can ask for a selection without loading the ADS catalog.
15
20
  */
16
21
 
22
+ /**
23
+ * Action shape mirrored from the ADS catalog. The adapter casts a resolved
24
+ * action to `() => void` at call time.
25
+ */
26
+ var ActionSchema = _zod.z.union([_zod.z.object({
27
+ event: _zod.z.object({
28
+ name: _zod.z.string(),
29
+ context: _zod.z.record(_zod.z.string(), _zod.z.unknown()).optional()
30
+ })
31
+ }), _zod.z.object({
32
+ functionCall: _zod.z.object({
33
+ call: _zod.z.string(),
34
+ args: _zod.z.record(_zod.z.string(), _zod.z.unknown()),
35
+ returnType: _zod.z.string().optional()
36
+ })
37
+ })]).describe('Action payload dispatched when the component is interacted with.');
38
+ var BooleanDynamicValueSchema = _zod.z.union([_zod.z.boolean(), _zod.z.object({
39
+ path: _zod.z.string()
40
+ })]).describe('A literal boolean OR a `{ path }` JSON-pointer binding into the surface data model.');
41
+ var StringBindingSchema = _zod.z.union([_zod.z.string(), _zod.z.object({
42
+ path: _zod.z.string()
43
+ })]).describe('A literal string OR a `{ path }` JSON-pointer binding into the surface data model.');
44
+
45
+ /**
46
+ * Wire-level shape for a value that resolves to `string[]`.
47
+ * Pass `{ path }` for two-way state.
48
+ */
49
+ var StringListDataBindingSchema = _zod.z.union([_zod.z.array(_zod.z.string()), _zod.z.object({
50
+ path: _zod.z.string()
51
+ })]).describe('JSON-pointer binding to a string array, or a literal `string[]`. Two-way bound for multi-select; the adapter writes the selected values back.');
52
+
17
53
  /**
18
54
  * Agentic Forge v0.9 `ResultPanel` schema.
19
55
  *
@@ -23,4 +59,31 @@ var _zod = require("zod");
23
59
  var ResultPanelSchema = exports.ResultPanelSchema = _zod.z.object({
24
60
  summary: _zod.z.string().min(1).describe('Result body. Line breaks are shown as authored.'),
25
61
  title: _zod.z.string().min(1).describe('Heading for the completed result.')
26
- }).strict();
62
+ }).strict();
63
+
64
+ /**
65
+ * Agentic Forge v0.9 `MultipleChoice` schema.
66
+ *
67
+ * Copied from the ADS v0.9 `MultipleChoice` contract (DSP-25085):
68
+ * - `style` omitted / `'select'`, `multiple: false` → single select
69
+ * - `style` omitted / `'select'`, `multiple: true` → multi select
70
+ * - `style: 'action'` → menu of actions
71
+ *
72
+ * `value` is always a string array, either as a literal or a `{ path }`
73
+ * binding. The adapter writes the selection back when `value` is bound.
74
+ */
75
+ var MultipleChoiceSchema = exports.MultipleChoiceSchema = _zod.z.object({
76
+ options: _zod.z.array(_zod.z.object({
77
+ label: StringBindingSchema,
78
+ value: _zod.z.string().describe('Stable identifier persisted to the data model.')
79
+ })).describe('Available options.'),
80
+ value: StringListDataBindingSchema.describe('Selected values. A string array, or { "path": "/pointer" } so the selection is written back. Read that path to see what was picked.'),
81
+ label: StringBindingSchema.optional().describe('Visible group label.'),
82
+ multiple: _zod.z.boolean().optional().describe('Allow more than one selection. Defaults to false. Ignored when style is "action".'),
83
+ style: _zod.z.enum(['select', 'action']).optional().describe('"select" (default) is a dropdown. "action" is a menu. Picking an item writes value and fires onChange.'),
84
+ placeholder: StringBindingSchema.optional(),
85
+ disabled: BooleanDynamicValueSchema.optional(),
86
+ invalid: BooleanDynamicValueSchema.optional(),
87
+ filterable: _zod.z.boolean().optional().describe('Show a search box in the dropdown. Defaults to true. Ignored when style is "action".'),
88
+ onChange: ActionSchema.optional().describe('Fired after the selection is written to value. It has no arguments. Read the value path to see the choice, or put context on the action, for example { "event": { "name": "picked", "context": { "from": "fruit-menu" } } }.')
89
+ });
@@ -20,7 +20,7 @@ var _catalogId3 = require("../v0_9/catalog-id");
20
20
  */
21
21
 
22
22
  var COMMON_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents with a flat list of components. Each component needs a unique id and a component name from this catalog; reference children by id. Exactly one component must have the id "root". Use data bindings ({ "path": "/json/pointer" }) for values the user can change, and send updateDataModel to set initial values.';
23
- var FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains only ResultPanel and is not a superset of the ADS catalog. ResultPanel is a completed result: set id to "root", component to "ResultPanel", and provide title and summary as literal strings. summary keeps authored line breaks. Do not use data-binding path objects, updateDataModel, child component ids, or action props.';
23
+ var FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains ResultPanel and MultipleChoice. It is not a superset of the ADS catalog. ResultPanel is a completed result: set component to "ResultPanel" and provide title and summary as literal strings. summary keeps authored line breaks. Do not add actions, data-binding path objects, or child component ids to ResultPanel. MultipleChoice chooses one or more options. Set options to an array of { label, value }. Set value to a string array or a { "path": "/json/pointer" } binding; the renderer writes the selected values back to that path. style is "select" (default) or "action". Use updateDataModel to seed a bound MultipleChoice value. Do not invent other component names.';
24
24
  var CATALOG_DEFINITIONS = exports.CATALOG_DEFINITIONS = [{
25
25
  catalogId: _catalogId3.ADS_CATALOG_ID,
26
26
  slug: 'ads-v0_9',
@@ -40,7 +40,7 @@ var CATALOG_DEFINITIONS = exports.CATALOG_DEFINITIONS = [{
40
40
  slug: 'agentic-forge-v0_9-v1',
41
41
  title: 'Atlassian Agentic Forge A2UI catalog',
42
42
  isPrivate: true,
43
- description: 'A dedicated Forge result surface. ResultPanel shows a completed result from a literal title and summary. It is not a superset of the ADS catalog.',
43
+ description: 'A dedicated Forge catalog. ResultPanel shows a completed result from a literal title and summary. MultipleChoice selects one or more options. It is not a superset of the ADS catalog.',
44
44
  instructions: FORGE_INSTRUCTIONS,
45
45
  components: _catalogComponentApis.AGENTIC_FORGE_CATALOG_COMPONENT_APIS
46
46
  }];
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "MultipleChoiceApi", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _apis.MultipleChoiceApi;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "ResultPanelApi", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "MultipleChoiceSchema", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _schemas.MultipleChoiceSchema;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "ResultPanelSchema", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -8,7 +8,7 @@
8
8
 
9
9
  // Import from web_core (not @a2ui/react) so this package stays React-free.
10
10
 
11
- import { ResultPanelSchema } from './schemas';
11
+ import { MultipleChoiceSchema, ResultPanelSchema } from './schemas';
12
12
  /**
13
13
  * Tiny factory: pairs a catalog `name` with its `schema`. The `name`
14
14
  * parameter is restricted to the `AgenticForgeV09ComponentName` union — a
@@ -19,4 +19,5 @@ const apiOf = (name, schema) => ({
19
19
  name,
20
20
  schema
21
21
  });
22
+ export const MultipleChoiceApi = apiOf('MultipleChoice', MultipleChoiceSchema);
22
23
  export const ResultPanelApi = apiOf('ResultPanel', ResultPanelSchema);
@@ -7,5 +7,5 @@
7
7
  * `catalog.json` is generated from this list.
8
8
  */
9
9
 
10
- import { ResultPanelApi } from './apis';
11
- export const AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [ResultPanelApi];
10
+ import { MultipleChoiceApi, ResultPanelApi } from './apis';
11
+ export const AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [MultipleChoiceApi, ResultPanelApi];
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports -- Catalog schema file: one named `XxxSchema` export per component. Shared binding helpers stay co-located. */
2
+
1
3
  /**
2
4
  * Zod schemas for the Agentic Forge v0.9 catalog
3
5
  * (`com.atlassian.agentic-forge/v0_9/v1`).
@@ -5,10 +7,44 @@
5
7
  * `ResultPanel` is a completed result: a heading and a summary. Both values
6
8
  * are literals. There is no action prop. The host's tool-result envelope
7
9
  * (`text`, `ui`, `completed`) stays outside this schema.
10
+ *
11
+ * `MultipleChoice` is a copy of the ADS v0.9 `MultipleChoice` contract so a
12
+ * Forge surface can ask for a selection without loading the ADS catalog.
8
13
  */
9
14
 
10
15
  import { z } from 'zod';
11
16
 
17
+ /**
18
+ * Action shape mirrored from the ADS catalog. The adapter casts a resolved
19
+ * action to `() => void` at call time.
20
+ */
21
+ const ActionSchema = z.union([z.object({
22
+ event: z.object({
23
+ name: z.string(),
24
+ context: z.record(z.string(), z.unknown()).optional()
25
+ })
26
+ }), z.object({
27
+ functionCall: z.object({
28
+ call: z.string(),
29
+ args: z.record(z.string(), z.unknown()),
30
+ returnType: z.string().optional()
31
+ })
32
+ })]).describe('Action payload dispatched when the component is interacted with.');
33
+ const BooleanDynamicValueSchema = z.union([z.boolean(), z.object({
34
+ path: z.string()
35
+ })]).describe('A literal boolean OR a `{ path }` JSON-pointer binding into the surface data model.');
36
+ const StringBindingSchema = z.union([z.string(), z.object({
37
+ path: z.string()
38
+ })]).describe('A literal string OR a `{ path }` JSON-pointer binding into the surface data model.');
39
+
40
+ /**
41
+ * Wire-level shape for a value that resolves to `string[]`.
42
+ * Pass `{ path }` for two-way state.
43
+ */
44
+ const StringListDataBindingSchema = z.union([z.array(z.string()), z.object({
45
+ path: z.string()
46
+ })]).describe('JSON-pointer binding to a string array, or a literal `string[]`. Two-way bound for multi-select; the adapter writes the selected values back.');
47
+
12
48
  /**
13
49
  * Agentic Forge v0.9 `ResultPanel` schema.
14
50
  *
@@ -18,4 +54,31 @@ import { z } from 'zod';
18
54
  export const ResultPanelSchema = z.object({
19
55
  summary: z.string().min(1).describe('Result body. Line breaks are shown as authored.'),
20
56
  title: z.string().min(1).describe('Heading for the completed result.')
21
- }).strict();
57
+ }).strict();
58
+
59
+ /**
60
+ * Agentic Forge v0.9 `MultipleChoice` schema.
61
+ *
62
+ * Copied from the ADS v0.9 `MultipleChoice` contract (DSP-25085):
63
+ * - `style` omitted / `'select'`, `multiple: false` → single select
64
+ * - `style` omitted / `'select'`, `multiple: true` → multi select
65
+ * - `style: 'action'` → menu of actions
66
+ *
67
+ * `value` is always a string array, either as a literal or a `{ path }`
68
+ * binding. The adapter writes the selection back when `value` is bound.
69
+ */
70
+ export const MultipleChoiceSchema = z.object({
71
+ options: z.array(z.object({
72
+ label: StringBindingSchema,
73
+ value: z.string().describe('Stable identifier persisted to the data model.')
74
+ })).describe('Available options.'),
75
+ value: StringListDataBindingSchema.describe('Selected values. A string array, or { "path": "/pointer" } so the selection is written back. Read that path to see what was picked.'),
76
+ label: StringBindingSchema.optional().describe('Visible group label.'),
77
+ multiple: z.boolean().optional().describe('Allow more than one selection. Defaults to false. Ignored when style is "action".'),
78
+ style: z.enum(['select', 'action']).optional().describe('"select" (default) is a dropdown. "action" is a menu. Picking an item writes value and fires onChange.'),
79
+ placeholder: StringBindingSchema.optional(),
80
+ disabled: BooleanDynamicValueSchema.optional(),
81
+ invalid: BooleanDynamicValueSchema.optional(),
82
+ filterable: z.boolean().optional().describe('Show a search box in the dropdown. Defaults to true. Ignored when style is "action".'),
83
+ onChange: ActionSchema.optional().describe('Fired after the selection is written to value. It has no arguments. Read the value path to see the choice, or put context on the action, for example { "event": { "name": "picked", "context": { "from": "fruit-menu" } } }.')
84
+ });
@@ -14,7 +14,7 @@ import { AGENTIC_JIRA_CATALOG_ID } from '../agentic-jira-v0_9/catalog-id';
14
14
  import { ADS_CATALOG_COMPONENT_APIS } from '../v0_9/catalog-component-apis';
15
15
  import { ADS_CATALOG_ID } from '../v0_9/catalog-id';
16
16
  const COMMON_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents with a flat list of components. Each component needs a unique id and a component name from this catalog; reference children by id. Exactly one component must have the id "root". Use data bindings ({ "path": "/json/pointer" }) for values the user can change, and send updateDataModel to set initial values.';
17
- const FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains only ResultPanel and is not a superset of the ADS catalog. ResultPanel is a completed result: set id to "root", component to "ResultPanel", and provide title and summary as literal strings. summary keeps authored line breaks. Do not use data-binding path objects, updateDataModel, child component ids, or action props.';
17
+ const FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains ResultPanel and MultipleChoice. It is not a superset of the ADS catalog. ResultPanel is a completed result: set component to "ResultPanel" and provide title and summary as literal strings. summary keeps authored line breaks. Do not add actions, data-binding path objects, or child component ids to ResultPanel. MultipleChoice chooses one or more options. Set options to an array of { label, value }. Set value to a string array or a { "path": "/json/pointer" } binding; the renderer writes the selected values back to that path. style is "select" (default) or "action". Use updateDataModel to seed a bound MultipleChoice value. Do not invent other component names.';
18
18
  export const CATALOG_DEFINITIONS = [{
19
19
  catalogId: ADS_CATALOG_ID,
20
20
  slug: 'ads-v0_9',
@@ -34,7 +34,7 @@ export const CATALOG_DEFINITIONS = [{
34
34
  slug: 'agentic-forge-v0_9-v1',
35
35
  title: 'Atlassian Agentic Forge A2UI catalog',
36
36
  isPrivate: true,
37
- description: 'A dedicated Forge result surface. ResultPanel shows a completed result from a literal title and summary. It is not a superset of the ADS catalog.',
37
+ description: 'A dedicated Forge catalog. ResultPanel shows a completed result from a literal title and summary. MultipleChoice selects one or more options. It is not a superset of the ADS catalog.',
38
38
  instructions: FORGE_INSTRUCTIONS,
39
39
  components: AGENTIC_FORGE_CATALOG_COMPONENT_APIS
40
40
  }];
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable @atlaskit/volt-strict-mode/no-re-exports -- subpath entry point; re-exporting the implementation module is its purpose */
2
2
 
3
- export { ResultPanelApi } from '../agentic-forge-v0_9/apis';
3
+ export { MultipleChoiceApi, ResultPanelApi } from '../agentic-forge-v0_9/apis';
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable @atlaskit/volt-strict-mode/no-re-exports -- subpath entry point; re-exporting the implementation module is its purpose */
2
2
 
3
- export { ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
3
+ export { MultipleChoiceSchema, ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
@@ -8,7 +8,7 @@
8
8
 
9
9
  // Import from web_core (not @a2ui/react) so this package stays React-free.
10
10
 
11
- import { ResultPanelSchema } from './schemas';
11
+ import { MultipleChoiceSchema, ResultPanelSchema } from './schemas';
12
12
  /**
13
13
  * Tiny factory: pairs a catalog `name` with its `schema`. The `name`
14
14
  * parameter is restricted to the `AgenticForgeV09ComponentName` union — a
@@ -21,4 +21,5 @@ var apiOf = function apiOf(name, schema) {
21
21
  schema: schema
22
22
  };
23
23
  };
24
+ export var MultipleChoiceApi = apiOf('MultipleChoice', MultipleChoiceSchema);
24
25
  export var ResultPanelApi = apiOf('ResultPanel', ResultPanelSchema);
@@ -7,5 +7,5 @@
7
7
  * `catalog.json` is generated from this list.
8
8
  */
9
9
 
10
- import { ResultPanelApi } from './apis';
11
- export var AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [ResultPanelApi];
10
+ import { MultipleChoiceApi, ResultPanelApi } from './apis';
11
+ export var AGENTIC_FORGE_CATALOG_COMPONENT_APIS = [MultipleChoiceApi, ResultPanelApi];
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports -- Catalog schema file: one named `XxxSchema` export per component. Shared binding helpers stay co-located. */
2
+
1
3
  /**
2
4
  * Zod schemas for the Agentic Forge v0.9 catalog
3
5
  * (`com.atlassian.agentic-forge/v0_9/v1`).
@@ -5,10 +7,44 @@
5
7
  * `ResultPanel` is a completed result: a heading and a summary. Both values
6
8
  * are literals. There is no action prop. The host's tool-result envelope
7
9
  * (`text`, `ui`, `completed`) stays outside this schema.
10
+ *
11
+ * `MultipleChoice` is a copy of the ADS v0.9 `MultipleChoice` contract so a
12
+ * Forge surface can ask for a selection without loading the ADS catalog.
8
13
  */
9
14
 
10
15
  import { z } from 'zod';
11
16
 
17
+ /**
18
+ * Action shape mirrored from the ADS catalog. The adapter casts a resolved
19
+ * action to `() => void` at call time.
20
+ */
21
+ var ActionSchema = z.union([z.object({
22
+ event: z.object({
23
+ name: z.string(),
24
+ context: z.record(z.string(), z.unknown()).optional()
25
+ })
26
+ }), z.object({
27
+ functionCall: z.object({
28
+ call: z.string(),
29
+ args: z.record(z.string(), z.unknown()),
30
+ returnType: z.string().optional()
31
+ })
32
+ })]).describe('Action payload dispatched when the component is interacted with.');
33
+ var BooleanDynamicValueSchema = z.union([z.boolean(), z.object({
34
+ path: z.string()
35
+ })]).describe('A literal boolean OR a `{ path }` JSON-pointer binding into the surface data model.');
36
+ var StringBindingSchema = z.union([z.string(), z.object({
37
+ path: z.string()
38
+ })]).describe('A literal string OR a `{ path }` JSON-pointer binding into the surface data model.');
39
+
40
+ /**
41
+ * Wire-level shape for a value that resolves to `string[]`.
42
+ * Pass `{ path }` for two-way state.
43
+ */
44
+ var StringListDataBindingSchema = z.union([z.array(z.string()), z.object({
45
+ path: z.string()
46
+ })]).describe('JSON-pointer binding to a string array, or a literal `string[]`. Two-way bound for multi-select; the adapter writes the selected values back.');
47
+
12
48
  /**
13
49
  * Agentic Forge v0.9 `ResultPanel` schema.
14
50
  *
@@ -18,4 +54,31 @@ import { z } from 'zod';
18
54
  export var ResultPanelSchema = z.object({
19
55
  summary: z.string().min(1).describe('Result body. Line breaks are shown as authored.'),
20
56
  title: z.string().min(1).describe('Heading for the completed result.')
21
- }).strict();
57
+ }).strict();
58
+
59
+ /**
60
+ * Agentic Forge v0.9 `MultipleChoice` schema.
61
+ *
62
+ * Copied from the ADS v0.9 `MultipleChoice` contract (DSP-25085):
63
+ * - `style` omitted / `'select'`, `multiple: false` → single select
64
+ * - `style` omitted / `'select'`, `multiple: true` → multi select
65
+ * - `style: 'action'` → menu of actions
66
+ *
67
+ * `value` is always a string array, either as a literal or a `{ path }`
68
+ * binding. The adapter writes the selection back when `value` is bound.
69
+ */
70
+ export var MultipleChoiceSchema = z.object({
71
+ options: z.array(z.object({
72
+ label: StringBindingSchema,
73
+ value: z.string().describe('Stable identifier persisted to the data model.')
74
+ })).describe('Available options.'),
75
+ value: StringListDataBindingSchema.describe('Selected values. A string array, or { "path": "/pointer" } so the selection is written back. Read that path to see what was picked.'),
76
+ label: StringBindingSchema.optional().describe('Visible group label.'),
77
+ multiple: z.boolean().optional().describe('Allow more than one selection. Defaults to false. Ignored when style is "action".'),
78
+ style: z.enum(['select', 'action']).optional().describe('"select" (default) is a dropdown. "action" is a menu. Picking an item writes value and fires onChange.'),
79
+ placeholder: StringBindingSchema.optional(),
80
+ disabled: BooleanDynamicValueSchema.optional(),
81
+ invalid: BooleanDynamicValueSchema.optional(),
82
+ filterable: z.boolean().optional().describe('Show a search box in the dropdown. Defaults to true. Ignored when style is "action".'),
83
+ onChange: ActionSchema.optional().describe('Fired after the selection is written to value. It has no arguments. Read the value path to see the choice, or put context on the action, for example { "event": { "name": "picked", "context": { "from": "fruit-menu" } } }.')
84
+ });
@@ -14,7 +14,7 @@ import { AGENTIC_JIRA_CATALOG_ID } from '../agentic-jira-v0_9/catalog-id';
14
14
  import { ADS_CATALOG_COMPONENT_APIS } from '../v0_9/catalog-component-apis';
15
15
  import { ADS_CATALOG_ID } from '../v0_9/catalog-id';
16
16
  var COMMON_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents with a flat list of components. Each component needs a unique id and a component name from this catalog; reference children by id. Exactly one component must have the id "root". Use data bindings ({ "path": "/json/pointer" }) for values the user can change, and send updateDataModel to set initial values.';
17
- var FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains only ResultPanel and is not a superset of the ADS catalog. ResultPanel is a completed result: set id to "root", component to "ResultPanel", and provide title and summary as literal strings. summary keeps authored line breaks. Do not use data-binding path objects, updateDataModel, child component ids, or action props.';
17
+ var FORGE_INSTRUCTIONS = 'Send A2UI v0.9 messages, each with "version": "v0.9". Start with createSurface using this catalogId, then send updateComponents. This catalog contains ResultPanel and MultipleChoice. It is not a superset of the ADS catalog. ResultPanel is a completed result: set component to "ResultPanel" and provide title and summary as literal strings. summary keeps authored line breaks. Do not add actions, data-binding path objects, or child component ids to ResultPanel. MultipleChoice chooses one or more options. Set options to an array of { label, value }. Set value to a string array or a { "path": "/json/pointer" } binding; the renderer writes the selected values back to that path. style is "select" (default) or "action". Use updateDataModel to seed a bound MultipleChoice value. Do not invent other component names.';
18
18
  export var CATALOG_DEFINITIONS = [{
19
19
  catalogId: ADS_CATALOG_ID,
20
20
  slug: 'ads-v0_9',
@@ -34,7 +34,7 @@ export var CATALOG_DEFINITIONS = [{
34
34
  slug: 'agentic-forge-v0_9-v1',
35
35
  title: 'Atlassian Agentic Forge A2UI catalog',
36
36
  isPrivate: true,
37
- description: 'A dedicated Forge result surface. ResultPanel shows a completed result from a literal title and summary. It is not a superset of the ADS catalog.',
37
+ description: 'A dedicated Forge catalog. ResultPanel shows a completed result from a literal title and summary. MultipleChoice selects one or more options. It is not a superset of the ADS catalog.',
38
38
  instructions: FORGE_INSTRUCTIONS,
39
39
  components: AGENTIC_FORGE_CATALOG_COMPONENT_APIS
40
40
  }];
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable @atlaskit/volt-strict-mode/no-re-exports -- subpath entry point; re-exporting the implementation module is its purpose */
2
2
 
3
- export { ResultPanelApi } from '../agentic-forge-v0_9/apis';
3
+ export { MultipleChoiceApi, ResultPanelApi } from '../agentic-forge-v0_9/apis';
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable @atlaskit/volt-strict-mode/no-re-exports -- subpath entry point; re-exporting the implementation module is its purpose */
2
2
 
3
- export { ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
3
+ export { MultipleChoiceSchema, ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
@@ -4,5 +4,6 @@
4
4
  * `createComponentImplementation(api, RenderFn)`.
5
5
  */
6
6
  import type { ComponentApi } from '@a2ui/web_core/v0_9';
7
- import { ResultPanelSchema } from './schemas';
7
+ import { MultipleChoiceSchema, ResultPanelSchema } from './schemas';
8
+ export declare const MultipleChoiceApi: ComponentApi<typeof MultipleChoiceSchema>;
8
9
  export declare const ResultPanelApi: ComponentApi<typeof ResultPanelSchema>;
@@ -5,6 +5,9 @@
5
5
  * `ResultPanel` is a completed result: a heading and a summary. Both values
6
6
  * are literals. There is no action prop. The host's tool-result envelope
7
7
  * (`text`, `ui`, `completed`) stays outside this schema.
8
+ *
9
+ * `MultipleChoice` is a copy of the ADS v0.9 `MultipleChoice` contract so a
10
+ * Forge surface can ask for a selection without loading the ADS catalog.
8
11
  */
9
12
  import { z } from 'zod';
10
13
  /**
@@ -17,3 +20,29 @@ export declare const ResultPanelSchema: z.ZodObject<{
17
20
  summary: z.ZodString;
18
21
  title: z.ZodString;
19
22
  }, 'strict'>;
23
+ /**
24
+ * Agentic Forge v0.9 `MultipleChoice` schema.
25
+ *
26
+ * Copied from the ADS v0.9 `MultipleChoice` contract (DSP-25085):
27
+ * - `style` omitted / `'select'`, `multiple: false` → single select
28
+ * - `style` omitted / `'select'`, `multiple: true` → multi select
29
+ * - `style: 'action'` → menu of actions
30
+ *
31
+ * `value` is always a string array, either as a literal or a `{ path }`
32
+ * binding. The adapter writes the selection back when `value` is bound.
33
+ */
34
+ export declare const MultipleChoiceSchema: z.ZodObject<{
35
+ disabled: z.ZodOptional<z.ZodType>;
36
+ filterable: z.ZodOptional<z.ZodBoolean>;
37
+ invalid: z.ZodOptional<z.ZodType>;
38
+ label: z.ZodOptional<z.ZodType>;
39
+ multiple: z.ZodOptional<z.ZodBoolean>;
40
+ onChange: z.ZodOptional<z.ZodType>;
41
+ options: z.ZodArray<z.ZodObject<{
42
+ label: z.ZodType;
43
+ value: z.ZodString;
44
+ }>>;
45
+ placeholder: z.ZodOptional<z.ZodType>;
46
+ style: z.ZodOptional<z.ZodEnum<['select', 'action']>>;
47
+ value: z.ZodType;
48
+ }>;
@@ -3,21 +3,24 @@
3
3
  * (`com.atlassian.agentic-forge/v0_9/v1`).
4
4
  */
5
5
  import type { z } from 'zod';
6
- import type { ResultPanelSchema } from './schemas';
6
+ import type { MultipleChoiceSchema, ResultPanelSchema } from './schemas';
7
+ export type AgenticForgeV09MultipleChoiceProps = z.infer<typeof MultipleChoiceSchema>;
7
8
  export type AgenticForgeV09ResultPanelProps = z.infer<typeof ResultPanelSchema>;
8
9
  /**
9
10
  * One flat `updateComponents` entry for this catalog, the shape
10
11
  * `createSurface({ components })` accepts. `component` is the catalog name
11
12
  * and the remaining fields are that component's props.
12
13
  */
13
- export type AgenticForgeV09ComponentInstance = {
14
+ export type AgenticForgeV09ComponentInstance = ({
15
+ component: 'MultipleChoice';
16
+ id: string;
17
+ } & AgenticForgeV09MultipleChoiceProps) | {
14
18
  component: 'ResultPanel';
15
19
  id: string;
16
20
  summary: AgenticForgeV09ResultPanelProps['summary'];
17
21
  title: AgenticForgeV09ResultPanelProps['title'];
18
22
  };
19
23
  /**
20
- * Component names registered by this catalog. Further Forge UI components are
21
- * added as concrete needs arise.
24
+ * Component names registered by this catalog.
22
25
  */
23
- export type AgenticForgeV09ComponentName = 'ResultPanel';
26
+ export type AgenticForgeV09ComponentName = 'MultipleChoice' | 'ResultPanel';
@@ -1 +1 @@
1
- export { ResultPanelApi } from '../agentic-forge-v0_9/apis';
1
+ export { MultipleChoiceApi, ResultPanelApi } from '../agentic-forge-v0_9/apis';
@@ -1 +1 @@
1
- export { ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
1
+ export { MultipleChoiceSchema, ResultPanelSchema } from '../agentic-forge-v0_9/schemas';
@@ -1 +1 @@
1
- export type { AgenticForgeV09ResultPanelProps, AgenticForgeV09ComponentInstance, AgenticForgeV09ComponentName, } from '../agentic-forge-v0_9/types';
1
+ export type { AgenticForgeV09MultipleChoiceProps, AgenticForgeV09ResultPanelProps, AgenticForgeV09ComponentInstance, AgenticForgeV09ComponentName, } from '../agentic-forge-v0_9/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/a2ui-catalog",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "A2UI v0.9 catalog — Atlassian custom catalog (component APIs and Zod schemas) for the A2UI v0.9 protocol",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "atlassian": {