import { schema as s } from "jazz-tools"; import { inferenceAccountingEnabled, thoughtstreamApp } from "./schema.js"; /** Local development policy. Remote deployment must replace this permissive policy. */ export const thoughtstreamPermissions = s.definePermissions(thoughtstreamApp, ({ policy }) => { const tables = [ policy.events, policy.documentVersions, policy.documents, policy.sources, policy.sourceCursors, policy.agents, policy.runs, policy.traceChunks, policy.consumerProgress, policy.projections, ...(inferenceAccountingEnabled ? [policy.inferenceBudgetAccounts, policy.inferenceAccounting] : []), ]; for (const table of tables) { table.allowRead.always(); table.allowInsert.always(); table.allowUpdate.always(); table.allowDelete.always(); } }); export default thoughtstreamPermissions;