lemma-sdk 0.2.41 → 0.2.42
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 +5 -2
- package/dist/browser/lemma-client.js +22 -61
- package/dist/namespaces/conversations.d.ts +6 -0
- package/dist/namespaces/conversations.js +2 -0
- package/dist/namespaces/files.js +12 -21
- package/dist/openapi_client/index.d.ts +2 -1
- package/dist/openapi_client/index.js +2 -1
- package/dist/openapi_client/models/ConversationResponse.d.ts +5 -0
- package/dist/openapi_client/models/ConversationStatus.d.ts +11 -0
- package/dist/openapi_client/models/ConversationStatus.js +16 -0
- package/dist/openapi_client/models/ConversationType.d.ts +7 -0
- package/dist/openapi_client/models/ConversationType.js +12 -0
- package/dist/openapi_client/models/CreateConversationRequest.d.ts +3 -0
- package/dist/openapi_client/models/CreateFolderRequest.d.ts +0 -3
- package/dist/openapi_client/models/DatastoreFileUploadRequest.d.ts +0 -2
- package/dist/openapi_client/models/FileResponse.d.ts +0 -2
- package/dist/openapi_client/models/UpdateConversationRequest.d.ts +1 -0
- package/dist/openapi_client/models/update.d.ts +0 -3
- package/dist/openapi_client/services/AgentConversationsService.d.ts +5 -1
- package/dist/openapi_client/services/AgentConversationsService.js +5 -1
- package/dist/openapi_client/services/FilesService.d.ts +8 -17
- package/dist/openapi_client/services/FilesService.js +8 -25
- package/dist/react/AuthGuard.d.ts +0 -15
- package/dist/react/AuthGuard.js +128 -167
- package/dist/react/useAssistantSession.d.ts +6 -0
- package/dist/react/useAssistantSession.js +4 -0
- package/dist/react/useConversations.d.ts +7 -1
- package/dist/react/useConversations.js +10 -4
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/openapi_client/models/FileNamespace.d.ts +0 -4
- package/dist/openapi_client/models/FileNamespace.js +0 -9
package/README.md
CHANGED
|
@@ -188,6 +188,8 @@ function AgentButton({ client }: { client: LemmaClient }) {
|
|
|
188
188
|
const thread = await conversation.createConversation({
|
|
189
189
|
title: "Triage ticket ticket_123",
|
|
190
190
|
instructions: "Triage the ticket, propose the next owner, and explain the confidence level.",
|
|
191
|
+
metadata: { source: "support_queue", ticket_id: "ticket_123" },
|
|
192
|
+
type: "TASK",
|
|
191
193
|
setActive: true,
|
|
192
194
|
});
|
|
193
195
|
await conversation.sendMessage(JSON.stringify({
|
|
@@ -442,7 +444,7 @@ Useful helpers:
|
|
|
442
444
|
- `setTestingToken(...)`
|
|
443
445
|
- `clearTestingToken()`
|
|
444
446
|
|
|
445
|
-
When `client.podId` is set and the signed-in user is not a pod member, `AuthGuard`
|
|
447
|
+
When `client.podId` is set and the signed-in user is not a pod member, `AuthGuard` checks membership through the pod-member lookup endpoint and renders an interactive request-access flow. It can create a pod join request, show a pending request, retry access checks, and then render the app once the user is a member.
|
|
446
448
|
|
|
447
449
|
`usePodAccess` exposes the same membership/request-access state as a hook for custom UI.
|
|
448
450
|
|
|
@@ -461,7 +463,8 @@ From `0.2.37` onward:
|
|
|
461
463
|
|
|
462
464
|
- Agent APIs are the runtime abstraction. `client.assistants` is removed; use `client.agents` for definitions and `client.conversations` for turns/messages.
|
|
463
465
|
- Conversations are pod-scoped under the agent conversation API; message sends stream conversation events until final output.
|
|
464
|
-
-
|
|
466
|
+
- Conversation creation accepts `instructions`, `metadata`, and `type`; message sends accept `metadata`. Use conversation instructions for durable agent context and message metadata for per-turn provenance, object IDs, and UI recovery data.
|
|
467
|
+
- File API namespace query/body fields are no longer in the live OpenAPI. The SDK still accepts `namespace` in file helpers for source compatibility, but it is currently a no-op on requests.
|
|
465
468
|
|
|
466
469
|
From `0.2.39` onward:
|
|
467
470
|
|
|
@@ -1649,6 +1649,8 @@ class ConversationsNamespace {
|
|
|
1649
1649
|
return this.http.request("GET", `/pods/${podId}/conversations`, {
|
|
1650
1650
|
params: {
|
|
1651
1651
|
agent_name: options.agent_name,
|
|
1652
|
+
status: options.status,
|
|
1653
|
+
type: options.type,
|
|
1652
1654
|
limit: options.limit ?? 20,
|
|
1653
1655
|
page_token: options.page_token,
|
|
1654
1656
|
},
|
|
@@ -2025,7 +2027,6 @@ exports.DesksService = DesksService;
|
|
|
2025
2027
|
"use strict";
|
|
2026
2028
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2027
2029
|
exports.FilesNamespace = void 0;
|
|
2028
|
-
const FileNamespace_js_1 = require("./openapi_client/models/FileNamespace.js");
|
|
2029
2030
|
const SearchMethod_js_1 = require("./openapi_client/models/SearchMethod.js");
|
|
2030
2031
|
const FilesService_js_1 = require("./openapi_client/services/FilesService.js");
|
|
2031
2032
|
function joinDatastorePath(basePath, leaf) {
|
|
@@ -2057,13 +2058,6 @@ function getBaseName(path) {
|
|
|
2057
2058
|
}
|
|
2058
2059
|
return normalized.slice(index + 1);
|
|
2059
2060
|
}
|
|
2060
|
-
function normalizeFileNamespace(namespace) {
|
|
2061
|
-
const normalized = String(namespace ?? "").trim().toUpperCase();
|
|
2062
|
-
if (normalized === FileNamespace_js_1.FileNamespace.PERSONAL || normalized === "PRIVATE") {
|
|
2063
|
-
return FileNamespace_js_1.FileNamespace.PERSONAL;
|
|
2064
|
-
}
|
|
2065
|
-
return FileNamespace_js_1.FileNamespace.POD;
|
|
2066
|
-
}
|
|
2067
2061
|
class FilesNamespace {
|
|
2068
2062
|
constructor(client, http, podId) {
|
|
2069
2063
|
this.client = client;
|
|
@@ -2074,31 +2068,32 @@ class FilesNamespace {
|
|
|
2074
2068
|
const payload = {
|
|
2075
2069
|
path: joinDatastorePath(options.directoryPath ?? options.parentId, name),
|
|
2076
2070
|
description: options.description,
|
|
2077
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
2078
2071
|
};
|
|
2079
2072
|
return this.client.request(() => FilesService_js_1.FilesService.fileFolderCreate(this.podId(), payload));
|
|
2080
2073
|
},
|
|
2081
2074
|
};
|
|
2082
2075
|
this.converted = {
|
|
2083
|
-
get: (path, options = {}) => this.client.request(() => FilesService_js_1.FilesService.fileConvertedGet(this.podId(), path
|
|
2084
|
-
render: (path, options = {}) => this.client.request(() => FilesService_js_1.FilesService.fileConvertedRender(this.podId(), path
|
|
2076
|
+
get: (path, options = {}) => (void options, this.client.request(() => FilesService_js_1.FilesService.fileConvertedGet(this.podId(), path))),
|
|
2077
|
+
render: (path, options = {}) => (void options, this.client.request(() => FilesService_js_1.FilesService.fileConvertedRender(this.podId(), path))),
|
|
2085
2078
|
download: (path, artifact = "document.md", options = {}) => {
|
|
2079
|
+
void options;
|
|
2086
2080
|
const encodedPath = encodeURIComponent(path);
|
|
2087
2081
|
const encodedArtifact = encodeURIComponent(artifact);
|
|
2088
|
-
|
|
2089
|
-
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}&namespace=${encodedNamespace}`);
|
|
2082
|
+
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}`);
|
|
2090
2083
|
},
|
|
2091
2084
|
};
|
|
2092
2085
|
}
|
|
2093
2086
|
list(options = {}) {
|
|
2094
2087
|
const directoryPath = options.directoryPath ?? options.parentId ?? "/";
|
|
2095
|
-
return this.client.request(() => FilesService_js_1.FilesService.fileList(this.podId(), directoryPath,
|
|
2088
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileList(this.podId(), directoryPath, options.limit ?? 100, options.pageToken));
|
|
2096
2089
|
}
|
|
2097
2090
|
get(path, options = {}) {
|
|
2098
|
-
|
|
2091
|
+
void options;
|
|
2092
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileGet(this.podId(), path));
|
|
2099
2093
|
}
|
|
2100
2094
|
delete(path, options = {}) {
|
|
2101
|
-
|
|
2095
|
+
void options;
|
|
2096
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileDelete(this.podId(), path));
|
|
2102
2097
|
}
|
|
2103
2098
|
search(query, options = {}) {
|
|
2104
2099
|
return this.client.request(() => FilesService_js_1.FilesService.fileSearch(this.podId(), {
|
|
@@ -2108,12 +2103,12 @@ class FilesNamespace {
|
|
|
2108
2103
|
}));
|
|
2109
2104
|
}
|
|
2110
2105
|
download(path, options = {}) {
|
|
2106
|
+
void options;
|
|
2111
2107
|
const encodedPath = encodeURIComponent(path);
|
|
2112
|
-
|
|
2113
|
-
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}&namespace=${encodedNamespace}`);
|
|
2108
|
+
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}`);
|
|
2114
2109
|
}
|
|
2115
2110
|
tree(options = {}) {
|
|
2116
|
-
return this.client.request(() => FilesService_js_1.FilesService.fileTree(this.podId(), options.rootPath ?? "/",
|
|
2111
|
+
return this.client.request(() => FilesService_js_1.FilesService.fileTree(this.podId(), options.rootPath ?? "/", options.filesPerDirectory ?? 3));
|
|
2117
2112
|
}
|
|
2118
2113
|
upload(file, options = {}) {
|
|
2119
2114
|
const payload = {
|
|
@@ -2122,7 +2117,6 @@ class FilesNamespace {
|
|
|
2122
2117
|
description: options.description,
|
|
2123
2118
|
directory_path: options.directoryPath ?? options.parentId ?? "/",
|
|
2124
2119
|
search_enabled: options.searchEnabled ?? true,
|
|
2125
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
2126
2120
|
};
|
|
2127
2121
|
return this.client.request(() => FilesService_js_1.FilesService.fileUpload(this.podId(), payload));
|
|
2128
2122
|
}
|
|
@@ -2141,28 +2135,12 @@ class FilesNamespace {
|
|
|
2141
2135
|
description: options.description,
|
|
2142
2136
|
new_path: resolvedNewPath,
|
|
2143
2137
|
search_enabled: options.searchEnabled,
|
|
2144
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
2145
2138
|
};
|
|
2146
2139
|
return this.client.request(() => FilesService_js_1.FilesService.fileUpdate(this.podId(), payload));
|
|
2147
2140
|
}
|
|
2148
2141
|
}
|
|
2149
2142
|
exports.FilesNamespace = FilesNamespace;
|
|
2150
2143
|
|
|
2151
|
-
},
|
|
2152
|
-
"./openapi_client/models/FileNamespace.js": function (module, exports, require) {
|
|
2153
|
-
"use strict";
|
|
2154
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2155
|
-
exports.FileNamespace = void 0;
|
|
2156
|
-
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2157
|
-
/* istanbul ignore file */
|
|
2158
|
-
/* tslint:disable */
|
|
2159
|
-
/* eslint-disable */
|
|
2160
|
-
var FileNamespace;
|
|
2161
|
-
(function (FileNamespace) {
|
|
2162
|
-
FileNamespace["PERSONAL"] = "PERSONAL";
|
|
2163
|
-
FileNamespace["POD"] = "POD";
|
|
2164
|
-
})(FileNamespace || (exports.FileNamespace = FileNamespace = {}));
|
|
2165
|
-
|
|
2166
2144
|
},
|
|
2167
2145
|
"./openapi_client/models/SearchMethod.js": function (module, exports, require) {
|
|
2168
2146
|
"use strict";
|
|
@@ -2184,7 +2162,6 @@ var SearchMethod;
|
|
|
2184
2162
|
"use strict";
|
|
2185
2163
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2186
2164
|
exports.FilesService = void 0;
|
|
2187
|
-
const FileNamespace_js_1 = require("./openapi_client/models/FileNamespace.js");
|
|
2188
2165
|
const OpenAPI_js_1 = require("./openapi_client/core/OpenAPI.js");
|
|
2189
2166
|
const request_js_1 = require("./openapi_client/core/request.js");
|
|
2190
2167
|
class FilesService {
|
|
@@ -2192,13 +2169,12 @@ class FilesService {
|
|
|
2192
2169
|
* List Files
|
|
2193
2170
|
* @param podId
|
|
2194
2171
|
* @param directoryPath
|
|
2195
|
-
* @param namespace
|
|
2196
2172
|
* @param limit
|
|
2197
2173
|
* @param pageToken
|
|
2198
2174
|
* @returns FileListResponse Successful Response
|
|
2199
2175
|
* @throws ApiError
|
|
2200
2176
|
*/
|
|
2201
|
-
static fileList(podId, directoryPath = '/',
|
|
2177
|
+
static fileList(podId, directoryPath = '/', limit = 100, pageToken) {
|
|
2202
2178
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2203
2179
|
method: 'GET',
|
|
2204
2180
|
url: '/pods/{pod_id}/datastore/files',
|
|
@@ -2207,7 +2183,6 @@ class FilesService {
|
|
|
2207
2183
|
},
|
|
2208
2184
|
query: {
|
|
2209
2185
|
'directory_path': directoryPath,
|
|
2210
|
-
'namespace': namespace,
|
|
2211
2186
|
'limit': limit,
|
|
2212
2187
|
'page_token': pageToken,
|
|
2213
2188
|
},
|
|
@@ -2241,11 +2216,10 @@ class FilesService {
|
|
|
2241
2216
|
* Delete File Or Folder
|
|
2242
2217
|
* @param podId
|
|
2243
2218
|
* @param path
|
|
2244
|
-
* @param namespace
|
|
2245
2219
|
* @returns DatastoreMessageResponse Successful Response
|
|
2246
2220
|
* @throws ApiError
|
|
2247
2221
|
*/
|
|
2248
|
-
static fileDelete(podId, path
|
|
2222
|
+
static fileDelete(podId, path) {
|
|
2249
2223
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2250
2224
|
method: 'DELETE',
|
|
2251
2225
|
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
@@ -2254,7 +2228,6 @@ class FilesService {
|
|
|
2254
2228
|
},
|
|
2255
2229
|
query: {
|
|
2256
2230
|
'path': path,
|
|
2257
|
-
'namespace': namespace,
|
|
2258
2231
|
},
|
|
2259
2232
|
errors: {
|
|
2260
2233
|
422: `Validation Error`,
|
|
@@ -2265,11 +2238,10 @@ class FilesService {
|
|
|
2265
2238
|
* Get File
|
|
2266
2239
|
* @param podId
|
|
2267
2240
|
* @param path
|
|
2268
|
-
* @param namespace
|
|
2269
2241
|
* @returns FileResponse Successful Response
|
|
2270
2242
|
* @throws ApiError
|
|
2271
2243
|
*/
|
|
2272
|
-
static fileGet(podId, path
|
|
2244
|
+
static fileGet(podId, path) {
|
|
2273
2245
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2274
2246
|
method: 'GET',
|
|
2275
2247
|
url: '/pods/{pod_id}/datastore/files/by-path',
|
|
@@ -2278,7 +2250,6 @@ class FilesService {
|
|
|
2278
2250
|
},
|
|
2279
2251
|
query: {
|
|
2280
2252
|
'path': path,
|
|
2281
|
-
'namespace': namespace,
|
|
2282
2253
|
},
|
|
2283
2254
|
errors: {
|
|
2284
2255
|
422: `Validation Error`,
|
|
@@ -2310,11 +2281,10 @@ class FilesService {
|
|
|
2310
2281
|
* Get Converted File Metadata
|
|
2311
2282
|
* @param podId
|
|
2312
2283
|
* @param path
|
|
2313
|
-
* @param namespace
|
|
2314
2284
|
* @returns ConvertedFileResponse Successful Response
|
|
2315
2285
|
* @throws ApiError
|
|
2316
2286
|
*/
|
|
2317
|
-
static fileConvertedGet(podId, path
|
|
2287
|
+
static fileConvertedGet(podId, path) {
|
|
2318
2288
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2319
2289
|
method: 'GET',
|
|
2320
2290
|
url: '/pods/{pod_id}/datastore/files/converted/by-path',
|
|
@@ -2323,7 +2293,6 @@ class FilesService {
|
|
|
2323
2293
|
},
|
|
2324
2294
|
query: {
|
|
2325
2295
|
'path': path,
|
|
2326
|
-
'namespace': namespace,
|
|
2327
2296
|
},
|
|
2328
2297
|
errors: {
|
|
2329
2298
|
422: `Validation Error`,
|
|
@@ -2335,11 +2304,10 @@ class FilesService {
|
|
|
2335
2304
|
* @param podId
|
|
2336
2305
|
* @param path
|
|
2337
2306
|
* @param artifact
|
|
2338
|
-
* @param namespace
|
|
2339
2307
|
* @returns binary File bytes
|
|
2340
2308
|
* @throws ApiError
|
|
2341
2309
|
*/
|
|
2342
|
-
static fileConvertedDownload(podId, path, artifact = 'document.md'
|
|
2310
|
+
static fileConvertedDownload(podId, path, artifact = 'document.md') {
|
|
2343
2311
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2344
2312
|
method: 'GET',
|
|
2345
2313
|
url: '/pods/{pod_id}/datastore/files/converted/download',
|
|
@@ -2349,7 +2317,6 @@ class FilesService {
|
|
|
2349
2317
|
query: {
|
|
2350
2318
|
'path': path,
|
|
2351
2319
|
'artifact': artifact,
|
|
2352
|
-
'namespace': namespace,
|
|
2353
2320
|
},
|
|
2354
2321
|
errors: {
|
|
2355
2322
|
422: `Validation Error`,
|
|
@@ -2360,11 +2327,10 @@ class FilesService {
|
|
|
2360
2327
|
* Render Converted File As HTML
|
|
2361
2328
|
* @param podId
|
|
2362
2329
|
* @param path
|
|
2363
|
-
* @param namespace
|
|
2364
2330
|
* @returns string Rendered HTML
|
|
2365
2331
|
* @throws ApiError
|
|
2366
2332
|
*/
|
|
2367
|
-
static fileConvertedRender(podId, path
|
|
2333
|
+
static fileConvertedRender(podId, path) {
|
|
2368
2334
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2369
2335
|
method: 'GET',
|
|
2370
2336
|
url: '/pods/{pod_id}/datastore/files/converted/render',
|
|
@@ -2373,7 +2339,6 @@ class FilesService {
|
|
|
2373
2339
|
},
|
|
2374
2340
|
query: {
|
|
2375
2341
|
'path': path,
|
|
2376
|
-
'namespace': namespace,
|
|
2377
2342
|
},
|
|
2378
2343
|
errors: {
|
|
2379
2344
|
422: `Validation Error`,
|
|
@@ -2384,11 +2349,10 @@ class FilesService {
|
|
|
2384
2349
|
* Download File
|
|
2385
2350
|
* @param podId
|
|
2386
2351
|
* @param path
|
|
2387
|
-
* @param namespace
|
|
2388
2352
|
* @returns binary File bytes
|
|
2389
2353
|
* @throws ApiError
|
|
2390
2354
|
*/
|
|
2391
|
-
static fileDownload(podId, path
|
|
2355
|
+
static fileDownload(podId, path) {
|
|
2392
2356
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2393
2357
|
method: 'GET',
|
|
2394
2358
|
url: '/pods/{pod_id}/datastore/files/download',
|
|
@@ -2397,7 +2361,6 @@ class FilesService {
|
|
|
2397
2361
|
},
|
|
2398
2362
|
query: {
|
|
2399
2363
|
'path': path,
|
|
2400
|
-
'namespace': namespace,
|
|
2401
2364
|
},
|
|
2402
2365
|
errors: {
|
|
2403
2366
|
422: `Validation Error`,
|
|
@@ -2450,12 +2413,11 @@ class FilesService {
|
|
|
2450
2413
|
* Get Directory Tree
|
|
2451
2414
|
* @param podId
|
|
2452
2415
|
* @param rootPath
|
|
2453
|
-
* @param namespace
|
|
2454
2416
|
* @param filesPerDirectory
|
|
2455
2417
|
* @returns DirectoryTreeResponse Successful Response
|
|
2456
2418
|
* @throws ApiError
|
|
2457
2419
|
*/
|
|
2458
|
-
static fileTree(podId, rootPath = '/',
|
|
2420
|
+
static fileTree(podId, rootPath = '/', filesPerDirectory = 3) {
|
|
2459
2421
|
return (0, request_js_1.request)(OpenAPI_js_1.OpenAPI, {
|
|
2460
2422
|
method: 'GET',
|
|
2461
2423
|
url: '/pods/{pod_id}/datastore/files/tree',
|
|
@@ -2464,7 +2426,6 @@ class FilesService {
|
|
|
2464
2426
|
},
|
|
2465
2427
|
query: {
|
|
2466
2428
|
'root_path': rootPath,
|
|
2467
|
-
'namespace': namespace,
|
|
2468
2429
|
'files_per_directory': filesPerDirectory,
|
|
2469
2430
|
},
|
|
2470
2431
|
errors: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
2
|
import type { ConversationListResponse } from "../openapi_client/models/ConversationListResponse.js";
|
|
3
|
+
import type { ConversationStatus } from "../openapi_client/models/ConversationStatus.js";
|
|
4
|
+
import type { ConversationType } from "../openapi_client/models/ConversationType.js";
|
|
3
5
|
import type { CreateConversationRequest } from "../openapi_client/models/CreateConversationRequest.js";
|
|
4
6
|
import type { SendMessageRequest } from "../openapi_client/models/SendMessageRequest.js";
|
|
5
7
|
import type { UpdateConversationRequest } from "../openapi_client/models/UpdateConversationRequest.js";
|
|
@@ -21,11 +23,15 @@ export declare class ConversationsNamespace {
|
|
|
21
23
|
list(options?: {
|
|
22
24
|
agent_name?: string | null;
|
|
23
25
|
pod_id?: string | null;
|
|
26
|
+
status?: ConversationStatus | `${ConversationStatus}` | null;
|
|
27
|
+
type?: ConversationType | `${ConversationType}` | null;
|
|
24
28
|
limit?: number;
|
|
25
29
|
page_token?: string | null;
|
|
26
30
|
}): Promise<ConversationListResponse>;
|
|
27
31
|
listByAgent(agentName: string, options?: {
|
|
28
32
|
pod_id?: string | null;
|
|
33
|
+
status?: ConversationStatus | `${ConversationStatus}` | null;
|
|
34
|
+
type?: ConversationType | `${ConversationType}` | null;
|
|
29
35
|
limit?: number;
|
|
30
36
|
page_token?: string | null;
|
|
31
37
|
}): Promise<ConversationListResponse>;
|
|
@@ -55,6 +55,8 @@ export class ConversationsNamespace {
|
|
|
55
55
|
return this.http.request("GET", `/pods/${podId}/conversations`, {
|
|
56
56
|
params: {
|
|
57
57
|
agent_name: options.agent_name,
|
|
58
|
+
status: options.status,
|
|
59
|
+
type: options.type,
|
|
58
60
|
limit: options.limit ?? 20,
|
|
59
61
|
page_token: options.page_token,
|
|
60
62
|
},
|
package/dist/namespaces/files.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FileNamespace } from "../openapi_client/models/FileNamespace.js";
|
|
2
1
|
import { SearchMethod } from "../openapi_client/models/SearchMethod.js";
|
|
3
2
|
import { FilesService } from "../openapi_client/services/FilesService.js";
|
|
4
3
|
function joinDatastorePath(basePath, leaf) {
|
|
@@ -30,13 +29,6 @@ function getBaseName(path) {
|
|
|
30
29
|
}
|
|
31
30
|
return normalized.slice(index + 1);
|
|
32
31
|
}
|
|
33
|
-
function normalizeFileNamespace(namespace) {
|
|
34
|
-
const normalized = String(namespace ?? "").trim().toUpperCase();
|
|
35
|
-
if (normalized === FileNamespace.PERSONAL || normalized === "PRIVATE") {
|
|
36
|
-
return FileNamespace.PERSONAL;
|
|
37
|
-
}
|
|
38
|
-
return FileNamespace.POD;
|
|
39
|
-
}
|
|
40
32
|
export class FilesNamespace {
|
|
41
33
|
client;
|
|
42
34
|
http;
|
|
@@ -48,13 +40,15 @@ export class FilesNamespace {
|
|
|
48
40
|
}
|
|
49
41
|
list(options = {}) {
|
|
50
42
|
const directoryPath = options.directoryPath ?? options.parentId ?? "/";
|
|
51
|
-
return this.client.request(() => FilesService.fileList(this.podId(), directoryPath,
|
|
43
|
+
return this.client.request(() => FilesService.fileList(this.podId(), directoryPath, options.limit ?? 100, options.pageToken));
|
|
52
44
|
}
|
|
53
45
|
get(path, options = {}) {
|
|
54
|
-
|
|
46
|
+
void options;
|
|
47
|
+
return this.client.request(() => FilesService.fileGet(this.podId(), path));
|
|
55
48
|
}
|
|
56
49
|
delete(path, options = {}) {
|
|
57
|
-
|
|
50
|
+
void options;
|
|
51
|
+
return this.client.request(() => FilesService.fileDelete(this.podId(), path));
|
|
58
52
|
}
|
|
59
53
|
search(query, options = {}) {
|
|
60
54
|
return this.client.request(() => FilesService.fileSearch(this.podId(), {
|
|
@@ -64,12 +58,12 @@ export class FilesNamespace {
|
|
|
64
58
|
}));
|
|
65
59
|
}
|
|
66
60
|
download(path, options = {}) {
|
|
61
|
+
void options;
|
|
67
62
|
const encodedPath = encodeURIComponent(path);
|
|
68
|
-
|
|
69
|
-
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}&namespace=${encodedNamespace}`);
|
|
63
|
+
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/download?path=${encodedPath}`);
|
|
70
64
|
}
|
|
71
65
|
tree(options = {}) {
|
|
72
|
-
return this.client.request(() => FilesService.fileTree(this.podId(), options.rootPath ?? "/",
|
|
66
|
+
return this.client.request(() => FilesService.fileTree(this.podId(), options.rootPath ?? "/", options.filesPerDirectory ?? 3));
|
|
73
67
|
}
|
|
74
68
|
upload(file, options = {}) {
|
|
75
69
|
const payload = {
|
|
@@ -78,7 +72,6 @@ export class FilesNamespace {
|
|
|
78
72
|
description: options.description,
|
|
79
73
|
directory_path: options.directoryPath ?? options.parentId ?? "/",
|
|
80
74
|
search_enabled: options.searchEnabled ?? true,
|
|
81
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
82
75
|
};
|
|
83
76
|
return this.client.request(() => FilesService.fileUpload(this.podId(), payload));
|
|
84
77
|
}
|
|
@@ -97,7 +90,6 @@ export class FilesNamespace {
|
|
|
97
90
|
description: options.description,
|
|
98
91
|
new_path: resolvedNewPath,
|
|
99
92
|
search_enabled: options.searchEnabled,
|
|
100
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
101
93
|
};
|
|
102
94
|
return this.client.request(() => FilesService.fileUpdate(this.podId(), payload));
|
|
103
95
|
}
|
|
@@ -106,19 +98,18 @@ export class FilesNamespace {
|
|
|
106
98
|
const payload = {
|
|
107
99
|
path: joinDatastorePath(options.directoryPath ?? options.parentId, name),
|
|
108
100
|
description: options.description,
|
|
109
|
-
namespace: normalizeFileNamespace(options.namespace),
|
|
110
101
|
};
|
|
111
102
|
return this.client.request(() => FilesService.fileFolderCreate(this.podId(), payload));
|
|
112
103
|
},
|
|
113
104
|
};
|
|
114
105
|
converted = {
|
|
115
|
-
get: (path, options = {}) => this.client.request(() => FilesService.fileConvertedGet(this.podId(), path
|
|
116
|
-
render: (path, options = {}) => this.client.request(() => FilesService.fileConvertedRender(this.podId(), path
|
|
106
|
+
get: (path, options = {}) => (void options, this.client.request(() => FilesService.fileConvertedGet(this.podId(), path))),
|
|
107
|
+
render: (path, options = {}) => (void options, this.client.request(() => FilesService.fileConvertedRender(this.podId(), path))),
|
|
117
108
|
download: (path, artifact = "document.md", options = {}) => {
|
|
109
|
+
void options;
|
|
118
110
|
const encodedPath = encodeURIComponent(path);
|
|
119
111
|
const encodedArtifact = encodeURIComponent(artifact);
|
|
120
|
-
|
|
121
|
-
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}&namespace=${encodedNamespace}`);
|
|
112
|
+
return this.http.requestBytes("GET", `/pods/${this.podId()}/datastore/files/converted/download?path=${encodedPath}&artifact=${encodedArtifact}`);
|
|
122
113
|
},
|
|
123
114
|
};
|
|
124
115
|
}
|
|
@@ -40,6 +40,8 @@ export type { ConnectRequestInitiateSchema } from './models/ConnectRequestInitia
|
|
|
40
40
|
export type { ConnectRequestResponseSchema } from './models/ConnectRequestResponseSchema.js';
|
|
41
41
|
export type { ConversationListResponse } from './models/ConversationListResponse.js';
|
|
42
42
|
export type { ConversationResponse } from './models/ConversationResponse.js';
|
|
43
|
+
export { ConversationStatus } from './models/ConversationStatus.js';
|
|
44
|
+
export { ConversationType } from './models/ConversationType.js';
|
|
43
45
|
export type { ConvertedArtifactResponse } from './models/ConvertedArtifactResponse.js';
|
|
44
46
|
export type { ConvertedFileResponse } from './models/ConvertedFileResponse.js';
|
|
45
47
|
export type { CreateAgentRequest } from './models/CreateAgentRequest.js';
|
|
@@ -87,7 +89,6 @@ export type { ExecuteFunctionRequest } from './models/ExecuteFunctionRequest.js'
|
|
|
87
89
|
export type { ExpressionInputBinding } from './models/ExpressionInputBinding.js';
|
|
88
90
|
export { FeedbackCategory } from './models/FeedbackCategory.js';
|
|
89
91
|
export type { FileListResponse } from './models/FileListResponse.js';
|
|
90
|
-
export { FileNamespace } from './models/FileNamespace.js';
|
|
91
92
|
export type { FileResponse } from './models/FileResponse.js';
|
|
92
93
|
export type { FileSearchRequest } from './models/FileSearchRequest.js';
|
|
93
94
|
export type { FileSearchResponse } from './models/FileSearchResponse.js';
|
|
@@ -12,12 +12,13 @@ export { ApplicationMode } from './models/ApplicationMode.js';
|
|
|
12
12
|
export { BillingInterval } from './models/BillingInterval.js';
|
|
13
13
|
export { BillingInvoiceStatus } from './models/BillingInvoiceStatus.js';
|
|
14
14
|
export { BillingScope } from './models/BillingScope.js';
|
|
15
|
+
export { ConversationStatus } from './models/ConversationStatus.js';
|
|
16
|
+
export { ConversationType } from './models/ConversationType.js';
|
|
15
17
|
export { CredentialTypes } from './models/CredentialTypes.js';
|
|
16
18
|
export { DatastoreDataType } from './models/DatastoreDataType.js';
|
|
17
19
|
export { DatastoreOperation } from './models/DatastoreOperation.js';
|
|
18
20
|
export { DeskStatus } from './models/DeskStatus.js';
|
|
19
21
|
export { FeedbackCategory } from './models/FeedbackCategory.js';
|
|
20
|
-
export { FileNamespace } from './models/FileNamespace.js';
|
|
21
22
|
export { FileSearchScopeMode } from './models/FileSearchScopeMode.js';
|
|
22
23
|
export { FlowRunStatus } from './models/FlowRunStatus.js';
|
|
23
24
|
export { FunctionRunStatus } from './models/FunctionRunStatus.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AgentModelName } from './AgentModelName.js';
|
|
2
|
+
import type { ConversationStatus } from './ConversationStatus.js';
|
|
3
|
+
import type { ConversationType } from './ConversationType.js';
|
|
2
4
|
export type ConversationResponse = {
|
|
3
5
|
agent_id?: (string | null);
|
|
4
6
|
created_at: string;
|
|
@@ -7,9 +9,12 @@ export type ConversationResponse = {
|
|
|
7
9
|
metadata?: (Record<string, any> | null);
|
|
8
10
|
model_name?: (AgentModelName | null);
|
|
9
11
|
organization_id?: (string | null);
|
|
12
|
+
output?: null;
|
|
10
13
|
parent_id?: (string | null);
|
|
11
14
|
pod_id: string;
|
|
15
|
+
status?: (ConversationStatus | null);
|
|
12
16
|
title?: (string | null);
|
|
17
|
+
type?: ConversationType;
|
|
13
18
|
updated_at: string;
|
|
14
19
|
user_id: string;
|
|
15
20
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* User-visible lifecycle for a conversation.
|
|
7
|
+
*/
|
|
8
|
+
export var ConversationStatus;
|
|
9
|
+
(function (ConversationStatus) {
|
|
10
|
+
ConversationStatus["RUNNING"] = "RUNNING";
|
|
11
|
+
ConversationStatus["STOP_REQUESTED"] = "STOP_REQUESTED";
|
|
12
|
+
ConversationStatus["WAITING"] = "WAITING";
|
|
13
|
+
ConversationStatus["COMPLETED"] = "COMPLETED";
|
|
14
|
+
ConversationStatus["FAILED"] = "FAILED";
|
|
15
|
+
ConversationStatus["STOPPED"] = "STOPPED";
|
|
16
|
+
})(ConversationStatus || (ConversationStatus = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* User-visible conversation behavior.
|
|
7
|
+
*/
|
|
8
|
+
export var ConversationType;
|
|
9
|
+
(function (ConversationType) {
|
|
10
|
+
ConversationType["CHAT"] = "CHAT";
|
|
11
|
+
ConversationType["TASK"] = "TASK";
|
|
12
|
+
})(ConversationType || (ConversationType = {}));
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { AgentModelName } from './AgentModelName.js';
|
|
2
|
+
import type { ConversationType } from './ConversationType.js';
|
|
2
3
|
export type CreateConversationRequest = {
|
|
3
4
|
agent_name?: (string | null);
|
|
4
5
|
instructions?: (string | null);
|
|
6
|
+
metadata?: (Record<string, any> | null);
|
|
5
7
|
model_name?: (AgentModelName | null);
|
|
6
8
|
parent_id?: (string | null);
|
|
7
9
|
title?: (string | null);
|
|
10
|
+
type?: ConversationType;
|
|
8
11
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { FileNamespace } from './FileNamespace.js';
|
|
2
1
|
export type CreateFolderRequest = {
|
|
3
2
|
description?: (string | null);
|
|
4
3
|
name?: (string | null);
|
|
5
|
-
namespace?: (FileNamespace | null);
|
|
6
4
|
parent_id?: (string | null);
|
|
7
5
|
path?: (string | null);
|
|
8
|
-
visibility?: (string | null);
|
|
9
6
|
visibility_roles?: (Array<string> | null);
|
|
10
7
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { FileNamespace } from './FileNamespace.js';
|
|
2
1
|
export type DatastoreFileUploadRequest = {
|
|
3
2
|
data: string;
|
|
4
3
|
description?: (string | null);
|
|
5
4
|
directory_path?: string;
|
|
6
5
|
name?: (string | null);
|
|
7
|
-
namespace?: (FileNamespace | null);
|
|
8
6
|
search_enabled?: boolean;
|
|
9
7
|
visibility_roles?: (string | null);
|
|
10
8
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { FileNamespace } from './FileNamespace.js';
|
|
2
1
|
export type FileResponse = {
|
|
3
2
|
created_at: string;
|
|
4
3
|
description: (string | null);
|
|
@@ -9,7 +8,6 @@ export type FileResponse = {
|
|
|
9
8
|
metadata?: (Record<string, any> | null);
|
|
10
9
|
mime_type?: (string | null);
|
|
11
10
|
name: string;
|
|
12
|
-
namespace?: FileNamespace;
|
|
13
11
|
owner_user_id?: (string | null);
|
|
14
12
|
path: string;
|
|
15
13
|
pod_id: string;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type { FileNamespace } from './FileNamespace.js';
|
|
2
1
|
export type update = {
|
|
3
2
|
data?: (string | null);
|
|
4
3
|
description?: (string | null);
|
|
5
|
-
namespace?: (FileNamespace | null);
|
|
6
4
|
new_path?: (string | null);
|
|
7
5
|
path: string;
|
|
8
6
|
search_enabled?: (boolean | null);
|
|
9
|
-
visibility?: (string | null);
|
|
10
7
|
visibility_roles?: (string | null);
|
|
11
8
|
};
|