@webless/agent 0.2.0 → 0.2.7

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,121 +1,37 @@
1
- # `@webless/agent`
1
+ # @webless/agent
2
2
 
3
- Webless Agent SDK Eve runtime client, React UI, embed mount API, and IIFE bundle builder.
3
+ Webless Agent — AI assist for your site.
4
4
 
5
- ## Install
5
+ ## Get started
6
6
 
7
- ```bash
8
- npm install @webless/agent eve react react-dom
9
- ```
10
-
11
- `react` and `react-dom` are required for `@webless/agent/react` and `@webless/agent/embed`.
12
-
13
- ## Headless client
14
-
15
- ```ts
16
- import { createAgentClient, pingAgentHealth } from "@webless/agent";
17
-
18
- const health = await pingAgentHealth("https://runtime.staging.webless.ai");
19
- console.log(health.ok ? "ready" : health.detail);
20
-
21
- const agent = createAgentClient({
22
- indexId: "YOUR_PUBLISHED_INDEX_ID",
23
- runtimeOrigin: "https://runtime.staging.webless.ai",
24
- });
25
-
26
- const reply = await agent.sendTurn("What can you help me with?", {
27
- handlers: {
28
- onDelta: (delta) => process.stdout.write(delta),
29
- },
30
- });
31
- ```
32
-
33
- ## React UI
34
-
35
- ```tsx
36
- import { AgentRail, useAgentChat } from "@webless/agent/react";
37
- import "@webless/agent/react.css";
38
-
39
- function AssistPanel({ indexId }: { indexId: string }) {
40
- const { state, submit } = useAgentChat({ indexId });
41
-
42
- return (
43
- <AgentRail
44
- state={state}
45
- onSubmit={(message) => void submit(message)}
46
- onFollowUpSelect={(label) => void submit(label)}
47
- />
48
- );
49
- }
50
- ```
51
-
52
- ## Embed API (programmatic mount)
53
-
54
- ```ts
55
- import { mountAgent, unmountAgent } from "@webless/agent/embed";
56
-
57
- const handle = mountAgent({
58
- manifest: {
59
- customerId: "cust_123",
60
- indexId: "idx_abc",
61
- runtimeOrigin: "https://runtime.staging.webless.ai",
62
- placement: { side: "right", along: 50, inset: 0, variant: "outline" },
63
- },
64
- });
65
-
66
- handle.open();
67
- handle.close();
68
- handle.unmount();
69
- // or unmountAgent("cust_123");
70
- ```
7
+ 1. Sign up at [app.webless.ai](https://app.webless.ai)
8
+ 2. Create and publish an index
9
+ 3. Open **Agent Studio** for that index
10
+ 4. Build a preview bundle, then copy the **install snippet**
11
+ 5. Paste the snippet into your site HTML
71
12
 
72
- v1 defaults to a right-side edge tab + collapsible rail (Agent Studio tokens).
13
+ That is the full integration. Webless builds and hosts the agent script for you.
73
14
 
74
- ## Customer IIFE bundle (`agent.js`)
75
-
76
- Build a copy-paste script bundle with manifest baked in:
77
-
78
- ```bash
79
- cd packages/agent
80
- npm run build:bundle -- \
81
- --manifest examples/agent.manifest.json \
82
- --customer-id demo_customer \
83
- --out-dir dist/bundles
84
- ```
85
-
86
- Output: `dist/bundles/agent.js` exposing `window.WeblessAgent`:
15
+ The snippet is a single script tag, for example:
87
16
 
88
17
  ```html
89
- <script src="https://agents.webless.ai/demo_customer/agent.js" async></script>
90
- <script>
91
- window.WeblessAgent?.open();
92
- </script>
18
+ <script defer src=""></script>
93
19
  ```
94
20
 
95
- ## Runtime endpoints
21
+ The exact URL is generated in the console when you build your bundle.
96
22
 
97
- | Operation | Request |
98
- |-----------|---------|
99
- | Health | `GET /eve/v1/health` |
100
- | Start session | `POST /eve/v1/session?indexId=<index-id>` |
101
- | Continue session | `POST /eve/v1/session/:sessionId?indexId=<index-id>` |
102
- | Resume stream | `GET /eve/v1/session/:sessionId/stream?indexId=<index-id>` |
23
+ ## What you get
103
24
 
104
- ## Local browser demo
25
+ - A collapsible assist panel on your site
26
+ - Answers grounded in your published index
27
+ - Edge tab launcher (position configured in Agent Studio)
28
+ - Session continuity for returning visitors
105
29
 
106
- ```bash
107
- cd webless-sdk
108
- cp apps/agent-demo/.env.example apps/agent-demo/.env.local
109
- npm install
110
- npm run dev:agent
111
- ```
112
30
 
113
- Open **http://127.0.0.1:5178** for the headless Eve streaming demo.
31
+ ## This npm package
32
+
33
+ `@webless/agent` is published for Webless tooling and internal use. It powers the script bundle served from the console install flow.
114
34
 
115
- ## Exports
35
+ Customers integrate via the **console snippet only** — not via `@webless/agent/react` or a direct npm dependency.
116
36
 
117
- | Subpath | Purpose |
118
- |---------|---------|
119
- | `@webless/agent` | Headless Eve client |
120
- | `@webless/agent/react` | AgentRail, AssistEdgeTab, `useAgentChat` |
121
- | `@webless/agent/embed` | `mountAgent`, manifest normalization |
37
+ If you are building on Webless internally, see the package source and `apps/agent-demo` in the [webless-sdk](https://github.com/tech-webless/webless-sdk) repo.