@sinas/sdk 0.1.0

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 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/client/errors.ts","../src/client/SinasClient.ts","../src/client/queries.ts","../src/client/functions.ts","../src/client/states.ts","../src/client/chat.ts","../src/hooks/useQuery.ts","../src/hooks/context.ts","../src/hooks/useExecute.ts","../src/hooks/useStateStore.ts","../src/hooks/useChat.ts","../src/hooks/useSinas.ts"],"sourcesContent":["// Client\nexport { SinasClient } from './client/SinasClient';\nexport { executeQuery } from './client/queries';\nexport { executeFunction } from './client/functions';\nexport { stateGet, stateSet, stateDelete, stateList } from './client/states';\nexport { createChat, sendMessage, streamMessage } from './client/chat';\nexport {\n SinasError,\n SinasAuthError,\n SinasPermissionError,\n SinasNotFoundError,\n SinasTimeoutError,\n} from './client/errors';\n\n// Hooks\nexport { useQuery } from './hooks/useQuery';\nexport { useExecute } from './hooks/useExecute';\nexport { useStateStore } from './hooks/useStateStore';\nexport { useChat } from './hooks/useChat';\nexport { useSinas } from './hooks/useSinas';\nexport { SinasProvider } from './hooks/context';\n\n// Types\nexport type {\n SinasConfig,\n QueryResult,\n FunctionResult,\n StateGetResult,\n StateListResult,\n ChatCreateResult,\n ChatMessage,\n SSEChunk,\n} from './client/types';\nexport type { UseQueryOptions, UseQueryResult } from './hooks/useQuery';\nexport type { UseExecuteResult } from './hooks/useExecute';\nexport type { UseStateStoreResult, UseStateStoreOptions } from './hooks/useStateStore';\nexport type { UseChatResult } from './hooks/useChat';\nexport type { UseSinasResult } from './hooks/useSinas';\nexport type { SinasProviderProps } from './hooks/context';\n","export class SinasError extends Error {\n public readonly status: number;\n public readonly detail: string;\n\n constructor(message: string, status: number = 0, detail?: string) {\n super(message);\n this.name = 'SinasError';\n this.status = status;\n this.detail = detail || message;\n }\n}\n\nexport class SinasAuthError extends SinasError {\n constructor(message: string = 'Authentication required') {\n super(message, 401);\n this.name = 'SinasAuthError';\n }\n}\n\nexport class SinasPermissionError extends SinasError {\n constructor(message: string = 'Permission denied') {\n super(message, 403);\n this.name = 'SinasPermissionError';\n }\n}\n\nexport class SinasNotFoundError extends SinasError {\n constructor(resource: string) {\n super(`${resource} not found`, 404);\n this.name = 'SinasNotFoundError';\n }\n}\n\nexport class SinasTimeoutError extends SinasError {\n constructor(message: string = 'Request timed out') {\n super(message, 408);\n this.name = 'SinasTimeoutError';\n }\n}\n","import { SinasError, SinasAuthError, SinasPermissionError, SinasNotFoundError } from './errors';\nimport type { SinasConfig } from './types';\n\ndeclare global {\n interface Window {\n __SINAS_CONFIG__?: SinasConfig;\n __SINAS_AUTH_TOKEN__?: string | null;\n }\n}\n\nexport class SinasClient {\n private configOverride?: SinasConfig;\n\n constructor(config?: SinasConfig) {\n this.configOverride = config;\n }\n\n getConfig(): SinasConfig {\n const config = this.configOverride || window.__SINAS_CONFIG__;\n if (!config) {\n return {\n apiBase: '',\n component: { namespace: '', name: '', version: '' },\n resources: {\n enabledAgents: [],\n enabledFunctions: [],\n enabledQueries: [],\n enabledComponents: [],\n stateNamespacesReadonly: [],\n stateNamespacesReadwrite: [],\n },\n input: {},\n };\n }\n return config;\n }\n\n getInput(): Record<string, unknown> {\n return this.getConfig().input || {};\n }\n\n getAuthHeaders(): Record<string, string> {\n const token = window.__SINAS_AUTH_TOKEN__;\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (token) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n return headers;\n }\n\n getProxyBase(): string {\n const config = this.getConfig();\n const comp = config.component;\n return `${config.apiBase}/components/${comp.namespace}/${comp.name}/proxy`;\n }\n\n async fetch(url: string, options: RequestInit = {}): Promise<Response> {\n const res = await fetch(url, {\n ...options,\n headers: {\n ...this.getAuthHeaders(),\n ...(options.headers as Record<string, string> || {}),\n },\n });\n\n if (!res.ok) {\n const body = await res.json().catch(() => ({ detail: res.statusText }));\n const message = body.detail || body.message || res.statusText;\n\n if (res.status === 401) throw new SinasAuthError(message);\n if (res.status === 403) throw new SinasPermissionError(message);\n if (res.status === 404) throw new SinasNotFoundError(message);\n throw new SinasError(message, res.status);\n }\n\n return res;\n }\n}\n","import type { SinasClient } from './SinasClient';\nimport type { QueryResult } from './types';\n\nfunction parseRef(ref: string): [string, string] {\n const parts = ref.split('/');\n if (parts.length !== 2) {\n throw new Error(`Invalid query ref \"${ref}\": expected \"namespace/name\"`);\n }\n return [parts[0], parts[1]];\n}\n\nexport async function executeQuery(\n client: SinasClient,\n ref: string,\n input: Record<string, unknown> = {}\n): Promise<QueryResult> {\n const [ns, name] = parseRef(ref);\n const base = client.getProxyBase();\n const res = await client.fetch(`${base}/queries/${ns}/${name}/execute`, {\n method: 'POST',\n body: JSON.stringify({ input }),\n });\n const data = await res.json();\n return {\n success: data.success,\n operation: data.operation,\n data: data.data,\n rowCount: data.row_count,\n affectedRows: data.affected_rows,\n durationMs: data.duration_ms,\n };\n}\n","import type { SinasClient } from './SinasClient';\nimport type { FunctionResult } from './types';\n\nfunction parseRef(ref: string): [string, string] {\n const parts = ref.split('/');\n if (parts.length !== 2) {\n throw new Error(`Invalid function ref \"${ref}\": expected \"namespace/name\"`);\n }\n return [parts[0], parts[1]];\n}\n\nexport async function executeFunction(\n client: SinasClient,\n ref: string,\n input: Record<string, unknown> = {},\n timeout?: number\n): Promise<FunctionResult> {\n const [ns, name] = parseRef(ref);\n const base = client.getProxyBase();\n const body: Record<string, unknown> = { input };\n if (timeout !== undefined) {\n body.timeout = timeout;\n }\n const res = await client.fetch(`${base}/functions/${ns}/${name}/execute`, {\n method: 'POST',\n body: JSON.stringify(body),\n });\n const data = await res.json();\n return {\n status: data.status,\n executionId: data.execution_id,\n result: data.result,\n error: data.error,\n };\n}\n","import type { SinasClient } from './SinasClient';\nimport type { StateGetResult, StateListResult } from './types';\n\nexport async function stateGet(\n client: SinasClient,\n ns: string,\n key: string\n): Promise<StateGetResult> {\n const base = client.getProxyBase();\n const res = await client.fetch(`${base}/states/${ns}`, {\n method: 'POST',\n body: JSON.stringify({ action: 'get', key }),\n });\n return res.json();\n}\n\nexport async function stateSet(\n client: SinasClient,\n ns: string,\n key: string,\n value: unknown,\n visibility: 'private' | 'shared' = 'private'\n): Promise<void> {\n const base = client.getProxyBase();\n await client.fetch(`${base}/states/${ns}`, {\n method: 'POST',\n body: JSON.stringify({ action: 'set', key, value, visibility }),\n });\n}\n\nexport async function stateDelete(\n client: SinasClient,\n ns: string,\n key: string\n): Promise<void> {\n const base = client.getProxyBase();\n await client.fetch(`${base}/states/${ns}`, {\n method: 'POST',\n body: JSON.stringify({ action: 'delete', key }),\n });\n}\n\nexport async function stateList(\n client: SinasClient,\n ns: string\n): Promise<StateListResult> {\n const base = client.getProxyBase();\n const res = await client.fetch(`${base}/states/${ns}`, {\n method: 'POST',\n body: JSON.stringify({ action: 'list' }),\n });\n return res.json();\n}\n","import type { SinasClient } from './SinasClient';\nimport type { ChatCreateResult, ChatMessage, SSEChunk } from './types';\n\nexport async function createChat(\n client: SinasClient,\n agentRef: string,\n input?: Record<string, unknown>\n): Promise<ChatCreateResult> {\n const [ns, name] = agentRef.split('/');\n if (!ns || !name) {\n throw new Error(`Invalid agent ref \"${agentRef}\": expected \"namespace/name\"`);\n }\n const config = client.getConfig();\n const res = await client.fetch(`${config.apiBase}/agents/${ns}/${name}/chats`, {\n method: 'POST',\n body: JSON.stringify({ input: input || {} }),\n });\n const data = await res.json();\n return {\n id: data.id,\n agentNamespace: data.agent_namespace,\n agentName: data.agent_name,\n title: data.title,\n };\n}\n\nexport async function sendMessage(\n client: SinasClient,\n chatId: string,\n content: string\n): Promise<ChatMessage> {\n const config = client.getConfig();\n const res = await client.fetch(`${config.apiBase}/chats/${chatId}/messages`, {\n method: 'POST',\n body: JSON.stringify({ content }),\n });\n const data = await res.json();\n return {\n id: data.id,\n chatId: data.chat_id,\n role: data.role,\n content: data.content,\n createdAt: data.created_at,\n };\n}\n\nfunction parseSSE(buffer: string): { chunks: SSEChunk[]; remaining: string } {\n const chunks: SSEChunk[] = [];\n const lines = buffer.split('\\n');\n let event = '';\n let data = '';\n let remaining = '';\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n // If last line and doesn't end with newline, it's incomplete\n if (i === lines.length - 1 && !buffer.endsWith('\\n')) {\n remaining = line;\n break;\n }\n\n if (line.startsWith('event:')) {\n event = line.slice(6).trim();\n } else if (line.startsWith('data:')) {\n data = line.slice(5).trim();\n } else if (line === '') {\n if (event || data) {\n chunks.push({ event: event || 'message', data });\n event = '';\n data = '';\n }\n }\n }\n\n return { chunks, remaining };\n}\n\nexport function streamMessage(\n client: SinasClient,\n chatId: string,\n content: string,\n onChunk: (chunk: SSEChunk) => void,\n onDone?: () => void,\n onError?: (error: Error) => void\n): AbortController {\n const controller = new AbortController();\n const config = client.getConfig();\n\n (async () => {\n try {\n const res = await fetch(`${config.apiBase}/chats/${chatId}/messages/stream`, {\n method: 'POST',\n headers: client.getAuthHeaders(),\n body: JSON.stringify({ content }),\n signal: controller.signal,\n });\n\n if (!res.ok) {\n const body = await res.json().catch(() => ({ detail: res.statusText }));\n throw new Error(body.detail || 'Stream request failed');\n }\n\n const reader = res.body!.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const { chunks, remaining } = parseSSE(buffer);\n buffer = remaining;\n\n for (const chunk of chunks) {\n onChunk(chunk);\n if (chunk.event === 'done') {\n onDone?.();\n return;\n }\n }\n }\n\n // Process any remaining buffer\n if (buffer.trim()) {\n const { chunks } = parseSSE(buffer + '\\n\\n');\n for (const chunk of chunks) {\n onChunk(chunk);\n }\n }\n\n onDone?.();\n } catch (err) {\n if ((err as Error).name === 'AbortError') return;\n onError?.(err as Error);\n }\n })();\n\n return controller;\n}\n","import React from 'react';\nimport { executeQuery } from '../client/queries';\nimport { useClient } from './context';\nimport type { QueryResult } from '../client/types';\n\nexport interface UseQueryOptions {\n enabled?: boolean;\n refetchInterval?: number | null;\n}\n\nexport interface UseQueryResult {\n data: Record<string, unknown>[] | null;\n loading: boolean;\n error: string | null;\n rowCount: number | null;\n refetch: (overrideInput?: Record<string, unknown>) => Promise<QueryResult | undefined>;\n}\n\nexport function useQuery(\n ref: string,\n input: Record<string, unknown> = {},\n options: UseQueryOptions = {}\n): UseQueryResult {\n const client = useClient();\n const { enabled = true, refetchInterval = null } = options;\n\n const [data, setData] = React.useState<Record<string, unknown>[] | null>(null);\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n const [rowCount, setRowCount] = React.useState<number | null>(null);\n\n const abortRef = React.useRef<AbortController | null>(null);\n const inputJson = JSON.stringify(input);\n\n const execute = React.useCallback(\n async (overrideInput?: Record<string, unknown>) => {\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n setError(null);\n try {\n const result = await executeQuery(\n client,\n ref,\n overrideInput || JSON.parse(inputJson)\n );\n if (!controller.signal.aborted) {\n setData(result.data || null);\n setRowCount(result.rowCount ?? result.affectedRows ?? null);\n }\n return result;\n } catch (e) {\n if (!controller.signal.aborted) {\n setError((e as Error).message);\n }\n } finally {\n if (!controller.signal.aborted) {\n setLoading(false);\n }\n }\n },\n [client, ref, inputJson]\n );\n\n React.useEffect(() => {\n if (enabled) {\n execute();\n }\n return () => {\n abortRef.current?.abort();\n };\n }, [enabled, execute]);\n\n React.useEffect(() => {\n if (refetchInterval && enabled) {\n const id = setInterval(execute, refetchInterval);\n return () => clearInterval(id);\n }\n }, [refetchInterval, enabled, execute]);\n\n return { data, loading, error, rowCount, refetch: execute };\n}\n","import React from 'react';\nimport { SinasClient } from '../client/SinasClient';\n\nconst SinasContext = React.createContext<SinasClient | null>(null);\n\nexport interface SinasProviderProps {\n client?: SinasClient;\n children: React.ReactNode;\n}\n\nexport function SinasProvider({ client, children }: SinasProviderProps) {\n const value = React.useMemo(() => client || new SinasClient(), [client]);\n return React.createElement(SinasContext.Provider, { value }, children);\n}\n\nexport function useClient(): SinasClient {\n const client = React.useContext(SinasContext);\n if (client) return client;\n // Fallback: create a default client using window globals\n return defaultClient;\n}\n\nconst defaultClient = new SinasClient();\n","import React from 'react';\nimport { executeFunction } from '../client/functions';\nimport { useClient } from './context';\nimport type { FunctionResult } from '../client/types';\n\nexport interface UseExecuteResult {\n execute: (input?: Record<string, unknown>, timeout?: number) => Promise<FunctionResult | undefined>;\n result: unknown;\n loading: boolean;\n error: string | null;\n executionId: string | null;\n}\n\nexport function useExecute(ref: string): UseExecuteResult {\n const client = useClient();\n\n const [result, setResult] = React.useState<unknown>(null);\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n const [executionId, setExecutionId] = React.useState<string | null>(null);\n\n const execute = React.useCallback(\n async (input: Record<string, unknown> = {}, timeout?: number) => {\n setLoading(true);\n setError(null);\n try {\n const data = await executeFunction(client, ref, input, timeout);\n setResult(data.result);\n setExecutionId(data.executionId);\n if (data.status === 'error') {\n setError(data.error || 'Function execution failed');\n } else if (data.status === 'timeout') {\n setError('Function execution timed out');\n }\n return data;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, ref]\n );\n\n return { execute, result, loading, error, executionId };\n}\n","import React from 'react';\nimport { stateGet, stateSet, stateDelete, stateList } from '../client/states';\nimport { useClient } from './context';\nimport type { StateListResult } from '../client/types';\n\nexport interface UseStateStoreOptions {\n visibility?: 'private' | 'shared';\n}\n\nexport interface UseStateStoreResult {\n value: unknown;\n loading: boolean;\n error: string | null;\n save: (value: unknown, opts?: UseStateStoreOptions) => Promise<void>;\n remove: () => Promise<void>;\n refetch: () => Promise<void>;\n list: () => Promise<StateListResult | undefined>;\n}\n\nexport function useStateStore(ns: string, key?: string): UseStateStoreResult {\n const client = useClient();\n\n const [value, setValue] = React.useState<unknown>(null);\n const [loading, setLoading] = React.useState(true);\n const [error, setError] = React.useState<string | null>(null);\n\n const load = React.useCallback(async () => {\n if (!key) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const result = await stateGet(client, ns, key);\n if (result.found) {\n setValue(result.value);\n } else {\n setValue(null);\n }\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n }, [client, ns, key]);\n\n const save = React.useCallback(\n async (newValue: unknown, opts?: UseStateStoreOptions) => {\n if (!key) throw new Error('Cannot save without a key');\n setValue(newValue);\n setError(null);\n try {\n await stateSet(client, ns, key, newValue, opts?.visibility);\n } catch (e) {\n setError((e as Error).message);\n throw e;\n }\n },\n [client, ns, key]\n );\n\n const remove = React.useCallback(async () => {\n if (!key) throw new Error('Cannot delete without a key');\n setValue(null);\n setError(null);\n try {\n await stateDelete(client, ns, key);\n } catch (e) {\n setError((e as Error).message);\n throw e;\n }\n }, [client, ns, key]);\n\n const list = React.useCallback(async () => {\n setError(null);\n try {\n return await stateList(client, ns);\n } catch (e) {\n setError((e as Error).message);\n }\n }, [client, ns]);\n\n React.useEffect(() => {\n load();\n }, [load]);\n\n return { value, loading, error, save, remove, refetch: load, list };\n}\n","import React from 'react';\nimport { createChat, sendMessage, streamMessage } from '../client/chat';\nimport { useClient } from './context';\nimport type { ChatMessage, SSEChunk } from '../client/types';\n\nexport interface UseChatResult {\n chatId: string | null;\n messages: ChatMessage[];\n loading: boolean;\n streaming: boolean;\n error: string | null;\n createChat: (input?: Record<string, unknown>) => Promise<string | undefined>;\n sendMessage: (content: string) => Promise<ChatMessage | undefined>;\n streamMessage: (content: string) => AbortController | undefined;\n}\n\nexport function useChat(agentRef: string): UseChatResult {\n const client = useClient();\n\n const [chatId, setChatId] = React.useState<string | null>(null);\n const [messages, setMessages] = React.useState<ChatMessage[]>([]);\n const [loading, setLoading] = React.useState(false);\n const [streaming, setStreaming] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n\n const abortRef = React.useRef<AbortController | null>(null);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n abortRef.current?.abort();\n };\n }, []);\n\n const doCreateChat = React.useCallback(\n async (input?: Record<string, unknown>) => {\n setLoading(true);\n setError(null);\n try {\n const result = await createChat(client, agentRef, input);\n setChatId(result.id);\n setMessages([]);\n return result.id;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, agentRef]\n );\n\n const doSendMessage = React.useCallback(\n async (content: string) => {\n if (!chatId) {\n setError('No active chat. Call createChat first.');\n return;\n }\n setLoading(true);\n setError(null);\n\n // Add user message optimistically\n const userMsg: ChatMessage = {\n id: `tmp-${Date.now()}`,\n chatId,\n role: 'user',\n content,\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, userMsg]);\n\n try {\n const msg = await sendMessage(client, chatId, content);\n setMessages(prev => [...prev, msg]);\n return msg;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, chatId]\n );\n\n const doStreamMessage = React.useCallback(\n (content: string) => {\n if (!chatId) {\n setError('No active chat. Call createChat first.');\n return;\n }\n\n abortRef.current?.abort();\n setStreaming(true);\n setError(null);\n\n // Add user message optimistically\n const userMsg: ChatMessage = {\n id: `tmp-${Date.now()}`,\n chatId,\n role: 'user',\n content,\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, userMsg]);\n\n // Add empty assistant message to accumulate chunks\n const assistantId = `stream-${Date.now()}`;\n const assistantMsg: ChatMessage = {\n id: assistantId,\n chatId,\n role: 'assistant',\n content: '',\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, assistantMsg]);\n\n const controller = streamMessage(\n client,\n chatId,\n content,\n (chunk: SSEChunk) => {\n if (chunk.event === 'content' || chunk.event === 'message') {\n setMessages(prev =>\n prev.map(m =>\n m.id === assistantId ? { ...m, content: m.content + chunk.data } : m\n )\n );\n }\n },\n () => {\n setStreaming(false);\n },\n (err: Error) => {\n setError(err.message);\n setStreaming(false);\n }\n );\n\n abortRef.current = controller;\n return controller;\n },\n [client, chatId]\n );\n\n return {\n chatId,\n messages,\n loading,\n streaming,\n error,\n createChat: doCreateChat,\n sendMessage: doSendMessage,\n streamMessage: doStreamMessage,\n };\n}\n","import { useClient } from './context';\nimport { useQuery } from './useQuery';\nimport { useExecute } from './useExecute';\nimport { useStateStore } from './useStateStore';\nimport { useChat } from './useChat';\nimport type { SinasConfig } from '../client/types';\nimport type { SinasClient } from '../client/SinasClient';\n\nexport interface UseSinasResult {\n config: SinasConfig;\n input: Record<string, unknown>;\n client: SinasClient;\n useQuery: typeof useQuery;\n useExecute: typeof useExecute;\n useStateStore: typeof useStateStore;\n useChat: typeof useChat;\n}\n\nexport function useSinas(): UseSinasResult {\n const client = useClient();\n\n return {\n config: client.getConfig(),\n input: client.getInput(),\n client,\n useQuery,\n useExecute,\n useStateStore,\n useChat,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,aAAN,cAAyB,MAAM;AAAA,EAIpC,YAAY,SAAiB,SAAiB,GAAG,QAAiB;AAChE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,SAAS,UAAU;AAAA,EAC1B;AACF;AAEO,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAC7C,YAAY,UAAkB,2BAA2B;AACvD,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,uBAAN,cAAmC,WAAW;AAAA,EACnD,YAAY,UAAkB,qBAAqB;AACjD,UAAM,SAAS,GAAG;AAClB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,qBAAN,cAAiC,WAAW;AAAA,EACjD,YAAY,UAAkB;AAC5B,UAAM,GAAG,QAAQ,cAAc,GAAG;AAClC,SAAK,OAAO;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,YAAY;AAAA,MACpC;AACA,kBAAY,UAAQ,CAAC,GAAG,MAAM,OAAO,CAAC;AAGtC,YAAM,cAAc,UAAU,KAAK,IAAI,CAAC;AACxC,YAAM,eAA4B;AAAA,QAChC,IAAI;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MACpC;AACA,kBAAY,UAAQ,CAAC,GAAG,MAAM,YAAY,CAAC;AAE3C,YAAM,aAAa;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA,CAAC,UAAoB;AACnB,cAAI,MAAM,UAAU,aAAa,MAAM,UAAU,WAAW;AAC1D;AAAA,cAAY,UACV,KAAK;AAAA,gBAAI,OACP,EAAE,OAAO,cAAc,EAAE,GAAG,GAAG,SAAS,EAAE,UAAU,MAAM,KAAK,IAAI;AAAA,cACrE;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,MAAM;AACJ,uBAAa,KAAK;AAAA,QACpB;AAAA,QACA,CAAC,QAAe;AACd,mBAAS,IAAI,OAAO;AACpB,uBAAa,KAAK;AAAA,QACpB;AAAA,MACF;AAEA,eAAS,UAAU;AACnB,aAAO;AAAA,IACT;AAAA,IACA,CAAC,QAAQ,MAAM;AAAA,EACjB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,eAAe;AAAA,EACjB;AACF;;;ACxIO,SAAS,WAA2B;AACzC,QAAM,SAAS,UAAU;AAEzB,SAAO;AAAA,IACL,QAAQ,OAAO,UAAU;AAAA,IACzB,OAAO,OAAO,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["parseRef","import_react","React","React","import_react","React","import_react","React","import_react","React"]}
@@ -0,0 +1,70 @@
1
+ import { QueryResult, FunctionResult, StateListResult, ChatMessage, SinasConfig, SinasClient } from './client.cjs';
2
+ export { ChatCreateResult, SSEChunk, SinasAuthError, SinasError, SinasNotFoundError, SinasPermissionError, SinasTimeoutError, StateGetResult, createChat, executeFunction, executeQuery, sendMessage, stateDelete, stateGet, stateList, stateSet, streamMessage } from './client.cjs';
3
+ import React from 'react';
4
+
5
+ interface UseQueryOptions {
6
+ enabled?: boolean;
7
+ refetchInterval?: number | null;
8
+ }
9
+ interface UseQueryResult {
10
+ data: Record<string, unknown>[] | null;
11
+ loading: boolean;
12
+ error: string | null;
13
+ rowCount: number | null;
14
+ refetch: (overrideInput?: Record<string, unknown>) => Promise<QueryResult | undefined>;
15
+ }
16
+ declare function useQuery(ref: string, input?: Record<string, unknown>, options?: UseQueryOptions): UseQueryResult;
17
+
18
+ interface UseExecuteResult {
19
+ execute: (input?: Record<string, unknown>, timeout?: number) => Promise<FunctionResult | undefined>;
20
+ result: unknown;
21
+ loading: boolean;
22
+ error: string | null;
23
+ executionId: string | null;
24
+ }
25
+ declare function useExecute(ref: string): UseExecuteResult;
26
+
27
+ interface UseStateStoreOptions {
28
+ visibility?: 'private' | 'shared';
29
+ }
30
+ interface UseStateStoreResult {
31
+ value: unknown;
32
+ loading: boolean;
33
+ error: string | null;
34
+ save: (value: unknown, opts?: UseStateStoreOptions) => Promise<void>;
35
+ remove: () => Promise<void>;
36
+ refetch: () => Promise<void>;
37
+ list: () => Promise<StateListResult | undefined>;
38
+ }
39
+ declare function useStateStore(ns: string, key?: string): UseStateStoreResult;
40
+
41
+ interface UseChatResult {
42
+ chatId: string | null;
43
+ messages: ChatMessage[];
44
+ loading: boolean;
45
+ streaming: boolean;
46
+ error: string | null;
47
+ createChat: (input?: Record<string, unknown>) => Promise<string | undefined>;
48
+ sendMessage: (content: string) => Promise<ChatMessage | undefined>;
49
+ streamMessage: (content: string) => AbortController | undefined;
50
+ }
51
+ declare function useChat(agentRef: string): UseChatResult;
52
+
53
+ interface UseSinasResult {
54
+ config: SinasConfig;
55
+ input: Record<string, unknown>;
56
+ client: SinasClient;
57
+ useQuery: typeof useQuery;
58
+ useExecute: typeof useExecute;
59
+ useStateStore: typeof useStateStore;
60
+ useChat: typeof useChat;
61
+ }
62
+ declare function useSinas(): UseSinasResult;
63
+
64
+ interface SinasProviderProps {
65
+ client?: SinasClient;
66
+ children: React.ReactNode;
67
+ }
68
+ declare function SinasProvider({ client, children }: SinasProviderProps): React.FunctionComponentElement<React.ProviderProps<SinasClient | null>>;
69
+
70
+ export { ChatMessage, FunctionResult, QueryResult, SinasClient, SinasConfig, SinasProvider, type SinasProviderProps, StateListResult, type UseChatResult, type UseExecuteResult, type UseQueryOptions, type UseQueryResult, type UseSinasResult, type UseStateStoreOptions, type UseStateStoreResult, useChat, useExecute, useQuery, useSinas, useStateStore };
@@ -0,0 +1,70 @@
1
+ import { QueryResult, FunctionResult, StateListResult, ChatMessage, SinasConfig, SinasClient } from './client.js';
2
+ export { ChatCreateResult, SSEChunk, SinasAuthError, SinasError, SinasNotFoundError, SinasPermissionError, SinasTimeoutError, StateGetResult, createChat, executeFunction, executeQuery, sendMessage, stateDelete, stateGet, stateList, stateSet, streamMessage } from './client.js';
3
+ import React from 'react';
4
+
5
+ interface UseQueryOptions {
6
+ enabled?: boolean;
7
+ refetchInterval?: number | null;
8
+ }
9
+ interface UseQueryResult {
10
+ data: Record<string, unknown>[] | null;
11
+ loading: boolean;
12
+ error: string | null;
13
+ rowCount: number | null;
14
+ refetch: (overrideInput?: Record<string, unknown>) => Promise<QueryResult | undefined>;
15
+ }
16
+ declare function useQuery(ref: string, input?: Record<string, unknown>, options?: UseQueryOptions): UseQueryResult;
17
+
18
+ interface UseExecuteResult {
19
+ execute: (input?: Record<string, unknown>, timeout?: number) => Promise<FunctionResult | undefined>;
20
+ result: unknown;
21
+ loading: boolean;
22
+ error: string | null;
23
+ executionId: string | null;
24
+ }
25
+ declare function useExecute(ref: string): UseExecuteResult;
26
+
27
+ interface UseStateStoreOptions {
28
+ visibility?: 'private' | 'shared';
29
+ }
30
+ interface UseStateStoreResult {
31
+ value: unknown;
32
+ loading: boolean;
33
+ error: string | null;
34
+ save: (value: unknown, opts?: UseStateStoreOptions) => Promise<void>;
35
+ remove: () => Promise<void>;
36
+ refetch: () => Promise<void>;
37
+ list: () => Promise<StateListResult | undefined>;
38
+ }
39
+ declare function useStateStore(ns: string, key?: string): UseStateStoreResult;
40
+
41
+ interface UseChatResult {
42
+ chatId: string | null;
43
+ messages: ChatMessage[];
44
+ loading: boolean;
45
+ streaming: boolean;
46
+ error: string | null;
47
+ createChat: (input?: Record<string, unknown>) => Promise<string | undefined>;
48
+ sendMessage: (content: string) => Promise<ChatMessage | undefined>;
49
+ streamMessage: (content: string) => AbortController | undefined;
50
+ }
51
+ declare function useChat(agentRef: string): UseChatResult;
52
+
53
+ interface UseSinasResult {
54
+ config: SinasConfig;
55
+ input: Record<string, unknown>;
56
+ client: SinasClient;
57
+ useQuery: typeof useQuery;
58
+ useExecute: typeof useExecute;
59
+ useStateStore: typeof useStateStore;
60
+ useChat: typeof useChat;
61
+ }
62
+ declare function useSinas(): UseSinasResult;
63
+
64
+ interface SinasProviderProps {
65
+ client?: SinasClient;
66
+ children: React.ReactNode;
67
+ }
68
+ declare function SinasProvider({ client, children }: SinasProviderProps): React.FunctionComponentElement<React.ProviderProps<SinasClient | null>>;
69
+
70
+ export { ChatMessage, FunctionResult, QueryResult, SinasClient, SinasConfig, SinasProvider, type SinasProviderProps, StateListResult, type UseChatResult, type UseExecuteResult, type UseQueryOptions, type UseQueryResult, type UseSinasResult, type UseStateStoreOptions, type UseStateStoreResult, useChat, useExecute, useQuery, useSinas, useStateStore };
package/dist/index.js ADDED
@@ -0,0 +1,352 @@
1
+ import {
2
+ SinasAuthError,
3
+ SinasClient,
4
+ SinasError,
5
+ SinasNotFoundError,
6
+ SinasPermissionError,
7
+ SinasTimeoutError,
8
+ createChat,
9
+ executeFunction,
10
+ executeQuery,
11
+ sendMessage,
12
+ stateDelete,
13
+ stateGet,
14
+ stateList,
15
+ stateSet,
16
+ streamMessage
17
+ } from "./chunk-M7YHE5Y6.js";
18
+
19
+ // src/hooks/useQuery.ts
20
+ import React2 from "react";
21
+
22
+ // src/hooks/context.ts
23
+ import React from "react";
24
+ var SinasContext = React.createContext(null);
25
+ function SinasProvider({ client, children }) {
26
+ const value = React.useMemo(() => client || new SinasClient(), [client]);
27
+ return React.createElement(SinasContext.Provider, { value }, children);
28
+ }
29
+ function useClient() {
30
+ const client = React.useContext(SinasContext);
31
+ if (client) return client;
32
+ return defaultClient;
33
+ }
34
+ var defaultClient = new SinasClient();
35
+
36
+ // src/hooks/useQuery.ts
37
+ function useQuery(ref, input = {}, options = {}) {
38
+ const client = useClient();
39
+ const { enabled = true, refetchInterval = null } = options;
40
+ const [data, setData] = React2.useState(null);
41
+ const [loading, setLoading] = React2.useState(false);
42
+ const [error, setError] = React2.useState(null);
43
+ const [rowCount, setRowCount] = React2.useState(null);
44
+ const abortRef = React2.useRef(null);
45
+ const inputJson = JSON.stringify(input);
46
+ const execute = React2.useCallback(
47
+ async (overrideInput) => {
48
+ abortRef.current?.abort();
49
+ const controller = new AbortController();
50
+ abortRef.current = controller;
51
+ setLoading(true);
52
+ setError(null);
53
+ try {
54
+ const result = await executeQuery(
55
+ client,
56
+ ref,
57
+ overrideInput || JSON.parse(inputJson)
58
+ );
59
+ if (!controller.signal.aborted) {
60
+ setData(result.data || null);
61
+ setRowCount(result.rowCount ?? result.affectedRows ?? null);
62
+ }
63
+ return result;
64
+ } catch (e) {
65
+ if (!controller.signal.aborted) {
66
+ setError(e.message);
67
+ }
68
+ } finally {
69
+ if (!controller.signal.aborted) {
70
+ setLoading(false);
71
+ }
72
+ }
73
+ },
74
+ [client, ref, inputJson]
75
+ );
76
+ React2.useEffect(() => {
77
+ if (enabled) {
78
+ execute();
79
+ }
80
+ return () => {
81
+ abortRef.current?.abort();
82
+ };
83
+ }, [enabled, execute]);
84
+ React2.useEffect(() => {
85
+ if (refetchInterval && enabled) {
86
+ const id = setInterval(execute, refetchInterval);
87
+ return () => clearInterval(id);
88
+ }
89
+ }, [refetchInterval, enabled, execute]);
90
+ return { data, loading, error, rowCount, refetch: execute };
91
+ }
92
+
93
+ // src/hooks/useExecute.ts
94
+ import React3 from "react";
95
+ function useExecute(ref) {
96
+ const client = useClient();
97
+ const [result, setResult] = React3.useState(null);
98
+ const [loading, setLoading] = React3.useState(false);
99
+ const [error, setError] = React3.useState(null);
100
+ const [executionId, setExecutionId] = React3.useState(null);
101
+ const execute = React3.useCallback(
102
+ async (input = {}, timeout) => {
103
+ setLoading(true);
104
+ setError(null);
105
+ try {
106
+ const data = await executeFunction(client, ref, input, timeout);
107
+ setResult(data.result);
108
+ setExecutionId(data.executionId);
109
+ if (data.status === "error") {
110
+ setError(data.error || "Function execution failed");
111
+ } else if (data.status === "timeout") {
112
+ setError("Function execution timed out");
113
+ }
114
+ return data;
115
+ } catch (e) {
116
+ setError(e.message);
117
+ } finally {
118
+ setLoading(false);
119
+ }
120
+ },
121
+ [client, ref]
122
+ );
123
+ return { execute, result, loading, error, executionId };
124
+ }
125
+
126
+ // src/hooks/useStateStore.ts
127
+ import React4 from "react";
128
+ function useStateStore(ns, key) {
129
+ const client = useClient();
130
+ const [value, setValue] = React4.useState(null);
131
+ const [loading, setLoading] = React4.useState(true);
132
+ const [error, setError] = React4.useState(null);
133
+ const load = React4.useCallback(async () => {
134
+ if (!key) {
135
+ setLoading(false);
136
+ return;
137
+ }
138
+ setLoading(true);
139
+ setError(null);
140
+ try {
141
+ const result = await stateGet(client, ns, key);
142
+ if (result.found) {
143
+ setValue(result.value);
144
+ } else {
145
+ setValue(null);
146
+ }
147
+ } catch (e) {
148
+ setError(e.message);
149
+ } finally {
150
+ setLoading(false);
151
+ }
152
+ }, [client, ns, key]);
153
+ const save = React4.useCallback(
154
+ async (newValue, opts) => {
155
+ if (!key) throw new Error("Cannot save without a key");
156
+ setValue(newValue);
157
+ setError(null);
158
+ try {
159
+ await stateSet(client, ns, key, newValue, opts?.visibility);
160
+ } catch (e) {
161
+ setError(e.message);
162
+ throw e;
163
+ }
164
+ },
165
+ [client, ns, key]
166
+ );
167
+ const remove = React4.useCallback(async () => {
168
+ if (!key) throw new Error("Cannot delete without a key");
169
+ setValue(null);
170
+ setError(null);
171
+ try {
172
+ await stateDelete(client, ns, key);
173
+ } catch (e) {
174
+ setError(e.message);
175
+ throw e;
176
+ }
177
+ }, [client, ns, key]);
178
+ const list = React4.useCallback(async () => {
179
+ setError(null);
180
+ try {
181
+ return await stateList(client, ns);
182
+ } catch (e) {
183
+ setError(e.message);
184
+ }
185
+ }, [client, ns]);
186
+ React4.useEffect(() => {
187
+ load();
188
+ }, [load]);
189
+ return { value, loading, error, save, remove, refetch: load, list };
190
+ }
191
+
192
+ // src/hooks/useChat.ts
193
+ import React5 from "react";
194
+ function useChat(agentRef) {
195
+ const client = useClient();
196
+ const [chatId, setChatId] = React5.useState(null);
197
+ const [messages, setMessages] = React5.useState([]);
198
+ const [loading, setLoading] = React5.useState(false);
199
+ const [streaming, setStreaming] = React5.useState(false);
200
+ const [error, setError] = React5.useState(null);
201
+ const abortRef = React5.useRef(null);
202
+ React5.useEffect(() => {
203
+ return () => {
204
+ abortRef.current?.abort();
205
+ };
206
+ }, []);
207
+ const doCreateChat = React5.useCallback(
208
+ async (input) => {
209
+ setLoading(true);
210
+ setError(null);
211
+ try {
212
+ const result = await createChat(client, agentRef, input);
213
+ setChatId(result.id);
214
+ setMessages([]);
215
+ return result.id;
216
+ } catch (e) {
217
+ setError(e.message);
218
+ } finally {
219
+ setLoading(false);
220
+ }
221
+ },
222
+ [client, agentRef]
223
+ );
224
+ const doSendMessage = React5.useCallback(
225
+ async (content) => {
226
+ if (!chatId) {
227
+ setError("No active chat. Call createChat first.");
228
+ return;
229
+ }
230
+ setLoading(true);
231
+ setError(null);
232
+ const userMsg = {
233
+ id: `tmp-${Date.now()}`,
234
+ chatId,
235
+ role: "user",
236
+ content,
237
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
238
+ };
239
+ setMessages((prev) => [...prev, userMsg]);
240
+ try {
241
+ const msg = await sendMessage(client, chatId, content);
242
+ setMessages((prev) => [...prev, msg]);
243
+ return msg;
244
+ } catch (e) {
245
+ setError(e.message);
246
+ } finally {
247
+ setLoading(false);
248
+ }
249
+ },
250
+ [client, chatId]
251
+ );
252
+ const doStreamMessage = React5.useCallback(
253
+ (content) => {
254
+ if (!chatId) {
255
+ setError("No active chat. Call createChat first.");
256
+ return;
257
+ }
258
+ abortRef.current?.abort();
259
+ setStreaming(true);
260
+ setError(null);
261
+ const userMsg = {
262
+ id: `tmp-${Date.now()}`,
263
+ chatId,
264
+ role: "user",
265
+ content,
266
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
267
+ };
268
+ setMessages((prev) => [...prev, userMsg]);
269
+ const assistantId = `stream-${Date.now()}`;
270
+ const assistantMsg = {
271
+ id: assistantId,
272
+ chatId,
273
+ role: "assistant",
274
+ content: "",
275
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
276
+ };
277
+ setMessages((prev) => [...prev, assistantMsg]);
278
+ const controller = streamMessage(
279
+ client,
280
+ chatId,
281
+ content,
282
+ (chunk) => {
283
+ if (chunk.event === "content" || chunk.event === "message") {
284
+ setMessages(
285
+ (prev) => prev.map(
286
+ (m) => m.id === assistantId ? { ...m, content: m.content + chunk.data } : m
287
+ )
288
+ );
289
+ }
290
+ },
291
+ () => {
292
+ setStreaming(false);
293
+ },
294
+ (err) => {
295
+ setError(err.message);
296
+ setStreaming(false);
297
+ }
298
+ );
299
+ abortRef.current = controller;
300
+ return controller;
301
+ },
302
+ [client, chatId]
303
+ );
304
+ return {
305
+ chatId,
306
+ messages,
307
+ loading,
308
+ streaming,
309
+ error,
310
+ createChat: doCreateChat,
311
+ sendMessage: doSendMessage,
312
+ streamMessage: doStreamMessage
313
+ };
314
+ }
315
+
316
+ // src/hooks/useSinas.ts
317
+ function useSinas() {
318
+ const client = useClient();
319
+ return {
320
+ config: client.getConfig(),
321
+ input: client.getInput(),
322
+ client,
323
+ useQuery,
324
+ useExecute,
325
+ useStateStore,
326
+ useChat
327
+ };
328
+ }
329
+ export {
330
+ SinasAuthError,
331
+ SinasClient,
332
+ SinasError,
333
+ SinasNotFoundError,
334
+ SinasPermissionError,
335
+ SinasProvider,
336
+ SinasTimeoutError,
337
+ createChat,
338
+ executeFunction,
339
+ executeQuery,
340
+ sendMessage,
341
+ stateDelete,
342
+ stateGet,
343
+ stateList,
344
+ stateSet,
345
+ streamMessage,
346
+ useChat,
347
+ useExecute,
348
+ useQuery,
349
+ useSinas,
350
+ useStateStore
351
+ };
352
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useQuery.ts","../src/hooks/context.ts","../src/hooks/useExecute.ts","../src/hooks/useStateStore.ts","../src/hooks/useChat.ts","../src/hooks/useSinas.ts"],"sourcesContent":["import React from 'react';\nimport { executeQuery } from '../client/queries';\nimport { useClient } from './context';\nimport type { QueryResult } from '../client/types';\n\nexport interface UseQueryOptions {\n enabled?: boolean;\n refetchInterval?: number | null;\n}\n\nexport interface UseQueryResult {\n data: Record<string, unknown>[] | null;\n loading: boolean;\n error: string | null;\n rowCount: number | null;\n refetch: (overrideInput?: Record<string, unknown>) => Promise<QueryResult | undefined>;\n}\n\nexport function useQuery(\n ref: string,\n input: Record<string, unknown> = {},\n options: UseQueryOptions = {}\n): UseQueryResult {\n const client = useClient();\n const { enabled = true, refetchInterval = null } = options;\n\n const [data, setData] = React.useState<Record<string, unknown>[] | null>(null);\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n const [rowCount, setRowCount] = React.useState<number | null>(null);\n\n const abortRef = React.useRef<AbortController | null>(null);\n const inputJson = JSON.stringify(input);\n\n const execute = React.useCallback(\n async (overrideInput?: Record<string, unknown>) => {\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n setError(null);\n try {\n const result = await executeQuery(\n client,\n ref,\n overrideInput || JSON.parse(inputJson)\n );\n if (!controller.signal.aborted) {\n setData(result.data || null);\n setRowCount(result.rowCount ?? result.affectedRows ?? null);\n }\n return result;\n } catch (e) {\n if (!controller.signal.aborted) {\n setError((e as Error).message);\n }\n } finally {\n if (!controller.signal.aborted) {\n setLoading(false);\n }\n }\n },\n [client, ref, inputJson]\n );\n\n React.useEffect(() => {\n if (enabled) {\n execute();\n }\n return () => {\n abortRef.current?.abort();\n };\n }, [enabled, execute]);\n\n React.useEffect(() => {\n if (refetchInterval && enabled) {\n const id = setInterval(execute, refetchInterval);\n return () => clearInterval(id);\n }\n }, [refetchInterval, enabled, execute]);\n\n return { data, loading, error, rowCount, refetch: execute };\n}\n","import React from 'react';\nimport { SinasClient } from '../client/SinasClient';\n\nconst SinasContext = React.createContext<SinasClient | null>(null);\n\nexport interface SinasProviderProps {\n client?: SinasClient;\n children: React.ReactNode;\n}\n\nexport function SinasProvider({ client, children }: SinasProviderProps) {\n const value = React.useMemo(() => client || new SinasClient(), [client]);\n return React.createElement(SinasContext.Provider, { value }, children);\n}\n\nexport function useClient(): SinasClient {\n const client = React.useContext(SinasContext);\n if (client) return client;\n // Fallback: create a default client using window globals\n return defaultClient;\n}\n\nconst defaultClient = new SinasClient();\n","import React from 'react';\nimport { executeFunction } from '../client/functions';\nimport { useClient } from './context';\nimport type { FunctionResult } from '../client/types';\n\nexport interface UseExecuteResult {\n execute: (input?: Record<string, unknown>, timeout?: number) => Promise<FunctionResult | undefined>;\n result: unknown;\n loading: boolean;\n error: string | null;\n executionId: string | null;\n}\n\nexport function useExecute(ref: string): UseExecuteResult {\n const client = useClient();\n\n const [result, setResult] = React.useState<unknown>(null);\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n const [executionId, setExecutionId] = React.useState<string | null>(null);\n\n const execute = React.useCallback(\n async (input: Record<string, unknown> = {}, timeout?: number) => {\n setLoading(true);\n setError(null);\n try {\n const data = await executeFunction(client, ref, input, timeout);\n setResult(data.result);\n setExecutionId(data.executionId);\n if (data.status === 'error') {\n setError(data.error || 'Function execution failed');\n } else if (data.status === 'timeout') {\n setError('Function execution timed out');\n }\n return data;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, ref]\n );\n\n return { execute, result, loading, error, executionId };\n}\n","import React from 'react';\nimport { stateGet, stateSet, stateDelete, stateList } from '../client/states';\nimport { useClient } from './context';\nimport type { StateListResult } from '../client/types';\n\nexport interface UseStateStoreOptions {\n visibility?: 'private' | 'shared';\n}\n\nexport interface UseStateStoreResult {\n value: unknown;\n loading: boolean;\n error: string | null;\n save: (value: unknown, opts?: UseStateStoreOptions) => Promise<void>;\n remove: () => Promise<void>;\n refetch: () => Promise<void>;\n list: () => Promise<StateListResult | undefined>;\n}\n\nexport function useStateStore(ns: string, key?: string): UseStateStoreResult {\n const client = useClient();\n\n const [value, setValue] = React.useState<unknown>(null);\n const [loading, setLoading] = React.useState(true);\n const [error, setError] = React.useState<string | null>(null);\n\n const load = React.useCallback(async () => {\n if (!key) {\n setLoading(false);\n return;\n }\n setLoading(true);\n setError(null);\n try {\n const result = await stateGet(client, ns, key);\n if (result.found) {\n setValue(result.value);\n } else {\n setValue(null);\n }\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n }, [client, ns, key]);\n\n const save = React.useCallback(\n async (newValue: unknown, opts?: UseStateStoreOptions) => {\n if (!key) throw new Error('Cannot save without a key');\n setValue(newValue);\n setError(null);\n try {\n await stateSet(client, ns, key, newValue, opts?.visibility);\n } catch (e) {\n setError((e as Error).message);\n throw e;\n }\n },\n [client, ns, key]\n );\n\n const remove = React.useCallback(async () => {\n if (!key) throw new Error('Cannot delete without a key');\n setValue(null);\n setError(null);\n try {\n await stateDelete(client, ns, key);\n } catch (e) {\n setError((e as Error).message);\n throw e;\n }\n }, [client, ns, key]);\n\n const list = React.useCallback(async () => {\n setError(null);\n try {\n return await stateList(client, ns);\n } catch (e) {\n setError((e as Error).message);\n }\n }, [client, ns]);\n\n React.useEffect(() => {\n load();\n }, [load]);\n\n return { value, loading, error, save, remove, refetch: load, list };\n}\n","import React from 'react';\nimport { createChat, sendMessage, streamMessage } from '../client/chat';\nimport { useClient } from './context';\nimport type { ChatMessage, SSEChunk } from '../client/types';\n\nexport interface UseChatResult {\n chatId: string | null;\n messages: ChatMessage[];\n loading: boolean;\n streaming: boolean;\n error: string | null;\n createChat: (input?: Record<string, unknown>) => Promise<string | undefined>;\n sendMessage: (content: string) => Promise<ChatMessage | undefined>;\n streamMessage: (content: string) => AbortController | undefined;\n}\n\nexport function useChat(agentRef: string): UseChatResult {\n const client = useClient();\n\n const [chatId, setChatId] = React.useState<string | null>(null);\n const [messages, setMessages] = React.useState<ChatMessage[]>([]);\n const [loading, setLoading] = React.useState(false);\n const [streaming, setStreaming] = React.useState(false);\n const [error, setError] = React.useState<string | null>(null);\n\n const abortRef = React.useRef<AbortController | null>(null);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n abortRef.current?.abort();\n };\n }, []);\n\n const doCreateChat = React.useCallback(\n async (input?: Record<string, unknown>) => {\n setLoading(true);\n setError(null);\n try {\n const result = await createChat(client, agentRef, input);\n setChatId(result.id);\n setMessages([]);\n return result.id;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, agentRef]\n );\n\n const doSendMessage = React.useCallback(\n async (content: string) => {\n if (!chatId) {\n setError('No active chat. Call createChat first.');\n return;\n }\n setLoading(true);\n setError(null);\n\n // Add user message optimistically\n const userMsg: ChatMessage = {\n id: `tmp-${Date.now()}`,\n chatId,\n role: 'user',\n content,\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, userMsg]);\n\n try {\n const msg = await sendMessage(client, chatId, content);\n setMessages(prev => [...prev, msg]);\n return msg;\n } catch (e) {\n setError((e as Error).message);\n } finally {\n setLoading(false);\n }\n },\n [client, chatId]\n );\n\n const doStreamMessage = React.useCallback(\n (content: string) => {\n if (!chatId) {\n setError('No active chat. Call createChat first.');\n return;\n }\n\n abortRef.current?.abort();\n setStreaming(true);\n setError(null);\n\n // Add user message optimistically\n const userMsg: ChatMessage = {\n id: `tmp-${Date.now()}`,\n chatId,\n role: 'user',\n content,\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, userMsg]);\n\n // Add empty assistant message to accumulate chunks\n const assistantId = `stream-${Date.now()}`;\n const assistantMsg: ChatMessage = {\n id: assistantId,\n chatId,\n role: 'assistant',\n content: '',\n createdAt: new Date().toISOString(),\n };\n setMessages(prev => [...prev, assistantMsg]);\n\n const controller = streamMessage(\n client,\n chatId,\n content,\n (chunk: SSEChunk) => {\n if (chunk.event === 'content' || chunk.event === 'message') {\n setMessages(prev =>\n prev.map(m =>\n m.id === assistantId ? { ...m, content: m.content + chunk.data } : m\n )\n );\n }\n },\n () => {\n setStreaming(false);\n },\n (err: Error) => {\n setError(err.message);\n setStreaming(false);\n }\n );\n\n abortRef.current = controller;\n return controller;\n },\n [client, chatId]\n );\n\n return {\n chatId,\n messages,\n loading,\n streaming,\n error,\n createChat: doCreateChat,\n sendMessage: doSendMessage,\n streamMessage: doStreamMessage,\n };\n}\n","import { useClient } from './context';\nimport { useQuery } from './useQuery';\nimport { useExecute } from './useExecute';\nimport { useStateStore } from './useStateStore';\nimport { useChat } from './useChat';\nimport type { SinasConfig } from '../client/types';\nimport type { SinasClient } from '../client/SinasClient';\n\nexport interface UseSinasResult {\n config: SinasConfig;\n input: Record<string, unknown>;\n client: SinasClient;\n useQuery: typeof useQuery;\n useExecute: typeof useExecute;\n useStateStore: typeof useStateStore;\n useChat: typeof useChat;\n}\n\nexport function useSinas(): UseSinasResult {\n const client = useClient();\n\n return {\n config: client.getConfig(),\n input: client.getInput(),\n client,\n useQuery,\n useExecute,\n useStateStore,\n useChat,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAO,WAAW;AAGlB,IA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F;AACF;","names":["React","React","React","React","React","React","React","React"]}