agentbase-web-sdk 2.7.1 → 2.8.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 +2 -2
- package/dist/cjs/sdk.js +83 -5
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +83 -5
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +83 -5
- package/package.json +5 -4
- package/types/index.d.ts +1 -1
- package/types/models.d.ts +4 -0
- package/types/services/ai-gateway.d.ts +57 -0
- package/types/services/knowledge-bases.d.ts +4 -1
- package/types/services/memory.d.ts +4 -1
- package/types/services/storage.d.ts +8 -2
package/dist/iife/sdk.js
CHANGED
|
@@ -4393,7 +4393,7 @@
|
|
|
4393
4393
|
* Holds configuration such as project.
|
|
4394
4394
|
*/
|
|
4395
4395
|
this.config = {
|
|
4396
|
-
endpoint: 'https://
|
|
4396
|
+
endpoint: 'https://appbase.local/v1',
|
|
4397
4397
|
endpointRealtime: '',
|
|
4398
4398
|
project: '',
|
|
4399
4399
|
organization: '',
|
|
@@ -4412,9 +4412,9 @@
|
|
|
4412
4412
|
'x-sdk-name': 'Agentbase',
|
|
4413
4413
|
'x-sdk-platform': 'client',
|
|
4414
4414
|
'x-sdk-language': 'web',
|
|
4415
|
-
'x-sdk-version': '2.
|
|
4415
|
+
'x-sdk-version': '2.8.0',
|
|
4416
4416
|
'X-AppBase-SDK': 'true',
|
|
4417
|
-
'X-Appwrite-Response-Format': '2.
|
|
4417
|
+
'X-Appwrite-Response-Format': '2.8.0',
|
|
4418
4418
|
};
|
|
4419
4419
|
this.realtime = {
|
|
4420
4420
|
socket: undefined,
|
|
@@ -7900,6 +7900,51 @@
|
|
|
7900
7900
|
};
|
|
7901
7901
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
7902
7902
|
}
|
|
7903
|
+
listLogicalModelMounts(paramsOrFirst) {
|
|
7904
|
+
let params;
|
|
7905
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
7906
|
+
params = (paramsOrFirst || {});
|
|
7907
|
+
}
|
|
7908
|
+
else {
|
|
7909
|
+
params = {
|
|
7910
|
+
id: paramsOrFirst
|
|
7911
|
+
};
|
|
7912
|
+
}
|
|
7913
|
+
const id = params.id;
|
|
7914
|
+
if (typeof id === 'undefined') {
|
|
7915
|
+
throw new AgentbaseException('Missing required parameter: "id"');
|
|
7916
|
+
}
|
|
7917
|
+
const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
|
|
7918
|
+
const payload = {};
|
|
7919
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7920
|
+
const apiHeaders = {
|
|
7921
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
7922
|
+
};
|
|
7923
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
7924
|
+
}
|
|
7925
|
+
replaceLogicalModelMounts(paramsOrFirst) {
|
|
7926
|
+
let params;
|
|
7927
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
7928
|
+
params = (paramsOrFirst || {});
|
|
7929
|
+
}
|
|
7930
|
+
else {
|
|
7931
|
+
params = {
|
|
7932
|
+
id: paramsOrFirst
|
|
7933
|
+
};
|
|
7934
|
+
}
|
|
7935
|
+
const id = params.id;
|
|
7936
|
+
if (typeof id === 'undefined') {
|
|
7937
|
+
throw new AgentbaseException('Missing required parameter: "id"');
|
|
7938
|
+
}
|
|
7939
|
+
const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
|
|
7940
|
+
const payload = {};
|
|
7941
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7942
|
+
const apiHeaders = {
|
|
7943
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
7944
|
+
'content-type': 'application/json',
|
|
7945
|
+
};
|
|
7946
|
+
return this.client.call('put', uri, apiHeaders, payload);
|
|
7947
|
+
}
|
|
7903
7948
|
testModelDeployment(paramsOrFirst) {
|
|
7904
7949
|
let params;
|
|
7905
7950
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -8481,6 +8526,29 @@
|
|
|
8481
8526
|
};
|
|
8482
8527
|
return this.client.call('delete', uri, apiHeaders, payload);
|
|
8483
8528
|
}
|
|
8529
|
+
testToolConnection(paramsOrFirst) {
|
|
8530
|
+
let params;
|
|
8531
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
8532
|
+
params = (paramsOrFirst || {});
|
|
8533
|
+
}
|
|
8534
|
+
else {
|
|
8535
|
+
params = {
|
|
8536
|
+
id: paramsOrFirst
|
|
8537
|
+
};
|
|
8538
|
+
}
|
|
8539
|
+
const id = params.id;
|
|
8540
|
+
if (typeof id === 'undefined') {
|
|
8541
|
+
throw new AgentbaseException('Missing required parameter: "id"');
|
|
8542
|
+
}
|
|
8543
|
+
const apiPath = '/ai-gateway/tool-connections/{id}/test'.replace('{id}', id);
|
|
8544
|
+
const payload = {};
|
|
8545
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8546
|
+
const apiHeaders = {
|
|
8547
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8548
|
+
'content-type': 'application/json',
|
|
8549
|
+
};
|
|
8550
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
8551
|
+
}
|
|
8484
8552
|
}
|
|
8485
8553
|
|
|
8486
8554
|
class Avatars {
|
|
@@ -10225,13 +10293,15 @@
|
|
|
10225
10293
|
knowledgeBaseId: paramsOrFirst,
|
|
10226
10294
|
sessionId: rest[0],
|
|
10227
10295
|
urls: rest[1],
|
|
10228
|
-
idempotencyKey: rest[2]
|
|
10296
|
+
idempotencyKey: rest[2],
|
|
10297
|
+
versionId: rest[3]
|
|
10229
10298
|
};
|
|
10230
10299
|
}
|
|
10231
10300
|
const knowledgeBaseId = params.knowledgeBaseId;
|
|
10232
10301
|
const sessionId = params.sessionId;
|
|
10233
10302
|
const urls = params.urls;
|
|
10234
10303
|
const idempotencyKey = params.idempotencyKey;
|
|
10304
|
+
const versionId = params.versionId;
|
|
10235
10305
|
if (typeof knowledgeBaseId === 'undefined') {
|
|
10236
10306
|
throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
|
|
10237
10307
|
}
|
|
@@ -10252,6 +10322,9 @@
|
|
|
10252
10322
|
if (typeof idempotencyKey !== 'undefined') {
|
|
10253
10323
|
payload['idempotencyKey'] = idempotencyKey;
|
|
10254
10324
|
}
|
|
10325
|
+
if (typeof versionId !== 'undefined') {
|
|
10326
|
+
payload['versionId'] = versionId;
|
|
10327
|
+
}
|
|
10255
10328
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10256
10329
|
const apiHeaders = {
|
|
10257
10330
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -13107,13 +13180,15 @@
|
|
|
13107
13180
|
profileType: rest[0],
|
|
13108
13181
|
messages: rest[1],
|
|
13109
13182
|
sourceMemoryIds: rest[2],
|
|
13110
|
-
|
|
13183
|
+
sessionId: rest[3],
|
|
13184
|
+
mode: rest[4]
|
|
13111
13185
|
};
|
|
13112
13186
|
}
|
|
13113
13187
|
const userId = params.userId;
|
|
13114
13188
|
const profileType = params.profileType;
|
|
13115
13189
|
const messages = params.messages;
|
|
13116
13190
|
const sourceMemoryIds = params.sourceMemoryIds;
|
|
13191
|
+
const sessionId = params.sessionId;
|
|
13117
13192
|
const mode = params.mode;
|
|
13118
13193
|
if (typeof userId === 'undefined') {
|
|
13119
13194
|
throw new AgentbaseException('Missing required parameter: "userId"');
|
|
@@ -13129,6 +13204,9 @@
|
|
|
13129
13204
|
if (typeof sourceMemoryIds !== 'undefined') {
|
|
13130
13205
|
payload['sourceMemoryIds'] = sourceMemoryIds;
|
|
13131
13206
|
}
|
|
13207
|
+
if (typeof sessionId !== 'undefined') {
|
|
13208
|
+
payload['sessionId'] = sessionId;
|
|
13209
|
+
}
|
|
13132
13210
|
if (typeof mode !== 'undefined') {
|
|
13133
13211
|
payload['mode'] = mode;
|
|
13134
13212
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentbase-web-sdk",
|
|
3
|
-
"homepage": "
|
|
3
|
+
"homepage": "https://appbase.local/support",
|
|
4
4
|
"description": "",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.8.0",
|
|
6
6
|
"license": "",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "npm run build:types && npm run build:libs",
|
|
28
28
|
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
|
|
29
|
-
"build:libs": "rollup -c"
|
|
29
|
+
"build:libs": "rollup -c",
|
|
30
|
+
"test": "node test/build-output.test.js"
|
|
30
31
|
},
|
|
31
32
|
"engines": {
|
|
32
33
|
"node": ">=18.0.0"
|
|
@@ -48,6 +49,6 @@
|
|
|
48
49
|
"jsdelivr": "dist/iife/sdk.js",
|
|
49
50
|
"unpkg": "dist/iife/sdk.js",
|
|
50
51
|
"agentbase_provenance": {
|
|
51
|
-
"build_manifest_sha256": "
|
|
52
|
+
"build_manifest_sha256": "ae62fff9e9d2c1b81a7040fafaa455cc9a28981039d541cd6e8843c74b172d96"
|
|
52
53
|
}
|
|
53
54
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agentbase Agentbase SDK
|
|
3
3
|
*
|
|
4
|
-
* This SDK is compatible with Appwrite server version 2.
|
|
4
|
+
* This SDK is compatible with Appwrite server version 2.8.x.
|
|
5
5
|
* For older versions, please check
|
|
6
6
|
* [previous releases](https://github.com/agentbase/agentbase-web-sdk/releases).
|
|
7
7
|
*/
|
package/types/models.d.ts
CHANGED
|
@@ -2194,6 +2194,10 @@ export declare namespace Models {
|
|
|
2194
2194
|
* Knowledge base ID this document belongs to.
|
|
2195
2195
|
*/
|
|
2196
2196
|
kbId: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Knowledge Base Version ID for Version-scoped documents.
|
|
2199
|
+
*/
|
|
2200
|
+
versionId?: string;
|
|
2197
2201
|
/**
|
|
2198
2202
|
* Document name.
|
|
2199
2203
|
*/
|
|
@@ -300,6 +300,44 @@ export declare class AiGateway {
|
|
|
300
300
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
301
301
|
*/
|
|
302
302
|
dryRunPolicy(policyEngineId: string): Promise<{}>;
|
|
303
|
+
/**
|
|
304
|
+
* Manage unified AI Gateway control-plane resources.
|
|
305
|
+
*
|
|
306
|
+
* @param {string} params.id - id path parameter.
|
|
307
|
+
* @throws {AgentbaseException}
|
|
308
|
+
* @returns {Promise<{}>}
|
|
309
|
+
*/
|
|
310
|
+
listLogicalModelMounts(params: {
|
|
311
|
+
id: string;
|
|
312
|
+
}): Promise<{}>;
|
|
313
|
+
/**
|
|
314
|
+
* Manage unified AI Gateway control-plane resources.
|
|
315
|
+
*
|
|
316
|
+
* @param {string} id - id path parameter.
|
|
317
|
+
* @throws {AgentbaseException}
|
|
318
|
+
* @returns {Promise<{}>}
|
|
319
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
320
|
+
*/
|
|
321
|
+
listLogicalModelMounts(id: string): Promise<{}>;
|
|
322
|
+
/**
|
|
323
|
+
* Manage unified AI Gateway control-plane resources.
|
|
324
|
+
*
|
|
325
|
+
* @param {string} params.id - id path parameter.
|
|
326
|
+
* @throws {AgentbaseException}
|
|
327
|
+
* @returns {Promise<{}>}
|
|
328
|
+
*/
|
|
329
|
+
replaceLogicalModelMounts(params: {
|
|
330
|
+
id: string;
|
|
331
|
+
}): Promise<{}>;
|
|
332
|
+
/**
|
|
333
|
+
* Manage unified AI Gateway control-plane resources.
|
|
334
|
+
*
|
|
335
|
+
* @param {string} id - id path parameter.
|
|
336
|
+
* @throws {AgentbaseException}
|
|
337
|
+
* @returns {Promise<{}>}
|
|
338
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
339
|
+
*/
|
|
340
|
+
replaceLogicalModelMounts(id: string): Promise<{}>;
|
|
303
341
|
/**
|
|
304
342
|
* Manage unified AI Gateway control-plane resources.
|
|
305
343
|
*
|
|
@@ -738,4 +776,23 @@ export declare class AiGateway {
|
|
|
738
776
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
739
777
|
*/
|
|
740
778
|
deleteToolConnection(id: string): Promise<{}>;
|
|
779
|
+
/**
|
|
780
|
+
* Manage unified AI Gateway control-plane resources.
|
|
781
|
+
*
|
|
782
|
+
* @param {string} params.id - id path parameter.
|
|
783
|
+
* @throws {AgentbaseException}
|
|
784
|
+
* @returns {Promise<{}>}
|
|
785
|
+
*/
|
|
786
|
+
testToolConnection(params: {
|
|
787
|
+
id: string;
|
|
788
|
+
}): Promise<{}>;
|
|
789
|
+
/**
|
|
790
|
+
* Manage unified AI Gateway control-plane resources.
|
|
791
|
+
*
|
|
792
|
+
* @param {string} id - id path parameter.
|
|
793
|
+
* @throws {AgentbaseException}
|
|
794
|
+
* @returns {Promise<{}>}
|
|
795
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
796
|
+
*/
|
|
797
|
+
testToolConnection(id: string): Promise<{}>;
|
|
741
798
|
}
|
|
@@ -15,6 +15,7 @@ export declare class KnowledgeBases {
|
|
|
15
15
|
* @param {string} params.sessionId - Yuque OAuth session ID from createYuqueOAuthSession.
|
|
16
16
|
* @param {string[]} params.urls - Yuque document URLs to import. Maximum 20 URLs.
|
|
17
17
|
* @param {string} params.idempotencyKey - Optional batch idempotency key prefix.
|
|
18
|
+
* @param {string} params.versionId - Optional DRAFT Version ID. Required for writes when Versioning is ACTIVE.
|
|
18
19
|
* @throws {AgentbaseException}
|
|
19
20
|
* @returns {Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>}
|
|
20
21
|
*/
|
|
@@ -23,6 +24,7 @@ export declare class KnowledgeBases {
|
|
|
23
24
|
sessionId: string;
|
|
24
25
|
urls: string[];
|
|
25
26
|
idempotencyKey?: string;
|
|
27
|
+
versionId?: string;
|
|
26
28
|
}): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
27
29
|
/**
|
|
28
30
|
* Import the current user's personal Yuque documents by URL using an authorized Yuque OAuth session. No team data source is required. Document ownership uses `source=yuque:personal`.
|
|
@@ -36,11 +38,12 @@ export declare class KnowledgeBases {
|
|
|
36
38
|
* @param {string} sessionId - Yuque OAuth session ID from createYuqueOAuthSession.
|
|
37
39
|
* @param {string[]} urls - Yuque document URLs to import. Maximum 20 URLs.
|
|
38
40
|
* @param {string} idempotencyKey - Optional batch idempotency key prefix.
|
|
41
|
+
* @param {string} versionId - Optional DRAFT Version ID. Required for writes when Versioning is ACTIVE.
|
|
39
42
|
* @throws {AgentbaseException}
|
|
40
43
|
* @returns {Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>}
|
|
41
44
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
42
45
|
*/
|
|
43
|
-
createYuqueDocuments(knowledgeBaseId: string, sessionId: string, urls: string[], idempotencyKey?: string): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
46
|
+
createYuqueDocuments(knowledgeBaseId: string, sessionId: string, urls: string[], idempotencyKey?: string, versionId?: string): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
44
47
|
/**
|
|
45
48
|
* Delete the current signed-in user's locally stored Yuque OAuth credential for this project. This endpoint is idempotent and returns `204 No Content` when no credential exists. It removes only the encrypted Agentbase copy; it does not revoke the authorization at Yuque.
|
|
46
49
|
*
|
|
@@ -1528,6 +1528,7 @@ export declare class Memory {
|
|
|
1528
1528
|
* @param {ProfileType} params.profileType - Profile type.
|
|
1529
1529
|
* @param {Models.MemoryMessage[]} params.messages - Typed role/content messages used as source evidence.
|
|
1530
1530
|
* @param {string[]} params.sourceMemoryIds - Existing memory IDs used as replacement evidence.
|
|
1531
|
+
* @param {string} params.sessionId - Optional conversation ID used to correlate profile extraction observability.
|
|
1531
1532
|
* @param {ProfileExtractionMode} params.mode - Incrementally update or replace the profile.
|
|
1532
1533
|
* @throws {AgentbaseException}
|
|
1533
1534
|
* @returns {Promise<{}>}
|
|
@@ -1537,6 +1538,7 @@ export declare class Memory {
|
|
|
1537
1538
|
profileType?: ProfileType;
|
|
1538
1539
|
messages?: Models.MemoryMessage[];
|
|
1539
1540
|
sourceMemoryIds?: string[];
|
|
1541
|
+
sessionId?: string;
|
|
1540
1542
|
mode?: ProfileExtractionMode;
|
|
1541
1543
|
}): Promise<{}>;
|
|
1542
1544
|
/**
|
|
@@ -1546,12 +1548,13 @@ export declare class Memory {
|
|
|
1546
1548
|
* @param {ProfileType} profileType - Profile type.
|
|
1547
1549
|
* @param {Models.MemoryMessage[]} messages - Typed role/content messages used as source evidence.
|
|
1548
1550
|
* @param {string[]} sourceMemoryIds - Existing memory IDs used as replacement evidence.
|
|
1551
|
+
* @param {string} sessionId - Optional conversation ID used to correlate profile extraction observability.
|
|
1549
1552
|
* @param {ProfileExtractionMode} mode - Incrementally update or replace the profile.
|
|
1550
1553
|
* @throws {AgentbaseException}
|
|
1551
1554
|
* @returns {Promise<{}>}
|
|
1552
1555
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1553
1556
|
*/
|
|
1554
|
-
createProfileExtraction(userId: string, profileType?: ProfileType, messages?: Models.MemoryMessage[], sourceMemoryIds?: string[], mode?: ProfileExtractionMode): Promise<{}>;
|
|
1557
|
+
createProfileExtraction(userId: string, profileType?: ProfileType, messages?: Models.MemoryMessage[], sourceMemoryIds?: string[], sessionId?: string, mode?: ProfileExtractionMode): Promise<{}>;
|
|
1555
1558
|
/**
|
|
1556
1559
|
* Create a user memory profile rebuild.
|
|
1557
1560
|
*
|
|
@@ -6,7 +6,10 @@ export declare class Storage {
|
|
|
6
6
|
client: Client;
|
|
7
7
|
constructor(client: Client);
|
|
8
8
|
/**
|
|
9
|
-
* Get a list of
|
|
9
|
+
* Get a list of files allowed by the existing bucket and file permissions.
|
|
10
|
+
*
|
|
11
|
+
* When the bucket has `clientFileListing=false`, application clients (including unauthenticated requests, anonymous sessions, user sessions and JWTs) cannot list files. Authenticated server and project management requests remain subject to project authorization and the `files.read` scope. This setting does not change upload or individual file access permissions. Missing or null values retain the previous listing behavior.
|
|
12
|
+
*
|
|
10
13
|
*
|
|
11
14
|
* @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration]([HOSTNAME]/docs/server/storage#createBucket).
|
|
12
15
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
@@ -22,7 +25,10 @@ export declare class Storage {
|
|
|
22
25
|
total?: boolean;
|
|
23
26
|
}): Promise<Models.FileList>;
|
|
24
27
|
/**
|
|
25
|
-
* Get a list of
|
|
28
|
+
* Get a list of files allowed by the existing bucket and file permissions.
|
|
29
|
+
*
|
|
30
|
+
* When the bucket has `clientFileListing=false`, application clients (including unauthenticated requests, anonymous sessions, user sessions and JWTs) cannot list files. Authenticated server and project management requests remain subject to project authorization and the `files.read` scope. This setting does not change upload or individual file access permissions. Missing or null values retain the previous listing behavior.
|
|
31
|
+
*
|
|
26
32
|
*
|
|
27
33
|
* @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration]([HOSTNAME]/docs/server/storage#createBucket).
|
|
28
34
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries]([HOSTNAME]/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|