@adonis-agora/agent 0.72.0 → 0.74.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/CHANGELOG.md +20 -0
- package/dist/configure.d.ts +5 -4
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +8 -4
- package/dist/configure.js.map +1 -1
- package/dist/providers/agent_provider.d.ts.map +1 -1
- package/dist/providers/agent_provider.js +5 -1
- package/dist/providers/agent_provider.js.map +1 -1
- package/dist/src/a2ui/adapter.d.ts.map +1 -1
- package/dist/src/a2ui/adapter.js +1 -0
- package/dist/src/a2ui/adapter.js.map +1 -1
- package/dist/src/a2ui/core.d.ts.map +1 -1
- package/dist/src/a2ui/core.js +11 -1
- package/dist/src/a2ui/core.js.map +1 -1
- package/dist/src/action-proposal-executor.d.ts.map +1 -1
- package/dist/src/action-proposal-executor.js +3 -0
- package/dist/src/action-proposal-executor.js.map +1 -1
- package/dist/src/ag-ui/adapter.d.ts.map +1 -1
- package/dist/src/ag-ui/adapter.js +2 -0
- package/dist/src/ag-ui/adapter.js.map +1 -1
- package/dist/src/ag-ui/core/encoder.d.ts.map +1 -1
- package/dist/src/ag-ui/core/encoder.js +3 -0
- package/dist/src/ag-ui/core/encoder.js.map +1 -1
- package/dist/src/agent-loop.d.ts.map +1 -1
- package/dist/src/agent-loop.js +18 -0
- package/dist/src/agent-loop.js.map +1 -1
- package/dist/src/agent-service.d.ts +6 -0
- package/dist/src/agent-service.d.ts.map +1 -1
- package/dist/src/agent-service.js +5 -3
- package/dist/src/agent-service.js.map +1 -1
- package/dist/src/channels/adapters/evolution_api.d.ts.map +1 -1
- package/dist/src/channels/adapters/evolution_api.js +35 -0
- package/dist/src/channels/adapters/evolution_api.js.map +1 -1
- package/dist/src/channels/adapters/telegram.d.ts.map +1 -1
- package/dist/src/channels/adapters/telegram.js +25 -7
- package/dist/src/channels/adapters/telegram.js.map +1 -1
- package/dist/src/channels/adapters/whatsapp_cloud.d.ts.map +1 -1
- package/dist/src/channels/adapters/whatsapp_cloud.js +44 -0
- package/dist/src/channels/adapters/whatsapp_cloud.js.map +1 -1
- package/dist/src/channels/handler.d.ts +21 -1
- package/dist/src/channels/handler.d.ts.map +1 -1
- package/dist/src/channels/handler.js +230 -9
- package/dist/src/channels/handler.js.map +1 -1
- package/dist/src/channels/index.d.ts +2 -2
- package/dist/src/channels/index.d.ts.map +1 -1
- package/dist/src/channels/index.js.map +1 -1
- package/dist/src/channels/types.d.ts +40 -0
- package/dist/src/channels/types.d.ts.map +1 -1
- package/dist/src/genui/catalog.d.ts +12 -1
- package/dist/src/genui/catalog.d.ts.map +1 -1
- package/dist/src/genui/catalog.js +12 -1
- package/dist/src/genui/catalog.js.map +1 -1
- package/dist/src/genui/channels.d.ts +206 -0
- package/dist/src/genui/channels.d.ts.map +1 -0
- package/dist/src/genui/channels.js +322 -0
- package/dist/src/genui/channels.js.map +1 -0
- package/dist/src/genui/chart-image.d.ts +46 -0
- package/dist/src/genui/chart-image.d.ts.map +1 -0
- package/dist/src/genui/chart-image.js +155 -0
- package/dist/src/genui/chart-image.js.map +1 -0
- package/dist/src/genui/factory.d.ts +23 -1
- package/dist/src/genui/factory.d.ts.map +1 -1
- package/dist/src/genui/factory.js +13 -1
- package/dist/src/genui/factory.js.map +1 -1
- package/dist/src/genui/index.d.ts.map +1 -1
- package/dist/src/genui/index.js +64 -3
- package/dist/src/genui/index.js.map +1 -1
- package/dist/src/genui/kit/adonis.d.ts +4 -0
- package/dist/src/genui/kit/adonis.d.ts.map +1 -0
- package/dist/src/genui/kit/adonis.js +38 -0
- package/dist/src/genui/kit/adonis.js.map +1 -0
- package/dist/src/genui/kit/bundle.d.ts +25 -0
- package/dist/src/genui/kit/bundle.d.ts.map +1 -0
- package/dist/src/genui/kit/bundle.js +144 -0
- package/dist/src/genui/kit/bundle.js.map +1 -0
- package/dist/src/genui/kit/discover.d.ts +41 -0
- package/dist/src/genui/kit/discover.d.ts.map +1 -0
- package/dist/src/genui/kit/discover.js +100 -0
- package/dist/src/genui/kit/discover.js.map +1 -0
- package/dist/src/genui/kit/docs.d.ts +22 -0
- package/dist/src/genui/kit/docs.d.ts.map +1 -0
- package/dist/src/genui/kit/docs.js +237 -0
- package/dist/src/genui/kit/docs.js.map +1 -0
- package/dist/src/genui/kit/files.d.ts +27 -0
- package/dist/src/genui/kit/files.d.ts.map +1 -0
- package/dist/src/genui/kit/files.js +126 -0
- package/dist/src/genui/kit/files.js.map +1 -0
- package/dist/src/genui/kit/index.d.ts +12 -0
- package/dist/src/genui/kit/index.d.ts.map +1 -0
- package/dist/src/genui/kit/index.js +12 -0
- package/dist/src/genui/kit/index.js.map +1 -0
- package/dist/src/genui/kit/plugin.d.ts +52 -0
- package/dist/src/genui/kit/plugin.d.ts.map +1 -0
- package/dist/src/genui/kit/plugin.js +314 -0
- package/dist/src/genui/kit/plugin.js.map +1 -0
- package/dist/src/genui/kit/write.d.ts +14 -0
- package/dist/src/genui/kit/write.d.ts.map +1 -0
- package/dist/src/genui/kit/write.js +39 -0
- package/dist/src/genui/kit/write.js.map +1 -0
- package/dist/src/genui/public.d.ts +7 -3
- package/dist/src/genui/public.d.ts.map +1 -1
- package/dist/src/genui/public.js +5 -1
- package/dist/src/genui/public.js.map +1 -1
- package/dist/src/genui/sandbox-jsx.d.ts +29 -0
- package/dist/src/genui/sandbox-jsx.d.ts.map +1 -0
- package/dist/src/genui/sandbox-jsx.js +656 -0
- package/dist/src/genui/sandbox-jsx.js.map +1 -0
- package/dist/src/genui/sandbox-kit.d.ts +88 -0
- package/dist/src/genui/sandbox-kit.d.ts.map +1 -0
- package/dist/src/genui/sandbox-kit.js +89 -0
- package/dist/src/genui/sandbox-kit.js.map +1 -0
- package/dist/src/genui/sandbox-theme.d.ts +61 -0
- package/dist/src/genui/sandbox-theme.d.ts.map +1 -0
- package/dist/src/genui/sandbox-theme.js +255 -0
- package/dist/src/genui/sandbox-theme.js.map +1 -0
- package/dist/src/genui/sandbox.d.ts +73 -2
- package/dist/src/genui/sandbox.d.ts.map +1 -1
- package/dist/src/genui/sandbox.js +87 -14
- package/dist/src/genui/sandbox.js.map +1 -1
- package/dist/src/genui/text.d.ts.map +1 -1
- package/dist/src/genui/text.js +33 -1
- package/dist/src/genui/text.js.map +1 -1
- package/dist/src/genui/tools.d.ts +26 -0
- package/dist/src/genui/tools.d.ts.map +1 -1
- package/dist/src/genui/tools.js +94 -14
- package/dist/src/genui/tools.js.map +1 -1
- package/dist/src/genui/tree.d.ts +25 -2
- package/dist/src/genui/tree.d.ts.map +1 -1
- package/dist/src/genui/tree.js +161 -4
- package/dist/src/genui/tree.js.map +1 -1
- package/dist/src/hooks/genui_kit.d.ts +20 -0
- package/dist/src/hooks/genui_kit.d.ts.map +1 -0
- package/dist/src/hooks/genui_kit.js +55 -0
- package/dist/src/hooks/genui_kit.js.map +1 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/react/core/genui/sandbox-assets.d.ts +32 -0
- package/dist/src/react/core/genui/sandbox-assets.d.ts.map +1 -0
- package/dist/src/react/core/genui/sandbox-assets.js +174 -0
- package/dist/src/react/core/genui/sandbox-assets.js.map +1 -0
- package/dist/src/react/core/genui/sandbox.d.ts +9 -0
- package/dist/src/react/core/genui/sandbox.d.ts.map +1 -1
- package/dist/src/react/core/genui/sandbox.js +115 -19
- package/dist/src/react/core/genui/sandbox.js.map +1 -1
- package/dist/src/react/core/index.d.ts +1 -1
- package/dist/src/react/core/index.d.ts.map +1 -1
- package/dist/src/react/core/index.js +1 -1
- package/dist/src/react/core/index.js.map +1 -1
- package/dist/src/react/core/presentation/phrasing.d.ts +3 -2
- package/dist/src/react/core/presentation/phrasing.d.ts.map +1 -1
- package/dist/src/react/core/presentation/phrasing.js +4 -27
- package/dist/src/react/core/presentation/phrasing.js.map +1 -1
- package/dist/src/react/core/presentation/tool-activity.d.ts +8 -0
- package/dist/src/react/core/presentation/tool-activity.d.ts.map +1 -1
- package/dist/src/react/core/presentation/tool-activity.js +28 -1
- package/dist/src/react/core/presentation/tool-activity.js.map +1 -1
- package/dist/src/react/core/transcript/model.d.ts +6 -0
- package/dist/src/react/core/transcript/model.d.ts.map +1 -1
- package/dist/src/react/core/transcript/model.js +6 -1
- package/dist/src/react/core/transcript/model.js.map +1 -1
- package/dist/src/react/core/transcript/use-chat-transcript.d.ts +5 -0
- package/dist/src/react/core/transcript/use-chat-transcript.d.ts.map +1 -1
- package/dist/src/react/core/transcript/use-chat-transcript.js +3 -0
- package/dist/src/react/core/transcript/use-chat-transcript.js.map +1 -1
- package/dist/src/spi/tool.d.ts +7 -0
- package/dist/src/spi/tool.d.ts.map +1 -1
- package/dist/src/tool-presentation.d.ts +15 -0
- package/dist/src/tool-presentation.d.ts.map +1 -1
- package/dist/src/tool-presentation.js +48 -0
- package/dist/src/tool-presentation.js.map +1 -1
- package/dist/src/tool-registry.d.ts.map +1 -1
- package/dist/src/tool-registry.js +2 -0
- package/dist/src/tool-registry.js.map +1 -1
- package/dist/src/types.d.ts +10 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/vite/index.d.ts +24 -0
- package/dist/src/vite/index.d.ts.map +1 -0
- package/dist/src/vite/index.js +29 -0
- package/dist/src/vite/index.js.map +1 -0
- package/package.json +38 -2
- package/skills/agent-setup/SKILL.md +3 -1
- package/skills/agent-tools/SKILL.md +5 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@adonis-agora/agent/vite` — `genuiSandboxKit()`, the Vite plugin that puts the app's design
|
|
3
|
+
* system (its components, its theme, Tailwind) inside the sandbox:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // vite.config.ts
|
|
7
|
+
* import { genuiSandboxKit } from '@adonis-agora/agent/vite'
|
|
8
|
+
* export default defineConfig({ plugins: [react(), adonisjs({ … }), genuiSandboxKit({ include: 'inertia/components/ui/*.tsx' })] })
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Then `genui({ sandbox: { kit: true, tailwind: true } })` in `config/agent.ts` finds the bundle and
|
|
12
|
+
* the docs through Vite (the dev server in dev, the manifest in production).
|
|
13
|
+
*/
|
|
14
|
+
import { type GenuiSandboxKitApi, type GenuiSandboxKitOptions, type GenuiSandboxKitPlugin, SANDBOX_KIT_DEV_PREFIX, SANDBOX_KIT_MANIFEST_KEYS, SANDBOX_KIT_UPDATE_EVENT } from '../genui/kit/plugin.js';
|
|
15
|
+
/** Where the dev descriptor is written in an Adonis app (`.adonisjs` is ignored by git already). */
|
|
16
|
+
export declare const ADONIS_SANDBOX_KIT_DESCRIPTOR = ".adonisjs/agent/genui_sandbox_kit.json";
|
|
17
|
+
/**
|
|
18
|
+
* The sandbox kit plugin. `entry` (a module exporting the kit) or `include` (a glob of component
|
|
19
|
+
* files); neither → the first `components/ui` folder (`inertia/components/ui`…). See
|
|
20
|
+
* {@link GenuiSandboxKitOptions}.
|
|
21
|
+
*/
|
|
22
|
+
export declare function genuiSandboxKit(options?: GenuiSandboxKitOptions): GenuiSandboxKitPlugin;
|
|
23
|
+
export { type GenuiSandboxKitApi, type GenuiSandboxKitOptions, type GenuiSandboxKitPlugin, SANDBOX_KIT_DEV_PREFIX, SANDBOX_KIT_MANIFEST_KEYS, SANDBOX_KIT_UPDATE_EVENT, };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,oGAAoG;AACpG,eAAO,MAAM,6BAA6B,2CAA2C,CAAC;AAEtF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,qBAAqB,CAK3F;AAED,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@adonis-agora/agent/vite` — `genuiSandboxKit()`, the Vite plugin that puts the app's design
|
|
3
|
+
* system (its components, its theme, Tailwind) inside the sandbox:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // vite.config.ts
|
|
7
|
+
* import { genuiSandboxKit } from '@adonis-agora/agent/vite'
|
|
8
|
+
* export default defineConfig({ plugins: [react(), adonisjs({ … }), genuiSandboxKit({ include: 'inertia/components/ui/*.tsx' })] })
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Then `genui({ sandbox: { kit: true, tailwind: true } })` in `config/agent.ts` finds the bundle and
|
|
12
|
+
* the docs through Vite (the dev server in dev, the manifest in production).
|
|
13
|
+
*/
|
|
14
|
+
import { createGenuiSandboxKitPlugin, SANDBOX_KIT_DEV_PREFIX, SANDBOX_KIT_MANIFEST_KEYS, SANDBOX_KIT_UPDATE_EVENT, } from '../genui/kit/plugin.js';
|
|
15
|
+
/** Where the dev descriptor is written in an Adonis app (`.adonisjs` is ignored by git already). */
|
|
16
|
+
export const ADONIS_SANDBOX_KIT_DESCRIPTOR = '.adonisjs/agent/genui_sandbox_kit.json';
|
|
17
|
+
/**
|
|
18
|
+
* The sandbox kit plugin. `entry` (a module exporting the kit) or `include` (a glob of component
|
|
19
|
+
* files); neither → the first `components/ui` folder (`inertia/components/ui`…). See
|
|
20
|
+
* {@link GenuiSandboxKitOptions}.
|
|
21
|
+
*/
|
|
22
|
+
export function genuiSandboxKit(options = {}) {
|
|
23
|
+
return createGenuiSandboxKitPlugin(options, {
|
|
24
|
+
descriptor: ADONIS_SANDBOX_KIT_DESCRIPTOR,
|
|
25
|
+
rendererImport: /@adonis-agora\/agent\/react/,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { SANDBOX_KIT_DEV_PREFIX, SANDBOX_KIT_MANIFEST_KEYS, SANDBOX_KIT_UPDATE_EVENT, };
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,2BAA2B,EAI3B,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,oGAAoG;AACpG,MAAM,CAAC,MAAM,6BAA6B,GAAG,wCAAwC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAO,GAA2B,EAAE;IAClE,OAAO,2BAA2B,CAAC,OAAO,EAAE;QAC1C,UAAU,EAAE,6BAA6B;QACzC,cAAc,EAAE,6BAA6B;KAC9C,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAIL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,GACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.74.0",
|
|
4
4
|
"description": "Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -168,6 +168,11 @@
|
|
|
168
168
|
"import": "./dist/src/hooks/tools.js",
|
|
169
169
|
"default": "./dist/src/hooks/tools.js"
|
|
170
170
|
},
|
|
171
|
+
"./hooks/genui_kit": {
|
|
172
|
+
"types": "./dist/src/hooks/genui_kit.d.ts",
|
|
173
|
+
"import": "./dist/src/hooks/genui_kit.js",
|
|
174
|
+
"default": "./dist/src/hooks/genui_kit.js"
|
|
175
|
+
},
|
|
171
176
|
"./telescope": {
|
|
172
177
|
"types": "./dist/src/telescope/index.d.ts",
|
|
173
178
|
"import": "./dist/src/telescope/index.js",
|
|
@@ -213,6 +218,21 @@
|
|
|
213
218
|
"import": "./dist/src/genui/builtins.js",
|
|
214
219
|
"default": "./dist/src/genui/builtins.js"
|
|
215
220
|
},
|
|
221
|
+
"./genui/chart-image": {
|
|
222
|
+
"types": "./dist/src/genui/chart-image.d.ts",
|
|
223
|
+
"import": "./dist/src/genui/chart-image.js",
|
|
224
|
+
"default": "./dist/src/genui/chart-image.js"
|
|
225
|
+
},
|
|
226
|
+
"./genui/kit": {
|
|
227
|
+
"types": "./dist/src/genui/kit/index.d.ts",
|
|
228
|
+
"import": "./dist/src/genui/kit/index.js",
|
|
229
|
+
"default": "./dist/src/genui/kit/index.js"
|
|
230
|
+
},
|
|
231
|
+
"./vite": {
|
|
232
|
+
"types": "./dist/src/vite/index.d.ts",
|
|
233
|
+
"import": "./dist/src/vite/index.js",
|
|
234
|
+
"default": "./dist/src/vite/index.js"
|
|
235
|
+
},
|
|
216
236
|
"./media": {
|
|
217
237
|
"types": "./dist/src/media/index.d.ts",
|
|
218
238
|
"import": "./dist/src/media/index.js",
|
|
@@ -239,7 +259,8 @@
|
|
|
239
259
|
"sideEffects": false,
|
|
240
260
|
"dependencies": {
|
|
241
261
|
"@modelcontextprotocol/sdk": "1.31.0",
|
|
242
|
-
"@standard-schema/spec": "1.1.0"
|
|
262
|
+
"@standard-schema/spec": "1.1.0",
|
|
263
|
+
"@tailwindcss/browser": "4.3.3"
|
|
243
264
|
},
|
|
244
265
|
"peerDependencies": {
|
|
245
266
|
"@adonis-agora/authz": ">=0.4.2 <1.0.0",
|
|
@@ -254,6 +275,7 @@
|
|
|
254
275
|
"@ai-sdk/react": "^4.0.0",
|
|
255
276
|
"@json-render/react": ">=0.21.0 <1.0.0",
|
|
256
277
|
"@qdrant/js-client-rest": "^1.11.0",
|
|
278
|
+
"@resvg/resvg-js": "^2.6.0",
|
|
257
279
|
"@streamdown/code": "^1.1.1",
|
|
258
280
|
"@streamdown/math": "^1.0.2",
|
|
259
281
|
"@streamdown/mermaid": "^1.0.2",
|
|
@@ -270,7 +292,9 @@
|
|
|
270
292
|
"remark-gfm": "^4.0.1",
|
|
271
293
|
"remark-math": "^6.0.0",
|
|
272
294
|
"streamdown": "^2.5.0",
|
|
295
|
+
"typescript": ">=5",
|
|
273
296
|
"unist-util-visit": "^5.1.0",
|
|
297
|
+
"vite": ">=5",
|
|
274
298
|
"zod": "^4.0.0"
|
|
275
299
|
},
|
|
276
300
|
"peerDependenciesMeta": {
|
|
@@ -363,6 +387,15 @@
|
|
|
363
387
|
},
|
|
364
388
|
"playwright-core": {
|
|
365
389
|
"optional": true
|
|
390
|
+
},
|
|
391
|
+
"@resvg/resvg-js": {
|
|
392
|
+
"optional": true
|
|
393
|
+
},
|
|
394
|
+
"vite": {
|
|
395
|
+
"optional": true
|
|
396
|
+
},
|
|
397
|
+
"typescript": {
|
|
398
|
+
"optional": true
|
|
366
399
|
}
|
|
367
400
|
},
|
|
368
401
|
"devDependencies": {
|
|
@@ -383,6 +416,7 @@
|
|
|
383
416
|
"@json-render/react": "0.21.0",
|
|
384
417
|
"@opencode/client": "2.0.18",
|
|
385
418
|
"@qdrant/js-client-rest": "1.19.0",
|
|
419
|
+
"@resvg/resvg-js": "^2.6.2",
|
|
386
420
|
"@streamdown/code": "1.1.1",
|
|
387
421
|
"@streamdown/math": "1.0.3",
|
|
388
422
|
"@streamdown/mermaid": "1.0.3",
|
|
@@ -420,7 +454,9 @@
|
|
|
420
454
|
"streamdown": "2.6.0",
|
|
421
455
|
"testcontainers": "12.2.0",
|
|
422
456
|
"typescript": "7.0.2",
|
|
457
|
+
"typescript5": "npm:typescript@5.9.3",
|
|
423
458
|
"unist-util-visit": "5.1.0",
|
|
459
|
+
"vite": "8.3.2",
|
|
424
460
|
"vitest": "5.0.3",
|
|
425
461
|
"zod": "4.6.5"
|
|
426
462
|
},
|
|
@@ -330,12 +330,14 @@ Agora owns its catalog (`@adonis-agora/agent/genui`), browser rendering
|
|
|
330
330
|
(`@adonis-agora/agent/react/media`). Protocol compatibility does not require installing
|
|
331
331
|
Aviary packages.
|
|
332
332
|
|
|
333
|
-
`genui({ catalog })` in `config/agent.ts` registers
|
|
333
|
+
`genui({ catalog })` in `config/agent.ts` registers a model tool, `ui__render`, taking a
|
|
334
334
|
component tree (`{ type, props, children? }`; a single node is a valid tree and is pushed as
|
|
335
335
|
that component). Its input schema is exact per component. Put `LAYOUT_COMPONENTS` (`Stack`,
|
|
336
336
|
`Card`, …) in the catalog next to `BUILTIN_COMPONENTS` and register a React renderer for each
|
|
337
337
|
layout you use. `mode: 'per-component'` instead registers one `ui__show_<component>` tool per
|
|
338
338
|
standalone component — for small models or when each tool should carry its own exact schema.
|
|
339
|
+
In tree mode, `componentTools: ['Sandbox']` also registers a flat `ui__sandbox` tool per named
|
|
340
|
+
standalone component whose input IS that component's props (prefix `componentToolPrefix`, default `ui__`).
|
|
339
341
|
`streaming: 'partial'` draws the tree while the model writes it; renderers then read
|
|
340
342
|
`useGenuiNode()?.incomplete` and must tolerate half-written props. Source:
|
|
341
343
|
`packages/adonis/docs/generative-ui.mdx`.
|
|
@@ -241,13 +241,15 @@ export const listRecords = defineTool({
|
|
|
241
241
|
`table` and `chart` present the builtin `DataTable` and `Chart` definitions: put them in the
|
|
242
242
|
genui catalog (`BUILTIN_COMPONENTS` from `@adonis-agora/agent/genui/builtins`, or the two
|
|
243
243
|
definitions) and register app renderers under those names. Builtins carry no visuals.
|
|
244
|
-
`genui({ catalog })` also offers the model
|
|
245
|
-
default mode; `mode: 'per-component'` gives `ui__show_*` tools instead).
|
|
244
|
+
`genui({ catalog })` also offers the model a `ui__render` tree tool over that catalog (the
|
|
245
|
+
default mode; `mode: 'per-component'` gives `ui__show_*` tools instead). In tree mode,
|
|
246
|
+
`componentTools: ['Sandbox']` also registers a flat `ui__sandbox` tool per named standalone
|
|
247
|
+
component whose input IS that component's props (prefix `componentToolPrefix`, default `ui__`).
|
|
246
248
|
A tool that knows its component before it reads can push a skeleton first: `ctx.emitUi(name,
|
|
247
249
|
{ state: 'loading', … })`, then the data with `{ id }` from that push (the component's props
|
|
248
250
|
schema must accept the placeholder variant; mark it `internal: true`). Always end on that id
|
|
249
251
|
(data, `empty` or `error`), and only push the skeleton when the component is declared in
|
|
250
|
-
`ctx.uiCapabilities` and `ctx.
|
|
252
|
+
`ctx.uiCapabilities` and the turn's channel (`ctx.channel`) is not a messaging channel. A tool that throws persists none
|
|
251
253
|
of its pushes. See `packages/adonis/docs/genui-loading-states.mdx`.
|
|
252
254
|
Use `createComponent` for custom definitions and one `createComponentRegistry` per app
|
|
253
255
|
or tenant. Input `props` may transform; if the transform changes shape or is not
|