@alfe.ai/agent-api-client 0.1.2 → 0.1.4
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/dist/index.cjs +75 -13
- package/dist/index.d.cts +64 -310
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +64 -310
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,41 +116,91 @@ var AgentApiClient = class {
|
|
|
116
116
|
async getRegistry() {
|
|
117
117
|
return this.request("/integrations/registry");
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns every connected Google account for the agent. Multi-account by
|
|
121
|
+
* design — the openclaw-google plugin requires the LLM to pass `email`
|
|
122
|
+
* explicitly to `google_run_command` so an account is always selected
|
|
123
|
+
* deliberately.
|
|
124
|
+
*
|
|
125
|
+
* 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,
|
|
126
|
+
* `refreshToken`, `accessToken`, etc., populated from the default account)
|
|
127
|
+
* is gone. Iterate over `accounts`.
|
|
128
|
+
*/
|
|
119
129
|
async getGoogleCredentials() {
|
|
120
|
-
return this.request("/agent/google/
|
|
130
|
+
return { accounts: (await this.request("/agent/connect/google/accounts")).accounts.map((a) => ({
|
|
131
|
+
email: a.accountIdentifier,
|
|
132
|
+
refreshToken: a.refreshToken ?? "",
|
|
133
|
+
clientId: a.clientId ?? "",
|
|
134
|
+
clientSecret: a.clientSecret ?? "",
|
|
135
|
+
displayName: a.displayName ?? void 0,
|
|
136
|
+
connectedAt: a.connectedAt
|
|
137
|
+
})) };
|
|
121
138
|
}
|
|
122
139
|
async disconnectGoogleAccount(email) {
|
|
123
|
-
return this.request(`/agent/google/accounts/${encodeURIComponent(email)}`, { method: "DELETE" })
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
140
|
+
return { accounts: (await this.request(`/agent/connect/google/accounts/${encodeURIComponent(email)}`, { method: "DELETE" })).accounts.map((a) => ({
|
|
141
|
+
email: a.accountIdentifier,
|
|
142
|
+
displayName: a.displayName ?? void 0,
|
|
143
|
+
connectedAt: a.connectedAt
|
|
144
|
+
})) };
|
|
127
145
|
}
|
|
128
146
|
async getGoogleChatCredentials() {
|
|
129
147
|
return this.request("/agent/google-chat/credentials");
|
|
130
148
|
}
|
|
131
149
|
async getGithubCredentials() {
|
|
132
|
-
|
|
150
|
+
const raw = await this.request("/agent/connect/github/credentials");
|
|
151
|
+
return {
|
|
152
|
+
login: raw.login,
|
|
153
|
+
accessToken: raw.accessToken
|
|
154
|
+
};
|
|
133
155
|
}
|
|
134
156
|
async getXeroCredentials() {
|
|
135
|
-
|
|
157
|
+
const raw = await this.request("/agent/connect/xero/credentials");
|
|
158
|
+
return {
|
|
159
|
+
accessToken: raw.accessToken,
|
|
160
|
+
accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
|
|
161
|
+
xeroTenantId: raw.xeroTenantId ?? ""
|
|
162
|
+
};
|
|
136
163
|
}
|
|
137
164
|
async refreshXeroToken() {
|
|
138
|
-
return this.request("/agent/xero/
|
|
165
|
+
return this.request("/agent/connect/xero/refresh", { method: "POST" });
|
|
139
166
|
}
|
|
140
167
|
async getNotionCredentials() {
|
|
141
|
-
|
|
168
|
+
const raw = await this.request("/agent/connect/notion/credentials");
|
|
169
|
+
return {
|
|
170
|
+
accessToken: raw.accessToken,
|
|
171
|
+
workspaceId: raw.workspaceId ?? "",
|
|
172
|
+
workspaceName: raw.workspaceName ?? ""
|
|
173
|
+
};
|
|
142
174
|
}
|
|
143
175
|
async getAtlassianCredentials() {
|
|
144
|
-
|
|
176
|
+
const raw = await this.request("/agent/connect/atlassian/credentials");
|
|
177
|
+
return {
|
|
178
|
+
accessToken: raw.accessToken,
|
|
179
|
+
refreshToken: "",
|
|
180
|
+
accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
|
|
181
|
+
cloudId: raw.cloudId ?? "",
|
|
182
|
+
siteName: raw.siteName ?? "",
|
|
183
|
+
siteUrl: raw.siteUrl ?? "",
|
|
184
|
+
email: "",
|
|
185
|
+
enabledProducts: [],
|
|
186
|
+
clientId: raw.clientId,
|
|
187
|
+
clientSecret: raw.clientSecret
|
|
188
|
+
};
|
|
145
189
|
}
|
|
146
190
|
async refreshAtlassianToken() {
|
|
147
|
-
return this.request("/agent/atlassian/
|
|
191
|
+
return this.request("/agent/connect/atlassian/refresh", { method: "POST" });
|
|
148
192
|
}
|
|
149
193
|
async getMYOBCredentials() {
|
|
150
|
-
|
|
194
|
+
const raw = await this.request("/agent/connect/myob/credentials");
|
|
195
|
+
return {
|
|
196
|
+
accessToken: raw.accessToken,
|
|
197
|
+
accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
|
|
198
|
+
myobBusinessId: raw.myobBusinessId,
|
|
199
|
+
clientId: raw.clientId
|
|
200
|
+
};
|
|
151
201
|
}
|
|
152
202
|
async refreshMYOBToken() {
|
|
153
|
-
return this.request("/agent/myob/
|
|
203
|
+
return this.request("/agent/connect/myob/refresh", { method: "POST" });
|
|
154
204
|
}
|
|
155
205
|
async getTeamsCredentials() {
|
|
156
206
|
return this.request("/agent/microsoft/credentials");
|
|
@@ -268,6 +318,18 @@ var AgentApiClient = class {
|
|
|
268
318
|
async listSecretScopes() {
|
|
269
319
|
return (await this.request("/agent/secrets/scopes")).scopes;
|
|
270
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Returns the calling agent's own identity context — `{ agentId, tenantId }`
|
|
323
|
+
* decoded server-side from the agent API token. Used by the
|
|
324
|
+
* `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
|
|
325
|
+
* OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
|
|
326
|
+
* Plugins should cache this for the daemon's lifetime (single-agent-per-
|
|
327
|
+
* process invariant). One HTTP round-trip per process activate; not for
|
|
328
|
+
* per-call use.
|
|
329
|
+
*/
|
|
330
|
+
async whoami() {
|
|
331
|
+
return this.request("/agent/identity/whoami");
|
|
332
|
+
}
|
|
271
333
|
async resolveIdentity(args) {
|
|
272
334
|
return this.request("/agent/identity/resolve", {
|
|
273
335
|
method: "POST",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,262 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ChangelogAction, ChangelogActor, ChangelogEntry, ChangelogEntry as ChangelogEntry$1, EncryptedEnvelopeV1, EncryptedEnvelopeV1 as EncryptedEnvelopeV1$1, Field, FieldEnvelope, FieldEnvelope as FieldEnvelope$1, FieldFormat, FieldFormat as FieldFormat$1, FieldSensitivity, FieldSensitivity as FieldSensitivity$1, FieldView, GeneratedDataKey, GeneratedDataKey as GeneratedDataKey$1, IntegrationConfigResult, IntegrationConfigResult as IntegrationConfigResult$1, IntegrationConfigSchemaField, IntegrationInstall, IntegrationInstall as IntegrationInstall$1, RegistryEntry, RegistryEntry as RegistryEntry$1, ScopeInfo, ScopeInfo as ScopeInfo$1, SecretAggregate, SecretAggregate as SecretAggregate$1, SecretCategory, SecretCategory as SecretCategory$1, SecretMetadata, SecretMetadata as SecretMetadata$1, SecretScope, SecretScope as SecretScope$1 } from "@alfe/types";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* The four resource scopes at which a permission can apply.
|
|
5
|
-
* Order is meaningful: broader scopes first (`org`) → narrower last (`agent`).
|
|
6
|
-
*
|
|
7
|
-
* `IntegrationScope` in integration.ts and `SecretScope` in secrets.ts are
|
|
8
|
-
* intentional aliases of this same enum — there is only one concept of
|
|
9
|
-
* "scope" in Alfe.
|
|
10
|
-
*/
|
|
11
|
-
declare const ResourceScope: {
|
|
12
|
-
readonly Org: "org";
|
|
13
|
-
readonly Team: "team";
|
|
14
|
-
readonly Project: "project";
|
|
15
|
-
readonly Agent: "agent";
|
|
16
|
-
};
|
|
17
|
-
type ResourceScope = (typeof ResourceScope)[keyof typeof ResourceScope];
|
|
18
|
-
/** Ordered tuple of resource scope string values (broad → narrow). */
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region ../../packages-internal/types/dist/integration.d.ts
|
|
21
|
-
/** Controls where an integration appears: public (everyone), hidden (nowhere) */
|
|
22
|
-
declare const IntegrationVisibility: {
|
|
23
|
-
readonly Public: "public";
|
|
24
|
-
readonly Hidden: "hidden";
|
|
25
|
-
};
|
|
26
|
-
type IntegrationVisibility = (typeof IntegrationVisibility)[keyof typeof IntegrationVisibility];
|
|
27
|
-
/** Scope at which an integration is installed */
|
|
28
|
-
declare const IntegrationScope: {
|
|
29
|
-
readonly Org: "org";
|
|
30
|
-
readonly Team: "team";
|
|
31
|
-
readonly Project: "project";
|
|
32
|
-
readonly Agent: "agent";
|
|
33
|
-
};
|
|
34
|
-
type IntegrationScope = ResourceScope;
|
|
35
|
-
declare const IntegrationDesiredStatus: {
|
|
36
|
-
readonly Active: "active";
|
|
37
|
-
readonly Removed: "removed";
|
|
38
|
-
};
|
|
39
|
-
type IntegrationDesiredStatus = (typeof IntegrationDesiredStatus)[keyof typeof IntegrationDesiredStatus];
|
|
40
|
-
declare const IntegrationActualStatus: {
|
|
41
|
-
readonly Installing: "installing";
|
|
42
|
-
readonly Active: "active";
|
|
43
|
-
readonly Error: "error";
|
|
44
|
-
readonly Removing: "removing";
|
|
45
|
-
readonly Inactive: "inactive";
|
|
46
|
-
readonly Unknown: "unknown";
|
|
47
|
-
};
|
|
48
|
-
type IntegrationActualStatus = (typeof IntegrationActualStatus)[keyof typeof IntegrationActualStatus];
|
|
49
|
-
interface IntegrationInstall {
|
|
50
|
-
scope: IntegrationScope;
|
|
51
|
-
scopeId: string;
|
|
52
|
-
integrationId: string;
|
|
53
|
-
tenantId: string;
|
|
54
|
-
desiredStatus: IntegrationDesiredStatus;
|
|
55
|
-
actualStatus: IntegrationActualStatus;
|
|
56
|
-
version: string;
|
|
57
|
-
config: Record<string, unknown>;
|
|
58
|
-
errorMessage: string;
|
|
59
|
-
installedAt: string;
|
|
60
|
-
updatedAt: string;
|
|
61
|
-
}
|
|
62
|
-
/** @deprecated Use IntegrationInstall instead */
|
|
63
|
-
|
|
64
|
-
interface IntegrationConfigSchemaField {
|
|
65
|
-
key: string;
|
|
66
|
-
label: string;
|
|
67
|
-
type: string;
|
|
68
|
-
description?: string;
|
|
69
|
-
required?: boolean;
|
|
70
|
-
default?: string | number | boolean;
|
|
71
|
-
options?: string[];
|
|
72
|
-
select_options?: {
|
|
73
|
-
value: string;
|
|
74
|
-
label: string;
|
|
75
|
-
}[];
|
|
76
|
-
oauth_provider?: string;
|
|
77
|
-
oauth_scopes?: string[];
|
|
78
|
-
oauth_integration_id?: string;
|
|
79
|
-
editable?: string;
|
|
80
|
-
hidden?: boolean;
|
|
81
|
-
}
|
|
82
|
-
interface IntegrationConfigResult {
|
|
83
|
-
integrationId: string;
|
|
84
|
-
config: Record<string, unknown>;
|
|
85
|
-
configSchema: IntegrationConfigSchemaField[];
|
|
86
|
-
}
|
|
87
|
-
interface RegistryEntry {
|
|
88
|
-
id: string;
|
|
89
|
-
name: string;
|
|
90
|
-
description: string;
|
|
91
|
-
versions: string[];
|
|
92
|
-
latest: string;
|
|
93
|
-
repository: string;
|
|
94
|
-
commit: string;
|
|
95
|
-
icon?: string;
|
|
96
|
-
author?: {
|
|
97
|
-
name: string;
|
|
98
|
-
url?: string;
|
|
99
|
-
} | string;
|
|
100
|
-
pricing?: {
|
|
101
|
-
type: "free" | "paid" | "usage";
|
|
102
|
-
price?: number;
|
|
103
|
-
currency?: string;
|
|
104
|
-
interval?: "month" | "year";
|
|
105
|
-
description?: string;
|
|
106
|
-
};
|
|
107
|
-
features?: string[];
|
|
108
|
-
preview_images?: string[];
|
|
109
|
-
config_schema?: IntegrationConfigSchemaField[];
|
|
110
|
-
supported_agents?: string[];
|
|
111
|
-
/** Scopes where this integration can be installed */
|
|
112
|
-
supported_scopes?: IntegrationScope[];
|
|
113
|
-
/** Visibility status — controls where integration appears */
|
|
114
|
-
visibility?: IntegrationVisibility;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=integration.d.ts.map
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region ../../packages-internal/types/dist/secrets.d.ts
|
|
119
|
-
/** Scope levels at which a secret can be owned. Aliased to ResourceScope. */
|
|
120
|
-
type SecretScope = ResourceScope;
|
|
121
|
-
/**
|
|
122
|
-
* v1 encrypted envelope as persisted by services/secrets and exchanged with
|
|
123
|
-
* agents. Values are AES-256-GCM ciphertext; iv/authTag/ciphertext/dataKeyCiphertext
|
|
124
|
-
* are all base64-encoded.
|
|
125
|
-
*/
|
|
126
|
-
interface EncryptedEnvelopeV1 {
|
|
127
|
-
version: 1;
|
|
128
|
-
iv: string;
|
|
129
|
-
ciphertext: string;
|
|
130
|
-
authTag: string;
|
|
131
|
-
dataKeyCiphertext: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Display/validation hint for a field's value. `"json"` signals that the
|
|
135
|
-
* string is a JSON-stringified payload that consumers should `JSON.parse`.
|
|
136
|
-
*/
|
|
137
|
-
declare const FIELD_FORMATS: readonly ["text", "email", "url", "phone", "date", "number", "json"];
|
|
138
|
-
type FieldFormat = (typeof FIELD_FORMATS)[number];
|
|
139
|
-
/**
|
|
140
|
-
* Whether a field is stored in plaintext (visible to anyone with read access)
|
|
141
|
-
* or encrypted (requires KMS + the right encryption context to read).
|
|
142
|
-
*/
|
|
143
|
-
declare const FIELD_SENSITIVITIES: readonly ["plaintext", "encrypted"];
|
|
144
|
-
type FieldSensitivity = (typeof FIELD_SENSITIVITIES)[number];
|
|
145
|
-
/**
|
|
146
|
-
* A field on a secret. `value` is always a string at the wire; for encrypted
|
|
147
|
-
* fields it's the plaintext at the API edge (the service encrypts before
|
|
148
|
-
* persistence). Reads from the dashboard omit `value` for encrypted fields;
|
|
149
|
-
* agents get a `FieldEnvelope` instead and decrypt locally.
|
|
150
|
-
*/
|
|
151
|
-
interface Field {
|
|
152
|
-
key: string;
|
|
153
|
-
format?: FieldFormat;
|
|
154
|
-
sensitivity: FieldSensitivity;
|
|
155
|
-
value: string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Secret category — drives icon/template/filter behaviour. Defaults to
|
|
159
|
-
* `"other"` for migrated rows.
|
|
160
|
-
*/
|
|
161
|
-
declare const SECRET_CATEGORIES: readonly ["login", "api_key", "database", "ssh_key", "certificate", "secure_note", "credit_card", "identity", "wifi", "other"];
|
|
162
|
-
type SecretCategory = (typeof SECRET_CATEGORIES)[number];
|
|
163
|
-
/**
|
|
164
|
-
* One field as exposed to readers. Encrypted fields have no `value` on the
|
|
165
|
-
* dashboard read path; the agent-side aggregate carries `envelope` instead.
|
|
166
|
-
*/
|
|
167
|
-
interface FieldView {
|
|
168
|
-
key: string;
|
|
169
|
-
format?: FieldFormat;
|
|
170
|
-
sensitivity: FieldSensitivity;
|
|
171
|
-
/** Present for `sensitivity: "plaintext"` only. */
|
|
172
|
-
value?: string;
|
|
173
|
-
/** Present for `sensitivity: "encrypted"` on agent-side reads only. */
|
|
174
|
-
envelope?: EncryptedEnvelopeV1;
|
|
175
|
-
/** Plaintext fields that opt into `format: "json"` are pre-parsed for callers. */
|
|
176
|
-
parsedValue?: unknown;
|
|
177
|
-
rotatedAt?: string;
|
|
178
|
-
createdAt: string;
|
|
179
|
-
updatedAt: string;
|
|
180
|
-
}
|
|
181
|
-
/** A secret as assembled from its multi-row aggregate. */
|
|
182
|
-
interface SecretAggregate {
|
|
183
|
-
secretId: string;
|
|
184
|
-
secretName: string;
|
|
185
|
-
description?: string;
|
|
186
|
-
tags: string[];
|
|
187
|
-
category: SecretCategory;
|
|
188
|
-
fields: FieldView[];
|
|
189
|
-
changelogVersion: number;
|
|
190
|
-
createdAt: string;
|
|
191
|
-
updatedAt: string;
|
|
192
|
-
}
|
|
193
|
-
/** Metadata-only projection — used by list endpoints. */
|
|
194
|
-
interface SecretMetadata {
|
|
195
|
-
secretId: string;
|
|
196
|
-
secretName: string;
|
|
197
|
-
description?: string;
|
|
198
|
-
tags: string[];
|
|
199
|
-
category: SecretCategory;
|
|
200
|
-
fieldKeys: string[];
|
|
201
|
-
changelogVersion: number;
|
|
202
|
-
createdAt: string;
|
|
203
|
-
updatedAt: string;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Per-field encrypted envelope returned to agents on the agent-side aggregate.
|
|
207
|
-
* Agents decrypt locally using a data key fetched from `/decrypt-data-key`.
|
|
208
|
-
*/
|
|
209
|
-
interface FieldEnvelope {
|
|
210
|
-
key: string;
|
|
211
|
-
format?: FieldFormat;
|
|
212
|
-
envelope: EncryptedEnvelopeV1;
|
|
213
|
-
rotatedAt?: string;
|
|
214
|
-
createdAt: string;
|
|
215
|
-
updatedAt: string;
|
|
216
|
-
}
|
|
217
|
-
/** A scope the caller can read or write secrets in. */
|
|
218
|
-
interface ScopeInfo {
|
|
219
|
-
scope: SecretScope;
|
|
220
|
-
scopeId: string;
|
|
221
|
-
name?: string;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* KMS-issued data key, returned by the secrets service's
|
|
225
|
-
* `/secrets/generate-data-key` KMS proxy endpoint. The plaintext key is
|
|
226
|
-
* returned base64-encoded; callers MUST decode it to a Buffer and zero the
|
|
227
|
-
* Buffer after use — never keep the plaintext as a JS string.
|
|
228
|
-
*/
|
|
229
|
-
interface GeneratedDataKey {
|
|
230
|
-
plaintextKey: string;
|
|
231
|
-
dataKeyCiphertext: string;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Action types recorded in the secret changelog. Append-only.
|
|
235
|
-
*/
|
|
236
|
-
declare const CHANGELOG_ACTIONS: readonly ["created", "deleted", "metadata_updated", "field_added", "field_rotated", "field_removed", "tag_added", "tag_removed"];
|
|
237
|
-
type ChangelogAction = (typeof CHANGELOG_ACTIONS)[number];
|
|
238
|
-
/** Who triggered a changelog entry. */
|
|
239
|
-
interface ChangelogActor {
|
|
240
|
-
kind: "user" | "agent" | "system";
|
|
241
|
-
id: string;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* One audit row from the secret's changelog. Metadata only — never carries
|
|
245
|
-
* field VALUES (old or new). Rolling back a rotated secret is intentionally
|
|
246
|
-
* not supported.
|
|
247
|
-
*/
|
|
248
|
-
interface ChangelogEntry {
|
|
249
|
-
changelogVersion: number;
|
|
250
|
-
action: ChangelogAction;
|
|
251
|
-
fieldKey?: string;
|
|
252
|
-
fieldSensitivity?: FieldSensitivity;
|
|
253
|
-
changedBy: ChangelogActor;
|
|
254
|
-
reason?: string;
|
|
255
|
-
timestamp: string;
|
|
256
|
-
}
|
|
257
|
-
//# sourceMappingURL=secrets.d.ts.map
|
|
258
|
-
//#endregion
|
|
259
3
|
//#region src/index.d.ts
|
|
4
|
+
|
|
260
5
|
interface AgentApiClientConfig {
|
|
261
6
|
apiKey: string;
|
|
262
7
|
apiUrl: string;
|
|
@@ -402,14 +147,14 @@ declare class AgentApiClient {
|
|
|
402
147
|
downloadUrl: string;
|
|
403
148
|
expiresIn: number;
|
|
404
149
|
}>;
|
|
405
|
-
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
406
|
-
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
150
|
+
listIntegrations(): Promise<IntegrationInstall$1[]>;
|
|
151
|
+
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult$1>;
|
|
407
152
|
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
408
153
|
installIntegration(integrationId: string, options?: {
|
|
409
154
|
version?: string;
|
|
410
155
|
config?: Record<string, unknown>;
|
|
411
|
-
}): Promise<IntegrationInstall>;
|
|
412
|
-
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
156
|
+
}): Promise<IntegrationInstall$1>;
|
|
157
|
+
removeIntegration(integrationId: string): Promise<IntegrationInstall$1>;
|
|
413
158
|
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
414
159
|
url: string;
|
|
415
160
|
provider: string;
|
|
@@ -421,37 +166,33 @@ declare class AgentApiClient {
|
|
|
421
166
|
config?: Record<string, string>;
|
|
422
167
|
}>;
|
|
423
168
|
getRegistry(): Promise<{
|
|
424
|
-
integrations: RegistryEntry[];
|
|
169
|
+
integrations: RegistryEntry$1[];
|
|
425
170
|
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Returns every connected Google account for the agent. Multi-account by
|
|
173
|
+
* design — the openclaw-google plugin requires the LLM to pass `email`
|
|
174
|
+
* explicitly to `google_run_command` so an account is always selected
|
|
175
|
+
* deliberately.
|
|
176
|
+
*
|
|
177
|
+
* 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,
|
|
178
|
+
* `refreshToken`, `accessToken`, etc., populated from the default account)
|
|
179
|
+
* is gone. Iterate over `accounts`.
|
|
180
|
+
*/
|
|
426
181
|
getGoogleCredentials(): Promise<{
|
|
427
|
-
accounts
|
|
182
|
+
accounts: {
|
|
428
183
|
email: string;
|
|
429
184
|
refreshToken: string;
|
|
430
185
|
clientId: string;
|
|
431
186
|
clientSecret: string;
|
|
432
|
-
enabledServices?: string[];
|
|
433
|
-
isDefault: boolean;
|
|
434
187
|
displayName?: string;
|
|
188
|
+
connectedAt?: string;
|
|
435
189
|
}[];
|
|
436
|
-
email: string;
|
|
437
|
-
refreshToken: string;
|
|
438
|
-
clientId: string;
|
|
439
|
-
clientSecret: string;
|
|
440
|
-
projectId: string;
|
|
441
|
-
enabledServices?: string[];
|
|
442
190
|
}>;
|
|
443
191
|
disconnectGoogleAccount(email: string): Promise<{
|
|
444
192
|
accounts: {
|
|
445
193
|
email: string;
|
|
446
194
|
displayName?: string;
|
|
447
|
-
|
|
448
|
-
}[];
|
|
449
|
-
}>;
|
|
450
|
-
setDefaultGoogleAccount(email: string): Promise<{
|
|
451
|
-
accounts: {
|
|
452
|
-
email: string;
|
|
453
|
-
displayName?: string;
|
|
454
|
-
isDefault: boolean;
|
|
195
|
+
connectedAt?: string;
|
|
455
196
|
}[];
|
|
456
197
|
}>;
|
|
457
198
|
getGoogleChatCredentials(): Promise<{
|
|
@@ -559,11 +300,11 @@ declare class AgentApiClient {
|
|
|
559
300
|
* to reach them.
|
|
560
301
|
*/
|
|
561
302
|
generateSecretDataKey(args: {
|
|
562
|
-
scope: SecretScope;
|
|
303
|
+
scope: SecretScope$1;
|
|
563
304
|
scopeId: string;
|
|
564
305
|
secretId: string;
|
|
565
306
|
fieldKey: string;
|
|
566
|
-
}): Promise<GeneratedDataKey>;
|
|
307
|
+
}): Promise<GeneratedDataKey$1>;
|
|
567
308
|
/**
|
|
568
309
|
* Unwrap a wrapped data key so the agent can decrypt the envelope locally.
|
|
569
310
|
* `fieldKey` MUST match the value supplied when the data key was generated
|
|
@@ -571,7 +312,7 @@ declare class AgentApiClient {
|
|
|
571
312
|
* `InvalidCiphertextException`.
|
|
572
313
|
*/
|
|
573
314
|
decryptSecretDataKey(args: {
|
|
574
|
-
scope: SecretScope;
|
|
315
|
+
scope: SecretScope$1;
|
|
575
316
|
scopeId: string;
|
|
576
317
|
secretId: string;
|
|
577
318
|
fieldKey: string;
|
|
@@ -586,57 +327,57 @@ declare class AgentApiClient {
|
|
|
586
327
|
* Plaintext fields ship the value inline.
|
|
587
328
|
*/
|
|
588
329
|
createSecret(args: {
|
|
589
|
-
scope: SecretScope;
|
|
330
|
+
scope: SecretScope$1;
|
|
590
331
|
scopeId: string;
|
|
591
332
|
secretId: string;
|
|
592
333
|
secretName: string;
|
|
593
|
-
category?: SecretCategory;
|
|
334
|
+
category?: SecretCategory$1;
|
|
594
335
|
description?: string;
|
|
595
336
|
tags?: string[];
|
|
596
337
|
fields: {
|
|
597
338
|
key: string;
|
|
598
|
-
format?: FieldFormat;
|
|
599
|
-
sensitivity: FieldSensitivity;
|
|
339
|
+
format?: FieldFormat$1;
|
|
340
|
+
sensitivity: FieldSensitivity$1;
|
|
600
341
|
value?: string;
|
|
601
|
-
envelope?: EncryptedEnvelopeV1;
|
|
342
|
+
envelope?: EncryptedEnvelopeV1$1;
|
|
602
343
|
}[];
|
|
603
344
|
reason?: string;
|
|
604
|
-
}): Promise<SecretAggregate>;
|
|
345
|
+
}): Promise<SecretAggregate$1>;
|
|
605
346
|
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
606
347
|
getSecret(args: {
|
|
607
|
-
scope: SecretScope;
|
|
348
|
+
scope: SecretScope$1;
|
|
608
349
|
scopeId: string;
|
|
609
350
|
secretId: string;
|
|
610
351
|
}): Promise<{
|
|
611
|
-
aggregate: SecretAggregate;
|
|
612
|
-
envelopes: FieldEnvelope[];
|
|
352
|
+
aggregate: SecretAggregate$1;
|
|
353
|
+
envelopes: FieldEnvelope$1[];
|
|
613
354
|
}>;
|
|
614
355
|
/** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
|
|
615
356
|
getSecretField(args: {
|
|
616
|
-
scope: SecretScope;
|
|
357
|
+
scope: SecretScope$1;
|
|
617
358
|
scopeId: string;
|
|
618
359
|
secretId: string;
|
|
619
360
|
fieldKey: string;
|
|
620
361
|
}): Promise<{
|
|
621
362
|
key: string;
|
|
622
|
-
sensitivity: FieldSensitivity;
|
|
623
|
-
format?: FieldFormat;
|
|
363
|
+
sensitivity: FieldSensitivity$1;
|
|
364
|
+
format?: FieldFormat$1;
|
|
624
365
|
value?: string;
|
|
625
|
-
envelope?: EncryptedEnvelopeV1;
|
|
366
|
+
envelope?: EncryptedEnvelopeV1$1;
|
|
626
367
|
rotatedAt?: string;
|
|
627
368
|
createdAt: string;
|
|
628
369
|
updatedAt: string;
|
|
629
370
|
}>;
|
|
630
371
|
/** Add OR rotate one field. */
|
|
631
372
|
setSecretField(args: {
|
|
632
|
-
scope: SecretScope;
|
|
373
|
+
scope: SecretScope$1;
|
|
633
374
|
scopeId: string;
|
|
634
375
|
secretId: string;
|
|
635
376
|
fieldKey: string;
|
|
636
|
-
sensitivity: FieldSensitivity;
|
|
637
|
-
format?: FieldFormat;
|
|
377
|
+
sensitivity: FieldSensitivity$1;
|
|
378
|
+
format?: FieldFormat$1;
|
|
638
379
|
value?: string;
|
|
639
|
-
envelope?: EncryptedEnvelopeV1;
|
|
380
|
+
envelope?: EncryptedEnvelopeV1$1;
|
|
640
381
|
reason?: string;
|
|
641
382
|
}): Promise<{
|
|
642
383
|
fieldKey: string;
|
|
@@ -644,49 +385,62 @@ declare class AgentApiClient {
|
|
|
644
385
|
}>;
|
|
645
386
|
/** Remove one field. */
|
|
646
387
|
removeSecretField(args: {
|
|
647
|
-
scope: SecretScope;
|
|
388
|
+
scope: SecretScope$1;
|
|
648
389
|
scopeId: string;
|
|
649
390
|
secretId: string;
|
|
650
391
|
fieldKey: string;
|
|
651
392
|
}): Promise<void>;
|
|
652
393
|
/** Update secret-level metadata (name/description/tags/category). */
|
|
653
394
|
updateSecretMetadata(args: {
|
|
654
|
-
scope: SecretScope;
|
|
395
|
+
scope: SecretScope$1;
|
|
655
396
|
scopeId: string;
|
|
656
397
|
secretId: string;
|
|
657
398
|
secretName?: string;
|
|
658
399
|
description?: string;
|
|
659
400
|
tags?: string[];
|
|
660
|
-
category?: SecretCategory;
|
|
401
|
+
category?: SecretCategory$1;
|
|
661
402
|
reason?: string;
|
|
662
|
-
}): Promise<SecretAggregate>;
|
|
403
|
+
}): Promise<SecretAggregate$1>;
|
|
663
404
|
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
664
405
|
listSecrets(args: {
|
|
665
|
-
scope: SecretScope;
|
|
406
|
+
scope: SecretScope$1;
|
|
666
407
|
scopeId: string;
|
|
667
|
-
category?: SecretCategory;
|
|
408
|
+
category?: SecretCategory$1;
|
|
668
409
|
tag?: string;
|
|
669
410
|
fieldKey?: string;
|
|
670
|
-
}): Promise<SecretMetadata[]>;
|
|
411
|
+
}): Promise<SecretMetadata$1[]>;
|
|
671
412
|
/** Bounded changelog read — metadata-only audit entries. */
|
|
672
413
|
getSecretHistory(args: {
|
|
673
|
-
scope: SecretScope;
|
|
414
|
+
scope: SecretScope$1;
|
|
674
415
|
scopeId: string;
|
|
675
416
|
secretId: string;
|
|
676
417
|
limit?: number;
|
|
677
418
|
cursor?: string;
|
|
678
419
|
}): Promise<{
|
|
679
|
-
entries: ChangelogEntry[];
|
|
420
|
+
entries: ChangelogEntry$1[];
|
|
680
421
|
nextCursor?: string;
|
|
681
422
|
}>;
|
|
682
423
|
/** Delete a secret (and all its field rows + tag rows + changelog rows). */
|
|
683
424
|
deleteSecret(args: {
|
|
684
|
-
scope: SecretScope;
|
|
425
|
+
scope: SecretScope$1;
|
|
685
426
|
scopeId: string;
|
|
686
427
|
secretId: string;
|
|
687
428
|
}): Promise<void>;
|
|
688
429
|
/** Enumerate scopes (org/team/project/agent) this agent can access. */
|
|
689
|
-
listSecretScopes(): Promise<ScopeInfo[]>;
|
|
430
|
+
listSecretScopes(): Promise<ScopeInfo$1[]>;
|
|
431
|
+
/**
|
|
432
|
+
* Returns the calling agent's own identity context — `{ agentId, tenantId }`
|
|
433
|
+
* decoded server-side from the agent API token. Used by the
|
|
434
|
+
* `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
|
|
435
|
+
* OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
|
|
436
|
+
* Plugins should cache this for the daemon's lifetime (single-agent-per-
|
|
437
|
+
* process invariant). One HTTP round-trip per process activate; not for
|
|
438
|
+
* per-call use.
|
|
439
|
+
*/
|
|
440
|
+
whoami(): Promise<{
|
|
441
|
+
agentId: string;
|
|
442
|
+
tenantId: string;
|
|
443
|
+
}>;
|
|
690
444
|
resolveIdentity(args: {
|
|
691
445
|
provider: string;
|
|
692
446
|
platformId: string;
|