@xynehq/jaf
Version:
Juspay Agent Framework - A purely functional agent framework with immutable state and composable tools
456 lines • 13.5 kB
TypeScript
import { z } from 'zod';
import { Agent, RunConfig } from '../core/types';
import { MemoryProvider } from '../memory/types';
export interface ServerConfig<Ctx> {
port?: number;
host?: string;
cors?: boolean;
runConfig: RunConfig<Ctx>;
agentRegistry: Map<string, Agent<Ctx, any>>;
defaultMemoryProvider?: MemoryProvider;
}
export declare const httpMessageSchema: z.ZodObject<{
role: z.ZodEnum<["user", "assistant", "system"]>;
content: z.ZodString;
}, "strip", z.ZodTypeAny, {
content: string;
role: "user" | "assistant" | "system";
}, {
content: string;
role: "user" | "assistant" | "system";
}>;
export declare const chatRequestSchema: z.ZodObject<{
messages: z.ZodArray<z.ZodObject<{
role: z.ZodEnum<["user", "assistant", "system"]>;
content: z.ZodString;
}, "strip", z.ZodTypeAny, {
content: string;
role: "user" | "assistant" | "system";
}, {
content: string;
role: "user" | "assistant" | "system";
}>, "many">;
agentName: z.ZodString;
context: z.ZodOptional<z.ZodAny>;
maxTurns: z.ZodOptional<z.ZodNumber>;
stream: z.ZodDefault<z.ZodBoolean>;
conversationId: z.ZodOptional<z.ZodString>;
memory: z.ZodOptional<z.ZodObject<{
autoStore: z.ZodDefault<z.ZodBoolean>;
maxMessages: z.ZodOptional<z.ZodNumber>;
compressionThreshold: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
autoStore: boolean;
compressionThreshold?: number | undefined;
maxMessages?: number | undefined;
}, {
autoStore?: boolean | undefined;
compressionThreshold?: number | undefined;
maxMessages?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
messages: {
content: string;
role: "user" | "assistant" | "system";
}[];
agentName: string;
stream: boolean;
memory?: {
autoStore: boolean;
compressionThreshold?: number | undefined;
maxMessages?: number | undefined;
} | undefined;
context?: any;
maxTurns?: number | undefined;
conversationId?: string | undefined;
}, {
messages: {
content: string;
role: "user" | "assistant" | "system";
}[];
agentName: string;
memory?: {
autoStore?: boolean | undefined;
compressionThreshold?: number | undefined;
maxMessages?: number | undefined;
} | undefined;
context?: any;
maxTurns?: number | undefined;
conversationId?: string | undefined;
stream?: boolean | undefined;
}>;
export type ChatRequest = z.infer<typeof chatRequestSchema>;
export type HttpMessage = z.infer<typeof httpMessageSchema>;
export declare const fullMessageSchema: z.ZodUnion<[z.ZodObject<{
role: z.ZodEnum<["user", "assistant", "system"]>;
content: z.ZodString;
}, "strip", z.ZodTypeAny, {
content: string;
role: "user" | "assistant" | "system";
}, {
content: string;
role: "user" | "assistant" | "system";
}>, z.ZodObject<{
role: z.ZodLiteral<"assistant">;
content: z.ZodString;
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodString;
type: z.ZodLiteral<"function">;
function: z.ZodObject<{
name: z.ZodString;
arguments: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
arguments: string;
}, {
name: string;
arguments: string;
}>;
}, "strip", z.ZodTypeAny, {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}, {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
}, {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
}>, z.ZodObject<{
role: z.ZodLiteral<"tool">;
content: z.ZodString;
tool_call_id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
content: string;
role: "tool";
tool_call_id?: string | undefined;
}, {
content: string;
role: "tool";
tool_call_id?: string | undefined;
}>]>;
export declare const chatResponseSchema: z.ZodObject<{
success: z.ZodBoolean;
data: z.ZodOptional<z.ZodObject<{
runId: z.ZodString;
traceId: z.ZodString;
conversationId: z.ZodOptional<z.ZodString>;
messages: z.ZodArray<z.ZodUnion<[z.ZodObject<{
role: z.ZodEnum<["user", "assistant", "system"]>;
content: z.ZodString;
}, "strip", z.ZodTypeAny, {
content: string;
role: "user" | "assistant" | "system";
}, {
content: string;
role: "user" | "assistant" | "system";
}>, z.ZodObject<{
role: z.ZodLiteral<"assistant">;
content: z.ZodString;
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodString;
type: z.ZodLiteral<"function">;
function: z.ZodObject<{
name: z.ZodString;
arguments: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
arguments: string;
}, {
name: string;
arguments: string;
}>;
}, "strip", z.ZodTypeAny, {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}, {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
}, {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
}>, z.ZodObject<{
role: z.ZodLiteral<"tool">;
content: z.ZodString;
tool_call_id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
content: string;
role: "tool";
tool_call_id?: string | undefined;
}, {
content: string;
role: "tool";
tool_call_id?: string | undefined;
}>]>, "many">;
outcome: z.ZodObject<{
status: z.ZodEnum<["completed", "error", "max_turns"]>;
output: z.ZodOptional<z.ZodString>;
error: z.ZodOptional<z.ZodAny>;
}, "strip", z.ZodTypeAny, {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
}, {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
}>;
turnCount: z.ZodNumber;
executionTimeMs: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
traceId: string;
executionTimeMs: number;
outcome: {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
};
runId: string;
messages: ({
content: string;
role: "user" | "assistant" | "system";
} | {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
} | {
content: string;
role: "tool";
tool_call_id?: string | undefined;
})[];
turnCount: number;
conversationId?: string | undefined;
}, {
traceId: string;
executionTimeMs: number;
outcome: {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
};
runId: string;
messages: ({
content: string;
role: "user" | "assistant" | "system";
} | {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
} | {
content: string;
role: "tool";
tool_call_id?: string | undefined;
})[];
turnCount: number;
conversationId?: string | undefined;
}>>;
error: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
success: boolean;
data?: {
traceId: string;
executionTimeMs: number;
outcome: {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
};
runId: string;
messages: ({
content: string;
role: "user" | "assistant" | "system";
} | {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
} | {
content: string;
role: "tool";
tool_call_id?: string | undefined;
})[];
turnCount: number;
conversationId?: string | undefined;
} | undefined;
error?: string | undefined;
}, {
success: boolean;
data?: {
traceId: string;
executionTimeMs: number;
outcome: {
status: "error" | "completed" | "max_turns";
error?: any;
output?: string | undefined;
};
runId: string;
messages: ({
content: string;
role: "user" | "assistant" | "system";
} | {
content: string;
role: "assistant";
tool_calls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
} | {
content: string;
role: "tool";
tool_call_id?: string | undefined;
})[];
turnCount: number;
conversationId?: string | undefined;
} | undefined;
error?: string | undefined;
}>;
export type ChatResponse = z.infer<typeof chatResponseSchema>;
export declare const agentListResponseSchema: z.ZodObject<{
success: z.ZodBoolean;
data: z.ZodOptional<z.ZodObject<{
agents: z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodString;
tools: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
name: string;
tools: string[];
description: string;
}, {
name: string;
tools: string[];
description: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
agents: {
name: string;
tools: string[];
description: string;
}[];
}, {
agents: {
name: string;
tools: string[];
description: string;
}[];
}>>;
error: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
success: boolean;
data?: {
agents: {
name: string;
tools: string[];
description: string;
}[];
} | undefined;
error?: string | undefined;
}, {
success: boolean;
data?: {
agents: {
name: string;
tools: string[];
description: string;
}[];
} | undefined;
error?: string | undefined;
}>;
export type AgentListResponse = z.infer<typeof agentListResponseSchema>;
export declare const healthResponseSchema: z.ZodObject<{
status: z.ZodLiteral<"healthy">;
timestamp: z.ZodString;
version: z.ZodString;
uptime: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
status: "healthy";
timestamp: string;
version: string;
uptime: number;
}, {
status: "healthy";
timestamp: string;
version: string;
uptime: number;
}>;
export type HealthResponse = z.infer<typeof healthResponseSchema>;
//# sourceMappingURL=types.d.ts.map