* chore: repo-wide bloat sweep, remove dead code and fold duplicate helpers Remove 33 dead files, ~270 unreferenced exports/types, 13 dead i18n namespaces and 4 unused dependencies; fold byte-identical helper copies into one canonical home each (lib/utils chunk/sleep/utcDateStamp, lib/dates/iso, lib/invariants/uuid, lib/xml/escape, lib/reports/sru/format, lib/pdf/number-text, lib/browser/panel-request, lib/api/v1/body + v1ValidationError rolled out to ~55 v1 routes, booking-template schemas). No behaviour change: v1 bodies and status codes, MCP tool schemas, DB writes and money math are untouched. Naive ore rounding was deliberately not swapped for roundOre; see DECISIONS.md 2026-09-02 for the full list of things left alone on purpose. tsc, lint, 19588 unit tests and check:guards green; antipattern baseline ratcheted (naive-ore-round 622 -> 620, hand-rolled-invariant 115 -> 113). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(transactions): import RawTransaction from @/types after the ingest re-export removal CI's type ratchet (check:types, full tsconfig) caught the one test file that still imported the type through lib/transactions/ingest. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
43 lines
1.5 KiB
TypeScript
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)
|
|
}
|