agentbase-web-sdk 2.6.0 → 2.7.0-fix2
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 -5
- package/dist/cjs/sdk.js +564 -22
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +564 -23
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +564 -22
- package/package.json +5 -2
- package/types/client.d.ts +2 -2
- package/types/enums/timezone.d.ts +0 -1
- package/types/index.d.ts +3 -2
- package/types/models.d.ts +20 -16
- package/types/services/account.d.ts +10 -10
- package/types/services/agent-runtime.d.ts +370 -0
- package/types/services/ai-gateway.d.ts +4 -1
- package/types/services/memory.d.ts +10 -7
- package/types/services/self-hosted-organizations.d.ts +4 -4
- package/types/services/storage.d.ts +6 -6
- package/types/services/teams.d.ts +6 -6
|
@@ -89,7 +89,8 @@ export declare class Memory {
|
|
|
89
89
|
* @param {Models.MemoryMessage[]} params.messages - Optional typed role/content messages used as source evidence.
|
|
90
90
|
* @param {string} params.agentId - Optional agent ID.
|
|
91
91
|
* @param {string} params.runId - Optional run ID.
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {string} params.sessionId - Optional conversation ID (max 128 characters). With infer=true, bounded history is loaded only for user, group, and project scopes; private and strict_private never hydrate history.
|
|
93
|
+
* @param {MemorySensitivity} params.sensitivity - Content classification. Secret values must use Agentbase Secret or variables.
|
|
93
94
|
* @param {MemoryHandlingPolicy} params.handlingPolicy - Processing restriction. no_model requires infer=false.
|
|
94
95
|
* @param {object} params.metadata - Memory metadata.
|
|
95
96
|
* @param {boolean} params.infer - Use configured model-assisted extraction and cross-type deduplication. Defaults to true.
|
|
@@ -107,6 +108,7 @@ export declare class Memory {
|
|
|
107
108
|
messages?: Models.MemoryMessage[];
|
|
108
109
|
agentId?: string;
|
|
109
110
|
runId?: string;
|
|
111
|
+
sessionId?: string;
|
|
110
112
|
sensitivity?: MemorySensitivity;
|
|
111
113
|
handlingPolicy?: MemoryHandlingPolicy;
|
|
112
114
|
metadata?: object;
|
|
@@ -125,7 +127,8 @@ export declare class Memory {
|
|
|
125
127
|
* @param {Models.MemoryMessage[]} messages - Optional typed role/content messages used as source evidence.
|
|
126
128
|
* @param {string} agentId - Optional agent ID.
|
|
127
129
|
* @param {string} runId - Optional run ID.
|
|
128
|
-
* @param {
|
|
130
|
+
* @param {string} sessionId - Optional conversation ID (max 128 characters). With infer=true, bounded history is loaded only for user, group, and project scopes; private and strict_private never hydrate history.
|
|
131
|
+
* @param {MemorySensitivity} sensitivity - Content classification. Secret values must use Agentbase Secret or variables.
|
|
129
132
|
* @param {MemoryHandlingPolicy} handlingPolicy - Processing restriction. no_model requires infer=false.
|
|
130
133
|
* @param {object} metadata - Memory metadata.
|
|
131
134
|
* @param {boolean} infer - Use configured model-assisted extraction and cross-type deduplication. Defaults to true.
|
|
@@ -135,7 +138,7 @@ export declare class Memory {
|
|
|
135
138
|
* @returns {Promise<{}>}
|
|
136
139
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
137
140
|
*/
|
|
138
|
-
create(userId: string, scope: MemoryScope, memoryType: string, recordKind: RecordKind, content?: string, messages?: Models.MemoryMessage[], agentId?: string, runId?: string, sensitivity?: MemorySensitivity, handlingPolicy?: MemoryHandlingPolicy, metadata?: object, infer?: boolean, reRemember?: boolean, async?: boolean): Promise<{}>;
|
|
141
|
+
create(userId: string, scope: MemoryScope, memoryType: string, recordKind: RecordKind, content?: string, messages?: Models.MemoryMessage[], agentId?: string, runId?: string, sessionId?: string, sensitivity?: MemorySensitivity, handlingPolicy?: MemoryHandlingPolicy, metadata?: object, infer?: boolean, reRemember?: boolean, async?: boolean): Promise<{}>;
|
|
139
142
|
/**
|
|
140
143
|
* Forget memory records in one bounded pass. Repeat while hasMore is true and inspect failed and items before considering the scope fully deleted.
|
|
141
144
|
*
|
|
@@ -1094,12 +1097,12 @@ export declare class Memory {
|
|
|
1094
1097
|
* @param {string} params.memorySubStoreId - Bound memory sub-store ID.
|
|
1095
1098
|
* @param {string} params.sourceId - Evidence source ID.
|
|
1096
1099
|
* @param {string} params.injectionId - Recall injection ID.
|
|
1097
|
-
* @param {VerificationSource} params.verificationSource - Deprecated caller hint;
|
|
1100
|
+
* @param {VerificationSource} params.verificationSource - Deprecated caller hint; Agentbase derives the trusted source from authentication.
|
|
1098
1101
|
* @param {string} params.toolName - Tool name.
|
|
1099
1102
|
* @param {string} params.toolVersion - Tool version.
|
|
1100
1103
|
* @param {string} params.toolSchemaVersion - Tool schema version.
|
|
1101
1104
|
* @param {string} params.errorFingerprint - Bounded error fingerprint.
|
|
1102
|
-
* @param {number} params.weight - Deprecated caller hint;
|
|
1105
|
+
* @param {number} params.weight - Deprecated caller hint; Agentbase derives the trusted weight from authentication.
|
|
1103
1106
|
* @param {string} params.observedAt - Observation timestamp.
|
|
1104
1107
|
* @param {string} params.idempotencyKey - Stable key used to deduplicate retries. May be supplied as the Idempotency-Key header.
|
|
1105
1108
|
* @throws {AgentbaseException}
|
|
@@ -1142,12 +1145,12 @@ export declare class Memory {
|
|
|
1142
1145
|
* @param {string} memorySubStoreId - Bound memory sub-store ID.
|
|
1143
1146
|
* @param {string} sourceId - Evidence source ID.
|
|
1144
1147
|
* @param {string} injectionId - Recall injection ID.
|
|
1145
|
-
* @param {VerificationSource} verificationSource - Deprecated caller hint;
|
|
1148
|
+
* @param {VerificationSource} verificationSource - Deprecated caller hint; Agentbase derives the trusted source from authentication.
|
|
1146
1149
|
* @param {string} toolName - Tool name.
|
|
1147
1150
|
* @param {string} toolVersion - Tool version.
|
|
1148
1151
|
* @param {string} toolSchemaVersion - Tool schema version.
|
|
1149
1152
|
* @param {string} errorFingerprint - Bounded error fingerprint.
|
|
1150
|
-
* @param {number} weight - Deprecated caller hint;
|
|
1153
|
+
* @param {number} weight - Deprecated caller hint; Agentbase derives the trusted weight from authentication.
|
|
1151
1154
|
* @param {string} observedAt - Observation timestamp.
|
|
1152
1155
|
* @param {string} idempotencyKey - Stable key used to deduplicate retries. May be supplied as the Idempotency-Key header.
|
|
1153
1156
|
* @throws {AgentbaseException}
|
|
@@ -433,12 +433,12 @@ export declare class SelfHostedOrganizations {
|
|
|
433
433
|
updateQuota(organizationId: string, maxMembers?: number): Promise<Models.SelfHostedOrganization>;
|
|
434
434
|
/**
|
|
435
435
|
* 获取组织唯一规范默认 Team(`defaultTeamId` 与 `defaultTeamInternalId` 精确匹配)下
|
|
436
|
-
*
|
|
436
|
+
* `deletionStatus` 为空且数据库 Pool 当前可用的活动项目用量汇总;待删除或删除中项目不会进入汇总和项目明细。调用者必须具有与当前 user generation、当前 organization
|
|
437
437
|
* generation 精确匹配的 active membership,且角色为组织 `owner`、`admin`、
|
|
438
438
|
* `analyst` 或 `billing`。无有效成员关系的调用者(包括平台管理员)按组织未找到处理,
|
|
439
439
|
* 其他 active 角色无权访问;普通 API Key 不能调用该组织控制面接口。
|
|
440
440
|
*
|
|
441
|
-
*
|
|
441
|
+
* 接口按活动项目游标分页读取各项目自身的 `stats` 数据。尚未初始化 `stats` collection 的新项目按零用量返回;数据库连接或查询错误不会被忽略。
|
|
442
442
|
*
|
|
443
443
|
* 当权威 pool.registry 已成功读取时,引用不存在或状态为 inactive、disabled、removed 的 Pool 的项目不会进入汇总;Registry 读取失败不等同于空 Registry,此时项目数据库错误仍会返回失败,避免静默返回少算的用量。
|
|
444
444
|
*
|
|
@@ -456,12 +456,12 @@ export declare class SelfHostedOrganizations {
|
|
|
456
456
|
}): Promise<Models.SelfHostedOrganizationUsage>;
|
|
457
457
|
/**
|
|
458
458
|
* 获取组织唯一规范默认 Team(`defaultTeamId` 与 `defaultTeamInternalId` 精确匹配)下
|
|
459
|
-
*
|
|
459
|
+
* `deletionStatus` 为空且数据库 Pool 当前可用的活动项目用量汇总;待删除或删除中项目不会进入汇总和项目明细。调用者必须具有与当前 user generation、当前 organization
|
|
460
460
|
* generation 精确匹配的 active membership,且角色为组织 `owner`、`admin`、
|
|
461
461
|
* `analyst` 或 `billing`。无有效成员关系的调用者(包括平台管理员)按组织未找到处理,
|
|
462
462
|
* 其他 active 角色无权访问;普通 API Key 不能调用该组织控制面接口。
|
|
463
463
|
*
|
|
464
|
-
*
|
|
464
|
+
* 接口按活动项目游标分页读取各项目自身的 `stats` 数据。尚未初始化 `stats` collection 的新项目按零用量返回;数据库连接或查询错误不会被忽略。
|
|
465
465
|
*
|
|
466
466
|
* 当权威 pool.registry 已成功读取时,引用不存在或状态为 inactive、disabled、removed 的 Pool 的项目不会进入汇总;Registry 读取失败不等同于空 Registry,此时项目数据库错误仍会返回失败,避免静默返回少算的用量。
|
|
467
467
|
*
|
|
@@ -34,18 +34,18 @@ export declare class Storage {
|
|
|
34
34
|
*/
|
|
35
35
|
listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.FileList>;
|
|
36
36
|
/**
|
|
37
|
-
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration]([HOSTNAME]/docs/server/storage#storageCreateBucket) API or directly from your
|
|
37
|
+
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration]([HOSTNAME]/docs/server/storage#storageCreateBucket) API or directly from your Agentbase console.
|
|
38
38
|
*
|
|
39
39
|
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
40
40
|
*
|
|
41
41
|
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
42
42
|
*
|
|
43
|
-
* If you're creating a new file using one of the
|
|
43
|
+
* If you're creating a new file using one of the Agentbase SDKs, all the chunking logic will be managed by the SDK internally.
|
|
44
44
|
*
|
|
45
45
|
*
|
|
46
46
|
* @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).
|
|
47
47
|
* @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
48
|
-
* @param {File} params.file - Binary file.
|
|
48
|
+
* @param {File} params.file - Binary file. Agentbase SDKs provide helpers to handle file input. [Learn about file input]([HOSTNAME]/docs/products/storage/upload-download#input-file).
|
|
49
49
|
* @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
50
50
|
* @throws {AgentbaseException}
|
|
51
51
|
* @returns {Promise<Models.File>}
|
|
@@ -58,18 +58,18 @@ export declare class Storage {
|
|
|
58
58
|
onProgress?: (progress: UploadProgress) => void;
|
|
59
59
|
}): Promise<Models.File>;
|
|
60
60
|
/**
|
|
61
|
-
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration]([HOSTNAME]/docs/server/storage#storageCreateBucket) API or directly from your
|
|
61
|
+
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration]([HOSTNAME]/docs/server/storage#storageCreateBucket) API or directly from your Agentbase console.
|
|
62
62
|
*
|
|
63
63
|
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
64
64
|
*
|
|
65
65
|
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
66
66
|
*
|
|
67
|
-
* If you're creating a new file using one of the
|
|
67
|
+
* If you're creating a new file using one of the Agentbase SDKs, all the chunking logic will be managed by the SDK internally.
|
|
68
68
|
*
|
|
69
69
|
*
|
|
70
70
|
* @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).
|
|
71
71
|
* @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
72
|
-
* @param {File} file - Binary file.
|
|
72
|
+
* @param {File} file - Binary file. Agentbase SDKs provide helpers to handle file input. [Learn about file input]([HOSTNAME]/docs/products/storage/upload-download#input-file).
|
|
73
73
|
* @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions]([HOSTNAME]/docs/permissions).
|
|
74
74
|
* @throws {AgentbaseException}
|
|
75
75
|
* @returns {Promise<Models.File>}
|
|
@@ -142,13 +142,13 @@ export declare class Teams {
|
|
|
142
142
|
*/
|
|
143
143
|
listMemberships(teamId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
|
|
144
144
|
/**
|
|
145
|
-
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK,
|
|
145
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Agentbase will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
146
146
|
*
|
|
147
|
-
* You only need to provide one of a user ID, email, or phone number.
|
|
147
|
+
* You only need to provide one of a user ID, email, or phone number. Agentbase will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
148
148
|
*
|
|
149
149
|
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status]([HOSTNAME]/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
150
150
|
*
|
|
151
|
-
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
151
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Agentbase will accept the only redirect URLs under the domains you have added as a platform on the Agentbase Console.
|
|
152
152
|
*
|
|
153
153
|
*
|
|
154
154
|
* @param {string} params.teamId - Team ID.
|
|
@@ -171,13 +171,13 @@ export declare class Teams {
|
|
|
171
171
|
name?: string;
|
|
172
172
|
}): Promise<Models.Membership>;
|
|
173
173
|
/**
|
|
174
|
-
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK,
|
|
174
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Agentbase will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
175
175
|
*
|
|
176
|
-
* You only need to provide one of a user ID, email, or phone number.
|
|
176
|
+
* You only need to provide one of a user ID, email, or phone number. Agentbase will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
177
177
|
*
|
|
178
178
|
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status]([HOSTNAME]/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
179
179
|
*
|
|
180
|
-
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
180
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Agentbase will accept the only redirect URLs under the domains you have added as a platform on the Agentbase Console.
|
|
181
181
|
*
|
|
182
182
|
*
|
|
183
183
|
* @param {string} teamId - Team ID.
|