UNPKG

@kya-os/cli

Version:

CLI for MCP-I setup and management

103 lines 3.15 kB
/** * Know-That-AI (KTA) API utilities * Handles delegation checking and other KTA API interactions */ import { z } from "zod"; import type { AgentStatus } from "@kya-os/contracts/registry"; /** * Delegation status response from KTA * Accept both kid and keyId for backward compatibility */ export declare const DelegationStatusSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{ did: z.ZodString; kid: z.ZodOptional<z.ZodString>; keyId: z.ZodOptional<z.ZodString>; status: z.ZodEnum<["active", "revoked", "not_found"]>; delegatedTo: z.ZodOptional<z.ZodString>; expiresAt: z.ZodOptional<z.ZodNumber>; lastUpdated: z.ZodNumber; }, "strip", z.ZodTypeAny, { did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; kid?: string | undefined; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }, { did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; kid?: string | undefined; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }>, { did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; kid?: string | undefined; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }, { did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; kid?: string | undefined; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }>, { kid: string; did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }, { did: string; status: "active" | "revoked" | "not_found"; lastUpdated: number; kid?: string | undefined; keyId?: string | undefined; delegatedTo?: string | undefined; expiresAt?: number | undefined; }>; export type DelegationStatus = z.infer<typeof DelegationStatusSchema>; /** * KTA API client for delegation checking */ export declare class KTAApiClient { private baseURL; private apiKey?; constructor(baseURL?: string, apiKey?: string); /** * Check delegation status for a DID/KeyID pair * This is the exact KTA lookup API used for delegation confirmation */ checkDelegation(did: string, kid: string): Promise<DelegationStatus>; /** * Check if KTA is reachable */ isReachable(): Promise<boolean>; /** * Get agent status from KTA */ getAgentStatus(did: string): Promise<AgentStatus>; } /** * Default KTA API client instance */ export declare const ktaApi: KTAApiClient; /** * Check if a delegation exists for the given DID/KeyID pair * Returns true if delegation is active, false otherwise */ export declare function hasDelegation(did: string, kid: string): Promise<boolean>; /** * Check if KTA is available */ export declare function isKTAAvailable(): Promise<boolean>; //# sourceMappingURL=kta-api.d.ts.map