@polpo-ai/connect 0.15.144 → 0.16.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.
Files changed (60) hide show
  1. package/README.md +207 -25
  2. package/dist/assignment-policy.d.ts +21 -0
  3. package/dist/assignment-policy.d.ts.map +1 -0
  4. package/dist/assignment-policy.js +93 -0
  5. package/dist/assignment-policy.js.map +1 -0
  6. package/dist/capability-resolver.d.ts +47 -3
  7. package/dist/capability-resolver.d.ts.map +1 -1
  8. package/dist/capability-resolver.js +197 -31
  9. package/dist/capability-resolver.js.map +1 -1
  10. package/dist/client/index.d.ts +97 -20
  11. package/dist/client/index.d.ts.map +1 -1
  12. package/dist/client/index.js +90 -4
  13. package/dist/client/index.js.map +1 -1
  14. package/dist/credential-requirement.d.ts +7 -0
  15. package/dist/credential-requirement.d.ts.map +1 -0
  16. package/dist/credential-requirement.js +7 -0
  17. package/dist/credential-requirement.js.map +1 -0
  18. package/dist/definition-store.d.ts +19 -0
  19. package/dist/definition-store.d.ts.map +1 -0
  20. package/dist/definition-store.js +2 -0
  21. package/dist/definition-store.js.map +1 -0
  22. package/dist/definitions.d.ts +54 -0
  23. package/dist/definitions.d.ts.map +1 -0
  24. package/dist/definitions.js +394 -0
  25. package/dist/definitions.js.map +1 -0
  26. package/dist/errors.d.ts +1 -1
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/errors.js +3 -0
  29. package/dist/errors.js.map +1 -1
  30. package/dist/http-policy.d.ts +3 -1
  31. package/dist/http-policy.d.ts.map +1 -1
  32. package/dist/http-policy.js +55 -14
  33. package/dist/http-policy.js.map +1 -1
  34. package/dist/index.d.ts +8 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +8 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/mcp-oauth-commit.d.ts +11 -0
  39. package/dist/mcp-oauth-commit.d.ts.map +1 -0
  40. package/dist/mcp-oauth-commit.js +65 -0
  41. package/dist/mcp-oauth-commit.js.map +1 -0
  42. package/dist/oauth-reconnect.d.ts +5 -0
  43. package/dist/oauth-reconnect.d.ts.map +1 -0
  44. package/dist/oauth-reconnect.js +18 -0
  45. package/dist/oauth-reconnect.js.map +1 -0
  46. package/dist/registry.d.ts +6 -3
  47. package/dist/registry.d.ts.map +1 -1
  48. package/dist/registry.js +47 -9
  49. package/dist/registry.js.map +1 -1
  50. package/dist/setup-lifecycle.d.ts +9 -0
  51. package/dist/setup-lifecycle.d.ts.map +1 -0
  52. package/dist/setup-lifecycle.js +57 -0
  53. package/dist/setup-lifecycle.js.map +1 -0
  54. package/dist/types.d.ts +204 -5
  55. package/dist/types.d.ts.map +1 -1
  56. package/dist/verification.d.ts +55 -0
  57. package/dist/verification.d.ts.map +1 -0
  58. package/dist/verification.js +50 -0
  59. package/dist/verification.js.map +1 -0
  60. package/package.json +2 -2
@@ -1,5 +1,38 @@
1
- import { ConnectionSelectionError, } from "@polpo-ai/core";
1
+ import { ConnectionSelectionError, createToolInvocationContext, assertAgentIdentity, } from "@polpo-ai/core";
2
2
  import { hasScopes } from "./scopes.js";
3
+ const capabilitySelections = new WeakMap();
4
+ const capabilityAuthorizations = new WeakMap();
5
+ /** Host-only delivery guard. Rechecks the acquired account, grant, identity
6
+ * and credential installation without switching selection or rematerializing
7
+ * secrets. Never serialize this guard into a tool or sandbox capability. */
8
+ export async function assertConnectionCapabilityAuthorized(capability) {
9
+ const authorize = capabilityAuthorizations.get(capability);
10
+ if (!authorize)
11
+ throw new ConnectionSelectionError("connection_resolver_unavailable", "Connection capability has no host authorization guard");
12
+ await authorize();
13
+ }
14
+ export function getConnectionCapabilitySelection(capability) {
15
+ return capabilitySelections.get(capability);
16
+ }
17
+ /** Host-only snapshot for durable delegation. Never expose this to tools or
18
+ * copy it into a sandbox: it includes credential installation references. */
19
+ export function snapshotConnectionCapabilitySelection(connection) {
20
+ const binding = connection.binding;
21
+ return Object.freeze({ connectionId: connection.id, providerId: connection.providerId,
22
+ audience: effectiveConnectionAudience(connection), secretRef: connection.secretRef,
23
+ credentialVersion: connection.credentialVersion,
24
+ bindingKey: JSON.stringify([binding?.principal?.type, binding?.principal?.id, binding?.principal?.namespace,
25
+ binding?.tenant?.namespace, binding?.tenant?.id, binding?.resource?.namespace, binding?.resource?.type,
26
+ binding?.resource?.id, binding?.scopeEpoch, connection.owner?.type, connection.owner?.id,
27
+ connection.owner?.type === "external_user" ? connection.owner.namespace : undefined]),
28
+ });
29
+ }
30
+ export function matchesConnectionCapabilitySelection(connection, expected) {
31
+ const current = snapshotConnectionCapabilitySelection(connection);
32
+ return current.connectionId === expected.connectionId && current.providerId === expected.providerId
33
+ && current.audience === expected.audience && current.secretRef === expected.secretRef
34
+ && current.credentialVersion === expected.credentialVersion && current.bindingKey === expected.bindingKey;
35
+ }
3
36
  function bindingPartMatches(binding, selector) {
4
37
  if (!binding)
5
38
  return true;
@@ -9,14 +42,43 @@ function bindingPartMatches(binding, selector) {
9
42
  const selectorRecord = selector;
10
43
  return Object.keys(bindingRecord).every((key) => bindingRecord[key] === selectorRecord[key]);
11
44
  }
12
- function bindingMatches(binding, selector) {
13
- if (!binding)
14
- return false;
15
- return bindingPartMatches(binding.principal, selector.principal)
45
+ /** Legacy installations are shared; ownership is never inferred from binding fields. */
46
+ export function effectiveConnectionAudience(connection) {
47
+ return connection.audience ?? "shared";
48
+ }
49
+ /** Grant bindings are additional constraints, not standalone account identities. */
50
+ export function matchesConnectionBindingAttributes(binding, selector) {
51
+ return !binding || (bindingPartMatches(binding.principal, selector.principal)
16
52
  && bindingPartMatches(binding.tenant, selector.tenant)
17
53
  && bindingPartMatches(binding.resource, selector.resource)
18
- && (binding.scopeEpoch === undefined
19
- || binding.scopeEpoch === selector.scopeEpoch);
54
+ && (binding.scopeEpoch === undefined || binding.scopeEpoch === selector.scopeEpoch));
55
+ }
56
+ /** Match account ownership and binding against a host-created selector. No fallback is performed. */
57
+ export function matchesConnectionBinding(connection, selector) {
58
+ const binding = connection.binding;
59
+ // Pre-audience records retain their historical classification. A missing
60
+ // user match must never silently become project-wide access.
61
+ const audience = effectiveConnectionAudience(connection);
62
+ if (selector.audience !== undefined && audience !== selector.audience)
63
+ return false;
64
+ if (audience === "personal") {
65
+ if (!connection.owner || connection.owner.type !== "user"
66
+ || selector.principal?.type !== "user" || selector.principal.id !== connection.owner.id)
67
+ return false;
68
+ }
69
+ if (audience === "end_user") {
70
+ const owner = connection.owner;
71
+ if (owner?.type !== "external_user" || typeof owner.namespace !== "string" || !owner.namespace.trim()
72
+ || !binding?.principal || binding.principal.type !== "external_user" || binding.principal.id !== owner.id
73
+ || selector.principal?.type !== "external_user" || selector.principal.id !== owner.id
74
+ || selector.principal.namespace !== owner.namespace)
75
+ return false;
76
+ }
77
+ if (!binding)
78
+ return selector.audience === "shared" || selector.audience === "personal";
79
+ if (Object.keys(binding).length === 0)
80
+ return false;
81
+ return matchesConnectionBindingAttributes(binding, selector);
20
82
  }
21
83
  function requiredText(name, value) {
22
84
  if (typeof value !== "string" || !value.trim()) {
@@ -32,11 +94,14 @@ function normalizeSelector(selector) {
32
94
  && Object.getPrototypeOf(selector) !== null)) {
33
95
  throw new ConnectionSelectionError("connection_slot_invalid", "Trusted Connection selector must be an object");
34
96
  }
35
- const unsupported = Object.keys(selector).filter((key) => !["projectId", "orgId", "principal", "tenant", "resource", "scopeEpoch"].includes(key));
97
+ const unsupported = Object.keys(selector).filter((key) => !["projectId", "orgId", "principal", "tenant", "resource", "scopeEpoch", "audience"].includes(key));
36
98
  if (unsupported.length > 0) {
37
99
  throw new ConnectionSelectionError("connection_slot_invalid", `Trusted Connection selector contains unsupported fields: ${unsupported.join(", ")}`);
38
100
  }
39
- const part = (name, value, fields) => {
101
+ if (selector.audience !== undefined && !["personal", "shared", "end_user"].includes(selector.audience)) {
102
+ throw new ConnectionSelectionError("connection_slot_invalid", "Trusted Connection selector audience is invalid");
103
+ }
104
+ const part = (name, value, fields, optionalFields = []) => {
40
105
  if (value === undefined)
41
106
  return undefined;
42
107
  if (!value
@@ -46,11 +111,11 @@ function normalizeSelector(selector) {
46
111
  && Object.getPrototypeOf(value) !== null)) {
47
112
  throw new ConnectionSelectionError("connection_slot_invalid", `Trusted Connection selector ${name} is invalid`);
48
113
  }
49
- const unsupportedPart = Object.keys(value).filter((key) => !fields.includes(key));
114
+ const unsupportedPart = Object.keys(value).filter((key) => !fields.includes(key) && !optionalFields.includes(key));
50
115
  if (unsupportedPart.length > 0) {
51
116
  throw new ConnectionSelectionError("connection_slot_invalid", `Trusted Connection selector ${name} contains unsupported fields: ${unsupportedPart.join(", ")}`);
52
117
  }
53
- const normalized = Object.fromEntries(fields.map((field) => [
118
+ const normalized = Object.fromEntries([...fields, ...optionalFields.filter(field => value[field] !== undefined)].map((field) => [
54
119
  field,
55
120
  requiredText(`${name}.${String(field)}`, value[String(field)]),
56
121
  ]));
@@ -59,8 +124,9 @@ function normalizeSelector(selector) {
59
124
  return Object.freeze({
60
125
  projectId: requiredText("projectId", selector.projectId),
61
126
  ...(selector.orgId === undefined ? {} : { orgId: requiredText("orgId", selector.orgId) }),
127
+ ...(selector.audience === undefined ? {} : { audience: selector.audience }),
62
128
  ...(selector.principal === undefined ? {} : {
63
- principal: part("principal", selector.principal, ["type", "id"]),
129
+ principal: part("principal", selector.principal, ["type", "id"], ["namespace"]),
64
130
  }),
65
131
  ...(selector.tenant === undefined ? {} : {
66
132
  tenant: part("tenant", selector.tenant, ["namespace", "id"]),
@@ -101,12 +167,35 @@ function credentialCapability(credential) {
101
167
  getKey: () => credential.kind === "api_key" ? credential.value : undefined,
102
168
  };
103
169
  }
104
- export function createConnectionCapabilityResolver(options) {
170
+ export function createConnectionAccessResolver(options) {
105
171
  return {
106
- async resolve(input) {
172
+ async acquire(original) {
173
+ let input = original;
107
174
  try {
175
+ input = Object.freeze({ ...original,
176
+ spec: Object.freeze({ ...original.spec, scopes: Object.freeze([...original.spec.scopes]) }),
177
+ invocation: createToolInvocationContext(original.invocation),
178
+ });
179
+ const assertCurrentAgent = async () => {
180
+ if (!options.getAgentSnapshot)
181
+ return;
182
+ const expected = input.invocation.agent;
183
+ if (!expected)
184
+ throw new ConnectionSelectionError("connection_scope_denied", "An authoritative agent identity is required");
185
+ const current = await options.getAgentSnapshot(expected.name);
186
+ try {
187
+ assertAgentIdentity(expected, current);
188
+ }
189
+ catch {
190
+ throw new ConnectionSelectionError("connection_scope_denied", "The execution agent no longer exists or has been replaced");
191
+ }
192
+ };
193
+ if (input.signal?.aborted)
194
+ throw new ConnectionSelectionError("connection_scope_denied", "Connection invocation was cancelled", { slot: input.slot });
195
+ await assertCurrentAgent();
108
196
  const selector = normalizeSelector(await options.resolveSelector(input));
109
- const listed = await options.store.listConnections({
197
+ const resumed = options.selection ? await options.store.getConnection(options.selection.connectionId) : undefined;
198
+ const listed = options.selection ? (resumed ? [resumed] : []) : await options.store.listConnections({
110
199
  ...(options.isConnectionVisible ? {} : { projectId: selector.projectId }),
111
200
  ...(selector.orgId ? { orgId: selector.orgId } : {}),
112
201
  ...(input.spec.provider ? { providerId: input.spec.provider } : {}),
@@ -114,13 +203,15 @@ export function createConnectionCapabilityResolver(options) {
114
203
  });
115
204
  const candidates = [];
116
205
  for (const connection of listed) {
117
- const visible = connection.projectId === selector.projectId
118
- || await options.isConnectionVisible?.(connection, selector) === true;
206
+ const visible = options.isConnectionVisible
207
+ ? await options.isConnectionVisible(connection, selector)
208
+ : connection.projectId === selector.projectId;
119
209
  if (connection.status === "active"
120
210
  && visible
121
211
  && (selector.orgId === undefined || connection.orgId === selector.orgId)
122
212
  && (input.spec.provider === undefined || connection.providerId === input.spec.provider)
123
- && bindingMatches(connection.binding, selector)) {
213
+ && matchesConnectionBinding(connection, selector)
214
+ && (!options.selection || matchesConnectionCapabilitySelection(connection, options.selection))) {
124
215
  candidates.push(connection);
125
216
  }
126
217
  }
@@ -128,6 +219,7 @@ export function createConnectionCapabilityResolver(options) {
128
219
  throw new ConnectionSelectionError("connection_not_found_for_scope", `No active Connection matches slot "${input.slot}"`, { slot: input.slot });
129
220
  }
130
221
  const authorized = [];
222
+ const connectionSlot = Object.freeze({ name: input.slot, mode: input.spec.mode ?? "legacy_credentials" });
131
223
  for (const connection of candidates) {
132
224
  if (!hasScopes(connection.grantedScopes, input.spec.scopes))
133
225
  continue;
@@ -138,6 +230,7 @@ export function createConnectionCapabilityResolver(options) {
138
230
  : {}),
139
231
  scopes: [...input.spec.scopes],
140
232
  actionId: input.toolName,
233
+ connectionSlot,
141
234
  }) ?? true;
142
235
  if (allowed)
143
236
  authorized.push(connection);
@@ -149,27 +242,100 @@ export function createConnectionCapabilityResolver(options) {
149
242
  throw new ConnectionSelectionError("connection_selection_ambiguous", `More than one Connection matches slot "${input.slot}"`, { slot: input.slot });
150
243
  }
151
244
  const selected = authorized[0];
245
+ await assertCurrentAgent();
246
+ let disposed = false;
247
+ const identity = snapshotConnectionCapabilitySelection(selected);
248
+ const capabilityScopes = input.spec.scopes;
249
+ return {
250
+ input, connection: selected, selection: identity,
251
+ dispose: () => { disposed = true; },
252
+ current: async () => {
253
+ let current;
254
+ try {
255
+ if (disposed || input.signal?.aborted)
256
+ throw new ConnectionSelectionError("connection_scope_denied", "Connection capability is no longer active", { slot: input.slot });
257
+ const found = await options.store.getConnection(identity.connectionId);
258
+ const visible = found && (options.isConnectionVisible
259
+ ? await options.isConnectionVisible(found, selector)
260
+ : found.projectId === selector.projectId);
261
+ if (!found || found.status !== "active" || !visible
262
+ || !matchesConnectionCapabilitySelection(found, identity)
263
+ || (selector.orgId !== undefined && found.orgId !== selector.orgId)
264
+ || !matchesConnectionBinding(found, selector)) {
265
+ throw new ConnectionSelectionError("connection_not_found_for_scope", "Selected Connection is no longer available", { slot: input.slot });
266
+ }
267
+ const allowed = hasScopes(found.grantedScopes, capabilityScopes) && (await options.policy?.canUseConnection({
268
+ connection: found,
269
+ ...(input.invocation.user ? { subject: { type: "user", id: input.invocation.user } } : {}),
270
+ scopes: [...capabilityScopes], actionId: input.toolName, connectionSlot,
271
+ }) ?? true);
272
+ if (!allowed || disposed || input.signal?.aborted)
273
+ throw new ConnectionSelectionError("connection_scope_denied", "Connection permission is no longer valid", { slot: input.slot });
274
+ await assertCurrentAgent();
275
+ if (disposed || input.signal?.aborted)
276
+ throw new ConnectionSelectionError("connection_scope_denied", "Connection capability is no longer active", { slot: input.slot });
277
+ current = found;
278
+ }
279
+ catch (error) {
280
+ if (error instanceof ConnectionSelectionError)
281
+ throw error;
282
+ throw new ConnectionSelectionError("connection_resolver_unavailable", "Connection authorization could not be rechecked", { slot: input.slot, cause: error });
283
+ }
284
+ return current;
285
+ },
286
+ };
287
+ }
288
+ catch (error) {
289
+ if (error instanceof ConnectionSelectionError)
290
+ throw error;
291
+ throw new ConnectionSelectionError("connection_resolver_unavailable", `Trusted Connection resolution failed for slot "${input.slot}"`, { slot: input.slot, cause: error });
292
+ }
293
+ },
294
+ };
295
+ }
296
+ export function createConnectionCapabilityResolver(options) {
297
+ const accessResolver = createConnectionAccessResolver(options);
298
+ return {
299
+ async resolve(original) {
300
+ let access;
301
+ try {
302
+ access = await accessResolver.acquire(original);
303
+ const input = access.input;
304
+ const selected = access.connection;
152
305
  const mode = input.spec.mode ?? "legacy_credentials";
153
306
  if (mode === "gateway") {
154
- if (!options.request) {
307
+ if (!options.request)
155
308
  throw new ConnectionSelectionError("connection_resolver_unavailable", `Connection gateway is unavailable for slot "${input.slot}"`, { slot: input.slot });
156
- }
157
- return {
158
- mode,
159
- providerId: selected.providerId,
160
- scopes: Object.freeze([...selected.grantedScopes]),
161
- request: (request) => options.request(selected, input, request),
309
+ const acquired = access;
310
+ const capability = {
311
+ mode, providerId: selected.providerId, scopes: input.spec.scopes,
312
+ dispose: () => acquired.dispose(),
313
+ request: async (request) => {
314
+ const current = await acquired.current();
315
+ return options.request(current, input, request, async () => { await acquired.current(); });
316
+ },
162
317
  };
318
+ capabilitySelections.set(capability, acquired.selection);
319
+ capabilityAuthorizations.set(capability, async () => { await acquired.current(); });
320
+ return capability;
163
321
  }
164
- if (!options.materialize) {
322
+ if (!options.materialize)
165
323
  throw new ConnectionSelectionError("connection_resolver_unavailable", `Legacy credential materialization is unavailable for slot "${input.slot}"`, { slot: input.slot });
166
- }
167
- return credentialCapability(await options.materialize(selected, input));
324
+ await access.current();
325
+ const credential = await options.materialize(selected, input);
326
+ await access.current();
327
+ const capability = credentialCapability(credential);
328
+ const acquired = access;
329
+ capability.dispose = () => acquired.dispose();
330
+ capabilitySelections.set(capability, acquired.selection);
331
+ capabilityAuthorizations.set(capability, async () => { await acquired.current(); });
332
+ return capability;
168
333
  }
169
334
  catch (error) {
335
+ access?.dispose();
170
336
  if (error instanceof ConnectionSelectionError)
171
337
  throw error;
172
- throw new ConnectionSelectionError("connection_resolver_unavailable", `Trusted Connection resolution failed for slot "${input.slot}"`, { slot: input.slot, cause: error });
338
+ throw new ConnectionSelectionError("connection_resolver_unavailable", `Trusted Connection resolution failed for slot "${original.slot}"`, { slot: original.slot, cause: error });
173
339
  }
174
340
  },
175
341
  };
@@ -186,9 +352,9 @@ export function createApplicationCapabilityResolver(options) {
186
352
  ...options,
187
353
  resolveSelector: () => options.resolveSelector(input),
188
354
  request: options.request
189
- ? async (connection, resolveInput, request) => {
355
+ ? async (connection, resolveInput, request, reauthorize) => {
190
356
  assertApplicationOperationAllowed(input.spec.allowedOperations, request, input.spec.scopes);
191
- return options.request(connection, resolveInput, request);
357
+ return options.request(connection, resolveInput, request, reauthorize);
192
358
  }
193
359
  : undefined,
194
360
  });
@@ -1 +1 @@
1
- {"version":3,"file":"capability-resolver.js","sourceRoot":"","sources":["../src/capability-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GASzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAwCxC,SAAS,kBAAkB,CACzB,OAAsB,EACtB,QAAuB;IAEvB,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,CAAC,QAAQ;QAAE,OAAO,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/D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAClH,OAAO,CAAC,MAAM,CAAC,cAAc,IAAI,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,EAC7B,oDAAoD,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,CAC7E,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,36 +1,43 @@
1
+ import type { ConnectorCatalogEntry, ConnectorDefinition } from "../definitions.js";
2
+ import type { StoredConnectorDefinition } from "../definition-store.js";
3
+ import type { ConnectionVerificationResult, ConnectorSetupReadinessInput, ConnectorSetupReadinessResult } from "../verification.js";
1
4
  import type { ConnectionOperationPolicy, ConnectionRequest, ConnectionResponse, ToolInvocationJsonValue } from "@polpo-ai/core";
2
- import type { ConnectSubject, ConnectionAudience, ConnectionBindingAttributes, ConnectionLink, ConnectionLinkListFilter, ConnectionOwner, ConnectionRecord, ConnectionSetupSession, ConnectorProviderDefinition, McpConnectionAuth, McpConnectionTransport, McpOAuthClientInformation, McpOAuthClientMode, McpOAuthInspection, RuntimeToken } from "../types.js";
5
+ import type { ConnectSubject, ConnectionAudience, ConnectionBindingAttributes, ConnectionCreationContext, ConnectionLink, ConnectionLinkListFilter, ConnectionOwner, ConnectionRecord, ConnectionSetupSession, ConnectionSetupStatus, ConnectorProviderDefinition, McpConnectionAuth, McpConnectionTransport, McpOAuthClientInformation, McpOAuthClientMode, McpOAuthInspection, ResolvedMcpOAuthClient, RuntimeToken } from "../types.js";
3
6
  export interface PolpoConnectClientOptions {
4
7
  baseUrl: string;
5
8
  headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
6
9
  fetch?: typeof fetch;
7
10
  }
8
- export interface CreateApiKeyConnectionRequest {
11
+ export interface CreateApiKeyConnectionRequest extends ConnectionCreationContext {
9
12
  providerId: string;
13
+ authenticationId?: string;
10
14
  apiKey: string;
11
15
  scopes?: string[];
12
- subject?: ConnectSubject;
13
16
  name?: string;
14
17
  projectId?: string;
15
18
  orgId?: string;
16
19
  metadata?: Record<string, unknown>;
17
20
  }
18
- export interface CreateMcpConnectionRequest {
21
+ export type CreatePublicConnectionRequest = Omit<CreateApiKeyConnectionRequest, "apiKey">;
22
+ export interface CreateMcpConnectionRequest extends ConnectionCreationContext {
19
23
  providerId?: string;
24
+ authenticationId?: string;
20
25
  name?: string;
21
26
  url: string;
22
27
  transport?: McpConnectionTransport;
23
28
  auth?: McpConnectionAuth;
29
+ headerName?: string;
24
30
  apiKey?: string;
25
31
  bearerToken?: string;
26
32
  scopes?: string[];
27
- subject?: ConnectSubject;
28
33
  projectId?: string;
29
34
  orgId?: string;
30
35
  metadata?: Record<string, unknown>;
31
36
  }
32
37
  export interface StartOAuthRequest {
33
38
  providerId: string;
39
+ authenticationId?: string;
40
+ oauthClientMode?: "managed" | "customer" | "instance";
34
41
  scopes?: string[];
35
42
  subject?: ConnectSubject;
36
43
  redirectUri: string;
@@ -54,7 +61,9 @@ export interface InspectMcpOAuthRequest {
54
61
  url: string;
55
62
  transport?: McpConnectionTransport;
56
63
  }
57
- export interface StartMcpOAuthRequest extends InspectMcpOAuthRequest {
64
+ export interface StartMcpOAuthRequest extends InspectMcpOAuthRequest, ConnectionCreationContext {
65
+ providerId?: string;
66
+ authenticationId?: string;
58
67
  name?: string;
59
68
  scopes?: string[];
60
69
  mode: McpOAuthClientMode;
@@ -70,6 +79,9 @@ export interface GetTokenRequest {
70
79
  }
71
80
  export interface CreateConnectionSetupSessionRequest {
72
81
  providerId: string;
82
+ authenticationId?: string;
83
+ /** Reusable host-owned MCP OAuth configuration; never a provider secret. */
84
+ configurationId?: string;
73
85
  projectId: string;
74
86
  orgId?: string;
75
87
  audience: ConnectionAudience;
@@ -118,22 +130,15 @@ export interface ApplicationCapabilityRequest {
118
130
  invocation?: ApplicationCapabilityInvocation;
119
131
  request: ConnectionRequest;
120
132
  }
121
- export interface ConnectionSetupStatus {
122
- providerId: string;
123
- projectId: string;
124
- status: "pending" | "started" | "completed" | "cancelled" | "expired" | "error";
125
- resultingConnectionId?: string;
126
- expiresAt: string;
127
- consumedAt?: string;
128
- scopes: string[];
129
- application?: {
130
- name: string;
131
- url?: string;
132
- };
133
+ export type { ConnectionSetupStatus } from "../types.js";
134
+ /** Project-approved destinations after provider authorization, independent of OAuth app ownership. */
135
+ export interface ProjectConnectionSetupConfiguration {
136
+ returnOrigins: string[];
133
137
  }
134
138
  export interface CloudOAuthClientRecord {
135
139
  id: string;
136
140
  providerId: string;
141
+ authenticationId?: string;
137
142
  owner: {
138
143
  type: "organization" | "project";
139
144
  id: string;
@@ -149,10 +154,37 @@ export interface CloudOAuthClientRecord {
149
154
  }
150
155
  export interface ConfigureCloudOAuthClientRequest {
151
156
  name?: string;
157
+ authenticationId?: string;
152
158
  clientId: string;
153
159
  clientSecret?: string;
154
160
  returnOrigins?: string[];
155
161
  }
162
+ export type McpOAuthConfigurationScope = {
163
+ type: "project" | "organization";
164
+ id: string;
165
+ };
166
+ export type ConfigureMcpOAuthRequest = Pick<ResolvedMcpOAuthClient, "providerId" | "authenticationId" | "resourceUrl" | "transport" | "registration"> & {
167
+ name?: string;
168
+ returnOrigins?: string[];
169
+ };
170
+ export type CloudMcpOAuthConfiguration = Omit<ResolvedMcpOAuthClient, "registration"> & {
171
+ registration: Exclude<ResolvedMcpOAuthClient["registration"], {
172
+ mode: "pre_registered";
173
+ }> | {
174
+ mode: "pre_registered";
175
+ client: McpOAuthClientInformation & {
176
+ client_secret?: never;
177
+ };
178
+ };
179
+ name?: string;
180
+ status: "active" | "revoked";
181
+ hasSecret: boolean;
182
+ fingerprint: string;
183
+ revision: string;
184
+ returnOrigins: string[];
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ };
156
188
  export interface ConnectionEventRecord {
157
189
  id: string;
158
190
  connectionId?: string | null;
@@ -187,14 +219,41 @@ export declare class PolpoConnectClient {
187
219
  private readonly headers?;
188
220
  constructor(options: PolpoConnectClientOptions);
189
221
  listProviders(): Promise<ConnectorProviderDefinition[]>;
222
+ listCatalog(): Promise<ConnectorCatalogEntry[]>;
223
+ listProjectCatalog(projectId: string): Promise<ConnectorCatalogEntry[]>;
224
+ getProjectSetupReadiness(projectId: string, input: Pick<ConnectorSetupReadinessInput, "providerId" | "authenticationId"> & {
225
+ oauthClientMode?: "managed" | "customer";
226
+ }): Promise<ConnectorSetupReadinessResult>;
227
+ registerProjectConnectorDefinition(projectId: string, definition: ConnectorDefinition): Promise<StoredConnectorDefinition>;
228
+ disableProjectConnectorDefinition(projectId: string, connectorId: string): Promise<StoredConnectorDefinition>;
229
+ getSetupReadiness(input: ConnectorSetupReadinessInput): Promise<ConnectorSetupReadinessResult>;
230
+ registerConnectorDefinition(definition: ConnectorDefinition): Promise<StoredConnectorDefinition>;
231
+ disableConnectorDefinition(connectorId: string): Promise<StoredConnectorDefinition>;
190
232
  listConnections(): Promise<ConnectionRecord[]>;
191
233
  listConnectionLinks(filter?: ConnectionLinkListFilter): Promise<ConnectionLink[]>;
192
234
  linkConnection(connectionId: string, projectId: string): Promise<ConnectionLink>;
193
235
  unlinkConnection(linkId: string): Promise<ConnectionLink>;
194
236
  createApiKeyConnection(input: CreateApiKeyConnectionRequest): Promise<ConnectionRecord>;
237
+ createPublicConnection(input: CreatePublicConnectionRequest): Promise<ConnectionRecord>;
238
+ verifyConnection(connectionId: string): Promise<ConnectionVerificationResult>;
239
+ verifyProjectConnection(projectId: string, connectionId: string): Promise<ConnectionVerificationResult>;
195
240
  createMcpConnection(input: CreateMcpConnectionRequest): Promise<ConnectionRecord>;
241
+ createProjectApiKeyConnection(projectId: string, input: CreateApiKeyConnectionRequest): Promise<ConnectionRecord>;
242
+ createProjectPublicConnection(projectId: string, input: CreatePublicConnectionRequest): Promise<ConnectionRecord>;
243
+ createProjectMcpConnection(projectId: string, input: CreateMcpConnectionRequest): Promise<ConnectionRecord>;
244
+ inspectMcpOAuth(input: InspectMcpOAuthRequest): Promise<McpOAuthInspection>;
245
+ startMcpOAuth(input: StartMcpOAuthRequest & {
246
+ redirectUri: string;
247
+ projectId?: string;
248
+ orgId?: string;
249
+ }): Promise<StartOAuthResponse>;
196
250
  inspectProjectMcpOAuth(projectId: string, input: InspectMcpOAuthRequest): Promise<McpOAuthInspection>;
251
+ /** Requires a Polpo browser session; a platform key does not identify the
252
+ * person authorizing MCP. CLI users review and confirm setup in the dashboard. */
197
253
  startProjectMcpOAuth(projectId: string, input: StartMcpOAuthRequest): Promise<StartOAuthResponse>;
254
+ /** @deprecated Cloud deliberately rejects MCP reconnect until verified-account
255
+ * continuity is supported. Create a new Connection and explicitly reassign
256
+ * its tools; this compatibility method surfaces the server's 409 denial. */
198
257
  reconnectProjectMcpConnection(projectId: string, connectionId: string): Promise<StartOAuthResponse>;
199
258
  verifyProjectMcpConnection(projectId: string, connectionId: string): Promise<{
200
259
  ok: true;
@@ -206,19 +265,37 @@ export declare class PolpoConnectClient {
206
265
  createProjectSetupSession(projectId: string, input: Omit<CreateConnectionSetupSessionRequest, "projectId">): Promise<ConnectionSetupSession & {
207
266
  setupUrl: string;
208
267
  }>;
268
+ getProjectSetupConfiguration(projectId: string): Promise<ProjectConnectionSetupConfiguration>;
269
+ listProjectEndUserConnections(projectId: string, owner: {
270
+ namespace: string;
271
+ id: string;
272
+ }): Promise<ConnectionRecord[]>;
273
+ revokeProjectEndUserConnection(projectId: string, owner: {
274
+ namespace: string;
275
+ id: string;
276
+ }, connectionId: string): Promise<ConnectionRecord>;
277
+ configureProjectSetup(projectId: string, input: ProjectConnectionSetupConfiguration): Promise<ProjectConnectionSetupConfiguration>;
209
278
  getSetupStatus(setupToken: string): Promise<ConnectionSetupStatus>;
210
279
  cancelSetupSession(setupToken: string): Promise<ConnectionSetupStatus>;
211
280
  waitForSetupCompletion(setupToken: string, options?: WaitForConnectionSetupOptions): Promise<ConnectionSetupStatus>;
212
281
  startOAuthSetup(setupSessionId: string): Promise<StartOAuthResponse>;
282
+ /** Starts a session from createProjectSetupSession through the Cloud public setup API. */
283
+ startProjectOAuthSetup(setupToken: string): Promise<StartOAuthResponse>;
213
284
  getToken(connectionId: string, input?: GetTokenRequest): Promise<RuntimeToken>;
214
285
  gatewayRequest<T = unknown>(connectionId: string, input: ConnectionGatewayRequest): Promise<ConnectionResponse<T>>;
215
286
  listApplicationCapabilities(projectId: string, status?: "pending" | "active" | "revoked"): Promise<ApplicationCapabilityRecord[]>;
216
287
  listProjectOAuthClients(projectId: string): Promise<CloudOAuthClientRecord[]>;
288
+ listMcpOAuthConfigurations(owner: McpOAuthConfigurationScope): Promise<CloudMcpOAuthConfiguration[]>;
289
+ createMcpOAuthConfiguration(owner: McpOAuthConfigurationScope, input: ConfigureMcpOAuthRequest): Promise<CloudMcpOAuthConfiguration>;
290
+ updateMcpOAuthConfiguration(owner: McpOAuthConfigurationScope, id: string, input: ConfigureMcpOAuthRequest & {
291
+ expectedRevision: string;
292
+ }): Promise<CloudMcpOAuthConfiguration>;
293
+ revokeMcpOAuthConfiguration(owner: McpOAuthConfigurationScope, id: string, expectedRevision: string): Promise<CloudMcpOAuthConfiguration>;
217
294
  configureProjectOAuthClient(projectId: string, providerId: string, input: ConfigureCloudOAuthClientRequest): Promise<CloudOAuthClientRecord>;
218
- revokeProjectOAuthClient(projectId: string, providerId: string): Promise<CloudOAuthClientRecord>;
295
+ revokeProjectOAuthClient(projectId: string, providerId: string, authenticationId?: string): Promise<CloudOAuthClientRecord>;
219
296
  listOrganizationOAuthClients(organizationId: string): Promise<CloudOAuthClientRecord[]>;
220
297
  configureOrganizationOAuthClient(organizationId: string, providerId: string, input: ConfigureCloudOAuthClientRequest): Promise<CloudOAuthClientRecord>;
221
- revokeOrganizationOAuthClient(organizationId: string, providerId: string): Promise<CloudOAuthClientRecord>;
298
+ revokeOrganizationOAuthClient(organizationId: string, providerId: string, authenticationId?: string): Promise<CloudOAuthClientRecord>;
222
299
  configureApplicationCapability(projectId: string, capabilityId: string, input: ConfigureApplicationCapabilityRequest): Promise<ApplicationCapabilityRecord>;
223
300
  revokeApplicationCapability(projectId: string, capabilityId: string): Promise<ApplicationCapabilityRecord>;
224
301
  requestApplicationCapability<T = unknown>(projectId: string, capabilityId: string, input: ApplicationCapabilityRequest): Promise<ConnectionResponse<T>>;