@assemblyline-agents/openui 5.0.10 → 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 +63 -61
- package/ai.assemblyline/index.ts +127 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -13
- package/dist/tools.js +29 -4
- package/dist/tools.js.map +1 -1
- package/package.json +5 -3
- package/plugin.json +11 -0
- package/skills/openui-artifacts/SKILL.md +2 -2
package/README.md
CHANGED
|
@@ -1,72 +1,74 @@
|
|
|
1
1
|
# @assemblyline-agents/openui
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
6
|
+
## Add the plugin
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
\`\`\`sh
|
|
8
|
+
```sh
|
|
10
9
|
assembly-line add openui agent
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
72
|
+
## License
|
|
71
73
|
|
|
72
|
-
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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"}
|