@aginies/embed 0.2.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.
@@ -0,0 +1,30 @@
1
+ import { ApprovalPanelProps, ChatWidgetProps, AginiesConfig, AginiesClient } from '@aginies/webuikit';
2
+
3
+ declare const version = "0.1.0";
4
+ /** Creates the shared client and starts the activation handshake. Call once per page. */
5
+ declare function init(config: AginiesConfig): AginiesClient;
6
+ interface ChatOptions extends ChatWidgetProps {
7
+ /** Where to mount for `inline` / `full`: a selector or element. Bubble mode makes its own root. */
8
+ container?: string | HTMLElement;
9
+ }
10
+ interface ApprovalOptions extends ApprovalPanelProps {
11
+ /** Where to mount: a selector or element. Defaults to a new element at the end of `<body>`. */
12
+ container?: string | HTMLElement;
13
+ }
14
+ interface MountHandle {
15
+ unmount: () => void;
16
+ element: HTMLElement;
17
+ }
18
+ /** Mounts a chat widget. Requires `init()` first. */
19
+ declare function chat(options: ChatOptions): MountHandle;
20
+ /** Mounts an approval panel for a paused run. Requires `init()` first. */
21
+ declare function approval(options: ApprovalOptions): MountHandle;
22
+ /**
23
+ * Reads `data-*` attributes off the script tag and mounts without any code:
24
+ * `data-base-url`, `data-token`, `data-chat`, `data-mode`, `data-position`, `data-locale`,
25
+ * `data-theme`, `data-label`; or `data-approval="workflowId/executionId[/contextId]"` for an
26
+ * approval panel.
27
+ */
28
+ declare function autoload(script?: HTMLScriptElement | null): MountHandle | null;
29
+
30
+ export { type ApprovalOptions, type ChatOptions, type MountHandle, approval, autoload, chat, init, version };
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@aginies/embed",
3
+ "version": "0.2.0",
4
+ "description": "Single-file script that embeds Aginies agents into any website with one tag",
5
+ "license": "MIT",
6
+ "author": "Abra Partners",
7
+ "homepage": "https://www.aginies.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/abrapartners/agiwebuikit.git",
11
+ "directory": "packages/embed"
12
+ },
13
+ "keywords": [
14
+ "aginies",
15
+ "embed",
16
+ "chat-widget",
17
+ "script-tag",
18
+ "agents"
19
+ ],
20
+ "type": "module",
21
+ "main": "./dist/aginies.js",
22
+ "unpkg": "./dist/aginies.js",
23
+ "jsdelivr": "./dist/aginies.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/aginies.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsup",
37
+ "type-check": "tsc --noEmit",
38
+ "test": "vitest run"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@aginies/webuikit": "0.1.0",
45
+ "preact": "^10.29.8"
46
+ },
47
+ "devDependencies": {
48
+ "@testing-library/react": "^16.3.0",
49
+ "@types/react": "^19.1.0",
50
+ "@types/react-dom": "^19.1.0",
51
+ "jsdom": "^26.1.0",
52
+ "react": "^19.1.0",
53
+ "react-dom": "^19.1.0"
54
+ }
55
+ }