# Source ingest

Add knowledge: drop files, paste a link, or paste text (meeting notes, a process description). What's added is read and shown in Sources; nothing here claims it was understood until the read finishes.

- Registry name: `source-ingest` (`@candor/source-ingest`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/source-ingest

## Install

```bash
npx candor-ui add source-ingest
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/source-ingest`.
It brings in: button, input, locale, utils.
npm packages: lucide-react@^1.67.0, radix-ui@^1.8.1.

## Example

```tsx
"use client"

import { SourceIngest } from "@/components/source-ingest"

export default function Example() {
  return <SourceIngest className="max-w-md" onFiles={() => {}} onLink={() => {}} onText={() => {}} />
}
```

## <SourceIngest>

Props:

- `onFiles: (files: File[]) => void`: Called with the files a person dropped or chose.
- `onLink: (url: string) => void`: Called with a pasted link when it's added.
- `onText: (title: string, text: string) => void`: Called with the title and body of pasted text when it's added.
- `accept?: string | undefined` (default `".pdf,.docx,.md,.txt,.csv,.xlsx"`): File types the picker offers, as in the input accept attribute.
- `className?: string | undefined`

## Strings (`sourceIngest`)

The fixed words, English by default. Override any of them under `sourceIngest` in `<LocaleProvider strings={{ sourceIngest: { … } }}>`; the table is exported as `sourceIngestStrings`.

- `label`: Add knowledge
- `addFrom`: Add from
- `files`: Files
- `link`: Link
- `text`: Text
- `drop`: Drop process docs, architecture notes or spreadsheets
- `fileTypes`: PDF, Word, Markdown, text, CSV or Excel
- `chooseFiles`: Choose files
- `addLink`: Add link
- `pastedText`: Pasted text
- `titlePlaceholder`: Title, e.g. Q4 territory rules
- `title`: Title
- `textPlaceholder`: Paste notes, a process description, a decision…
- `addText`: Add text

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
