esap-aiui-react 1.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/LICENSE +21 -0
- package/README.md +1380 -0
- package/assets/architecture-diagram.png +0 -0
- package/dist/AIUIProvider.d.ts +58 -0
- package/dist/AIUIProvider.d.ts.map +1 -0
- package/dist/auuichat.d.ts +57 -0
- package/dist/auuichat.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +68 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export type ActionType = 'set_value' | 'click' | 'toggle' | 'navigate' | 'get_value';
|
|
2
|
+
export interface ActionResult {
|
|
3
|
+
success: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
data?: any;
|
|
6
|
+
}
|
|
7
|
+
export interface SetValueParams {
|
|
8
|
+
semantic: string;
|
|
9
|
+
value: string | number | boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ClickParams {
|
|
12
|
+
semantic: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ToggleParams {
|
|
15
|
+
semantic: string;
|
|
16
|
+
}
|
|
17
|
+
export interface NavigateParams {
|
|
18
|
+
route: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetValueParams {
|
|
21
|
+
semantic: string;
|
|
22
|
+
}
|
|
23
|
+
export type ActionParams = SetValueParams | ClickParams | ToggleParams | NavigateParams | GetValueParams;
|
|
24
|
+
export interface ContextUpdate {
|
|
25
|
+
timestamp: string;
|
|
26
|
+
page: PageContext | null;
|
|
27
|
+
elements: DiscoveredElementState[];
|
|
28
|
+
viewport: ViewportInfo;
|
|
29
|
+
}
|
|
30
|
+
export interface PageContext {
|
|
31
|
+
route: string;
|
|
32
|
+
title: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DiscoveredElementState {
|
|
35
|
+
selector: string;
|
|
36
|
+
semantic: string;
|
|
37
|
+
type: 'button' | 'input' | 'select' | 'link' | 'checkbox' | 'textarea' | 'other';
|
|
38
|
+
actions: string[];
|
|
39
|
+
attributes: Record<string, any>;
|
|
40
|
+
}
|
|
41
|
+
export interface ViewportInfo {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
scrollX: number;
|
|
45
|
+
scrollY: number;
|
|
46
|
+
}
|
|
47
|
+
export interface MCPMessage {
|
|
48
|
+
type: string;
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}
|
|
51
|
+
export interface ActionMessage extends MCPMessage {
|
|
52
|
+
type: 'action';
|
|
53
|
+
action: ActionType;
|
|
54
|
+
params: ActionParams;
|
|
55
|
+
action_id?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ContextUpdateMessage extends MCPMessage {
|
|
58
|
+
type: 'context_update';
|
|
59
|
+
context: ContextUpdate;
|
|
60
|
+
trigger?: 'initial_load' | 'navigation' | 'dom_change' | 'post_action' | string;
|
|
61
|
+
}
|
|
62
|
+
export interface ConfigMessage extends MCPMessage {
|
|
63
|
+
type: 'config';
|
|
64
|
+
config: any;
|
|
65
|
+
}
|
|
66
|
+
export interface ConnectedMessage extends MCPMessage {
|
|
67
|
+
type: 'connected';
|
|
68
|
+
session_id?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface DisconnectedMessage extends MCPMessage {
|
|
71
|
+
type: 'disconnected';
|
|
72
|
+
reason?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ErrorMessage extends MCPMessage {
|
|
75
|
+
type: 'error';
|
|
76
|
+
error: string;
|
|
77
|
+
code?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface AIUIHookReturn {
|
|
80
|
+
config: any;
|
|
81
|
+
isConnected: boolean;
|
|
82
|
+
isListening: boolean;
|
|
83
|
+
currentPage: string | null;
|
|
84
|
+
startListening: () => Promise<void>;
|
|
85
|
+
stopListening: () => void;
|
|
86
|
+
executeAction: (action: ActionType, params: ActionParams) => Promise<ActionResult>;
|
|
87
|
+
getComponentValue: (selector: string) => any;
|
|
88
|
+
registerComponent: (componentId: string, element: HTMLElement) => void;
|
|
89
|
+
unregisterComponent: (componentId: string) => void;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,UAAU,GAClB,WAAW,GACX,OAAO,GACP,QAAQ,GACR,UAAU,GACV,WAAW,CAAC;AAKhB,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAKD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC;AAGD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,WAAW,GACX,YAAY,GACZ,cAAc,GACd,cAAc,CAAC;AAQnB,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,QAAQ,EAAE,YAAY,CAAC;CACxB;AAGD,MAAM,WAAW,W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,UAAU;IACrD,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACnF,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7C,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACvE,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "esap-aiui-react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Zero-configuration voice and chat control for React applications through autonomous semantic UI discovery",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"assets",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rollup -c",
|
|
17
|
+
"dev": "rollup -c -w",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"clean": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\"",
|
|
20
|
+
"prebuild": "npm run clean",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"react",
|
|
25
|
+
"voice-control",
|
|
26
|
+
"chat-interface",
|
|
27
|
+
"ai",
|
|
28
|
+
"accessibility",
|
|
29
|
+
"natural-language",
|
|
30
|
+
"ui-automation",
|
|
31
|
+
"semantic-discovery",
|
|
32
|
+
"llm",
|
|
33
|
+
"conversational-ui",
|
|
34
|
+
"aiui",
|
|
35
|
+
"voice-assistant",
|
|
36
|
+
"chat-assistant"
|
|
37
|
+
],
|
|
38
|
+
"author": "ESPAI Team <support@espai.dev>",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/espai/aiui-react.git"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/espai/aiui-react/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/espai/aiui-react#readme",
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": ">=16.8.0",
|
|
50
|
+
"react-dom": ">=16.8.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
54
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
55
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
56
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
57
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
58
|
+
"@types/node": "^24.9.2",
|
|
59
|
+
"@types/react": "^18.2.43",
|
|
60
|
+
"@types/react-dom": "^18.2.17",
|
|
61
|
+
"react": "^18.2.0",
|
|
62
|
+
"react-dom": "^18.2.0",
|
|
63
|
+
"rollup": "^4.9.0",
|
|
64
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
65
|
+
"tslib": "^2.8.1",
|
|
66
|
+
"typescript": "^5.3.3"
|
|
67
|
+
}
|
|
68
|
+
}
|