@nobulex/kova 0.2.1
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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +84 -0
- package/dist/index.mjs +52 -0
- package/package.json +67 -0
- package/scripts/kova.js +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stele Labs, Inc.
|
|
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,46 @@
|
|
|
1
|
+
# Kova
|
|
2
|
+
|
|
3
|
+
**The trust layer for the agent economy.**
|
|
4
|
+
|
|
5
|
+
Kova is an open cryptographic protocol (MIT license) that enables AI agents to declare behavioral commitments, prove compliance, and build verifiable reputation across platforms. Single package, one import, 30-minute integration.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install kova
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { withKova } from 'kova';
|
|
17
|
+
|
|
18
|
+
const server = await withKova(yourMCPServer, 'data-isolation');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Three lines of code. Your MCP server is now wrapped with covenant enforcement.
|
|
22
|
+
|
|
23
|
+
## Presets
|
|
24
|
+
|
|
25
|
+
| Preset | Description |
|
|
26
|
+
|--------|-------------|
|
|
27
|
+
| `data-isolation` | Read-only data access, no writes, no network |
|
|
28
|
+
| `read-write` | Read/write to data and output, no network |
|
|
29
|
+
| `network` | Full network access with PII protection |
|
|
30
|
+
| `minimal` | Deny all; audit only |
|
|
31
|
+
|
|
32
|
+
## Advanced: 3 Primitives
|
|
33
|
+
|
|
34
|
+
For custom integrations, Kova re-exports the protocol primitives:
|
|
35
|
+
|
|
36
|
+
- **Identity Binding**: `createIdentity`, `evolveIdentity`
|
|
37
|
+
- **Covenant Declaration**: `buildCovenant`, `verifyCovenant`
|
|
38
|
+
- **Compliance Proof**: `generateComplianceProof`, `Monitor`
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { createIdentity, buildCovenant, generateComplianceProof } from 'kova';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kova — The trust layer for the agent economy.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { MCPServer, SteleGuardOptions, WrappedMCPServer } from '@nobulex/mcp';
|
|
6
|
+
|
|
7
|
+
export type KovaPreset = 'data-isolation' | 'read-write' | 'network' | 'minimal';
|
|
8
|
+
|
|
9
|
+
export function getPresetConstraints(preset: KovaPreset): string;
|
|
10
|
+
|
|
11
|
+
export function withKova(
|
|
12
|
+
server: MCPServer,
|
|
13
|
+
preset: KovaPreset | string,
|
|
14
|
+
options?: Partial<SteleGuardOptions>,
|
|
15
|
+
): Promise<WrappedMCPServer>;
|
|
16
|
+
|
|
17
|
+
export { createIdentity, evolveIdentity } from '@nobulex/identity';
|
|
18
|
+
export { buildCovenant, verifyCovenant } from '@nobulex/core';
|
|
19
|
+
export { generateComplianceProof } from '@nobulex/proof';
|
|
20
|
+
export { Monitor } from '@nobulex/enforcement';
|
|
21
|
+
|
|
22
|
+
export type { MCPServer, WrappedMCPServer, SteleGuardOptions } from '@nobulex/mcp';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Monitor: () => import_enforcement.Monitor,
|
|
24
|
+
buildCovenant: () => import_core.buildCovenant,
|
|
25
|
+
createIdentity: () => import_identity.createIdentity,
|
|
26
|
+
evolveIdentity: () => import_identity.evolveIdentity,
|
|
27
|
+
generateComplianceProof: () => import_proof.generateComplianceProof,
|
|
28
|
+
getPresetConstraints: () => getPresetConstraints,
|
|
29
|
+
verifyCovenant: () => import_core.verifyCovenant,
|
|
30
|
+
withKova: () => withKova
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
|
+
var import_mcp = require("@nobulex/mcp");
|
|
34
|
+
var import_identity = require("@nobulex/identity");
|
|
35
|
+
var import_core = require("@nobulex/core");
|
|
36
|
+
var import_proof = require("@nobulex/proof");
|
|
37
|
+
var import_enforcement = require("@nobulex/enforcement");
|
|
38
|
+
function getPresetConstraints(preset) {
|
|
39
|
+
const key = `standard:${preset}`;
|
|
40
|
+
const ccl = import_mcp.PRESETS[key];
|
|
41
|
+
if (!ccl) {
|
|
42
|
+
throw new Error(`Unknown preset: ${preset}. Use 'data-isolation', 'read-write', 'network', or 'minimal'.`);
|
|
43
|
+
}
|
|
44
|
+
return ccl;
|
|
45
|
+
}
|
|
46
|
+
async function withKova(server, preset, options) {
|
|
47
|
+
if (server == null) {
|
|
48
|
+
throw new Error("withKova: server is required");
|
|
49
|
+
}
|
|
50
|
+
if (typeof server !== "object") {
|
|
51
|
+
throw new Error("withKova: server must be an object with tools and handleToolCall");
|
|
52
|
+
}
|
|
53
|
+
if (typeof server.handleToolCall !== "function") {
|
|
54
|
+
throw new Error(
|
|
55
|
+
"withKova: server.handleToolCall is required. The MCP server must implement handleToolCall(name, args) => Promise<unknown>"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
if (typeof preset !== "string" || preset.trim() === "") {
|
|
59
|
+
throw new Error("withKova: preset must be a non-empty string");
|
|
60
|
+
}
|
|
61
|
+
const trimmed = preset.trim();
|
|
62
|
+
const isPreset = ["data-isolation", "read-write", "network", "minimal"].includes(trimmed) || trimmed.startsWith("standard:");
|
|
63
|
+
const constraints = isPreset ? trimmed.startsWith("standard:") ? trimmed : `standard:${trimmed}` : trimmed;
|
|
64
|
+
try {
|
|
65
|
+
return await import_mcp.SteleGuard.wrap(server, { constraints, ...options });
|
|
66
|
+
} catch (err) {
|
|
67
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
68
|
+
if (msg.includes("CCL") || msg.includes("parse")) {
|
|
69
|
+
throw new Error(`withKova: invalid CCL constraints. Use a preset ('data-isolation', 'read-write', 'network', 'minimal') or valid CCL. ${msg}`);
|
|
70
|
+
}
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
Monitor,
|
|
77
|
+
buildCovenant,
|
|
78
|
+
createIdentity,
|
|
79
|
+
evolveIdentity,
|
|
80
|
+
generateComplianceProof,
|
|
81
|
+
getPresetConstraints,
|
|
82
|
+
verifyCovenant,
|
|
83
|
+
withKova
|
|
84
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { SteleGuard, PRESETS } from "@nobulex/mcp";
|
|
3
|
+
import { createIdentity, evolveIdentity } from "@nobulex/identity";
|
|
4
|
+
import { buildCovenant, verifyCovenant } from "@nobulex/core";
|
|
5
|
+
import { generateComplianceProof } from "@nobulex/proof";
|
|
6
|
+
import { Monitor } from "@nobulex/enforcement";
|
|
7
|
+
function getPresetConstraints(preset) {
|
|
8
|
+
const key = `standard:${preset}`;
|
|
9
|
+
const ccl = PRESETS[key];
|
|
10
|
+
if (!ccl) {
|
|
11
|
+
throw new Error(`Unknown preset: ${preset}. Use 'data-isolation', 'read-write', 'network', or 'minimal'.`);
|
|
12
|
+
}
|
|
13
|
+
return ccl;
|
|
14
|
+
}
|
|
15
|
+
async function withKova(server, preset, options) {
|
|
16
|
+
if (server == null) {
|
|
17
|
+
throw new Error("withKova: server is required");
|
|
18
|
+
}
|
|
19
|
+
if (typeof server !== "object") {
|
|
20
|
+
throw new Error("withKova: server must be an object with tools and handleToolCall");
|
|
21
|
+
}
|
|
22
|
+
if (typeof server.handleToolCall !== "function") {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"withKova: server.handleToolCall is required. The MCP server must implement handleToolCall(name, args) => Promise<unknown>"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
if (typeof preset !== "string" || preset.trim() === "") {
|
|
28
|
+
throw new Error("withKova: preset must be a non-empty string");
|
|
29
|
+
}
|
|
30
|
+
const trimmed = preset.trim();
|
|
31
|
+
const isPreset = ["data-isolation", "read-write", "network", "minimal"].includes(trimmed) || trimmed.startsWith("standard:");
|
|
32
|
+
const constraints = isPreset ? trimmed.startsWith("standard:") ? trimmed : `standard:${trimmed}` : trimmed;
|
|
33
|
+
try {
|
|
34
|
+
return await SteleGuard.wrap(server, { constraints, ...options });
|
|
35
|
+
} catch (err) {
|
|
36
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
37
|
+
if (msg.includes("CCL") || msg.includes("parse")) {
|
|
38
|
+
throw new Error(`withKova: invalid CCL constraints. Use a preset ('data-isolation', 'read-write', 'network', 'minimal') or valid CCL. ${msg}`);
|
|
39
|
+
}
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
Monitor,
|
|
45
|
+
buildCovenant,
|
|
46
|
+
createIdentity,
|
|
47
|
+
evolveIdentity,
|
|
48
|
+
generateComplianceProof,
|
|
49
|
+
getPresetConstraints,
|
|
50
|
+
verifyCovenant,
|
|
51
|
+
withKova
|
|
52
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nobulex/kova",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Open cryptographic protocol (MIT) \u2014 the trust layer for the agent economy. AI agents declare behavioral commitments, prove compliance, build verifiable reputation.",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup src/index.ts --format cjs,esm && node -e \"require('fs').copyFileSync('src/index.d.ts','dist/index.d.ts')\"",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"scripts",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@nobulex/cli": "0.2.0",
|
|
28
|
+
"@nobulex/sdk": "0.2.0",
|
|
29
|
+
"@nobulex/mcp": "0.2.0",
|
|
30
|
+
"@nobulex/enforcement": "0.2.0",
|
|
31
|
+
"@nobulex/core": "0.2.0",
|
|
32
|
+
"@nobulex/ccl": "0.2.0",
|
|
33
|
+
"@nobulex/crypto": "0.2.0",
|
|
34
|
+
"@nobulex/identity": "0.2.0",
|
|
35
|
+
"@nobulex/proof": "0.2.0",
|
|
36
|
+
"@nobulex/store": "0.2.0",
|
|
37
|
+
"@nobulex/verifier": "0.2.0"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/nobulexdev/nobulex.git",
|
|
49
|
+
"directory": "packages/kova"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://nobulex.com",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/nobulexdev/nobulex/issues"
|
|
54
|
+
},
|
|
55
|
+
"author": "Nobulex Labs, Inc.",
|
|
56
|
+
"keywords": [
|
|
57
|
+
"kova",
|
|
58
|
+
"trust",
|
|
59
|
+
"agent",
|
|
60
|
+
"accountability",
|
|
61
|
+
"mcp",
|
|
62
|
+
"covenant"
|
|
63
|
+
],
|
|
64
|
+
"bin": {
|
|
65
|
+
"kova": "./scripts/kova.js"
|
|
66
|
+
}
|
|
67
|
+
}
|