Something went wrong. Try again.
A local-first event pipeline for independent agents, built on Jazz.
Something went wrong. Try again.
1.3 kB · 40 lines
TypeScript
1234567891011121314151617181920212223242526272829303132333435363738394041import fs from "node:fs/promises";import os from "node:os";import path from "node:path";import { randomUUID } from "node:crypto";import { JazzThoughtStore } from "../src/jazz/store.js";import type { InferenceBudgetPolicy } from "../src/store/types.js";
export const testDeclarationEnvironment: NodeJS.ProcessEnv = { THOUGHTSTREAM_LETTA_TELEGRAM_AGENT_ID: "agent-telegram-fixture", THOUGHTSTREAM_TINKER_ESCALATION_MODEL: "fixture/escalation-model",};
export async function temporaryProject(prefix = "thoughtstream-test-"): Promise<string> { return fs.mkdtemp(path.join(os.tmpdir(), prefix));}
export function testInferenceAccountingPolicy(maxCalls = 100): InferenceBudgetPolicy { return { leaseMs: 180_000, reservation: { inputTokens: 1_000, outputTokens: 100, costMicrousd: 10_000 }, limits: [{ window: "rolling", durationMs: 3_600_000, maxCalls, maxInputTokens: maxCalls * 1_000, maxOutputTokens: maxCalls * 100, maxCostMicrousd: maxCalls * 10_000, }], };}
export async function testStore( projectRoot: string,): Promise<JazzThoughtStore> { return JazzThoughtStore.open({ projectRoot, appId: `thoughtstream-test-${randomUUID()}`, runtimeRevision: "test", });}