Files
accounted/lib/agent/intents/registry.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

43 lines
1.5 KiB
TypeScript

import type { AgentIntent } from './types'
import { generalHelp } from './general-help'
import { transactionCategorization } from './transaction-categorization'
import { inboxBulkBook } from './inbox-bulk-book'
import { invoiceDraft } from './invoice-draft'
import { supplierInvoiceReview } from './supplier-invoice-review'
import { vatReview } from './vat-review'
import { bokslutStep } from './bokslut-step'
import { verifikationDraft } from './verifikation-draft'
import { kpiExplain } from './kpi-explain'
import { settingsHelp } from './settings-help'
import { onboardingEmpty } from './onboarding-empty'
import { onboardingIntake } from './onboarding-intake'
// Static intent table. Adding a new intent: write a file under
// lib/agent/intents/<id>.ts that calls defineAgentIntent({...}), import it
// here, append it to INTENTS, and it's reachable from /api/agent/invoke.
// Plan refs: §8 (intent system).
//
// Using a static table (not a registry singleton) on purpose: intents are
// pure code, not data. Their lifetime matches the deployment.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const INTENTS: AgentIntent<any, any>[] = [
generalHelp,
transactionCategorization,
inboxBulkBook,
invoiceDraft,
supplierInvoiceReview,
vatReview,
bokslutStep,
verifikationDraft,
kpiExplain,
settingsHelp,
onboardingEmpty,
onboardingIntake,
]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getIntent(id: string): AgentIntent<any, any> | undefined {
return INTENTS.find((i) => i.id === id)
}