@fenixforce/kernel 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.
- package/dist/agent/execution-result.d.ts +27 -0
- package/dist/agent-loop.d.ts +55 -0
- package/dist/api/dashboard.d.ts +260 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/middleware.d.ts +46 -0
- package/dist/api/openai-compat.d.ts +163 -0
- package/dist/api/server.d.ts +44 -0
- package/dist/api/streaming.d.ts +15 -0
- package/dist/api/webhook-triggers.d.ts +139 -0
- package/dist/billing/cost-meter.d.ts +123 -0
- package/dist/billing/index.d.ts +2 -0
- package/dist/boot.d.ts +109 -0
- package/dist/channels/discord.d.ts +99 -0
- package/dist/channels/email.d.ts +88 -0
- package/dist/channels/http-api.d.ts +155 -0
- package/dist/channels/index.d.ts +20 -0
- package/dist/channels/mcp-channel.d.ts +75 -0
- package/dist/channels/mobile-hil.d.ts +88 -0
- package/dist/channels/openai-compat.d.ts +42 -0
- package/dist/channels/registry.d.ts +80 -0
- package/dist/channels/signal.d.ts +75 -0
- package/dist/channels/slack.d.ts +115 -0
- package/dist/channels/teams.d.ts +106 -0
- package/dist/channels/telegram.d.ts +164 -0
- package/dist/channels/types.d.ts +71 -0
- package/dist/channels/whatsapp.d.ts +83 -0
- package/dist/checkpoint.d.ts +77 -0
- package/dist/config/canary.d.ts +74 -0
- package/dist/config/constitution.d.ts +57 -0
- package/dist/config/defaults.d.ts +17 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/loader.d.ts +11 -0
- package/dist/config/provider-config.d.ts +29 -0
- package/dist/config/schema.d.ts +118 -0
- package/dist/config/steering-rules.d.ts +28 -0
- package/dist/content/chunker.d.ts +42 -0
- package/dist/content/entity-extractor.d.ts +58 -0
- package/dist/content/index.d.ts +8 -0
- package/dist/content/ocr.d.ts +79 -0
- package/dist/content/pipeline.d.ts +153 -0
- package/dist/context-overflow.d.ts +19 -0
- package/dist/editions/mobile.d.ts +12 -0
- package/dist/editions/pro.d.ts +12 -0
- package/dist/editions/voices.d.ts +14 -0
- package/dist/events/block-manager.d.ts +37 -0
- package/dist/events/bus.d.ts +39 -0
- package/dist/events/index.d.ts +8 -0
- package/dist/events/session-manager.d.ts +59 -0
- package/dist/events/stream-adapter.d.ts +24 -0
- package/dist/events/types.d.ts +465 -0
- package/dist/events/websocket.d.ts +34 -0
- package/dist/extensions/defaults/05-session-repair.d.ts +6 -0
- package/dist/extensions/defaults/10-logging.d.ts +6 -0
- package/dist/extensions/defaults/15-loop-guard.d.ts +6 -0
- package/dist/extensions/defaults/20-cost-tracking.d.ts +7 -0
- package/dist/extensions/defaults/25-ssrf-protection.d.ts +6 -0
- package/dist/extensions/defaults/30-rate-limiting.d.ts +6 -0
- package/dist/extensions/defaults/35-shell-bleed.d.ts +6 -0
- package/dist/extensions/defaults/40-observation-capture.d.ts +7 -0
- package/dist/extensions/defaults/45-context-survival.d.ts +6 -0
- package/dist/extensions/defaults/50-context-budget.d.ts +6 -0
- package/dist/extensions/defaults/55-steering-rules.d.ts +7 -0
- package/dist/extensions/defaults/60-quality-gates.d.ts +7 -0
- package/dist/extensions/defaults/65-job-dispatch.d.ts +24 -0
- package/dist/extensions/defaults/70-skill-loader.d.ts +18 -0
- package/dist/extensions/hooks.d.ts +74 -0
- package/dist/extensions/index.d.ts +21 -0
- package/dist/extensions/intervention.d.ts +59 -0
- package/dist/extensions/manager.d.ts +63 -0
- package/dist/extensions/runner.d.ts +63 -0
- package/dist/hooks/hook-manager.d.ts +39 -0
- package/dist/hooks/hook-types.d.ts +60 -0
- package/dist/identity/assembler.d.ts +45 -0
- package/dist/identity/ccc-adapter.d.ts +33 -0
- package/dist/identity/index.d.ts +6 -0
- package/dist/identity/persona-parser.d.ts +24 -0
- package/dist/identity/soul-parser.d.ts +23 -0
- package/dist/identity/user-populator.d.ts +20 -0
- package/dist/index.d.ts +227 -0
- package/dist/index.js +579 -0
- package/dist/interrupt.d.ts +84 -0
- package/dist/job-queue.d.ts +69 -0
- package/dist/jobs/index.d.ts +12 -0
- package/dist/jobs/memory-queue.d.ts +23 -0
- package/dist/jobs/planned-tasks.d.ts +121 -0
- package/dist/jobs/queue.d.ts +79 -0
- package/dist/jobs/router.d.ts +23 -0
- package/dist/jobs/synthesize-memories.d.ts +26 -0
- package/dist/jobs/types.d.ts +47 -0
- package/dist/jobs/worker-pool.d.ts +25 -0
- package/dist/jobs/worker.d.ts +40 -0
- package/dist/loop/autonomous-controller.d.ts +91 -0
- package/dist/loop/backpressure.d.ts +64 -0
- package/dist/loop/fresh-context.d.ts +48 -0
- package/dist/loop/prd-importer.d.ts +134 -0
- package/dist/loop/stop-controller.d.ts +31 -0
- package/dist/loop-guard.d.ts +32 -0
- package/dist/mcp/tool-executor.d.ts +57 -0
- package/dist/memory/brain-artifacts.d.ts +25 -0
- package/dist/memory/dual-search.d.ts +67 -0
- package/dist/memory/episodic.d.ts +45 -0
- package/dist/memory/index.d.ts +27 -0
- package/dist/memory/knowledge-graph.d.ts +89 -0
- package/dist/memory/markdown-store.d.ts +64 -0
- package/dist/memory/metadata-filter.d.ts +29 -0
- package/dist/memory/mid-conversation-saves.d.ts +17 -0
- package/dist/memory/note-parser.d.ts +34 -0
- package/dist/memory/observation-store.d.ts +36 -0
- package/dist/memory/observation-thresholds.d.ts +26 -0
- package/dist/memory/progressive-search.d.ts +25 -0
- package/dist/memory/synthesis.d.ts +36 -0
- package/dist/memory/tree-index.d.ts +104 -0
- package/dist/memory/write-gate.d.ts +63 -0
- package/dist/mission-control.d.ts +34 -0
- package/dist/pre-classifier-widgets.d.ts +40 -0
- package/dist/pre-classifier.d.ts +19 -0
- package/dist/prompt/context-budget.d.ts +68 -0
- package/dist/prompt/index.d.ts +3 -0
- package/dist/prompt/system-prompt.d.ts +32 -0
- package/dist/prompt/templates.d.ts +11 -0
- package/dist/providers/anthropic.d.ts +24 -0
- package/dist/providers/auto-detect.d.ts +16 -0
- package/dist/providers/auto-discover.d.ts +28 -0
- package/dist/providers/bedrock.d.ts +38 -0
- package/dist/providers/cache-strategy.d.ts +58 -0
- package/dist/providers/circuit-breaker.d.ts +33 -0
- package/dist/providers/cost-meter.d.ts +74 -0
- package/dist/providers/cost-tracking.d.ts +36 -0
- package/dist/providers/google.d.ts +35 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/interface.d.ts +98 -0
- package/dist/providers/json-repair.d.ts +10 -0
- package/dist/providers/key-rotation.d.ts +36 -0
- package/dist/providers/manager.d.ts +64 -0
- package/dist/providers/model-registry.d.ts +50 -0
- package/dist/providers/openai-compatible.d.ts +26 -0
- package/dist/providers/optimization-modes.d.ts +38 -0
- package/dist/providers/provider-manager.d.ts +71 -0
- package/dist/providers/runtime-crud.d.ts +68 -0
- package/dist/providers/sidecar-lifecycle.d.ts +40 -0
- package/dist/providers/stream-wrapper.d.ts +21 -0
- package/dist/providers/structured-verify.d.ts +31 -0
- package/dist/providers/versioning.d.ts +18 -0
- package/dist/quality-gates.d.ts +10 -0
- package/dist/scheduler/engine.d.ts +95 -0
- package/dist/scheduler/index.d.ts +4 -0
- package/dist/scheduler/webhook-handler.d.ts +37 -0
- package/dist/sdk/agent.d.ts +22 -0
- package/dist/sdk/cli.d.ts +2 -0
- package/dist/sdk/client.d.ts +19 -0
- package/dist/sdk/index.d.ts +24 -0
- package/dist/sdk/jobs.d.ts +25 -0
- package/dist/sdk/memory.d.ts +18 -0
- package/dist/sdk/types.d.ts +69 -0
- package/dist/security/approval-gates.d.ts +166 -0
- package/dist/security/content-wrapper.d.ts +38 -0
- package/dist/security/guard-rails.d.ts +6 -0
- package/dist/security/index.d.ts +21 -0
- package/dist/security/instruction-hierarchy.d.ts +109 -0
- package/dist/security/pii-tokenizer.d.ts +30 -0
- package/dist/security/reputation.d.ts +53 -0
- package/dist/security/secret-store.d.ts +41 -0
- package/dist/security/security-engine.d.ts +53 -0
- package/dist/security/shell-bleed.d.ts +15 -0
- package/dist/security/ssrf.d.ts +12 -0
- package/dist/security/taint-tracker.d.ts +63 -0
- package/dist/security/tool-access-control.d.ts +114 -0
- package/dist/session-compaction.d.ts +20 -0
- package/dist/session-orient.d.ts +22 -0
- package/dist/session-repair.d.ts +6 -0
- package/dist/storage/index.d.ts +24 -0
- package/dist/storage/interface.d.ts +245 -0
- package/dist/storage/postgres.d.ts +6 -0
- package/dist/storage/sqlite.d.ts +2 -0
- package/dist/streaming/reasoning.d.ts +67 -0
- package/dist/task-tracker.d.ts +26 -0
- package/dist/testing/action-cache.d.ts +39 -0
- package/dist/testing/incident-eval.d.ts +49 -0
- package/dist/testing/workflow-evals.d.ts +73 -0
- package/dist/tools/access-control.d.ts +60 -0
- package/dist/tools/browser-engine.d.ts +73 -0
- package/dist/tools/builtins/jobs-router.d.ts +7 -0
- package/dist/tools/builtins/tasks-router.d.ts +25 -0
- package/dist/tools/index.d.ts +20 -0
- package/dist/tools/map-reduce.d.ts +64 -0
- package/dist/tools/registry.d.ts +39 -0
- package/dist/tools/router.d.ts +30 -0
- package/dist/tools/routers/browser-router.d.ts +12 -0
- package/dist/tools/routers/code-router.d.ts +34 -0
- package/dist/tools/routers/file-router.d.ts +35 -0
- package/dist/tools/routers/memory-router.d.ts +21 -0
- package/dist/tools/routers/schedule-router.d.ts +31 -0
- package/dist/tools/routers/search-backends.d.ts +47 -0
- package/dist/tools/routers/task-router.d.ts +32 -0
- package/dist/tools/routers/web-router.d.ts +36 -0
- package/dist/tools/skill-discovery.d.ts +32 -0
- package/dist/tools/skill-loader.d.ts +76 -0
- package/dist/tools/skill-types.d.ts +21 -0
- package/dist/voice/audio-intelligence.d.ts +42 -0
- package/dist/voice/barge-in.d.ts +51 -0
- package/dist/voice/index.d.ts +22 -0
- package/dist/voice/marker-parser.d.ts +31 -0
- package/dist/voice/sidecar-manager.d.ts +68 -0
- package/dist/voice/speaker-focus.d.ts +41 -0
- package/dist/voice/speaker-voiceprint.d.ts +47 -0
- package/dist/voice/speech-intent.d.ts +51 -0
- package/dist/voice/speechmatics-stt.d.ts +77 -0
- package/dist/voice/speechmatics-tts.d.ts +39 -0
- package/dist/voice/stt-provider.d.ts +40 -0
- package/dist/voice/transcript.d.ts +19 -0
- package/dist/voice/turn-detection.d.ts +53 -0
- package/dist/wrapup.d.ts +15 -0
- package/package.json +39 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optimization Modes — route requests to providers based on
|
|
3
|
+
* speed, cost, or quality preference.
|
|
4
|
+
*
|
|
5
|
+
* Configurable per workspace and overridable per conversation.
|
|
6
|
+
* Ties into model registry capabilities and pricing data.
|
|
7
|
+
*/
|
|
8
|
+
import type { ModelEntry, ModelRegistry } from "./model-registry.js";
|
|
9
|
+
export type OptimizationMode = "speed" | "cost" | "quality";
|
|
10
|
+
export interface OptimizationConfig {
|
|
11
|
+
/** Default mode for the workspace. */
|
|
12
|
+
defaultMode: OptimizationMode;
|
|
13
|
+
/** Per-conversation override (takes priority). */
|
|
14
|
+
conversationOverride?: OptimizationMode;
|
|
15
|
+
}
|
|
16
|
+
export interface RankedModel {
|
|
17
|
+
entry: ModelEntry;
|
|
18
|
+
score: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the active optimization mode from config.
|
|
22
|
+
* Conversation override takes priority over workspace default.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveMode(config: OptimizationConfig): OptimizationMode;
|
|
25
|
+
/**
|
|
26
|
+
* Rank models from the registry by the active optimization mode.
|
|
27
|
+
* Returns models sorted from best to worst for the given mode.
|
|
28
|
+
*/
|
|
29
|
+
export declare function rankModels(registry: ModelRegistry, mode: OptimizationMode, provider?: string): RankedModel[];
|
|
30
|
+
/**
|
|
31
|
+
* Pick the best model for a given optimization mode.
|
|
32
|
+
* Optionally filter by provider. Returns null if no models available.
|
|
33
|
+
*/
|
|
34
|
+
export declare function pickBestModel(registry: ModelRegistry, mode: OptimizationMode, provider?: string): ModelEntry | null;
|
|
35
|
+
/**
|
|
36
|
+
* Create an OptimizationConfig with defaults.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createOptimizationConfig(defaultMode?: OptimizationMode, conversationOverride?: OptimizationMode): OptimizationConfig;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ResolvedProviderConfig, ResolvedSlot } from "../config/provider-config.js";
|
|
2
|
+
import type { ProviderCapabilities } from "./interface.js";
|
|
3
|
+
import { ProviderCircuitBreaker } from "./circuit-breaker.js";
|
|
4
|
+
import { CostTrackingProvider } from "./cost-tracking.js";
|
|
5
|
+
export interface LLMProvider {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
complete(params: unknown): Promise<unknown>;
|
|
8
|
+
capabilities?(): ProviderCapabilities;
|
|
9
|
+
}
|
|
10
|
+
export type ProviderFactory = (slot: ResolvedSlot) => LLMProvider;
|
|
11
|
+
export type TaskType = "conversation" | "code_generation" | "memory_extraction" | "classification" | "embedding";
|
|
12
|
+
export interface ProviderManagerConfig {
|
|
13
|
+
/** Named provider slots, e.g. { chat: provider1, fast: provider2 } */
|
|
14
|
+
slots: Record<string, LLMProvider>;
|
|
15
|
+
/** Maps task type → preferred slot name, overrides DEFAULT_TASK_SLOTS */
|
|
16
|
+
routingPreferences?: Partial<Record<string, string>>;
|
|
17
|
+
/** Enable circuit breakers per slot (default: false) */
|
|
18
|
+
enableCircuitBreakers?: boolean;
|
|
19
|
+
/** Enable cost tracking wrappers (default: false) */
|
|
20
|
+
enableCostTracking?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare class ProviderManager {
|
|
23
|
+
private slots;
|
|
24
|
+
private routingPreferences;
|
|
25
|
+
private breakers;
|
|
26
|
+
private costTrackers;
|
|
27
|
+
constructor(config: ProviderManagerConfig);
|
|
28
|
+
/** Register or replace a named provider slot */
|
|
29
|
+
setSlot(name: string, provider: LLMProvider): void;
|
|
30
|
+
/** Get a provider by slot name, or undefined */
|
|
31
|
+
getSlot(name: string): LLMProvider | undefined;
|
|
32
|
+
/** Set a routing preference: taskType → slotName */
|
|
33
|
+
setPreference(taskType: string, slotName: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get the preferred provider for a task type.
|
|
36
|
+
*
|
|
37
|
+
* Resolution order:
|
|
38
|
+
* 1. "embedding" always routes to the "embed" slot (hard rule)
|
|
39
|
+
* 2. routingPreferences[taskType] → use that slot if it exists
|
|
40
|
+
* 3. DEFAULT_TASK_SLOTS[taskType] → use the default slot for this type
|
|
41
|
+
* 4. Fall back to "chat" slot
|
|
42
|
+
*
|
|
43
|
+
* At each step, if the resolved slot doesn't exist, continue to next.
|
|
44
|
+
* Throws if no provider can be resolved at all.
|
|
45
|
+
*/
|
|
46
|
+
getPreferred(taskType: string): LLMProvider;
|
|
47
|
+
/**
|
|
48
|
+
* Get a healthy provider for a slot (circuit breaker aware).
|
|
49
|
+
* Returns the slot's provider if its circuit breaker is closed or half-open.
|
|
50
|
+
* Returns undefined if the breaker is open.
|
|
51
|
+
*/
|
|
52
|
+
getHealthy(slotName: string): LLMProvider | undefined;
|
|
53
|
+
/** Get the circuit breaker for a slot (if enabled) */
|
|
54
|
+
getBreaker(slotName: string): ProviderCircuitBreaker | undefined;
|
|
55
|
+
/** Get the cost tracker for a slot (if enabled) */
|
|
56
|
+
getCostTracker(slotName: string): CostTrackingProvider | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Find a slot whose provider has a specific capability.
|
|
59
|
+
* Returns the first matching slot name, or undefined.
|
|
60
|
+
*/
|
|
61
|
+
findByCapability(capability: keyof ProviderCapabilities): LLMProvider | undefined;
|
|
62
|
+
/** List all registered slot names */
|
|
63
|
+
listSlots(): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Build a ProviderManager from a normalized config.
|
|
66
|
+
* Shares provider instances when multiple slots reference the same
|
|
67
|
+
* provider+apiKeys combination (v1.5 multi-modality).
|
|
68
|
+
*/
|
|
69
|
+
static fromConfig(resolved: ResolvedProviderConfig, factory: ProviderFactory, routingPreferences?: Partial<Record<string, string>>): ProviderManager;
|
|
70
|
+
private isFullProvider;
|
|
71
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime Provider CRUD — API endpoints for managing providers at runtime.
|
|
3
|
+
*
|
|
4
|
+
* POST /api/v1/providers — add a new provider configuration
|
|
5
|
+
* PUT /api/v1/providers/:id — update provider config
|
|
6
|
+
* DELETE /api/v1/providers/:id — remove provider
|
|
7
|
+
* POST /api/v1/providers/:id/test — test connectivity
|
|
8
|
+
*
|
|
9
|
+
* Validates credentials, runs health check, persists to encrypted
|
|
10
|
+
* credentials store. ~80 lines of logic.
|
|
11
|
+
*/
|
|
12
|
+
import type { ProviderSlot, LLMProvider } from "./interface.js";
|
|
13
|
+
import type { SecretStore } from "../security/secret-store.js";
|
|
14
|
+
export interface ProviderEntry {
|
|
15
|
+
id: string;
|
|
16
|
+
provider: string;
|
|
17
|
+
slot: ProviderSlot;
|
|
18
|
+
model?: string;
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateProviderInput {
|
|
24
|
+
/** Provider type (e.g. "anthropic", "openai", "google"). */
|
|
25
|
+
provider: string;
|
|
26
|
+
/** Slot to assign this provider to. */
|
|
27
|
+
slot: ProviderSlot;
|
|
28
|
+
/** API key. */
|
|
29
|
+
apiKey: string;
|
|
30
|
+
/** Optional model override. */
|
|
31
|
+
model?: string;
|
|
32
|
+
/** Optional base URL override. */
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface UpdateProviderInput {
|
|
36
|
+
slot?: ProviderSlot;
|
|
37
|
+
apiKey?: string;
|
|
38
|
+
model?: string;
|
|
39
|
+
baseUrl?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface TestResult {
|
|
42
|
+
ok: boolean;
|
|
43
|
+
latencyMs: number;
|
|
44
|
+
error?: string;
|
|
45
|
+
model?: string;
|
|
46
|
+
}
|
|
47
|
+
export type ProviderFactory = (type: string, config: {
|
|
48
|
+
apiKey: string;
|
|
49
|
+
model?: string;
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
}) => LLMProvider;
|
|
52
|
+
export interface RuntimeProviderCRUDConfig {
|
|
53
|
+
secretStore: SecretStore;
|
|
54
|
+
/** Factory to instantiate an LLMProvider from type + config. */
|
|
55
|
+
createProvider: ProviderFactory;
|
|
56
|
+
/** User ID that owns these providers (for secret store scoping). */
|
|
57
|
+
userId: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function _resetProviderIds(): void;
|
|
60
|
+
export interface RuntimeProviderCRUD {
|
|
61
|
+
create(input: CreateProviderInput): Promise<ProviderEntry>;
|
|
62
|
+
update(id: string, input: UpdateProviderInput): Promise<ProviderEntry | undefined>;
|
|
63
|
+
remove(id: string): Promise<boolean>;
|
|
64
|
+
test(id: string): Promise<TestResult>;
|
|
65
|
+
get(id: string): ProviderEntry | undefined;
|
|
66
|
+
list(): ProviderEntry[];
|
|
67
|
+
}
|
|
68
|
+
export declare function createRuntimeProviderCRUD(config: RuntimeProviderCRUDConfig): RuntimeProviderCRUD;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type Listener = (...args: any[]) => void;
|
|
2
|
+
declare class TypedEmitter {
|
|
3
|
+
private _listeners;
|
|
4
|
+
on(event: string, fn: Listener): this;
|
|
5
|
+
off(event: string, fn: Listener): this;
|
|
6
|
+
emit(event: string, ...args: unknown[]): boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SidecarConfig {
|
|
9
|
+
command: string;
|
|
10
|
+
healthEndpoint: string;
|
|
11
|
+
maxRestartAttempts: number;
|
|
12
|
+
failureCooldownMs: number;
|
|
13
|
+
backoffMultiplier: number;
|
|
14
|
+
maxCooldownMs: number;
|
|
15
|
+
fallbackProvider?: string;
|
|
16
|
+
}
|
|
17
|
+
export type SidecarState = "running" | "starting" | "restarting" | "cooldown" | "probing" | "stopped";
|
|
18
|
+
export type StartFn = (command: string) => Promise<boolean>;
|
|
19
|
+
export type HealthCheckFn = (endpoint: string) => Promise<boolean>;
|
|
20
|
+
export declare class SidecarLifecycle extends TypedEmitter {
|
|
21
|
+
readonly config: SidecarConfig;
|
|
22
|
+
private _state;
|
|
23
|
+
private restartAttempts;
|
|
24
|
+
private cooldownCycle;
|
|
25
|
+
private cooldownTimer;
|
|
26
|
+
private startFn;
|
|
27
|
+
private healthCheckFn;
|
|
28
|
+
constructor(config: Partial<SidecarConfig> & Pick<SidecarConfig, "command">, startFn: StartFn, healthCheckFn: HealthCheckFn);
|
|
29
|
+
get state(): SidecarState;
|
|
30
|
+
get currentCooldownCycle(): number;
|
|
31
|
+
get currentRestartAttempts(): number;
|
|
32
|
+
get activeFallback(): string | null;
|
|
33
|
+
private setState;
|
|
34
|
+
start(): Promise<boolean>;
|
|
35
|
+
handleFailure(): Promise<void>;
|
|
36
|
+
private enterCooldown;
|
|
37
|
+
probe(): Promise<boolean>;
|
|
38
|
+
stop(): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ChatCompletionChunk {
|
|
2
|
+
id?: string;
|
|
3
|
+
choices: Array<{
|
|
4
|
+
delta: {
|
|
5
|
+
content?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
};
|
|
8
|
+
finish_reason: string | null;
|
|
9
|
+
index: number;
|
|
10
|
+
}>;
|
|
11
|
+
usage?: {
|
|
12
|
+
prompt_tokens?: number;
|
|
13
|
+
completion_tokens?: number;
|
|
14
|
+
total_tokens?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface TokenUsage {
|
|
18
|
+
input: number;
|
|
19
|
+
output: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function createOpenAICompatibleStream(response: AsyncIterable<ChatCompletionChunk>, onTokens?: (usage: TokenUsage) => void): ReadableStream<Uint8Array>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured Output Verification — wraps generateObject with schema
|
|
3
|
+
* validation and retry logic.
|
|
4
|
+
*
|
|
5
|
+
* Calls the provider's generateObject, validates the result against
|
|
6
|
+
* a JSON schema, and retries up to 2x on validation failure.
|
|
7
|
+
* Logs schema violations for debugging.
|
|
8
|
+
*/
|
|
9
|
+
import type { LLMProvider, GenerateObjectParams } from "./interface.js";
|
|
10
|
+
export interface VerifyOptions {
|
|
11
|
+
/** Max retry attempts after validation failure (default: 2) */
|
|
12
|
+
maxRetries?: number;
|
|
13
|
+
/** Custom validation function — return null if valid, or error string */
|
|
14
|
+
validate?: (result: unknown) => string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface VerifyResult<T> {
|
|
17
|
+
data: T;
|
|
18
|
+
attempts: number;
|
|
19
|
+
violations: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generate a structured object with validation and retry.
|
|
23
|
+
*
|
|
24
|
+
* @throws Error if provider doesn't support generateObject
|
|
25
|
+
* @throws Error if validation fails after all retries
|
|
26
|
+
*/
|
|
27
|
+
export declare function verifiedGenerateObject<T = unknown>(provider: LLMProvider, params: GenerateObjectParams, options?: VerifyOptions): Promise<VerifyResult<T>>;
|
|
28
|
+
export declare class StructuredOutputError extends Error {
|
|
29
|
+
readonly violations: string[];
|
|
30
|
+
constructor(message: string, violations: string[]);
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Versioning — independent semver for voice sidecar binaries.
|
|
3
|
+
* Kernel checks compatibility range on startup to prevent broken updates
|
|
4
|
+
* when sidecar and kernel version independently.
|
|
5
|
+
*/
|
|
6
|
+
export interface VersionCompat {
|
|
7
|
+
sidecar: string;
|
|
8
|
+
kernelMin: string;
|
|
9
|
+
kernelMax: string;
|
|
10
|
+
}
|
|
11
|
+
export interface VersionCheckResult {
|
|
12
|
+
compatible: boolean;
|
|
13
|
+
sidecar: string;
|
|
14
|
+
kernel: string;
|
|
15
|
+
range: string;
|
|
16
|
+
}
|
|
17
|
+
/** Check if the current kernel version falls within a sidecar's compat range. */
|
|
18
|
+
export declare function checkCompatibility(kernelVersion: string, compat: VersionCompat): VersionCheckResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentEvent, TaskTracker } from "./events/types.js";
|
|
2
|
+
export type ConditionFn = () => boolean | Promise<boolean>;
|
|
3
|
+
export interface QualityGateInput {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
tracker: TaskTracker;
|
|
6
|
+
/** Map of taskId → condition function */
|
|
7
|
+
conditions: Record<string, ConditionFn>;
|
|
8
|
+
maxRetries?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function qualityGates(input: QualityGateInput): AsyncGenerator<AgentEvent>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler Engine — extends the planned-tasks scheduler with
|
|
3
|
+
* cron expressions, one-shot datetime scheduling, and recurring
|
|
4
|
+
* patterns. Manages progression by enqueuing steps into the job
|
|
5
|
+
* queue when their scheduled time arrives.
|
|
6
|
+
*
|
|
7
|
+
* Schedule types:
|
|
8
|
+
* - cron: Standard 5-field cron expression (min hour dom mon dow)
|
|
9
|
+
* - once: Single datetime execution
|
|
10
|
+
* - recurring: Interval-based repetition (every N ms)
|
|
11
|
+
*/
|
|
12
|
+
import { type PlannedTaskScheduler, type SchedulerJobQueue, type SchedulerEventListener } from "../jobs/planned-tasks.js";
|
|
13
|
+
export interface CronField {
|
|
14
|
+
type: "wildcard" | "value" | "range" | "list" | "step";
|
|
15
|
+
values: number[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse a standard 5-field cron expression into structured fields.
|
|
19
|
+
* Fields: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (0-6).
|
|
20
|
+
*
|
|
21
|
+
* Supports: *, N, N-M, N,M,O, *\/N (step)
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseCronExpression(expr: string): CronField[];
|
|
24
|
+
/**
|
|
25
|
+
* Get the next execution time after `after` that matches the cron expression.
|
|
26
|
+
*/
|
|
27
|
+
export declare function nextCronTime(fields: CronField[], after?: Date): Date;
|
|
28
|
+
export type ScheduleType = "cron" | "once" | "recurring";
|
|
29
|
+
export interface CronSchedule {
|
|
30
|
+
type: "cron";
|
|
31
|
+
/** Standard 5-field cron expression. */
|
|
32
|
+
expression: string;
|
|
33
|
+
/** Maximum number of executions (default: unlimited). */
|
|
34
|
+
maxExecutions?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface OnceSchedule {
|
|
37
|
+
type: "once";
|
|
38
|
+
/** When to execute. */
|
|
39
|
+
runAt: Date;
|
|
40
|
+
}
|
|
41
|
+
export interface RecurringSchedule {
|
|
42
|
+
type: "recurring";
|
|
43
|
+
/** Interval in ms between executions. */
|
|
44
|
+
intervalMs: number;
|
|
45
|
+
/** When to start. Defaults to now. */
|
|
46
|
+
startAt?: Date;
|
|
47
|
+
/** Maximum number of executions (default: unlimited). */
|
|
48
|
+
maxExecutions?: number;
|
|
49
|
+
}
|
|
50
|
+
export type Schedule = CronSchedule | OnceSchedule | RecurringSchedule;
|
|
51
|
+
export interface ScheduledEntry {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
schedule: Schedule;
|
|
55
|
+
jobType: string;
|
|
56
|
+
payload: Record<string, unknown>;
|
|
57
|
+
chatId?: string;
|
|
58
|
+
executionCount: number;
|
|
59
|
+
active: boolean;
|
|
60
|
+
nextRunAt: Date | null;
|
|
61
|
+
createdAt: Date;
|
|
62
|
+
}
|
|
63
|
+
export interface SchedulerEngineConfig {
|
|
64
|
+
/** Job queue to enqueue scheduled work into. */
|
|
65
|
+
queue: SchedulerJobQueue;
|
|
66
|
+
/** Override Date.now() for testing. */
|
|
67
|
+
nowFn?: () => number;
|
|
68
|
+
}
|
|
69
|
+
export declare function _resetEngineIds(): void;
|
|
70
|
+
export interface SchedulerEngine {
|
|
71
|
+
/** Schedule a new entry. Returns the entry. */
|
|
72
|
+
schedule(opts: {
|
|
73
|
+
name: string;
|
|
74
|
+
schedule: Schedule;
|
|
75
|
+
jobType: string;
|
|
76
|
+
payload?: Record<string, unknown>;
|
|
77
|
+
chatId?: string;
|
|
78
|
+
}): ScheduledEntry;
|
|
79
|
+
/** Cancel a scheduled entry. */
|
|
80
|
+
cancel(entryId: string): boolean;
|
|
81
|
+
/** Get an entry by ID. */
|
|
82
|
+
get(entryId: string): ScheduledEntry | undefined;
|
|
83
|
+
/** List all entries. */
|
|
84
|
+
list(): ScheduledEntry[];
|
|
85
|
+
/** Access the underlying planned-task scheduler. */
|
|
86
|
+
readonly taskScheduler: PlannedTaskScheduler;
|
|
87
|
+
/** Events passthrough to planned-task scheduler. */
|
|
88
|
+
on(listener: SchedulerEventListener): void;
|
|
89
|
+
off(listener: SchedulerEventListener): void;
|
|
90
|
+
/** Clean up all timers. */
|
|
91
|
+
dispose(): void;
|
|
92
|
+
}
|
|
93
|
+
export declare function createSchedulerEngine(config: SchedulerEngineConfig): SchedulerEngine;
|
|
94
|
+
export type { PlannedTask, PlannedStep, PlannedStepInput, PlannedStepStatus, PlannedTaskStatus, PlannedTaskScheduler, SchedulerJobQueue, SchedulerEventType, SchedulerEvent, SchedulerEventListener, CreatePlannedTaskInput, } from "../jobs/planned-tasks.js";
|
|
95
|
+
export { createPlannedTaskScheduler, _resetTaskIds } from "../jobs/planned-tasks.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createScheduledWebhookJob, isWebhookJob, createWebhookHandler, verifyGitHubSignature, verifyStripeSignature, verifyGenericAuth, safeEqual, extractWebhookContent, createWebhookEnvelope, } from "./webhook-handler.js";
|
|
2
|
+
export type { ScheduledWebhookJob, WebhookProvider, GitHubWebhookConfig, StripeWebhookConfig, GenericWebhookConfig, WebhookConfig, WebhookRegistration, WebhookRequest, WebhookResult, WebhookEventType, WebhookEvent, WebhookEventListener, WebhookJobQueue, WebhookHandlerConfig, WebhookHandler, WebhookMessageEnvelope, } from "./webhook-handler.js";
|
|
3
|
+
export { createSchedulerEngine, parseCronExpression, nextCronTime, createPlannedTaskScheduler, _resetTaskIds, _resetEngineIds, } from "./engine.js";
|
|
4
|
+
export type { CronField, ScheduleType, CronSchedule, OnceSchedule, RecurringSchedule, Schedule, ScheduledEntry, SchedulerEngineConfig, SchedulerEngine, PlannedTask, PlannedStep, PlannedStepInput, PlannedStepStatus, PlannedTaskStatus, PlannedTaskScheduler, SchedulerJobQueue, SchedulerEventType, SchedulerEvent, SchedulerEventListener, CreatePlannedTaskInput, } from "./engine.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Handler — creates `type: "webhook"` scheduled jobs from
|
|
3
|
+
* incoming POST /api/v1/webhooks/:id requests.
|
|
4
|
+
*
|
|
5
|
+
* This module re-exports the core webhook trigger machinery and adds
|
|
6
|
+
* the ScheduledWebhookJob type that integrates webhooks into the
|
|
7
|
+
* job queue + planned-tasks scheduler pipeline.
|
|
8
|
+
*
|
|
9
|
+
* Supported providers:
|
|
10
|
+
* - GitHub: SHA-256 HMAC via x-hub-signature-256
|
|
11
|
+
* - Stripe: Custom t=...,v1=... signature via stripe-signature
|
|
12
|
+
* - Generic: Bearer token, custom header, or IP allowlist
|
|
13
|
+
*
|
|
14
|
+
* All signature comparisons use crypto.timingSafeEqual.
|
|
15
|
+
*/
|
|
16
|
+
import type { WebhookMessageEnvelope, WebhookProvider } from "../api/webhook-triggers.js";
|
|
17
|
+
export interface ScheduledWebhookJob {
|
|
18
|
+
type: "webhook";
|
|
19
|
+
webhookId: string;
|
|
20
|
+
provider: WebhookProvider;
|
|
21
|
+
envelope: WebhookMessageEnvelope;
|
|
22
|
+
/** ISO timestamp of when the webhook was received. */
|
|
23
|
+
receivedAt: string;
|
|
24
|
+
/** Optional: schedule the webhook processing for a future time. */
|
|
25
|
+
scheduledAt?: Date;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Convert a webhook envelope into a ScheduledWebhookJob payload
|
|
29
|
+
* suitable for enqueuing into the job queue or planned-task scheduler.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createScheduledWebhookJob(webhookId: string, provider: WebhookProvider, envelope: WebhookMessageEnvelope, scheduledAt?: Date): ScheduledWebhookJob;
|
|
32
|
+
/**
|
|
33
|
+
* Type guard for ScheduledWebhookJob payloads extracted from a job queue.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isWebhookJob(payload: unknown): payload is ScheduledWebhookJob;
|
|
36
|
+
export { createWebhookHandler, verifyGitHubSignature, verifyStripeSignature, verifyGenericAuth, safeEqual, extractWebhookContent, createWebhookEnvelope, } from "../api/webhook-triggers.js";
|
|
37
|
+
export type { WebhookProvider, GitHubWebhookConfig, StripeWebhookConfig, GenericWebhookConfig, WebhookConfig, WebhookRegistration, WebhookRequest, WebhookResult, WebhookEventType, WebhookEvent, WebhookEventListener, WebhookJobQueue, WebhookHandlerConfig, WebhookHandler, WebhookMessageEnvelope, } from "../api/webhook-triggers.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FenixClient } from "./client.js";
|
|
2
|
+
import type { AgentOptions, AgentResult, StreamEvent } from "./types.js";
|
|
3
|
+
export declare class FenixAgent {
|
|
4
|
+
private client;
|
|
5
|
+
private options;
|
|
6
|
+
private sessionId;
|
|
7
|
+
constructor(client: FenixClient, options: AgentOptions);
|
|
8
|
+
/**
|
|
9
|
+
* Run a single-turn agent completion. Returns the full result.
|
|
10
|
+
*/
|
|
11
|
+
run(prompt: string): Promise<AgentResult>;
|
|
12
|
+
/**
|
|
13
|
+
* Stream a multi-turn agent session with real-time events.
|
|
14
|
+
*/
|
|
15
|
+
stream(prompt: string): AsyncGenerator<StreamEvent>;
|
|
16
|
+
/**
|
|
17
|
+
* Stop the current session.
|
|
18
|
+
*/
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
/** Get the current session ID. */
|
|
21
|
+
getSessionId(): string | null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FenixConfig } from "./types.js";
|
|
2
|
+
export declare class FenixClient {
|
|
3
|
+
private baseUrl;
|
|
4
|
+
private apiKey;
|
|
5
|
+
private timeout;
|
|
6
|
+
constructor(config: FenixConfig);
|
|
7
|
+
request<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
8
|
+
stream(method: string, path: string, body?: unknown): AsyncGenerator<string>;
|
|
9
|
+
get(path: string): Promise<unknown>;
|
|
10
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
11
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
12
|
+
delete(path: string): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare class FenixAPIError extends Error {
|
|
15
|
+
status: number;
|
|
16
|
+
body: string;
|
|
17
|
+
path: string;
|
|
18
|
+
constructor(status: number, body: string, path: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FenixAgent } from "./agent.js";
|
|
2
|
+
import { FenixJobs } from "./jobs.js";
|
|
3
|
+
import { FenixMemory } from "./memory.js";
|
|
4
|
+
import type { FenixConfig, AgentOptions } from "./types.js";
|
|
5
|
+
export declare class Fenix {
|
|
6
|
+
private client;
|
|
7
|
+
readonly jobs: FenixJobs;
|
|
8
|
+
readonly memory: FenixMemory;
|
|
9
|
+
constructor(config: FenixConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Create a headless agent session.
|
|
12
|
+
*/
|
|
13
|
+
createAgent(options: AgentOptions): FenixAgent;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a Fenix SDK instance from environment variables.
|
|
17
|
+
* Reads FENIX_API_URL and FENIX_API_KEY.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createFenix(overrides?: Partial<FenixConfig>): Fenix;
|
|
20
|
+
export { FenixClient, FenixAPIError } from "./client.js";
|
|
21
|
+
export { FenixAgent } from "./agent.js";
|
|
22
|
+
export { FenixJobs } from "./jobs.js";
|
|
23
|
+
export { FenixMemory } from "./memory.js";
|
|
24
|
+
export type { FenixConfig, AgentOptions, AgentResult, StreamEvent, ToolCallRecord, JobSubmission, JobStatus, MemoryEntry, MemorySearchOptions, MemoryWriteOptions, } from "./types.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FenixClient } from "./client.js";
|
|
2
|
+
import type { JobSubmission, JobStatus } from "./types.js";
|
|
3
|
+
export declare class FenixJobs {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: FenixClient);
|
|
6
|
+
/**
|
|
7
|
+
* Submit a background job.
|
|
8
|
+
*/
|
|
9
|
+
submit(job: JobSubmission): Promise<JobStatus>;
|
|
10
|
+
/**
|
|
11
|
+
* Wait for a job to complete or fail.
|
|
12
|
+
*/
|
|
13
|
+
wait(jobId: string, opts?: {
|
|
14
|
+
pollInterval?: number;
|
|
15
|
+
timeout?: number;
|
|
16
|
+
}): Promise<JobStatus>;
|
|
17
|
+
/**
|
|
18
|
+
* Get job status.
|
|
19
|
+
*/
|
|
20
|
+
status(jobId: string): Promise<JobStatus>;
|
|
21
|
+
/**
|
|
22
|
+
* Cancel a pending or running job.
|
|
23
|
+
*/
|
|
24
|
+
cancel(jobId: string): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FenixClient } from "./client.js";
|
|
2
|
+
import type { MemoryEntry, MemorySearchOptions, MemoryWriteOptions } from "./types.js";
|
|
3
|
+
export declare class FenixMemory {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: FenixClient);
|
|
6
|
+
/**
|
|
7
|
+
* Semantic search across memory entries.
|
|
8
|
+
*/
|
|
9
|
+
search(options: MemorySearchOptions): Promise<MemoryEntry[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Write a memory entry.
|
|
12
|
+
*/
|
|
13
|
+
write(options: MemoryWriteOptions): Promise<MemoryEntry>;
|
|
14
|
+
/**
|
|
15
|
+
* Delete a memory entry by ID.
|
|
16
|
+
*/
|
|
17
|
+
delete(id: string): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface FenixConfig {
|
|
2
|
+
/** Fenix HTTP API base URL */
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
/** API key (or set FENIX_API_KEY env var) */
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
/** Request timeout in ms */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface AgentOptions {
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
identity?: string;
|
|
12
|
+
tools?: string[];
|
|
13
|
+
systemPrompt?: string;
|
|
14
|
+
maxTurns?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface AgentResult {
|
|
17
|
+
sessionId: string;
|
|
18
|
+
response: string;
|
|
19
|
+
toolCalls: ToolCallRecord[];
|
|
20
|
+
tokenUsage: {
|
|
21
|
+
input: number;
|
|
22
|
+
output: number;
|
|
23
|
+
};
|
|
24
|
+
elapsedMs: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ToolCallRecord {
|
|
27
|
+
tool: string;
|
|
28
|
+
input: Record<string, unknown>;
|
|
29
|
+
output: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface StreamEvent {
|
|
32
|
+
type: "token" | "tool:start" | "tool:end" | "reasoning" | "response:final" | "error";
|
|
33
|
+
text?: string;
|
|
34
|
+
tool?: string;
|
|
35
|
+
toolInput?: Record<string, unknown>;
|
|
36
|
+
toolOutput?: unknown;
|
|
37
|
+
sessionId?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface JobSubmission {
|
|
41
|
+
type: string;
|
|
42
|
+
payload: Record<string, unknown>;
|
|
43
|
+
priority?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface JobStatus {
|
|
46
|
+
id: string;
|
|
47
|
+
type: string;
|
|
48
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
49
|
+
result?: unknown;
|
|
50
|
+
error?: string;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
completedAt?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface MemoryEntry {
|
|
55
|
+
id: string;
|
|
56
|
+
content: string;
|
|
57
|
+
metadata?: Record<string, unknown>;
|
|
58
|
+
score?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface MemorySearchOptions {
|
|
61
|
+
query: string;
|
|
62
|
+
topK?: number;
|
|
63
|
+
filter?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
export interface MemoryWriteOptions {
|
|
66
|
+
content: string;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
namespace?: string;
|
|
69
|
+
}
|