@webless/agent 0.8.0 → 0.9.1

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
@@ -12,7 +12,6 @@ Sign up at [app.webless.ai](https://app.webless.ai).
12
12
 
13
13
  An index is the content your agent answers from. Add your sources (URLs, sitemaps, docs), then publish the index.
14
14
 
15
-
16
15
  ### 3. Configure your agent in Agent Studio
17
16
 
18
17
  Open **Agent Studio** for your index. Customize the launcher position, appearance, and behavior, then build a preview bundle.
@@ -27,13 +26,14 @@ After building the bundle, copy the **install snippet** — a single script tag:
27
26
 
28
27
  Paste it into your site's HTML, before the closing `</body>` tag. That's the full integration.
29
28
 
30
-
31
29
  ## What you get
32
30
 
33
31
  - A collapsible Agent panel on your site.
34
32
  - Edge tab launcher, positioned where you configure it in Agent Studio.
35
33
  - Session continuity for returning visitors.
36
34
  - Search & Discovery source cards and call-to-action links beneath each answer, retained in the current browser session history. Sources without a usable web URL stay readable; unavailable action links are omitted.
35
+ - Connected actions show task-focused progress and confirmed results. Receipts stay with the answer in the conversation.
36
+ - Long answers keep their beginning visible; source links are collapsed until opened.
37
37
  - Page content shifts to make room for the desktop side rail.
38
38
 
39
39
  ## Preview before you install
@@ -54,11 +54,45 @@ import "@webless/agent/react.css";
54
54
 
55
55
  <AgentTranscript
56
56
  messages={[
57
- { id: "1", role: "visitor", text: "Can I book a demo?", createdAt: 1789056000000 },
58
- { id: "2", role: "agent", text: "What day works for you?", createdAt: 1789056001000 },
57
+ {
58
+ id: "1",
59
+ role: "visitor",
60
+ text: "Can I book a demo?",
61
+ createdAt: 1789056000000,
62
+ },
63
+ {
64
+ id: "2",
65
+ role: "agent",
66
+ text: "What day works for you?",
67
+ createdAt: 1789056001000,
68
+ },
59
69
  ]}
60
70
  colorScheme="light"
61
- />
71
+ />;
62
72
  ```
63
73
 
64
74
  The host owns fetching, authorization, pagination, scrolling, and review controls. Pass `ConversationMessage` snapshots with stable IDs and millisecond timestamps. Optional `theme`, `agentLabel`, `visitorLabel`, `label`, and `formatTimestamp` props adapt the presentation to the host. Timestamps default to UTC. Structured references render when supplied in the message; the component does not fetch missing history or tool results.
75
+
76
+ Pass `activities` alongside `messages` to include recorded tool calls and specialist routing. Entries are ordered by their timestamps. Tool result details expand locally; forms and booking controls remain disabled. No runtime connection is created.
77
+
78
+ ```tsx
79
+ <AgentTranscript
80
+ messages={messages}
81
+ activities={[
82
+ {
83
+ id: "handoff-1",
84
+ callId: "specialist-1",
85
+ createdAt: 1789084800000,
86
+ category: "specialist",
87
+ label: "Product specialist",
88
+ status: "completed",
89
+ },
90
+ ]}
91
+ />
92
+ ```
93
+
94
+ Use `presentTranscriptToolResult` from `@webless/agent/presentation` on the server to project stored tool output into the SDK's visitor-facing result cards. This entry point contains no React or CSS imports. Only send the projected presentation to a browser; keep raw tool arguments, provider payloads, and internal prompts server-side. Historical provider errors are represented as failures even when the runtime execution status was completed.
95
+
96
+ ### Custom composer submit handlers
97
+
98
+ When using `AgentRail` directly, forward both arguments from `onSubmit(message, options)` to the chat controller. `message` is the visitor-visible text; `options.runtimeText` carries form submissions and the visitor's decision to skip a details form. A form submission uses an empty `message` so the transcript shows one collapsed confirmation instead of echoing the fields. Keep that runtime context out of the visible transcript.