tekivex-ui 3.4.0 → 3.18.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.
- package/LICENSE +21 -21
- package/README.md +146 -33
- package/dist/agent.cjs +1 -0
- package/dist/agent.js +17 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +41 -22
- package/dist/experimental.cjs +1 -0
- package/dist/experimental.js +39 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +55 -1
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +31 -6
- package/dist/index.js +694 -571
- package/dist/quantum.cjs +1 -1
- package/dist/quantum.js +59 -74
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.js +1 -1
- package/dist/src/agent/a2a/A2AClient.d.ts +32 -0
- package/dist/src/agent/a2a/a2aTool.d.ts +11 -0
- package/dist/src/agent/a2a/createA2ARoute.d.ts +5 -0
- package/dist/src/agent/bindings/solid.d.ts +12 -0
- package/dist/src/agent/bindings/svelte.d.ts +10 -0
- package/dist/src/agent/bindings/vanilla.d.ts +17 -0
- package/dist/src/agent/bindings/vue.d.ts +15 -0
- package/dist/src/agent/components/TkxAgentMessage.d.ts +15 -0
- package/dist/src/agent/components/TkxReasoningTrace.d.ts +9 -0
- package/dist/src/agent/components/TkxToolCallCard.d.ts +12 -0
- package/dist/src/agent/content/helpers.d.ts +17 -0
- package/dist/src/agent/core/Agent.d.ts +29 -0
- package/dist/src/agent/core/Memory.d.ts +12 -0
- package/dist/src/agent/core/Middleware.d.ts +10 -0
- package/dist/src/agent/core/Provider.d.ts +44 -0
- package/dist/src/agent/core/Sanitizer.d.ts +4 -0
- package/dist/src/agent/core/Tool.d.ts +13 -0
- package/dist/src/agent/core/Transport.d.ts +18 -0
- package/dist/src/agent/core/events.d.ts +19 -0
- package/dist/src/agent/core/sse.d.ts +6 -0
- package/dist/src/agent/core/types.d.ts +39 -0
- package/dist/src/agent/devtools/DevToolsPanel.d.ts +8 -0
- package/dist/src/agent/devtools/useEventCollector.d.ts +8 -0
- package/dist/src/agent/eval/runEval.d.ts +31 -0
- package/dist/src/agent/index.d.ts +54 -0
- package/dist/src/agent/mcp/MCPClient.d.ts +33 -0
- package/dist/src/agent/mcp/mcpAdapter.d.ts +3 -0
- package/dist/src/agent/memory/SlidingWindowMemory.d.ts +10 -0
- package/dist/src/agent/memory/SummarizingMemory.d.ts +16 -0
- package/dist/src/agent/memory/VectorMemory.d.ts +17 -0
- package/dist/src/agent/middleware/guardrails.d.ts +20 -0
- package/dist/src/agent/middleware/otel.d.ts +13 -0
- package/dist/src/agent/middleware/retry.d.ts +11 -0
- package/dist/src/agent/middleware/tokenUsage.d.ts +27 -0
- package/dist/src/agent/multi/agentAsTool.d.ts +11 -0
- package/dist/src/agent/providers/anthropic.d.ts +16 -0
- package/dist/src/agent/providers/gemini.d.ts +16 -0
- package/dist/src/agent/providers/ollama.d.ts +14 -0
- package/dist/src/agent/providers/openai.d.ts +16 -0
- package/dist/src/agent/rag/Retriever.d.ts +13 -0
- package/dist/src/agent/rag/retrievalTool.d.ts +11 -0
- package/dist/src/agent/react/useAgent.d.ts +12 -0
- package/dist/src/agent/replay/ReplayProvider.d.ts +13 -0
- package/dist/src/agent/replay/recorder.d.ts +16 -0
- package/dist/src/agent/research/DeepResearch.d.ts +37 -0
- package/dist/src/agent/research/citations.d.ts +10 -0
- package/dist/src/agent/server/createAgentClient.d.ts +11 -0
- package/dist/src/agent/server/createAgentRoute.d.ts +10 -0
- package/dist/src/agent/structured/generateObject.d.ts +19 -0
- package/dist/src/agent/tools/cancellable.d.ts +6 -0
- package/dist/src/charts/TkxDataExplorer.d.ts +17 -0
- package/dist/src/charts/index.d.ts +2 -0
- package/dist/src/components/TkxAccessibilityChecker.d.ts +12 -0
- package/dist/src/components/TkxAppBar.d.ts +2 -1
- package/dist/src/components/TkxButton.d.ts +1 -0
- package/dist/src/components/TkxCommandPalette.d.ts +32 -0
- package/dist/src/components/TkxDataGrid.d.ts +37 -1
- package/dist/src/components/TkxFlowChart.d.ts +52 -0
- package/dist/src/components/TkxFormBuilder.d.ts +34 -0
- package/dist/src/components/TkxFormulaBar.d.ts +19 -0
- package/dist/src/components/TkxFunnelChart.d.ts +21 -0
- package/dist/src/components/TkxGantt.d.ts +29 -0
- package/dist/src/components/TkxGauge.d.ts +21 -0
- package/dist/src/components/TkxHeatmap.d.ts +25 -0
- package/dist/src/components/TkxHolographic.d.ts +2 -0
- package/dist/src/components/TkxHolographicAdvanced.d.ts +48 -0
- package/dist/src/components/TkxMindMap.d.ts +22 -0
- package/dist/src/components/TkxPivotTable.d.ts +21 -0
- package/dist/src/components/TkxSparkline.d.ts +15 -0
- package/dist/src/components/TkxSpreadsheet.d.ts +33 -0
- package/dist/src/components/TkxTreemap.d.ts +21 -0
- package/dist/src/components/TkxTypography.d.ts +1 -1
- package/dist/src/components/index.d.ts +5 -3
- package/dist/src/engine/security.d.ts +3 -0
- package/dist/src/experimental/index.d.ts +8 -0
- package/dist/src/headless/index.d.ts +6 -0
- package/dist/src/headless/rhfBindings.d.ts +59 -0
- package/dist/src/headless/useFormState.d.ts +12 -2
- package/dist/src/headless/valibotResolver.d.ts +25 -0
- package/dist/src/headless/zodResolver.d.ts +25 -0
- package/dist/src/i18n/index.d.ts +20 -0
- package/dist/src/i18n/plurals.d.ts +4 -0
- package/dist/src/quantum/index.d.ts +0 -2
- package/dist/src/themes/index.d.ts +7 -1
- package/dist/themes.cjs +1 -0
- package/dist/themes.js +1 -0
- package/package.json +32 -8
- package/dist/chunk-BHX35YDv.js +0 -1
- package/dist/chunk-BpuJ3-K8.js +0 -1
- package/dist/chunk-Bze40nDX.js +0 -1
- package/dist/chunk-C8Wy8P59.js +0 -1
- package/dist/chunk-D7-yknXg.js +0 -1
- package/dist/chunk-DTO-RrPx.js +0 -3
- package/dist/chunk-DcVMayoM.js +0 -1
- package/dist/chunk-DdHSYetV.js +0 -1
- package/dist/chunk-DmRB1Blb.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentEvent } from '../core/events';
|
|
2
|
+
export interface DevToolsPanelProps {
|
|
3
|
+
events: AgentEvent[];
|
|
4
|
+
onClear?(): void;
|
|
5
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
6
|
+
startOpen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function DevToolsPanel({ events, onClear, position, startOpen, }: DevToolsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentEvent } from '../core/events';
|
|
2
|
+
import type { Middleware } from '../core/Middleware';
|
|
3
|
+
export interface UseEventCollectorReturn {
|
|
4
|
+
events: AgentEvent[];
|
|
5
|
+
middleware: Middleware;
|
|
6
|
+
clear(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useEventCollector(): UseEventCollectorReturn;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Agent } from '../core/Agent';
|
|
2
|
+
import type { Provider } from '../core/Provider';
|
|
3
|
+
export interface EvalCase {
|
|
4
|
+
name: string;
|
|
5
|
+
input: string;
|
|
6
|
+
expected?: string;
|
|
7
|
+
judge?(output: string, expected?: string): boolean | Promise<boolean>;
|
|
8
|
+
meta?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface EvalResult {
|
|
11
|
+
name: string;
|
|
12
|
+
input: string;
|
|
13
|
+
output: string;
|
|
14
|
+
passed: boolean;
|
|
15
|
+
durationMs: number;
|
|
16
|
+
error?: Error;
|
|
17
|
+
meta?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface EvalSummary {
|
|
20
|
+
total: number;
|
|
21
|
+
passed: number;
|
|
22
|
+
failed: number;
|
|
23
|
+
passRate: number;
|
|
24
|
+
totalDurationMs: number;
|
|
25
|
+
results: EvalResult[];
|
|
26
|
+
}
|
|
27
|
+
export declare function runEval(agent: Agent, cases: EvalCase[], opts?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
onProgress?(done: number, total: number): void;
|
|
30
|
+
}): Promise<EvalSummary>;
|
|
31
|
+
export declare function judgeWithLLM(provider: Provider, model: string, criteria: string): (output: string, expected?: string) => Promise<boolean>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export * from './core/types';
|
|
2
|
+
export * from './core/Provider';
|
|
3
|
+
export * from './core/Tool';
|
|
4
|
+
export * from './core/Memory';
|
|
5
|
+
export * from './core/Transport';
|
|
6
|
+
export * from './core/Middleware';
|
|
7
|
+
export * from './core/Sanitizer';
|
|
8
|
+
export * from './core/events';
|
|
9
|
+
export * from './core/sse';
|
|
10
|
+
export * from './core/Agent';
|
|
11
|
+
export { AnthropicProvider } from './providers/anthropic';
|
|
12
|
+
export type { AnthropicProviderOptions } from './providers/anthropic';
|
|
13
|
+
export { OpenAIProvider } from './providers/openai';
|
|
14
|
+
export type { OpenAIProviderOptions } from './providers/openai';
|
|
15
|
+
export { GeminiProvider } from './providers/gemini';
|
|
16
|
+
export type { GeminiProviderOptions } from './providers/gemini';
|
|
17
|
+
export { OllamaProvider } from './providers/ollama';
|
|
18
|
+
export type { OllamaProviderOptions } from './providers/ollama';
|
|
19
|
+
export * from './rag/Retriever';
|
|
20
|
+
export * from './rag/retrievalTool';
|
|
21
|
+
export * from './multi/agentAsTool';
|
|
22
|
+
export * from './middleware/tokenUsage';
|
|
23
|
+
export * from './middleware/retry';
|
|
24
|
+
export * from './middleware/otel';
|
|
25
|
+
export * from './middleware/guardrails';
|
|
26
|
+
export * from './memory/SlidingWindowMemory';
|
|
27
|
+
export * from './memory/SummarizingMemory';
|
|
28
|
+
export * from './memory/VectorMemory';
|
|
29
|
+
export * from './structured/generateObject';
|
|
30
|
+
export * from './content/helpers';
|
|
31
|
+
export * from './mcp/MCPClient';
|
|
32
|
+
export * from './mcp/mcpAdapter';
|
|
33
|
+
export * from './eval/runEval';
|
|
34
|
+
export * from './tools/cancellable';
|
|
35
|
+
export * from './components/TkxAgentMessage';
|
|
36
|
+
export * from './components/TkxToolCallCard';
|
|
37
|
+
export * from './components/TkxReasoningTrace';
|
|
38
|
+
export * from './research/DeepResearch';
|
|
39
|
+
export * from './research/citations';
|
|
40
|
+
export * from './bindings/vanilla';
|
|
41
|
+
export * from './bindings/vue';
|
|
42
|
+
export * from './bindings/svelte';
|
|
43
|
+
export * from './bindings/solid';
|
|
44
|
+
export * from './server/createAgentRoute';
|
|
45
|
+
export * from './server/createAgentClient';
|
|
46
|
+
export * from './replay/recorder';
|
|
47
|
+
export * from './replay/ReplayProvider';
|
|
48
|
+
export * from './devtools/DevToolsPanel';
|
|
49
|
+
export * from './devtools/useEventCollector';
|
|
50
|
+
export * from './a2a/A2AClient';
|
|
51
|
+
export * from './a2a/a2aTool';
|
|
52
|
+
export * from './a2a/createA2ARoute';
|
|
53
|
+
export { useAgent } from './react/useAgent';
|
|
54
|
+
export type { UseAgentReturn } from './react/useAgent';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Transport } from '../core/Transport';
|
|
2
|
+
export interface MCPClientOptions {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
transport?: Transport;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
clientInfo?: {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface MCPTool {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
inputSchema: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface MCPCallResult {
|
|
17
|
+
content?: Array<{
|
|
18
|
+
type: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
}>;
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class MCPClient {
|
|
24
|
+
private readonly opts;
|
|
25
|
+
private idSeq;
|
|
26
|
+
private transport;
|
|
27
|
+
private initialized;
|
|
28
|
+
constructor(opts: MCPClientOptions);
|
|
29
|
+
initialize(signal?: AbortSignal): Promise<void>;
|
|
30
|
+
listTools(signal?: AbortSignal): Promise<MCPTool[]>;
|
|
31
|
+
callTool(name: string, args: unknown, signal?: AbortSignal): Promise<MCPCallResult>;
|
|
32
|
+
private call;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Memory } from '../core/Memory';
|
|
2
|
+
import type { Message } from '../core/types';
|
|
3
|
+
export declare class SlidingWindowMemory implements Memory {
|
|
4
|
+
private readonly windowSize;
|
|
5
|
+
private messages;
|
|
6
|
+
constructor(windowSize: number);
|
|
7
|
+
append(message: Message): void;
|
|
8
|
+
all(): Message[];
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Memory } from '../core/Memory';
|
|
2
|
+
import type { Message } from '../core/types';
|
|
3
|
+
export interface SummarizingMemoryOptions {
|
|
4
|
+
threshold: number;
|
|
5
|
+
keepRecent?: number;
|
|
6
|
+
summarizer(messages: Message[]): string | Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare class SummarizingMemory implements Memory {
|
|
9
|
+
private readonly opts;
|
|
10
|
+
private messages;
|
|
11
|
+
private summary;
|
|
12
|
+
constructor(opts: SummarizingMemoryOptions);
|
|
13
|
+
append(message: Message): Promise<void>;
|
|
14
|
+
all(): Message[];
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Memory } from '../core/Memory';
|
|
2
|
+
import type { Retriever } from '../rag/Retriever';
|
|
3
|
+
import type { Message } from '../core/types';
|
|
4
|
+
export interface VectorMemoryOptions {
|
|
5
|
+
retriever: Retriever;
|
|
6
|
+
topK?: number;
|
|
7
|
+
keepRecent?: number;
|
|
8
|
+
onAppend?(message: Message): void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare class VectorMemory implements Memory {
|
|
11
|
+
private readonly opts;
|
|
12
|
+
private messages;
|
|
13
|
+
constructor(opts: VectorMemoryOptions);
|
|
14
|
+
append(message: Message): Promise<void>;
|
|
15
|
+
all(): Promise<Message[]>;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Middleware } from '../core/Middleware';
|
|
2
|
+
export interface GuardrailVerdict {
|
|
3
|
+
allow: boolean;
|
|
4
|
+
replacement?: string;
|
|
5
|
+
reason?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Guardrail {
|
|
8
|
+
name: string;
|
|
9
|
+
checkInput?(text: string): GuardrailVerdict | Promise<GuardrailVerdict>;
|
|
10
|
+
checkOutput?(text: string): GuardrailVerdict | Promise<GuardrailVerdict>;
|
|
11
|
+
}
|
|
12
|
+
export declare class GuardrailViolation extends Error {
|
|
13
|
+
readonly guardrailName: string;
|
|
14
|
+
readonly reason: string;
|
|
15
|
+
constructor(guardrailName: string, reason: string);
|
|
16
|
+
}
|
|
17
|
+
export declare function checkGuardrails(text: string, guardrails: Guardrail[], direction: 'input' | 'output'): Promise<GuardrailVerdict>;
|
|
18
|
+
export declare function guardrailsMiddleware(guardrails: Guardrail[]): Middleware;
|
|
19
|
+
export declare const piiRedactor: Guardrail;
|
|
20
|
+
export declare const promptInjectionDetector: Guardrail;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Middleware } from '../core/Middleware';
|
|
2
|
+
export interface OTelSpan {
|
|
3
|
+
end(attrs?: Record<string, unknown>): void;
|
|
4
|
+
}
|
|
5
|
+
export interface OTelSink {
|
|
6
|
+
spanStart(name: string, attrs?: Record<string, unknown>): OTelSpan;
|
|
7
|
+
event(name: string, attrs?: Record<string, unknown>): void;
|
|
8
|
+
}
|
|
9
|
+
export interface OTelMiddlewareOptions {
|
|
10
|
+
sink: OTelSink;
|
|
11
|
+
serviceName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function otelMiddleware(opts: OTelMiddlewareOptions): Middleware;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Transport, TransportResponse } from '../core/Transport';
|
|
2
|
+
export interface RetryOptions {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
initialDelayMs?: number;
|
|
5
|
+
maxDelayMs?: number;
|
|
6
|
+
factor?: number;
|
|
7
|
+
jitter?: boolean;
|
|
8
|
+
retryOn?(res: TransportResponse): boolean;
|
|
9
|
+
retryOnError?(err: unknown): boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function withRetry(base: Transport, opts?: RetryOptions): Transport;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Middleware } from '../core/Middleware';
|
|
2
|
+
export interface TokenUsageTotals {
|
|
3
|
+
inputTokens: number;
|
|
4
|
+
outputTokens: number;
|
|
5
|
+
cachedInputTokens: number;
|
|
6
|
+
totalCostUSD: number;
|
|
7
|
+
byModel: Record<string, {
|
|
8
|
+
inputTokens: number;
|
|
9
|
+
outputTokens: number;
|
|
10
|
+
costUSD: number;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface TokenPricing {
|
|
14
|
+
inputPerMillion: number;
|
|
15
|
+
outputPerMillion: number;
|
|
16
|
+
cachedInputPerMillion?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface TokenUsageMiddlewareOptions {
|
|
19
|
+
pricing?: Record<string, TokenPricing>;
|
|
20
|
+
model?: string;
|
|
21
|
+
onUpdate?(totals: TokenUsageTotals): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function createTokenUsageTracker(opts?: TokenUsageMiddlewareOptions): {
|
|
24
|
+
middleware: Middleware;
|
|
25
|
+
totals(): TokenUsageTotals;
|
|
26
|
+
reset(): void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Agent } from '../core/Agent';
|
|
2
|
+
import { type Tool } from '../core/Tool';
|
|
3
|
+
export interface AgentAsToolOptions {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
agent: Agent;
|
|
7
|
+
inputDescription?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function agentAsTool(opts: AgentAsToolOptions): Tool<{
|
|
10
|
+
input: string;
|
|
11
|
+
}, string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChatOptions, Provider, StreamEvent } from '../core/Provider';
|
|
2
|
+
import { type Transport } from '../core/Transport';
|
|
3
|
+
export interface AnthropicProviderOptions {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
apiVersion?: string;
|
|
7
|
+
transport?: Transport;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AnthropicProvider implements Provider {
|
|
11
|
+
private readonly opts;
|
|
12
|
+
readonly name = "anthropic";
|
|
13
|
+
private readonly transport;
|
|
14
|
+
constructor(opts?: AnthropicProviderOptions);
|
|
15
|
+
stream(opts: ChatOptions): AsyncGenerator<StreamEvent>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChatOptions, Provider, StreamEvent } from '../core/Provider';
|
|
2
|
+
import { type Transport } from '../core/Transport';
|
|
3
|
+
export interface GeminiProviderOptions {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
transport?: Transport;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare class GeminiProvider implements Provider {
|
|
10
|
+
private readonly opts;
|
|
11
|
+
readonly name = "gemini";
|
|
12
|
+
private readonly transport;
|
|
13
|
+
constructor(opts?: GeminiProviderOptions);
|
|
14
|
+
stream(opts: ChatOptions): AsyncGenerator<StreamEvent>;
|
|
15
|
+
private buildUrl;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatOptions, Provider, StreamEvent } from '../core/Provider';
|
|
2
|
+
import { type Transport } from '../core/Transport';
|
|
3
|
+
export interface OllamaProviderOptions {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
transport?: Transport;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export declare class OllamaProvider implements Provider {
|
|
9
|
+
private readonly opts;
|
|
10
|
+
readonly name = "ollama";
|
|
11
|
+
private readonly transport;
|
|
12
|
+
constructor(opts?: OllamaProviderOptions);
|
|
13
|
+
stream(opts: ChatOptions): AsyncGenerator<StreamEvent>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChatOptions, Provider, StreamEvent } from '../core/Provider';
|
|
2
|
+
import { type Transport } from '../core/Transport';
|
|
3
|
+
export interface OpenAIProviderOptions {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
organization?: string;
|
|
7
|
+
transport?: Transport;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class OpenAIProvider implements Provider {
|
|
11
|
+
private readonly opts;
|
|
12
|
+
readonly name = "openai";
|
|
13
|
+
private readonly transport;
|
|
14
|
+
constructor(opts?: OpenAIProviderOptions);
|
|
15
|
+
stream(opts: ChatOptions): AsyncGenerator<StreamEvent>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RetrievalResult {
|
|
2
|
+
text: string;
|
|
3
|
+
score: number;
|
|
4
|
+
metadata?: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface RetrieveOptions {
|
|
7
|
+
topK?: number;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
filter?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface Retriever {
|
|
12
|
+
retrieve(query: string, opts?: RetrieveOptions): Promise<RetrievalResult[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Tool } from '../core/Tool';
|
|
2
|
+
import type { Retriever } from './Retriever';
|
|
3
|
+
export interface RetrievalToolOptions {
|
|
4
|
+
retriever: Retriever;
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
topK?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function retrievalTool(opts: RetrievalToolOptions): Tool<{
|
|
10
|
+
query: string;
|
|
11
|
+
}, string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AgentOptions } from '../core/Agent';
|
|
2
|
+
import type { Message } from '../core/types';
|
|
3
|
+
export interface UseAgentReturn {
|
|
4
|
+
messages: Message[];
|
|
5
|
+
streamingText: string;
|
|
6
|
+
isStreaming: boolean;
|
|
7
|
+
error: Error | null;
|
|
8
|
+
send(text: string): Promise<void>;
|
|
9
|
+
stop(): void;
|
|
10
|
+
reset(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useAgent(opts: AgentOptions): UseAgentReturn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChatOptions, Provider, StreamEvent } from '../core/Provider';
|
|
2
|
+
import type { Recording } from './recorder';
|
|
3
|
+
export interface ReplayProviderOptions {
|
|
4
|
+
recording: Recording;
|
|
5
|
+
delayMsBetweenEvents?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ReplayProvider implements Provider {
|
|
8
|
+
private readonly opts;
|
|
9
|
+
readonly name = "replay";
|
|
10
|
+
private readonly events;
|
|
11
|
+
constructor(opts: ReplayProviderOptions);
|
|
12
|
+
stream(_opts: ChatOptions): AsyncGenerator<StreamEvent>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentEvent } from '../core/events';
|
|
2
|
+
import type { Middleware } from '../core/Middleware';
|
|
3
|
+
export interface Recording {
|
|
4
|
+
events: AgentEvent[];
|
|
5
|
+
startedAt: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class Recorder {
|
|
8
|
+
private events;
|
|
9
|
+
private started;
|
|
10
|
+
record(event: AgentEvent): void;
|
|
11
|
+
snapshot(): Recording;
|
|
12
|
+
toJSONL(): string;
|
|
13
|
+
static fromJSONL(jsonl: string): Recording;
|
|
14
|
+
reset(): void;
|
|
15
|
+
asMiddleware(): Middleware;
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Provider } from '../core/Provider';
|
|
2
|
+
import type { Tool } from '../core/Tool';
|
|
3
|
+
import type { Retriever } from '../rag/Retriever';
|
|
4
|
+
export interface DeepResearchOptions {
|
|
5
|
+
provider: Provider;
|
|
6
|
+
model: string;
|
|
7
|
+
retriever?: Retriever;
|
|
8
|
+
tools?: Tool[];
|
|
9
|
+
maxSubtasks?: number;
|
|
10
|
+
concurrency?: number;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export interface ResearchPlan {
|
|
14
|
+
subtasks: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
question: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export interface SubFinding {
|
|
20
|
+
id: string;
|
|
21
|
+
question: string;
|
|
22
|
+
findings: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ResearchResult {
|
|
26
|
+
question: string;
|
|
27
|
+
plan: ResearchPlan;
|
|
28
|
+
subFindings: SubFinding[];
|
|
29
|
+
synthesis: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class DeepResearch {
|
|
32
|
+
private readonly opts;
|
|
33
|
+
constructor(opts: DeepResearchOptions);
|
|
34
|
+
run(question: string, signal?: AbortSignal): Promise<ResearchResult>;
|
|
35
|
+
private research;
|
|
36
|
+
}
|
|
37
|
+
export declare function createDeepResearch(opts: DeepResearchOptions): DeepResearch;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Citation {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
source?: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
score?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function extractCitations(text: string): Citation[];
|
|
9
|
+
export declare function mergeCitations(...lists: Citation[][]): Citation[];
|
|
10
|
+
export declare function formatCitationsList(citations: Citation[]): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentEvent } from '../core/events';
|
|
2
|
+
import { type Transport } from '../core/Transport';
|
|
3
|
+
export interface AgentClientOptions {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
transport?: Transport;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface AgentClient {
|
|
9
|
+
run(message: string, signal?: AbortSignal): AsyncIterable<AgentEvent>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createAgentClient(opts: AgentClientOptions): AgentClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AgentOptions } from '../core/Agent';
|
|
2
|
+
export interface CreateAgentRouteOptions {
|
|
3
|
+
agent: (req: Request) => AgentOptions | Promise<AgentOptions>;
|
|
4
|
+
parseInput?(req: Request, body: unknown): {
|
|
5
|
+
message: string;
|
|
6
|
+
} | Promise<{
|
|
7
|
+
message: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createAgentRoute(opts: CreateAgentRouteOptions): (req: Request) => Promise<Response>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Provider } from '../core/Provider';
|
|
2
|
+
import type { JSONSchema } from '../core/types';
|
|
3
|
+
export interface GenerateObjectOptions<T> {
|
|
4
|
+
provider: Provider;
|
|
5
|
+
model: string;
|
|
6
|
+
schema: JSONSchema;
|
|
7
|
+
prompt: string;
|
|
8
|
+
system?: string;
|
|
9
|
+
maxTokens?: number;
|
|
10
|
+
temperature?: number;
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
parse?(raw: unknown): T;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}
|
|
15
|
+
export declare class StructuredOutputError extends Error {
|
|
16
|
+
readonly raw: string;
|
|
17
|
+
constructor(message: string, raw: string);
|
|
18
|
+
}
|
|
19
|
+
export declare function generateObject<T = unknown>(opts: GenerateObjectOptions<T>): Promise<T>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
export type DataRecord = Record<string, string | number | null>;
|
|
3
|
+
export type ChartKind = 'bar' | 'line' | 'area' | 'pie' | 'scatter';
|
|
4
|
+
export type ColumnType = 'number' | 'string' | 'mixed';
|
|
5
|
+
export interface TkxDataExplorerProps {
|
|
6
|
+
initialData?: DataRecord[];
|
|
7
|
+
allowedCharts?: ChartKind[];
|
|
8
|
+
previewRows?: number;
|
|
9
|
+
chartHeight?: number;
|
|
10
|
+
onDataLoad?: (data: DataRecord[]) => void;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseCSV(text: string): string[][];
|
|
15
|
+
export declare function csvToRecords(rows: string[][]): DataRecord[];
|
|
16
|
+
export declare function inferColumnTypes(records: DataRecord[]): Record<string, ColumnType>;
|
|
17
|
+
export declare function TkxDataExplorer({ initialData, allowedCharts, previewRows, chartHeight, onDataLoad, style, className, }: TkxDataExplorerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,8 @@ export { TkxPieChart } from './TkxPieChart';
|
|
|
5
5
|
export { TkxDonutChart } from './TkxDonutChart';
|
|
6
6
|
export { TkxScatterChart } from './TkxScatterChart';
|
|
7
7
|
export { TkxRadarChart } from './TkxRadarChart';
|
|
8
|
+
export { TkxDataExplorer, parseCSV, csvToRecords, inferColumnTypes, } from './TkxDataExplorer';
|
|
9
|
+
export type { TkxDataExplorerProps, DataRecord, ChartKind, ColumnType, } from './TkxDataExplorer';
|
|
8
10
|
export type { TkxAreaChartProps } from './TkxAreaChart';
|
|
9
11
|
export type { TkxBarChartProps } from './TkxBarChart';
|
|
10
12
|
export type { TkxLineChartProps } from './TkxLineChart';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface TkxAccessibilityCheckerProps {
|
|
2
|
+
show?: boolean;
|
|
3
|
+
intervalMs?: number;
|
|
4
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
5
|
+
scope?: Element | null;
|
|
6
|
+
axeOptions?: Record<string, unknown>;
|
|
7
|
+
onScan?: (result: {
|
|
8
|
+
violations: number;
|
|
9
|
+
impacts: Record<string, number>;
|
|
10
|
+
}) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function TkxAccessibilityChecker({ show, intervalMs, position, scope, axeOptions, onScan, }: TkxAccessibilityCheckerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
export interface TkxAppBarProps {
|
|
3
3
|
title?: ReactNode;
|
|
4
|
+
leading?: ReactNode;
|
|
4
5
|
logo?: ReactNode;
|
|
5
6
|
actions?: ReactNode;
|
|
6
7
|
navigation?: ReactNode;
|
|
@@ -8,4 +9,4 @@ export interface TkxAppBarProps {
|
|
|
8
9
|
variant?: 'default' | 'transparent' | 'elevated';
|
|
9
10
|
color?: 'primary' | 'surface';
|
|
10
11
|
}
|
|
11
|
-
export declare function TkxAppBar({ title, logo, actions, navigation, position, variant, color, }: TkxAppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function TkxAppBar({ title, leading, logo, actions, navigation, position, variant, color, }: TkxAppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,5 +12,6 @@ export interface TkxButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
12
12
|
rightIcon?: ReactNode;
|
|
13
13
|
isFullWidth?: boolean;
|
|
14
14
|
glow?: boolean;
|
|
15
|
+
isDisabled?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare const TkxButton: import("react").ForwardRefExoticComponent<TkxButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface CommandPaletteCommand {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
section?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
shortcut?: string[];
|
|
9
|
+
data?: unknown;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
onSelect?: (cmd: CommandPaletteCommand) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface CommandHotkey {
|
|
14
|
+
ctrl?: boolean;
|
|
15
|
+
shift?: boolean;
|
|
16
|
+
alt?: boolean;
|
|
17
|
+
key: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TkxCommandPaletteProps {
|
|
20
|
+
commands: CommandPaletteCommand[];
|
|
21
|
+
hotkey?: CommandHotkey | null;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
onSelect?: (cmd: CommandPaletteCommand) => void;
|
|
26
|
+
recents?: boolean;
|
|
27
|
+
maxRecents?: number;
|
|
28
|
+
emptyState?: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function fuzzyScore(query: string, text: string): number | null;
|
|
32
|
+
export declare function TkxCommandPalette({ commands, hotkey, open: controlledOpen, onOpenChange, placeholder, onSelect, recents, maxRecents, emptyState, className, }: TkxCommandPaletteProps): import("react").ReactPortal | null;
|