@alfe.ai/agent-api-client 0.1.3 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["PERMISSION_CATALOG","Record","TENANT_ALLOWED_SUBJECTS","TenantAllowedSubject","ResourceScope","RESOURCE_SCOPES","AccessLevel","ScopedAccess","AllScopedAccess","ResourceScope","DEFAULT_INTEGRATIONS","IntegrationVisibility","INTEGRATION_VISIBILITIES","IntegrationScope","INTEGRATION_SCOPES","IntegrationDesiredStatus","INTEGRATION_DESIRED_STATUSES","IntegrationActualStatus","INTEGRATION_ACTUAL_STATUSES","IntegrationInstall","Record","AgentIntegration","OrgIntegration","IntegrationConfigSchemaField","IntegrationConfigResult","RegistryEntry","ResourceScope","SecretScope","SECRET_SCOPES","EncryptedEnvelopeV1","FIELD_FORMATS","FieldFormat","FIELD_SENSITIVITIES","FieldSensitivity","Field","SECRET_CATEGORIES","SecretCategory","FieldView","SecretAggregate","SecretMetadata","FieldEnvelope","ScopeInfo","GeneratedDataKey","CHANGELOG_ACTIONS","ChangelogAction","ChangelogActor","ChangelogEntry"],"sources":["../../../packages-internal/types/dist/access.d.ts","../../../packages-internal/types/dist/integration.d.ts","../../../packages-internal/types/dist/secrets.d.ts","../src/index.ts"],"sourcesContent":["/**\n * Runtime catalog of declared permission subjects + allowed actions.\n *\n * Mirrors the compile-time `PermissionDefinitions` augmentation in\n * `@alfe/api-core/auriclabs-roles.ts`. Kept here so browser code\n * (dashboard) can consume it without pulling in server-only deps\n * (`@middy/core`, `aws-lambda`, etc.).\n */\nexport declare const PERMISSION_CATALOG: Record<string, readonly string[]>;\n/**\n * Subjects a tenant may grant via a custom role.\n *\n * Excludes `all` (platform-admin escape hatch) and `admin_*` subjects.\n */\nexport declare const TENANT_ALLOWED_SUBJECTS: readonly [\"agent\", \"sync\", \"integration\", \"secret\", \"database\", \"template\", \"org_file\", \"team\", \"project\", \"model_policy\", \"role_management\", \"billing\", \"identity\", \"token\", \"user\", \"gateway\", \"voice\"];\nexport type TenantAllowedSubject = (typeof TENANT_ALLOWED_SUBJECTS)[number];\n/**\n * The four resource scopes at which a permission can apply.\n * Order is meaningful: broader scopes first (`org`) → narrower last (`agent`).\n *\n * `IntegrationScope` in integration.ts and `SecretScope` in secrets.ts are\n * intentional aliases of this same enum — there is only one concept of\n * \"scope\" in Alfe.\n */\nexport declare const ResourceScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type ResourceScope = (typeof ResourceScope)[keyof typeof ResourceScope];\n/** Ordered tuple of resource scope string values (broad → narrow). */\nexport declare const RESOURCE_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const AccessLevel: {\n readonly None: \"none\";\n readonly Read: \"read\";\n readonly Write: \"write\";\n readonly Manage: \"manage\";\n};\nexport type AccessLevel = (typeof AccessLevel)[keyof typeof AccessLevel];\nexport interface ScopedAccess {\n scope: ResourceScope;\n scopeId: string;\n accessLevel: AccessLevel;\n /** Resolved role label (e.g. \"org_admin\", \"team_member\") */\n role: string;\n}\nexport interface AllScopedAccess {\n orgAccess: ScopedAccess;\n teamAccess: ScopedAccess[];\n projectAccess: ScopedAccess[];\n}\n//# sourceMappingURL=access.d.ts.map","import { ResourceScope } from \"./access.js\";\n/** Integrations auto-installed for ALL agents regardless of hosting type. Cannot be removed. */\nexport declare const DEFAULT_INTEGRATIONS: readonly string[];\n/** Controls where an integration appears: public (everyone), hidden (nowhere) */\nexport declare const IntegrationVisibility: {\n readonly Public: \"public\";\n readonly Hidden: \"hidden\";\n};\nexport type IntegrationVisibility = (typeof IntegrationVisibility)[keyof typeof IntegrationVisibility];\nexport declare const INTEGRATION_VISIBILITIES: readonly [\"public\" | \"hidden\", ...(\"public\" | \"hidden\")[]];\n/** Scope at which an integration is installed */\nexport declare const IntegrationScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type IntegrationScope = ResourceScope;\nexport declare const INTEGRATION_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const IntegrationDesiredStatus: {\n readonly Active: \"active\";\n readonly Removed: \"removed\";\n};\nexport type IntegrationDesiredStatus = (typeof IntegrationDesiredStatus)[keyof typeof IntegrationDesiredStatus];\nexport declare const INTEGRATION_DESIRED_STATUSES: readonly [\"active\" | \"removed\", ...(\"active\" | \"removed\")[]];\nexport declare const IntegrationActualStatus: {\n readonly Installing: \"installing\";\n readonly Active: \"active\";\n readonly Error: \"error\";\n readonly Removing: \"removing\";\n readonly Inactive: \"inactive\";\n readonly Unknown: \"unknown\";\n};\nexport type IntegrationActualStatus = (typeof IntegrationActualStatus)[keyof typeof IntegrationActualStatus];\nexport declare const INTEGRATION_ACTUAL_STATUSES: readonly [\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\", ...(\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\")[]];\nexport interface IntegrationInstall {\n scope: IntegrationScope;\n scopeId: string;\n integrationId: string;\n tenantId: string;\n desiredStatus: IntegrationDesiredStatus;\n actualStatus: IntegrationActualStatus;\n version: string;\n config: Record<string, unknown>;\n errorMessage: string;\n installedAt: string;\n updatedAt: string;\n}\n/** @deprecated Use IntegrationInstall instead */\nexport type AgentIntegration = IntegrationInstall;\n/** Org-scoped integration install */\nexport type OrgIntegration = IntegrationInstall;\nexport interface IntegrationConfigSchemaField {\n key: string;\n label: string;\n type: string;\n description?: string;\n required?: boolean;\n default?: string | number | boolean;\n options?: string[];\n select_options?: {\n value: string;\n label: string;\n }[];\n oauth_provider?: string;\n oauth_scopes?: string[];\n oauth_integration_id?: string;\n editable?: string;\n hidden?: boolean;\n}\nexport interface IntegrationConfigResult {\n integrationId: string;\n config: Record<string, unknown>;\n configSchema: IntegrationConfigSchemaField[];\n}\nexport interface RegistryEntry {\n id: string;\n name: string;\n description: string;\n versions: string[];\n latest: string;\n repository: string;\n commit: string;\n icon?: string;\n author?: {\n name: string;\n url?: string;\n } | string;\n pricing?: {\n type: \"free\" | \"paid\" | \"usage\";\n price?: number;\n currency?: string;\n interval?: \"month\" | \"year\";\n description?: string;\n };\n features?: string[];\n preview_images?: string[];\n config_schema?: IntegrationConfigSchemaField[];\n supported_agents?: string[];\n /** Scopes where this integration can be installed */\n supported_scopes?: IntegrationScope[];\n /** Visibility status — controls where integration appears */\n visibility?: IntegrationVisibility;\n}\n//# sourceMappingURL=integration.d.ts.map","/**\n * Secrets types — shared between services/secrets, @alfe.ai/agent-api-client,\n * the openclaw-secrets plugin, and dashboard clients.\n *\n * Server-side crypto and KMS glue live in @alfe/secret-store (Node/AWS-only);\n * this module is a pure, dependency-free shape contract safe for every\n * environment the agent-api-client ships to.\n */\nimport type { ResourceScope } from \"./access.js\";\n/** Scope levels at which a secret can be owned. Aliased to ResourceScope. */\nexport type SecretScope = ResourceScope;\nexport declare const SECRET_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\n/**\n * v1 encrypted envelope as persisted by services/secrets and exchanged with\n * agents. Values are AES-256-GCM ciphertext; iv/authTag/ciphertext/dataKeyCiphertext\n * are all base64-encoded.\n */\nexport interface EncryptedEnvelopeV1 {\n version: 1;\n iv: string;\n ciphertext: string;\n authTag: string;\n dataKeyCiphertext: string;\n}\n/**\n * Display/validation hint for a field's value. `\"json\"` signals that the\n * string is a JSON-stringified payload that consumers should `JSON.parse`.\n */\nexport declare const FIELD_FORMATS: readonly [\"text\", \"email\", \"url\", \"phone\", \"date\", \"number\", \"json\"];\nexport type FieldFormat = (typeof FIELD_FORMATS)[number];\n/**\n * Whether a field is stored in plaintext (visible to anyone with read access)\n * or encrypted (requires KMS + the right encryption context to read).\n */\nexport declare const FIELD_SENSITIVITIES: readonly [\"plaintext\", \"encrypted\"];\nexport type FieldSensitivity = (typeof FIELD_SENSITIVITIES)[number];\n/**\n * A field on a secret. `value` is always a string at the wire; for encrypted\n * fields it's the plaintext at the API edge (the service encrypts before\n * persistence). Reads from the dashboard omit `value` for encrypted fields;\n * agents get a `FieldEnvelope` instead and decrypt locally.\n */\nexport interface Field {\n key: string;\n format?: FieldFormat;\n sensitivity: FieldSensitivity;\n value: string;\n}\n/**\n * Secret category — drives icon/template/filter behaviour. Defaults to\n * `\"other\"` for migrated rows.\n */\nexport declare const SECRET_CATEGORIES: readonly [\"login\", \"api_key\", \"database\", \"ssh_key\", \"certificate\", \"secure_note\", \"credit_card\", \"identity\", \"wifi\", \"other\"];\nexport type SecretCategory = (typeof SECRET_CATEGORIES)[number];\n/**\n * One field as exposed to readers. Encrypted fields have no `value` on the\n * dashboard read path; the agent-side aggregate carries `envelope` instead.\n */\nexport interface FieldView {\n key: string;\n format?: FieldFormat;\n sensitivity: FieldSensitivity;\n /** Present for `sensitivity: \"plaintext\"` only. */\n value?: string;\n /** Present for `sensitivity: \"encrypted\"` on agent-side reads only. */\n envelope?: EncryptedEnvelopeV1;\n /** Plaintext fields that opt into `format: \"json\"` are pre-parsed for callers. */\n parsedValue?: unknown;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n}\n/** A secret as assembled from its multi-row aggregate. */\nexport interface SecretAggregate {\n secretId: string;\n secretName: string;\n description?: string;\n tags: string[];\n category: SecretCategory;\n fields: FieldView[];\n changelogVersion: number;\n createdAt: string;\n updatedAt: string;\n}\n/** Metadata-only projection — used by list endpoints. */\nexport interface SecretMetadata {\n secretId: string;\n secretName: string;\n description?: string;\n tags: string[];\n category: SecretCategory;\n fieldKeys: string[];\n changelogVersion: number;\n createdAt: string;\n updatedAt: string;\n}\n/**\n * Per-field encrypted envelope returned to agents on the agent-side aggregate.\n * Agents decrypt locally using a data key fetched from `/decrypt-data-key`.\n */\nexport interface FieldEnvelope {\n key: string;\n format?: FieldFormat;\n envelope: EncryptedEnvelopeV1;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n}\n/** A scope the caller can read or write secrets in. */\nexport interface ScopeInfo {\n scope: SecretScope;\n scopeId: string;\n name?: string;\n}\n/**\n * KMS-issued data key, returned by the secrets service's\n * `/secrets/generate-data-key` KMS proxy endpoint. The plaintext key is\n * returned base64-encoded; callers MUST decode it to a Buffer and zero the\n * Buffer after use — never keep the plaintext as a JS string.\n */\nexport interface GeneratedDataKey {\n plaintextKey: string;\n dataKeyCiphertext: string;\n}\n/**\n * Action types recorded in the secret changelog. Append-only.\n */\nexport declare const CHANGELOG_ACTIONS: readonly [\"created\", \"deleted\", \"metadata_updated\", \"field_added\", \"field_rotated\", \"field_removed\", \"tag_added\", \"tag_removed\"];\nexport type ChangelogAction = (typeof CHANGELOG_ACTIONS)[number];\n/** Who triggered a changelog entry. */\nexport interface ChangelogActor {\n kind: \"user\" | \"agent\" | \"system\";\n id: string;\n}\n/**\n * One audit row from the secret's changelog. Metadata only — never carries\n * field VALUES (old or new). Rolling back a rotated secret is intentionally\n * not supported.\n */\nexport interface ChangelogEntry {\n changelogVersion: number;\n action: ChangelogAction;\n fieldKey?: string;\n fieldSensitivity?: FieldSensitivity;\n changedBy: ChangelogActor;\n reason?: string;\n timestamp: string;\n}\n//# sourceMappingURL=secrets.d.ts.map"],"mappings":";;ACWA;AAMA;AAEA;AAIA;;;;;AAEqBiB,cDDAb,aCQpB,EAAA;EACWa,SAAAA,GAAAA,EAAAA,KAAAA;EAAuB,SAAA,IAAA,EAAA,MAAA;WAAWA,OAAAA,EAAAA,SAAAA;WAAsCA,KAAAA,EAAAA,OAAAA;CAAuB;AAE1FE,KDLLf,aAAAA,GCKuB,CAAA,ODLCA,aCKD,CAAA,CAAA,MAAA,ODL6BA,aCK7B,CAAA;;;;;ADLCA,cC1BfO,qBD0BeP,EAAAA;WAA4BA,MAAAA,EAAAA,QAAAA;EAAa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2B;;;;+BAII;;;;;;;;;;MAY/B;;;;MAUA;;;;;MAWA;iCASiC;;;;;;;;;;;MAcjC"}
package/dist/index.js CHANGED
@@ -115,41 +115,362 @@ var AgentApiClient = class {
115
115
  async getRegistry() {
116
116
  return this.request("/integrations/registry");
117
117
  }
118
+ /**
119
+ * Returns every connected Google account for the agent. Multi-account by
120
+ * design — the openclaw-google plugin requires the LLM to pass `email`
121
+ * explicitly to `google_run_command` so an account is always selected
122
+ * deliberately.
123
+ *
124
+ * 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,
125
+ * `refreshToken`, `accessToken`, etc., populated from the default account)
126
+ * is gone. Iterate over `accounts`.
127
+ */
118
128
  async getGoogleCredentials() {
119
- return this.request("/agent/google/credentials");
129
+ return { accounts: (await this.request("/agent/connect/google/accounts")).accounts.map((a) => ({
130
+ email: a.accountIdentifier,
131
+ refreshToken: a.refreshToken ?? "",
132
+ clientId: a.clientId ?? "",
133
+ clientSecret: a.clientSecret ?? "",
134
+ displayName: a.displayName ?? void 0,
135
+ connectedAt: a.connectedAt
136
+ })) };
120
137
  }
121
138
  async disconnectGoogleAccount(email) {
122
- return this.request(`/agent/google/accounts/${encodeURIComponent(email)}`, { method: "DELETE" });
123
- }
124
- async setDefaultGoogleAccount(email) {
125
- return this.request(`/agent/google/accounts/${encodeURIComponent(email)}/default`, { method: "PUT" });
139
+ return { accounts: (await this.request(`/agent/connect/google/accounts/${encodeURIComponent(email)}`, { method: "DELETE" })).accounts.map((a) => ({
140
+ email: a.accountIdentifier,
141
+ displayName: a.displayName ?? void 0,
142
+ connectedAt: a.connectedAt
143
+ })) };
126
144
  }
127
145
  async getGoogleChatCredentials() {
128
146
  return this.request("/agent/google-chat/credentials");
129
147
  }
148
+ /**
149
+ * @deprecated Returns a single primary credential blob (legacy "pick-the-
150
+ * default-connection" shape). Use `getGithubAccounts()` for the multi-
151
+ * account shape required by Pattern A — explicit selector args on every
152
+ * tool. Retained because the `@alfe.ai/openclaw-github` proxy is the
153
+ * only consumer that knows about Pattern A; legacy env-interpolation
154
+ * callers will keep hitting `/credentials` until they move to the proxy.
155
+ */
130
156
  async getGithubCredentials() {
131
- return this.request("/agent/github/credentials");
157
+ const raw = await this.request("/agent/connect/github/credentials");
158
+ return {
159
+ login: raw.login,
160
+ accessToken: raw.accessToken
161
+ };
132
162
  }
163
+ /**
164
+ * Pattern A: multi-account credential fetch for GitHub.
165
+ *
166
+ * Returns every agent-scoped GitHub connection. The caller is expected
167
+ * to require a `login` selector on every credential-touching tool and
168
+ * look up the matching account at dispatch time.
169
+ *
170
+ * GitHub OAuth tokens have no expiry (`tokenLifecycle: "no_expiry"`),
171
+ * so there is intentionally no `refreshGithubAccountToken` method — if
172
+ * a token is revoked the user must re-run the OAuth flow.
173
+ *
174
+ * Returned `accounts[i].login` is the GitHub username — the stable
175
+ * cross-session identifier the LLM should pass.
176
+ */
177
+ async getGithubAccounts() {
178
+ return { accounts: (await this.request("/agent/connect/github/accounts")).accounts.map((a) => ({
179
+ connectionId: a.connectionId,
180
+ accountIdentifier: a.accountIdentifier,
181
+ displayName: a.displayName,
182
+ connectedAt: a.connectedAt,
183
+ accessToken: a.accessToken ?? "",
184
+ login: a.login ?? a.accountIdentifier,
185
+ scopes: a.scopes ?? ""
186
+ })) };
187
+ }
188
+ /**
189
+ * @deprecated Returns a single primary credential blob (legacy "pick-the-
190
+ * default-connection" shape). Use `getXeroAccounts()` for the multi-
191
+ * account shape required by Pattern A — explicit selector args on every
192
+ * tool. This method will be removed once all consumers migrate.
193
+ */
133
194
  async getXeroCredentials() {
134
- return this.request("/agent/xero/credentials");
195
+ const raw = await this.request("/agent/connect/xero/credentials");
196
+ return {
197
+ accessToken: raw.accessToken,
198
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
199
+ xeroTenantId: raw.xeroTenantId ?? ""
200
+ };
201
+ }
202
+ /**
203
+ * Pattern A: multi-account credential fetch for Xero. Returns every
204
+ * agent-scoped Xero connection. The caller is expected to require a
205
+ * selector arg (e.g. `xeroTenantId`) on every credential-touching tool
206
+ * and look up the matching account by that selector at dispatch time.
207
+ *
208
+ * Returned `accounts[i].accountIdentifier` is the Xero tenantId — the
209
+ * stable cross-session identifier the LLM should pass.
210
+ */
211
+ async getXeroAccounts() {
212
+ return { accounts: (await this.request("/agent/connect/xero/accounts")).accounts.map((a) => ({
213
+ connectionId: a.connectionId,
214
+ accountIdentifier: a.accountIdentifier,
215
+ displayName: a.displayName,
216
+ connectedAt: a.connectedAt,
217
+ accessToken: a.accessToken,
218
+ accessTokenExpiresAt: a.accessTokenExpiresAt ?? "",
219
+ xeroTenantId: a.xeroTenantId ?? a.accountIdentifier
220
+ })) };
135
221
  }
136
222
  async refreshXeroToken() {
137
- return this.request("/agent/xero/token", { method: "POST" });
223
+ return this.request("/agent/connect/xero/refresh", { method: "POST" });
224
+ }
225
+ /**
226
+ * Pattern A: refresh a specific Xero connection by its `accountIdentifier`
227
+ * (the Xero `tenantId`). The legacy `refreshXeroToken()` only refreshes
228
+ * the *primary* connection, which is wrong for multi-tenant Xero where
229
+ * each tenant has its own non-interchangeable access token.
230
+ */
231
+ async refreshXeroAccountToken(xeroTenantId) {
232
+ const path = `/agent/connect/xero/accounts/${encodeURIComponent(xeroTenantId)}/refresh`;
233
+ const raw = await this.request(path, { method: "POST" });
234
+ return {
235
+ accessToken: raw.accessToken,
236
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
237
+ expiresAt: raw.expiresAt ?? ""
238
+ };
138
239
  }
240
+ /**
241
+ * @deprecated Returns a single primary credential blob (legacy "pick-the-
242
+ * default-connection" shape). Use `getNotionAccounts()` for the multi-
243
+ * account shape required by Pattern A.
244
+ */
139
245
  async getNotionCredentials() {
140
- return this.request("/agent/notion/credentials");
246
+ const raw = await this.request("/agent/connect/notion/credentials");
247
+ return {
248
+ accessToken: raw.accessToken,
249
+ workspaceId: raw.workspaceId ?? "",
250
+ workspaceName: raw.workspaceName ?? ""
251
+ };
141
252
  }
253
+ /**
254
+ * Pattern A: multi-account credential fetch for Notion. Returns every
255
+ * agent-scoped Notion connection. The caller is expected to require a
256
+ * selector arg (e.g. `workspaceId`) on every credential-touching tool.
257
+ *
258
+ * Returned `accounts[i].accountIdentifier` is the Notion workspaceId.
259
+ */
260
+ async getNotionAccounts() {
261
+ return { accounts: (await this.request("/agent/connect/notion/accounts")).accounts.map((a) => ({
262
+ connectionId: a.connectionId,
263
+ accountIdentifier: a.accountIdentifier,
264
+ displayName: a.displayName,
265
+ connectedAt: a.connectedAt,
266
+ accessToken: a.accessToken,
267
+ workspaceId: a.workspaceId ?? a.accountIdentifier,
268
+ workspaceName: a.workspaceName ?? a.displayName ?? ""
269
+ })) };
270
+ }
271
+ /**
272
+ * @deprecated Returns a single primary Atlassian Connection's credentials
273
+ * (one OAuth user, one cloudId) — the legacy "pick-the-default-connection"
274
+ * shape. Atlassian is multi-site by nature (each OAuth user may have
275
+ * access to multiple Cloud sites), so Pattern A plugins MUST use
276
+ * `getAtlassianAccounts()` to discover the full set and dispatch via
277
+ * the `cloudId` selector arg.
278
+ */
142
279
  async getAtlassianCredentials() {
143
- return this.request("/agent/atlassian/credentials");
280
+ const raw = await this.request("/agent/connect/atlassian/credentials");
281
+ return {
282
+ accessToken: raw.accessToken,
283
+ refreshToken: "",
284
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
285
+ cloudId: raw.cloudId ?? "",
286
+ siteName: raw.siteName ?? "",
287
+ siteUrl: raw.siteUrl ?? "",
288
+ email: "",
289
+ enabledProducts: [],
290
+ clientId: raw.clientId,
291
+ clientSecret: raw.clientSecret
292
+ };
144
293
  }
145
294
  async refreshAtlassianToken() {
146
- return this.request("/agent/atlassian/token", { method: "POST" });
295
+ return this.request("/agent/connect/atlassian/refresh", { method: "POST" });
296
+ }
297
+ /**
298
+ * Pattern A: multi-account / multi-site credential fetch for Atlassian.
299
+ *
300
+ * Returns every agent-scoped Atlassian Connection. Each Connection is
301
+ * one OAuth user with a single access token and N accessible Cloud
302
+ * sites (`availableSites`). The caller is expected to:
303
+ *
304
+ * 1. Flatten (connection × cloudId) into one MCP child per site.
305
+ * 2. Require a `cloudId` selector on every credential-touching tool.
306
+ * 3. Use the access token bound to the Connection that owns the
307
+ * requested `cloudId` (Atlassian shares one access token across
308
+ * all sites accessible to the OAuth user).
309
+ *
310
+ * Per-account token refresh uses `refreshAtlassianAccountToken(email)`
311
+ * — refreshing one Connection rotates its single access token, which
312
+ * then applies to every cloudId for that Connection.
313
+ *
314
+ * Returned `accounts[i].accountIdentifier` is the OAuth user's email
315
+ * — the stable cross-session identifier for refresh purposes. The LLM
316
+ * never sees this directly: it picks a site via the `cloudId` arg
317
+ * instead.
318
+ */
319
+ async getAtlassianAccounts() {
320
+ return { accounts: (await this.request("/agent/connect/atlassian/accounts")).accounts.map((a) => ({
321
+ connectionId: a.connectionId,
322
+ accountIdentifier: a.accountIdentifier,
323
+ displayName: a.displayName,
324
+ connectedAt: a.connectedAt,
325
+ accessToken: a.accessToken ?? "",
326
+ accessTokenExpiresAt: a.accessTokenExpiresAt ?? "",
327
+ clientId: a.clientId ?? "",
328
+ clientSecret: a.clientSecret ?? "",
329
+ cloudId: a.cloudId ?? "",
330
+ siteName: a.siteName ?? "",
331
+ siteUrl: a.siteUrl ?? "",
332
+ availableSites: a.availableSites ?? []
333
+ })) };
147
334
  }
335
+ /**
336
+ * Pattern A: refresh a specific Atlassian Connection by `accountIdentifier`
337
+ * (the OAuth user's email).
338
+ *
339
+ * Atlassian rotates refresh tokens (`rotatesRefreshToken: true`); the
340
+ * server-side per-account refresh endpoint handles rotation and
341
+ * persistence. Refreshing one Connection updates its single access
342
+ * token, which applies to every accessible Cloud site (cloudId) for
343
+ * that OAuth user.
344
+ *
345
+ * Returns the new access token + expiry. The proxy is responsible for
346
+ * fanning the new token out to every child server it spawned for
347
+ * cloudIds owned by this Connection.
348
+ */
349
+ async refreshAtlassianAccountToken(accountIdentifier) {
350
+ const path = `/agent/connect/atlassian/accounts/${encodeURIComponent(accountIdentifier)}/refresh`;
351
+ const raw = await this.request(path, { method: "POST" });
352
+ return {
353
+ accessToken: raw.accessToken,
354
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
355
+ expiresAt: raw.expiresAt ?? ""
356
+ };
357
+ }
358
+ /**
359
+ * @deprecated Returns a single primary credential blob (legacy "pick-the-
360
+ * default-connection" shape). Use `getMYOBAccounts()` for the multi-
361
+ * account shape required by Pattern A.
362
+ */
148
363
  async getMYOBCredentials() {
149
- return this.request("/agent/myob/credentials");
364
+ const raw = await this.request("/agent/connect/myob/credentials");
365
+ return {
366
+ accessToken: raw.accessToken,
367
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
368
+ myobBusinessId: raw.myobBusinessId,
369
+ clientId: raw.clientId
370
+ };
371
+ }
372
+ /**
373
+ * Pattern A: multi-account credential fetch for MYOB. Returns every
374
+ * agent-scoped MYOB connection. The caller is expected to require a
375
+ * selector arg (e.g. `myobBusinessId` / `accountIdentifier`) on every
376
+ * credential-touching tool.
377
+ *
378
+ * Returned `accounts[i].accountIdentifier` is the MYOB businessId.
379
+ */
380
+ async getMYOBAccounts() {
381
+ return { accounts: (await this.request("/agent/connect/myob/accounts")).accounts.map((a) => ({
382
+ connectionId: a.connectionId,
383
+ accountIdentifier: a.accountIdentifier,
384
+ displayName: a.displayName,
385
+ connectedAt: a.connectedAt,
386
+ accessToken: a.accessToken,
387
+ accessTokenExpiresAt: a.accessTokenExpiresAt ?? "",
388
+ myobBusinessId: a.myobBusinessId ?? a.accountIdentifier,
389
+ clientId: a.clientId
390
+ })) };
150
391
  }
151
392
  async refreshMYOBToken() {
152
- return this.request("/agent/myob/token", { method: "POST" });
393
+ return this.request("/agent/connect/myob/refresh", { method: "POST" });
394
+ }
395
+ /**
396
+ * Microsoft 365 (delegated OAuth) credential fetch — single-account shape.
397
+ *
398
+ * @deprecated Use `getMicrosoftAccounts()` and dispatch via the `email`
399
+ * selector once per-account plugins land. Retained because the existing
400
+ * `integrations/connect/microsoft/hooks/post_activate.mjs` writes
401
+ * `mgc` credentials for the single (default) Microsoft account.
402
+ *
403
+ * Returns the agent's effective Microsoft delegated-OAuth credentials.
404
+ * Distinct from `getTeamsCredentials()` (Azure bot credentials for the
405
+ * Teams adapter, which is admin-consent flow on services/microsoft, not
406
+ * delegated OAuth on services/connect).
407
+ */
408
+ async getMicrosoftCredentials() {
409
+ const raw = await this.request("/agent/connect/microsoft/credentials");
410
+ return {
411
+ accessToken: raw.accessToken ?? "",
412
+ accessTokenExpiresAt: raw.accessTokenExpiresAt,
413
+ refreshToken: raw.refreshToken ?? "",
414
+ clientId: raw.clientId ?? "",
415
+ clientSecret: raw.clientSecret ?? "",
416
+ email: raw.email ?? raw.accountIdentifier,
417
+ microsoftTenantId: raw.microsoftTenantId,
418
+ workspaceDomain: raw.workspaceDomain
419
+ };
420
+ }
421
+ /**
422
+ * Pattern A: multi-account credential fetch for Microsoft 365.
423
+ *
424
+ * Returns every agent-scoped Microsoft connection. The caller is expected
425
+ * to require an `email` selector on every credential-touching tool and
426
+ * look up the matching account at dispatch time.
427
+ *
428
+ * Returned `accounts[i].accountIdentifier` is the user's primary email
429
+ * (or the tid claim as fallback) — the stable cross-session identifier
430
+ * the LLM should pass.
431
+ *
432
+ * Per-account token refresh is exposed via `refreshMicrosoftAccountToken`,
433
+ * NOT `refreshXeroAccountToken` — Microsoft refresh tokens are not
434
+ * interchangeable across (tenant, user) pairs.
435
+ */
436
+ async getMicrosoftAccounts() {
437
+ return { accounts: (await this.request("/agent/connect/microsoft/accounts")).accounts.map((a) => ({
438
+ connectionId: a.connectionId,
439
+ accountIdentifier: a.accountIdentifier,
440
+ displayName: a.displayName,
441
+ connectedAt: a.connectedAt,
442
+ accessToken: a.accessToken ?? "",
443
+ accessTokenExpiresAt: a.accessTokenExpiresAt ?? "",
444
+ refreshToken: a.refreshToken ?? "",
445
+ clientId: a.clientId ?? "",
446
+ clientSecret: a.clientSecret ?? "",
447
+ email: a.email ?? a.accountIdentifier,
448
+ microsoftTenantId: a.microsoftTenantId ?? "",
449
+ workspaceDomain: a.workspaceDomain ?? ""
450
+ })) };
451
+ }
452
+ /**
453
+ * Pattern A: refresh a specific Microsoft 365 connection by its
454
+ * `accountIdentifier`. For Microsoft, `accountIdentifier` is the user's
455
+ * email when the Graph profile fetch succeeded at connect time, and the
456
+ * Azure tenant id (`tid` claim) as fallback. Callers should pass the
457
+ * value returned by `getMicrosoftAccounts()` rather than synthesising
458
+ * an email locally.
459
+ *
460
+ * Microsoft refresh tokens are bound to a specific (tenant, user) pair —
461
+ * they are NOT interchangeable across accounts, so per-account refresh
462
+ * is mandatory. The generic /accounts/{accountIdentifier}/refresh
463
+ * endpoint walks the agent's full visible scope chain to find a matching
464
+ * connection (works for inherited team/project Microsoft connections).
465
+ */
466
+ async refreshMicrosoftAccountToken(accountIdentifier) {
467
+ const path = `/agent/connect/microsoft/accounts/${encodeURIComponent(accountIdentifier)}/refresh`;
468
+ const raw = await this.request(path, { method: "POST" });
469
+ return {
470
+ accessToken: raw.accessToken,
471
+ accessTokenExpiresAt: raw.accessTokenExpiresAt ?? "",
472
+ expiresAt: raw.expiresAt ?? ""
473
+ };
153
474
  }
154
475
  async getTeamsCredentials() {
155
476
  return this.request("/agent/microsoft/credentials");