@aui.io/aui-client 3.2.3 → 3.3.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/README.md +13 -4
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/agents/client/Client.js +2 -2
- package/dist/cjs/api/types/MessageCardJsonData.d.ts +10 -0
- package/dist/cjs/api/types/MessageCardJsonData.js +3 -0
- package/dist/cjs/api/types/MessageCardSubEntity.d.ts +4 -0
- package/dist/cjs/api/types/MessageCardSubEntity.js +3 -0
- package/dist/cjs/api/types/ThreadListItem.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/agents/client/Client.mjs +2 -2
- package/dist/esm/api/types/MessageCardJsonData.d.mts +10 -0
- package/dist/esm/api/types/MessageCardJsonData.mjs +2 -0
- package/dist/esm/api/types/MessageCardSubEntity.d.mts +4 -0
- package/dist/esm/api/types/MessageCardSubEntity.mjs +2 -0
- package/dist/esm/api/types/ThreadListItem.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +2 -2
package/README.md
CHANGED
|
@@ -59,8 +59,8 @@ await client.messaging.sendMessage({
|
|
|
59
59
|
user_id: 'end-user-123',
|
|
60
60
|
text: 'Where is my order?',
|
|
61
61
|
agent_variables: {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
customer_name: 'Ada',
|
|
63
|
+
order_id: 'ORD-1042',
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
```
|
|
@@ -103,6 +103,10 @@ const { suggestions } = await client.messaging.generateFollowupSuggestions({
|
|
|
103
103
|
| `getWelcomeMessage()` | Return the agent's welcome message. |
|
|
104
104
|
| `generateFollowupSuggestions(request)` | Generate follow-up prompts from a context. |
|
|
105
105
|
|
|
106
|
+
Message cards carry both a rendered `rendered_jsx` string and a structured
|
|
107
|
+
`json_data` representation (`entity` plus `sub_entities`), so you can either render
|
|
108
|
+
the JSX directly or read the card's fields programmatically.
|
|
109
|
+
|
|
106
110
|
### Channels (SMS and WhatsApp)
|
|
107
111
|
|
|
108
112
|
Start an outbound thread on a channel with `channels.initiateThread`. Pass `'sms'`
|
|
@@ -128,13 +132,16 @@ and it works in both Node and the browser.
|
|
|
128
132
|
const socket = await client.connect();
|
|
129
133
|
await socket.waitForOpen();
|
|
130
134
|
|
|
135
|
+
// The agent is resolved from your publishable key.
|
|
136
|
+
const { agentId } = await client.getContext();
|
|
137
|
+
|
|
131
138
|
socket.on('message', (message) => console.log(message));
|
|
132
139
|
socket.on('error', (error) => console.error(error));
|
|
133
140
|
socket.on('close', (event) => console.log('closed', event.code));
|
|
134
141
|
|
|
135
142
|
socket.sendMessage({
|
|
136
143
|
type: 'message',
|
|
137
|
-
agent_id: agentId
|
|
144
|
+
agent_id: agentId!,
|
|
138
145
|
user_id: 'end-user-123',
|
|
139
146
|
text: 'Hello over WebSocket',
|
|
140
147
|
});
|
|
@@ -199,7 +206,7 @@ const usage = await client.projects.getProjectUsage(project.id);
|
|
|
199
206
|
| `listAgents(projectId, { filters })` | List a project's agents. |
|
|
200
207
|
| `createAgent(projectId, request)` | Create an agent. |
|
|
201
208
|
| `getAgent(agentId)` | Fetch one agent. |
|
|
202
|
-
| `updateAgent(agentId, request)` | Rename an agent. |
|
|
209
|
+
| `updateAgent(agentId, request)` | Rename an agent (re-publishes the live version with the new name). |
|
|
203
210
|
| `deleteAgent(agentId)` | Delete an agent and its versions. |
|
|
204
211
|
| `getAgentUsage(agentId)` | Usage metrics for one agent. |
|
|
205
212
|
|
|
@@ -242,6 +249,8 @@ await client.agentVersions.publishVersion(agentId, draft.id);
|
|
|
242
249
|
(range), `tool`, `rule`, and `param`. Prefer a filter such as `project_id` over an
|
|
243
250
|
empty object; the unfiltered list sorts every thread in the organization and can be slow.
|
|
244
251
|
|
|
252
|
+
Listed threads include a `version_tag` indicating the agent version the thread runs on.
|
|
253
|
+
|
|
245
254
|
```ts
|
|
246
255
|
const page = await client.threads.listThreads(
|
|
247
256
|
{ filters: { project_id: projectId } },
|
package/dist/cjs/Client.js
CHANGED
|
@@ -62,8 +62,8 @@ class ApolloClient {
|
|
|
62
62
|
"x-organization-api-key": _options === null || _options === void 0 ? void 0 : _options.organizationApiKey,
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
65
|
-
"X-Fern-SDK-Version": "3.
|
|
66
|
-
"User-Agent": "@aui.io/aui-client/3.
|
|
65
|
+
"X-Fern-SDK-Version": "3.3.0",
|
|
66
|
+
"User-Agent": "@aui.io/aui-client/3.3.0",
|
|
67
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
68
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
69
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -94,8 +94,8 @@ export declare class Agents {
|
|
|
94
94
|
deleteAgent(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
|
|
95
95
|
private __deleteAgent;
|
|
96
96
|
/**
|
|
97
|
-
* Rename an agent.
|
|
98
|
-
* instead.
|
|
97
|
+
* Rename an agent. re-publishes the published version with the updated name.
|
|
98
|
+
* To change which version is live, publish a version instead.
|
|
99
99
|
*
|
|
100
100
|
* @param {string} agentId
|
|
101
101
|
* @param {Apollo.AgentUpdateRequest} request
|
|
@@ -410,8 +410,8 @@ class Agents {
|
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
/**
|
|
413
|
-
* Rename an agent.
|
|
414
|
-
* instead.
|
|
413
|
+
* Rename an agent. re-publishes the published version with the updated name.
|
|
414
|
+
* To change which version is live, publish a version instead.
|
|
415
415
|
*
|
|
416
416
|
* @param {string} agentId
|
|
417
417
|
* @param {Apollo.AgentUpdateRequest} request
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Apollo from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Structured, self-contained form of the card — the JSON counterpart to
|
|
4
|
+
* ``rendered_jsx``. ``entity`` is the card's own flat {code: value} map;
|
|
5
|
+
* ``sub_entities`` holds its variant groups.
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageCardJsonData {
|
|
8
|
+
entity?: Record<string, unknown>;
|
|
9
|
+
sub_entities?: Apollo.MessageCardSubEntity[];
|
|
10
|
+
}
|
|
@@ -23,6 +23,8 @@ export * from "./HttpValidationError.js";
|
|
|
23
23
|
export * from "./InitiateThreadResponse.js";
|
|
24
24
|
export * from "./Message.js";
|
|
25
25
|
export * from "./MessageCard.js";
|
|
26
|
+
export * from "./MessageCardJsonData.js";
|
|
27
|
+
export * from "./MessageCardSubEntity.js";
|
|
26
28
|
export * from "./MessageEnvelope.js";
|
|
27
29
|
export * from "./MessageParty.js";
|
|
28
30
|
export * from "./MessageStreamEvent.js";
|
|
@@ -39,6 +39,8 @@ __exportStar(require("./HttpValidationError.js"), exports);
|
|
|
39
39
|
__exportStar(require("./InitiateThreadResponse.js"), exports);
|
|
40
40
|
__exportStar(require("./Message.js"), exports);
|
|
41
41
|
__exportStar(require("./MessageCard.js"), exports);
|
|
42
|
+
__exportStar(require("./MessageCardJsonData.js"), exports);
|
|
43
|
+
__exportStar(require("./MessageCardSubEntity.js"), exports);
|
|
42
44
|
__exportStar(require("./MessageEnvelope.js"), exports);
|
|
43
45
|
__exportStar(require("./MessageParty.js"), exports);
|
|
44
46
|
__exportStar(require("./MessageStreamEvent.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.3.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -26,8 +26,8 @@ export class ApolloClient {
|
|
|
26
26
|
"x-organization-api-key": _options === null || _options === void 0 ? void 0 : _options.organizationApiKey,
|
|
27
27
|
"X-Fern-Language": "JavaScript",
|
|
28
28
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
29
|
-
"X-Fern-SDK-Version": "3.
|
|
30
|
-
"User-Agent": "@aui.io/aui-client/3.
|
|
29
|
+
"X-Fern-SDK-Version": "3.3.0",
|
|
30
|
+
"User-Agent": "@aui.io/aui-client/3.3.0",
|
|
31
31
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
32
32
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
33
33
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -94,8 +94,8 @@ export declare class Agents {
|
|
|
94
94
|
deleteAgent(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
|
|
95
95
|
private __deleteAgent;
|
|
96
96
|
/**
|
|
97
|
-
* Rename an agent.
|
|
98
|
-
* instead.
|
|
97
|
+
* Rename an agent. re-publishes the published version with the updated name.
|
|
98
|
+
* To change which version is live, publish a version instead.
|
|
99
99
|
*
|
|
100
100
|
* @param {string} agentId
|
|
101
101
|
* @param {Apollo.AgentUpdateRequest} request
|
|
@@ -374,8 +374,8 @@ export class Agents {
|
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
|
-
* Rename an agent.
|
|
378
|
-
* instead.
|
|
377
|
+
* Rename an agent. re-publishes the published version with the updated name.
|
|
378
|
+
* To change which version is live, publish a version instead.
|
|
379
379
|
*
|
|
380
380
|
* @param {string} agentId
|
|
381
381
|
* @param {Apollo.AgentUpdateRequest} request
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Apollo from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Structured, self-contained form of the card — the JSON counterpart to
|
|
4
|
+
* ``rendered_jsx``. ``entity`` is the card's own flat {code: value} map;
|
|
5
|
+
* ``sub_entities`` holds its variant groups.
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageCardJsonData {
|
|
8
|
+
entity?: Record<string, unknown>;
|
|
9
|
+
sub_entities?: Apollo.MessageCardSubEntity[];
|
|
10
|
+
}
|
|
@@ -23,6 +23,8 @@ export * from "./HttpValidationError.mjs";
|
|
|
23
23
|
export * from "./InitiateThreadResponse.mjs";
|
|
24
24
|
export * from "./Message.mjs";
|
|
25
25
|
export * from "./MessageCard.mjs";
|
|
26
|
+
export * from "./MessageCardJsonData.mjs";
|
|
27
|
+
export * from "./MessageCardSubEntity.mjs";
|
|
26
28
|
export * from "./MessageEnvelope.mjs";
|
|
27
29
|
export * from "./MessageParty.mjs";
|
|
28
30
|
export * from "./MessageStreamEvent.mjs";
|
|
@@ -23,6 +23,8 @@ export * from "./HttpValidationError.mjs";
|
|
|
23
23
|
export * from "./InitiateThreadResponse.mjs";
|
|
24
24
|
export * from "./Message.mjs";
|
|
25
25
|
export * from "./MessageCard.mjs";
|
|
26
|
+
export * from "./MessageCardJsonData.mjs";
|
|
27
|
+
export * from "./MessageCardSubEntity.mjs";
|
|
26
28
|
export * from "./MessageEnvelope.mjs";
|
|
27
29
|
export * from "./MessageParty.mjs";
|
|
28
30
|
export * from "./MessageStreamEvent.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.3.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "3.
|
|
1
|
+
export const SDK_VERSION = "3.3.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -341,8 +341,8 @@ await client.agents.deleteAgent("agentId");
|
|
|
341
341
|
<dl>
|
|
342
342
|
<dd>
|
|
343
343
|
|
|
344
|
-
Rename an agent.
|
|
345
|
-
instead.
|
|
344
|
+
Rename an agent. re-publishes the published version with the updated name.
|
|
345
|
+
To change which version is live, publish a version instead.
|
|
346
346
|
</dd>
|
|
347
347
|
</dl>
|
|
348
348
|
</dd>
|