@amigo-ai/platform-sdk 0.27.0 → 0.31.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/api.md +4 -1
- package/dist/index.cjs +26 -10
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -10
- package/dist/index.mjs.map +3 -3
- package/dist/resources/conversations.js +8 -5
- package/dist/resources/conversations.js.map +1 -1
- package/dist/resources/me.js +46 -0
- package/dist/resources/me.js.map +1 -0
- package/dist/resources/workspaces.js +8 -10
- package/dist/resources/workspaces.js.map +1 -1
- package/dist/types/generated/api.d.ts +252 -119
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/calls.d.ts +16 -9
- package/dist/types/resources/calls.d.ts.map +1 -1
- package/dist/types/resources/conversations.d.ts +7 -3
- package/dist/types/resources/conversations.d.ts.map +1 -1
- package/dist/types/resources/functions.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/me.d.ts +54 -0
- package/dist/types/resources/me.d.ts.map +1 -0
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts +17 -17
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/workspaces.d.ts +8 -17
- package/dist/types/resources/workspaces.d.ts.map +1 -1
- package/package.json +1 -1
package/api.md
CHANGED
|
@@ -66,7 +66,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
66
66
|
|
|
67
67
|
### `workspaces`
|
|
68
68
|
|
|
69
|
-
- `createSelfService`
|
|
70
69
|
- `list`
|
|
71
70
|
- `listAutoPaging`
|
|
72
71
|
- `get`
|
|
@@ -78,6 +77,10 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
78
77
|
- `testCallerNumbers.get`
|
|
79
78
|
- `testCallerNumbers.update`
|
|
80
79
|
|
|
80
|
+
### `me`
|
|
81
|
+
|
|
82
|
+
- `createWorkspace`
|
|
83
|
+
|
|
81
84
|
### `apiKeys`
|
|
82
85
|
|
|
83
86
|
- `me`
|
package/dist/index.cjs
CHANGED
|
@@ -993,16 +993,27 @@ function resolveScopedPlatformClient(client) {
|
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
995
|
|
|
996
|
-
// src/resources/
|
|
997
|
-
var
|
|
998
|
-
/**
|
|
999
|
-
|
|
996
|
+
// src/resources/me.ts
|
|
997
|
+
var MeResource = class extends WorkspaceScopedResource {
|
|
998
|
+
/**
|
|
999
|
+
* Create a workspace owned by the authenticated identity.
|
|
1000
|
+
*
|
|
1001
|
+
* The caller is bootstrapped as the workspace's owner. Use this
|
|
1002
|
+
* method anywhere that previously called
|
|
1003
|
+
* ``client.workspaces.createSelfService(body)`` — the request body
|
|
1004
|
+
* shape and response are unchanged; only the URL moved.
|
|
1005
|
+
*/
|
|
1006
|
+
async createWorkspace(body) {
|
|
1000
1007
|
return extractData(
|
|
1001
|
-
await this.client.POST("/v1/workspaces
|
|
1008
|
+
await this.client.POST("/v1/me/workspaces", {
|
|
1002
1009
|
body
|
|
1003
1010
|
})
|
|
1004
1011
|
);
|
|
1005
1012
|
}
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
// src/resources/workspaces.ts
|
|
1016
|
+
var WorkspacesResource = class extends WorkspaceScopedResource {
|
|
1006
1017
|
/** List workspaces accessible to the current API key */
|
|
1007
1018
|
async list(params) {
|
|
1008
1019
|
return extractData(
|
|
@@ -2164,10 +2175,14 @@ var ConversationsResource = class extends WorkspaceScopedResource {
|
|
|
2164
2175
|
);
|
|
2165
2176
|
}
|
|
2166
2177
|
/**
|
|
2167
|
-
* Send a message and receive the agent's response as an SSE stream.
|
|
2178
|
+
* Send a message and receive the agent's response as an SSE byte stream.
|
|
2168
2179
|
*
|
|
2169
|
-
*
|
|
2170
|
-
*
|
|
2180
|
+
* Targets the explicit always-SSE endpoint
|
|
2181
|
+
* `POST /v1/{ws}/conversations/{id}/turns/stream`, so the response is
|
|
2182
|
+
* always `text/event-stream` regardless of `Accept` negotiation. Returns
|
|
2183
|
+
* a `ReadableStream` of raw bytes; use `EventSourceParserStream` (from
|
|
2184
|
+
* `eventsource-parser/stream`) to parse into typed `TurnStreamEvent`,
|
|
2185
|
+
* or use the higher-level {@link streamTurn} which hides the parser.
|
|
2171
2186
|
*
|
|
2172
2187
|
* @example
|
|
2173
2188
|
* ```ts
|
|
@@ -2183,7 +2198,7 @@ var ConversationsResource = class extends WorkspaceScopedResource {
|
|
|
2183
2198
|
*/
|
|
2184
2199
|
async createTurnStream(conversationId, request, options) {
|
|
2185
2200
|
const result = await this.client.POST(
|
|
2186
|
-
"/v1/{workspace_id}/conversations/{conversation_id}/turns",
|
|
2201
|
+
"/v1/{workspace_id}/conversations/{conversation_id}/turns/stream",
|
|
2187
2202
|
{
|
|
2188
2203
|
params: {
|
|
2189
2204
|
path: { workspace_id: this.workspaceId, conversation_id: conversationId },
|
|
@@ -2192,7 +2207,6 @@ var ConversationsResource = class extends WorkspaceScopedResource {
|
|
|
2192
2207
|
}
|
|
2193
2208
|
},
|
|
2194
2209
|
body: request,
|
|
2195
|
-
headers: { Accept: "text/event-stream" },
|
|
2196
2210
|
parseAs: "stream",
|
|
2197
2211
|
signal: options?.signal
|
|
2198
2212
|
}
|
|
@@ -6042,6 +6056,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6042
6056
|
baseUrl;
|
|
6043
6057
|
agentBaseUrl;
|
|
6044
6058
|
workspaces;
|
|
6059
|
+
me;
|
|
6045
6060
|
apiKeys;
|
|
6046
6061
|
agents;
|
|
6047
6062
|
/** @deprecated Use `actions` instead */
|
|
@@ -6183,6 +6198,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6183
6198
|
mutable.agentBaseUrl = agentBaseUrl;
|
|
6184
6199
|
target.api = client;
|
|
6185
6200
|
mutable.workspaces = new WorkspacesResource(client, workspaceId2);
|
|
6201
|
+
mutable.me = new MeResource(client, "_account");
|
|
6186
6202
|
mutable.apiKeys = new ApiKeysResource(client, workspaceId2);
|
|
6187
6203
|
mutable.agents = new AgentsResource(client, workspaceId2);
|
|
6188
6204
|
mutable.skills = new SkillsResource(client, workspaceId2);
|