Chuyển tới nội dung chính

Type Definitions

All types are exported as TypeScript interfaces from @faos/sdk.

import type {
AgentResponse,
ShortcutResolution,
ShortcutDefinition,
ShortcutListOptions,
FaosClientOptions,
} from '@faos/sdk';

AgentResponse

Response from an agent invocation.

interface AgentResponse {
content: string;
agent_id: string;
metadata: Record<string, unknown>;
}
PropertyTypeDescription
contentstringThe agent's response text
agent_idstringID of the agent that responded
metadataRecord<string, unknown>Additional response metadata

ShortcutResolution

Result of resolving a shortcut command to an agent.

interface ShortcutResolution {
resolved: boolean;
agent_id: string | null;
module_key: string | null;
module_name: string | null;
agent_name: string | null;
task_template: string | null;
capabilities: string[];
suggestions: string[];
}
PropertyTypeDescription
resolvedbooleanWhether the shortcut was resolved
agent_idstring | nullResolved agent ID
module_keystring | nullModule key (e.g., "faos-bank")
module_namestring | nullModule display name
agent_namestring | nullAgent display name
task_templatestring | nullDefault task template for agent
capabilitiesstring[]Agent capabilities
suggestionsstring[]Suggested shortcuts if unresolved

ShortcutDefinition

Definition of an available shortcut.

interface ShortcutDefinition {
pattern: string;
type: 'module' | 'agent' | 'command';
description: string;
module_key: string;
agent_id?: string;
examples: string[];
}
PropertyTypeDescription
patternstringShortcut pattern (e.g., "bank credit-analyst")
type"module" | "agent" | "command"Shortcut type
descriptionstringHuman-readable description
module_keystringModule key
agent_idstring | undefinedAgent ID if agent-level shortcut
examplesstring[]Usage examples

ShortcutListOptions

Options for listing shortcuts.

interface ShortcutListOptions {
module?: string;
search?: string;
}
PropertyTypeDescription
modulestringFilter by module key
searchstringSearch query string

FaosClientOptions

Options for the FaosClient constructor.

interface FaosClientOptions {
apiKey: string;
baseUrl?: string;
timeout?: number;
}
PropertyTypeDefaultDescription
apiKeystringrequiredFAOS API key
baseUrlstring"https://api.faosx.ai"API base URL
timeoutnumber30000Request timeout in milliseconds