kavachos 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +4 -5
- package/dist/agent/index.js +2 -2
- package/dist/audit/index.d.ts +3 -4
- package/dist/audit/index.js +2 -2
- package/dist/auth/index.d.ts +1719 -2
- package/dist/auth/index.js +2 -1
- package/dist/{chunk-I4J4KKKK.js → chunk-5DT4DN4Y.js} +9 -3
- package/dist/chunk-5DT4DN4Y.js.map +1 -0
- package/dist/chunk-KL6XW4S4.js +10774 -0
- package/dist/chunk-KL6XW4S4.js.map +1 -0
- package/dist/{chunk-DEVV32BE.js → chunk-OVGNZ5OX.js} +3 -3
- package/dist/{chunk-DEVV32BE.js.map → chunk-OVGNZ5OX.js.map} +1 -1
- package/dist/{chunk-N7VZO6SP.js → chunk-SJGSPIAD.js} +3 -3
- package/dist/{chunk-N7VZO6SP.js.map → chunk-SJGSPIAD.js.map} +1 -1
- package/dist/chunk-V66UUIA7.js +480 -0
- package/dist/chunk-V66UUIA7.js.map +1 -0
- package/dist/index.d.ts +1125 -14
- package/dist/index.js +2986 -111
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/permission/index.d.ts +4 -5
- package/dist/permission/index.js +2 -2
- package/dist/types-Xk83hv4O.d.ts +7759 -0
- package/dist/{types-B4sQA44H.d.ts → types-mwupB57A.d.ts} +5 -5
- package/package.json +1 -1
- package/dist/chunk-7RKVTHFC.js +0 -96
- package/dist/chunk-7RKVTHFC.js.map +0 -1
- package/dist/chunk-I4J4KKKK.js.map +0 -1
- package/dist/chunk-UEE7OYLG.js +0 -161
- package/dist/chunk-UEE7OYLG.js.map +0 -1
- package/dist/types-WP-mKSdQ.d.ts +0 -2349
- package/dist/types-_7hIICee.d.ts +0 -52
package/dist/types-_7hIICee.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core types for the human auth adapter system.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* A resolved human user identity. All fields except `id` are optional
|
|
6
|
-
* because different providers expose different levels of profile data.
|
|
7
|
-
*/
|
|
8
|
-
interface ResolvedUser {
|
|
9
|
-
/** Stable user ID (from the auth provider). */
|
|
10
|
-
id: string;
|
|
11
|
-
email?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
image?: string;
|
|
14
|
-
/** Any additional claims / metadata from the auth provider. */
|
|
15
|
-
metadata?: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Plug KavachOS into an existing auth system by implementing this interface.
|
|
19
|
-
*
|
|
20
|
-
* Only `resolveUser` is required – it is called for every inbound request that
|
|
21
|
-
* needs a human identity. The optional helpers (`getUser`, `syncUser`) are
|
|
22
|
-
* called by higher-level KavachOS flows when they need to fetch or persist user
|
|
23
|
-
* data.
|
|
24
|
-
*/
|
|
25
|
-
interface AuthAdapter {
|
|
26
|
-
/**
|
|
27
|
-
* Resolve a human user from an incoming HTTP `Request`.
|
|
28
|
-
*
|
|
29
|
-
* Inspect cookies, session tokens, `Authorization` headers, etc. and return
|
|
30
|
-
* the matching `ResolvedUser`. Return `null` when the request carries no
|
|
31
|
-
* recognisable credential.
|
|
32
|
-
*/
|
|
33
|
-
resolveUser(request: Request): Promise<ResolvedUser | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Fetch a user by their ID from the auth provider.
|
|
36
|
-
*
|
|
37
|
-
* Used when KavachOS needs to verify that a user still exists (e.g. before
|
|
38
|
-
* creating an agent on their behalf). Return `null` when the user is not
|
|
39
|
-
* found or has been deleted.
|
|
40
|
-
*/
|
|
41
|
-
getUser?(userId: string): Promise<ResolvedUser | null>;
|
|
42
|
-
/**
|
|
43
|
-
* Persist / update user data from the auth provider into the KavachOS
|
|
44
|
-
* `kavach_users` table.
|
|
45
|
-
*
|
|
46
|
-
* Called after a successful `resolveUser` when user data should be kept in
|
|
47
|
-
* sync with an external provider.
|
|
48
|
-
*/
|
|
49
|
-
syncUser?(user: ResolvedUser): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type { AuthAdapter as A, ResolvedUser as R };
|