managed-deepagents 0.0.3-dev.26 → 0.0.3-dev.29
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/identity.d.ts +273 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +358 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/auth.d.ts +44 -0
- package/dist/runtime/auth.d.ts.map +1 -0
- package/dist/runtime/auth.js +168 -0
- package/dist/runtime/auth.js.map +1 -0
- package/dist/runtime/credentials.d.ts +60 -0
- package/dist/runtime/credentials.d.ts.map +1 -0
- package/dist/runtime/credentials.js +189 -0
- package/dist/runtime/credentials.js.map +1 -0
- package/dist/runtime/identity-http.d.ts +8 -0
- package/dist/runtime/identity-http.d.ts.map +1 -0
- package/dist/runtime/identity-http.js +23 -0
- package/dist/runtime/identity-http.js.map +1 -0
- package/dist/runtime/identity-runtime.d.ts +54 -0
- package/dist/runtime/identity-runtime.d.ts.map +1 -0
- package/dist/runtime/identity-runtime.js +151 -0
- package/dist/runtime/identity-runtime.js.map +1 -0
- package/dist/runtime/index.d.ts +11 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +26 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/managed-middleware.d.ts +25 -0
- package/dist/runtime/managed-middleware.d.ts.map +1 -0
- package/dist/runtime/managed-middleware.js +76 -0
- package/dist/runtime/managed-middleware.js.map +1 -0
- package/dist/runtime/managed-tools.d.ts +61 -0
- package/dist/runtime/managed-tools.d.ts.map +1 -0
- package/dist/runtime/managed-tools.js +102 -0
- package/dist/runtime/managed-tools.js.map +1 -0
- package/dist/runtime/types.d.ts +18 -3
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/validated-token.d.ts +25 -0
- package/dist/runtime/validated-token.d.ts.map +1 -0
- package/dist/runtime/validated-token.js +260 -0
- package/dist/runtime/validated-token.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -8
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The managed `identity.ts` declaration primitive.
|
|
3
|
+
*
|
|
4
|
+
* A project's root `identity.ts` exports a named `identity` created with
|
|
5
|
+
* `defineIdentity(...)` (or `defineIdentity.preset(...)`). The compiler
|
|
6
|
+
* discovers it, generates the custom-auth handler, and wires thread/memory
|
|
7
|
+
* scoping and downstream credentials. See `specification/identity-final.md`.
|
|
8
|
+
*
|
|
9
|
+
* This module is pure authoring-time config construction plus eager validation —
|
|
10
|
+
* it has no runtime dependency (the `providers.*` helpers return plain data).
|
|
11
|
+
*/
|
|
12
|
+
/** How MDA learns who is calling on the HTTP ingress path (§6). */
|
|
13
|
+
export type HttpIngress = "trusted_backend" | ValidatedTokenIngress;
|
|
14
|
+
/**
|
|
15
|
+
* Browser-direct ingress: MDA verifies the caller's own IdP token server-side
|
|
16
|
+
* and derives identity from its claims (§6.2).
|
|
17
|
+
*/
|
|
18
|
+
export interface ValidatedTokenIngress {
|
|
19
|
+
mode: "validated_token";
|
|
20
|
+
/**
|
|
21
|
+
* The token families this deployment accepts (non-empty). MDA selects a
|
|
22
|
+
* provider per request by the token issuer (`iss`). Use one entry for a single
|
|
23
|
+
* IdP; `id` is required once there is more than one entry.
|
|
24
|
+
*/
|
|
25
|
+
providers: ValidatedTokenProvider[];
|
|
26
|
+
}
|
|
27
|
+
/** A single token family MDA knows how to verify (§6.2). */
|
|
28
|
+
export interface ValidatedTokenProvider {
|
|
29
|
+
/** Label used for routing; required only when there is more than one provider. */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Expected token issuer (`iss`) — the routing/verification key for real IdP tokens. */
|
|
32
|
+
issuer?: string;
|
|
33
|
+
/** Expected audience (`aud`), so tokens minted for other apps are rejected. */
|
|
34
|
+
audience?: string;
|
|
35
|
+
/** Accepted signing algorithms, e.g. `["RS256"]`. */
|
|
36
|
+
algorithms?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* URL of the IdP's public keys (JWKS). MDA verifies the signature locally —
|
|
39
|
+
* the recommended path for most OAuth/OIDC providers.
|
|
40
|
+
*/
|
|
41
|
+
jwks?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Resolve `jwks`/endpoints from `issuer/.well-known/openid-configuration`
|
|
44
|
+
* instead of a literal `jwks` URL (what `providers.oidc` sets).
|
|
45
|
+
*/
|
|
46
|
+
discover?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Only for opaque tokens: verify by calling the IdP once per request
|
|
49
|
+
* (e.g. Supabase `/auth/v1/user`).
|
|
50
|
+
*/
|
|
51
|
+
introspect?: {
|
|
52
|
+
/** Single introspection endpoint (the common case). */
|
|
53
|
+
url?: string;
|
|
54
|
+
/** Provider-specific endpoint selection by a client header (e.g. Supabase region). */
|
|
55
|
+
regionHeader?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Region value → introspection endpoint. A bare string is the URL (using the
|
|
58
|
+
* shared `headers` below); an object also carries region-specific headers
|
|
59
|
+
* (e.g. a per-region Supabase `apikey`), which override the shared ones.
|
|
60
|
+
*/
|
|
61
|
+
regions?: Record<string, string | {
|
|
62
|
+
url: string;
|
|
63
|
+
headers?: Record<string, string>;
|
|
64
|
+
}>;
|
|
65
|
+
/** Static headers sent with the introspection call (e.g. Supabase `apikey`). */
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
/** Where MDA puts the user's token when calling the endpoint. Default: "authorization". */
|
|
68
|
+
tokenIn?: "authorization" | "header";
|
|
69
|
+
/** Custom header name when `tokenIn` is "header". */
|
|
70
|
+
header?: string;
|
|
71
|
+
};
|
|
72
|
+
/** MDA issues + verifies short-lived signed tokens for anonymous/guest users. */
|
|
73
|
+
guest?: {
|
|
74
|
+
/** Enable an issue/reissue path for this provider. */
|
|
75
|
+
issue: boolean;
|
|
76
|
+
/** Token lifetime, e.g. "24h". */
|
|
77
|
+
ttl?: string;
|
|
78
|
+
/** Prefix applied to the generated actor id, e.g. "guest:". */
|
|
79
|
+
actorPrefix?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Maps verified token claims → identity envelope fields. */
|
|
82
|
+
claims: {
|
|
83
|
+
/** Claim used as `runtime.identity.actor.id` (e.g. "sub", "email"). */
|
|
84
|
+
actor: string;
|
|
85
|
+
/** Claim used as `runtime.identity.tenant.id` (e.g. "org_id"). */
|
|
86
|
+
tenant?: string;
|
|
87
|
+
/** Claim used as `runtime.identity.actor.email`. */
|
|
88
|
+
email?: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** Which downstream call needs a credential right now (§7). */
|
|
92
|
+
export interface CredentialTarget {
|
|
93
|
+
/** What is being called. */
|
|
94
|
+
kind: "subagent" | "mcp" | "connection";
|
|
95
|
+
/** The configured name, e.g. "code-reviewer" | "docs" | "github". */
|
|
96
|
+
name: string;
|
|
97
|
+
/** Optional read/write hint so the resolver can mint different tokens (§7.6). */
|
|
98
|
+
intent?: "read" | "write";
|
|
99
|
+
/** Current thread, when the credential is thread-specific. */
|
|
100
|
+
threadId?: string;
|
|
101
|
+
/** Free-form context (e.g. `{ repo, installationId }`); part of the cache key. */
|
|
102
|
+
metadata?: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
/** What a credential resolver returns (§7.2). */
|
|
105
|
+
export interface ResolvedCredential {
|
|
106
|
+
/** Headers MDA attaches to the downstream call (usually Authorization). */
|
|
107
|
+
headers: Record<string, string>;
|
|
108
|
+
/** ISO expiry; MDA caches per (actor, tenant, target) until then. */
|
|
109
|
+
expiresAt?: string;
|
|
110
|
+
}
|
|
111
|
+
/** The frozen identity envelope tools and middleware see (§8). */
|
|
112
|
+
export interface RuntimeIdentity {
|
|
113
|
+
actor: {
|
|
114
|
+
type: "user" | "service";
|
|
115
|
+
id: string;
|
|
116
|
+
email?: string;
|
|
117
|
+
};
|
|
118
|
+
tenant?: {
|
|
119
|
+
id: string;
|
|
120
|
+
};
|
|
121
|
+
source: {
|
|
122
|
+
provider: "http" | "slack" | "schedule" | "cli" | "studio";
|
|
123
|
+
threadId?: string;
|
|
124
|
+
};
|
|
125
|
+
claims?: Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
/** An in-process resolver callback (§7.2). */
|
|
128
|
+
export type CredentialResolver = (args: {
|
|
129
|
+
identity: RuntimeIdentity;
|
|
130
|
+
target: CredentialTarget;
|
|
131
|
+
}) => Promise<ResolvedCredential>;
|
|
132
|
+
/**
|
|
133
|
+
* Provide this (with `scoping.credentials: "custom"`) to mint your own
|
|
134
|
+
* downstream credentials per actor: an in-process callback or a hosted
|
|
135
|
+
* token-exchange endpoint.
|
|
136
|
+
*/
|
|
137
|
+
export type CredentialResolverConfig = {
|
|
138
|
+
resolve: CredentialResolver;
|
|
139
|
+
} | {
|
|
140
|
+
endpoint: {
|
|
141
|
+
url: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/** The tenant boundary (§5). */
|
|
145
|
+
export type Tenancy = "single" | "multi";
|
|
146
|
+
/** Who can open/resume the conversation (§4). */
|
|
147
|
+
export type ThreadScope = "actor" | "channel" | "tenant";
|
|
148
|
+
/** The durable Store namespace prefix (§4). */
|
|
149
|
+
export type MemoryScope = "actor" | "tenant" | "agent" | "none";
|
|
150
|
+
/** Whose token downstream calls carry (§4, §7). */
|
|
151
|
+
export type CredentialScope = "agent" | "actor" | "none" | "custom";
|
|
152
|
+
/** The whole identity config surface (§13.1). */
|
|
153
|
+
export interface IdentityConfig {
|
|
154
|
+
/** How MDA learns who is calling (§6). */
|
|
155
|
+
ingress: {
|
|
156
|
+
http: HttpIngress;
|
|
157
|
+
};
|
|
158
|
+
/** The tenant boundary (§5). */
|
|
159
|
+
tenancy: Tenancy;
|
|
160
|
+
/** The three scoping axes (§4). */
|
|
161
|
+
scoping: {
|
|
162
|
+
/** Who can open/resume the conversation. */
|
|
163
|
+
threads?: ThreadScope;
|
|
164
|
+
/** Durable Store namespace prefix. */
|
|
165
|
+
memory: MemoryScope;
|
|
166
|
+
/** Managed mode, or "custom" when a resolver/endpoint is provided below. */
|
|
167
|
+
credentials?: CredentialScope;
|
|
168
|
+
};
|
|
169
|
+
/** Present when `scoping.credentials` is "custom" (or a resolver is set). */
|
|
170
|
+
credentials?: CredentialResolverConfig;
|
|
171
|
+
}
|
|
172
|
+
/** The object exported from the project's root `identity.ts`. */
|
|
173
|
+
export interface IdentityDefinition {
|
|
174
|
+
readonly kind: "identity";
|
|
175
|
+
readonly config: IdentityConfig;
|
|
176
|
+
}
|
|
177
|
+
/** The archetype presets that expand to a full {@link IdentityConfig} (§3). */
|
|
178
|
+
export type IdentityPresetName = "private-assistant" | "multi-tenant-saas" | "shared-bot" | "internal-tool" | "service";
|
|
179
|
+
/** The signature of {@link defineIdentity}, including its `.preset` helper. */
|
|
180
|
+
export interface DefineIdentity {
|
|
181
|
+
(config: IdentityConfig): IdentityDefinition;
|
|
182
|
+
/**
|
|
183
|
+
* Start from a named archetype and optionally override any subset of it. The
|
|
184
|
+
* headline API for the common case (§3).
|
|
185
|
+
*/
|
|
186
|
+
preset(name: IdentityPresetName, overrides?: DeepPartial<IdentityConfig>): IdentityDefinition;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Declare the identity contract for the deployment.
|
|
190
|
+
*
|
|
191
|
+
* Most developers call {@link defineIdentity.preset} instead. The three scoping
|
|
192
|
+
* axes are the power-user layer underneath.
|
|
193
|
+
*/
|
|
194
|
+
export declare const defineIdentity: DefineIdentity;
|
|
195
|
+
/**
|
|
196
|
+
* A single Supabase region for multi-region introspection. A bare string is the
|
|
197
|
+
* introspection URL (using the shared `${SUPABASE_ANON_KEY}`); an object pins a
|
|
198
|
+
* `projectRef` or explicit `url`, plus an optional region-specific `anonKey`
|
|
199
|
+
* (or raw `headers`) so each region uses its own project and anon key.
|
|
200
|
+
*/
|
|
201
|
+
export type SupabaseRegion = string | {
|
|
202
|
+
projectRef?: string;
|
|
203
|
+
url?: string;
|
|
204
|
+
anonKey?: string;
|
|
205
|
+
headers?: Record<string, string>;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Provider integrations — authoring-time sugar over {@link ValidatedTokenProvider}
|
|
209
|
+
* (§6.2). Each returns a plain provider object you can spread-and-override, so
|
|
210
|
+
* there is no new runtime surface.
|
|
211
|
+
*/
|
|
212
|
+
export declare const providers: {
|
|
213
|
+
auth0({ domain, audience, }: {
|
|
214
|
+
domain: string;
|
|
215
|
+
audience?: string;
|
|
216
|
+
}): ValidatedTokenProvider;
|
|
217
|
+
clerk({ domain }: {
|
|
218
|
+
domain: string;
|
|
219
|
+
}): ValidatedTokenProvider;
|
|
220
|
+
okta({ domain, audience, }: {
|
|
221
|
+
domain: string;
|
|
222
|
+
audience?: string;
|
|
223
|
+
}): ValidatedTokenProvider;
|
|
224
|
+
cognito({ userPoolId, region, }: {
|
|
225
|
+
userPoolId: string;
|
|
226
|
+
region: string;
|
|
227
|
+
}): ValidatedTokenProvider;
|
|
228
|
+
entra({ tenantId, audience, }: {
|
|
229
|
+
tenantId: string;
|
|
230
|
+
audience?: string;
|
|
231
|
+
}): ValidatedTokenProvider;
|
|
232
|
+
google({ audience }?: {
|
|
233
|
+
audience?: string;
|
|
234
|
+
}): ValidatedTokenProvider;
|
|
235
|
+
supabase({ projectRef, introspect, regions, regionHeader, }: {
|
|
236
|
+
projectRef?: string;
|
|
237
|
+
introspect?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Multi-region introspection: map each region to its Supabase project. A
|
|
240
|
+
* string is a `projectRef`; an object can pin an explicit `url`/`anonKey` (so
|
|
241
|
+
* each region uses its own project + anon key). Only valid with `introspect`.
|
|
242
|
+
*/
|
|
243
|
+
regions?: Record<string, SupabaseRegion>;
|
|
244
|
+
/** Client header carrying the region (default `x-supabase-region`). */
|
|
245
|
+
regionHeader?: string;
|
|
246
|
+
}): ValidatedTokenProvider;
|
|
247
|
+
/** Universal fallback for any OIDC-compliant IdP via discovery. */
|
|
248
|
+
oidc({ issuer, audience, }: {
|
|
249
|
+
issuer: string;
|
|
250
|
+
audience?: string;
|
|
251
|
+
}): ValidatedTokenProvider;
|
|
252
|
+
/**
|
|
253
|
+
* GitHub OAuth access tokens (opaque bearer tokens, not JWTs). MDA verifies
|
|
254
|
+
* each request by calling `GET https://api.github.com/user` with the token.
|
|
255
|
+
*/
|
|
256
|
+
github(): ValidatedTokenProvider;
|
|
257
|
+
/** MDA-issued anonymous/guest tokens. */
|
|
258
|
+
guest({ ttl, actorPrefix, }?: {
|
|
259
|
+
ttl?: string;
|
|
260
|
+
actorPrefix?: string;
|
|
261
|
+
}): ValidatedTokenProvider;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Eagerly reject illegal identity configs at authoring time so misconfig never
|
|
265
|
+
* reaches the compiler or runtime (§4.4).
|
|
266
|
+
*/
|
|
267
|
+
export declare function validateIdentity(config: IdentityConfig): void;
|
|
268
|
+
/** Recursively merge plain objects; arrays and primitives from `patch` win. */
|
|
269
|
+
type DeepPartial<T> = T extends object ? {
|
|
270
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
271
|
+
} : T;
|
|
272
|
+
export {};
|
|
273
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;;OAIG;IACH,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,EAAE,CAAC,EAAE,M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cACO,sBAAsB;IAehC,yCAAyC;kCAItC;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAQ,sBAAsB;CAWxE,CAAC;AAIF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CA0E7D;AA0ED,+EAA+E;AAC/E,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAClC;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAC"}
|
package/dist/identity.js
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The managed `identity.ts` declaration primitive.
|
|
3
|
+
*
|
|
4
|
+
* A project's root `identity.ts` exports a named `identity` created with
|
|
5
|
+
* `defineIdentity(...)` (or `defineIdentity.preset(...)`). The compiler
|
|
6
|
+
* discovers it, generates the custom-auth handler, and wires thread/memory
|
|
7
|
+
* scoping and downstream credentials. See `specification/identity-final.md`.
|
|
8
|
+
*
|
|
9
|
+
* This module is pure authoring-time config construction plus eager validation —
|
|
10
|
+
* it has no runtime dependency (the `providers.*` helpers return plain data).
|
|
11
|
+
*/
|
|
12
|
+
const PRESETS = {
|
|
13
|
+
"private-assistant": {
|
|
14
|
+
ingress: { http: "trusted_backend" },
|
|
15
|
+
tenancy: "single",
|
|
16
|
+
scoping: { threads: "actor", memory: "actor", credentials: "actor" },
|
|
17
|
+
},
|
|
18
|
+
"multi-tenant-saas": {
|
|
19
|
+
ingress: { http: "trusted_backend" },
|
|
20
|
+
tenancy: "multi",
|
|
21
|
+
scoping: { threads: "actor", memory: "tenant", credentials: "agent" },
|
|
22
|
+
},
|
|
23
|
+
"shared-bot": {
|
|
24
|
+
ingress: { http: "trusted_backend" },
|
|
25
|
+
tenancy: "single",
|
|
26
|
+
scoping: { threads: "channel", memory: "actor", credentials: "agent" },
|
|
27
|
+
},
|
|
28
|
+
"internal-tool": {
|
|
29
|
+
ingress: { http: "trusted_backend" },
|
|
30
|
+
tenancy: "single",
|
|
31
|
+
scoping: { threads: "actor", memory: "actor", credentials: "agent" },
|
|
32
|
+
},
|
|
33
|
+
service: {
|
|
34
|
+
ingress: { http: "trusted_backend" },
|
|
35
|
+
tenancy: "single",
|
|
36
|
+
scoping: { memory: "agent", credentials: "agent" },
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Declare the identity contract for the deployment.
|
|
41
|
+
*
|
|
42
|
+
* Most developers call {@link defineIdentity.preset} instead. The three scoping
|
|
43
|
+
* axes are the power-user layer underneath.
|
|
44
|
+
*/
|
|
45
|
+
export const defineIdentity = Object.assign(function defineIdentity(config) {
|
|
46
|
+
validateIdentity(config);
|
|
47
|
+
return { kind: "identity", config };
|
|
48
|
+
}, {
|
|
49
|
+
preset(name, overrides) {
|
|
50
|
+
const base = PRESETS[name];
|
|
51
|
+
if (base === undefined) {
|
|
52
|
+
throw new Error(`defineIdentity.preset(...) unknown preset "${String(name)}". ` +
|
|
53
|
+
`Valid presets: ${Object.keys(PRESETS).join(", ")}.`);
|
|
54
|
+
}
|
|
55
|
+
return defineIdentity(deepMerge(base, overrides));
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
function supabaseBase(projectRef) {
|
|
59
|
+
return `https://${projectRef}.supabase.co/auth/v1`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Normalize authoring-time Supabase regions into the runtime `regions` shape. A
|
|
63
|
+
* bare string stays a URL (using the shared base `apikey`); an object resolves
|
|
64
|
+
* its `url` from `url`/`projectRef` and, when given, carries region-specific
|
|
65
|
+
* `headers`/`anonKey` that override the shared `apikey` at introspection time.
|
|
66
|
+
*/
|
|
67
|
+
function normalizeSupabaseRegions(regions) {
|
|
68
|
+
const out = {};
|
|
69
|
+
for (const [region, entry] of Object.entries(regions)) {
|
|
70
|
+
if (typeof entry === "string") {
|
|
71
|
+
out[region] = entry;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const url = entry.url ??
|
|
75
|
+
(entry.projectRef ? `${supabaseBase(entry.projectRef)}/user` : undefined);
|
|
76
|
+
if (!url) {
|
|
77
|
+
throw new Error(`providers.supabase(...) region "${region}" needs a \`projectRef\` or \`url\`.`);
|
|
78
|
+
}
|
|
79
|
+
const headers = entry.headers ?? (entry.anonKey ? { apikey: entry.anonKey } : undefined);
|
|
80
|
+
out[region] = headers ? { url, headers } : { url };
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Provider integrations — authoring-time sugar over {@link ValidatedTokenProvider}
|
|
86
|
+
* (§6.2). Each returns a plain provider object you can spread-and-override, so
|
|
87
|
+
* there is no new runtime surface.
|
|
88
|
+
*/
|
|
89
|
+
export const providers = {
|
|
90
|
+
auth0({ domain, audience, }) {
|
|
91
|
+
return {
|
|
92
|
+
issuer: `https://${domain}/`,
|
|
93
|
+
jwks: `https://${domain}/.well-known/jwks.json`,
|
|
94
|
+
...(audience ? { audience } : {}),
|
|
95
|
+
algorithms: ["RS256"],
|
|
96
|
+
claims: { actor: "sub", tenant: "org_id" },
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
clerk({ domain }) {
|
|
100
|
+
return {
|
|
101
|
+
issuer: `https://${domain}`,
|
|
102
|
+
jwks: `https://${domain}/.well-known/jwks.json`,
|
|
103
|
+
algorithms: ["RS256"],
|
|
104
|
+
claims: { actor: "sub" },
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
okta({ domain, audience, }) {
|
|
108
|
+
return {
|
|
109
|
+
issuer: `https://${domain}`,
|
|
110
|
+
jwks: `https://${domain}/oauth2/v1/keys`,
|
|
111
|
+
...(audience ? { audience } : {}),
|
|
112
|
+
algorithms: ["RS256"],
|
|
113
|
+
claims: { actor: "sub" },
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
cognito({ userPoolId, region, }) {
|
|
117
|
+
const issuer = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;
|
|
118
|
+
return {
|
|
119
|
+
issuer,
|
|
120
|
+
jwks: `${issuer}/.well-known/jwks.json`,
|
|
121
|
+
algorithms: ["RS256"],
|
|
122
|
+
claims: { actor: "sub" },
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
entra({ tenantId, audience, }) {
|
|
126
|
+
return {
|
|
127
|
+
issuer: `https://login.microsoftonline.com/${tenantId}/v2.0`,
|
|
128
|
+
jwks: `https://login.microsoftonline.com/${tenantId}/discovery/v2.0/keys`,
|
|
129
|
+
...(audience ? { audience } : {}),
|
|
130
|
+
algorithms: ["RS256"],
|
|
131
|
+
claims: { actor: "oid" },
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
google({ audience } = {}) {
|
|
135
|
+
return {
|
|
136
|
+
issuer: "https://accounts.google.com",
|
|
137
|
+
jwks: "https://www.googleapis.com/oauth2/v3/certs",
|
|
138
|
+
...(audience ? { audience } : {}),
|
|
139
|
+
algorithms: ["RS256"],
|
|
140
|
+
claims: { actor: "sub", email: "email" },
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
supabase({ projectRef, introspect, regions, regionHeader = "x-supabase-region", }) {
|
|
144
|
+
if (introspect) {
|
|
145
|
+
if (regions) {
|
|
146
|
+
return {
|
|
147
|
+
id: "supabase",
|
|
148
|
+
introspect: {
|
|
149
|
+
regionHeader,
|
|
150
|
+
regions: normalizeSupabaseRegions(regions),
|
|
151
|
+
headers: { apikey: "${SUPABASE_ANON_KEY}" },
|
|
152
|
+
},
|
|
153
|
+
claims: { actor: "email" },
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (!projectRef) {
|
|
157
|
+
throw new Error("providers.supabase(...) requires `projectRef` (single region) or `regions`.");
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
id: "supabase",
|
|
161
|
+
introspect: {
|
|
162
|
+
url: `${supabaseBase(projectRef)}/user`,
|
|
163
|
+
headers: { apikey: "${SUPABASE_ANON_KEY}" },
|
|
164
|
+
},
|
|
165
|
+
claims: { actor: "email" },
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (!projectRef) {
|
|
169
|
+
throw new Error("providers.supabase(...) without `introspect` requires `projectRef`.");
|
|
170
|
+
}
|
|
171
|
+
const base = supabaseBase(projectRef);
|
|
172
|
+
return {
|
|
173
|
+
id: "supabase",
|
|
174
|
+
issuer: base,
|
|
175
|
+
jwks: `${base}/.well-known/jwks.json`,
|
|
176
|
+
algorithms: ["ES256", "RS256"],
|
|
177
|
+
claims: { actor: "email" },
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
/** Universal fallback for any OIDC-compliant IdP via discovery. */
|
|
181
|
+
oidc({ issuer, audience, }) {
|
|
182
|
+
return {
|
|
183
|
+
issuer,
|
|
184
|
+
discover: true,
|
|
185
|
+
...(audience ? { audience } : {}),
|
|
186
|
+
claims: { actor: "sub" },
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* GitHub OAuth access tokens (opaque bearer tokens, not JWTs). MDA verifies
|
|
191
|
+
* each request by calling `GET https://api.github.com/user` with the token.
|
|
192
|
+
*/
|
|
193
|
+
github() {
|
|
194
|
+
return {
|
|
195
|
+
id: "github",
|
|
196
|
+
introspect: {
|
|
197
|
+
url: "https://api.github.com/user",
|
|
198
|
+
headers: {
|
|
199
|
+
Accept: "application/vnd.github+json",
|
|
200
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
201
|
+
"User-Agent": "managed-deepagents-github-example",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
claims: { actor: "login", email: "email" },
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
/** MDA-issued anonymous/guest tokens. */
|
|
208
|
+
guest({ ttl, actorPrefix, } = {}) {
|
|
209
|
+
return {
|
|
210
|
+
id: "guest",
|
|
211
|
+
guest: {
|
|
212
|
+
issue: true,
|
|
213
|
+
...(ttl ? { ttl } : {}),
|
|
214
|
+
...(actorPrefix ? { actorPrefix } : {}),
|
|
215
|
+
},
|
|
216
|
+
claims: { actor: "sub" },
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
const MANAGED_CREDENTIAL_MODES = ["agent", "actor", "none"];
|
|
221
|
+
/**
|
|
222
|
+
* Eagerly reject illegal identity configs at authoring time so misconfig never
|
|
223
|
+
* reaches the compiler or runtime (§4.4).
|
|
224
|
+
*/
|
|
225
|
+
export function validateIdentity(config) {
|
|
226
|
+
const provided = config;
|
|
227
|
+
const ingress = provided.ingress;
|
|
228
|
+
if (ingress === null || typeof ingress !== "object" || !("http" in ingress)) {
|
|
229
|
+
throw new Error("defineIdentity(...) requires an `ingress.http` value ('trusted_backend' or a validated_token config).");
|
|
230
|
+
}
|
|
231
|
+
const tenancy = provided.tenancy;
|
|
232
|
+
if (tenancy !== "single" && tenancy !== "multi") {
|
|
233
|
+
throw new Error('defineIdentity(...) requires `tenancy` to be "single" or "multi".');
|
|
234
|
+
}
|
|
235
|
+
const scoping = provided.scoping;
|
|
236
|
+
if (scoping === null || typeof scoping !== "object") {
|
|
237
|
+
throw new Error("defineIdentity(...) requires a `scoping` object.");
|
|
238
|
+
}
|
|
239
|
+
if (typeof scoping.memory !== "string") {
|
|
240
|
+
throw new Error('defineIdentity(...) requires `scoping.memory` (one of "actor" | "tenant" | "agent" | "none").');
|
|
241
|
+
}
|
|
242
|
+
// tenancy: "single" cannot use any tenant-scoped axis.
|
|
243
|
+
if (tenancy === "single") {
|
|
244
|
+
const tenantAxes = ["threads", "memory", "credentials"].filter((axis) => scoping[axis] === "tenant");
|
|
245
|
+
if (tenantAxes.length > 0) {
|
|
246
|
+
throw new Error(`defineIdentity(...) cannot use "tenant" scope (${tenantAxes.join(", ")}) with tenancy: "single". Set tenancy: "multi".`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Credentials axis must agree with the presence of a resolver/endpoint.
|
|
250
|
+
const hasResolver = provided.credentials !== undefined;
|
|
251
|
+
const credentialsMode = scoping.credentials;
|
|
252
|
+
if (credentialsMode === "custom" && !hasResolver) {
|
|
253
|
+
throw new Error('defineIdentity(...) with scoping.credentials: "custom" requires a `credentials` resolver or endpoint.');
|
|
254
|
+
}
|
|
255
|
+
if (hasResolver &&
|
|
256
|
+
typeof credentialsMode === "string" &&
|
|
257
|
+
MANAGED_CREDENTIAL_MODES.includes(credentialsMode)) {
|
|
258
|
+
throw new Error(`defineIdentity(...) provides a \`credentials\` resolver but scoping.credentials is "${credentialsMode}". ` +
|
|
259
|
+
'Set scoping.credentials: "custom" (or remove the resolver).');
|
|
260
|
+
}
|
|
261
|
+
if (hasResolver) {
|
|
262
|
+
validateCredentialResolver(provided.credentials);
|
|
263
|
+
}
|
|
264
|
+
// validated_token ingress needs at least one provider, each with claims.actor.
|
|
265
|
+
const http = ingress.http;
|
|
266
|
+
if (isValidatedToken(http)) {
|
|
267
|
+
validateValidatedToken(http);
|
|
268
|
+
}
|
|
269
|
+
else if (http !== "trusted_backend") {
|
|
270
|
+
throw new Error('defineIdentity(...) `ingress.http` must be "trusted_backend" or a { mode: "validated_token", providers: [...] } config.');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function isValidatedToken(http) {
|
|
274
|
+
return (typeof http === "object" &&
|
|
275
|
+
http !== null &&
|
|
276
|
+
http.mode === "validated_token");
|
|
277
|
+
}
|
|
278
|
+
function validateValidatedToken(http) {
|
|
279
|
+
const list = http.providers;
|
|
280
|
+
if (!Array.isArray(list) || list.length === 0) {
|
|
281
|
+
throw new Error("defineIdentity(...) validated_token ingress requires a non-empty `providers` list.");
|
|
282
|
+
}
|
|
283
|
+
const multiple = list.length > 1;
|
|
284
|
+
for (const [index, entry] of list.entries()) {
|
|
285
|
+
const provider = entry;
|
|
286
|
+
const label = provider?.id ?? `#${index}`;
|
|
287
|
+
if (provider === null || typeof provider !== "object") {
|
|
288
|
+
throw new Error(`defineIdentity(...) validated_token provider ${label} must be an object.`);
|
|
289
|
+
}
|
|
290
|
+
if (typeof provider.claims !== "object" ||
|
|
291
|
+
provider.claims === null ||
|
|
292
|
+
typeof provider.claims.actor !== "string" ||
|
|
293
|
+
provider.claims.actor.length === 0) {
|
|
294
|
+
throw new Error(`defineIdentity(...) validated_token provider ${label} requires \`claims.actor\`.`);
|
|
295
|
+
}
|
|
296
|
+
if (multiple && typeof provider.id !== "string") {
|
|
297
|
+
throw new Error("defineIdentity(...) each validated_token provider requires an `id` when more than one is configured.");
|
|
298
|
+
}
|
|
299
|
+
const hasVerifier = typeof provider.jwks === "string" ||
|
|
300
|
+
provider.discover === true ||
|
|
301
|
+
provider.introspect !== undefined ||
|
|
302
|
+
provider.guest !== undefined;
|
|
303
|
+
if (!hasVerifier) {
|
|
304
|
+
throw new Error(`defineIdentity(...) validated_token provider ${label} must declare one of \`jwks\`, \`discover\`, \`introspect\`, or \`guest\`.`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function validateCredentialResolver(credentials) {
|
|
309
|
+
if (credentials === null || typeof credentials !== "object") {
|
|
310
|
+
throw new Error("defineIdentity(...) `credentials` must be a resolver ({ resolve }) or endpoint ({ endpoint }) config.");
|
|
311
|
+
}
|
|
312
|
+
const cfg = credentials;
|
|
313
|
+
const hasResolveFn = typeof cfg.resolve === "function";
|
|
314
|
+
const hasEndpoint = typeof cfg.endpoint === "object" &&
|
|
315
|
+
cfg.endpoint !== null &&
|
|
316
|
+
typeof cfg.endpoint.url === "string";
|
|
317
|
+
if (hasResolveFn === hasEndpoint) {
|
|
318
|
+
throw new Error("defineIdentity(...) `credentials` requires exactly one of `resolve` (function) or `endpoint` ({ url }).");
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function isPlainObject(value) {
|
|
322
|
+
return (typeof value === "object" &&
|
|
323
|
+
value !== null &&
|
|
324
|
+
!Array.isArray(value) &&
|
|
325
|
+
typeof value !== "function");
|
|
326
|
+
}
|
|
327
|
+
function deepMerge(base, patch) {
|
|
328
|
+
if (patch === undefined)
|
|
329
|
+
return structuredCloneConfig(base);
|
|
330
|
+
if (!isPlainObject(base) || !isPlainObject(patch)) {
|
|
331
|
+
return patch;
|
|
332
|
+
}
|
|
333
|
+
const out = { ...base };
|
|
334
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
335
|
+
if (value === undefined)
|
|
336
|
+
continue;
|
|
337
|
+
const current = out[key];
|
|
338
|
+
out[key] =
|
|
339
|
+
isPlainObject(current) && isPlainObject(value)
|
|
340
|
+
? deepMerge(current, value)
|
|
341
|
+
: value;
|
|
342
|
+
}
|
|
343
|
+
return out;
|
|
344
|
+
}
|
|
345
|
+
function structuredCloneConfig(value) {
|
|
346
|
+
if (Array.isArray(value)) {
|
|
347
|
+
return value.map((item) => structuredCloneConfig(item));
|
|
348
|
+
}
|
|
349
|
+
if (isPlainObject(value)) {
|
|
350
|
+
const out = {};
|
|
351
|
+
for (const [key, inner] of Object.entries(value)) {
|
|
352
|
+
out[key] = structuredCloneConfig(inner);
|
|
353
|
+
}
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiLH,MAAM,OAAO,GAA+C;IAC1D,mBAAmB,EAAE;QACnB,OAAO,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;QACpC,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE;KACrE;IACD,mBAAmB,EAAE;QACnB,OAAO,EAAE,EAAE,IA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AE,CAAC;IACjD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,GAAG,CAAC,GAAG,CAAC;YACN,aAAa,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC;gBAC5C,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,KAAoC,CAAC;gBAC1D,CAAC,CAAC,KAAK,CAAC;IACd,CAAC;IACD,OAAO,GAAQ,CAAC;AAClB,CAAC;AAED,SAAS,qBAAqB,CAAI,KAAQ;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAiB,CAAC;IAC1E,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACjD,GAAG,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,GAAQ,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ export { defineDeepAgent } from "./define-deep-agent.js";
|
|
|
2
2
|
export { defineMcpServers } from "./connectors.js";
|
|
3
3
|
export { defineSchedule } from "./schedules.js";
|
|
4
4
|
export { defineSandbox } from "./sandbox.js";
|
|
5
|
+
export { defineIdentity, providers, validateIdentity } from "./identity.js";
|
|
6
|
+
export type { CredentialResolver, CredentialResolverConfig, CredentialScope, CredentialTarget, DefineIdentity, HttpIngress, IdentityConfig, IdentityDefinition, IdentityPresetName, MemoryScope, ResolvedCredential, RuntimeIdentity, Tenancy, ThreadScope, ValidatedTokenIngress, ValidatedTokenProvider, } from "./identity.js";
|
|
5
7
|
export type { HttpMcpServerConfig, McpServersConfig, McpServersDefinition, McpToolSelectionConfig, RemoteMcpServerBaseConfig, RemoteMcpServerConfig, SseMcpServerConfig, } from "./connectors.js";
|
|
6
8
|
export type { ScheduleConfig, ScheduleDefinition, ScheduleDeliveryTarget, ScheduleThreadConfig, } from "./schedules.js";
|
|
7
9
|
export type { ChannelAttachment, ChannelDestination, ChannelEvent, ChannelMessage, ChannelPostOptions, DeepAgentDefinition, DefineDeepAgentConfig, ManagedDeepAgentKey, PostedChannelMessage, Runtime, RuntimeChannel, } from "./types.js";
|
|
10
|
+
export type { ManagedDeepAgentRuntime, ManagedRuntimeExtras, } from "./runtime/managed-tools.js";
|
|
8
11
|
export type { DefineSandboxOptions, ManagedSandboxOptionKey, SandboxDefinition, SandboxProviderClass, SandboxProviderOptions, SandboxScope, } from "./sandbox.js";
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|