@kya-os/contracts 1.6.1 → 1.6.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.
@@ -8,7 +8,7 @@
8
8
  * @package @kya-os/contracts/agentshield-api
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- 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 = void 0;
11
+ exports.registerSessionAPIResponseSchema = exports.registerSessionResponseSchema = exports.registerSessionRequestSchema = exports.sessionClientIdentitySchema = exports.sessionClientInfoSchema = 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 = void 0;
12
12
  const zod_1 = require("zod");
13
13
  const proof_js_1 = require("../proof.js");
14
14
  const index_js_1 = require("../delegation/index.js");
@@ -266,3 +266,49 @@ exports.revokeDelegationResponseSchema = zod_1.z.object({
266
266
  * Wrapped revocation response schema
267
267
  */
268
268
  exports.revokeDelegationAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.revokeDelegationResponseSchema);
269
+ // ============================================================================
270
+ // Session Registration Schemas
271
+ // ============================================================================
272
+ /**
273
+ * Session client info schema
274
+ */
275
+ exports.sessionClientInfoSchema = zod_1.z.object({
276
+ name: zod_1.z.string().min(1, "Client name is required"),
277
+ version: zod_1.z.string().optional(),
278
+ protocol_version: zod_1.z.string().optional(),
279
+ platform: zod_1.z.string().optional(),
280
+ vendor: zod_1.z.string().optional(),
281
+ });
282
+ /**
283
+ * Session client identity schema
284
+ */
285
+ exports.sessionClientIdentitySchema = zod_1.z.object({
286
+ did: zod_1.z.string().min(1, "Client DID is required"),
287
+ source: zod_1.z.enum(["knowthat.ai", "kta-lookup", "generated"]),
288
+ registered: zod_1.z.boolean(),
289
+ });
290
+ /**
291
+ * Register session request schema
292
+ */
293
+ exports.registerSessionRequestSchema = zod_1.z.object({
294
+ session_id: zod_1.z.string().min(1, "Session ID is required"),
295
+ agent_did: zod_1.z.string().min(1, "Agent DID is required"),
296
+ project_id: zod_1.z.string().min(1, "Project ID is required"),
297
+ created_at: zod_1.z.number().int().positive("Created at must be a positive timestamp"),
298
+ client_info: exports.sessionClientInfoSchema,
299
+ client_identity: exports.sessionClientIdentitySchema.optional(),
300
+ server_did: zod_1.z.string().optional(),
301
+ ttl_minutes: zod_1.z.number().int().positive().optional(),
302
+ });
303
+ /**
304
+ * Register session response schema
305
+ */
306
+ exports.registerSessionResponseSchema = zod_1.z.object({
307
+ session_id: zod_1.z.string().min(1),
308
+ registered: zod_1.z.boolean(),
309
+ created_at: zod_1.z.string().datetime(),
310
+ });
311
+ /**
312
+ * Wrapped session registration response schema
313
+ */
314
+ exports.registerSessionAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.registerSessionResponseSchema);
@@ -248,6 +248,69 @@ export interface RevokeDelegationResponse {
248
248
  * Wrapped revocation response
249
249
  */
250
250
  export type RevokeDelegationAPIResponse = AgentShieldAPIResponse<RevokeDelegationResponse>;
251
+ /**
252
+ * MCP Client information from the initialize message
253
+ */
254
+ export interface SessionClientInfo {
255
+ /** Client application name (e.g., "Claude Desktop", "Anthropic/ClaudeAI") */
256
+ name: string;
257
+ /** Client version (e.g., "1.0.0") */
258
+ version?: string;
259
+ /** MCP protocol version (e.g., "2025-06-18") */
260
+ protocol_version?: string;
261
+ /** Platform (e.g., "darwin", "win32") */
262
+ platform?: string;
263
+ /** Vendor name (e.g., "Anthropic") */
264
+ vendor?: string;
265
+ }
266
+ /**
267
+ * Client identity resolution information
268
+ */
269
+ export interface SessionClientIdentity {
270
+ /** Resolved DID for the client */
271
+ did: string;
272
+ /** Source of the DID */
273
+ source: "knowthat.ai" | "kta-lookup" | "generated";
274
+ /** Whether client is registered on knowthat.ai */
275
+ registered: boolean;
276
+ }
277
+ /**
278
+ * Request body for session registration endpoint
279
+ * POST /api/v1/bouncer/sessions
280
+ */
281
+ export interface RegisterSessionRequest {
282
+ /** Unique session identifier (matches proof.meta.sessionId) */
283
+ session_id: string;
284
+ /** Agent's DID */
285
+ agent_did: string;
286
+ /** AgentShield project ID */
287
+ project_id: string;
288
+ /** Unix timestamp in milliseconds when session was created */
289
+ created_at: number;
290
+ /** MCP client information */
291
+ client_info: SessionClientInfo;
292
+ /** Client identity resolution (optional) */
293
+ client_identity?: SessionClientIdentity;
294
+ /** MCP server's DID (optional) */
295
+ server_did?: string;
296
+ /** Session TTL in minutes (default: 30) */
297
+ ttl_minutes?: number;
298
+ }
299
+ /**
300
+ * Response from session registration endpoint
301
+ */
302
+ export interface RegisterSessionResponse {
303
+ /** The registered session ID */
304
+ session_id: string;
305
+ /** Whether registration was successful */
306
+ registered: boolean;
307
+ /** ISO 8601 timestamp of registration */
308
+ created_at: string;
309
+ }
310
+ /**
311
+ * Wrapped session registration response
312
+ */
313
+ export type RegisterSessionAPIResponse = AgentShieldAPIResponse<RegisterSessionResponse>;
251
314
  /**
252
315
  * AgentShield API error class
253
316
  */
@@ -285,8 +285,8 @@ export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
285
285
  tool: string;
286
286
  scopes: string[];
287
287
  projectId: string;
288
- toolDescription: string;
289
288
  serverUrl: string;
289
+ toolDescription: string;
290
290
  provider?: string | undefined;
291
291
  branding?: {
292
292
  primaryColor?: string | undefined;
@@ -321,8 +321,8 @@ export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
321
321
  tool: string;
322
322
  scopes: string[];
323
323
  projectId: string;
324
- toolDescription: string;
325
324
  serverUrl: string;
325
+ toolDescription: string;
326
326
  provider?: string | undefined;
327
327
  branding?: {
328
328
  primaryColor?: string | undefined;
@@ -357,8 +357,8 @@ export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
357
357
  tool: string;
358
358
  scopes: string[];
359
359
  projectId: string;
360
- toolDescription: string;
361
360
  serverUrl: string;
361
+ toolDescription: string;
362
362
  provider?: string | undefined;
363
363
  branding?: {
364
364
  primaryColor?: string | undefined;
@@ -393,8 +393,8 @@ export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
393
393
  tool: string;
394
394
  scopes: string[];
395
395
  projectId: string;
396
- toolDescription: string;
397
396
  serverUrl: string;
397
+ toolDescription: string;
398
398
  provider?: string | undefined;
399
399
  branding?: {
400
400
  primaryColor?: string | undefined;
@@ -747,8 +747,8 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
747
747
  tool: string;
748
748
  scopes: string[];
749
749
  projectId: string;
750
- toolDescription: string;
751
750
  serverUrl: string;
751
+ toolDescription: string;
752
752
  provider?: string | undefined;
753
753
  branding?: {
754
754
  primaryColor?: string | undefined;
@@ -783,8 +783,8 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
783
783
  tool: string;
784
784
  scopes: string[];
785
785
  projectId: string;
786
- toolDescription: string;
787
786
  serverUrl: string;
787
+ toolDescription: string;
788
788
  provider?: string | undefined;
789
789
  branding?: {
790
790
  primaryColor?: string | undefined;