Files
accounted/extensions/general/mcp-server/resources/ledger-context.ts
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

22 lines
1.1 KiB
TypeScript

import type { McpResource } from './types'
import { buildLedgerContext } from '@/lib/agent-context/ledger-context'
/**
* How this company books things, derived from the ledger itself: account
* usage, counterparty + supplier booking patterns (with count-grounded
* evidence), user-authored rules, observed VAT profile, and conventions.
* Sibling of company-current (state now vs patterns over time); zero field
* overlap.
*
* Read-only and per-request; caching is deferred until measured slow
* (dev_docs/ledger_context_resource.md).
*/
export const ledgerContextResource: McpResource = {
uri: 'Accounted://ledger/context',
name: 'Ledger Context',
description:
'How this company books things: account usage, counterparty and supplier booking patterns with count-grounded evidence, explicit rules, observed VAT profile, conventions. Read before categorizing or creating vouchers; prefer these patterns over guesses. Explicit rules outrank observed patterns.',
mimeType: 'application/json',
read: async ({ supabase, companyId }) => buildLedgerContext(supabase, companyId),
}