@kya-os/contracts 1.5.2 → 1.5.4-canary.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.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * AgentShield Admin API Validation Schemas
3
+ *
4
+ * Zod schemas for administrative operations in AgentShield.
5
+ *
6
+ * @package @kya-os/contracts/agentshield-api
7
+ */
8
+ import { z } from 'zod';
9
+ /**
10
+ * Request schema for clearing agent cache
11
+ */
12
+ export declare const clearCacheRequestSchema: z.ZodObject<{
13
+ agent_did: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ agent_did: string;
16
+ }, {
17
+ agent_did: string;
18
+ }>;
19
+ /**
20
+ * Response schema for clear cache operation
21
+ */
22
+ export declare const clearCacheResponseSchema: z.ZodObject<{
23
+ message: z.ZodString;
24
+ agent_did: z.ZodString;
25
+ project_id: z.ZodNullable<z.ZodString>;
26
+ cache_key: z.ZodString;
27
+ old_cache_key: z.ZodNullable<z.ZodString>;
28
+ had_value: z.ZodBoolean;
29
+ had_old_value: z.ZodBoolean;
30
+ cleared: z.ZodBoolean;
31
+ refreshed_immediately: z.ZodOptional<z.ZodBoolean>;
32
+ refresh_error: z.ZodOptional<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ agent_did: string;
35
+ message: string;
36
+ project_id: string | null;
37
+ cache_key: string;
38
+ old_cache_key: string | null;
39
+ had_value: boolean;
40
+ had_old_value: boolean;
41
+ cleared: boolean;
42
+ refreshed_immediately?: boolean | undefined;
43
+ refresh_error?: string | undefined;
44
+ }, {
45
+ agent_did: string;
46
+ message: string;
47
+ project_id: string | null;
48
+ cache_key: string;
49
+ old_cache_key: string | null;
50
+ had_value: boolean;
51
+ had_old_value: boolean;
52
+ cleared: boolean;
53
+ refreshed_immediately?: boolean | undefined;
54
+ refresh_error?: string | undefined;
55
+ }>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * AgentShield Admin API Validation Schemas
4
+ *
5
+ * Zod schemas for administrative operations in AgentShield.
6
+ *
7
+ * @package @kya-os/contracts/agentshield-api
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.clearCacheResponseSchema = exports.clearCacheRequestSchema = void 0;
11
+ const zod_1 = require("zod");
12
+ /**
13
+ * Request schema for clearing agent cache
14
+ */
15
+ exports.clearCacheRequestSchema = zod_1.z.object({
16
+ agent_did: zod_1.z.string().min(1).describe('The DID of the agent whose cache should be cleared'),
17
+ });
18
+ /**
19
+ * Response schema for clear cache operation
20
+ */
21
+ exports.clearCacheResponseSchema = zod_1.z.object({
22
+ message: zod_1.z.string().describe('Human-readable message about the operation result'),
23
+ agent_did: zod_1.z.string().describe('The agent DID that was cleared'),
24
+ project_id: zod_1.z.string().nullable().describe('The project ID if available'),
25
+ cache_key: zod_1.z.string().describe('The cache key that was cleared'),
26
+ old_cache_key: zod_1.z.string().nullable().describe('Old cache key that was also cleared (for migration)'),
27
+ had_value: zod_1.z.boolean().describe('Whether the cache entry existed before clearing'),
28
+ had_old_value: zod_1.z.boolean().describe('Whether the old cache entry existed before clearing'),
29
+ cleared: zod_1.z.boolean().describe('Whether the cache was successfully cleared'),
30
+ refreshed_immediately: zod_1.z.boolean().optional().describe('Whether cache was immediately refreshed from API after clearing'),
31
+ refresh_error: zod_1.z.string().optional().describe('Error message if immediate refresh failed (non-fatal)'),
32
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * AgentShield Admin API Type Definitions
3
+ *
4
+ * TypeScript interfaces for administrative operations in AgentShield.
5
+ * These types ensure parity between xmcp-i admin endpoints and the AgentShield service.
6
+ *
7
+ * @package @kya-os/contracts/agentshield-api
8
+ */
9
+ /**
10
+ * Request to clear agent cache
11
+ * POST /admin/clear-cache
12
+ */
13
+ export interface ClearCacheRequest {
14
+ /** The DID of the agent whose cache should be cleared */
15
+ agent_did: string;
16
+ }
17
+ /**
18
+ * Response from clear cache operation
19
+ */
20
+ export interface ClearCacheResponse {
21
+ /** Human-readable message about the operation result */
22
+ message: string;
23
+ /** The agent DID that was cleared */
24
+ agent_did: string;
25
+ /** The project ID if available */
26
+ project_id: string | null;
27
+ /** The cache key that was cleared */
28
+ cache_key: string;
29
+ /** Old cache key that was also cleared (for migration) */
30
+ old_cache_key: string | null;
31
+ /** Whether the cache entry existed before clearing */
32
+ had_value: boolean;
33
+ /** Whether the old cache entry existed before clearing */
34
+ had_old_value: boolean;
35
+ /** Whether the cache was successfully cleared */
36
+ cleared: boolean;
37
+ /** Whether cache was immediately refreshed from API after clearing */
38
+ refreshed_immediately?: boolean;
39
+ /** Error message if immediate refresh failed (non-fatal) */
40
+ refresh_error?: string;
41
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * AgentShield Admin API Type Definitions
4
+ *
5
+ * TypeScript interfaces for administrative operations in AgentShield.
6
+ * These types ensure parity between xmcp-i admin endpoints and the AgentShield service.
7
+ *
8
+ * @package @kya-os/contracts/agentshield-api
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,8 +6,10 @@
6
6
  *
7
7
  * @package @kya-os/contracts/agentshield-api
8
8
  */
9
- export type { AgentShieldAPIResponse, AgentShieldAPIErrorResponse, ProofSubmissionRequest, ProofSubmissionResponse, ToolCallContext, BouncerOutcome, VerifyDelegationRequest, VerifyDelegationResponse, VerifyDelegationAPIResponse, DelegationCredential, AgentShieldToolProtection, ToolProtectionConfigResponse, ToolProtectionConfigAPIResponse, CreateDelegationRequest, CreateDelegationResponse, CreateDelegationAPIResponse, RevokeDelegationRequest, RevokeDelegationResponse, RevokeDelegationAPIResponse, } from './types.js';
10
- export { AgentShieldAPIError } from './types.js';
11
- export type { AgentShieldAPIHeaders } from './endpoints.js';
12
- export { agentShieldAPIErrorSchema, agentShieldAPIResponseSchema, proofSubmissionRequestSchema, proofSubmissionResponseSchema, delegationCredentialSchema, verifyDelegationRequestSchema, verifyDelegationResponseSchema, verifyDelegationAPIResponseSchema, agentShieldToolProtectionSchema, toolProtectionConfigResponseSchema, toolProtectionConfigAPIResponseSchema, createDelegationRequestSchema, createDelegationResponseSchema, createDelegationAPIResponseSchema, revokeDelegationRequestSchema, revokeDelegationResponseSchema, revokeDelegationAPIResponseSchema, } from './schemas.js';
13
- export { AGENTSHIELD_API_BASE, AGENTSHIELD_ENDPOINTS, AGENTSHIELD_METHODS, } from './endpoints.js';
9
+ export type { AgentShieldAPIResponse, AgentShieldAPIErrorResponse, ProofSubmissionRequest, ProofSubmissionResponse, ToolCallContext, BouncerOutcome, VerifyDelegationRequest, VerifyDelegationResponse, VerifyDelegationAPIResponse, DelegationCredential, AgentShieldToolProtection, ToolProtectionConfigResponse, ToolProtectionConfigAPIResponse, CreateDelegationRequest, CreateDelegationResponse, CreateDelegationAPIResponse, RevokeDelegationRequest, RevokeDelegationResponse, RevokeDelegationAPIResponse, } from "./types.js";
10
+ export { AgentShieldAPIError } from "./types.js";
11
+ export type { AgentShieldAPIHeaders } from "./endpoints.js";
12
+ export type { ClearCacheRequest, ClearCacheResponse } from "./admin-types.js";
13
+ export { agentShieldAPIErrorSchema, agentShieldAPIResponseSchema, proofSubmissionRequestSchema, proofSubmissionResponseSchema, delegationCredentialSchema, verifyDelegationRequestSchema, verifyDelegationResponseSchema, verifyDelegationAPIResponseSchema, agentShieldToolProtectionSchema, toolProtectionConfigResponseSchema, toolProtectionConfigAPIResponseSchema, createDelegationRequestSchema, createDelegationResponseSchema, createDelegationAPIResponseSchema, revokeDelegationRequestSchema, revokeDelegationResponseSchema, revokeDelegationAPIResponseSchema, } from "./schemas.js";
14
+ export { clearCacheRequestSchema, clearCacheResponseSchema, } from "./admin-schemas.js";
15
+ export { AGENTSHIELD_API_BASE, AGENTSHIELD_ENDPOINTS, AGENTSHIELD_METHODS, } from "./endpoints.js";
@@ -8,7 +8,7 @@
8
8
  * @package @kya-os/contracts/agentshield-api
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- 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;
11
+ exports.AGENTSHIELD_METHODS = exports.AGENTSHIELD_ENDPOINTS = exports.AGENTSHIELD_API_BASE = exports.clearCacheResponseSchema = exports.clearCacheRequestSchema = 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;
12
12
  var types_js_1 = require("./types.js");
13
13
  Object.defineProperty(exports, "AgentShieldAPIError", { enumerable: true, get: function () { return types_js_1.AgentShieldAPIError; } });
14
14
  // Schema exports
@@ -30,6 +30,9 @@ Object.defineProperty(exports, "createDelegationAPIResponseSchema", { enumerable
30
30
  Object.defineProperty(exports, "revokeDelegationRequestSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationRequestSchema; } });
31
31
  Object.defineProperty(exports, "revokeDelegationResponseSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationResponseSchema; } });
32
32
  Object.defineProperty(exports, "revokeDelegationAPIResponseSchema", { enumerable: true, get: function () { return schemas_js_1.revokeDelegationAPIResponseSchema; } });
33
+ var admin_schemas_js_1 = require("./admin-schemas.js");
34
+ Object.defineProperty(exports, "clearCacheRequestSchema", { enumerable: true, get: function () { return admin_schemas_js_1.clearCacheRequestSchema; } });
35
+ Object.defineProperty(exports, "clearCacheResponseSchema", { enumerable: true, get: function () { return admin_schemas_js_1.clearCacheResponseSchema; } });
33
36
  // Endpoint exports
34
37
  var endpoints_js_1 = require("./endpoints.js");
35
38
  Object.defineProperty(exports, "AGENTSHIELD_API_BASE", { enumerable: true, get: function () { return endpoints_js_1.AGENTSHIELD_API_BASE; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.5.2",
3
+ "version": "1.5.4-canary.1",
4
4
  "description": "Shared types and schemas for XMCP-I ecosystem",
5
5
  "type": "commonjs",
6
6
  "sideEffects": false,