<haki_memory> block generated — zero runtime
dependency (native fetch, Node ≥ 18).
Installation
HakiClient
Promise<HealthResponse>
Promise<CaptureResponse>
events: EventInput[].Promise<ContextResponse>
Promise<TraceResponse>
Promise<TimelineResponse>
Promise<ConsolidateResponse>
Promise<ForgetResponse>
Promise<FeedbackResponse>
Promise<ResolveConflictResponse>
Promise<KeyCreatedResponse>
Promise<KeyListResponse>
Promise<KeyRevokedResponse>
snake_case (contract B.1 and route schemas): the
exported types (EventInput, CaptureResponse, ContextResponse…)
expose fields like project_id, source_event_ids, trace_id as-is —
only the method options are camelCase (projectId, subjectId…).
Typed errors
HakiConnectionError (network),
HakiApiError (statusCode, errorType, field, payload).
The two agent hooks (haki/runtime)
buildPromptContext produces text identical to the Python SDK (same
fixed instruction, same - predicate: value (valid from ...; sources: ...) format). captureTurn(client, { subjectId, projectId, userMsg, assistantMsg, orgId?, agentId?, threadId?, kind? }) writes a
conversation.turn event with idempotency_key: "turn-" + randomUUID().
CLI haki-ts
command
Tests
/health, writes ~/.haki/config.json.command
Full timed scenario, exit 0/1.
command
API health.
Runnable example
sdk/typescript/examples/basic-agent.mjs in the repository — a
complete minimal agent using HakiClient, buildPromptContext and
captureTurn.
