@kavachos/nuxt 0.0.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/package.json +49 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KavachOS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @kavachos/nuxt
2
+
3
+ Nuxt adapter for KavachOS.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@kavachos/nuxt)](https://www.npmjs.com/package/@kavachos/nuxt)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add kavachos @kavachos/nuxt
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Create `server/api/kavach/[...].ts`:
16
+
17
+ ```typescript
18
+ import { createKavach } from 'kavachos';
19
+ import { kavachNuxt } from '@kavachos/nuxt';
20
+
21
+ const kavach = createKavach({
22
+ database: { provider: 'sqlite', url: 'kavach.db' },
23
+ });
24
+
25
+ export default kavachNuxt(kavach);
26
+ ```
27
+
28
+ This handles the full KavachOS REST API under `/api/kavach`: agent CRUD, authorization, delegations, audit logs, and dashboard stats.
29
+
30
+ ### With MCP OAuth 2.1
31
+
32
+ ```typescript
33
+ import { createMcpModule } from 'kavachos/mcp';
34
+ import { kavachNuxt } from '@kavachos/nuxt';
35
+
36
+ const mcp = createMcpModule({
37
+ issuer: 'https://your-app.com',
38
+ // ...
39
+ });
40
+
41
+ export default kavachNuxt(kavach, { mcp });
42
+ ```
43
+
44
+ When `mcp` is provided, the OAuth 2.1 endpoints are enabled:
45
+
46
+ - `GET /.well-known/oauth-authorization-server`
47
+ - `GET /.well-known/oauth-protected-resource`
48
+ - `POST /mcp/register`
49
+ - `GET /mcp/authorize`
50
+ - `POST /mcp/token`
51
+
52
+ ## API surface
53
+
54
+ `kavachNuxt(kavach, options?)` returns an H3 `EventHandler` for use as a Nuxt server route.
55
+
56
+ | Option | Type | Description |
57
+ |--------|------|-------------|
58
+ | `mcp` | `McpAuthModule` | Enables MCP OAuth 2.1 endpoints |
59
+ | `basePath` | `string` | URL prefix before the catch-all segment. Defaults to `/api/kavach` |
60
+
61
+ For full docs on agent identity, permissions, delegation, and audit, see the main [kavachos](https://www.npmjs.com/package/kavachos) package.
62
+
63
+ ## Links
64
+
65
+ - [Documentation](https://kavachos.dev/docs)
66
+ - [GitHub](https://github.com/kavachos/kavachos)
67
+
68
+ ## License
69
+
70
+ MIT
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@kavachos/nuxt",
3
+ "version": "0.0.2",
4
+ "description": "Nuxt adapter for KavachOS - exposes agent auth as HTTP REST endpoints via H3",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "keywords": [
18
+ "kavachos",
19
+ "nuxt",
20
+ "h3",
21
+ "auth",
22
+ "agent",
23
+ "mcp"
24
+ ],
25
+ "author": "KavachOS <hello@kavachos.com>",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/kavachos/kavachos.git",
30
+ "directory": "packages/adapters/nuxt"
31
+ },
32
+ "peerDependencies": {
33
+ "nuxt": ">=3.0.0",
34
+ "zod": ">=3.0.0",
35
+ "kavachos": "0.0.2"
36
+ },
37
+ "devDependencies": {
38
+ "h3": "^1.13.0",
39
+ "nuxt": "^3.16.0",
40
+ "tsup": "^8.4.0",
41
+ "typescript": "^5.8.0",
42
+ "zod": "^3.24.0",
43
+ "kavachos": "0.0.2"
44
+ },
45
+ "scripts": {
46
+ "build": "tsup",
47
+ "typecheck": "tsc --noEmit"
48
+ }
49
+ }