@assemblyline-agents/openui 5.0.9 → 6.0.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 CHANGED
@@ -1,72 +1,74 @@
1
1
  # @assemblyline-agents/openui
2
2
 
3
- Reusable Assembly Line lifecycle tools backed by the official OpenUI runtime.
3
+ Official OpenUI artifact plugin. It contributes a reviewed operating Skill and
4
+ three tools: `openui_create`, `openui_update`, and `openui_publish`.
4
5
 
5
- The default component pack is the complete 54-component \`@openuidev/react-ui\` standard library. Developers can allow every component, restrict it by name, or register an independently versioned component pack. The model supplies only OpenUI Lang and a title. It never supplies publication HTML, CSS, or JavaScript.
6
+ ## Add the plugin
6
7
 
7
- ## Add the pack
8
-
9
- \`\`\`sh
8
+ ```sh
10
9
  assembly-line add openui agent
11
- \`\`\`
12
-
13
- This creates \`tool-config/openui.ts\`, three tool wrappers, and the OpenUI operating skill. Configure \`R2_PUBLIC_BASE_URL\` or \`S3_PUBLIC_BASE_URL\` with an HTTPS origin before publishing.
14
-
15
- The generated configuration uses the official standard pack with every component enabled. Restrict and theme it explicitly when needed:
16
-
17
- \`\`\`ts
18
- import { defineOpenUiConfig } from "@assemblyline-agents/openui";
19
-
20
- export default defineOpenUiConfig({
21
- allowedComponents: ["Stack", "Card", "CardHeader", "TextContent", "Table", "Col"],
22
- brand: {
23
- name: "Example",
24
- theme: {
25
- background: "#F7F7F5",
26
- textBrand: "#1F2937",
27
- fontHeading: "Georgia, serif",
28
- fontBody: "Arial, sans-serif"
29
- }
30
- }
31
- });
32
- \`\`\`
33
-
34
- The tool's \`document\` schema is generated from the selected pack and allowlist, so agents see the permitted component signatures rather than a framework-owned report vocabulary. Artifact titles are lifecycle metadata and do not force a particular root component.
35
-
36
- The standard renderer keeps desktop row compositions intact and automatically wraps row \`Stack\` layouts on narrow screens. Metric cards and callouts use a readable minimum width, yielding two columns when the container can support them and one column when it cannot. The document itself cannot scroll sideways; wide tables and Cartesian charts retain component-local scrolling, while pie, radial, and radar compositions wrap within the viewport. Mobile table text stays at the reviewed size instead of being enlarged by browser text autosizing.
10
+ ```
11
+
12
+ The command selects `openui` in `agent.md` and updates `plugins.lock`. It does
13
+ not create root tool wrappers or a `tool-config/` directory.
14
+
15
+ Publishing requires `R2_PUBLIC_BASE_URL` or `S3_PUBLIC_BASE_URL` to be an HTTPS
16
+ origin. The official plugin always exposes the complete standard OpenUI
17
+ component library. Configure its brand and theme declaratively in `agent.md`:
18
+
19
+ ```yaml
20
+ capabilities:
21
+ openui:
22
+ config:
23
+ brand:
24
+ name: Example
25
+ legalName: Example, Inc.
26
+ theme:
27
+ background: "#F7F7F5"
28
+ foreground: "#FFFFFF"
29
+ textBrand: "#1F2937"
30
+ textAccentPrimary: "#2563EB"
31
+ borderDefault: "#E5E7EB"
32
+ borderAccent: "#2563EB"
33
+ fontHeading: '"Cormorant Garamond", Georgia, serif'
34
+ fontBody: '"Outfit", Arial, sans-serif'
35
+ footer: Example | Confidential
36
+ ```
37
+
38
+ `brand` accepts `name`, `legalName`, OpenUI `theme` tokens, an optional data-URI
39
+ `logo`, and `footer`. The package owns the component library and trusted
40
+ renderer; agent configuration cannot provide executable rendering code.
41
+
42
+ Change only supported authority exceptions. For example, keep creation and
43
+ editing but remove publication:
44
+
45
+ ```yaml
46
+ capabilities:
47
+ openui:
48
+ tools:
49
+ disable: [openui_publish]
50
+ ```
51
+
52
+ To change the component pack or trusted renderer, publish a reviewed plugin
53
+ implementation that uses this package's TypeScript APIs. Those changes are
54
+ executable plugin policy, not agent configuration.
37
55
 
38
- ## Component packs
39
-
40
- A component pack combines an OpenUI library, an immutable identity and version, and trusted publication code:
41
-
42
- \`\`\`ts
43
- import {
44
- createOpenUiLibrary,
45
- defineOpenUiConfig,
46
- type OpenUiComponentPack
47
- } from "@assemblyline-agents/openui";
48
-
49
- const pack: OpenUiComponentPack = {
50
- id: "@example/product-ui",
51
- version: "3.1.0",
52
- library: createOpenUiLibrary({
53
- root: "ProductPage",
54
- components: [ProductPage, Metric, Chart]
55
- }),
56
- render({ source, title, config }) {
57
- return renderReviewedProductUi({ source, title, theme: config.brand.theme });
58
- }
59
- };
60
-
61
- export default defineOpenUiConfig({ componentPack: pack });
62
- \`\`\`
56
+ ## Lifecycle and security
63
57
 
64
- Pack renderers execute as trusted application code. Review and version them like any other plugin. Project content may select installed packs, but it must not load arbitrary repository code into the runtime.
58
+ Artifacts use immutable revisions. Publication renders the selected revision,
59
+ verifies the stored bytes, and gives the channel the exact HTTPS URL. The
60
+ model never supplies HTML, CSS, JavaScript, or the final delivery URL.
65
61
 
66
- ## Lifecycle and security
62
+ `openui_create.document` and `openui_update.document` accept either inline
63
+ OpenUI Lang or an exact `@/workspace/<file>` reference. Workspace references
64
+ are resolved through the current run's sandbox, remain confined below
65
+ `/workspace`, and are subject to the same document-size and parser policy as
66
+ inline input. This keeps large generated reports out of tool-call payloads.
67
67
 
68
- \`openui_create\` and \`openui_update\` store private immutable revisions with the exact pack version, allowlist, theme, and provenance. \`openui_publish\` renders the selected revision without an approval pause, verifies the bytes served by storage, and selects that exact HTTPS URL for runtime delivery. Its model-facing result omits the URL, so the channel does not depend on the model copying a link.
68
+ The official renderer runs with a network-disabled content security policy.
69
+ Published links are unlisted bearer links; use channel file delivery when an
70
+ artifact must remain private.
69
71
 
70
- The official renderer embeds OpenUI's reviewed browser runtime and styles in a network-disabled CSP. Agent content cannot add scripts, styles, external requests, queries, or mutations. Local OpenUI state and actions are disabled by default and can be enabled by the developer. Tightening the current allowlist or interactivity policy also blocks publication of older revisions that exceed it.
72
+ ## License
71
73
 
72
- Published links are unlisted bearer links. Use the built-in \`deliver_artifact\` tool instead when the artifact must remain a private channel file.
74
+ MIT
@@ -0,0 +1,127 @@
1
+ /** Static Agent Plugins v1 descriptor. Runtime factories use the package's public export. */
2
+ export const configSchema = {
3
+ type: "object",
4
+ properties: {
5
+ brand: {
6
+ type: "object",
7
+ properties: {
8
+ name: { type: "string", minLength: 1, maxLength: 120 },
9
+ legalName: { type: "string", minLength: 1, maxLength: 160 },
10
+ theme: {
11
+ type: "object",
12
+ maxProperties: 200,
13
+ additionalProperties: {
14
+ anyOf: [
15
+ { type: "string", minLength: 1, maxLength: 1000 },
16
+ {
17
+ type: "array",
18
+ maxItems: 32,
19
+ items: { type: "string", minLength: 1, maxLength: 1000 }
20
+ }
21
+ ]
22
+ }
23
+ },
24
+ logo: {
25
+ type: "object",
26
+ properties: {
27
+ dataUri: { type: "string", pattern: "^data:image/" },
28
+ alt: { type: "string", minLength: 1, maxLength: 200 }
29
+ },
30
+ required: ["dataUri", "alt"],
31
+ additionalProperties: false
32
+ },
33
+ footer: { type: "string", minLength: 1, maxLength: 240 }
34
+ },
35
+ additionalProperties: false
36
+ }
37
+ },
38
+ additionalProperties: false
39
+ };
40
+
41
+ export const tools = {
42
+ openui_create: {
43
+ definition: "@assemblyline-agents/openui",
44
+ factory: "defineOpenUiCreateTool",
45
+ description: "Create an immutable artifact revision from developer-approved OpenUI components. Raw HTML is not accepted.",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {
49
+ title: { type: "string", minLength: 1, maxLength: 240 },
50
+ document: { type: "string" }
51
+ },
52
+ required: ["title", "document"],
53
+ additionalProperties: false
54
+ },
55
+ outputSchema: {
56
+ type: "object",
57
+ properties: {
58
+ artifactId: { type: "string" },
59
+ revision: { type: "string" },
60
+ parentRevision: { type: "string" },
61
+ title: { type: "string" },
62
+ status: { type: "string", enum: ["draft"] }
63
+ },
64
+ required: ["artifactId", "revision", "title", "status"]
65
+ },
66
+ needsApproval: false,
67
+ capability: { visibility: "always", execution: "direct", namespace: "openui", tags: ["artifacts", "ui"] }
68
+ },
69
+ openui_update: {
70
+ definition: "@assemblyline-agents/openui",
71
+ factory: "defineOpenUiUpdateTool",
72
+ description: "Create a new immutable revision of an existing OpenUI artifact. Raw HTML is not accepted.",
73
+ inputSchema: {
74
+ type: "object",
75
+ properties: {
76
+ artifactId: { type: "string", pattern: "^oui_[a-f0-9]{24}$" },
77
+ revision: { type: "string", pattern: "^[a-f0-9]{64}$", description: "The immutable parent revision to update." },
78
+ title: { type: "string", minLength: 1, maxLength: 240 },
79
+ document: { type: "string" }
80
+ },
81
+ required: ["artifactId", "revision", "title", "document"],
82
+ additionalProperties: false
83
+ },
84
+ outputSchema: {
85
+ type: "object",
86
+ properties: {
87
+ artifactId: { type: "string" },
88
+ revision: { type: "string" },
89
+ parentRevision: { type: "string" },
90
+ title: { type: "string" },
91
+ status: { type: "string", enum: ["draft"] }
92
+ },
93
+ required: ["artifactId", "revision", "title", "status"]
94
+ },
95
+ needsApproval: false,
96
+ capability: { visibility: "always", execution: "direct", namespace: "openui", tags: ["artifacts", "ui"] }
97
+ },
98
+ openui_publish: {
99
+ definition: "@assemblyline-agents/openui",
100
+ factory: "defineOpenUiPublishTool",
101
+ description: "Publish one OpenUI artifact revision to an unlisted, storage-issued HTTPS link.",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: {
105
+ artifactId: { type: "string", pattern: "^oui_[a-f0-9]{24}$" },
106
+ revision: { type: "string", pattern: "^[a-f0-9]{64}$" }
107
+ },
108
+ required: ["artifactId", "revision"],
109
+ additionalProperties: false
110
+ },
111
+ outputSchema: {
112
+ type: "object",
113
+ properties: {
114
+ artifactId: { type: "string" },
115
+ revision: { type: "string" },
116
+ title: { type: "string" },
117
+ url: { type: "string", format: "uri" },
118
+ visibility: { type: "string", enum: ["unlisted"] }
119
+ },
120
+ required: ["artifactId", "revision", "title", "url", "visibility"]
121
+ },
122
+ needsApproval: false,
123
+ capability: { visibility: "always", execution: "direct", namespace: "openui", tags: ["artifacts", "ui", "publish"] }
124
+ }
125
+ };
126
+
127
+ export default { configSchema, tools };
package/dist/index.d.ts CHANGED
@@ -6,5 +6,4 @@ export { openUiGenerationPrompt, parseOpenUiDocument, type ParsedOpenUiDocument
6
6
  export { renderOpenUiArtifact } from "./render.js";
7
7
  export { OPENUI_COMPONENT_NAMES, openUiStandardComponentPack } from "./standard-pack.js";
8
8
  export { defineOpenUiCreateTool, defineOpenUiPublishTool, defineOpenUiUpdateTool } from "./tools.js";
9
- export declare const assemblyLinePlugin: import("@assemblyline-agents/core").PluginModule;
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,eAAe,IAAI,qBAAqB,EACzC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,cAAc,IAAI,oBAAoB,EACtC,gBAAgB,IAAI,sBAAsB,EAC1C,OAAO,IAAI,aAAa,EACxB,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,kBAAkB,kDAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,eAAe,IAAI,qBAAqB,EACzC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,cAAc,IAAI,oBAAoB,EACtC,gBAAgB,IAAI,sBAAsB,EAC1C,OAAO,IAAI,aAAa,EACxB,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,YAAY,CAAC"}