@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 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
- static: { customer_name: 'Ada' },
63
- dynamic: { order_id: 'ORD-1042' },
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 } },
@@ -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.2.3",
66
- "User-Agent": "@aui.io/aui-client/3.2.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. To change which version is live, publish a version
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. To change which version is live, publish a version
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
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface MessageCardSubEntity {
2
+ name?: string;
3
+ items?: Record<string, unknown>[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,4 +5,6 @@ export interface ThreadListItem {
5
5
  title?: string;
6
6
  /** Creation timestamp (ISO-8601) */
7
7
  created_at?: string;
8
+ /** Agent version tag the thread runs on */
9
+ version_tag?: string;
8
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);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.2.3";
1
+ export declare const SDK_VERSION = "3.3.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "3.2.3";
4
+ exports.SDK_VERSION = "3.3.0";
@@ -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.2.3",
30
- "User-Agent": "@aui.io/aui-client/3.2.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. To change which version is live, publish a version
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. To change which version is live, publish a version
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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface MessageCardSubEntity {
2
+ name?: string;
3
+ items?: Record<string, unknown>[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -5,4 +5,6 @@ export interface ThreadListItem {
5
5
  title?: string;
6
6
  /** Creation timestamp (ISO-8601) */
7
7
  created_at?: string;
8
+ /** Agent version tag the thread runs on */
9
+ version_tag?: string;
8
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";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.2.3";
1
+ export declare const SDK_VERSION = "3.3.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "3.2.3";
1
+ export const SDK_VERSION = "3.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aui.io/aui-client",
3
- "version": "3.2.3",
3
+ "version": "3.3.0",
4
4
  "private": false,
5
5
  "repository": "github:aui-io/aui-client-typescript",
6
6
  "type": "commonjs",
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. To change which version is live, publish a version
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>