@kya-os/contracts 1.3.3 → 1.3.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/package.json +3 -2
- package/README.md +0 -130
- package/dist/agentshield-api/endpoints.d.ts +0 -21
- package/dist/agentshield-api/endpoints.js +0 -20
- package/dist/agentshield-api/index.d.ts +0 -5
- package/dist/agentshield-api/index.js +0 -27
- package/dist/agentshield-api/schemas.d.ts +0 -9846
- package/dist/agentshield-api/schemas.js +0 -92
- package/dist/agentshield-api/types.d.ts +0 -92
- package/dist/agentshield-api/types.js +0 -12
- package/dist/cli.d.ts +0 -375
- package/dist/cli.js +0 -109
- package/dist/config/base.d.ts +0 -19
- package/dist/config/base.js +0 -2
- package/dist/config/delegation.d.ts +0 -46
- package/dist/config/delegation.js +0 -2
- package/dist/config/identity.d.ts +0 -22
- package/dist/config/identity.js +0 -2
- package/dist/config/index.d.ts +0 -17
- package/dist/config/index.js +0 -2
- package/dist/config/proofing.d.ts +0 -26
- package/dist/config/proofing.js +0 -2
- package/dist/config/tool-protection.d.ts +0 -36
- package/dist/config/tool-protection.js +0 -2
- package/dist/delegation/constraints.d.ts +0 -726
- package/dist/delegation/constraints.js +0 -103
- package/dist/delegation/index.d.ts +0 -2
- package/dist/delegation/index.js +0 -18
- package/dist/delegation/schemas.d.ts +0 -8042
- package/dist/delegation/schemas.js +0 -232
- package/dist/did/index.d.ts +0 -3
- package/dist/did/index.js +0 -19
- package/dist/did/resolve-contract.d.ts +0 -53
- package/dist/did/resolve-contract.js +0 -12
- package/dist/did/schemas.d.ts +0 -33
- package/dist/did/schemas.js +0 -80
- package/dist/did/types.d.ts +0 -38
- package/dist/did/types.js +0 -37
- package/dist/env/constants.d.ts +0 -13
- package/dist/env/constants.js +0 -15
- package/dist/env/index.d.ts +0 -1
- package/dist/env/index.js +0 -17
- package/dist/handshake.d.ts +0 -138
- package/dist/handshake.js +0 -50
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -28
- package/dist/proof/index.d.ts +0 -2
- package/dist/proof/index.js +0 -18
- package/dist/proof/proof-record.d.ts +0 -728
- package/dist/proof/proof-record.js +0 -60
- package/dist/proof/signing-spec.d.ts +0 -73
- package/dist/proof/signing-spec.js +0 -52
- package/dist/proof.d.ts +0 -378
- package/dist/proof.js +0 -59
- package/dist/registry.d.ts +0 -326
- package/dist/registry.js +0 -98
- package/dist/runtime/errors.d.ts +0 -179
- package/dist/runtime/errors.js +0 -51
- package/dist/runtime/headers.d.ts +0 -34
- package/dist/runtime/headers.js +0 -52
- package/dist/runtime/index.d.ts +0 -2
- package/dist/runtime/index.js +0 -18
- package/dist/test.d.ts +0 -215
- package/dist/test.js +0 -83
- package/dist/tlkrc/index.d.ts +0 -1
- package/dist/tlkrc/index.js +0 -17
- package/dist/tlkrc/rotation.d.ts +0 -168
- package/dist/tlkrc/rotation.js +0 -55
- package/dist/tool-protection/index.d.ts +0 -129
- package/dist/tool-protection/index.js +0 -80
- package/dist/utils/validation.d.ts +0 -14
- package/dist/utils/validation.js +0 -56
- package/dist/vc/index.d.ts +0 -2
- package/dist/vc/index.js +0 -18
- package/dist/vc/schemas.d.ts +0 -1888
- package/dist/vc/schemas.js +0 -116
- package/dist/vc/statuslist.d.ts +0 -292
- package/dist/vc/statuslist.js +0 -61
- package/dist/verifier.d.ts +0 -202
- package/dist/verifier.js +0 -76
- package/dist/well-known/index.d.ts +0 -248
- package/dist/well-known/index.js +0 -104
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/contracts",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Shared types and schemas for XMCP-I ecosystem",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -102,7 +102,8 @@
|
|
|
102
102
|
"!dist/**/*.spec.*",
|
|
103
103
|
"!dist/**/*.test.*",
|
|
104
104
|
"!README.md",
|
|
105
|
-
"!*.md"
|
|
105
|
+
"!*.md",
|
|
106
|
+
"!CHANGELOG.md"
|
|
106
107
|
],
|
|
107
108
|
"scripts": {
|
|
108
109
|
"build": "tsc -p tsconfig.build.json && npm run emit-schemas",
|
package/README.md
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# @kya-os/contracts
|
|
2
|
-
|
|
3
|
-
Shared types and schemas for the XMCP-I ecosystem. This package provides a single source of truth for all contracts used across runtime, CLI, verifier, and registry components.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Type-safe contracts** using Zod schemas
|
|
8
|
-
- **Subpath exports** for modular imports
|
|
9
|
-
- **JSON schemas** with versioning for external validation
|
|
10
|
-
- **Zero runtime dependencies** (except Zod)
|
|
11
|
-
- **ESM-only** with tree-shaking support
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @kya-os/contracts
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
### Subpath Imports
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
// Import specific namespaces
|
|
25
|
-
import { HandshakeRequest, SessionContext } from "@kya-os/contracts/handshake";
|
|
26
|
-
import { DetachedProof, ProofMeta } from "@kya-os/contracts/proof";
|
|
27
|
-
import { AgentContext, AGENT_HEADERS } from "@kya-os/contracts/verifier";
|
|
28
|
-
import {
|
|
29
|
-
RegistrationResult,
|
|
30
|
-
MCP_I_CAPABILITIES,
|
|
31
|
-
} from "@kya-os/contracts/registry";
|
|
32
|
-
import { StatusReport, ERROR_CODES } from "@kya-os/contracts/cli";
|
|
33
|
-
|
|
34
|
-
// Or import everything
|
|
35
|
-
import * as Contracts from "@kya-os/contracts";
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Schema Validation
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
import { DetachedProofSchema } from "@kya-os/contracts/proof";
|
|
42
|
-
|
|
43
|
-
// Validate data at runtime
|
|
44
|
-
const result = DetachedProofSchema.safeParse(data);
|
|
45
|
-
if (result.success) {
|
|
46
|
-
// data is now typed as DetachedProof
|
|
47
|
-
console.log(result.data.meta.did);
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### JSON Schemas
|
|
52
|
-
|
|
53
|
-
JSON schemas are available under the `/schemas/**` subpath:
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
// Access versioned JSON schemas
|
|
57
|
-
import proofSchema from "@kya-os/contracts/schemas/proof/v1.0.0.json";
|
|
58
|
-
import agentSchema from "@kya-os/contracts/schemas/well-known/agent/v1.0.0.json";
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Namespaces
|
|
62
|
-
|
|
63
|
-
### Handshake (`/handshake`)
|
|
64
|
-
|
|
65
|
-
- `HandshakeRequest` - Nonce, audience, timestamp validation
|
|
66
|
-
- `SessionContext` - Session management and TTL
|
|
67
|
-
- `NonceCacheEntry` - Nonce cache storage
|
|
68
|
-
|
|
69
|
-
### Proof (`/proof`)
|
|
70
|
-
|
|
71
|
-
- `DetachedProof` - JWS signature with metadata
|
|
72
|
-
- `ProofMeta` - Proof metadata fields
|
|
73
|
-
- `AuditRecord` - Audit logging format
|
|
74
|
-
|
|
75
|
-
### Verifier (`/verifier`)
|
|
76
|
-
|
|
77
|
-
- `AgentContext` - Verified agent information
|
|
78
|
-
- `VerifierResult` - Middleware validation results
|
|
79
|
-
- `AGENT_HEADERS` - Frozen header name constants
|
|
80
|
-
|
|
81
|
-
### Registry (`/registry`)
|
|
82
|
-
|
|
83
|
-
- `RegistrationResult` - KTA registration response
|
|
84
|
-
- `AgentStatus` - Agent status reporting
|
|
85
|
-
- `MCP_I_CAPABILITIES` - Protocol capability constants
|
|
86
|
-
|
|
87
|
-
### CLI (`/cli`)
|
|
88
|
-
|
|
89
|
-
- `StatusReport` - CLI status command output
|
|
90
|
-
- `ScaffolderResult` - Scaffolder operation results
|
|
91
|
-
- `ERROR_CODES` - Error code constants
|
|
92
|
-
|
|
93
|
-
## Versioning
|
|
94
|
-
|
|
95
|
-
This package follows semantic versioning:
|
|
96
|
-
|
|
97
|
-
- **Major**: Breaking changes to existing contracts
|
|
98
|
-
- **Minor**: Additive changes (new fields, optional properties)
|
|
99
|
-
- **Patch**: Bug fixes and documentation updates
|
|
100
|
-
|
|
101
|
-
JSON schemas are versioned independently under `/schemas/{namespace}/v{major}.{minor}.{patch}.json`.
|
|
102
|
-
|
|
103
|
-
## Type Safety
|
|
104
|
-
|
|
105
|
-
All types are derived from Zod schemas to ensure runtime validation matches TypeScript types:
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
// Schema definition
|
|
109
|
-
export const ProofMetaSchema = z.object({
|
|
110
|
-
did: z.string().min(1),
|
|
111
|
-
kid: z.string().min(1),
|
|
112
|
-
// ...
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// Type derived from schema
|
|
116
|
-
export type ProofMeta = z.infer<typeof ProofMetaSchema>;
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Bundle Size
|
|
120
|
-
|
|
121
|
-
This package is optimized for minimal bundle impact:
|
|
122
|
-
|
|
123
|
-
- **Tarball size**: < 80 KB
|
|
124
|
-
- **Side effects**: None (`"sideEffects": false`)
|
|
125
|
-
- **Tree-shaking**: Full ESM support
|
|
126
|
-
- **Dependencies**: Only Zod for schema validation
|
|
127
|
-
|
|
128
|
-
## License
|
|
129
|
-
|
|
130
|
-
MIT
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const AGENTSHIELD_API_BASE: "/api/v1/bouncer";
|
|
2
|
-
export declare const AGENTSHIELD_ENDPOINTS: {
|
|
3
|
-
readonly PROOFS: "/api/v1/bouncer/proofs";
|
|
4
|
-
readonly DELEGATIONS_VERIFY: "/api/v1/bouncer/delegations/verify";
|
|
5
|
-
readonly DELEGATIONS_GET: (id: string) => `/api/v1/bouncer/delegations/${string}`;
|
|
6
|
-
readonly DELEGATIONS_CREATE: "/api/v1/bouncer/delegations";
|
|
7
|
-
readonly DELEGATIONS_REVOKE: (id: string) => `/api/v1/bouncer/delegations/${string}/revoke`;
|
|
8
|
-
readonly CONFIG: (projectId: string) => `/api/v1/bouncer/config/${string}`;
|
|
9
|
-
};
|
|
10
|
-
export declare const AGENTSHIELD_METHODS: {
|
|
11
|
-
readonly PROOFS: "POST";
|
|
12
|
-
readonly DELEGATIONS_VERIFY: "POST";
|
|
13
|
-
readonly DELEGATIONS_GET: "GET";
|
|
14
|
-
readonly DELEGATIONS_CREATE: "POST";
|
|
15
|
-
readonly DELEGATIONS_REVOKE: "POST";
|
|
16
|
-
readonly CONFIG: "GET";
|
|
17
|
-
};
|
|
18
|
-
export interface AgentShieldAPIHeaders {
|
|
19
|
-
'Content-Type': 'application/json';
|
|
20
|
-
'Authorization': `Bearer ${string}`;
|
|
21
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AGENTSHIELD_METHODS = exports.AGENTSHIELD_ENDPOINTS = exports.AGENTSHIELD_API_BASE = void 0;
|
|
4
|
-
exports.AGENTSHIELD_API_BASE = '/api/v1/bouncer';
|
|
5
|
-
exports.AGENTSHIELD_ENDPOINTS = {
|
|
6
|
-
PROOFS: `${exports.AGENTSHIELD_API_BASE}/proofs`,
|
|
7
|
-
DELEGATIONS_VERIFY: `${exports.AGENTSHIELD_API_BASE}/delegations/verify`,
|
|
8
|
-
DELEGATIONS_GET: (id) => `${exports.AGENTSHIELD_API_BASE}/delegations/${id}`,
|
|
9
|
-
DELEGATIONS_CREATE: `${exports.AGENTSHIELD_API_BASE}/delegations`,
|
|
10
|
-
DELEGATIONS_REVOKE: (id) => `${exports.AGENTSHIELD_API_BASE}/delegations/${id}/revoke`,
|
|
11
|
-
CONFIG: (projectId) => `${exports.AGENTSHIELD_API_BASE}/config/${projectId}`,
|
|
12
|
-
};
|
|
13
|
-
exports.AGENTSHIELD_METHODS = {
|
|
14
|
-
PROOFS: 'POST',
|
|
15
|
-
DELEGATIONS_VERIFY: 'POST',
|
|
16
|
-
DELEGATIONS_GET: 'GET',
|
|
17
|
-
DELEGATIONS_CREATE: 'POST',
|
|
18
|
-
DELEGATIONS_REVOKE: 'POST',
|
|
19
|
-
CONFIG: 'GET',
|
|
20
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { AgentShieldAPIResponse, ProofSubmissionRequest, ProofSubmissionResponse, VerifyDelegationRequest, VerifyDelegationResponse, VerifyDelegationAPIResponse, DelegationCredential, AgentShieldToolProtection, ToolProtectionConfigResponse, ToolProtectionConfigAPIResponse, CreateDelegationRequest, CreateDelegationResponse, CreateDelegationAPIResponse, RevokeDelegationRequest, RevokeDelegationResponse, RevokeDelegationAPIResponse, } from './types.js';
|
|
2
|
-
export { AgentShieldAPIError } from './types.js';
|
|
3
|
-
export type { AgentShieldAPIHeaders } from './endpoints.js';
|
|
4
|
-
export { agentShieldAPIErrorSchema, agentShieldAPIResponseSchema, proofSubmissionRequestSchema, proofSubmissionResponseSchema, delegationCredentialSchema, verifyDelegationRequestSchema, verifyDelegationResponseSchema, verifyDelegationAPIResponseSchema, agentShieldToolProtectionSchema, toolProtectionConfigResponseSchema, toolProtectionConfigAPIResponseSchema, createDelegationRequestSchema, createDelegationResponseSchema, createDelegationAPIResponseSchema, revokeDelegationRequestSchema, revokeDelegationResponseSchema, revokeDelegationAPIResponseSchema, } from './schemas.js';
|
|
5
|
-
export { AGENTSHIELD_API_BASE, AGENTSHIELD_ENDPOINTS, AGENTSHIELD_METHODS, } from './endpoints.js';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AGENTSHIELD_METHODS = exports.AGENTSHIELD_ENDPOINTS = exports.AGENTSHIELD_API_BASE = exports.revokeDelegationAPIResponseSchema = exports.revokeDelegationResponseSchema = exports.revokeDelegationRequestSchema = exports.createDelegationAPIResponseSchema = exports.createDelegationResponseSchema = exports.createDelegationRequestSchema = exports.toolProtectionConfigAPIResponseSchema = exports.toolProtectionConfigResponseSchema = exports.agentShieldToolProtectionSchema = exports.verifyDelegationAPIResponseSchema = exports.verifyDelegationResponseSchema = exports.verifyDelegationRequestSchema = exports.delegationCredentialSchema = exports.proofSubmissionResponseSchema = exports.proofSubmissionRequestSchema = exports.agentShieldAPIResponseSchema = exports.agentShieldAPIErrorSchema = exports.AgentShieldAPIError = void 0;
|
|
4
|
-
var types_js_1 = require("./types.js");
|
|
5
|
-
Object.defineProperty(exports, "AgentShieldAPIError", { enumerable: true, get: function () { return types_js_1.AgentShieldAPIError; } });
|
|
6
|
-
var schemas_js_1 = require("./schemas.js");
|
|
7
|
-
Object.defineProperty(exports, "agentShieldAPIErrorSchema", { enumerable: true, get: function () { return schemas_js_1.agentShieldAPIErrorSchema; } });
|
|
8
|
-
Object.defineProperty(exports, "agentShieldAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.agentShieldAPIResponseSchema; } });
|
|
9
|
-
Object.defineProperty(exports, "proofSubmissionRequestSchema", { enumerable: true, get: function () { return schemas_js_1.proofSubmissionRequestSchema; } });
|
|
10
|
-
Object.defineProperty(exports, "proofSubmissionResponseSchema", { enumerable: true, get: function () { return schemas_js_1.proofSubmissionResponseSchema; } });
|
|
11
|
-
Object.defineProperty(exports, "delegationCredentialSchema", { enumerable: true, get: function () { return schemas_js_1.delegationCredentialSchema; } });
|
|
12
|
-
Object.defineProperty(exports, "verifyDelegationRequestSchema", { enumerable: true, get: function () { return schemas_js_1.verifyDelegationRequestSchema; } });
|
|
13
|
-
Object.defineProperty(exports, "verifyDelegationResponseSchema", { enumerable: true, get: function () { return schemas_js_1.verifyDelegationResponseSchema; } });
|
|
14
|
-
Object.defineProperty(exports, "verifyDelegationAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.verifyDelegationAPIResponseSchema; } });
|
|
15
|
-
Object.defineProperty(exports, "agentShieldToolProtectionSchema", { enumerable: true, get: function () { return schemas_js_1.agentShieldToolProtectionSchema; } });
|
|
16
|
-
Object.defineProperty(exports, "toolProtectionConfigResponseSchema", { enumerable: true, get: function () { return schemas_js_1.toolProtectionConfigResponseSchema; } });
|
|
17
|
-
Object.defineProperty(exports, "toolProtectionConfigAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.toolProtectionConfigAPIResponseSchema; } });
|
|
18
|
-
Object.defineProperty(exports, "createDelegationRequestSchema", { enumerable: true, get: function () { return schemas_js_1.createDelegationRequestSchema; } });
|
|
19
|
-
Object.defineProperty(exports, "createDelegationResponseSchema", { enumerable: true, get: function () { return schemas_js_1.createDelegationResponseSchema; } });
|
|
20
|
-
Object.defineProperty(exports, "createDelegationAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.createDelegationAPIResponseSchema; } });
|
|
21
|
-
Object.defineProperty(exports, "revokeDelegationRequestSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationRequestSchema; } });
|
|
22
|
-
Object.defineProperty(exports, "revokeDelegationResponseSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationResponseSchema; } });
|
|
23
|
-
Object.defineProperty(exports, "revokeDelegationAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationAPIResponseSchema; } });
|
|
24
|
-
var endpoints_js_1 = require("./endpoints.js");
|
|
25
|
-
Object.defineProperty(exports, "AGENTSHIELD_API_BASE", { enumerable: true, get: function () { return endpoints_js_1.AGENTSHIELD_API_BASE; } });
|
|
26
|
-
Object.defineProperty(exports, "AGENTSHIELD_ENDPOINTS", { enumerable: true, get: function () { return endpoints_js_1.AGENTSHIELD_ENDPOINTS; } });
|
|
27
|
-
Object.defineProperty(exports, "AGENTSHIELD_METHODS", { enumerable: true, get: function () { return endpoints_js_1.AGENTSHIELD_METHODS; } });
|