diff --git a/.github/workflows/changelog-guard.yml b/.github/workflows/changelog-guard.yml index 9ec468e5f..2bee6da77 100644 --- a/.github/workflows/changelog-guard.yml +++ b/.github/workflows/changelog-guard.yml @@ -2,11 +2,11 @@ name: Changelog guard on: pull_request: - types: [opened, edited, synchronize, reopened] + types: [opened, edited, synchronize, reopened, labeled, unlabeled] permissions: contents: read jobs: changelog: - uses: WireCatLabs/cli-base/.github/workflows/changelog-guard.yml@fe3430bae73bc7ccb5854124343fcb4549c26243 # cli-base main at #555: the guard accepts changes/ fragments + uses: WireCatLabs/cli-base/.github/workflows/changelog-guard.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0: the API report and `major` label rules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d277b12d6..29df9ca95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ permissions: jobs: ci: - uses: WireCatLabs/cli-base/.github/workflows/node-ci.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/node-ci.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: pack: ${{ inputs.pack || false }} # 588 test files took 250 s on one runner; `ci / coverage` merges the shards and holds the floor. Two, not four: diff --git a/.github/workflows/monthly.yml b/.github/workflows/monthly.yml index 48e53c491..dc1e122ab 100644 --- a/.github/workflows/monthly.yml +++ b/.github/workflows/monthly.yml @@ -20,7 +20,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: dependencies: true languages: '["actions","javascript-typescript","python","c-cpp","java-kotlin"]' diff --git a/.github/workflows/onnx.yml b/.github/workflows/onnx.yml index 26edceba0..6088bdcf8 100644 --- a/.github/workflows/onnx.yml +++ b/.github/workflows/onnx.yml @@ -21,7 +21,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: languages: '["actions","javascript-typescript","c-cpp"]' diff --git a/.github/workflows/parity.yml b/.github/workflows/parity.yml index 0f36c0183..15058b78b 100644 --- a/.github/workflows/parity.yml +++ b/.github/workflows/parity.yml @@ -138,6 +138,9 @@ jobs: run: pnpm ci:quick && pnpm test working-directory: cli + # Every CLI on a release (`tests`), the monthly run and a run by hand; a pull request and a push to main build the + # ones marked `pr`: the messengers the manifest and wording jobs read, the store's heaviest user, mail, a Google + # client and a CRM built from a config. Actions minutes are shared by every WireCat repository. downstream-list: runs-on: ubuntu-latest outputs: @@ -149,7 +152,11 @@ jobs: sparse-checkout: scripts/parity/downstream.json sparse-checkout-cone-mode: false - id: read - run: echo "clis=$(jq -c . scripts/parity/downstream.json)" >> "$GITHUB_OUTPUT" + env: + ALL: ${{ inputs.tests || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + run: | + echo "clis=$(jq -c 'if env.ALL == "true" then . else map(select(.pr)) end' scripts/parity/downstream.json)" \ + >> "$GITHUB_OUTPUT" # Each CLI that depends on cli-core, built against this checkout: what its own pull request would run first. A build, # typecheck or start that fails is a break and fails `downstream`; command lint and docs only warn: they flag cleanup @@ -292,7 +299,7 @@ jobs: # labelled `breaks-downstream` passes it with the broken CLIs named: a break made on purpose, said so in its body. # The label is read when the job runs, not from the event, so adding it and re-running this job is enough. downstream-result: - needs: downstream + needs: [downstream-list, downstream] if: always() runs-on: ubuntu-latest name: downstream @@ -308,6 +315,7 @@ jobs: merge-multiple: true - env: RESULT: ${{ needs.downstream.result }} + CLIS: ${{ needs.downstream-list.outputs.clis }} GH_TOKEN: ${{ github.token }} PR: ${{ github.event.pull_request.number }} LABEL: breaks-downstream diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fda50d9c3..b7126c227 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,7 +94,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: languages: '["actions","javascript-typescript","python","c-cpp","java-kotlin"]' @@ -231,7 +231,11 @@ jobs: with: name: package # Permit checking an already published version; this job has no publishing permissions. - - run: npm publish ./*.tgz --access public --dry-run --force + # A pre-release goes to the next tag: npm refuses one without a tag, and latest must stay a release. + - run: | + tag=latest + case "$(ls ./*.tgz)" in *[0-9]-*.tgz) tag=next ;; esac + npm publish ./*.tgz --access public --dry-run --force --tag "$tag" publish: needs: build @@ -254,7 +258,10 @@ jobs: # npm, not pnpm: npm's trusted publishing is the documented path. A tarball runs no # lifecycle scripts, and nothing is installed here. - - run: npm publish "wirecat-cli-core-$VERSION.tgz" --access public + - run: | + tag=latest + case "$VERSION" in *-*) tag=next ;; esac + npm publish "wirecat-cli-core-$VERSION.tgz" --access public --tag "$tag" - name: wait for npm to show the version if: ${{ !inputs.dry_run }} diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 3e2d69d28..a2963fb70 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -59,7 +59,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: dependencies: false languages: ${{ needs.languages.outputs.analyze }} diff --git a/.github/workflows/sqlite.yml b/.github/workflows/sqlite.yml index bd3255685..b5ecae7e3 100644 --- a/.github/workflows/sqlite.yml +++ b/.github/workflows/sqlite.yml @@ -25,7 +25,7 @@ jobs: contents: read actions: read security-events: write - uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@92f177f38b68ad8fa5eda46f72815648e211c795 # v0.98.0 + uses: WireCatLabs/cli-base/.github/workflows/release-checks.yml@29f6679fe6f90c335d0d1d080cbddeb1ba86fa7e # v1.0.0-rc.0 with: languages: '["actions","javascript-typescript","c-cpp"]' diff --git a/CHANGELOG.md b/CHANGELOG.md index 2701fbafb..abbf6ba12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0, minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the shape of this file. +## 1.0.0-rc.0 — 25.11.2026 + ## 0.753.0 — 25.11.2026 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index e2ae46fc5..d5325f170 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -69,9 +69,10 @@ Every pull request runs three checks. The fast standards job (`standards.yml`) c `CHANGELOG.md`, config integrity, lint, Markdown, `ci:quick` (the typecheck and the command lint) and the new commits for secrets. The pull request validation (`pr.yml`) runs the full Linux validation, `ci.yml`: lint, typecheck, the tests on two runners with the coverage floor checked on their merged report, build, `docs:check`, the schema and -dist checks, Bun, old Node, the SQLite restart and parity, which builds cli-template and every CLI in -`scripts/parity/downstream.json` against the branch, checking the manifests and wording of tg, max and wa on the -same builds. The security checks (`security.yml`) run zizmor, gitleaks and CodeQL of the workflows; CodeQL of the +dist checks, Bun, old Node, the SQLite restart and parity, which builds cli-template and the CLIs marked `pr` in +`scripts/parity/downstream.json` against the branch (a release builds and tests all of them), checking the +manifests and wording of tg, max and wa on the same builds. The security checks (`security.yml`) run zizmor, +gitleaks and CodeQL of the workflows; CodeQL of the code (javascript-typescript, python, c-cpp, java-kotlin) runs only in the release's `checks` and the monthly run, and the pull request reports those checks as passed. A pull request that changes only `CHANGELOG.md`, the `changes/` fragments and the version against a `main` already diff --git a/README.md b/README.md index 423609394..903b16d8f 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,10 @@ Acme. The search found "are you coming?" from the word "come", with no network. npm install --save-exact @wirecat/cli-core ``` -npm 7+ and pnpm also install its peers: `@wirecat/cli-base` in the range `package.json` names, and `commander` 15 or -later. `@napi-rs/canvas` is optional, and charts need it only for PNG output. It runs on Node 22.16+ and 24+, and on -Bun. Pin an exact version, because any release before 1.0 may break a caller ([Build on it](#build-on-it)). +npm 7+ and pnpm also install its peers: `@wirecat/cli-base` in the range `package.json` names, and `commander` 15. +`@napi-rs/canvas` is optional, and charts need it only for PNG output. It runs on Node 22.16+ and 24+, and on Bun. +The stable API follows semver. Names marked `@experimental`, and the entry points outside `wirecat.stable`, may +change in a minor ([Build on it](#build-on-it)). [Architecture](docs/dev/ARCHITECTURE.md) · [Write an adapter](docs/dev/ADAPTERS.md) · [Query language](docs/search/query-language.md) · [Messenger rules](docs/dev/STANDARD.md) · @@ -157,9 +158,11 @@ describe("the adapter keeps the port's promises", () => { }) ``` -**Before 1.0, any release may break a caller.** Releases are frequent, sometimes several a day, and any of them may -change any entry point. The [changelog](CHANGELOG.md) lists every such change in its own section, with what to change. -tg-cli and max-cli pin an exact version and move to a new one in their own pull request. Pin an exact version too. +**The stable API follows semver from 1.0.0.** The entry points in `wirecat.stable` (`package.json`) are stable, +except the names whose doc comment says `@experimental`; a break of them needs a major. Everything else is +experimental and may change in a minor, and releases are frequent, sometimes several a day. The +[changelog](CHANGELOG.md) lists every change that needs one, with what to change. Using only stable names, `^1.0.0` is +safe; using experimental ones, pin an exact version, as tg-cli and max-cli do. The full list of entry points and what each holds is in the [API reference](docs/REFERENCE.md). ⚠ **Errors are recognised by shape, not by class** (`isCliFailure`). A package linked during development brings its diff --git a/api/cli-start.api.txt b/api/cli-start.api.txt new file mode 100644 index 000000000..18a5a55d0 --- /dev/null +++ b/api/cli-start.api.txt @@ -0,0 +1,54 @@ +# @wirecat/cli-core "./cli/start": the stable API, written by cli-dev api-report. Do not edit. +AppIdentity · interface · export interface AppIdentity { +AppIdentity · interface · command: string; +AppIdentity · interface · appName: string; +AppIdentity · interface · envPrefix: string; +AppIdentity · interface · description: string; +AppIdentity · interface · version: string; +AppIdentity · interface · issues?: string; +AppIdentity · interface · locale?: string; +AppIdentity · interface · contentLanguages?: readonly string[]; +AppIdentity · interface · messenger?: boolean; +AppIdentity · interface · sends?: true; +AppIdentity · interface · requestMs?: number; +AppIdentity · interface · errors?: AppErrors; +AppIdentity · interface · } +CliEntry · interface · export interface CliEntry { +CliEntry · interface · app: AppIdentity; +CliEntry · interface · run: (entry: EntryContext) => Promise; +CliEntry · interface · fail: (error: unknown, entry: EntryContext) => number; +CliEntry · interface · interactive?: (args: readonly string[], tty: boolean) => boolean; +CliEntry · interface · reasons?: readonly ErrorReason[]; +CliEntry · interface · sqlite?: boolean; +CliEntry · interface · io?: Partial; +CliEntry · interface · } +EntryContext · interface · export interface EntryContext { +EntryContext · interface · args: string[]; +EntryContext · interface · env: NodeJS.ProcessEnv; +EntryContext · interface · tty: boolean; +EntryContext · interface · signal: AbortSignal; +EntryContext · interface · atStart: (command: Command) => Promise; +EntryContext · interface · ask: (question: string, command?: Command) => Promise; +EntryContext · interface · openBrowser: (url: string, browser?: string, command?: Command) => Promise; +EntryContext · interface · outputClosed: () => boolean; +EntryContext · interface · setExitCode: (code: number) => void; +EntryContext · interface · } +EntryIo · interface · export interface EntryIo { +EntryIo · interface · argv: readonly string[]; +EntryIo · interface · env: NodeJS.ProcessEnv; +EntryIo · interface · platform: NodeJS.Platform; +EntryIo · interface · stdin: NodeJS.ReadableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · stdout: NodeJS.WritableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · stderr: NodeJS.WritableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · signals: Pick; +EntryIo · interface · setExitCode: (code: number) => void; +EntryIo · interface · spawn: (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess; +EntryIo · interface · } +openBrowser · const · export declare const openBrowser: (url: string, browser?: string, io?: Pick) => Promise; +startCli · const · export declare const startCli: (entry: CliEntry) => Promise; diff --git a/api/cli.api.txt b/api/cli.api.txt new file mode 100644 index 000000000..ab3447f8e --- /dev/null +++ b/api/cli.api.txt @@ -0,0 +1,3271 @@ +# @wirecat/cli-core "./cli": the stable API, written by cli-dev api-report. Do not edit. +AGENTS · const · export declare const AGENTS: readonly ["none", "codex", "cursor", "claude", "gemini", "all"]; +AccountRemoval · interface · export interface AccountRemoval { +AccountRemoval · interface · signOut(profile: string, context: AccountRemovalContext): Promise; +AccountRemoval · interface · account?(profile: string, context: AccountRemovalContext): AccountKey | undefined; +AccountRemoval · interface · secrets?(profile: string, context: AccountRemovalContext): AccountSecrets[]; +AccountRemoval · interface · signIn?(profile: string, context: AccountRemovalContext): { +AccountRemoval · interface · secrets?: AccountSecrets[]; +AccountRemoval · interface · files?: string[]; +AccountRemoval · interface · }; +AccountRemoval · interface · stateFiles?(profile: string, context: AccountRemovalContext): string[]; +AccountRemoval · interface · dataFiles?(profile: string, context: AccountRemovalContext): string[]; +AccountRemoval · interface · forgetConfig?(profile: string, context: AccountRemovalContext): string[]; +AccountRemoval · interface · busy?(profile: string, context: AccountRemovalContext): string | undefined; +AccountRemoval · interface · ownFolders?(context: AccountRemovalContext): string[]; +AccountRemoval · interface · } +AccountRemovalContext · interface · export interface AccountRemovalContext { +AccountRemovalContext · interface · env: NodeJS.ProcessEnv; +AccountRemovalContext · interface · keyring?: KeyringStore; +AccountRemovalContext · interface · mayRevoke: boolean; +AccountRemovalContext · interface · } +AccountRemoveOptions · interface · export interface AccountRemoveOptions { +AccountRemoveOptions · interface · provider?: Provider; +AccountRemoveOptions · interface · resolveSettings?: (flags: GlobalFlags, options?: ResolveOptions) => Settings; +AccountRemoveOptions · interface · ownerHome?: string; +AccountRemoveOptions · interface · } +AccountSecrets · interface · export interface AccountSecrets { +AccountSecrets · interface · credentials: CredentialsOptions; +AccountSecrets · interface · accounts: readonly string[]; +AccountSecrets · interface · } +After · type · export type After = { +After · type · id: Id; +After · type · } | { +After · type · time: number; +After · type · }; +Agent · type · export type Agent = (typeof AGENTS)[number]; +AgentCli · type · export type AgentCli = Pick; +AgentInput · type · export type AgentInput = (schedule: Schedule, run: (argv: string[]) => Promise) => Promise; +AgentRun · interface · export interface AgentRun { +AgentRun · interface · result: (value: unknown) => void; +AgentRun · interface · failure: (error: ErrorObject) => void; +AgentRun · interface · overrides?: readonly string[]; +AgentRun · interface · authority?: boolean; +AgentRun · interface · botApi?: boolean; +AgentRun · interface · caller?: RunCaller; +AgentRun · interface · } +AnswerOutput · interface · export interface AnswerOutput { +AnswerOutput · interface · renderer: Renderer; +AnswerOutput · interface · format: RenderFormat; +AnswerOutput · interface · streams: Streams; +AnswerOutput · interface · compact?: boolean; +AnswerOutput · interface · full?: boolean; +AnswerOutput · interface · } +ApiCommandInput · interface · export interface ApiCommandInput { +ApiCommandInput · interface · path: Record; +ApiCommandInput · interface · query: Record; +ApiCommandInput · interface · headers: Record; +ApiCommandInput · interface · fields: Record; +ApiCommandInput · interface · body?: string; +ApiCommandInput · interface · bytes?: Uint8Array; +ApiCommandInput · interface · bodySource?: "argument" | "stdin" | "file"; +ApiCommandInput · interface · tokenProfile?: string; +ApiCommandInput · interface · selection?: string; +ApiCommandInput · interface · } +ApiCommands · interface · export interface ApiCommands { +ApiCommands · interface · operations: readonly ManifestOperation[]; +ApiCommands · interface · description?: string; +ApiCommands · interface · checkParameter: (name: string, schema: SchemaNode, raw: string) => string | undefined; +ApiCommands · interface · checkBody?: (operation: ManifestOperation, text: string | undefined) => string | undefined; +ApiCommands · interface · before?: (command: Command, operation: ManifestOperation) => void | Promise; +ApiCommands · interface · readBody?: (command: Command, options: { +ApiCommands · interface · body?: string; +ApiCommands · interface · bodyFile?: string; +ApiCommands · interface · }) => string | undefined; +ApiCommands · interface · readBytes?: (command: Command, path: string) => Uint8Array; +ApiCommands · interface · execute: (command: Command, operation: ManifestOperation, input: ApiCommandInput) => Promise; +ApiCommands · interface · configure?: (command: Command, operation: ManifestOperation) => void; +ApiCommands · interface · } +AppCompletionOptions · interface · export interface AppCompletionOptions { +AppCompletionOptions · interface · sources?: (request: CompletionRequest) => CompletionSources | undefined | Promise; +AppCompletionOptions · interface · } +AppDoctorOptions · interface · export interface AppDoctorOptions { +AppDoctorOptions · interface · oauthClient?: (env: NodeJS.ProcessEnv) => OAuthClientReport; +AppDoctorOptions · interface · packageName?: string; +AppDoctorOptions · interface · online?: (env: NodeJS.ProcessEnv) => Promise<{ +AppDoctorOptions · interface · ok: boolean; +AppDoctorOptions · interface · } & Record>; +AppDoctorOptions · interface · local?: (env: NodeJS.ProcessEnv) => { +AppDoctorOptions · interface · fields: Record; +AppDoctorOptions · interface · notes?: string[]; +AppDoctorOptions · interface · }; +AppDoctorOptions · interface · } +AppErrors · interface · export interface AppErrors { +AppErrors · interface · reasons?: readonly ErrorReason[]; +AppErrors · interface · details?: readonly string[]; +AppErrors · interface · } +AppIdentity · interface · export interface AppIdentity { +AppIdentity · interface · command: string; +AppIdentity · interface · appName: string; +AppIdentity · interface · envPrefix: string; +AppIdentity · interface · description: string; +AppIdentity · interface · version: string; +AppIdentity · interface · issues?: string; +AppIdentity · interface · locale?: string; +AppIdentity · interface · contentLanguages?: readonly string[]; +AppIdentity · interface · messenger?: boolean; +AppIdentity · interface · sends?: true; +AppIdentity · interface · requestMs?: number; +AppIdentity · interface · errors?: AppErrors; +AppIdentity · interface · } +AppMcpOptions · interface · export interface AppMcpOptions { +AppMcpOptions · interface · name: string; +AppMcpOptions · interface · untrusted: AppServerOptions["untrusted"]; +AppMcpOptions · interface · permissionExample: string; +AppMcpOptions · interface · skill?: URL; +AppMcpOptions · interface · availability?: AppServerOptions["availability"]; +AppMcpOptions · interface · signedIn?: (profile: string, env: NodeJS.ProcessEnv, keyring: KeyringStore | undefined) => boolean; +AppMcpOptions · interface · } +Attempt · interface · export interface Attempt { +Attempt · interface · attempt: number; +Attempt · interface · waitMs?: number; +Attempt · interface · } +BaseContext · interface · export interface BaseContext { +BaseContext · interface · settings: Settings; +BaseContext · interface · renderer: Renderer; +BaseContext · interface · format: RenderFormat; +BaseContext · interface · color: boolean; +BaseContext · interface · streams: Streams; +BaseContext · interface · compact?: boolean; +BaseContext · interface · full?: boolean; +BaseContext · interface · env: NodeJS.ProcessEnv; +BaseContext · interface · keyring?: KeyringStore; +BaseContext · interface · run: (body: (events: EventSink) => Promise, options?: { +BaseContext · interface · unbounded?: boolean; +BaseContext · interface · name?: string; +BaseContext · interface · }) => Promise; +BaseContext · interface · track: (closeable: Closeable) => void; +BaseContext · interface · } +BaseEnvironment · interface · export interface BaseEnvironment { +BaseEnvironment · interface · rows?: import("./compact.js").RowTable; +BaseEnvironment · interface · discoveryAvailability?: (command: import("./command-availability.js").AvailabilityCommand) => import("./command-availability.js").CommandAvailability | undefined; +BaseEnvironment · interface · streams?: Streams; +BaseEnvironment · interface · tty?: boolean; +BaseEnvironment · interface · env?: NodeJS.ProcessEnv; +BaseEnvironment · interface · keyring?: KeyringStore; +BaseEnvironment · interface · commandSignal?: AbortSignal; +BaseEnvironment · interface · signal?: AbortSignal; +BaseEnvironment · interface · trackCloseable?: (closeable: Closeable) => void; +BaseEnvironment · interface · stdin?: NodeJS.ReadableStream & { +BaseEnvironment · interface · isTTY?: boolean; +BaseEnvironment · interface · }; +BaseEnvironment · interface · answer?: (question: string) => Promise | string | null; +BaseEnvironment · interface · app?: AppIdentity; +BaseEnvironment · interface · resolveSettings?: (flags: GlobalFlags, options?: ResolveOptions) => Settings; +BaseEnvironment · interface · permissionDefaults?: Readonly>; +BaseEnvironment · interface · platform?: NodeJS.Platform; +BaseEnvironment · interface · recognizer?: OpenRecognizer; +BaseEnvironment · interface · storeLockWaitMs?: number; +BaseEnvironment · interface · closeWaitMs?: number; +BaseEnvironment · interface · rekeyPacing?: { +BaseEnvironment · interface · lockMs: number; +BaseEnvironment · interface · pauseMs: number; +BaseEnvironment · interface · }; +BaseEnvironment · interface · stdout?: NodeJS.WritableStream; +BaseEnvironment · interface · stderr?: NodeJS.WritableStream; +BaseEnvironment · interface · exit?: { +BaseEnvironment · interface · code?: number; +BaseEnvironment · interface · }; +BaseEnvironment · interface · runCommand?: (argv: string[], environment: BaseEnvironment) => Promise; +BaseEnvironment · interface · relayed?: RelayedRun; +BaseEnvironment · interface · handled?: (event: MessageEvent) => void; +BaseEnvironment · interface · startSyncDelayMs?: number; +BaseEnvironment · interface · outdated?: { +BaseEnvironment · interface · everyMs?: number; +BaseEnvironment · interface · packageRoot?: string; +BaseEnvironment · interface · }; +BaseEnvironment · interface · agent?: AgentRun; +BaseEnvironment · interface · argv?: readonly string[]; +BaseEnvironment · interface · untilStopped?: () => AbortSignal; +BaseEnvironment · interface · deadline?: () => Deadline | undefined; +BaseEnvironment · interface · endUntilStopped?: () => void; +BaseEnvironment · interface · } +Body · type · export type Body = ListBody | ItemBody; +BodyPermission · interface · export interface BodyPermission { +BodyPermission · interface · key: PermissionKey; +BodyPermission · interface · when: string; +BodyPermission · interface · applies: (body: unknown) => boolean; +BodyPermission · interface · } +BotAction · type · export type BotAction = (typeof BOT_ACTIONS)[number]; +BotAdapter · type · export type BotAdapter = Pick & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial & Partial; +BotCallbacks · interface · export interface BotCallbacks { +BotCallbacks · interface · answer(callbackId: string, answer: { +BotCallbacks · interface · notification?: string; +BotCallbacks · interface · text?: string; +BotCallbacks · interface · press?: BotPress; +BotCallbacks · interface · }): Promise; +BotCallbacks · interface · } +BotChatAdmin · interface · export interface BotChatAdmin extends Member { +BotChatAdmin · interface · role: "owner" | "admin"; +BotChatAdmin · interface · rights: AdminRight[]; +BotChatAdmin · interface · title: string | null; +BotChatAdmin · interface · } +BotChatAdmins · interface · export interface BotChatAdmins { +BotChatAdmins · interface · admins(chat: BotChatRef): Promise; +BotChatAdmins · interface · addAdmin(chat: BotChatRef, person: Id, rights: AdminRight[], options: { +BotChatAdmins · interface · title?: string; +BotChatAdmins · interface · }): Promise; +BotChatAdmins · interface · removeAdmin(chat: BotChatRef, person: Id): Promise; +BotChatAdmins · interface · } +BotChatMembers · interface · export interface BotChatMembers { +BotChatMembers · interface · removeMember(chat: BotChatRef, person: Id, options: { +BotChatMembers · interface · block: boolean; +BotChatMembers · interface · }): Promise; +BotChatMembers · interface · } +BotChatRef · type · export type BotChatRef = string; +BotChatTools · interface · export interface BotChatTools { +BotChatTools · interface · chat(chat: BotChatRef): Promise; +BotChatTools · interface · leave(chat: BotChatRef): Promise; +BotChatTools · interface · action(chat: BotChatRef, action: BotAction): Promise; +BotChatTools · interface · } +BotConnectOptions · interface · export interface BotConnectOptions { +BotConnectOptions · interface · stop?: AbortSignal; +BotConnectOptions · interface · events?: EventSink; +BotConnectOptions · interface · history?: { +BotConnectOptions · interface · from?: string; +BotConnectOptions · interface · pauseMs: number; +BotConnectOptions · interface · }; +BotConnectOptions · interface · track?: (client: Pick) => void; +BotConnectOptions · interface · } +BotEvent · type · export type BotEvent = (MessageEvent | BotNotice) & { +BotEvent · type · update?: BotUpdateRef; +BotEvent · type · }; +BotHistory · interface · export interface BotHistory { +BotHistory · interface · history(chat: BotChatRef, window: { +BotHistory · interface · limit: number; +BotHistory · interface · }): Promise; +BotHistory · interface · message(chat: BotChatRef, messageId: Id): Promise; +BotHistory · interface · historySince(chat: BotChatRef, since: number, limit: number): Promise<{ +BotHistory · interface · messages: Message[]; +BotHistory · interface · more: boolean; +BotHistory · interface · }>; +BotHistory · interface · historyBefore(chat: BotChatRef, window: { +BotHistory · interface · limit: number; +BotHistory · interface · before?: string; +BotHistory · interface · }): Promise<{ +BotHistory · interface · items: Message[]; +BotHistory · interface · hasMore: boolean; +BotHistory · interface · }>; +BotHistory · interface · } +BotMcp · interface · export interface BotMcp { +BotMcp · interface · program: () => Promise; +BotMcp · interface · keyOf?: (path: readonly string[]) => PermissionKey | null | undefined; +BotMcp · interface · skill?: URL; +BotMcp · interface · } +BotMenu · interface · export interface BotMenu { +BotMenu · interface · menu(): Promise; +BotMenu · interface · setMenu(entries: BotMenuEntry[]): Promise; +BotMenu · interface · } +BotMessaging · interface · export interface BotMessaging { +BotMessaging · interface · send(chat: BotChatRef, text: string, options: BotSendOptions): Promise; +BotMessaging · interface · edit(chat: BotChatRef, messageId: Id, text: string, options: { +BotMessaging · interface · markup?: Markup[]; +BotMessaging · interface · formatting?: TextSpan[]; +BotMessaging · interface · html?: boolean; +BotMessaging · interface · buttons?: BotButton[][]; +BotMessaging · interface · }): Promise; +BotMessaging · interface · delete(chat: BotChatRef, messageIds: Id[]): Promise; +BotMessaging · interface · } +BotMessenger · interface · export interface BotMessenger { +BotMessenger · interface · app: AppIdentity; +BotMessenger · interface · provider: Provider; +BotMessenger · interface · name?: string; +BotMessenger · interface · adminRights?: readonly AdminRight[]; +BotMessenger · interface · manyWebhooks?: boolean; +BotMessenger · interface · secrets?: readonly BotSecret[]; +BotMessenger · interface · identity?: boolean; +BotMessenger · interface · keepUpdates?: (command: Command, profile: string, events: readonly BotEvent[]) => void; +BotMessenger · interface · joinsSince?: (command: Command, profile: string, chatId: Id, since: number) => GroupMember[] | undefined; +BotMessenger · interface · resolveSettings: (flags: GlobalFlags, options?: ResolveOptions) => Settings; +BotMessenger · interface · connect: (command: Command, token: string, options?: BotConnectOptions) => Promise; +BotMessenger · interface · tokenStore?: (command: Command, profile: string) => BotTokenStore; +BotMessenger · interface · registry?: (command: Command, profile: string) => ChatRegistry; +BotMessenger · interface · readSecret?: (command: Command, prompt: string) => Promise; +BotMessenger · interface · chatKindOf?: (hit: StoredHit) => ChatKind; +BotMessenger · interface · fetching?: Fetching & { +BotMessenger · interface · from?: string; +BotMessenger · interface · }; +BotMessenger · interface · permissionFix?: (settings: Settings, request: GuardRequest) => string; +BotMessenger · interface · mcp?: BotMcp; +BotMessenger · interface · } +BotNativeApi · interface · export interface BotNativeApi { +BotNativeApi · interface · api(method: string, input: { +BotNativeApi · interface · body?: string; +BotNativeApi · interface · files: readonly { +BotNativeApi · interface · field: string; +BotNativeApi · interface · name: string; +BotNativeApi · interface · bytes: Uint8Array; +BotNativeApi · interface · }[]; +BotNativeApi · interface · secrets: readonly string[]; +BotNativeApi · interface · }, options: { +BotNativeApi · interface · reads: boolean; +BotNativeApi · interface · timeoutMs?: number; +BotNativeApi · interface · }): Promise; +BotNativeApi · interface · } +BotPeople · interface · export interface BotPeople { +BotPeople · interface · senders(): PersonFacts[]; +BotPeople · interface · } +BotSecret · interface · export interface BotSecret { +BotSecret · interface · name: string; +BotSecret · interface · description: string; +BotSecret · interface · } +BotSendOptions · interface · export interface BotSendOptions { +BotSendOptions · interface · replyTo?: Id; +BotSendOptions · interface · silent?: boolean; +BotSendOptions · interface · markup?: Markup[]; +BotSendOptions · interface · formatting?: TextSpan[]; +BotSendOptions · interface · html?: boolean; +BotSendOptions · interface · attachments?: Upload[]; +BotSendOptions · interface · buttons?: BotButton[][]; +BotSendOptions · interface · } +BotServerOptions · interface · export interface BotServerOptions { +BotServerOptions · interface · bot: BotMessenger; +BotServerOptions · interface · program: AgentProgram; +BotServerOptions · interface · settings: Pick; +BotServerOptions · interface · levels?: () => Readonly>; +BotServerOptions · interface · keyOf?: (path: readonly string[]) => PermissionKey | null | undefined; +BotServerOptions · interface · authority?: (path: readonly string[]) => boolean; +BotServerOptions · interface · fetchOnly?: (path: readonly string[]) => boolean; +BotServerOptions · interface · fetches?: (path: readonly string[]) => boolean; +BotServerOptions · interface · env: NodeJS.ProcessEnv; +BotServerOptions · interface · skill?: URL; +BotServerOptions · interface · } +BotTokenStore · class · export declare class BotTokenStore { +BotTokenStore · class · readonly profile: string; +BotTokenStore · class · constructor({ app, profile, env, keyring, configDir }: BotTokenStoreOptions); +BotTokenStore · class · read(): { +BotTokenStore · class · token: string; +BotTokenStore · class · source: CredentialSource; +BotTokenStore · class · } | undefined; +BotTokenStore · class · write(token: string): CredentialSource; +BotTokenStore · class · readKeyring(): string | undefined; +BotTokenStore · class · readStored(): { +BotTokenStore · class · secret: string; +BotTokenStore · class · source: CredentialSource; +BotTokenStore · class · } | undefined; +BotTokenStore · class · writeKeyring(token: string): void; +BotTokenStore · class · remove(): CredentialSource[]; +BotTokenStore · class · readSecret(name: string): { +BotTokenStore · class · secret: string; +BotTokenStore · class · source: CredentialSource; +BotTokenStore · class · } | undefined; +BotTokenStore · class · writeSecret(name: string, secret: string): CredentialSource; +BotTokenStore · class · removeSecret(name: string): CredentialSource[]; +BotTokenStore · class · } +BotTokenStoreOptions · interface · export interface BotTokenStoreOptions { +BotTokenStoreOptions · interface · app: AppIdentity; +BotTokenStoreOptions · interface · profile: string; +BotTokenStoreOptions · interface · env?: NodeJS.ProcessEnv; +BotTokenStoreOptions · interface · keyring?: KeyringStore; +BotTokenStoreOptions · interface · configDir?: string; +BotTokenStoreOptions · interface · } +BotUpdates · interface · export interface BotUpdates { +BotUpdates · interface · updates(cursor: string | undefined, options: { +BotUpdates · interface · types?: string[]; +BotUpdates · interface · waitSeconds: number; +BotUpdates · interface · signal: AbortSignal; +BotUpdates · interface · }): Promise; +BotUpdates · interface · } +BotWebhook · interface · export interface BotWebhook { +BotWebhook · interface · url: string; +BotWebhook · interface · types: string[] | null; +BotWebhook · interface · } +BotWebhookIntake · interface · export interface BotWebhookIntake { +BotWebhookIntake · interface · webhookHandshake(request: BotWebhookRequest): BotWebhookAnswer | undefined; +BotWebhookIntake · interface · webhookAuthentic(request: BotWebhookRequest): boolean; +BotWebhookIntake · interface · webhookEvents(request: BotWebhookRequest): BotEvent[]; +BotWebhookIntake · interface · } +BotWebhooks · interface · export interface BotWebhooks { +BotWebhooks · interface · webhooks(): Promise; +BotWebhooks · interface · setWebhook(url: string, options: { +BotWebhooks · interface · types?: string[]; +BotWebhooks · interface · secret?: string; +BotWebhooks · interface · }): Promise; +BotWebhooks · interface · deleteWebhook(url: string): Promise; +BotWebhooks · interface · } +CacheEvent · interface · export interface CacheEvent { +CacheEvent · interface · event: "cache"; +CacheEvent · interface · operation: string; +CacheEvent · interface · reason: string; +CacheEvent · interface · ids?: Record; +CacheEvent · interface · counts?: Record; +CacheEvent · interface · ageMs?: number; +CacheEvent · interface · } +ChatRegistry · class · export declare class ChatRegistry { +ChatRegistry · class · constructor(app: AppIdentity, profile: string, env?: NodeJS.ProcessEnv); +ChatRegistry · class · list(filter?: Partial>): SeenChat[]; +ChatRegistry · class · botId(): string | undefined; +ChatRegistry · class · rememberBot(id: string): void; +ChatRegistry · class · touch(): void; +ChatRegistry · class · observe(chats: readonly (Partial & { +ChatRegistry · class · id: string; +ChatRegistry · class · })[], now?: Date): void; +ChatRegistry · class · } +CliEntry · interface · export interface CliEntry { +CliEntry · interface · app: AppIdentity; +CliEntry · interface · run: (entry: EntryContext) => Promise; +CliEntry · interface · fail: (error: unknown, entry: EntryContext) => number; +CliEntry · interface · interactive?: (args: readonly string[], tty: boolean) => boolean; +CliEntry · interface · reasons?: readonly ErrorReason[]; +CliEntry · interface · sqlite?: boolean; +CliEntry · interface · io?: Partial; +CliEntry · interface · } +Closeable · interface · export interface Closeable { +Closeable · interface · close(): Promise; +Closeable · interface · } +CommandAvailability · interface · export interface CommandAvailability { +CommandAvailability · interface · available: boolean; +CommandAvailability · interface · reason?: string; +CommandAvailability · interface · permission?: string; +CommandAvailability · interface · level?: Level; +CommandAvailability · interface · } +CommandPermissions · interface · export interface CommandPermissions { +CommandPermissions · interface · keyOf: (path: readonly string[]) => PermissionKey | null; +CommandPermissions · interface · extra: readonly PermissionKey[]; +CommandPermissions · interface · defaults: Readonly>; +CommandPermissions · interface · alsoChecks?: (path: readonly string[]) => readonly (PermissionKey | ConditionalKey)[]; +CommandPermissions · interface · } +CommandRunOptions · interface · export interface CommandRunOptions { +CommandRunOptions · interface · app: AppIdentity; +CommandRunOptions · interface · settings: () => SavedRunSettings; +CommandRunOptions · interface · profile?: () => string | undefined; +CommandRunOptions · interface · agent?: boolean; +CommandRunOptions · interface · format?: () => RenderFormat; +CommandRunOptions · interface · recognise?: (error: unknown) => unknown; +CommandRunOptions · interface · env?: NodeJS.ProcessEnv; +CommandRunOptions · interface · streams?: Streams; +CommandRunOptions · interface · } +CommandRuns · interface · export interface CommandRuns { +CommandRuns · interface · start(action: Command): void; +CommandRuns · interface · succeed(): Promise; +CommandRuns · interface · fail(error: unknown): Promise; +CommandRuns · interface · runId(): string | undefined; +CommandRuns · interface · events(event: RequestEvent): void; +CommandRuns · interface · } +CompletionOptions · interface · export interface CompletionOptions { +CompletionOptions · interface · account?: (profile: string, env: NodeJS.ProcessEnv) => string | undefined; +CompletionOptions · interface · sources?: (profile: string, words: string[], env: NodeJS.ProcessEnv) => CompletionSources | undefined; +CompletionOptions · interface · } +CompletionRequest · interface · export interface CompletionRequest { +CompletionRequest · interface · profile: string | undefined; +CompletionRequest · interface · words: string[]; +CompletionRequest · interface · env: NodeJS.ProcessEnv; +CompletionRequest · interface · } +ConditionalKey · interface · export interface ConditionalKey { +ConditionalKey · interface · key: PermissionKey; +ConditionalKey · interface · when: string; +ConditionalKey · interface · } +ConfigIssue · interface · export interface ConfigIssue { +ConfigIssue · interface · kind: ConfigIssueKind; +ConfigIssue · interface · file: string; +ConfigIssue · interface · profile?: string; +ConfigIssue · interface · key?: string; +ConfigIssue · interface · line?: number; +ConfigIssue · interface · column?: number; +ConfigIssue · interface · what: string; +ConfigIssue · interface · fix?: string; +ConfigIssue · interface · } +ConfigIssueKind · type · export type ConfigIssueKind = "invalid_json" | "unknown_setting" | "unknown_permission" | "missing_setting" | "invalid_value"; +Configuration · type · export type Configuration = ReturnType; +ConnectOptions · interface · export interface ConnectOptions { +ConnectOptions · interface · listen?: boolean; +ConnectOptions · interface · catchUp?: boolean; +ConnectOptions · interface · events?: EventSink; +ConnectOptions · interface · stored?: StoredMessages; +ConnectOptions · interface · } +ContractEvidenceOptions · interface · export interface ContractEvidenceOptions { +ContractEvidenceOptions · interface · fields?: JsonFieldsResolver; +ContractEvidenceOptions · interface · errors?: AppErrors; +ContractEvidenceOptions · interface · } +DISCOVERY_DESCRIPTIONS · const · export declare const DISCOVERY_DESCRIPTIONS: Readonly<{ +DISCOVERY_DESCRIPTIONS · const · commands: "every command by section; --json prints its contract, one path per call"; +DISCOVERY_DESCRIPTIONS · const · info: "one command contract, or all schemas, error reasons and explicit overrides"; +DISCOVERY_DESCRIPTIONS · const · }>; +DateWindow · interface · export interface DateWindow { +DateWindow · interface · since?: number; +DateWindow · interface · until?: number; +DateWindow · interface · meta: { +DateWindow · interface · timezone?: string; +DateWindow · interface · window?: { +DateWindow · interface · since?: string; +DateWindow · interface · until?: string; +DateWindow · interface · }; +DateWindow · interface · }; +DateWindow · interface · } +DeclaredSetting · interface · export interface DeclaredSetting { +DeclaredSetting · interface · key: string; +DeclaredSetting · interface · default: string | number | boolean; +DeclaredSetting · interface · description: string; +DeclaredSetting · interface · } +DiagnosticEvent · type · export type DiagnosticEvent = RequestEvent | CacheEvent | WarningEvent | StoreEvent | ProgressEvent; +DiscoveredCommand · interface · export interface DiscoveredCommand extends CommandInfo { +DiscoveredCommand · interface · availability?: CommandAvailability; +DiscoveredCommand · interface · commands: readonly DiscoveredCommand[]; +DiscoveredCommand · interface · } +Download · interface · export interface Download { +Download · interface · files: RemoteFile[]; +Download · interface · skipped: string[]; +Download · interface · } +EntityFields · type · export type EntityFields = readonly string[] | { +EntityFields · type · readonly entries: Readonly>; +EntityFields · type · }; +EntryContext · interface · export interface EntryContext { +EntryContext · interface · args: string[]; +EntryContext · interface · env: NodeJS.ProcessEnv; +EntryContext · interface · tty: boolean; +EntryContext · interface · signal: AbortSignal; +EntryContext · interface · atStart: (command: Command) => Promise; +EntryContext · interface · ask: (question: string, command?: Command) => Promise; +EntryContext · interface · openBrowser: (url: string, browser?: string, command?: Command) => Promise; +EntryContext · interface · outputClosed: () => boolean; +EntryContext · interface · setExitCode: (code: number) => void; +EntryContext · interface · } +EntryIo · interface · export interface EntryIo { +EntryIo · interface · argv: readonly string[]; +EntryIo · interface · env: NodeJS.ProcessEnv; +EntryIo · interface · platform: NodeJS.Platform; +EntryIo · interface · stdin: NodeJS.ReadableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · stdout: NodeJS.WritableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · stderr: NodeJS.WritableStream & { +EntryIo · interface · isTTY?: boolean; +EntryIo · interface · }; +EntryIo · interface · signals: Pick; +EntryIo · interface · setExitCode: (code: number) => void; +EntryIo · interface · spawn: (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess; +EntryIo · interface · } +EventSink · type · export type EventSink = (event: DiagnosticEvent) => void; +FETCH · const · export declare const FETCH: Effects; +Fetching · interface · export interface Fetching { +Fetching · interface · beforeInclusive?: boolean; +Fetching · interface · page: number; +Fetching · interface · maxPageSize?: number; +Fetching · interface · pause: string; +Fetching · interface · jitter?: boolean; +Fetching · interface · maxPages: number; +Fetching · interface · orderBy?: "id" | "time"; +Fetching · interface · } +FirstScreen · interface · export interface FirstScreen { +FirstScreen · interface · pitch?: string; +FirstScreen · interface · can?: readonly FirstScreenLine[]; +FirstScreen · interface · profile?: boolean; +FirstScreen · interface · start?: string; +FirstScreen · interface · } +FirstScreenLine · interface · export interface FirstScreenLine { +FirstScreenLine · interface · command: string; +FirstScreenLine · interface · does: string; +FirstScreenLine · interface · } +ForumState · interface · export interface ForumState { +ForumState · interface · chat: Chat; +ForumState · interface · forum: boolean; +ForumState · interface · needsUpgrade: boolean; +ForumState · interface · owner: boolean; +ForumState · interface · linkedDiscussion: boolean; +ForumState · interface · canCreate: boolean; +ForumState · interface · } +GlobalFlags · interface · export interface GlobalFlags { +GlobalFlags · interface · permission?: string[]; +GlobalFlags · interface · profile?: string; +GlobalFlags · interface · json?: boolean; +GlobalFlags · interface · jsonl?: boolean; +GlobalFlags · interface · quiet?: boolean; +GlobalFlags · interface · verbose?: number; +GlobalFlags · interface · trace?: boolean; +GlobalFlags · interface · limit?: number; +GlobalFlags · interface · page?: number; +GlobalFlags · interface · all?: boolean; +GlobalFlags · interface · record?: boolean; +GlobalFlags · interface · offline?: boolean; +GlobalFlags · interface · timeout?: string; +GlobalFlags · interface · } +GuideOptions · interface · export interface GuideOptions { +GuideOptions · interface · directory: string; +GuideOptions · interface · worksWith?: readonly GuideReference[]; +GuideOptions · interface · profile?: boolean; +GuideOptions · interface · } +GuideReference · interface · export interface GuideReference { +GuideReference · interface · tool: string; +GuideReference · interface · name: string; +GuideReference · interface · title: string; +GuideReference · interface · } +GuideStep · interface · export interface GuideStep { +GuideStep · interface · run: string; +GuideStep · interface · why: string; +GuideStep · interface · } +HelpSection · type · export type HelpSection = Exclude; +HistoryBatch · interface · export interface HistoryBatch { +HistoryBatch · interface · rekeys?: { +HistoryBatch · interface · from: Id; +HistoryBatch · interface · to: Id; +HistoryBatch · interface · }[]; +HistoryBatch · interface · chats?: ChatUpdate[]; +HistoryBatch · interface · people?: Member[]; +HistoryBatch · interface · messages?: Message[]; +HistoryBatch · interface · votes?: HistoryVote[]; +HistoryBatch · interface · reactions?: HistoryReaction[]; +HistoryBatch · interface · stars?: HistoryStar[]; +HistoryBatch · interface · deletions?: { +HistoryBatch · interface · chatId: Id; +HistoryBatch · interface · messageId: Id; +HistoryBatch · interface · }[]; +HistoryBatch · interface · events?: HistoryChatEvent[]; +HistoryBatch · interface · } +HistoryBatchHandler · type · export type HistoryBatchHandler = (batch: HistoryBatch, saved?: Promise) => void | Promise; +InputPolicy · interface · export interface InputPolicy { +InputPolicy · interface · noInput?: boolean; +InputPolicy · interface · maxBytes?: number; +InputPolicy · interface · signal?: AbortSignal; +InputPolicy · interface · } +ItemBody · type · export type ItemBody = Omit, "meta"> & { +ItemBody · type · meta?: Partial; +ItemBody · type · }; +JsonFieldsResolver · type · export type JsonFieldsResolver = (command: Command | undefined) => readonly string[] | undefined; +JsonRequest · interface · export interface JsonRequest { +JsonRequest · interface · argv: string[]; +JsonRequest · interface · json: boolean; +JsonRequest · interface · fields?: string; +JsonRequest · interface · } +KEEP_RUNS_FOR_DAYS · const · export declare const KEEP_RUNS_FOR_DAYS = 30; +KEEP_SUCCESSFUL_RUNS_FOR_DAYS · const · export declare const KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7; +LOCAL_READ · const · export declare const LOCAL_READ: Effects; +LOCAL_WRITE · const · export declare const LOCAL_WRITE: Effects; +ListBody · type · export type ListBody = Omit, "meta"> & { +ListBody · type · meta?: Partial; +ListBody · type · }; +ListInput · interface · export interface ListInput { +ListInput · interface · items: T[]; +ListInput · interface · limit: number; +ListInput · interface · has_more: boolean; +ListInput · interface · cursor?: string; +ListInput · interface · paging?: "cursor"; +ListInput · interface · page?: number; +ListInput · interface · total?: Total; +ListInput · interface · args?: Record; +ListInput · interface · next?: NextStep[]; +ListInput · interface · missing?: Missing[]; +ListInput · interface · meta?: Partial; +ListInput · interface · } +MEMO_SCENARIOS · const · export declare const MEMO_SCENARIOS: { +MEMO_SCENARIOS · const · readonly personBrief: { +MEMO_SCENARIOS · const · readonly tool: "memo"; +MEMO_SCENARIOS · const · readonly name: "person-brief"; +MEMO_SCENARIOS · const · readonly title: "One person across every tool"; +MEMO_SCENARIOS · const · }; +MEMO_SCENARIOS · const · readonly decisionTrail: { +MEMO_SCENARIOS · const · readonly tool: "memo"; +MEMO_SCENARIOS · const · readonly name: "decision-trail"; +MEMO_SCENARIOS · const · readonly title: "What did we decide about X, across every source"; +MEMO_SCENARIOS · const · }; +MEMO_SCENARIOS · const · }; +ManifestVerifyOptions · interface · export interface ManifestVerifyOptions { +ManifestVerifyOptions · interface · manifest: ServiceApiManifest; +ManifestVerifyOptions · interface · service: string; +ManifestVerifyOptions · interface · verify: CliVerify; +ManifestVerifyOptions · interface · fetch: (command: Command, site: string | undefined) => FetchLike; +ManifestVerifyOptions · interface · } +MediaOption · type · export type MediaOption = "spoiler" | "captionAbove" | "fileName"; +MeetingPreparationReader · type · export type MeetingPreparationReader = (seriesId: string, request: MeetingPreparationRequest) => Promise; +MessageEditing · interface · export interface MessageEditing { +MessageEditing · interface · edit(chatId: Id, messageId: Id, text: string, options: { +MessageEditing · interface · markup?: Markup[]; +MessageEditing · interface · formatting?: TextSpan[]; +MessageEditing · interface · }): Promise; +MessageEditing · interface · forward(fromChatId: Id, messageId: Id, toChatId: Id, options: { +MessageEditing · interface · sendId: string; +MessageEditing · interface · silent?: boolean; +MessageEditing · interface · sendAs?: Id; +MessageEditing · interface · threadId?: Id; +MessageEditing · interface · }): Promise; +MessageEditing · interface · delete(chatId: Id, messageIds: Id[], options: { +MessageEditing · interface · forEveryone: boolean; +MessageEditing · interface · }): Promise; +MessageEditing · interface · } +MessagePins · interface · export interface MessagePins { +MessagePins · interface · pin(chatId: Id, messageId: Id, options: { +MessagePins · interface · notify: boolean; +MessagePins · interface · duration?: number; +MessagePins · interface · }): Promise; +MessagePins · interface · unpin(chatId: Id, messageId: Id): Promise; +MessagePins · interface · } +MessagePolls · interface · export interface MessagePolls { +MessagePolls · interface · poll(chatId: Id, messageId: Id): Promise; +MessagePolls · interface · vote(chatId: Id, messageId: Id, answerIds: Id[]): Promise; +MessagePolls · interface · closePoll(chatId: Id, messageId: Id): Promise; +MessagePolls · interface · pollVoters?(chatId: Id, messageId: Id, window: { +MessagePolls · interface · limit: number; +MessagePolls · interface · answerId?: Id; +MessagePolls · interface · }): Promise & { +MessagePolls · interface · total: number; +MessagePolls · interface · }>; +MessagePolls · interface · createPoll(chatId: Id, poll: NewPoll, options: { +MessagePolls · interface · sendId: string; +MessagePolls · interface · silent?: boolean; +MessagePolls · interface · threadId?: Id; +MessagePolls · interface · sendAs?: Id; +MessagePolls · interface · }): Promise; +MessagePolls · interface · } +MessageReactions · interface · export interface MessageReactions { +MessageReactions · interface · react(chatId: Id, messageId: Id, emoji: string | null): Promise; +MessageReactions · interface · reactors?(chatId: Id, messageId: Id, window: { +MessageReactions · interface · limit: number; +MessageReactions · interface · emoji?: string; +MessageReactions · interface · cursor?: string; +MessageReactions · interface · }): Promise & { +MessageReactions · interface · cursor?: string; +MessageReactions · interface · }>; +MessageReactions · interface · } +Messenger · interface · export interface Messenger extends ServiceMessenger { +Messenger · interface · connection?: "exclusive"; +Messenger · interface · pace?: PaceRate; +Messenger · interface · resolveSettings: (flags: GlobalFlags, options?: ResolveOptions) => Settings; +Messenger · interface · connect: (command: Command, context: BaseContext, options?: ConnectOptions) => Promise; +Messenger · interface · profileState?: (profile: string, env: NodeJS.ProcessEnv) => ProfileState; +Messenger · interface · accountRemoval?: import("../account-remove.js").AccountRemoval; +Messenger · interface · chatArgument: string; +Messenger · interface · purposes?: PurposeConfig; +Messenger · interface · groupSettings?: readonly GroupSettingKey[]; +Messenger · interface · pollQuiz?: boolean; +Messenger · interface · pollCloseSeconds?: readonly [min: number, max: number]; +Messenger · interface · reactionsList?: boolean; +Messenger · interface · reactionsListScope?: string; +Messenger · interface · pollVoters?: boolean; +Messenger · interface · pollClose?: boolean; +Messenger · interface · pollRevote?: boolean; +Messenger · interface · pollAnonymous?: boolean; +Messenger · interface · silentSends?: boolean; +Messenger · interface · sendAs?: boolean; +Messenger · interface · scheduledSends?: boolean; +Messenger · interface · autoReplies?: boolean; +Messenger · interface · lacks?: readonly (keyof MessengerAdapter)[]; +Messenger · interface · never?: readonly (keyof MessengerAdapter)[]; +Messenger · interface · deleteForMe?: boolean; +Messenger · interface · topics?: boolean; +Messenger · interface · topicShow?: boolean; +Messenger · interface · html?: boolean; +Messenger · interface · folderOrder?: boolean; +Messenger · interface · groupPhoto?: boolean; +Messenger · interface · groupPhotoRemoval?: boolean; +Messenger · interface · profilePhotoTypes?: readonly string[]; +Messenger · interface · chatMedia?: boolean; +Messenger · interface · privacy?: boolean; +Messenger · interface · privacySettings?: readonly PrivacyKey[]; +Messenger · interface · chatMute?: boolean; +Messenger · interface · chatArchive?: boolean; +Messenger · interface · chatPin?: boolean; +Messenger · interface · chatMarkUnread?: boolean; +Messenger · interface · messageStars?: boolean; +Messenger · interface · chatDeletion?: boolean; +Messenger · interface · personalBots?: boolean; +Messenger · interface · stickers?: boolean; +Messenger · interface · stickerFileBytes?: number; +Messenger · interface · folderJoin?: boolean; +Messenger · interface · inviteLinkCreate?: boolean; +Messenger · interface · inviteLinkList?: boolean; +Messenger · interface · inviteLinkRevoke?: boolean; +Messenger · interface · inviteLinkUpdate?: boolean; +Messenger · interface · joinRequestsAll?: boolean; +Messenger · interface · joinRequestsByLink?: boolean; +Messenger · interface · channelComments?: boolean; +Messenger · interface · readsComments?: boolean; +Messenger · interface · addsWithHistory?: boolean; +Messenger · interface · adminRights?: readonly AdminRight[]; +Messenger · interface · pickAdminRights?: boolean; +Messenger · interface · accountOf?: (command: Command) => AccountKey | undefined; +Messenger · interface · accountsOf?: (command: Command) => readonly AccountKey[] | undefined; +Messenger · interface · deletedWithoutChat?: DeletionScope; +Messenger · interface · officialStats?: boolean; +Messenger · interface · tracksMembers?: boolean; +Messenger · interface · speechModels?: readonly string[]; +Messenger · interface · guard?: (command: Command, settings: Settings, warn: Warn, ask?: Asker) => SendGuard; +Messenger · interface · permissionKey?: PermissionKeyOf; +Messenger · interface · skill?: URL; +Messenger · interface · diagnose?: (command: Command, context: BaseContext) => Promise>; +Messenger · interface · } +MessengerAdapter · interface · export interface MessengerAdapter extends MessengerCore, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial { +MessengerAdapter · interface · } +MessengerContext · interface · export interface MessengerContext extends BaseContext { +MessengerContext · interface · profile: string; +MessengerContext · interface · agent: boolean; +MessengerContext · interface · stdin: NodeJS.ReadableStream & { +MessengerContext · interface · isTTY?: boolean; +MessengerContext · interface · }; +MessengerContext · interface · recognizer?: OpenRecognizer; +MessengerContext · interface · guard: SendGuard; +MessengerContext · interface · withMessenger: (work: (messenger: MessengerAdapter) => Promise, options?: ConnectOptions) => Promise; +MessengerContext · interface · withStore: (work: (store: MessageStore, account: AccountKey) => Promise, options?: { +MessengerContext · interface · name?: string; +MessengerContext · interface · }) => Promise; +MessengerContext · interface · withServices: (work: (services: Services, connect?: ReadConnection) => Promise, options?: { +MessengerContext · interface · name?: string; +MessengerContext · interface · }) => Promise; +MessengerContext · interface · } +MessengerCore · interface · export interface MessengerCore { +MessengerCore · interface · self(): Id | null; +MessengerCore · interface · newSendId?(): string; +MessengerCore · interface · me(): Promise; +MessengerCore · interface · resolve(chat: string): Promise; +MessengerCore · interface · chat(chat: string): Promise; +MessengerCore · interface · send(chatId: Id, text: string, options: SendOptions): Promise; +MessengerCore · interface · saveDraft?(chatId: Id, text: string, options: Pick): Promise; +MessengerCore · interface · logout(): Promise; +MessengerCore · interface · close(): Promise; +MessengerCore · interface · } +ModeProblem · interface · export interface ModeProblem { +ModeProblem · interface · path: string; +ModeProblem · interface · mode: string; +ModeProblem · interface · want: string; +ModeProblem · interface · fix: string; +ModeProblem · interface · } +ModelCatalogueOptions · interface · export interface ModelCatalogueOptions { +ModelCatalogueOptions · interface · kinds: readonly ("audio" | "text")[]; +ModelCatalogueOptions · interface · env: () => NodeJS.ProcessEnv; +ModelCatalogueOptions · interface · enrichment?: boolean; +ModelCatalogueOptions · interface · keyring?: KeyringStore; +ModelCatalogueOptions · interface · stdin?: () => NodeJS.ReadableStream | undefined; +ModelCatalogueOptions · interface · output: (answer: Body, command: Command) => void; +ModelCatalogueOptions · interface · diagnostic: (line: string) => void; +ModelCatalogueOptions · interface · jsonOption?: boolean; +ModelCatalogueOptions · interface · offline?: () => boolean; +ModelCatalogueOptions · interface · defaultAudio?: () => string; +ModelCatalogueOptions · interface · } +NONE_NAMED · const · export declare const NONE_NAMED = "none named"; +NO_EFFECTS · const · export declare const NO_EFFECTS: Effects; +Need · interface · export interface Need { +Need · interface · field: string; +Need · interface · secret: boolean; +Need · interface · prompt: string; +Need · interface · hint?: string | undefined; +Need · interface · } +NewPoll · interface · export interface NewPoll { +NewPoll · interface · question: string; +NewPoll · interface · answers: string[]; +NewPoll · interface · multiple: boolean; +NewPoll · interface · anonymous: boolean; +NewPoll · interface · revote?: boolean; +NewPoll · interface · quiz?: { +NewPoll · interface · correct: number; +NewPoll · interface · solution?: string; +NewPoll · interface · }; +NewPoll · interface · closeAfter?: number; +NewPoll · interface · } +PermissionKeyOf · type · export type PermissionKeyOf = (command: Command) => PermissionKey | null | undefined; +PrivateFiles · type · export type PrivateFiles = { +PrivateFiles · type · checked: false; +PrivateFiles · type · reason: string; +PrivateFiles · type · } | { +PrivateFiles · type · checked: true; +PrivateFiles · type · ok: boolean; +PrivateFiles · type · problems: ModeProblem[]; +PrivateFiles · type · }; +ProfileChange · interface · export interface ProfileChange { +ProfileChange · interface · firstName?: string; +ProfileChange · interface · lastName?: string; +ProfileChange · interface · description?: string; +ProfileChange · interface · photo?: Upload; +ProfileChange · interface · } +ProfileKind · type · export type ProfileKind = "personal" | "bot"; +ProfileState · type · export type ProfileState = "signed-in" | "signed-out" | "bot"; +ProfileTokenStore · class · export declare class ProfileTokenStore { +ProfileTokenStore · class · readonly variable: string; +ProfileTokenStore · class · constructor({ app, env, keyring, warn }: ProfileTokenStoreOptions); +ProfileTokenStore · class · read(profile: string): StoredCredential | undefined; +ProfileTokenStore · class · write(profile: string, token: string, storage?: TokenStorage, secrets?: Readonly>): CredentialSource; +ProfileTokenStore · class · readWith(profile: string, name: string): { +ProfileTokenStore · class · token: StoredCredential; +ProfileTokenStore · class · secret: string | undefined; +ProfileTokenStore · class · } | undefined; +ProfileTokenStore · class · remove(profile: string): CredentialSource[]; +ProfileTokenStore · class · readSecret(profile: string, name: string): StoredCredential | undefined; +ProfileTokenStore · class · writeSecret(profile: string, name: string, secret: string, storage?: TokenStorage): CredentialSource; +ProfileTokenStore · class · removeSecret(profile: string, name: string): CredentialSource[]; +ProfileTokenStore · class · secretVariable(name: string): string; +ProfileTokenStore · class · need(profile: string): string; +ProfileTokenStore · class · signedIn(profile: string): boolean; +ProfileTokenStore · class · } +ProfileTokenStoreOptions · interface · export interface ProfileTokenStoreOptions { +ProfileTokenStoreOptions · interface · app: AppIdentity; +ProfileTokenStoreOptions · interface · env?: NodeJS.ProcessEnv; +ProfileTokenStoreOptions · interface · keyring?: KeyringStore | undefined; +ProfileTokenStoreOptions · interface · warn?: (message: string) => void; +ProfileTokenStoreOptions · interface · } +ProgramDefinition · interface · export interface ProgramDefinition { +ProgramDefinition · interface · app: AppIdentity; +ProgramDefinition · interface · commands: () => Command[]; +ProgramDefinition · interface · configuration?: { +ProgramDefinition · interface · permissionKey?: (path: readonly string[]) => string | null | undefined; +ProgramDefinition · interface · permissions?: CommandPermissions | undefined; +ProgramDefinition · interface · resolveSettings: (flags?: GlobalFlags, options?: ResolveOptions) => Pick & Partial>; +ProgramDefinition · interface · }; +ProgramDefinition · interface · configure?: (program: Command) => void; +ProgramDefinition · interface · rows?: RowTable; +ProgramDefinition · interface · firstScreen?: FirstScreen; +ProgramDefinition · interface · update?: Pick; +ProgramDefinition · interface · prepare?: (program: Command, environment: RunOptions) => void | Promise; +ProgramDefinition · interface · onFailure?: (error: unknown, program: Command) => void | Promise; +ProgramDefinition · interface · } +ProgramOptions · interface · export interface ProgramOptions { +ProgramOptions · interface · out?: (text: string) => void; +ProgramOptions · interface · err?: (text: string) => void; +ProgramOptions · interface · } +ProviderAnswer · interface · export interface ProviderAnswer { +ProviderAnswer · interface · status?: number; +ProviderAnswer · interface · error?: unknown; +ProviderAnswer · interface · errorCode?: string; +ProviderAnswer · interface · providerError?: string; +ProviderAnswer · interface · bytes?: number; +ProviderAnswer · interface · counts?: Record; +ProviderAnswer · interface · ids?: Record; +ProviderAnswer · interface · } +ProviderCall · interface · export interface ProviderCall { +ProviderCall · interface · method?: string; +ProviderCall · interface · endpointTemplate?: string; +ProviderCall · interface · transport?: RequestEvent["transport"]; +ProviderCall · interface · attempt?: number; +ProviderCall · interface · waitMs?: number; +ProviderCall · interface · bytes?: number; +ProviderCall · interface · } +QueryWords · type · export type QueryWords = readonly string[] | string | undefined; +REMOTE_READ · const · export declare const REMOTE_READ: Effects; +REMOTE_WRITE · const · export declare const REMOTE_WRITE: Effects; +RUNS_SIZE_LIMIT_MB · const · export declare const RUNS_SIZE_LIMIT_MB = 200; +ReadConnection · type · export type ReadConnection = (work: (adapter: MessengerAdapter) => Promise) => Promise; +ReadState · interface · export interface ReadState { +ReadState · interface · markRead(chatId: Id, until?: Id): Promise; +ReadState · interface · } +RemoteFile · interface · export interface RemoteFile { +RemoteFile · interface · kind: string; +RemoteFile · interface · name?: string; +RemoteFile · interface · mime?: string; +RemoteFile · interface · size?: number; +RemoteFile · interface · position?: number; +RemoteFile · interface · bytes(): AsyncIterable; +RemoteFile · interface · providerRef?: ProviderMetadata; +RemoteFile · interface · } +RequestEvent · interface · export interface RequestEvent { +RequestEvent · interface · event: "request" | "response"; +RequestEvent · interface · operation: string; +RequestEvent · interface · opcode?: number; +RequestEvent · interface · seq?: number; +RequestEvent · interface · status?: number; +RequestEvent · interface · method?: string; +RequestEvent · interface · endpointTemplate?: string; +RequestEvent · interface · bytes?: number; +RequestEvent · interface · ids?: Record; +RequestEvent · interface · counts?: Record; +RequestEvent · interface · durationMs?: number; +RequestEvent · interface · outcome?: "ok" | "error"; +RequestEvent · interface · errorCode?: string; +RequestEvent · interface · providerError?: string; +RequestEvent · interface · level?: "operation" | "wire"; +RequestEvent · interface · transport?: "http" | "mtproto" | "max-ws" | "wa-engine" | "sftp" | "ssh" | "sql"; +RequestEvent · interface · attempt?: number; +RequestEvent · interface · waitMs?: number; +RequestEvent · interface · } +ResolveOptions · interface · export interface ResolveOptions { +ResolveOptions · interface · env?: NodeJS.ProcessEnv; +ResolveOptions · interface · configDir?: string; +ResolveOptions · interface · kind?: ProfileKind; +ResolveOptions · interface · needsProfile?: boolean; +ResolveOptions · interface · readOnly?: boolean; +ResolveOptions · interface · withIssues?: boolean; +ResolveOptions · interface · } +RowColumn · interface · export interface RowColumn { +RowColumn · interface · field: string | readonly string[]; +RowColumn · interface · as?: RowValue; +RowColumn · interface · tag?: string; +RowColumn · interface · prefix?: string; +RowColumn · interface · } +RowShape · interface · export interface RowShape { +RowShape · interface · columns: readonly RowColumn[]; +RowShape · interface · text?: readonly string[]; +RowShape · interface · sections?: Readonly>; +RowShape · interface · whole?: readonly string[]; +RowShape · interface · hidden?: readonly string[]; +RowShape · interface · oneLine?: boolean; +RowShape · interface · } +RunBotCommand · type · export type RunBotCommand = AgentProgram["run"]; +RunContext · type · export type RunContext = Pick; +RunMetadata · interface · export interface RunMetadata { +RunMetadata · interface · runId: string; +RunMetadata · interface · command: string; +RunMetadata · interface · profile?: string; +RunMetadata · interface · startedAt: string; +RunMetadata · interface · completedAt?: string; +RunMetadata · interface · status: RunStatus | "running"; +RunMetadata · interface · requests?: number; +RunMetadata · interface · eventsDropped?: number; +RunMetadata · interface · durationMs?: number; +RunMetadata · interface · cliVersion: string; +RunMetadata · interface · runtime?: string; +RunMetadata · interface · platform?: string; +RunMetadata · interface · arch?: string; +RunMetadata · interface · errorCode?: string; +RunMetadata · interface · partial?: { +RunMetadata · interface · failed: number; +RunMetadata · interface · stopReason?: string; +RunMetadata · interface · failures: { +RunMetadata · interface · id: string; +RunMetadata · interface · stage: string; +RunMetadata · interface · errorCode: string; +RunMetadata · interface · attachment?: number; +RunMetadata · interface · }[]; +RunMetadata · interface · }; +RunMetadata · interface · providerError?: string; +RunMetadata · interface · keptBecauseFailed?: boolean; +RunMetadata · interface · keptBecauseStore?: boolean; +RunMetadata · interface · operations?: string[]; +RunMetadata · interface · codes?: string[]; +RunMetadata · interface · tables?: string[]; +RunMetadata · interface · traceId?: string; +RunMetadata · interface · cliCommand?: string; +RunMetadata · interface · argv?: string[]; +RunMetadata · interface · unknownCommand?: string; +RunMetadata · interface · agent?: RunAgent; +RunMetadata · interface · via?: RunVia; +RunMetadata · interface · mcp?: RunMcp; +RunMetadata · interface · error?: RunError; +RunMetadata · interface · } +RunOptions · type · export type RunOptions = BaseEnvironment & Record; +RunScope · interface · export interface RunScope { +RunScope · interface · runId: string; +RunScope · interface · command: string; +RunScope · interface · startedAt?: number; +RunScope · interface · traceId?: string; +RunScope · interface · profile?: string; +RunScope · interface · events?: EventSink; +RunScope · interface · } +Running · interface · export interface Running { +Running · interface · pid: number; +Running · interface · startedAt: string; +Running · interface · connected: boolean; +Running · interface · connectedAt?: string; +Running · interface · version?: string; +Running · interface · byCommand?: boolean; +Running · interface · } +SCHEDULE_SETTINGS · const · export declare const SCHEDULE_SETTINGS: readonly DeclaredSetting[]; +SavedRunSettings · interface · export interface SavedRunSettings { +SavedRunSettings · interface · record?: boolean | undefined; +SavedRunSettings · interface · keepRunsForDays?: number | undefined; +SavedRunSettings · interface · keepSuccessfulRunsForDays?: number | undefined; +SavedRunSettings · interface · keepStoreRunsForDays?: number | undefined; +SavedRunSettings · interface · runsSizeLimitMb?: number | undefined; +SavedRunSettings · interface · recordInput?: RecordInput | undefined; +SavedRunSettings · interface · } +Scenario · interface · export interface Scenario { +Scenario · interface · name: string; +Scenario · interface · title: string; +Scenario · interface · goal: string; +Scenario · interface · steps: GuideStep[]; +Scenario · interface · look: string[]; +Scenario · interface · } +Schedule · interface · export interface Schedule { +Schedule · interface · name: string; +Schedule · interface · kind: "command" | "agent"; +Schedule · interface · argv: string[]; +Schedule · interface · when: When; +Schedule · interface · environment: Record; +Schedule · interface · createdAt: string; +Schedule · interface · onNewMail?: string; +Schedule · interface · mailWaitMinutes?: number; +Schedule · interface · mailBatch?: number; +Schedule · interface · maxCostPerDay?: number; +Schedule · interface · notify?: Notify; +Schedule · interface · to?: string[]; +Schedule · interface · paused?: true; +Schedule · interface · files?: Record; +Schedule · interface · agent?: AgentSpec; +Schedule · interface · } +ScheduleHost · interface · export interface ScheduleHost { +ScheduleHost · interface · app: AppIdentity; +ScheduleHost · interface · context(command: Command, resolving?: { +ScheduleHost · interface · needsProfile?: boolean; +ScheduleHost · interface · }): AnswerOutput & { +ScheduleHost · interface · env: NodeJS.ProcessEnv; +ScheduleHost · interface · profile: string; +ScheduleHost · interface · }; +ScheduleHost · interface · newMail?: (command: Command, holder: string) => Promise; +ScheduleHost · interface · agentInput?: AgentInput; +ScheduleHost · interface · limits?: (command: Command) => ScheduleLimits; +ScheduleHost · interface · agentRuns?: readonly AgentCli[]; +ScheduleHost · interface · } +ScheduleLimits · type · export type ScheduleLimits = Partial & { +ScheduleLimits · type · models: Partial>; +ScheduleLimits · type · leanStart: boolean; +ScheduleLimits · type · }>; +SeenChat · interface · export interface SeenChat extends Chat { +SeenChat · interface · firstSeenAt: string; +SeenChat · interface · lastSeenAt: string; +SeenChat · interface · } +SendOptions · interface · export interface SendOptions { +SendOptions · interface · sendId: string; +SendOptions · interface · replyTo?: Id; +SendOptions · interface · threadId?: Id; +SendOptions · interface · silent?: boolean; +SendOptions · interface · noPreview?: boolean; +SendOptions · interface · markup?: Markup[]; +SendOptions · interface · formatting?: TextSpan[]; +SendOptions · interface · at?: string; +SendOptions · interface · attachments?: Upload[]; +SendOptions · interface · sticker?: Id; +SendOptions · interface · stickerFile?: StickerFile; +SendOptions · interface · spoiler?: boolean; +SendOptions · interface · captionAbove?: boolean; +SendOptions · interface · sendAs?: Id; +SendOptions · interface · } +Sent · interface · export interface Sent { +Sent · interface · message: Message; +Sent · interface · messages?: Message[]; +Sent · interface · sendId: string; +Sent · interface · } +ServerOptions · interface · export interface ServerOptions { +ServerOptions · interface · process?: (context: MessengerContext, system: ServerSystem, logPath: string) => ServerProcess; +ServerOptions · interface · logPath?: (context: MessengerContext) => string; +ServerOptions · interface · serveArgv?: string[]; +ServerOptions · interface · idle?: boolean; +ServerOptions · interface · unit?: Pick; +ServerOptions · interface · } +ServerProcess · interface · export interface ServerProcess { +ServerProcess · interface · probe: () => Promise; +ServerProcess · interface · launch: (args: string[], env: Record) => number; +ServerProcess · interface · stop: (running: Running) => Promise; +ServerProcess · interface · } +ServerQuery · interface · export interface ServerQuery { +ServerQuery · interface · text: string; +ServerQuery · interface · chat?: string; +ServerQuery · interface · from?: Id; +ServerQuery · interface · minDate?: number; +ServerQuery · interface · maxDate?: number; +ServerQuery · interface · } +ServerReads · interface · export interface ServerReads { +ServerReads · interface · chats(window: { +ServerReads · interface · limit?: number; +ServerReads · interface · offset: number; +ServerReads · interface · }): Promise>; +ServerReads · interface · history(chat: string, window: { +ServerReads · interface · limit: number; +ServerReads · interface · before?: string; +ServerReads · interface · reactions?: false; +ServerReads · interface · }): Promise>; +ServerReads · interface · contact(person: string): Promise; +ServerReads · interface · fetchCounters?(chat: string, messageId: Id, fields: readonly CounterField[], signal?: AbortSignal): Promise; +ServerReads · interface · around(chat: string, messageId: Id, window: { +ServerReads · interface · before: number; +ServerReads · interface · after: number; +ServerReads · interface · }): Promise; +ServerReads · interface · } +ServerSystem · interface · export interface ServerSystem { +ServerSystem · interface · platform: NodeJS.Platform; +ServerSystem · interface · run: (argv: string[], env: NodeJS.ProcessEnv, options?: RunOptions) => Promise; +ServerSystem · interface · entry: string[]; +ServerSystem · interface · uid: number; +ServerSystem · interface · spawn: (argv: string[], env: NodeJS.ProcessEnv, log: string) => number; +ServerSystem · interface · pause: () => Promise; +ServerSystem · interface · } +ServiceApiCall · type · export type ServiceApiCall = (operation: string, input: ApiCommandInput) => Promise; +ServiceApiCallOptions · interface · export interface ServiceApiCallOptions { +ServiceApiCallOptions · interface · manifest: ServiceApiManifest; +ServiceApiCallOptions · interface · service: string; +ServiceApiCallOptions · interface · fetch: FetchLike; +ServiceApiCallOptions · interface · token?: () => string | Promise; +ServiceApiCallOptions · interface · baseUrl?: string; +ServiceApiCallOptions · interface · serverVariables?: Readonly>; +ServiceApiCallOptions · interface · headers?: (operation: ManifestOperation) => Record; +ServiceApiCallOptions · interface · failure?: HttpApiSendOptions["failure"]; +ServiceApiCallOptions · interface · failedAnswer?: HttpApiSendOptions["failedAnswer"]; +ServiceApiCallOptions · interface · } +ServiceApiCallWithHeaders · type · export type ServiceApiCallWithHeaders = (operation: string, input: ApiCommandInput) => Promise<{ +ServiceApiCallWithHeaders · type · body: unknown; +ServiceApiCallWithHeaders · type · headers: Headers; +ServiceApiCallWithHeaders · type · }>; +ServiceApiManifest · interface · export interface ServiceApiManifest { +ServiceApiManifest · interface · operations: readonly ManifestOperation[]; +ServiceApiManifest · interface · servers?: readonly ApiServer[]; +ServiceApiManifest · interface · securitySchemes?: Readonly>; +ServiceApiManifest · interface · security?: readonly SecurityRequirement[]; +ServiceApiManifest · interface · } +ServiceApiOptions · interface · export interface ServiceApiOptions extends ServiceApiPermissionsInput { +ServiceApiOptions · interface · app: AppIdentity; +ServiceApiOptions · interface · configuration: Configuration; +ServiceApiOptions · interface · service: string; +ServiceApiOptions · interface · baseUrl?: string; +ServiceApiOptions · interface · spec?: string; +ServiceApiOptions · interface · serverVariables?: (command: Command) => Readonly>; +ServiceApiOptions · interface · fetch: (command: Command) => FetchLike; +ServiceApiOptions · interface · token?: (command: Command) => string | Promise; +ServiceApiOptions · interface · headers?: (command: Command, operation: ManifestOperation) => Record; +ServiceApiOptions · interface · schemas: () => Promise>>; +ServiceApiOptions · interface · definitions: () => Promise>>; +ServiceApiOptions · interface · excluded?: readonly { +ServiceApiOptions · interface · id: string; +ServiceApiOptions · interface · reason: string; +ServiceApiOptions · interface · }[]; +ServiceApiOptions · interface · shown?: Readonly>; +ServiceApiOptions · interface · failure?: (status: number, answer: unknown, operation: ManifestOperation) => CliError | undefined; +ServiceApiOptions · interface · failedAnswer?: (answer: unknown, operation: ManifestOperation) => CliError | undefined; +ServiceApiOptions · interface · } +ServiceApiPermissionsInput · interface · export interface ServiceApiPermissionsInput { +ServiceApiPermissionsInput · interface · manifest: ServiceApiManifest; +ServiceApiPermissionsInput · interface · bodyPermissions?: Readonly>; +ServiceApiPermissionsInput · interface · } +ServiceApiWrite · type · export type ServiceApiWrite = (command: Command, operation: string, input: ApiCommandInput, options?: { +ServiceApiWrite · type · confirmed?: readonly PermissionKey[]; +ServiceApiWrite · type · }) => Promise<{ +ServiceApiWrite · type · operation_id: string; +ServiceApiWrite · type · result: unknown; +ServiceApiWrite · type · }>; +SettingRow · interface · export interface SettingRow { +SettingRow · interface · setting: string; +SettingRow · interface · value: unknown; +SettingRow · interface · default: string | number | boolean; +SettingRow · interface · from: "config file" | "default"; +SettingRow · interface · description: string; +SettingRow · interface · } +Settings · interface · export interface Settings extends AISettings { +Settings · interface · profile: string; +Settings · interface · json: boolean; +Settings · interface · jsonl: boolean; +Settings · interface · quiet: boolean; +Settings · interface · detail: 0 | 1 | 2; +Settings · interface · trace: boolean; +Settings · interface · offline: boolean; +Settings · interface · color: boolean | undefined; +Settings · interface · senderColors: boolean; +Settings · interface · searchCatchUp?: boolean; +Settings · interface · historyLimits?: HistoryLimits; +Settings · interface · historyMuted?: boolean; +Settings · interface · pictureSearch?: boolean; +Settings · interface · searchReranker?: string; +Settings · interface · limit: number; +Settings · interface · page: number; +Settings · interface · all: boolean; +Settings · interface · timeoutMs: number | undefined; +Settings · interface · commandTimeoutMs: number | undefined; +Settings · interface · record: boolean; +Settings · interface · recordInput?: RecordInput; +Settings · interface · keepFailedRuns: boolean; +Settings · interface · keepRunsForDays: number; +Settings · interface · keepSuccessfulRunsForDays?: number; +Settings · interface · keepStoreRunsForDays?: number; +Settings · interface · runsSizeLimitMb?: number; +Settings · interface · readOnlyLock?: string; +Settings · interface · permissions: Readonly>; +Settings · interface · permissionSources: Readonly>; +Settings · interface · sendsPerHour: number; +Settings · interface · requestsPerMinute?: number; +Settings · interface · kind: ProfileKind; +Settings · interface · readOtherBots: boolean | readonly string[]; +Settings · interface · updateCheck: boolean; +Settings · interface · skillHint: boolean; +Settings · interface · configPath: string; +Settings · interface · configFound: boolean; +Settings · interface · configuredProfiles: string[]; +Settings · interface · profilesHere: string[]; +Settings · interface · accountProfiles?: string[]; +Settings · interface · botProfiles?: string[]; +Settings · interface · sources: Record; +Settings · interface · configured: Scope; +Settings · interface · shared: Scope; +Settings · interface · configIssues?: ConfigIssue[]; +Settings · interface · savedPermissions?: { +Settings · interface · key: PermissionKey; +Settings · interface · at: string[]; +Settings · interface · }[]; +Settings · interface · } +Settings · interface · type Scope = Record; +SettingsExtension · interface · export interface SettingsExtension> { +SettingsExtension · interface · schema?: v.GenericSchema; +SettingsExtension · interface · sourcePaths?: boolean; +SettingsExtension · interface · parseDuration?: (value: string, source: string) => number; +SettingsExtension · interface · resolve?: (context: SettingsExtensionContext) => { +SettingsExtension · interface · values: T; +SettingsExtension · interface · sources: Record; +SettingsExtension · interface · }; +SettingsExtension · interface · profile?: v.ObjectEntries; +SettingsExtension · interface · personal?: v.ObjectEntries; +SettingsExtension · interface · defaults?: v.ObjectEntries; +SettingsExtension · interface · settings?: readonly DeclaredSetting[]; +SettingsExtension · interface · profiles?: (env: NodeJS.ProcessEnv) => string[]; +SettingsExtension · interface · permissions?: CommandPermissions; +SettingsExtension · interface · configRepair?: boolean; +SettingsExtension · interface · } +SettingsExtensionContext · interface · export interface SettingsExtensionContext { +SettingsExtensionContext · interface · flags: GlobalFlags; +SettingsExtensionContext · interface · settings: Settings; +SettingsExtensionContext · interface · layers: [Source, Scope | undefined][]; +SettingsExtensionContext · interface · fromLayers: (key: string, fallback: T) => { +SettingsExtensionContext · interface · value: T; +SettingsExtensionContext · interface · from: Source; +SettingsExtensionContext · interface · }; +SettingsExtensionContext · interface · } +SettingsExtensionContext · interface · type Scope = Record; +Setup · interface · export interface Setup { +Setup · interface · readonly app: AppIdentity; +Setup · interface · readonly document: SetupDocument; +Setup · interface · readonly definition: SetupDefinition; +Setup · interface · } +SetupAsset · interface · export interface Asset { +SetupAsset · interface · file: string; +SetupAsset · interface · width?: number; +SetupAsset · interface · height?: number; +SetupAsset · interface · } +SetupBlock · type · export type Block = TextBlock | HeadingBlock | NoteBlock | ImageBlock | CodeBlock | InputBlock | ChoiceBlock | GroupBlock | LinkBlock | RequirementBlock | DividerBlock; +SetupCheck · type · export type SetupCheck = (input: SetupCheckInput) => Promise<(Record & { +SetupCheck · type · keep?: SetupKeep; +SetupCheck · type · }) | undefined>; +SetupCheckInput · interface · export interface SetupCheckInput { +SetupCheckInput · interface · command: Command; +SetupCheckInput · interface · profile: string; +SetupCheckInput · interface · settings: Settings; +SetupCheckInput · interface · secrets: Readonly>; +SetupCheckInput · interface · answers: Readonly>; +SetupCheckInput · interface · steps: SignInSteps; +SetupCheckInput · interface · } +SetupCondition · type · export type Condition = { +SetupCondition · type · field: string; +SetupCondition · type · is: string | number | boolean; +SetupCondition · type · } | { +SetupCondition · type · field: string; +SetupCondition · type · in: (string | number)[]; +SetupCondition · type · } | { +SetupCondition · type · field: string; +SetupCondition · type · set: boolean; +SetupCondition · type · } | { +SetupCondition · type · result: string; +SetupCondition · type · is: "ok"; +SetupCondition · type · } | { +SetupCondition · type · result: string; +SetupCondition · type · error: string; +SetupCondition · type · } | { +SetupCondition · type · all: Condition[]; +SetupCondition · type · } | { +SetupCondition · type · any: Condition[]; +SetupCondition · type · } | { +SetupCondition · type · not: Condition; +SetupCondition · type · }; +SetupDefinition · interface · export interface SetupDefinition { +SetupDefinition · interface · app: AppIdentity; +SetupDefinition · interface · configuration: Pick; +SetupDefinition · interface · requires?: string[]; +SetupDefinition · interface · start: string; +SetupDefinition · interface · steps: Record; +SetupDefinition · interface · assets?: Record; +SetupDefinition · interface · texts: { +SetupDefinition · interface · en: Texts; +SetupDefinition · interface · } & Record; +SetupDefinition · interface · check?: SetupCheck; +SetupDefinition · interface · ownerOnly?: OwnerOnlySettings; +SetupDefinition · interface · } +SetupDocument · interface · export interface SetupDocument { +SetupDocument · interface · format: typeof SETUP_FORMAT; +SetupDocument · interface · version: typeof SETUP_VERSION; +SetupDocument · interface · tool: string; +SetupDocument · interface · toolVersion?: string; +SetupDocument · interface · requires?: string[]; +SetupDocument · interface · start: string; +SetupDocument · interface · steps: Record; +SetupDocument · interface · assets?: Record; +SetupDocument · interface · texts: { +SetupDocument · interface · en: Texts; +SetupDocument · interface · } & Record; +SetupDocument · interface · values?: Record; +SetupDocument · interface · } +SetupKeep · interface · export interface SetupKeep { +SetupKeep · interface · secrets?: Readonly>; +SetupKeep · interface · account?: string; +SetupKeep · interface · } +SetupStep · interface · export interface Step { +SetupStep · interface · title: string; +SetupStep · interface · kind?: (typeof STEP_KINDS)[number]; +SetupStep · interface · blocks?: Block[]; +SetupStep · interface · next?: string | Edge[]; +SetupStep · interface · back?: boolean; +SetupStep · interface · action?: string; +SetupStep · interface · asks?: Record; +SetupStep · interface · result?: string; +SetupStep · interface · } +SignInSteps · interface · export interface SignInSteps { +SignInSteps · interface · readonly json: boolean; +SignInSteps · interface · readonly answers: boolean; +SignInSteps · interface · openUrl: (url: string, purpose: string) => void; +SignInSteps · interface · pairingCode: (code: string, where: string, expiresAt?: Date) => void; +SignInSteps · interface · progress: (step: string, message: string) => void; +SignInSteps · interface · ask: (need: Need, signal?: AbortSignal) => Promise; +SignInSteps · interface · } +SignInStepsOptions · interface · export interface SignInStepsOptions { +SignInStepsOptions · interface · diagnostic: (line: string) => void; +SignInStepsOptions · interface · json: boolean; +SignInStepsOptions · interface · answers: boolean; +SignInStepsOptions · interface · input?: NodeJS.ReadableStream; +SignInStepsOptions · interface · lines?: (signal?: AbortSignal) => Promise; +SignInStepsOptions · interface · } +SignedOut · interface · export interface SignedOut { +SignedOut · interface · revoked: boolean | null; +SignedOut · interface · removed: string[]; +SignedOut · interface · } +Slot · interface · export interface Slot { +Slot · interface · at: string; +Slot · interface · on?: Weekday; +Slot · interface · } +StoredMessages · interface · export interface StoredMessages { +StoredMessages · interface · message(chatId: Id, messageId: Id): Promise; +StoredMessages · interface · threadMessages?(chatId: Id, threadId: Id, window: { +StoredMessages · interface · limit: number; +StoredMessages · interface · before?: Id; +StoredMessages · interface · }): Promise>; +StoredMessages · interface · newestIncoming(chatId: Id, before?: Id): Promise; +StoredMessages · interface · anchor(chatId: Id, at?: string): Promise; +StoredMessages · interface · wroteTo(personId: Id): Promise; +StoredMessages · interface · pollVotes(chatId: Id, messageId: Id): Promise; +StoredMessages · interface · reactors(chatId: Id, messageId: Id): Promise; +StoredMessages · interface · } +TokenSessionOptions · interface · export interface TokenSessionOptions { +TokenSessionOptions · interface · app: AppIdentity; +TokenSessionOptions · interface · service: string; +TokenSessionOptions · interface · resolveSettings: (flags: GlobalFlags, options?: ResolveOptions) => Settings; +TokenSessionOptions · interface · verify: (command: Command, token: string, events: EventSink, site: string | undefined) => Promise<{ +TokenSessionOptions · interface · id: string; +TokenSessionOptions · interface · account: Readonly>; +TokenSessionOptions · interface · }>; +TokenSessionOptions · interface · site?: { +TokenSessionOptions · interface · example: string; +TokenSessionOptions · interface · }; +TokenSessionOptions · interface · login?: { +TokenSessionOptions · interface · page?: (site: string | undefined) => string; +TokenSessionOptions · interface · }; +TokenSessionOptions · interface · claim?: (env: NodeJS.ProcessEnv, profile: string, id: string, tokens: ProfileTokenStore, keyring: KeyringStore | undefined) => void; +TokenSessionOptions · interface · token?: string; +TokenSessionOptions · interface · about?: string; +TokenSessionOptions · interface · guide?: string; +TokenSessionOptions · interface · endNote?: string; +TokenSessionOptions · interface · } +TokenStorage · type · export type TokenStorage = "keyring" | "file"; +Transcript · interface · export interface Transcript { +Transcript · interface · text: string; +Transcript · interface · pending: boolean; +Transcript · interface · } +UpgradeContext · interface · export interface UpgradeContext extends Omit { +UpgradeContext · interface · renderer: Renderer; +UpgradeContext · interface · format: RenderFormat; +UpgradeContext · interface · streams: Streams; +UpgradeContext · interface · } +WarningEvent · interface · export interface WarningEvent { +WarningEvent · interface · event: "warning"; +WarningEvent · interface · code: string; +WarningEvent · interface · operation?: string; +WarningEvent · interface · detail?: string; +WarningEvent · interface · counts?: Record; +WarningEvent · interface · } +When · type · export type When = { +When · type · every: number; +When · type · } | { +When · type · daily: string; +When · type · } | { +When · type · weekly: string; +When · type · on: Weekday; +When · type · } | { +When · type · calendar: Slot[]; +When · type · } | { +When · type · once: string; +When · type · }; +accountCommand · const · export declare const accountCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +accountFileFor · const · export declare const accountFileFor: (app: AppIdentity, profile: string, env: NodeJS.ProcessEnv) => string; +accountRemoveCommand · const · export declare const accountRemoveCommand: (app: AppIdentity, removal: AccountRemoval, options?: AccountRemoveOptions) => Command; +actorOf · const · export declare const actorOf: (command: Command, asOwner?: boolean) => string; +addContractInfo · const · export declare const addContractInfo: (root: Command, output: (value: unknown) => void, options?: ContractEvidenceOptions) => Command; +addMeetingPreparationCommand · const · export declare const addMeetingPreparationCommand: (program: import("commander").Command, deps: { +addMeetingPreparationCommand · const · read: import("./meeting-preparation-read.js").MeetingPreparationReader; +addMeetingPreparationCommand · const · output: (answer: Awaited>) => void; +addMeetingPreparationCommand · const · signal: () => AbortSignal | undefined; +addMeetingPreparationCommand · const · now?: () => number; +addMeetingPreparationCommand · const · communications?: boolean; +addMeetingPreparationCommand · const · }) => import("commander").Command; +agentFor · const · export declare const agentFor: (context: { +agentFor · const · format: RenderFormat; +agentFor · const · stdin: NodeJS.ReadableStream & { +agentFor · const · isTTY?: boolean; +agentFor · const · }; +agentFor · const · }, given: Agent | undefined, pad: number, prompt?: Pick) => Promise; +answerEntity · const · export declare const answerEntity: (command: Command, name: string, schema: v.GenericSchema, options?: { +answerEntity · const · project?: v.GenericSchema; +answerEntity · const · row?: RowShape; +answerEntity · const · }) => Command; +answerFields · const · export declare const answerFields: (command: Command | undefined, resolve?: JsonFieldsResolver) => string[] | undefined; +answerSchema · const · export declare const answerSchema: (item?: v.GenericSchema) => v.UnionSchema<[v.StrictObjectSchema<{ +answerSchema · const · readonly items: v.ArraySchema; +answerSchema · const · readonly page: v.VariantSchema<"mode", [v.StrictObjectSchema<{ +answerSchema · const · readonly mode: v.LiteralSchema<"page", undefined>; +answerSchema · const · readonly limit: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly has_more: v.BooleanSchema; +answerSchema · const · readonly next_page: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>, undefined>; +answerSchema · const · readonly total: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly relation: v.PicklistSchema<["eq", "gte"], undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · }, undefined>, v.StrictObjectSchema<{ +answerSchema · const · readonly mode: v.LiteralSchema<"cursor", undefined>; +answerSchema · const · readonly limit: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly has_more: v.BooleanSchema; +answerSchema · const · readonly next_cursor: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly total: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly relation: v.PicklistSchema<["eq", "gte"], undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · }, undefined>], undefined>; +answerSchema · const · readonly next: v.OptionalSchema; +answerSchema · const · readonly step: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly command: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly args: v.RecordSchema, v.UnknownSchema, undefined>; +answerSchema · const · readonly line: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly safe_to_auto_execute: v.BooleanSchema; +answerSchema · const · }, undefined>, v.StrictObjectSchema<{ +answerSchema · const · readonly kind: v.LiteralSchema<"user_action", undefined>; +answerSchema · const · readonly step: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly safe_to_auto_execute: v.LiteralSchema; +answerSchema · const · }, undefined>], undefined>, undefined>, v.MaxLengthAction<({ +answerSchema · const · kind: "command"; +answerSchema · const · step: string; +answerSchema · const · command: string; +answerSchema · const · args: { +answerSchema · const · [x: string]: unknown; +answerSchema · const · }; +answerSchema · const · line?: string | undefined; +answerSchema · const · why: string; +answerSchema · const · safe_to_auto_execute: boolean; +answerSchema · const · } | { +answerSchema · const · kind: "user_action"; +answerSchema · const · step: string; +answerSchema · const · why: string; +answerSchema · const · safe_to_auto_execute: false; +answerSchema · const · })[], 2, undefined>]>, undefined>; +answerSchema · const · readonly missing: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly step: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · readonly meta: v.StrictObjectSchema<{ +answerSchema · const · readonly run_id: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly duration_ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly accounts: v.OptionalSchema, v.RegexAction]>, undefined>, undefined>; +answerSchema · const · readonly complete: v.BooleanSchema; +answerSchema · const · readonly issues: v.OptionalSchema; +answerSchema · const · readonly reason: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly source: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · readonly truncated: v.OptionalSchema, undefined>; +answerSchema · const · readonly timezone: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly now: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · readonly now_local: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly window: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · readonly until: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly ranking: v.OptionalSchema; +answerSchema · const · readonly reason_id: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly provider: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly model: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly endpoint: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly sent: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly cost_usd: v.NullableSchema, v.MinValueAction]>, undefined>; +answerSchema · const · readonly usage: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly output: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly model_run: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly model: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly endpoint: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly sent: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly done: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly left: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly usage: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly output: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly cost_usd: v.NullableSchema, v.MinValueAction]>, undefined>; +answerSchema · const · readonly ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly query: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly chat_id: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly title: v.NullableSchema, v.RegexAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly respelled: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly tried: v.SchemaWithPipe, v.RegexAction]>, undefined>, v.MinLengthAction]>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · }, undefined>; +answerSchema · const · }, undefined>, v.StrictObjectSchema<{ +answerSchema · const · readonly item: v.GenericSchema; +answerSchema · const · readonly next: v.OptionalSchema; +answerSchema · const · readonly step: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly command: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly args: v.RecordSchema, v.UnknownSchema, undefined>; +answerSchema · const · readonly line: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly safe_to_auto_execute: v.BooleanSchema; +answerSchema · const · }, undefined>, v.StrictObjectSchema<{ +answerSchema · const · readonly kind: v.LiteralSchema<"user_action", undefined>; +answerSchema · const · readonly step: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly safe_to_auto_execute: v.LiteralSchema; +answerSchema · const · }, undefined>], undefined>, undefined>, v.MaxLengthAction<({ +answerSchema · const · kind: "command"; +answerSchema · const · step: string; +answerSchema · const · command: string; +answerSchema · const · args: { +answerSchema · const · [x: string]: unknown; +answerSchema · const · }; +answerSchema · const · line?: string | undefined; +answerSchema · const · why: string; +answerSchema · const · safe_to_auto_execute: boolean; +answerSchema · const · } | { +answerSchema · const · kind: "user_action"; +answerSchema · const · step: string; +answerSchema · const · why: string; +answerSchema · const · safe_to_auto_execute: false; +answerSchema · const · })[], 2, undefined>]>, undefined>; +answerSchema · const · readonly missing: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly why: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly step: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · readonly meta: v.StrictObjectSchema<{ +answerSchema · const · readonly run_id: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly duration_ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly accounts: v.OptionalSchema, v.RegexAction]>, undefined>, undefined>; +answerSchema · const · readonly complete: v.BooleanSchema; +answerSchema · const · readonly issues: v.OptionalSchema; +answerSchema · const · readonly reason: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly source: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · readonly truncated: v.OptionalSchema, undefined>; +answerSchema · const · readonly timezone: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly now: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · readonly now_local: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly window: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · readonly until: v.OptionalSchema, v.IsoTimestampAction, v.EndsWithAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly ranking: v.OptionalSchema; +answerSchema · const · readonly reason_id: v.OptionalSchema, v.RegexAction]>, undefined>; +answerSchema · const · readonly provider: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly model: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly endpoint: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly sent: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly cost_usd: v.NullableSchema, v.MinValueAction]>, undefined>; +answerSchema · const · readonly usage: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly output: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly model_run: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly model: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly endpoint: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly sent: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly done: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly left: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly usage: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · readonly output: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly cost_usd: v.NullableSchema, v.MinValueAction]>, undefined>; +answerSchema · const · readonly ms: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly query: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly chat_id: v.SchemaWithPipe, v.RegexAction]>; +answerSchema · const · readonly title: v.NullableSchema, v.RegexAction]>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · readonly respelled: v.OptionalSchema, v.RegexAction]>; +answerSchema · const · readonly tried: v.SchemaWithPipe, v.RegexAction]>, undefined>, v.MinLengthAction]>; +answerSchema · const · }, undefined>, undefined>, undefined>; +answerSchema · const · }, undefined>, undefined>; +answerSchema · const · }, undefined>; +answerSchema · const · }, undefined>], undefined>; +answerStdinOption · const · export declare const answerStdinOption: () => Option; +apiFlagOf · const · export declare const apiFlagOf: (name: string) => string; +apiJson · const · export declare const apiJson: (value: unknown) => string; +apiPlainJson · const · export declare const apiPlainJson: (value: unknown) => unknown; +appCompleteCommand · const · export declare const appCompleteCommand: (app: Pick, config: Pick<{ +appCompleteCommand · const · resolveSettings: (flags?: import("./settings.js").GlobalFlags, options?: import("./settings.js").ResolveOptions) => import("./settings.js").Settings & object; +appCompleteCommand · const · configuredProfiles: (options?: import("./settings.js").ResolveOptions) => string[]; +appCompleteCommand · const · settingSchema: (key: string) => import("valibot").GenericSchema | undefined; +appCompleteCommand · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +appCompleteCommand · const · profile: string | undefined; +appCompleteCommand · const · setting: string; +appCompleteCommand · const · value: string | undefined; +appCompleteCommand · const · kind?: import("./settings.js").ProfileKind | undefined; +appCompleteCommand · const · root?: boolean; +appCompleteCommand · const · }) => unknown; +appCompleteCommand · const · migrate: (path: string) => string[]; +appCompleteCommand · const · declaredSettings: import("./setting-defaults.js").DeclaredSetting[]; +appCompleteCommand · const · allSettings: string[]; +appCompleteCommand · const · defaultsOnlyKeys: string[]; +appCompleteCommand · const · schema: import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · defaults: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingProvider"]; +appCompleteCommand · const · embedding_model: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingModel"]; +appCompleteCommand · const · embedding_base_url: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingBaseUrl"]; +appCompleteCommand · const · embedding_dims: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingDims"]; +appCompleteCommand · const · models: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["models"]; +appCompleteCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appCompleteCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appCompleteCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · update_check: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · skill_hint: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appCompleteCommand · const · profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · embedding_provider: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingProvider"]; +appCompleteCommand · const · embedding_model: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingModel"]; +appCompleteCommand · const · embedding_base_url: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingBaseUrl"]; +appCompleteCommand · const · embedding_dims: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["embeddingDims"]; +appCompleteCommand · const · models: ({ +appCompleteCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appCompleteCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appCompleteCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appCompleteCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appCompleteCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appCompleteCommand · const · }, undefined>, undefined>, undefined>; +appCompleteCommand · const · })["models"]; +appCompleteCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appCompleteCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appCompleteCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appCompleteCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appCompleteCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +appCompleteCommand · const · personal: import("valibot").OptionalSchema string>, undefined>; +appCompleteCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appCompleteCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appCompleteCommand · const · bot: import("valibot").OptionalSchema string>, undefined>; +appCompleteCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appCompleteCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appCompleteCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>; +appCompleteCommand · const · permissions?: import("./permission-keys.js").CommandPermissions | undefined; +appCompleteCommand · const · }, "configuredProfiles">, options?: import("./complete-command.js").AppCompletionOptions | undefined) => import("commander").Command; +appDoctorCommand · const · export declare const appDoctorCommand: (app: import("./entry.js").AppIdentity, configuration: { +appDoctorCommand · const · resolveSettings: (flags?: import("./settings.js").GlobalFlags, options?: import("./settings.js").ResolveOptions) => import("./settings.js").Settings & object; +appDoctorCommand · const · configuredProfiles: (options?: import("./settings.js").ResolveOptions) => string[]; +appDoctorCommand · const · settingSchema: (key: string) => import("valibot").GenericSchema | undefined; +appDoctorCommand · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +appDoctorCommand · const · profile: string | undefined; +appDoctorCommand · const · setting: string; +appDoctorCommand · const · value: string | undefined; +appDoctorCommand · const · kind?: import("./settings.js").ProfileKind | undefined; +appDoctorCommand · const · root?: boolean; +appDoctorCommand · const · }) => unknown; +appDoctorCommand · const · migrate: (path: string) => string[]; +appDoctorCommand · const · declaredSettings: import("./setting-defaults.js").DeclaredSetting[]; +appDoctorCommand · const · allSettings: string[]; +appDoctorCommand · const · defaultsOnlyKeys: string[]; +appDoctorCommand · const · schema: import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · defaults: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingProvider"]; +appDoctorCommand · const · embedding_model: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingModel"]; +appDoctorCommand · const · embedding_base_url: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingBaseUrl"]; +appDoctorCommand · const · embedding_dims: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingDims"]; +appDoctorCommand · const · models: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["models"]; +appDoctorCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appDoctorCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appDoctorCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · update_check: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · skill_hint: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appDoctorCommand · const · profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · embedding_provider: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingProvider"]; +appDoctorCommand · const · embedding_model: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingModel"]; +appDoctorCommand · const · embedding_base_url: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingBaseUrl"]; +appDoctorCommand · const · embedding_dims: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["embeddingDims"]; +appDoctorCommand · const · models: ({ +appDoctorCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appDoctorCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appDoctorCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appDoctorCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appDoctorCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appDoctorCommand · const · }, undefined>, undefined>, undefined>; +appDoctorCommand · const · })["models"]; +appDoctorCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appDoctorCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appDoctorCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appDoctorCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appDoctorCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +appDoctorCommand · const · personal: import("valibot").OptionalSchema string>, undefined>; +appDoctorCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appDoctorCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appDoctorCommand · const · bot: import("valibot").OptionalSchema string>, undefined>; +appDoctorCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appDoctorCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appDoctorCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>; +appDoctorCommand · const · permissions?: import("./permission-keys.js").CommandPermissions | undefined; +appDoctorCommand · const · }, options?: import("./app-doctor-command.js").AppDoctorOptions | undefined) => import("commander").Command; +appMcpCommand · const · export declare const appMcpCommand: (app: import("./entry.js").AppIdentity, configuration: { +appMcpCommand · const · resolveSettings: (flags?: import("./settings.js").GlobalFlags, options?: import("./settings.js").ResolveOptions) => import("./settings.js").Settings & object; +appMcpCommand · const · configuredProfiles: (options?: import("./settings.js").ResolveOptions) => string[]; +appMcpCommand · const · settingSchema: (key: string) => import("valibot").GenericSchema | undefined; +appMcpCommand · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +appMcpCommand · const · profile: string | undefined; +appMcpCommand · const · setting: string; +appMcpCommand · const · value: string | undefined; +appMcpCommand · const · kind?: import("./settings.js").ProfileKind | undefined; +appMcpCommand · const · root?: boolean; +appMcpCommand · const · }) => unknown; +appMcpCommand · const · migrate: (path: string) => string[]; +appMcpCommand · const · declaredSettings: import("./setting-defaults.js").DeclaredSetting[]; +appMcpCommand · const · allSettings: string[]; +appMcpCommand · const · defaultsOnlyKeys: string[]; +appMcpCommand · const · schema: import("valibot").StrictObjectSchema<{ +appMcpCommand · const · defaults: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingProvider"]; +appMcpCommand · const · embedding_model: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingModel"]; +appMcpCommand · const · embedding_base_url: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingBaseUrl"]; +appMcpCommand · const · embedding_dims: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingDims"]; +appMcpCommand · const · models: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["models"]; +appMcpCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appMcpCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appMcpCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appMcpCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appMcpCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · update_check: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · skill_hint: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appMcpCommand · const · profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · embedding_provider: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingProvider"]; +appMcpCommand · const · embedding_model: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingModel"]; +appMcpCommand · const · embedding_base_url: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingBaseUrl"]; +appMcpCommand · const · embedding_dims: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["embeddingDims"]; +appMcpCommand · const · models: ({ +appMcpCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +appMcpCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +appMcpCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +appMcpCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +appMcpCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +appMcpCommand · const · }, undefined>, undefined>, undefined>; +appMcpCommand · const · })["models"]; +appMcpCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +appMcpCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +appMcpCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appMcpCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +appMcpCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +appMcpCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +appMcpCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +appMcpCommand · const · personal: import("valibot").OptionalSchema string>, undefined>; +appMcpCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appMcpCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appMcpCommand · const · bot: import("valibot").OptionalSchema string>, undefined>; +appMcpCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +appMcpCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +appMcpCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>; +appMcpCommand · const · permissions?: import("./permission-keys.js").CommandPermissions | undefined; +appMcpCommand · const · }, options: import("./app-mcp-command.js").AppMcpOptions) => import("commander").Command; +asFirstWord · const · export declare const asFirstWord: (profile: string) => string; +attachmentsCommand · const · export declare const attachmentsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +baseContext · const · export declare const baseContext: (command: Command, resolveSettings: Resolve) => BaseContext; +baseContext · const · type Resolve = (flags: GlobalFlags, options?: ResolveOptions) => Settings; +botCommand · const · export declare const botCommand: (bot: import("./index.js").BotMessenger) => import("commander").Command; +botContext · const · export declare const botContext: (command: Command, bot: BotMessenger, resolving?: Pick) => { +botContext · const · settings: Settings; +botContext · const · renderer: import("@wirecat/cli-base").Renderer; +botContext · const · format: import("@wirecat/cli-base").RenderFormat; +botContext · const · color: boolean; +botContext · const · streams: import("@wirecat/cli-base").Streams; +botContext · const · compact?: boolean; +botContext · const · full?: boolean; +botContext · const · env: NodeJS.ProcessEnv; +botContext · const · keyring?: import("@wirecat/cli-base").KeyringStore; +botContext · const · run: (body: (events: import("../index.js").EventSink) => Promise, options?: { +botContext · const · unbounded?: boolean; +botContext · const · name?: string; +botContext · const · }) => Promise; +botContext · const · track: (closeable: import("../deadline.js").Closeable) => void; +botContext · const · profile: string; +botContext · const · words: string; +botContext · const · tokens: BotTokenStore; +botContext · const · registry: ChatRegistry; +botContext · const · recipients: () => RecipientList; +botContext · const · journal: () => SendJournal; +botContext · const · copy: { +botContext · const · accountOf: (botId: string) => import("../../store/types.js").AccountKey; +botContext · const · keep: (botId: string, messages: readonly import("../../index.js").Message[], via: import("../../store/types.js").IngestedVia, warn: (message: string) => void, senders?: readonly import("../../store/types.js").PersonFacts[]) => Promise; +botContext · const · keepChat: (botId: string, chat: import("../../index.js").Chat, warn: (message: string) => void) => Promise; +botContext · const · forget: (botId: string, chatId: string, messageIds: string[], warn: (message: string) => void) => Promise; +botContext · const · received: (botId: string, events: readonly import("./port.js").BotEvent[], warn: (message: string) => void) => Promise>; +botContext · const · settle: (botId: string, events: readonly import("./port.js").BotEvent[], error: string | null, warn: (message: string) => void) => Promise; +botContext · const · read: (read: (store: import("../../store/message-store.js").MessageStore) => Promise) => Promise; +botContext · const · }; +botContext · const · guard: (permissionDefaults?: Readonly>) => import("../../sends/guard.js").SendGuard; +botContext · const · chatRef: (typed: string) => BotChatRef; +botContext · const · readSecret: (prompt: string) => Promise; +botContext · const · connect: (token: string, options?: BotConnectOptions) => Promise; +botContext · const · authenticated: (options?: BotConnectOptions) => Promise; +botContext · const · }; +botCopy · const · export declare const botCopy: (provider: Provider) => { +botCopy · const · accountOf: (botId: string) => AccountKey; +botCopy · const · keep: (botId: string, messages: readonly Message[], via: IngestedVia, warn: (message: string) => void, senders?: readonly PersonFacts[]) => Promise; +botCopy · const · keepChat: (botId: string, chat: Chat, warn: (message: string) => void) => Promise; +botCopy · const · forget: (botId: string, chatId: string, messageIds: string[], warn: (message: string) => void) => Promise; +botCopy · const · received: (botId: string, events: readonly BotEvent[], warn: (message: string) => void) => Promise>; +botCopy · const · settle: (botId: string, events: readonly BotEvent[], error: string | null, warn: (message: string) => void) => Promise; +botCopy · const · read: (read: (store: MessageStore) => Promise) => Promise; +botCopy · const · }; +bufferedInput · const · export declare const bufferedInput: (input: NodeJS.ReadableStream, options?: { +bufferedInput · const · maxBytes?: number; +bufferedInput · const · signal?: AbortSignal; +bufferedInput · const · }) => Promise; +changesAuthority · const · export declare const changesAuthority: (command: Command) => boolean; +changesAuthorityAt · const · export declare const changesAuthorityAt: (root: Command) => (path: readonly string[]) => boolean; +chatsCommand · const · export declare const chatsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +checkApiBody · const · export declare const checkApiBody: (operation: ManifestOperation, text: string | undefined, schemas: Readonly>) => string | undefined; +checkApiParameter · const · export declare const checkApiParameter: (name: string, node: SchemaNode, raw: string, schemas: Readonly>) => string | undefined; +checkConfigText · const · export declare const checkConfigText: (text: string, { file, tool, schema, knownPermissions, repair, }: { +checkConfigText · const · file: string; +checkConfigText · const · tool: string; +checkConfigText · const · schema: T; +checkConfigText · const · knownPermissions?: ReadonlySet; +checkConfigText · const · repair?: boolean; +checkConfigText · const · }) => { +checkConfigText · const · issues: ConfigIssue[]; +checkConfigText · const · config: v.InferOutput | undefined; +checkConfigText · const · }; +checkGuide · const · export declare const checkGuide: (build: () => Command, { packageRoot }?: { +checkGuide · const · packageRoot?: string; +checkGuide · const · }) => Promise; +checkJson · const · export declare const checkJson: (command: Command, { json, fields }: Omit, terminal: boolean, resolve?: JsonFieldsResolver) => void; +commandHelpMarkdown · const · export declare const commandHelpMarkdown: (root: Command, path: readonly string[]) => string[]; +commandPath · const · export declare const commandPath: (command: Command) => string; +commandPathKey · const · export declare const commandPathKey: (path: readonly string[]) => PermissionKey | null; +commandPermissions · const · export declare const commandPermissions: ({ keyOf, extra, defaults, alsoChecks, }?: Partial) => CommandPermissions; +commandRuns · const · export declare const commandRuns: (options: CommandRunOptions) => CommandRuns; +commandWords · const · export declare const commandWords: (program: Command) => Set; +commandsCommand · const · export declare const commandsCommand: (app: import("./entry.js").AppIdentity) => import("commander").Command; +commandsText · const · export declare const commandsText: (root: Command, commands: readonly CommandInfo[], scope?: readonly string[]) => string; +completeCommand · const · export declare const completeCommand: (messenger: import("./index.js").Messenger, config: Pick<{ +completeCommand · const · resolveSettings: (flags?: import("./settings.js").GlobalFlags, options?: import("./settings.js").ResolveOptions) => import("./settings.js").Settings & object; +completeCommand · const · configuredProfiles: (options?: import("./settings.js").ResolveOptions) => string[]; +completeCommand · const · settingSchema: (key: string) => import("valibot").GenericSchema | undefined; +completeCommand · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +completeCommand · const · profile: string | undefined; +completeCommand · const · setting: string; +completeCommand · const · value: string | undefined; +completeCommand · const · kind?: import("./settings.js").ProfileKind | undefined; +completeCommand · const · root?: boolean; +completeCommand · const · }) => unknown; +completeCommand · const · migrate: (path: string) => string[]; +completeCommand · const · declaredSettings: import("./setting-defaults.js").DeclaredSetting[]; +completeCommand · const · allSettings: string[]; +completeCommand · const · defaultsOnlyKeys: string[]; +completeCommand · const · schema: import("valibot").StrictObjectSchema<{ +completeCommand · const · defaults: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingProvider"]; +completeCommand · const · embedding_model: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingModel"]; +completeCommand · const · embedding_base_url: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingBaseUrl"]; +completeCommand · const · embedding_dims: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingDims"]; +completeCommand · const · models: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["models"]; +completeCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +completeCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +completeCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +completeCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +completeCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · update_check: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · skill_hint: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +completeCommand · const · profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema<{ +completeCommand · const · embedding_provider: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingProvider"]; +completeCommand · const · embedding_model: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingModel"]; +completeCommand · const · embedding_base_url: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingBaseUrl"]; +completeCommand · const · embedding_dims: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["embeddingDims"]; +completeCommand · const · models: ({ +completeCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +completeCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +completeCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +completeCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +completeCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +completeCommand · const · }, undefined>, undefined>, undefined>; +completeCommand · const · })["models"]; +completeCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +completeCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +completeCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +completeCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +completeCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +completeCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +completeCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +completeCommand · const · personal: import("valibot").OptionalSchema string>, undefined>; +completeCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +completeCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +completeCommand · const · bot: import("valibot").OptionalSchema string>, undefined>; +completeCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +completeCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +completeCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>; +completeCommand · const · permissions?: import("./permission-keys.js").CommandPermissions | undefined; +completeCommand · const · }, "configuredProfiles">, options?: import("./messenger/complete-command.js").CompletionOptions | undefined) => import("commander").Command; +configCommand · const · export declare const configCommand: (app: import("./entry.js").AppIdentity, config: { +configCommand · const · resolveSettings: (flags?: import("./settings.js").GlobalFlags, options?: import("./settings.js").ResolveOptions) => import("./settings.js").Settings & object; +configCommand · const · configuredProfiles: (options?: import("./settings.js").ResolveOptions) => string[]; +configCommand · const · settingSchema: (key: string) => import("valibot").GenericSchema | undefined; +configCommand · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +configCommand · const · profile: string | undefined; +configCommand · const · setting: string; +configCommand · const · value: string | undefined; +configCommand · const · kind?: import("./settings.js").ProfileKind | undefined; +configCommand · const · root?: boolean; +configCommand · const · }) => unknown; +configCommand · const · migrate: (path: string) => string[]; +configCommand · const · declaredSettings: import("./setting-defaults.js").DeclaredSetting[]; +configCommand · const · allSettings: string[]; +configCommand · const · defaultsOnlyKeys: string[]; +configCommand · const · schema: import("valibot").StrictObjectSchema<{ +configCommand · const · defaults: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingProvider"]; +configCommand · const · embedding_model: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingModel"]; +configCommand · const · embedding_base_url: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingBaseUrl"]; +configCommand · const · embedding_dims: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingDims"]; +configCommand · const · models: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["models"]; +configCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +configCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +configCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +configCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +configCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · update_check: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · skill_hint: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +configCommand · const · profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema<{ +configCommand · const · embedding_provider: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingProvider"]; +configCommand · const · embedding_model: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingModel"]; +configCommand · const · embedding_base_url: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingBaseUrl"]; +configCommand · const · embedding_dims: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["embeddingDims"]; +configCommand · const · models: ({ +configCommand · const · embeddingProvider: import("valibot").OptionalSchema, undefined>; +configCommand · const · embeddingModel: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · embeddingBaseUrl: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · embeddingDims: import("valibot").OptionalSchema, import("valibot").IntegerAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>, undefined>; +configCommand · const · models: import("valibot").OptionalSchema, import("valibot").RegexAction]>, import("valibot").StrictObjectSchema<{ +configCommand · const · readonly provider: import("valibot").OptionalSchema, undefined>; +configCommand · const · readonly model: import("valibot").OptionalSchema, import("valibot").TrimAction, import("valibot").MinLengthAction, import("valibot").MaxLengthAction]>, undefined>; +configCommand · const · readonly base_url: import("valibot").OptionalSchema, import("valibot").CheckAction]>, undefined>; +configCommand · const · }, undefined>, undefined>, undefined>; +configCommand · const · })["models"]; +configCommand · const · limit: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · timeout_ms: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · color: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · sender_colors: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · record: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · record_input: import("valibot").OptionalSchema, import("valibot").LiteralSchema<"failed", undefined>], (issue: import("valibot").BaseIssue) => string>, undefined>; +configCommand · const · keep_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · keep_successful_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · keep_store_runs_for_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · runs_size_limit_mb: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · permissions: import("valibot").OptionalSchema, import("valibot").PicklistSchema string>, (issue: import("valibot").BaseIssue) => string>, undefined>; +configCommand · const · sends_per_hour: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · requests_per_minute: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · transcribe_with: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · speech_model: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · search_catch_up: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · history_dialog_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +configCommand · const · history_group_days: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>, import("valibot").MaxValueAction) => string>]>, undefined>; +configCommand · const · history_group_members_max: import("valibot").OptionalSchema) => string>, import("valibot").IntegerAction) => string>, import("valibot").MinValueAction) => string>]>, undefined>; +configCommand · const · history_muted: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · picture_search: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · search_reranker: import("valibot").OptionalSchema) => string>, undefined>; +configCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +configCommand · const · personal: import("valibot").OptionalSchema string>, undefined>; +configCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +configCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +configCommand · const · bot: import("valibot").OptionalSchema string>, undefined>; +configCommand · const · readonly profiles: import("valibot").OptionalSchema, import("valibot").StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +configCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>, undefined>; +configCommand · const · }, (issue: import("valibot").StrictObjectIssue) => string>; +configCommand · const · permissions?: import("./permission-keys.js").CommandPermissions | undefined; +configCommand · const · }, args_2?: { +configCommand · const · permissionKey?: import("./permission-keys.js").PermissionKeySource | undefined; +configCommand · const · ownerOnly?: import("./config-command.js").OwnerOnlySettings; +configCommand · const · } | undefined) => import("commander").Command; +contactsCommand · const · export declare const contactsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +conversationsCommand · const · export declare const conversationsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +createProgram · const · export declare const createProgram: (definition: ProgramDefinition, { out, err }?: ProgramOptions) => Command; +currentAttempt · const · export declare const currentAttempt: () => Attempt | undefined; +currentRun · const · export declare const currentRun: () => RunScope; +dateWindow · const · export declare const dateWindow: ({ sinceTime, untilTime, zone, now, names, }: { +dateWindow · const · sinceTime?: string; +dateWindow · const · untilTime?: string; +dateWindow · const · zone?: string; +dateWindow · const · now?: number; +dateWindow · const · names?: [string, string]; +dateWindow · const · }) => DateWindow; +defineSetup · const · export declare const defineSetup: (definition: SetupDefinition) => Setup; +doctorCommand · const · export declare const doctorCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +entityFields · const · export declare const entityFields: (table: Readonly>) => JsonFieldsResolver; +environmentOf · const · export declare const environmentOf: (command: Command) => E; +failureContext · const · export declare const failureContext: (errors?: AppErrors) => FailureContext; +fetchesOnly · const · export declare const fetchesOnly: (command: Command) => boolean; +findRun · const · export declare const findRun: (runsDir: string, id: string) => { +findRun · const · dir: string; +findRun · const · metadata: RunMetadata; +findRun · const · } | undefined; +floodCommand · const · export declare const floodCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +fromFile · const · export declare const fromFile: (settings: Pick, key: string, fallback: T) => { +fromFile · const · value: T; +fromFile · const · from: Source; +fromFile · const · }; +generatedApiCommand · const · export declare const generatedApiCommand: (api: import("./bot/api.js").ApiCommands) => import("commander").Command; +grantsAuthority · const · export declare const grantsAuthority: (command: T, { unless }?: { +grantsAuthority · const · unless?: string; +grantsAuthority · const · }) => T; +guideCommand · const · export declare const guideCommand: (app: Pick, options: import("./guide.js").GuideOptions) => import("commander").Command; +hasSharedContract · re-export · hasSharedContract from "@wirecat/cli-base/commands" +hostsFetch · const · export declare const hostsFetch: (hosts: readonly string[], fetch: FetchLike | undefined, +hostsFetch · const · credentialScope?: string) => FetchLike; +imagesCommand · const · export declare const imagesCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +inCommandRun · const · export declare const inCommandRun: (command: Command, body: (events: EventSink) => Promise) => Promise; +inRun · const · export declare const inRun: (scope: RunScope, body: () => T) => T; +inSection · const · export declare const inSection: (command: T, section: HelpSection) => T; +inboxCommand · const · export declare const inboxCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +inputPolicy · const · export declare const inputPolicy: (input: NodeJS.ReadableStream) => InputPolicy; +isBody · const · export declare const isBody: (value: unknown) => value is Body; +isStoreChange · const · export declare const isStoreChange: (command: Command) => boolean; +issueMessage · const · export declare const issueMessage: (issues: readonly ConfigIssue[], doctor?: string) => string; +itemOf · const · export declare const itemOf: (item: T, { next, missing, meta }?: { +itemOf · const · next?: NextStep[]; +itemOf · const · missing?: Missing[]; +itemOf · const · meta?: Partial; +itemOf · const · }) => ItemBody; +jsonlRecords · const · export declare const jsonlRecords: (body: Body) => object[]; +judgedEffects · const · export declare const judgedEffects: (effects: Effects | undefined) => Effects | undefined; +liftProfile · const · export declare const liftProfile: (argv: string[], words: Set, valued?: ReadonlySet) => { +liftProfile · const · profile?: string; +liftProfile · const · rest: string[]; +liftProfile · const · }; +listOf · const · export declare const listOf: (command: string, input: ListInput) => ListBody; +listQuery · const · export declare const listQuery: (text: string, registry: QueryRegistry, command: string, { defaultField }?: { +listQuery · const · defaultField?: string; +listQuery · const · }) => QueryAst | undefined; +listRuns · const · export declare const listRuns: (runsDir: string, { since, atLeast, filter, }?: { +listRuns · const · since?: number; +listRuns · const · atLeast?: number; +listRuns · const · filter?: RunListFilter; +listRuns · const · }) => RunMetadata[]; +loadScenarios · const · export declare const loadScenarios: (directory: string) => Promise<{ +loadScenarios · const · scenarios: Scenario[]; +loadScenarios · const · problems: string[]; +loadScenarios · const · }>; +logsInOrOut · const · export declare const logsInOrOut: (command: T) => T; +manifestBaseUrl · const · export declare const manifestBaseUrl: (manifest: ServiceApiManifest, given?: string, variables?: Readonly>) => string; +manifestVerify · const · export declare const manifestVerify: ({ manifest, service, verify, fetch }: ManifestVerifyOptions) => TokenSessionOptions["verify"]; +mayRevoke · const · export declare const mayRevoke: (app: AppIdentity, env: NodeJS.ProcessEnv, keyring?: KeyringStore) => boolean; +mcpCommand · const · export declare const mcpCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +meetingAnswerBody · const · export declare const meetingAnswerBody: (command: Command | string, value: unknown) => Body; +mentionsCommand · const · export declare const mentionsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +messagesCommand · const · export declare const messagesCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +messengerContext · const · export declare const messengerContext: (command: Command, messenger: Messenger, resolving?: Pick) => MessengerContext; +metadataCommand · const · export declare const metadataCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +modelCatalogueCommand · const · export declare const modelCatalogueCommand: (app: import("./entry.js").AppIdentity, options: import("./model-catalogue-command.js").ModelCatalogueOptions) => import("commander").Command; +modelsCommand · const · export declare const modelsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +module "@wirecat/cli-base/commands" · augmentation · declare module "@wirecat/cli-base/commands" { +module "@wirecat/cli-base/commands" · augmentation · interface CommandMeta { +module "@wirecat/cli-base/commands" · augmentation · literal_after_dashes?: boolean; +module "@wirecat/cli-base/commands" · augmentation · } +module "@wirecat/cli-base/commands" · augmentation · } +nativeTerms · const · export declare const nativeTerms: (ast: QueryAst | undefined, command: string) => Map; +openAppStore · const · export declare const openAppStore: (env: NodeJS.ProcessEnv, { app, provider, readOnly, }: { +openAppStore · const · app: Pick; +openAppStore · const · provider: ProviderEntry; +openAppStore · const · readOnly?: boolean; +openAppStore · const · }) => Promise; +openBrowser · const · export declare const openBrowser: (url: string, browser?: string, io?: Pick) => Promise; +outputFor · const · export declare const outputFor: (command: Command) => { +outputFor · const · format: "json" | "jsonl" | "pretty"; +outputFor · const · color: boolean; +outputFor · const · streams: Streams; +outputFor · const · renderer: Renderer; +outputFor · const · compact?: boolean | undefined; +outputFor · const · full?: boolean | undefined; +outputFor · const · }; +overrideSharedContract · re-export · overrideSharedContract from "@wirecat/cli-base/commands" +ownerOnlyOption · const · export declare const ownerOnlyOption: (flags: string, description: string) => Option; +pageOf · const · export declare const pageOf: ({ limit, page, all }: Pick) => { +pageOf · const · limit: number; +pageOf · const · offset: number; +pageOf · const · }; +pagedList · const · export declare const pagedList: (command: string, { limit, page, all }: Pick, { items, hasMore, ...rest }: Omit, "limit" | "page" | "cursor" | "has_more"> & { +pagedList · const · hasMore: boolean; +pagedList · const · }) => ListBody; +pagingOf · const · export declare const pagingOf: (command: Command) => Pick; +parseApiJson · const · export declare const parseApiJson: (text: string) => unknown; +parseDuration · const · export declare const parseDuration: (value: string, source: string) => number; +plain · const · export declare const plain: (rule: string) => (issue: v.BaseIssue) => string; +pollsCommand · const · export declare const pollsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +positiveCount · const · export declare const positiveCount: (flag: string) => (value: string) => number; +printItem · const · export declare const printItem: ({ renderer, format }: Pick, item: unknown) => void; +privateFiles · const · export declare const privateFiles: ({ files, dirs }: { +privateFiles · const · files: string[]; +privateFiles · const · dirs: string[]; +privateFiles · const · }, platform?: NodeJS.Platform) => PrivateFiles; +profileFree · const · export declare const profileFree: (command: T) => T; +profilesHere · const · export declare const profilesHere: (app: AppIdentity, configured: readonly string[], env: NodeJS.ProcessEnv) => string[]; +projectsCommand · const · export declare const projectsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +provide · const · export declare const provide: (program: Command, environment: BaseEnvironment) => void; +providerEvent · const · export declare const providerEvent: (event: RequestEvent) => void; +providerRequest · const · export declare const providerRequest: (operation: string, sink?: (event: RequestEvent) => void, call?: ProviderCall) => ({ status, error, errorCode, providerError, bytes, counts, ids }?: ProviderAnswer) => void; +queryTerms · const · export declare const queryTerms: (words: QueryWords, registry: QueryRegistry, command: string, ranged?: readonly string[]) => Map; +reactionsCommand · const · export declare const reactionsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +readApiBody · const · export declare const readApiBody: (options: { +readApiBody · const · body?: string; +readApiBody · const · bodyFile?: string; +readApiBody · const · }, read?: (path: string | number) => string) => string | undefined; +readConfigFile · const · export declare const readConfigFile: (path: string) => { +readConfigFile · const · raw: unknown; +readConfigFile · const · } | { +readConfigFile · const · issue: ConfigIssue; +readConfigFile · const · }; +readEvents · const · export declare const readEvents: (dir: string) => Record[]; +readOnlyLockOf · const · export declare const readOnlyLockOf: (app: AppIdentity, env: NodeJS.ProcessEnv) => string | undefined; +readOnlyRefusal · const · export declare const readOnlyRefusal: (lock: string, what: string) => CliError; +readsOverMcp · const · export declare const readsOverMcp: (command: Command) => boolean; +readsOverMcpAt · const · export declare const readsOverMcpAt: (root: Command) => (path: readonly string[]) => boolean; +recalledAccount · const · export declare const recalledAccount: (app: AppIdentity, provider: Provider, profile: string, env: NodeJS.ProcessEnv) => AccountKey | undefined; +recipientsCommand · const · export declare const recipientsCommand: (messenger: import("./index.js").Messenger, options?: { +recipientsCommand · const · resolve?: "chat-card"; +recipientsCommand · const · } | undefined) => import("commander").Command; +recordRuns · const · export declare const recordRuns: (program: Command, options: CommandRunOptions) => void; +refuseCommandName · const · export declare const refuseCommandName: (profile: string, words: Set, command: string) => void; +refuseOffline · const · export declare const refuseOffline: (command: Command, service: string) => void; +refuseUnderReadOnly · const · export declare const refuseUnderReadOnly: (command: Command, what: string) => void; +rememberAccount · const · export declare const rememberAccount: (app: AppIdentity, profile: string, id: string, env: NodeJS.ProcessEnv) => void; +renderAnswer · const · export declare const renderAnswer: (command: Command, { renderer, format, streams, compact, full }: AnswerOutput, body: Body, view?: (body: Body) => string) => void; +repliesCommand · const · export declare const repliesCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +repliesPathFor · const · export declare const repliesPathFor: (app: AppIdentity, profile: string, env?: NodeJS.ProcessEnv) => string; +resolveAISettings · const · export declare const resolveAISettings: (prefix: string, layers: readonly (readonly [string, Readonly> | undefined])[], env: NodeJS.ProcessEnv) => { +resolveAISettings · const · values: AISettings; +resolveAISettings · const · sources: Record; +resolveAISettings · const · }; +restartServers · const · export declare const restartServers: (app: AppIdentity, script: string, env: NodeJS.ProcessEnv, spawn?: (argv: string[]) => number) => { +restartServers · const · restarted: string[]; +restartServers · const · left: string[]; +restartServers · const · timedOut: string[]; +restartServers · const · } | { +restartServers · const · timedOut?: undefined; +restartServers · const · restarted: string[]; +restartServers · const · left: string[]; +restartServers · const · }; +reviewCommand · const · export declare const reviewCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +rootOf · const · export declare const rootOf: (command: Command) => Command; +run · const · export declare const run: (argv: string[], definition: ProgramDefinition, options?: RunOptions) => Promise; +runBudgetOf · const · export declare const runBudgetOf: (command: Command, requests?: number) => RunBudget; +runEvent · const · export declare const runEvent: EventSink; +runsCommand · const · export declare const runsCommand: (app: import("./entry.js").AppIdentity) => import("commander").Command; +runsDirFor · const · export declare const runsDirFor: (app: AppIdentity, env?: NodeJS.ProcessEnv) => string; +runtime · const · export declare const runtime: () => string; +scheduleCommand · const · export declare const scheduleCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +scheduleCommandFor · const · export declare const scheduleCommandFor: (args_0: import("./schedule/schedule-command.js").ScheduleHost) => import("commander").Command; +scheduleLimitsOf · const · export declare const scheduleLimitsOf: (config: { +scheduleLimitsOf · const · schedule_mail_wait?: unknown; +scheduleLimitsOf · const · schedule_mail_batch?: unknown; +scheduleLimitsOf · const · schedule_max_cost_per_day?: unknown; +scheduleLimitsOf · const · schedule_model_claude?: unknown; +scheduleLimitsOf · const · schedule_model_codex?: unknown; +scheduleLimitsOf · const · schedule_lean_start?: unknown; +scheduleLimitsOf · const · }) => ScheduleLimits; +screenFor · const · export declare const screenFor: (context: { +screenFor · const · format: RenderFormat; +screenFor · const · streams: Pick; +screenFor · const · renderer: Pick; +screenFor · const · }, quiet: boolean, steps: number) => { +screenFor · const · step: (index: number, title: string) => void; +screenFor · const · detail: (text: string) => void; +screenFor · const · title: (text: string) => void; +screenFor · const · indent: number; +screenFor · const · }; +searchCommand · const · export declare const searchCommand: (messenger: import("./index.js").Messenger, args_1?: { +searchCommand · const · topics?: boolean; +searchCommand · const · } | undefined) => import("commander").Command; +searchesCommand · const · export declare const searchesCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +secretInput · const · export declare const secretInput: (input: T) => T; +secretInputOf · const · export declare const secretInputOf: (command: Command) => Pick; +sendsBytes · const · export declare const sendsBytes: (operation: ManifestOperation) => boolean; +sendsCommand · const · export declare const sendsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +serveCommand · const · export declare const serveCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +serverCommand · const · export declare const serverCommand: (messenger: import("./index.js").Messenger, options?: import("./messenger/server-command.js").ServerOptions | undefined) => import("commander").Command; +serviceApiCall · const · export declare const serviceApiCall: (options: ServiceApiCallOptions) => ServiceApiCall & { +serviceApiCall · const · withHeaders: ServiceApiCallWithHeaders; +serviceApiCall · const · }; +serviceApiCommand · const · export declare const serviceApiCommand: (options: import("./service-api.js").ServiceApiOptions) => import("commander").Command; +serviceApiOperations · const · export declare const serviceApiOperations: (manifest: ServiceApiManifest) => { +serviceApiOperations · const · offered: readonly ManifestOperation[]; +serviceApiOperations · const · left: readonly { +serviceApiOperations · const · id: string; +serviceApiOperations · const · reason: string; +serviceApiOperations · const · }[]; +serviceApiOperations · const · }; +serviceApiPermissions · const · export declare const serviceApiPermissions: (input: ServiceApiPermissionsInput) => { +serviceApiPermissions · const · alsoChecks: (path: readonly string[]) => readonly (PermissionKey | ConditionalKey)[]; +serviceApiPermissions · const · defaults: Readonly>; +serviceApiPermissions · const · extra: readonly PermissionKey[]; +serviceApiPermissions · const · }; +serviceApiWriter · const · export declare const serviceApiWriter: (options: ServiceApiOptions) => ServiceApiWrite; +settingRows · const · export declare const settingRows: (raw: unknown, declared: readonly DeclaredSetting[]) => SettingRow[]; +settingsFor · const · export declare const settingsFor: >(app: AppIdentity, extension?: SettingsExtension) => { +settingsFor · const · resolveSettings: (flags?: GlobalFlags, options?: ResolveOptions) => Settings & T; +settingsFor · const · configuredProfiles: (options?: ResolveOptions) => string[]; +settingsFor · const · settingSchema: (key: string) => v.GenericSchema | undefined; +settingsFor · const · changeSetting: (path: string, { profile, setting, value, kind, root, }: { +settingsFor · const · profile: string | undefined; +settingsFor · const · setting: string; +settingsFor · const · value: string | undefined; +settingsFor · const · kind?: ProfileKind | undefined; +settingsFor · const · root?: boolean; +settingsFor · const · }) => unknown; +settingsFor · const · migrate: (path: string) => string[]; +settingsFor · const · declaredSettings: DeclaredSetting[]; +settingsFor · const · allSettings: string[]; +settingsFor · const · defaultsOnlyKeys: string[]; +settingsFor · const · schema: v.StrictObjectSchema<{ +settingsFor · const · defaults: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingProvider"]; +settingsFor · const · embedding_model: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingModel"]; +settingsFor · const · embedding_base_url: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingBaseUrl"]; +settingsFor · const · embedding_dims: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingDims"]; +settingsFor · const · models: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["models"]; +settingsFor · const · limit: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · timeout_ms: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · color: v.OptionalSchema) => string>, undefined>; +settingsFor · const · sender_colors: v.OptionalSchema) => string>, undefined>; +settingsFor · const · record: v.OptionalSchema) => string>, undefined>; +settingsFor · const · record_input: v.OptionalSchema, v.LiteralSchema<"failed", undefined>], (issue: v.BaseIssue) => string>, undefined>; +settingsFor · const · keep_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · keep_successful_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · keep_store_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · runs_size_limit_mb: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · permissions: v.OptionalSchema, v.PicklistSchema string>, (issue: v.BaseIssue) => string>, undefined>; +settingsFor · const · sends_per_hour: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · requests_per_minute: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · transcribe_with: v.OptionalSchema) => string>, undefined>; +settingsFor · const · speech_model: v.OptionalSchema) => string>, undefined>; +settingsFor · const · search_catch_up: v.OptionalSchema) => string>, undefined>; +settingsFor · const · history_dialog_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>, v.MaxValueAction) => string>]>, undefined>; +settingsFor · const · history_group_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>, v.MaxValueAction) => string>]>, undefined>; +settingsFor · const · history_group_members_max: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · history_muted: v.OptionalSchema) => string>, undefined>; +settingsFor · const · picture_search: v.OptionalSchema) => string>, undefined>; +settingsFor · const · search_reranker: v.OptionalSchema) => string>, undefined>; +settingsFor · const · update_check: v.OptionalSchema) => string>, undefined>; +settingsFor · const · skill_hint: v.OptionalSchema) => string>, undefined>; +settingsFor · const · }, (issue: v.StrictObjectIssue) => string>, undefined>; +settingsFor · const · profiles: v.OptionalSchema, v.StrictObjectSchema<{ +settingsFor · const · embedding_provider: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingProvider"]; +settingsFor · const · embedding_model: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingModel"]; +settingsFor · const · embedding_base_url: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingBaseUrl"]; +settingsFor · const · embedding_dims: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["embeddingDims"]; +settingsFor · const · models: ({ +settingsFor · const · embeddingProvider: v.OptionalSchema, undefined>; +settingsFor · const · embeddingModel: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · embeddingBaseUrl: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · embeddingDims: v.OptionalSchema, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; +settingsFor · const · models: v.OptionalSchema, v.RegexAction]>, v.StrictObjectSchema<{ +settingsFor · const · readonly provider: v.OptionalSchema, undefined>; +settingsFor · const · readonly model: v.OptionalSchema, v.TrimAction, v.MinLengthAction, v.MaxLengthAction]>, undefined>; +settingsFor · const · readonly base_url: v.OptionalSchema, v.CheckAction]>, undefined>; +settingsFor · const · }, undefined>, undefined>, undefined>; +settingsFor · const · })["models"]; +settingsFor · const · limit: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · timeout_ms: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · color: v.OptionalSchema) => string>, undefined>; +settingsFor · const · sender_colors: v.OptionalSchema) => string>, undefined>; +settingsFor · const · record: v.OptionalSchema) => string>, undefined>; +settingsFor · const · record_input: v.OptionalSchema, v.LiteralSchema<"failed", undefined>], (issue: v.BaseIssue) => string>, undefined>; +settingsFor · const · keep_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · keep_successful_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · keep_store_runs_for_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · runs_size_limit_mb: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · permissions: v.OptionalSchema, v.PicklistSchema string>, (issue: v.BaseIssue) => string>, undefined>; +settingsFor · const · sends_per_hour: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · requests_per_minute: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · transcribe_with: v.OptionalSchema) => string>, undefined>; +settingsFor · const · speech_model: v.OptionalSchema) => string>, undefined>; +settingsFor · const · search_catch_up: v.OptionalSchema) => string>, undefined>; +settingsFor · const · history_dialog_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>, v.MaxValueAction) => string>]>, undefined>; +settingsFor · const · history_group_days: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>, v.MaxValueAction) => string>]>, undefined>; +settingsFor · const · history_group_members_max: v.OptionalSchema) => string>, v.IntegerAction) => string>, v.MinValueAction) => string>]>, undefined>; +settingsFor · const · history_muted: v.OptionalSchema) => string>, undefined>; +settingsFor · const · picture_search: v.OptionalSchema) => string>, undefined>; +settingsFor · const · search_reranker: v.OptionalSchema) => string>, undefined>; +settingsFor · const · }, (issue: v.StrictObjectIssue) => string>, "has to be an object of profiles, by name">, {}>; +settingsFor · const · personal: v.OptionalSchema string>, undefined>; +settingsFor · const · readonly profiles: v.OptionalSchema, v.StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +settingsFor · const · }, (issue: v.StrictObjectIssue) => string>, undefined>; +settingsFor · const · bot: v.OptionalSchema string>, undefined>; +settingsFor · const · readonly profiles: v.OptionalSchema, v.StrictObjectSchema string>, "has to be an object of profiles, by name">, undefined>; +settingsFor · const · }, (issue: v.StrictObjectIssue) => string>, undefined>; +settingsFor · const · }, (issue: v.StrictObjectIssue) => string>; +settingsFor · const · permissions?: CommandPermissions | undefined; +settingsFor · const · }; +setupCommand · const · export declare const setupCommand: (setup: import("./index.js").Setup) => import("commander").Command; +setupPermissionCeiling · const · export declare const setupPermissionCeiling: (env?: NodeJS.ProcessEnv) => Level | undefined; +setupProblems · const · export declare const setupProblems: (document: unknown, { settings, v1 }?: ProblemOptions) => string[]; +sharedCommandTemplate · const · export declare const sharedCommandTemplate: (app: AppIdentity, name: "commands" | "doctor" | "mcp" | "search" | "notes" | "session" | "setup" | "meetings") => Command; +sharedStoreCommand · const · export declare const sharedStoreCommand: (app?: { +sharedStoreCommand · const · command: string; +sharedStoreCommand · const · version?: string; +sharedStoreCommand · const · }) => Command; +signInSteps · const · export declare const signInSteps: ({ diagnostic, json, answers, input, lines, }: SignInStepsOptions) => SignInSteps; +signedInSite · const · export declare const signedInSite: (app: AppIdentity, resolveSettings: TokenSessionOptions["resolveSettings"]) => ((command: Command) => { +signedInSite · const · site: string; +signedInSite · const · }); +skillCommand · const · export declare const skillCommand: (app: import("./entry.js").AppIdentity, skill: URL) => import("commander").Command; +snakeKeys · const · export declare const snakeKeys: (value: unknown) => unknown; +startCli · const · export declare const startCli: (entry: CliEntry) => Promise; +startRun · const · export declare const startRun: (options: StartRunOptions) => Run; +statsCommand · const · export declare const statsCommand: (messenger: import("./index.js").Messenger, loadRenderer?: typeof import("../charts/render.js").chartRenderer | undefined) => import("commander").Command; +storeCommand · const · export declare const storeCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +storeInfo · const · export declare const storeInfo: (env: NodeJS.ProcessEnv) => Promise; +storeSummary · const · export declare const storeSummary: (env: NodeJS.ProcessEnv, { deep, command, version }?: { +storeSummary · const · deep?: boolean; +storeSummary · const · command?: string; +storeSummary · const · version?: string; +storeSummary · const · }) => Promise<{ +storeSummary · const · path: string; +storeSummary · const · exists: boolean; +storeSummary · const · } | { +storeSummary · const · health: { +storeSummary · const · checked: "deep" | "quick"; +storeSummary · const · covers: string; +storeSummary · const · ok: boolean; +storeSummary · const · ms: number; +storeSummary · const · problems?: number | undefined; +storeSummary · const · damagedTables?: import("../../store/health.js").DamagedTable[] | undefined; +storeSummary · const · invalidJson?: import("../../store/health.js").InvalidJson[] | undefined; +storeSummary · const · damagedSearchIndexes?: string[] | undefined; +storeSummary · const · }; +storeSummary · const · lastKnownGood: string | null; +storeSummary · const · damageMark?: { +storeSummary · const · at: string; +storeSummary · const · command: string; +storeSummary · const · cli_version?: string; +storeSummary · const · run_id?: string; +storeSummary · const · error: string; +storeSummary · const · } | undefined; +storeSummary · const · journalMark?: import("../../store/marks.js").JournalMark | undefined; +storeSummary · const · damageMarkCleared?: { +storeSummary · const · at: string; +storeSummary · const · command: string; +storeSummary · const · cli_version?: string; +storeSummary · const · run_id?: string; +storeSummary · const · error: string; +storeSummary · const · } | undefined; +storeSummary · const · damage?: { +storeSummary · const · whatHappened: string; +storeSummary · const · likelyCauses: import("../../store/damage.js").DamageCause[]; +storeSummary · const · impact: string[]; +storeSummary · const · externalDataSafe: string; +storeSummary · const · lastOkAt: string | null; +storeSummary · const · loss: string; +storeSummary · const · steps: import("../../store/damage.js").RecoveryStep[]; +storeSummary · const · what: string; +storeSummary · const · } | undefined; +storeSummary · const · path: string; +storeSummary · const · exists: boolean; +storeSummary · const · schema: number; +storeSummary · const · speaks: number; +storeSummary · const · writable: boolean; +storeSummary · const · chats?: number | undefined; +storeSummary · const · messages?: number | undefined; +storeSummary · const · } | { +storeSummary · const · health: { +storeSummary · const · checked: "deep" | "quick"; +storeSummary · const · covers: string; +storeSummary · const · ok: boolean; +storeSummary · const · ms: number; +storeSummary · const · problems?: number | undefined; +storeSummary · const · damagedTables?: import("../../store/health.js").DamagedTable[] | undefined; +storeSummary · const · invalidJson?: import("../../store/health.js").InvalidJson[] | undefined; +storeSummary · const · damagedSearchIndexes?: string[] | undefined; +storeSummary · const · }; +storeSummary · const · lastKnownGood: string | null; +storeSummary · const · damageMark?: { +storeSummary · const · at: string; +storeSummary · const · command: string; +storeSummary · const · cli_version?: string; +storeSummary · const · run_id?: string; +storeSummary · const · error: string; +storeSummary · const · } | undefined; +storeSummary · const · journalMark?: import("../../store/marks.js").JournalMark | undefined; +storeSummary · const · damageMarkCleared?: { +storeSummary · const · at: string; +storeSummary · const · command: string; +storeSummary · const · cli_version?: string; +storeSummary · const · run_id?: string; +storeSummary · const · error: string; +storeSummary · const · } | undefined; +storeSummary · const · damage?: { +storeSummary · const · whatHappened: string; +storeSummary · const · likelyCauses: import("../../store/damage.js").DamageCause[]; +storeSummary · const · impact: string[]; +storeSummary · const · externalDataSafe: string; +storeSummary · const · lastOkAt: string | null; +storeSummary · const · loss: string; +storeSummary · const · steps: import("../../store/damage.js").RecoveryStep[]; +storeSummary · const · what: string; +storeSummary · const · } | undefined; +storeSummary · const · path: string; +storeSummary · const · exists: boolean; +storeSummary · const · error: string; +storeSummary · const · }>; +tagsCommand · const · export declare const tagsCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +tasksCommand · const · export declare const tasksCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +termField · const · export declare const termField: (name: string, type: FieldType, example: string, more?: Pick) => FieldSpec; +terminalAsker · const · export declare const terminalAsker: (command: Command) => Asker; +tokenSessionCommand · const · export declare const tokenSessionCommand: (options: TokenSessionOptions) => Command; +typedQuery · const · export declare const typedQuery: (words: QueryWords) => string; +unfilteredQuery · const · export declare const unfilteredQuery: (entity: string, schema: Parameters[0]) => QueryRegistry; +upgradeCommand · const · export declare const upgradeCommand: (app: import("./entry.js").AppIdentity, packageName: string, contextFor: (command: import("commander").Command) => import("./upgrade-command.js").UpgradeContext) => import("commander").Command; +usableProfileName · const · export declare const usableProfileName: (profile: string) => string; +watchCommand · const · export declare const watchCommand: (messenger: import("./index.js").Messenger) => import("commander").Command; +withAttempt · const · export declare const withAttempt: (attempt: Attempt, work: () => T) => T; +withDeadline · const · export declare const withDeadline: (ms: number | undefined, closeables: Closeable[], body: () => Promise) => Promise; +withPaging · const · export declare const withPaging: (command: Command) => Command; +withQuery · const · export declare const withQuery: (command: Command, registry: QueryRegistry) => Command; +withSettingDefaults · const · export declare const withSettingDefaults: (raw: unknown, declared: readonly DeclaredSetting[]) => { +withSettingDefaults · const · config: unknown; +withSettingDefaults · const · added: string[]; +withSettingDefaults · const · }; +withSqliteSidecars · const · export declare const withSqliteSidecars: (path: string) => string[]; +writeNewFile · const · export declare const writeNewFile: (path: string, content: string) => Promise; +writesNewFileOnlyWith · const · export declare const writesNewFileOnlyWith: (command: T, option: string) => T; +writesOwnerFiles · const · export declare const writesOwnerFiles: (command: T) => T; diff --git a/api/index.api.txt b/api/index.api.txt new file mode 100644 index 000000000..408057bb5 --- /dev/null +++ b/api/index.api.txt @@ -0,0 +1,817 @@ +# @wirecat/cli-core ".": the stable API, written by cli-dev api-report. Do not edit. +Account · interface · export interface Account { +Account · interface · id: Id; +Account · interface · name: string | null; +Account · interface · username: string | null; +Account · interface · phone?: string | null; +Account · interface · } +AccountSession · interface · export interface AccountSession { +AccountSession · interface · current: boolean; +AccountSession · interface · client: string | null; +AccountSession · interface · device: string | null; +AccountSession · interface · location: string | null; +AccountSession · interface · lastActiveAt: string | null; +AccountSession · interface · createdAt?: string | null; +AccountSession · interface · } +AdminRight · type · export type AdminRight = (typeof ADMIN_RIGHTS)[number]; +AppErrors · interface · export interface AppErrors { +AppErrors · interface · reasons?: readonly ErrorReason[]; +AppErrors · interface · details?: readonly string[]; +AppErrors · interface · } +Attachment · interface · export interface Attachment { +Attachment · interface · kind: string; +Attachment · interface · url?: string; +Attachment · interface · width?: number; +Attachment · interface · height?: number; +Attachment · interface · title?: string; +Attachment · interface · name?: string; +Attachment · interface · size?: number; +Attachment · interface · mime?: string; +Attachment · interface · duration?: number; +Attachment · interface · providerRef?: ProviderMetadata; +Attachment · interface · localPath?: string; +Attachment · interface · buttons?: Button[][]; +Attachment · interface · poll?: Poll; +Attachment · interface · contact?: SharedContact; +Attachment · interface · } +Audience · type · export type Audience = "everyone" | "contacts" | "nobody"; +Button · interface · export interface Button { +Button · interface · kind: ButtonKind; +Button · interface · text: string; +Button · interface · url?: string; +Button · interface · data?: string; +Button · interface · } +ButtonKind · type · export type ButtonKind = "callback" | "link" | "message" | "chat" | "contact" | "location" | "app" | "clipboard" | "other"; +CORE_REASONS · const · export declare const REASONS: ErrorReason[]; +Chat · interface · export interface Chat { +Chat · interface · parentChatId?: Id | null; +Chat · interface · scope?: "personal" | "work"; +Chat · interface · searchable?: false; +Chat · interface · id: Id; +Chat · interface · title: string | null; +Chat · interface · kind: ChatKind; +Chat · interface · unreadCount: number | null; +Chat · interface · lastMessageAt: string | null; +Chat · interface · participantsCount: number | null; +Chat · interface · muted?: boolean; +Chat · interface · mutedUntil?: string | null; +Chat · interface · archived?: boolean; +Chat · interface · markedUnread?: boolean; +Chat · interface · unreadMentions?: number; +Chat · interface · membershipState?: MembershipState; +Chat · interface · providerMetadata?: ProviderMetadata; +Chat · interface · } +ChatCard · interface · export interface ChatCard extends Chat { +ChatCard · interface · members: Member[] | null; +ChatCard · interface · } +ChatEvent · interface · export interface ChatEvent { +ChatEvent · interface · messageId: Id; +ChatEvent · interface · timestamp: string; +ChatEvent · interface · event: string; +ChatEvent · interface · by: { +ChatEvent · interface · id: Id | null; +ChatEvent · interface · name: string | null; +ChatEvent · interface · }; +ChatEvent · interface · people: { +ChatEvent · interface · id: Id; +ChatEvent · interface · name: string | null; +ChatEvent · interface · }[]; +ChatEvent · interface · title?: string; +ChatEvent · interface · } +ChatEventNotice · interface · export interface ChatEventNotice { +ChatEventNotice · interface · event: "chat_event"; +ChatEventNotice · interface · chatId: Id; +ChatEventNotice · interface · chatTitle: string | null; +ChatEventNotice · interface · change: ChatEvent; +ChatEventNotice · interface · } +ChatEvents · interface · export interface ChatEvents { +ChatEvents · interface · chatId: Id; +ChatEvents · interface · since: string; +ChatEvents · interface · events: ChatEvent[]; +ChatEvents · interface · more: boolean; +ChatEvents · interface · } +ChatKind · type · export type ChatKind = "dialog" | "group" | "channel" | "saved" | "unknown"; +ChatUpdate · type · export type ChatUpdate = Omit & Partial> & { +ChatUpdate · type · membershipState?: MembershipState | "member" | null; +ChatUpdate · type · }; +ChatUpdate · type · type KeptFields = "title" | "unreadCount" | "lastMessageAt" | "participantsCount"; +CheckRow · interface · export interface CheckRow extends Finding { +CheckRow · interface · outcome: Outcome; +CheckRow · interface · reason?: string; +CheckRow · interface · command?: string; +CheckRow · interface · } +CheckWords · type · export type CheckWords = (check: C, args?: string) => string; +Contact · interface · export interface Contact { +Contact · interface · alias?: string | null; +Contact · interface · displayName?: string | null; +Contact · interface · id: Id; +Contact · interface · name: string | null; +Contact · interface · username: string | null; +Contact · interface · description: string | null; +Contact · interface · lastMessagedAt: string | null; +Contact · interface · } +CounterObservation · interface · export interface CounterObservation { +CounterObservation · interface · value: number; +CounterObservation · interface · observedAt: string; +CounterObservation · interface · source: "remote_fetch" | "remote_update"; +CounterObservation · interface · reactions?: Reactions; +CounterObservation · interface · } +CounterState · interface · export interface CounterState { +CounterState · interface · counter: CounterField; +CounterState · interface · value: number | null; +CounterState · interface · observedAt: string | null; +CounterState · interface · source: CounterObservation["source"] | null; +CounterState · interface · ageMilliseconds: number | null; +CounterState · interface · freshness: "fresh" | "stale" | "unknown"; +CounterState · interface · } +CrmActivity · interface · export interface CrmActivity { +CrmActivity · interface · externalId: string; +CrmActivity · interface · kind: CrmActivityKind; +CrmActivity · interface · subject: string; +CrmActivity · interface · body?: string | null; +CrmActivity · interface · dueAt?: number | null; +CrmActivity · interface · done: boolean; +CrmActivity · interface · assignee?: string | null; +CrmActivity · interface · createdAt: number; +CrmActivity · interface · updatedAt: number; +CrmActivity · interface · on: { +CrmActivity · interface · kind: CrmKind; +CrmActivity · interface · externalId: string; +CrmActivity · interface · }[]; +CrmActivity · interface · } +CrmActivityKind · type · export type CrmActivityKind = (typeof CRM_ACTIVITY_KINDS)[number]; +CrmField · interface · export interface CrmField { +CrmField · interface · code: string; +CrmField · interface · label: string | null; +CrmField · interface · type: string; +CrmField · interface · multiple: boolean; +CrmField · interface · filterable: boolean; +CrmField · interface · options?: { +CrmField · interface · id: string; +CrmField · interface · label: string; +CrmField · interface · }[]; +CrmField · interface · holds?: "phone" | "email"; +CrmField · interface · } +CrmItem · interface · export interface CrmItem { +CrmItem · interface · externalId: string; +CrmItem · interface · title: string; +CrmItem · interface · pipeline: string; +CrmItem · interface · stage: string; +CrmItem · interface · status?: DealStatus | null; +CrmItem · interface · amount?: string | null; +CrmItem · interface · currency?: string | null; +CrmItem · interface · closeDate?: string | null; +CrmItem · interface · closedDate?: string | null; +CrmItem · interface · closedReason?: string | null; +CrmItem · interface · organization?: string | null; +CrmItem · interface · contactName?: string | null; +CrmItem · interface · companyName?: string | null; +CrmItem · interface · people?: { +CrmItem · interface · externalId: string; +CrmItem · interface · role: DealRole; +CrmItem · interface · primary?: boolean; +CrmItem · interface · }[]; +CrmItem · interface · deal?: string | null; +CrmItem · interface · createdAt?: number | null; +CrmItem · interface · updatedAt?: number | null; +CrmItem · interface · url?: string | null; +CrmItem · interface · assignee?: string | null; +CrmItem · interface · metadata?: Record; +CrmItem · interface · } +CrmKind · type · export type CrmKind = (typeof CRM_KINDS)[number]; +CrmOrganization · interface · export interface CrmOrganization { +CrmOrganization · interface · externalId: string; +CrmOrganization · interface · name: string; +CrmOrganization · interface · url?: string | null; +CrmOrganization · interface · own?: boolean; +CrmOrganization · interface · type?: string | null; +CrmOrganization · interface · metadata?: Record; +CrmOrganization · interface · phones?: string[]; +CrmOrganization · interface · emails?: string[]; +CrmOrganization · interface · contactTypes?: Record; +CrmOrganization · interface · people?: string[]; +CrmOrganization · interface · assignee?: string | null; +CrmOrganization · interface · createdAt?: number | null; +CrmOrganization · interface · updatedAt?: number | null; +CrmOrganization · interface · } +CrmPerson · interface · export interface CrmPerson { +CrmPerson · interface · externalId: string; +CrmPerson · interface · name: string | null; +CrmPerson · interface · email?: string | null; +CrmPerson · interface · phone?: string | null; +CrmPerson · interface · phones?: string[]; +CrmPerson · interface · emails?: string[]; +CrmPerson · interface · position?: string | null; +CrmPerson · interface · organizations?: { +CrmPerson · interface · externalId: string; +CrmPerson · interface · primary?: boolean; +CrmPerson · interface · sourceRole?: string | null; +CrmPerson · interface · }[]; +CrmPerson · interface · firstName?: string | null; +CrmPerson · interface · lastName?: string | null; +CrmPerson · interface · assignee?: string | null; +CrmPerson · interface · createdAt?: number | null; +CrmPerson · interface · updatedAt?: number | null; +CrmPerson · interface · url?: string | null; +CrmPerson · interface · metadata?: Record; +CrmPerson · interface · contactTypes?: Record; +CrmPerson · interface · } +CrmPipeline · interface · export interface CrmPipeline { +CrmPipeline · interface · externalId: string; +CrmPipeline · interface · name: string; +CrmPipeline · interface · stages: CrmStage[]; +CrmPipeline · interface · } +CrmRecords · interface · export interface CrmRecords { +CrmRecords · interface · deal: CrmItem; +CrmRecords · interface · lead: CrmItem; +CrmRecords · interface · person: CrmPerson; +CrmRecords · interface · organization: CrmOrganization; +CrmRecords · interface · } +CrmStage · interface · export interface CrmStage { +CrmStage · interface · externalId: string; +CrmStage · interface · name: string; +CrmStage · interface · position: number; +CrmStage · interface · outcome: StageOutcome; +CrmStage · interface · } +CrmStageEntry · interface · export interface CrmStageEntry { +CrmStageEntry · interface · externalId: string; +CrmStageEntry · interface · kind: DealKind; +CrmStageEntry · interface · item: string; +CrmStageEntry · interface · pipeline: string; +CrmStageEntry · interface · stage: string; +CrmStageEntry · interface · at: number; +CrmStageEntry · interface · } +CrmUser · interface · export interface CrmUser { +CrmUser · interface · externalId: string; +CrmUser · interface · name: string | null; +CrmUser · interface · email?: string | null; +CrmUser · interface · position?: string | null; +CrmUser · interface · departments?: string[]; +CrmUser · interface · active?: boolean; +CrmUser · interface · } +CrmValue · interface · export interface CrmValue { +CrmValue · interface · label: string | null; +CrmValue · interface · value: unknown; +CrmValue · interface · option_id?: string | string[]; +CrmValue · interface · } +DealKind · type · export type DealKind = (typeof DEAL_KINDS)[number]; +Deletion · interface · export interface Deletion { +Deletion · interface · chatId: Id; +Deletion · interface · deleted: Id[]; +Deletion · interface · forEveryone: boolean; +Deletion · interface · } +Delivery · type · export type Delivery = "delivered" | "read"; +Discussion · interface · export interface Discussion { +Discussion · interface · chatId: Id; +Discussion · interface · messageId: Id; +Discussion · interface · } +Finding · interface · export interface Finding { +Finding · interface · kind: "message" | "member"; +Finding · interface · rule: "blocked" | "invites" | "links" | "forwards" | "flood" | "newAccount"; +Finding · interface · personId: Id; +Finding · interface · personName: string | null; +Finding · interface · messageId?: Id; +Finding · interface · action: Action; +Finding · interface · } +Folder · interface · export interface Folder { +Folder · interface · id: string; +Folder · interface · title: string; +Folder · interface · chatIds: Id[]; +Folder · interface · emoji?: string; +Folder · interface · include?: FolderKind[]; +Folder · interface · skip?: FolderSkip[]; +Folder · interface · excludedChatIds?: Id[]; +Folder · interface · pinnedChatIds?: Id[]; +Folder · interface · } +FolderChange · interface · export interface FolderChange extends FolderRules { +FolderChange · interface · title?: string; +FolderChange · interface · add?: Id[]; +FolderChange · interface · remove?: Id[]; +FolderChange · interface · } +FolderRules · interface · export interface FolderRules { +FolderRules · interface · emoji?: string; +FolderRules · interface · include?: FolderKind[]; +FolderRules · interface · skip?: FolderSkip[]; +FolderRules · interface · exclude?: Id[]; +FolderRules · interface · pin?: Id[]; +FolderRules · interface · } +FormattedText · interface · export interface FormattedText { +FormattedText · interface · text: string; +FormattedText · interface · spans: TextSpan[]; +FormattedText · interface · } +GroupCard · interface · export interface GroupCard extends Chat { +GroupCard · interface · description: string | null; +GroupCard · interface · link: string | null; +GroupCard · interface · settings: GroupSettings & MoreGroupSettings; +GroupCard · interface · } +GroupChange · interface · export interface GroupChange { +GroupChange · interface · title?: string; +GroupChange · interface · description?: string; +GroupChange · interface · settings?: Partial & MoreGroupSettings; +GroupChange · interface · photo?: Upload; +GroupChange · interface · removePhoto?: true; +GroupChange · interface · } +GroupMember · interface · export interface GroupMember extends Member { +GroupMember · interface · role?: "owner" | "admin" | "member"; +GroupMember · interface · lastSeenAt?: string | null; +GroupMember · interface · registeredAt?: string | null; +GroupMember · interface · joinedAt?: string | null; +GroupMember · interface · invitedBy?: Id | null; +GroupMember · interface · isBot?: boolean; +GroupMember · interface · deleted?: boolean; +GroupMember · interface · flagged?: "scam" | "fake"; +GroupMember · interface · hasPhoto?: boolean; +GroupMember · interface · } +GroupSettingKey · type · export type GroupSettingKey = keyof GroupSettings | keyof MoreGroupSettings; +GroupSettings · interface · export interface GroupSettings { +GroupSettings · interface · allCanPin: boolean | null; +GroupSettings · interface · onlyAdminsAdd: boolean | null; +GroupSettings · interface · onlyAdminsCall: boolean | null; +GroupSettings · interface · onlyOwnerEditsInfo: boolean | null; +GroupSettings · interface · membersSeeLink: boolean | null; +GroupSettings · interface · joinApproval?: boolean | null; +GroupSettings · interface · } +Id · type · export type Id = string; +Inbox · interface · export interface Inbox { +Inbox · interface · mode: "unread" | "new"; +Inbox · interface · since?: string; +Inbox · interface · until?: string; +Inbox · interface · chats: InboxChat[]; +Inbox · interface · skipped: Pick[]; +Inbox · interface · partial: boolean; +Inbox · interface · left?: string[]; +Inbox · interface · quiet: number; +Inbox · interface · checked?: Record; +Inbox · interface · } +InboxChat · interface · export interface InboxChat extends Pick { +InboxChat · interface · messages: Message[]; +InboxChat · interface · more: boolean; +InboxChat · interface · } +InviteLink · interface · export interface InviteLink { +InviteLink · interface · link: string; +InviteLink · interface · approval: boolean; +InviteLink · interface · expiresAt: string | null; +InviteLink · interface · maxUses: number | null; +InviteLink · interface · primary?: boolean; +InviteLink · interface · revoked?: boolean; +InviteLink · interface · pending?: number; +InviteLink · interface · joined?: number; +InviteLink · interface · } +InviteLinkChange · interface · export interface InviteLinkChange { +InviteLinkChange · interface · approval?: boolean; +InviteLinkChange · interface · expiresAt?: string | null; +InviteLinkChange · interface · maxUses?: number; +InviteLinkChange · interface · } +JoinRequest · interface · export interface JoinRequest { +JoinRequest · interface · person: Member; +JoinRequest · interface · requestedAt: string | null; +JoinRequest · interface · about?: string; +JoinRequest · interface · } +KINDS · const · export declare const KINDS: readonly ["messages", "mail", "notes", "documents", "meetings", "events", "crm", "tracker"]; +Kind · type · export type Kind = (typeof KINDS)[number]; +LinkTarget · interface · export interface LinkTarget { +LinkTarget · interface · kind: ChatKind; +LinkTarget · interface · title: string | null; +LinkTarget · interface · id: Id | null; +LinkTarget · interface · username: string | null; +LinkTarget · interface · participantsCount: number | null; +LinkTarget · interface · description: string | null; +LinkTarget · interface · member: boolean | null; +LinkTarget · interface · approvalNeeded?: boolean; +LinkTarget · interface · } +LoginQr · interface · export interface LoginQr { +LoginQr · interface · show: (link: string, scan?: string, expiresAt?: Date) => void; +LoginQr · interface · } +LoginQrOptions · interface · export interface LoginQrOptions { +LoginQrOptions · interface · diagnostic: (text: string) => void; +LoginQrOptions · interface · note: (text: string) => void; +LoginQrOptions · interface · indent?: number; +LoginQrOptions · interface · columns?: () => number | undefined; +LoginQrOptions · interface · terminal?: boolean; +LoginQrOptions · interface · json?: boolean; +LoginQrOptions · interface · } +MailFields · interface · export interface MailFields { +MailFields · interface · subject: string | null; +MailFields · interface · from: MailPerson | null; +MailFields · interface · to: MailPerson[]; +MailFields · interface · cc: MailPerson[]; +MailFields · interface · bcc: MailPerson[]; +MailFields · interface · replyTo: MailPerson[]; +MailFields · interface · labels: string[]; +MailFields · interface · thread: string; +MailFields · interface · read: boolean | null; +MailFields · interface · flagged: boolean | null; +MailFields · interface · senderScore?: { +MailFields · interface · score: number; +MailFields · interface · signals: string[]; +MailFields · interface · demoted?: true; +MailFields · interface · }; +MailFields · interface · } +MailPerson · interface · export interface MailPerson { +MailPerson · interface · name: string | null; +MailPerson · interface · address: string; +MailPerson · interface · ref: string | null; +MailPerson · interface · } +MarkdownFormatting · interface · export interface MarkdownFormatting { +MarkdownFormatting · interface · formatMarkdown(text: string): Promise; +MarkdownFormatting · interface · } +Markup · interface · export interface Markup { +Markup · interface · type: "bold" | "italic" | "strike" | "code"; +Markup · interface · from: number; +Markup · interface · length: number; +Markup · interface · } +MeetingReference · interface · export interface MeetingReference { +MeetingReference · interface · type: "meeting"; +MeetingReference · interface · accountId: number; +MeetingReference · interface · meetingId: number; +MeetingReference · interface · transcriptId?: number; +MeetingReference · interface · cuePosition?: number; +MeetingReference · interface · } +Member · type · export type Member = Pick; +Message · interface · export interface Message { +Message · interface · id: Id; +Message · interface · chatId: Id; +Message · interface · senderId: Id | null; +Message · interface · senderName: string | null; +Message · interface · senderUsername?: string; +Message · interface · mentions?: Id[]; +Message · interface · senderIsChat?: boolean; +Message · interface · timestamp: string; +Message · interface · editedAt: string | null; +Message · interface · text: string; +Message · interface · outgoing: boolean | null; +Message · interface · attachments: Attachment[]; +Message · interface · replyTo: QuotedMessage | null; +Message · interface · replyToId?: Id; +Message · interface · forwardedFrom: QuotedMessage | null; +Message · interface · threadId?: Id; +Message · interface · threadRootId?: Id; +Message · interface · reactions: Reactions | null; +Message · interface · counterObservations?: CounterObservations; +Message · interface · scheduledFor?: string; +Message · interface · providerMetadata?: ProviderMetadata; +Message · interface · starred?: boolean; +Message · interface · delivery?: Delivery; +Message · interface · } +MessageChange · type · export type MessageChange = { +MessageChange · type · event: "edit"; +MessageChange · type · message: MessageHit; +MessageChange · type · } +MessageChange · type · | { +MessageChange · type · event: "delete"; +MessageChange · type · chatId: Id | null; +MessageChange · type · chatTitle: string | null; +MessageChange · type · messageId: Id; +MessageChange · type · } | { +MessageChange · type · event: "reaction"; +MessageChange · type · chatId: Id; +MessageChange · type · chatTitle: string | null; +MessageChange · type · messageId: Id; +MessageChange · type · reactions: Reactions; +MessageChange · type · counterObservation?: CounterObservation; +MessageChange · type · }; +MessageDeliveryEvent · interface · export interface MessageDeliveryEvent { +MessageDeliveryEvent · interface · event: "delivery"; +MessageDeliveryEvent · interface · chatId: Id; +MessageDeliveryEvent · interface · chatTitle: string | null; +MessageDeliveryEvent · interface · messageId: Id; +MessageDeliveryEvent · interface · delivery: Delivery; +MessageDeliveryEvent · interface · at: string; +MessageDeliveryEvent · interface · } +MessageEvent · type · export type MessageEvent = { +MessageEvent · type · event: "message"; +MessageEvent · type · message: MessageHit; +MessageEvent · type · } | MessageChange | PollVoteEvent | PersonReactionEvent | MessageStarEvent | MessageDeliveryEvent | ChatEventNotice; +MessageHit · interface · export interface MessageHit extends Message { +MessageHit · interface · chatTitle: string | null; +MessageHit · interface · email?: MailFields; +MessageHit · interface · excerpt?: string; +MessageHit · interface · } +MessageLink · type · export type MessageLink = MessagePermalink & { +MessageLink · type · locator: string; +MessageLink · type · files?: FileLink[]; +MessageLink · type · }; +MessagePermalink · type · export type MessagePermalink = { +MessagePermalink · type · url: string; +MessagePermalink · type · access: "public" | "restricted" | "unknown"; +MessagePermalink · type · reason: null; +MessagePermalink · type · } | { +MessagePermalink · type · url: null; +MessagePermalink · type · access: "unavailable"; +MessagePermalink · type · reason: "unsupported_chat" | "unsupported_provider" | "offline"; +MessagePermalink · type · }; +MessageStarEvent · interface · export interface MessageStarEvent { +MessageStarEvent · interface · event: "star"; +MessageStarEvent · interface · chatId: Id; +MessageStarEvent · interface · chatTitle: string | null; +MessageStarEvent · interface · messageId: Id; +MessageStarEvent · interface · starred: boolean; +MessageStarEvent · interface · } +MoreGroupSettings · interface · export interface MoreGroupSettings { +MoreGroupSettings · interface · onlyAdminsSend?: boolean | null; +MoreGroupSettings · interface · onlyAdminsEditInfo?: boolean | null; +MoreGroupSettings · interface · disappearingSeconds?: number | null; +MoreGroupSettings · interface · } +OfficialChatStats · type · export type OfficialChatStats = OfficialGroupStats | OfficialChannelStats; +OutputOptions · interface · export interface OutputOptions { +OutputOptions · interface · json?: boolean; +OutputOptions · interface · jsonl?: boolean; +OutputOptions · interface · quiet?: boolean; +OutputOptions · interface · streams?: Streams; +OutputOptions · interface · tty?: boolean; +OutputOptions · interface · color?: boolean; +OutputOptions · interface · env?: NodeJS.ProcessEnv; +OutputOptions · interface · fields?: string; +OutputOptions · interface · hitDetail?: Detail; +OutputOptions · interface · capture?: (value: unknown) => void; +OutputOptions · interface · compact?: boolean; +OutputOptions · interface · } +PASTE_QR · const · export declare const PASTE_QR: string; +Page · interface · export interface Page { +Page · interface · items: T[]; +Page · interface · hasMore: boolean; +Page · interface · } +PeopleLookup · interface · export interface PeopleLookup { +PeopleLookup · interface · provider?: Provider; +PeopleLookup · interface · get(id: Id): Contact | undefined; +PeopleLookup · interface · all(): Contact[]; +PeopleLookup · interface · } +PersonAlias · interface · export interface PersonAlias { +PersonAlias · interface · name?: string; +PersonAlias · interface · username?: string; +PersonAlias · interface · link?: string; +PersonAlias · interface · firstSeenAt: string; +PersonAlias · interface · lastSeenAt: string; +PersonAlias · interface · source: "profile" | "messages"; +PersonAlias · interface · } +PersonCard · interface · export interface PersonCard extends Contact { +PersonCard · interface · notes?: { +PersonCard · interface · id: string; +PersonCard · interface · personId: string; +PersonCard · interface · text: string; +PersonCard · interface · revision: number; +PersonCard · interface · createdAt: string; +PersonCard · interface · updatedAt: string; +PersonCard · interface · }[]; +PersonCard · interface · chats: Pick[]; +PersonCard · interface · } +PersonFlag · type · export type PersonFlag = "bot" | "verified" | "premium" | "scam" | "fake" | "restricted" | "deleted" | "support"; +PersonProfile · interface · export interface PersonProfile extends Omit { +PersonProfile · interface · chats: SharedChatActivity[]; +PersonProfile · interface · aliases: PersonAlias[]; +PersonProfile · interface · } +PersonReaction · interface · export interface PersonReaction { +PersonReaction · interface · person: Member; +PersonReaction · interface · own: boolean; +PersonReaction · interface · reaction: string | null; +PersonReaction · interface · reactedAt: string; +PersonReaction · interface · } +PersonReactionEvent · interface · export interface PersonReactionEvent { +PersonReactionEvent · interface · event: "person_reaction"; +PersonReactionEvent · interface · chatId: Id; +PersonReactionEvent · interface · chatTitle: string | null; +PersonReactionEvent · interface · messageId: Id; +PersonReactionEvent · interface · reaction: PersonReaction; +PersonReactionEvent · interface · } +PhoneBookEntry · interface · export interface PhoneBookEntry { +PhoneBookEntry · interface · phone: string; +PhoneBookEntry · interface · name: string; +PhoneBookEntry · interface · } +Poll · interface · export interface Poll { +Poll · interface · chatId: Id; +Poll · interface · messageId: Id; +Poll · interface · question: string; +Poll · interface · answers: PollAnswer[]; +Poll · interface · closed: boolean; +Poll · interface · multiple: boolean; +Poll · interface · anonymous: boolean; +Poll · interface · voters: number | null; +Poll · interface · quiz?: boolean; +Poll · interface · revote?: boolean; +Poll · interface · creator?: boolean; +Poll · interface · } +PollAnswer · interface · export interface PollAnswer { +PollAnswer · interface · id: Id; +PollAnswer · interface · text: string; +PollAnswer · interface · voters: number | null; +PollAnswer · interface · chosen: boolean; +PollAnswer · interface · } +PollVote · interface · export interface PollVote { +PollVote · interface · person: Member; +PollVote · interface · answers: Id[]; +PollVote · interface · votedAt: string; +PollVote · interface · } +PollVoteEvent · interface · export interface PollVoteEvent { +PollVoteEvent · interface · event: "vote"; +PollVoteEvent · interface · chatId: Id; +PollVoteEvent · interface · chatTitle: string | null; +PollVoteEvent · interface · messageId: Id; +PollVoteEvent · interface · vote: PollVote; +PollVoteEvent · interface · } +PrivacySettings · interface · export interface PrivacySettings { +PrivacySettings · interface · findByPhone?: Audience; +PrivacySettings · interface · phoneNumber?: Audience; +PrivacySettings · interface · calls?: Audience; +PrivacySettings · interface · chatInvites?: Audience; +PrivacySettings · interface · hideOnline?: boolean; +PrivacySettings · interface · readReceipts?: boolean; +PrivacySettings · interface · profilePhoto?: ShownAudience; +PrivacySettings · interface · about?: ShownAudience; +PrivacySettings · interface · lastSeen?: ShownAudience; +PrivacySettings · interface · } +ProfileFacts · interface · export interface ProfileFacts { +ProfileFacts · interface · id: Id; +ProfileFacts · interface · name: string | null; +ProfileFacts · interface · usernames: string[]; +ProfileFacts · interface · bio: string | null; +ProfileFacts · interface · birthday?: string | null; +ProfileFacts · interface · phone?: string | null; +ProfileFacts · interface · flags: Partial>; +ProfileFacts · interface · seen?: Seen; +ProfileFacts · interface · contact?: boolean; +ProfileFacts · interface · mutualContact?: boolean; +ProfileFacts · interface · commonChatsCount?: number | null; +ProfileFacts · interface · registered?: Registered | null; +ProfileFacts · interface · hasPhoto?: boolean; +ProfileFacts · interface · chats: Pick[]; +ProfileFacts · interface · } +ProviderEntry · interface · export interface ProviderEntry { +ProviderEntry · interface · name: Provider; +ProviderEntry · interface · kind: Kind; +ProviderEntry · interface · kinds?: readonly Kind[]; +ProviderEntry · interface · imported?: boolean; +ProviderEntry · interface · aliases: readonly string[]; +ProviderEntry · interface · command?: string; +ProviderEntry · interface · opens?: Partial>; +ProviderEntry · interface · globalItemIds?: boolean; +ProviderEntry · interface · } +ProviderMetadata · type · export type ProviderMetadata = Record; +QuotedMessage · interface · export interface QuotedMessage { +QuotedMessage · interface · id: Id; +QuotedMessage · interface · senderId: Id | null; +QuotedMessage · interface · senderName: string | null; +QuotedMessage · interface · timestamp: string | null; +QuotedMessage · interface · text: string; +QuotedMessage · interface · attachments: Attachment[]; +QuotedMessage · interface · outgoing: boolean | null; +QuotedMessage · interface · } +RankingComponent · type · export type RankingComponent = Exclude | "replies-from-others" | "reactions-per-message" | "replies-from-others-per-message"; +RankingInput · interface · export interface RankingInput { +RankingInput · interface · measure?: string; +RankingInput · interface · score?: string; +RankingInput · interface · weights?: unknown; +RankingInput · interface · minMessages?: number; +RankingInput · interface · messageKind?: string; +RankingInput · interface · } +RankingTarget · type · export type RankingTarget = "messages" | "contacts"; +Reactions · interface · export interface Reactions { +Reactions · interface · counts: { +Reactions · interface · reaction: string; +Reactions · interface · count: number; +Reactions · interface · }[]; +Reactions · interface · mine: string | null; +Reactions · interface · total: number; +Reactions · interface · } +Reactor · interface · export interface Reactor { +Reactor · interface · person: Member; +Reactor · interface · reaction: string; +Reactor · interface · reactedAt: string; +Reactor · interface · } +RefKindName · type · export type RefKindName = Exclude; +Reference · type · export type Reference = { +Reference · type · type: "message"; +Reference · type · provider: string; +Reference · type · account: string; +Reference · type · chat: string; +Reference · type · message: string; +Reference · type · } | { +Reference · type · type: "chat"; +Reference · type · provider: string; +Reference · type · account: string; +Reference · type · chat: string; +Reference · type · } | { +Reference · type · type: "contact"; +Reference · type · provider: string; +Reference · type · id: string; +Reference · type · } | { +Reference · type · type: SimpleReference; +Reference · type · id: string; +Reference · type · } +Reference · type · | { +Reference · type · type: "folder"; +Reference · type · id: string; +Reference · type · path: string | null; +Reference · type · } | MeetingReference; +Registered · interface · export interface Registered { +Registered · interface · at: string; +Registered · interface · source: "telegram" | "max" | "estimate"; +Registered · interface · precision: "day" | "month"; +Registered · interface · } +Review · interface · export interface Review { +Review · interface · since: string; +Review · interface · until: string; +Review · interface · complete: boolean; +Review · interface · chats: ReviewChat[]; +Review · interface · skipped: Pick[]; +Review · interface · partial: boolean; +Review · interface · left?: string[]; +Review · interface · quiet: number; +Review · interface · unanswered?: { +Review · interface · olderThanHours: number; +Review · interface · }; +Review · interface · waiting?: { +Review · interface · olderThanHours: number; +Review · interface · }; +Review · interface · checked?: Record; +Review · interface · tasks?: { +Review · interface · added: number; +Review · interface · closed: number; +Review · interface · review: number; +Review · interface · }; +Review · interface · offline?: true; +Review · interface · } +ReviewChat · interface · export interface ReviewChat extends Pick { +ReviewChat · interface · messages: Message[]; +ReviewChat · interface · more: boolean; +ReviewChat · interface · answeredBy?: "owner" | "owner-and-admins"; +ReviewChat · interface · } +SecretInput · interface · export interface SecretInput { +SecretInput · interface · input?: NodeJS.ReadableStream & { +SecretInput · interface · isTTY?: boolean; +SecretInput · interface · }; +SecretInput · interface · output?: NodeJS.WritableStream; +SecretInput · interface · echo?: boolean; +SecretInput · interface · signal?: AbortSignal; +SecretInput · interface · } +SharedChatActivity · interface · export interface SharedChatActivity { +SharedChatActivity · interface · id: Id; +SharedChatActivity · interface · title: string | null; +SharedChatActivity · interface · kind: ChatKind; +SharedChatActivity · interface · theirMessages: number; +SharedChatActivity · interface · firstAt: string | null; +SharedChatActivity · interface · lastAt: string | null; +SharedChatActivity · interface · complete: boolean; +SharedChatActivity · interface · } +SharedContact · interface · export interface SharedContact { +SharedContact · interface · name: string; +SharedContact · interface · firstName?: string; +SharedContact · interface · lastName?: string; +SharedContact · interface · phone?: string; +SharedContact · interface · userId?: Id; +SharedContact · interface · } +StageOutcome · type · export type StageOutcome = DealStatus; +TextSpan · interface · export interface TextSpan { +TextSpan · interface · type: "bold" | "italic" | "strike" | "underline" | "code" | "pre" | "link" | "blockquote" | "spoiler" | "highlight" | "heading"; +TextSpan · interface · from: number; +TextSpan · interface · length: number; +TextSpan · interface · url?: string; +TextSpan · interface · language?: string; +TextSpan · interface · } +Topic · interface · export interface Topic { +Topic · interface · id: Id; +Topic · interface · title: string; +Topic · interface · closed: boolean; +Topic · interface · pinned: boolean; +Topic · interface · hidden?: boolean; +Topic · interface · unreadCount: number | null; +Topic · interface · lastMessageAt: string | null; +Topic · interface · createdAt: string | null; +Topic · interface · } +TopicChange · interface · export interface TopicChange { +TopicChange · interface · title?: string; +TopicChange · interface · closed?: boolean; +TopicChange · interface · pinned?: boolean; +TopicChange · interface · hidden?: boolean; +TopicChange · interface · icon?: string | null; +TopicChange · interface · } +WindowedMessage · type · export type WindowedMessage = Message & { +WindowedMessage · type · anchor?: true; +WindowedMessage · type · }; +atTerminal · const · export declare const atTerminal: (input: NodeJS.ReadableStream & { +atTerminal · const · isTTY?: boolean; +atTerminal · const · }) => boolean; +bareCheck · const · export declare const bareCheck: (check: C, args?: string) => string; +checkWords · const · export declare const checkWords: (command: string, profile?: string) => CheckWords; +e164Of · const · export declare const e164Of: (phone: string, region: string | undefined) => string | null | undefined; +failureContext · const · export declare const failureContext: (errors?: AppErrors) => FailureContext; +formatReference · const · export declare const formatReference: (reference: Reference) => string; +isFolderProvider · const · export declare const isFolderProvider: (provider: string) => boolean; +loginQr · const · export declare const loginQr: ({ diagnostic, note, indent: pad, columns, terminal, json, }: LoginQrOptions) => LoginQr; +normalizeTag · const · export declare const normalizeTag: (value: string) => string; +observedCounters · const · export declare const observedCounters: (message: Message, observedAt: string, fields: readonly CounterField[], source?: CounterObservation["source"]) => Message; +parseMarkdownSpans · const · export declare const parseMarkdownSpans: (input: string) => FormattedText; +parseReference · const · export declare const parseReference: (text: string) => Reference; +pickChat · const · export declare const pickChat: (reference: string, chats: Chat[]) => Chat; +pickPerson · const · export declare const pickPerson: (reference: string, people: PeopleLookup) => Contact; +plainQr · const · export declare const plainQr: (link: string) => string; +providerNamed · const · export declare const providerNamed: (word: string) => ProviderEntry | undefined; +readSecret · const · export declare const readSecret: (prompt: string, { input, output, echo, signal: givenSignal }?: SecretInput) => Promise; +resolveOutput · const · export declare const resolveOutput: ({ json, jsonl, quiet, streams, tty, color, fields, hitDetail, env, capture, compact, }?: OutputOptions) => { +resolveOutput · const · format: "json" | "jsonl" | "pretty"; +resolveOutput · const · color: boolean; +resolveOutput · const · streams: Streams; +resolveOutput · const · renderer: Renderer; +resolveOutput · const · compact?: boolean | undefined; +resolveOutput · const · full?: boolean | undefined; +resolveOutput · const · }; +validateFormattedText · const · export declare const validateFormattedText: (formatted: FormattedText) => FormattedText; diff --git a/api/mcp.api.txt b/api/mcp.api.txt new file mode 100644 index 000000000..65ba04b54 --- /dev/null +++ b/api/mcp.api.txt @@ -0,0 +1,57 @@ +# @wirecat/cli-core "./mcp": the stable API, written by cli-dev api-report. Do not edit. +AgentProgram · interface · export interface AgentProgram { +AgentProgram · interface · run: (argv: string[], environment: RunOptions) => Promise; +AgentProgram · interface · commands: readonly CommandInfo[]; +AgentProgram · interface · } +AgentTool · interface · export interface AgentTool { +AgentTool · interface · availability?: () => CommandAvailability; +AgentTool · interface · command: string; +AgentTool · interface · path: readonly string[]; +AgentTool · interface · title: string; +AgentTool · interface · description: string; +AgentTool · interface · keywords?: readonly string[]; +AgentTool · interface · writes: boolean; +AgentTool · interface · input: v.ObjectSchema; +AgentTool · interface · output?: CommandOutput; +AgentTool · interface · } +BotServerOptions · interface · export interface BotServerOptions { +BotServerOptions · interface · bot: BotMessenger; +BotServerOptions · interface · program: AgentProgram; +BotServerOptions · interface · settings: Pick; +BotServerOptions · interface · levels?: () => Readonly>; +BotServerOptions · interface · keyOf?: (path: readonly string[]) => PermissionKey | null | undefined; +BotServerOptions · interface · authority?: (path: readonly string[]) => boolean; +BotServerOptions · interface · fetchOnly?: (path: readonly string[]) => boolean; +BotServerOptions · interface · fetches?: (path: readonly string[]) => boolean; +BotServerOptions · interface · env: NodeJS.ProcessEnv; +BotServerOptions · interface · skill?: URL; +BotServerOptions · interface · } +CatalogueOptions · interface · export interface CatalogueOptions { +CatalogueOptions · interface · includeUnavailable?: boolean; +CatalogueOptions · interface · root?: readonly string[]; +CatalogueOptions · interface · exclude?: readonly (readonly string[])[]; +CatalogueOptions · interface · currentLevels?: () => Readonly>; +CatalogueOptions · interface · levels?: Readonly>; +CatalogueOptions · interface · readOnly?: boolean; +CatalogueOptions · interface · keyOf?: (path: readonly string[]) => PermissionKey | null | undefined; +CatalogueOptions · interface · permissions?: CommandPermissions | undefined; +CatalogueOptions · interface · authority?: (path: readonly string[]) => boolean; +CatalogueOptions · interface · fetchOnly?: (path: readonly string[]) => boolean; +CatalogueOptions · interface · fetches?: (path: readonly string[]) => boolean; +CatalogueOptions · interface · omit?: readonly string[]; +CatalogueOptions · interface · offline?: boolean; +CatalogueOptions · interface · stdin?: (path: readonly string[]) => StdinField | undefined; +CatalogueOptions · interface · } +CommandAvailability · interface · export interface CommandAvailability { +CommandAvailability · interface · available: boolean; +CommandAvailability · interface · reason?: string; +CommandAvailability · interface · permission?: string; +CommandAvailability · interface · level?: Level; +CommandAvailability · interface · } +RunBotCommand · type · export type RunBotCommand = AgentProgram["run"]; +createBotServer · const · export declare const createBotServer: (options: BotServerOptions) => { +createBotServer · const · build: () => McpServer; +createBotServer · const · tools: import("../agent.js").AgentTool[]; +createBotServer · const · offered: string[]; +createBotServer · const · }; +toolsFromCommands · const · export declare const toolsFromCommands: (commands: readonly CommandInfo[], options?: CatalogueOptions) => AgentTool[]; diff --git a/api/sends.api.txt b/api/sends.api.txt new file mode 100644 index 000000000..d091d5b0d --- /dev/null +++ b/api/sends.api.txt @@ -0,0 +1,205 @@ +# @wirecat/cli-core "./sends": the stable API, written by cli-dev api-report. Do not edit. +Asker · type · export type Asker = (key: PermissionKey, request: GuardRequest) => Promise; +CEILING_KEY · const · export declare const CEILING_KEY = "*"; +DEFAULT_PERMISSIONS · const · export declare const DEFAULT_PERMISSIONS: Readonly>; +FloodDeadline · interface · export interface FloodDeadline { +FloodDeadline · interface · operation: string; +FloodDeadline · interface · chatId?: string; +FloodDeadline · interface · until: string; +FloodDeadline · interface · providerError?: string; +FloodDeadline · interface · } +FloodMemory · class · export declare class FloodMemory { +FloodMemory · class · readonly path: string; +FloodMemory · class · constructor(path: string, now?: () => number); +FloodMemory · class · read(): FloodState; +FloodMemory · class · owed(operation: string, chatId?: string): FloodDeadline | undefined; +FloodMemory · class · remember(deadline: Omit & { +FloodMemory · class · waitMs: number; +FloodMemory · class · }): FloodDeadline; +FloodMemory · class · sendBlock(): SendBlock | undefined; +FloodMemory · class · block(block: Omit & { +FloodMemory · class · until?: string; +FloodMemory · class · }): SendBlock; +FloodMemory · class · unblock(state: SendBlock["state"]): void; +FloodMemory · class · clear(): FloodState; +FloodMemory · class · } +FloodState · interface · export interface FloodState { +FloodState · interface · deadlines: FloodDeadline[]; +FloodState · interface · sendBlock?: SendBlock; +FloodState · interface · } +GuardRequest · interface · export interface GuardRequest { +GuardRequest · interface · chatId: Id | null; +GuardRequest · interface · kind?: SendKind; +GuardRequest · interface · action?: ChatAction | AccountAction; +GuardRequest · interface · count?: number; +GuardRequest · interface · sendId?: string; +GuardRequest · interface · sendAs?: Id; +GuardRequest · interface · operationId?: string; +GuardRequest · interface · scheduledFor?: string; +GuardRequest · interface · notify?: boolean; +GuardRequest · interface · personIds?: Id[]; +GuardRequest · interface · forEveryone?: boolean; +GuardRequest · interface · key?: PermissionKey; +GuardRequest · interface · } +KeyedGuard · type · export type KeyedGuard = SendGuard & { +KeyedGuard · type · refuse(request: GuardRequest): void; +KeyedGuard · type · }; +LEVELS · const · export declare const LEVELS: readonly ["deny", "readonly", "ask", "allow"]; +Level · type · export type Level = (typeof LEVELS)[number]; +Operated · type · export type Operated = T & { +Operated · type · operationId: string; +Operated · type · }; +PaceRate · interface · export interface PaceRate { +PaceRate · interface · perMinute: number; +PaceRate · interface · burst: number; +PaceRate · interface · } +Pacer · class · export declare class Pacer { +Pacer · class · readonly path: string; +Pacer · class · constructor(path: string, rate: PaceRate, now?: () => number); +Pacer · class · get interval(): number; +Pacer · class · reserve(): Promise; +Pacer · class · holdFor(waitMs: number): Promise; +Pacer · class · reset(): Promise; +Pacer · class · } +Recipient · interface · export interface Recipient { +Recipient · interface · id: Id; +Recipient · interface · title: string | null; +Recipient · interface · partnerId?: Id; +Recipient · interface · addedAt: string; +Recipient · interface · } +RecipientList · class · export declare class RecipientList { +RecipientList · class · readonly path: string; +RecipientList · class · readonly command: string; +RecipientList · class · readonly lockWaitMs?: number | undefined; +RecipientList · class · constructor(path: string, command: string, lockWaitMs?: number | undefined); +RecipientList · class · read(): Recipient[] | undefined; +RecipientList · class · list(filter?: RecipientFilter): { +RecipientList · class · state: "off" | "empty" | "on"; +RecipientList · class · items: Recipient[]; +RecipientList · class · }; +RecipientList · class · add(recipient: Recipient): boolean; +RecipientList · class · addAsync(recipient: Recipient): Promise; +RecipientList · class · remove(reference: string): Recipient | undefined; +RecipientList · class · rekey(from: Id, to: Id): Promise; +RecipientList · class · off(): boolean; +RecipientList · class · } +SendBlock · interface · export interface SendBlock { +SendBlock · interface · state: "frozen" | "limited" | "banned"; +SendBlock · interface · since: string; +SendBlock · interface · until: string | null; +SendBlock · interface · hint: string; +SendBlock · interface · } +SendEntry · interface · export interface SendEntry { +SendEntry · interface · at: string; +SendEntry · interface · profile: string; +SendEntry · interface · chatId: Id | null; +SendEntry · interface · outcome: SendOutcome; +SendEntry · interface · kind?: SendKind; +SendEntry · interface · action?: ChatAction | AccountAction; +SendEntry · interface · people?: number; +SendEntry · interface · messageId?: Id; +SendEntry · interface · key?: string; +SendEntry · interface · count?: number; +SendEntry · interface · forEveryone?: boolean; +SendEntry · interface · sendId?: string; +SendEntry · interface · operationId?: string; +SendEntry · interface · parentOperationId?: string; +SendEntry · interface · replyTo?: Id; +SendEntry · interface · threadId?: Id; +SendEntry · interface · sendAs?: Id; +SendEntry · interface · resultChatId?: Id; +SendEntry · interface · length?: number; +SendEntry · interface · attachments?: { +SendEntry · interface · kind: "photo" | "file" | "video" | "voice" | "sticker"; +SendEntry · interface · bytes: number; +SendEntry · interface · }[]; +SendEntry · interface · scheduledFor?: string; +SendEntry · interface · notify?: boolean; +SendEntry · interface · origin?: string; +SendEntry · interface · reservation?: string; +SendEntry · interface · errorCode?: string; +SendEntry · interface · } +SendGuard · interface · export interface SendGuard { +SendGuard · interface · check(request: GuardRequest, options?: { +SendGuard · interface · reserve?: boolean; +SendGuard · interface · }): void; +SendGuard · interface · reserve?(request: GuardRequest): Promise; +SendGuard · interface · ask?(request: GuardRequest): Promise; +SendGuard · interface · record(entry: Omit): void; +SendGuard · interface · } +SendGuardOptions · interface · export interface SendGuardOptions { +SendGuardOptions · interface · profile: string; +SendGuardOptions · interface · command?: string; +SendGuardOptions · interface · readOnlyLock?: string; +SendGuardOptions · interface · permissions?: Readonly> | (() => Readonly>); +SendGuardOptions · interface · permissionSources?: Readonly>; +SendGuardOptions · interface · permissionDefaults?: Readonly>; +SendGuardOptions · interface · permissionFix?: (request: GuardRequest, key: PermissionKey) => string; +SendGuardOptions · interface · ask?: Asker; +SendGuardOptions · interface · sendsPerHour: number; +SendGuardOptions · interface · journal: SendJournal; +SendGuardOptions · interface · recipients: RecipientList; +SendGuardOptions · interface · flood?: FloodMemory; +SendGuardOptions · interface · warn: Warn; +SendGuardOptions · interface · now?: () => Date; +SendGuardOptions · interface · } +SendJournal · class · export declare class SendJournal { +SendJournal · class · readonly path: string; +SendJournal · class · constructor(path: string, +SendJournal · class · resource?: LogRecord["resource"]); +SendJournal · class · locked(body: () => T): T; +SendJournal · class · lockedAsync(body: () => T): Promise; +SendJournal · class · append(entry: SendEntry): void; +SendJournal · class · entries(filter?: SendFilter): SendEntry[]; +SendJournal · class · } +SendKind · type · export type SendKind = "message" | "reaction" | "edit" | "forward" | "pin" | "read" | "delete" | "chat" | "account"; +SendOutcome · type · export type SendOutcome = "sent" | "outcome_unknown" | "refused" | "failed" | "reserved"; +StickerFile · interface · export interface StickerFile { +StickerFile · interface · name: string; +StickerFile · interface · source: UploadSource; +StickerFile · interface · } +Upload · interface · export interface Upload { +Upload · interface · kind: UploadKind; +Upload · interface · name: string; +Upload · interface · source: UploadSource; +Upload · interface · asFile?: true; +Upload · interface · } +UploadKind · type · export type UploadKind = "photo" | "file" | "voice"; +UploadSource · type · export type UploadSource = { +UploadSource · type · kind: "file"; +UploadSource · type · path: string; +UploadSource · type · size: number; +UploadSource · type · } | { +UploadSource · type · kind: "bytes"; +UploadSource · type · bytes: Uint8Array; +UploadSource · type · }; +guardFor · const · export declare const guardFor: (app: AppIdentity, settings: GuardSettings, warn: Warn, env?: NodeJS.ProcessEnv, ask?: Asker) => SendGuard; +guardedWrite · const · export declare const guardedWrite: (guard: SendGuard, attempt: Attempt, act: () => Promise, settled?: (done: T) => Partial, prepare?: () => Promise) => Promise; +guardedWrite · const · type Attempt = Omit & { +guardedWrite · const · operationId: string; +guardedWrite · const · key?: PermissionKey; +guardedWrite · const · personIds?: Id[]; +guardedWrite · const · }; +keyForCommand · const · export declare const keyForCommand: (path: readonly string[]) => PermissionKey | null | undefined; +keyedGuard · const · export declare const keyedGuard: (build: (ask: Asker) => SendGuard, ask: Asker, levelOf: (key: PermissionKey) => Level, extra: readonly PermissionKey[]) => KeyedGuard; +layerPermissions · const · export declare const layerPermissions: (layers: readonly [string, Readonly> | undefined][]) => { +layerPermissions · const · levels: Record; +layerPermissions · const · sources: Record; +layerPermissions · const · }; +levelFor · const · export declare const levelFor: (permissions: Readonly>, key: PermissionKey, defaults?: Readonly>) => { +levelFor · const · level: Level; +levelFor · const · key: PermissionKey | null; +levelFor · const · }; +newOperationId · const · export declare const newOperationId: typeof newSendId; +newSendId · const · export declare const newSendId: () => string; +pacePathFor · const · export declare const pacePathFor: (app: AppIdentity, profile: string, env?: NodeJS.ProcessEnv) => string; +readUpload · const · export declare const readUpload: (kind: UploadKind, path: string, { app, env, anyFile, photoTypes, }: { +readUpload · const · app: AppIdentity; +readUpload · const · env?: NodeJS.ProcessEnv; +readUpload · const · anyFile?: boolean; +readUpload · const · photoTypes?: readonly string[]; +readUpload · const · }) => Promise; +refusedPlace · const · export declare const refusedPlace: (path: string, app: AppIdentity, env: NodeJS.ProcessEnv, platform?: NodeJS.Platform) => boolean; +sendGuard · const · export declare const sendGuard: ({ profile, recipients, command, readOnlyLock, permissions, permissionSources, permissionDefaults, permissionFix, ask, sendsPerHour, journal, flood, warn, now, }: SendGuardOptions) => SendGuard; +sendsPathFor · const · export declare const sendsPathFor: (app: AppIdentity, profile: string, env?: NodeJS.ProcessEnv) => string; +uploadBlob · const · export declare const uploadBlob: (source: UploadSource, type?: string) => Promise; diff --git a/api/skill-validation.api.txt b/api/skill-validation.api.txt new file mode 100644 index 000000000..5f72e16ae --- /dev/null +++ b/api/skill-validation.api.txt @@ -0,0 +1,9 @@ +# @wirecat/cli-core "./skill-validation": the stable API, written by cli-dev api-report. Do not edit. +SkillValidation · interface · export interface SkillValidation { +SkillValidation · interface · folder?: string; +SkillValidation · interface · file?: string; +SkillValidation · interface · version?: string; +SkillValidation · interface · program?: Command; +SkillValidation · interface · maxBytes?: number; +SkillValidation · interface · } +validateSkill · const · export declare const validateSkill: (content: string, options?: SkillValidation) => string[]; diff --git a/api/sqlite-runtime.api.txt b/api/sqlite-runtime.api.txt new file mode 100644 index 000000000..234e0b8b1 --- /dev/null +++ b/api/sqlite-runtime.api.txt @@ -0,0 +1,15 @@ +# @wirecat/cli-core "./sqlite-runtime": the stable API, written by cli-dev api-report. Do not edit. +SqliteRuntime · interface · export interface SqliteRuntime { +SqliteRuntime · interface · env: NodeJS.ProcessEnv; +SqliteRuntime · interface · platform: NodeJS.Platform; +SqliteRuntime · interface · bun: boolean; +SqliteRuntime · interface · maps(): string; +SqliteRuntime · interface · capable(): Promise; +SqliteRuntime · interface · library(musl: boolean): Promise<{ +SqliteRuntime · interface · path: string; +SqliteRuntime · interface · version: string; +SqliteRuntime · interface · } | undefined>; +SqliteRuntime · interface · works(env: NodeJS.ProcessEnv, version: string): boolean; +SqliteRuntime · interface · restart(env: NodeJS.ProcessEnv): Promise; +SqliteRuntime · interface · } +ensureSqlite · const · export declare const ensureSqlite: (runtime?: SqliteRuntime) => Promise; diff --git a/api/store.api.txt b/api/store.api.txt new file mode 100644 index 000000000..c53fa86b9 --- /dev/null +++ b/api/store.api.txt @@ -0,0 +1,491 @@ +# @wirecat/cli-core "./store": the stable API, written by cli-dev api-report. Do not edit. +AccountGroupChange · interface · export interface AccountGroupChange { +AccountGroupChange · interface · remove?: { +AccountGroupChange · interface · group: string; +AccountGroupChange · interface · drop: (entry: string) => boolean; +AccountGroupChange · interface · }; +AccountGroupChange · interface · add?: { +AccountGroupChange · interface · group: string; +AccountGroupChange · interface · entry: string; +AccountGroupChange · interface · }; +AccountGroupChange · interface · } +AccountKey · interface · export interface AccountKey { +AccountKey · interface · provider: Provider; +AccountKey · interface · account: Id; +AccountKey · interface · scope?: "personal" | "work"; +AccountKey · interface · } +AccountMessageFilter · interface · export interface AccountMessageFilter { +AccountMessageFilter · interface · senders?: Id[]; +AccountMessageFilter · interface · together?: boolean; +AccountMessageFilter · interface · text?: string; +AccountMessageFilter · interface · chatId?: Id; +AccountMessageFilter · interface · limit: number; +AccountMessageFilter · interface · perChat?: boolean; +AccountMessageFilter · interface · } +AccountsStore · interface · export interface AccountsStore extends AccountAccounts { +AccountsStore · interface · accounts(): Promise; +AccountsStore · interface · storedAccounts(): Promise; +AccountsStore · interface · setScope(key: AccountKey, scope: StoredAccount["scope"]): Promise; +AccountsStore · interface · accountGroups(): Promise; +AccountsStore · interface · saveAccountGroup(name: string, members: string[] | undefined): Promise; +AccountsStore · interface · changeAccountGroups(change: AccountGroupChange): Promise<{ +AccountsStore · interface · removed: string[]; +AccountsStore · interface · }>; +AccountsStore · interface · renameAccountGroup(from: string, to: string): Promise; +AccountsStore · interface · profiles(): Promise; +AccountsStore · interface · saveProfile(app: string, profile: string, key: AccountKey): Promise; +AccountsStore · interface · forgetProfile(app: string, profile: string): Promise; +AccountsStore · interface · registerProvider(entry: ProviderEntry): Promise; +AccountsStore · interface · } +AgentLink · type · export type AgentLink = { +AgentLink · type · outcome: "merged"; +AgentLink · type · person: string; +AgentLink · type · merge: string; +AgentLink · type · proposal: string; +AgentLink · type · evidence: LinkEvidence; +AgentLink · type · } | { +AgentLink · type · outcome: "proposed"; +AgentLink · type · proposal: string; +AgentLink · type · evidence: LinkEvidence; +AgentLink · type · }; +AgentLinkInput · interface · export interface AgentLinkInput { +AgentLinkInput · interface · identity: IdentityRef; +AgentLinkInput · interface · with: IdentityRef; +AgentLinkInput · interface · bot: string; +AgentLinkInput · interface · run?: string; +AgentLinkInput · interface · reason: string; +AgentLinkInput · interface · apply: boolean; +AgentLinkInput · interface · } +AgentMerge · interface · export interface AgentMerge { +AgentMerge · interface · proposal: string; +AgentMerge · interface · bot: string; +AgentMerge · interface · run: string | null; +AgentMerge · interface · reason: string | null; +AgentMerge · interface · evidence: LinkEvidence | null; +AgentMerge · interface · } +CacheDatabase · interface · export interface CacheDatabase { +CacheDatabase · interface · exec(sql: string): void; +CacheDatabase · interface · prepare(sql: string): CacheStatement; +CacheDatabase · interface · close(): void; +CacheDatabase · interface · timeLimit?: true; +CacheDatabase · interface · } +CacheStatement · interface · export interface CacheStatement { +CacheStatement · interface · run(...parameters: SqlValue[]): { +CacheStatement · interface · changes: number; +CacheStatement · interface · }; +CacheStatement · interface · get(...parameters: SqlValue[]): Record | undefined; +CacheStatement · interface · all(...parameters: SqlValue[]): Record[]; +CacheStatement · interface · } +ChatStats · interface · export interface ChatStats { +ChatStats · interface · chatId: Id; +ChatStats · interface · title: string | null; +ChatStats · interface · kind: ChatKind; +ChatStats · interface · messages: number; +ChatStats · interface · oldestAt: string | null; +ChatStats · interface · newestAt: string | null; +ChatStats · interface · lastStoredAt: string | null; +ChatStats · interface · } +ChatsStore · interface · export interface ChatsStore { +ChatsStore · interface · saveChats(key: AccountKey, chats: ChatUpdate[]): Promise; +ChatsStore · interface · chats(key: AccountKey, window: { +ChatsStore · interface · limit?: number; +ChatsStore · interface · offset?: number; +ChatsStore · interface · } & StoredChatFilter): Promise>; +ChatsStore · interface · countChats(key: AccountKey, filter?: StoredChatFilter): Promise; +ChatsStore · interface · chatsWith(key: AccountKey, memberId: Id): Promise; +ChatsStore · interface · setChatScope(key: AccountKey, chatId: Id, scope: StoredAccount["scope"] | null): Promise; +ChatsStore · interface · chatScopes(key: AccountKey, chatIds: readonly Id[]): Promise>; +ChatsStore · interface · markChatsLeft(key: AccountKey, present: Id[]): Promise; +ChatsStore · interface · rejoinChats(key: AccountKey, present: Id[]): Promise; +ChatsStore · interface · rekeyChat(key: AccountKey, from: Id, to: Id): Promise; +ChatsStore · interface · rekeyChats(key: AccountKey, pairs: readonly { +ChatsStore · interface · from: Id; +ChatsStore · interface · to: Id; +ChatsStore · interface · }[], lockMs: number): Promise; +ChatsStore · interface · leftChats(key: AccountKey, options?: { +ChatsStore · interface · clear?: boolean; +ChatsStore · interface · }): Promise; +ChatsStore · interface · chatCompleteness(key: AccountKey, chatIds: Id[]): Promise; +ChatsStore · interface · chatCoverage(key: AccountKey): Promise; +ChatsStore · interface · chatStats(key: AccountKey, chatId?: Id): Promise; +ChatsStore · interface · chatsNewest(key: AccountKey): Promise[]>; +ChatsStore · interface · renamedChatId(key: AccountKey, chatId: Id): Promise; +ChatsStore · interface · historyShapes(key: AccountKey, chatIds: Id[]): Promise>; +ChatsStore · interface · recordHistorySkips(key: AccountKey, skips: Map): Promise; +ChatsStore · interface · setHistoryIncluded(key: AccountKey, chatId: Id, included: boolean): Promise; +ChatsStore · interface · historySkips(key: AccountKey): Promise; +ChatsStore · interface · chatKind(key: AccountKey, chatId: Id): Promise; +ChatsStore · interface · chatTitle(key: AccountKey, chatId: Id): Promise; +ChatsStore · interface · chatActivity(key: AccountKey, since: number, where?: Where): Promise<{ +ChatsStore · interface · chats: ChatActivity[]; +ChatsStore · interface · storedAt: string | null; +ChatsStore · interface · }>; +ChatsStore · interface · chatMetadata(key: AccountKey, chatId: Id): Promise; +ChatsStore · interface · saveChatMetadata(key: AccountKey, entry: Omit): Promise; +ChatsStore · interface · replaceAutoTags(key: AccountKey, chatId: Id, algorithm: string, tags: ChannelTagMatch[]): Promise; +ChatsStore · interface · rankingDiscussionChats(account: AccountKey, chatId: string): Promise; +ChatsStore · interface · } +ContextEvidenceSender · interface · export interface ContextEvidenceSender { +ContextEvidenceSender · interface · provider: string; +ContextEvidenceSender · interface · id: string; +ContextEvidenceSender · interface · name: string | null; +ContextEvidenceSender · interface · person: string | null; +ContextEvidenceSender · interface · personName: string | null; +ContextEvidenceSender · interface · owner: boolean; +ContextEvidenceSender · interface · } +ContextSource · interface · export interface ContextSource { +ContextSource · interface · kind: (typeof CONTEXT_SOURCE_KINDS)[number]; +ContextSource · interface · accountId: number; +ContextSource · interface · provider: string; +ContextSource · interface · account: string; +ContextSource · interface · } +DamageCause · interface · export interface DamageCause { +DamageCause · interface · cause: string; +DamageCause · interface · check: string; +DamageCause · interface · } +DamagedTable · interface · export interface DamagedTable { +DamagedTable · interface · table: string | null; +DamagedTable · interface · problems: number; +DamagedTable · interface · sample: string; +DamagedTable · interface · } +Decider · type · export type Decider = "owner" | { +Decider · type · bot: string; +Decider · type · model?: string; +Decider · type · reason: string; +Decider · type · }; +DecisionPolicy · interface · export interface DecisionPolicy { +DecisionPolicy · interface · agentDecisions: boolean; +DecisionPolicy · interface · ruleProposalsOwnerOnly: boolean; +DecisionPolicy · interface · } +DeletionScope · type · export type DeletionScope = (chat: Pick) => boolean; +IdentityLinkDecision · interface · export interface IdentityLinkDecision { +IdentityLinkDecision · interface · confirm: boolean; +IdentityLinkDecision · interface · by: Decider; +IdentityLinkDecision · interface · reason?: string; +IdentityLinkDecision · interface · company?: { +IdentityLinkDecision · interface · organization?: number; +IdentityLinkDecision · interface · name?: string; +IdentityLinkDecision · interface · all?: boolean; +IdentityLinkDecision · interface · mailbox?: string; +IdentityLinkDecision · interface · }; +IdentityLinkDecision · interface · organization?: { +IdentityLinkDecision · interface · organization?: number; +IdentityLinkDecision · interface · name?: string; +IdentityLinkDecision · interface · all?: boolean; +IdentityLinkDecision · interface · }; +IdentityLinkDecision · interface · } +IdentityLinkFilter · interface · export interface IdentityLinkFilter { +IdentityLinkFilter · interface · person?: string; +IdentityLinkFilter · interface · status?: IdentityLinkRow["status"] | "all"; +IdentityLinkFilter · interface · order?: "newest" | "score"; +IdentityLinkFilter · interface · limit: number; +IdentityLinkFilter · interface · offset: number; +IdentityLinkFilter · interface · } +IdentityLinkInput · interface · export interface IdentityLinkInput { +IdentityLinkInput · interface · identity: IdentityRef; +IdentityLinkInput · interface · with: IdentityRef; +IdentityLinkInput · interface · signal: IdentityLinkSignal; +IdentityLinkInput · interface · by: Author; +IdentityLinkInput · interface · reason?: string; +IdentityLinkInput · interface · score?: number; +IdentityLinkInput · interface · evidence?: string[]; +IdentityLinkInput · interface · } +IdentityLinkRow · interface · export interface IdentityLinkRow { +IdentityLinkRow · interface · id: string; +IdentityLinkRow · interface · status: "proposed" | "confirmed" | "rejected"; +IdentityLinkRow · interface · persons: [string, string]; +IdentityLinkRow · interface · identity: string; +IdentityLinkRow · interface · with: string | null; +IdentityLinkRow · interface · joins: IdentityLinkPayload["joins"]; +IdentityLinkRow · interface · signal: IdentityLinkSignal; +IdentityLinkRow · interface · score: number | null; +IdentityLinkRow · interface · shared: SharedMailbox | null; +IdentityLinkRow · interface · mailbox: string | null; +IdentityLinkRow · interface · candidates: string[]; +IdentityLinkRow · interface · reason: string | null; +IdentityLinkRow · interface · evidence: string[]; +IdentityLinkRow · interface · proposedBy: Proposer; +IdentityLinkRow · interface · createdAt: string; +IdentityLinkRow · interface · } +IdentityRef · interface · export interface IdentityRef { +IdentityRef · interface · provider: Provider; +IdentityRef · interface · id: Id; +IdentityRef · interface · } +IdentitySplitDecision · interface · export interface IdentitySplitDecision { +IdentitySplitDecision · interface · confirm: boolean; +IdentitySplitDecision · interface · by: Decider; +IdentitySplitDecision · interface · reason?: string; +IdentitySplitDecision · interface · } +IdentitySplitFilter · interface · export interface IdentitySplitFilter { +IdentitySplitFilter · interface · status?: IdentitySplitRow["status"] | "all"; +IdentitySplitFilter · interface · limit: number; +IdentitySplitFilter · interface · offset: number; +IdentitySplitFilter · interface · } +IdentitySplitInput · type · export type IdentitySplitInput = ({ +IdentitySplitInput · type · identities: IdentityRef[]; +IdentitySplitInput · type · from?: string; +IdentitySplitInput · type · } | { +IdentitySplitInput · type · merge: string; +IdentitySplitInput · type · }) & { +IdentitySplitInput · type · by: Author; +IdentitySplitInput · type · reason: string; +IdentitySplitInput · type · evidence?: string[]; +IdentitySplitInput · type · }; +IdentitySplitMove · type · export type IdentitySplitMove = "unlink" | "unmerge"; +IdentitySplitRow · interface · export interface IdentitySplitRow { +IdentitySplitRow · interface · id: string; +IdentitySplitRow · interface · status: "proposed" | "confirmed" | "rejected" | "dropped"; +IdentitySplitRow · interface · split: IdentitySplitMove; +IdentitySplitRow · interface · person: string; +IdentitySplitRow · interface · identities: string[]; +IdentitySplitRow · interface · merge: string | null; +IdentitySplitRow · interface · reason: string | null; +IdentitySplitRow · interface · evidence: string[]; +IdentitySplitRow · interface · proposedBy: Proposer; +IdentitySplitRow · interface · createdAt: string; +IdentitySplitRow · interface · } +InvalidJson · interface · export interface InvalidJson { +InvalidJson · interface · table: string; +InvalidJson · interface · column: string; +InvalidJson · interface · rows: number; +InvalidJson · interface · required: boolean; +InvalidJson · interface · } +JournalMark · interface · export interface JournalMark { +JournalMark · interface · at: string; +JournalMark · interface · command: string; +JournalMark · interface · seen: "missing" | "replaced" | "shm-without-wal"; +JournalMark · interface · } +LinkEvidence · interface · export interface LinkEvidence { +LinkEvidence · interface · persons: [string, string]; +LinkEvidence · interface · strong: boolean; +LinkEvidence · interface · facts: LinkFact[]; +LinkEvidence · interface · weak: LinkHold | null; +LinkEvidence · interface · } +LinkOptions · interface · export interface LinkOptions { +LinkOptions · interface · method: string; +LinkOptions · interface · by: string; +LinkOptions · interface · } +LinkedIdentity · interface · export interface LinkedIdentity extends IdentityRef { +LinkedIdentity · interface · name: string | null; +LinkedIdentity · interface · username: string | null; +LinkedIdentity · interface · phone?: string | null; +LinkedIdentity · interface · email?: string | null; +LinkedIdentity · interface · phones?: string[]; +LinkedIdentity · interface · emails?: string[]; +LinkedIdentity · interface · isBot: boolean | null; +LinkedIdentity · interface · accounts: Id[]; +LinkedIdentity · interface · seenIn: { +LinkedIdentity · interface · account: Id; +LinkedIdentity · interface · scope: StoredAccount["scope"]; +LinkedIdentity · interface · }[]; +LinkedIdentity · interface · method: string; +LinkedIdentity · interface · linkedBy: string; +LinkedIdentity · interface · linkedAt: string; +LinkedIdentity · interface · } +MatchScan · interface · export interface MatchScan { +MatchScan · interface · full: boolean; +MatchScan · interface · merged: { +MatchScan · interface · into: string; +MatchScan · interface · from: string; +MatchScan · interface · signal: "same-email" | "same-phone"; +MatchScan · interface · }[]; +MatchScan · interface · proposed: { +MatchScan · interface · id: string; +MatchScan · interface · persons: [string, string]; +MatchScan · interface · signal: IdentityLinkSignal; +MatchScan · interface · opened: boolean; +MatchScan · interface · }[]; +MatchScan · interface · skipped: { +MatchScan · interface · persons: string[]; +MatchScan · interface · signal: string; +MatchScan · interface · reason: string; +MatchScan · interface · }[]; +MatchScan · interface · } +MessageFilter · type · export type MessageFilter = AccountMessageFilter & { +MessageFilter · type · provider?: Provider; +MessageFilter · type · accounts?: Id[]; +MessageFilter · type · } & ({ +MessageFilter · type · account: AccountKey; +MessageFilter · type · } | { +MessageFilter · type · account?: undefined; +MessageFilter · type · chatId?: undefined; +MessageFilter · type · }); +MessageStore · interface · export interface MessageStore extends MessageStoreCore, MessageStoreAreas { +MessageStore · interface · } +MessageStoreCore · interface · export interface MessageStoreCore { +MessageStoreCore · interface · readonly accounts: AccountsStore; +MessageStoreCore · interface · readonly chats: ChatsStore; +MessageStoreCore · interface · readonly messages: MessagesStore; +MessageStoreCore · interface · readonly people: PeopleStore; +MessageStoreCore · interface · readonly tags: TagsStore; +MessageStoreCore · interface · close(): Promise; +MessageStoreCore · interface · } +MessagesStore · interface · export interface MessagesStore extends AccountMessages { +MessagesStore · interface · search(query: string, options: { +MessagesStore · interface · limit: number; +MessagesStore · interface · account?: AccountKey; +MessagesStore · interface · }): Promise>; +MessagesStore · interface · find(filter: MessageFilter): Promise>; +MessagesStore · interface · directReplies(parents: { +MessagesStore · interface · account: AccountKey; +MessagesStore · interface · chatId: Id; +MessagesStore · interface · id: Id; +MessagesStore · interface · }[], limit: number): Promise>; +MessagesStore · interface · laterSharingRare(wanted: { +MessagesStore · interface · account: AccountKey; +MessagesStore · interface · chatId: Id; +MessagesStore · interface · id: Id; +MessagesStore · interface · }[], options: { +MessagesStore · interface · rareAt: number; +MessagesStore · interface · limit: number; +MessagesStore · interface · }): Promise; +MessagesStore · interface · chatActivityCounts(chats: readonly { +MessagesStore · interface · account: AccountKey; +MessagesStore · interface · chatId: Id; +MessagesStore · interface · }[], window: { +MessagesStore · interface · since: number; +MessagesStore · interface · until: number; +MessagesStore · interface · now: number; +MessagesStore · interface · }): Promise<(ChatActivityCount | undefined)[]>; +MessagesStore · interface · } +PeopleStore · interface · export interface PeopleStore extends AccountPeople { +PeopleStore · interface · people(provider: Provider, options?: { +PeopleStore · interface · account?: Id; +PeopleStore · interface · accounts?: Id[]; +PeopleStore · interface · }): Promise; +PeopleStore · interface · personOf(identity: IdentityRef): Promise; +PeopleStore · interface · personSeenInAccounts(uid: string, accountIds: readonly number[]): Promise; +PeopleStore · interface · personByUid(uid: string): Promise; +PeopleStore · interface · owner(): Promise; +PeopleStore · interface · preparation(uid: string, options: { +PeopleStore · interface · accounts: readonly AccountKey[]; +PeopleStore · interface · scopes: readonly StoredAccount["scope"][]; +PeopleStore · interface · limit: number; +PeopleStore · interface · }): Promise; +PeopleStore · interface · linkIdentities(person: IdentityRef, other: IdentityRef, options: LinkOptions): Promise; +PeopleStore · interface · unlinkIdentity(identity: IdentityRef, options: UnlinkOptions): Promise; +PeopleStore · interface · rekeyIdentities(provider: Provider, pairs: readonly IdentityRekey[], options?: { +PeopleStore · interface · lockMs?: number; +PeopleStore · interface · by?: string; +PeopleStore · interface · }): Promise; +PeopleStore · interface · merges(uid: string): Promise; +PeopleStore · interface · undoMerge(to: string, from: string, by: string): Promise; +PeopleStore · interface · split(uid: string, identities: IdentityRef[], by: string): Promise; +PeopleStore · interface · proposeLink(input: IdentityLinkInput): Promise; +PeopleStore · interface · agentLink(input: AgentLinkInput): Promise; +PeopleStore · interface · linkEvidence(pairs: readonly (readonly [string, string])[]): Promise; +PeopleStore · interface · agentMerges(page: { +PeopleStore · interface · limit: number; +PeopleStore · interface · offset: number; +PeopleStore · interface · }): Promise<{ +PeopleStore · interface · items: (PersonMerge & { +PeopleStore · interface · agent: AgentMerge; +PeopleStore · interface · })[]; +PeopleStore · interface · hasMore: boolean; +PeopleStore · interface · }>; +PeopleStore · interface · decideLink(id: string, decision: IdentityLinkDecision): Promise; +PeopleStore · interface · scanMatches(options?: { +PeopleStore · interface · full?: boolean; +PeopleStore · interface · }): Promise; +PeopleStore · interface · linkProposals(filter: IdentityLinkFilter): Promise<{ +PeopleStore · interface · items: IdentityLinkRow[]; +PeopleStore · interface · hasMore: boolean; +PeopleStore · interface · }>; +PeopleStore · interface · proposeSplit(input: IdentitySplitInput): Promise; +PeopleStore · interface · decideSplit(id: string, decision: IdentitySplitDecision): Promise; +PeopleStore · interface · splitProposals(filter: IdentitySplitFilter): Promise<{ +PeopleStore · interface · items: IdentitySplitRow[]; +PeopleStore · interface · hasMore: boolean; +PeopleStore · interface · }>; +PeopleStore · interface · doubts(page: { +PeopleStore · interface · limit: number; +PeopleStore · interface · offset: number; +PeopleStore · interface · }): Promise; +PeopleStore · interface · keep(person: string, by: Decider): Promise; +PeopleStore · interface · markTestData(person: string, by: Decider): Promise; +PeopleStore · interface · erase(person: string, by: Decider, options: { +PeopleStore · interface · apply: boolean; +PeopleStore · interface · }): Promise; +PeopleStore · interface · linkToOwner(identity: IdentityRef): Promise; +PeopleStore · interface · add(input: { +PeopleStore · interface · name: string; +PeopleStore · interface · }): Promise; +PeopleStore · interface · list(options: PeopleListOptions): Promise; +PeopleStore · interface · counts(query?: string): Promise>; +PeopleStore · interface · similar(name: string, options?: { +PeopleStore · interface · limit?: number; +PeopleStore · interface · }): Promise; +PeopleStore · interface · ties(people: readonly string[]): Promise>; +PeopleStore · interface · } +PersonFacts · interface · export interface PersonFacts { +PersonFacts · interface · id: Id; +PersonFacts · interface · name: string | null; +PersonFacts · interface · username?: string | null; +PersonFacts · interface · isBot?: boolean | null; +PersonFacts · interface · description?: string | null; +PersonFacts · interface · email?: string | null; +PersonFacts · interface · phone?: string | null; +PersonFacts · interface · phones?: string[]; +PersonFacts · interface · emails?: string[]; +PersonFacts · interface · } +PersonRecord · interface · export interface PersonRecord { +PersonRecord · interface · uid: string; +PersonRecord · interface · name: string | null; +PersonRecord · interface · displayName?: string | null; +PersonRecord · interface · identities: LinkedIdentity[]; +PersonRecord · interface · mergedInto?: string; +PersonRecord · interface · } +Proposer · type · export type Proposer = { +Proposer · type · type: "person"; +Proposer · type · id: string; +Proposer · type · } | { +Proposer · type · type: "bot"; +Proposer · type · id: string; +Proposer · type · name: string; +Proposer · type · kind: "agent" | "rule"; +Proposer · type · verified?: false; +Proposer · type · } | { +Proposer · type · type: "unknown"; +Proposer · type · }; +Range · interface · export interface Range { +Range · interface · from: number; +Range · interface · to: number; +Range · interface · } +RecoveryStep · interface · export interface RecoveryStep { +RecoveryStep · interface · command: string; +RecoveryStep · interface · why: string; +RecoveryStep · interface · destructive: boolean; +RecoveryStep · interface · } +SqlValue · type · export type SqlValue = string | number | bigint | null | Uint8Array; +StoreOptions · interface · export interface StoreOptions { +StoreOptions · interface · readOnly?: boolean; +StoreOptions · interface · path?: string; +StoreOptions · interface · env?: NodeJS.ProcessEnv; +StoreOptions · interface · now?: () => number; +StoreOptions · interface · command?: string; +StoreOptions · interface · version?: string; +StoreOptions · interface · warn?: (line: string) => void; +StoreOptions · interface · decisions?: DecisionPolicy; +StoreOptions · interface · } +StoredAccount · interface · export interface StoredAccount { +StoredAccount · interface · id: number; +StoredAccount · interface · provider: Provider; +StoredAccount · interface · account: Id; +StoredAccount · interface · name: string | null; +StoredAccount · interface · scope: "personal" | "work"; +StoredAccount · interface · } +StoredChatFilter · interface · export interface StoredChatFilter { +StoredChatFilter · interface · where?: Where; +StoredChatFilter · interface · includeLeft?: boolean; +StoredChatFilter · interface · } +StoredHit · interface · export interface StoredHit extends MessageHit { +StoredHit · interface · locator: string; +StoredHit · interface · } +TagsStore · interface · export interface TagsStore { +TagsStore · interface · addTags(key: AccountKey, target: AnyTagTarget, tags: string[]): Promise; +TagsStore · interface · removeTags(key: AccountKey, target: AnyTagTarget, tags: string[], source?: "manual" | "auto"): Promise; +TagsStore · interface · tags(key: AccountKey, filter?: TagFilter): Promise; +TagsStore · interface · } +openCache · const · export declare const openCache: (path: string) => Promise; +openStore · const · export declare const openStore: (options?: StoreOptions) => Promise; +storePath · const · export declare const storePath: (env?: NodeJS.ProcessEnv) => string; diff --git a/api/testing.api.txt b/api/testing.api.txt new file mode 100644 index 000000000..77c801cda --- /dev/null +++ b/api/testing.api.txt @@ -0,0 +1,87 @@ +# @wirecat/cli-core "./testing": the stable API, written by cli-dev api-report. Do not edit. +ARGV_LOG · const · export declare const ARGV_LOG: string; +ContractCase · interface · export interface ContractCase { +ContractCase · interface · name: string; +ContractCase · interface · needs?: string; +ContractCase · interface · run(): Promise; +ContractCase · interface · } +ContractOptions · interface · export interface ContractOptions { +ContractOptions · interface · connect: (seed: Seed) => MessengerAdapter | Promise; +ContractOptions · interface · ids?: IdMaker; +ContractOptions · interface · orderBy?: "id" | "time"; +ContractOptions · interface · waitMs?: number; +ContractOptions · interface · history?: "server" | "store"; +ContractOptions · interface · } +IdKind · type · export type IdKind = "chat" | "message" | "person"; +IdMaker · type · export type IdMaker = (kind: IdKind, n: number, time: Date) => Id; +McpStdio · interface · export interface McpStdio { +McpStdio · interface · request: (method: string, params?: object) => Promise; +McpStdio · interface · call: (name: string, args?: Record) => Promise; +McpStdio · interface · tools: () => Promise; +McpStdio · interface · close: () => Promise; +McpStdio · interface · } +McpStdioStreams · interface · export interface McpStdioStreams { +McpStdioStreams · interface · stdin: PassThrough; +McpStdioStreams · interface · stdout: PassThrough; +McpStdioStreams · interface · } +McpToolResult · interface · export interface McpToolResult { +McpToolResult · interface · isError: boolean; +McpToolResult · interface · body: unknown; +McpToolResult · interface · } +RunScopeCase · interface · export interface RunScopeCase { +RunScopeCase · interface · name: string; +RunScopeCase · interface · run(): Promise; +RunScopeCase · interface · } +RunScopeOptions · interface · export interface RunScopeOptions { +RunScopeOptions · interface · definition: ProgramDefinition; +RunScopeOptions · interface · commands: Record; +RunScopeOptions · interface · skip?: Record; +RunScopeOptions · interface · answering: () => RunOptions; +RunScopeOptions · interface · silent: () => RunOptions; +RunScopeOptions · interface · timeoutMs?: number; +RunScopeOptions · interface · } +Seed · interface · export interface Seed { +Seed · interface · account: Account | null; +Seed · interface · people: Contact[]; +Seed · interface · chats: Chat[]; +Seed · interface · members: Record; +Seed · interface · messages: Message[]; +Seed · interface · busy: Id; +Seed · interface · dialog: Id; +Seed · interface · person: Id; +Seed · interface · twins: string; +Seed · interface · } +SyncAfterInstallCase · interface · export interface SyncAfterInstallCase { +SyncAfterInstallCase · interface · name: string; +SyncAfterInstallCase · interface · run(): Promise; +SyncAfterInstallCase · interface · } +SyncAfterInstallOptions · interface · export interface SyncAfterInstallOptions { +SyncAfterInstallOptions · interface · sync: readonly string[]; +SyncAfterInstallOptions · interface · run: (argv: string[], env: NodeJS.ProcessEnv) => Promise<{ +SyncAfterInstallOptions · interface · code: number; +SyncAfterInstallOptions · interface · err: string; +SyncAfterInstallOptions · interface · out?: string; +SyncAfterInstallOptions · interface · }>; +SyncAfterInstallOptions · interface · refusedUnderReadOnly?: readonly string[]; +SyncAfterInstallOptions · interface · profileLevels?: { +SyncAfterInstallOptions · interface · variable: string; +SyncAfterInstallOptions · interface · keys: readonly string[]; +SyncAfterInstallOptions · interface · }; +SyncAfterInstallOptions · interface · } +argvLogSetup · const · export declare const argvLogSetup: () => void; +contractCases · const · export declare const contractCases: ({ connect, ids, orderBy, waitMs, history, }: ContractOptions) => ContractCase[]; +contractSeed · const · export declare const contractSeed: ({ ids, loggedIn }?: { +contractSeed · const · ids?: IdMaker; +contractSeed · const · loggedIn?: boolean; +contractSeed · const · }) => Seed; +mcpOverStdio · const · export declare const mcpOverStdio: (start: (streams: McpStdioStreams) => Promise, { protocolVersion }?: { +mcpOverStdio · const · protocolVersion?: string; +mcpOverStdio · const · }) => Promise; +neverAnswers · const · export declare const neverAnswers: typeof fetch; +ownCatalogue · const · export declare const ownCatalogue: (program: Command, options?: CatalogueOptions) => Record; +runScopeCases · const · export declare const runScopeCases: (options: RunScopeOptions) => RunScopeCase[]; +seedSearchRecipes · const · export declare const seedSearchRecipes: (store: MessageStore, account: AccountKey) => Promise; +setupFileProblems · const · export declare const setupFileProblems: (setup: Setup, packageRoot: string | URL) => string[]; +syncAfterInstallCases · const · export declare const syncAfterInstallCases: (options: SyncAfterInstallOptions) => SyncAfterInstallCase[]; diff --git a/api/update.api.txt b/api/update.api.txt new file mode 100644 index 000000000..52ddfe501 --- /dev/null +++ b/api/update.api.txt @@ -0,0 +1,29 @@ +# @wirecat/cli-core "./update": the stable API, written by cli-dev api-report. Do not edit. +AppUpdateOptions · interface · export interface AppUpdateOptions { +AppUpdateOptions · interface · packageName: string; +AppUpdateOptions · interface · command: string; +AppUpdateOptions · interface · version: string; +AppUpdateOptions · interface · entry: string; +AppUpdateOptions · interface · statePath: (env: NodeJS.ProcessEnv) => string; +AppUpdateOptions · interface · enabled: (env: NodeJS.ProcessEnv) => boolean; +AppUpdateOptions · interface · offVariables: readonly string[]; +AppUpdateOptions · interface · quietWords?: readonly string[]; +AppUpdateOptions · interface · } +NoticeOptions · interface · export interface NoticeOptions { +NoticeOptions · interface · tty?: boolean; +NoticeOptions · interface · environment?: UpdateEnvironment; +NoticeOptions · interface · env?: NodeJS.ProcessEnv; +NoticeOptions · interface · } +UpdateEnvironment · interface · export interface UpdateEnvironment { +UpdateEnvironment · interface · fetch?: FetchLike; +UpdateEnvironment · interface · now?: () => number; +UpdateEnvironment · interface · stderrIsTTY?: boolean; +UpdateEnvironment · interface · scriptPath?: string; +UpdateEnvironment · interface · spawn?: (argv: string[]) => number; +UpdateEnvironment · interface · } +appUpdate · const · export declare const appUpdate: (app: AppUpdateOptions) => { +appUpdate · const · installer: ({ scriptPath }?: UpdateEnvironment) => Installer; +appUpdate · const · latest: (environment?: UpdateEnvironment) => Promise; +appUpdate · const · runUpdate: (argv: string[], environment?: UpdateEnvironment) => number; +appUpdate · const · updateNotice: (argv: readonly string[], { tty, environment, env }?: NoticeOptions) => Promise; +appUpdate · const · }; diff --git a/bin/release b/bin/release index f0c5095c1..677e8e035 100755 --- a/bin/release +++ b/bin/release @@ -7,6 +7,7 @@ # bin/release # publishes from GitHub Actions (.github/workflows/release.yml) # bin/release --local # publishes from this machine: NPM_TOKEN if exported, else the keyring # bin/release --app-ref # Parity builds each downstream CLI at , or its main when it lacks one +# bin/release --major # also allows a new major version; without it, a version that raises the major stops # # The npm token is never printed and never written to a file — not on success, not in an error. set -eu @@ -26,12 +27,14 @@ package=@wirecat/cli-core mode=ci app_ref=main -usage() { echo 'usage: bin/release [--local] [--app-ref ]' >&2; exit 2; } +major="" +usage() { echo 'usage: bin/release [--local] [--app-ref ] [--major]' >&2; exit 2; } # A function, so the arguments survive for the exec after the merge below. parse() { while [ $# -gt 0 ]; do case "$1" in --local) mode=local ;; + --major) major=1 ;; --app-ref) [ $# -gt 1 ] || usage; app_ref=$2; shift ;; *) usage ;; esac @@ -119,11 +122,15 @@ rerun_if_changed "$@" # Two sessions preparing the same number is normal; the second takes the next free one (2026-09-29). latest=$(npm view "$package" version --prefer-online 2>/dev/null || true) versions=$(npm view "$package" versions --json --prefer-online 2>/dev/null || true) -next=$(node scripts/next-version.mjs "$version" "$latest" "$versions") +# With the root, the number also rises to the level the changelog and the changes/ fragments need. +next=$(node scripts/next-version.mjs "$version" "$latest" "$versions" .) fragments=$(find changes -maxdepth 1 -type f -name '*.md' ! -name README.md 2>/dev/null | wc -l) if [ "$next" != "$version" ]; then taken="" - if published; then taken=1; why="$version is already on npm"; else why="$version is not above npm's latest $latest"; fi + if published; then taken=1; why="$version is already on npm" + elif [ "$(node scripts/next-version.mjs "$version" "$latest" "$versions")" = "$version" ]; then + why="the changelog's headings need $next, not $version" + else why="$version is not above npm's latest $latest"; fi echo "$why — publishing $next instead" # A version npm already has keeps its changelog section; the unreleased one becomes the new version. # Renaming it instead moved 0.51.0's section under 0.52.0 (beb54e9, repaired in #155). @@ -153,6 +160,11 @@ if published; then echo "$version is already on npm — raise the version first" >&2 exit 1 fi +# A major breaks every caller of the stable API, so it ships only when the owner chose to (WC-REL-7). +if [ -n "$latest" ] && [ "${version%%.*}" != "${latest%%.*}" ] && [ -z "$major" ]; then + echo "$version raises the major version over npm's $latest — run bin/release --major if that is meant" >&2 + exit 1 +fi if [ "$mode" = ci ]; then last_run() { @@ -204,7 +216,9 @@ trap 'rm -f "$config"' EXIT printf '//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n' > "$config" echo "== publishing $version ==" -npm publish --access public --userconfig "$config" +# npm 11 refuses a pre-release without a tag, and one must never become `latest`. +case "$version" in *-*) tag=next ;; *) tag=latest ;; esac +npm publish --access public --userconfig "$config" --tag "$tag" echo "== waiting for npm to show $version (up to three minutes) ==" seen="" diff --git a/biome.json b/biome.json index 2c6745cc4..f36abb0ee 100644 --- a/biome.json +++ b/biome.json @@ -565,8 +565,8 @@ }, "patterns": [ { - "group": ["../../**", "!../../services/moment.js"], - "message": "src/meetings/ depends on nothing else in cli-core but the time grammar every past-time flag shares (src/services/moment.ts): the rest of the package calls it, never the other way round" + "group": ["../../**", "!../../services/moment.js", "!../../cli/commander-internals.js"], + "message": "src/meetings/ depends on nothing else in cli-core but the time grammar every past-time flag shares (src/services/moment.ts) and the one reader of commander's private fields (src/cli/commander-internals.ts): the rest of the package calls it, never the other way round" }, { "group": ["better-sqlite3", "drizzle-orm", "drizzle-orm/*"], @@ -787,7 +787,7 @@ "noExcessiveLinesPerFile": { "level": "error", "options": { - "maxLines": 1010 + "maxLines": 1012 } } } @@ -817,7 +817,7 @@ "noExcessiveLinesPerFile": { "level": "error", "options": { - "maxLines": 3112 + "maxLines": 3255 } } } diff --git a/changes/1.0-fixes.md b/changes/1.0-fixes.md new file mode 100644 index 000000000..9821aa897 --- /dev/null +++ b/changes/1.0-fixes.md @@ -0,0 +1,41 @@ +### Changed — may break callers + +- **`sync --rescan` no longer lets a sync mark most of a kind deleted.** In the CRM, tracker and content syncs, + `--rescan` only lists everything again; the mass-deletion guard stays on. The one way past it is + `--allow-deletions ` (`allowDeletions` in `syncCrm`, `syncTracker`, `syncContent` and `syncCalendars`): a + held pass goes through when it would mark at most that many deleted, and its message names the number. The flag + is owner-only, so an MCP server does not offer it. `crmSyncContract` and `contentSyncContract` check both: a rescan + stays held, `allowDeletions` lets it through. +- **`EventStore.markUnseen` takes an optional fifth argument**, `{ keep, dryRun }`: entries the source still has but + could not read are not marked, and a dry run marks nothing and answers how many it would. A store that implements + the port itself keeps working without it, but keeps marking such entries deleted. +- **An MCP call that names a refused place now answers `permission_error` (`access.denied`)**, with the option or + argument in `param`, before the command runs. `attachments extract --output-dir` and `--from-dir` answered + `validation_error` before. + +### Fixed + +- **A mail sync no longer marks mail deleted that the server's search found and its listing left out.** A run of a + folder whose listing returned fewer messages than its search skips the deletion check, and says why in + `deletionsSkipped`, budgeted or not. +- **A CRM id pass is held when the adapter said it could not read the whole kind**, as the tracker's already was. + The hold also covers a pass that spans several runs, and no flag lifts it. The tracker's id pass now keeps that + mark across runs too. +- **A calendar round no longer stalls on a series deleted between its listing and its slots call.** The series' + stored slots stay as they are, the round ends, and the next listing settles the series. +- **An ICS feed event that stops parsing is no longer marked deleted.** The feed still holds it, so its stored copy + stays as it was. The ICS source names such events in the new `ChangePage.kept`. +- **A full calendar round is held when it would mark most of a calendar deleted**: an empty list, or more than half + of ten or more stored entries. The round still ends; `held` says why and names `sync --allow-deletions`. +- **Serve no longer makes a remote path, a chat folder's title or a command path absolute** against the client's + folder. Only local paths are, as one declaration says (`notLocalPaths`). + +### Security + +- **One check for every file or folder an MCP call names.** Before any MCP call runs, each option and argument that + takes a local path is checked by its real path, so neither a link nor `..` gets past. A call cannot name a + credential folder, a folder of this or another WireCat tool, or the message store. `store backup` and + `store restore` may still name the store's own backups folder. A new option whose placeholder names a file or + folder is checked without more code; `notLocalPaths` marks one that names no local file, and a test fails on an + input named like a path that is neither. A CLI marks its own remote paths with `notLocalPaths` from + `@wirecat/cli-core/cli` (experimental). A shell run is unchanged, and the checks the commands already make stay. diff --git a/changes/1.0-reasons-ci.md b/changes/1.0-reasons-ci.md new file mode 100644 index 000000000..50f47ba5a --- /dev/null +++ b/changes/1.0-reasons-ci.md @@ -0,0 +1,20 @@ +### Added + +- **Every error reason is listed, and its list is a contract.** [Error reasons](../docs/reasons.md) names all 613 + reasons cli-core raises (`CORE_REASONS`) with their code, meaning and detail keys, generated from the source. New + reasons and reworded messages may come in any release. Removing or renaming a reason, or moving it to another code, + is a break: it is listed under "Changed — may break callers" or "Removed", and from 1.0.0 on it needs a major. + `pnpm docs:check` fails when the page and the source disagree, or when a listed reason goes without a changelog + entry that names it. +- **The changelog takes two more headings: "Changed — experimental" and "Deprecated".** They are for a change to the + experimental part of the API and for something marked to be removed later; both need a minor release. From 1.0.0 + on, "Changed — may break callers" and "Removed" are breaks of the stable API and need a major. `bin/release` picks + the version those headings need, stops before a new major unless run with `--major`, and publishes a pre-release + such as `1.0.0-rc.1` under npm's `next` tag, never as `latest`. + +### Fixed + +- **Parity builds every CLI that uses cli-core, not 9 of them.** A release now builds and tests all 19, adding + amo-cli, asterisk-cli, attio-cli, beeline-cli, hubspot-cli, linear-cli, notion-cli, slack-cli, wordpress-cli and + ydisk-cli. A pull request and a push to `main` build 7 of them (tg, max, wa, memo, mail, drive and attio) to save + the Actions minutes all WireCat repositories share; the monthly run and a run by hand build all. diff --git a/changes/1.0-store-v73.md b/changes/1.0-store-v73.md new file mode 100644 index 000000000..abd1efead --- /dev/null +++ b/changes/1.0-store-v73.md @@ -0,0 +1,27 @@ +### Changed — may break callers + +- **Store version 73: an id is never handed out twice, and only cli-core 1.0 tools open the store after it.** Every + base table with an integer `id` (101 tables) is copied once to become `AUTOINCREMENT`. Each counter starts 1,000 + above the largest id the store still knows, from the table's own rows, foreign keys, `_type`/`_id` + pointers and the kept highest ids of memories and facts. So after `people delete`, `organizations delete` or + `records clear`, an old reference such as `organization:2766` no longer names a new row. `minCompatible` becomes 73: + a 0.x tool refuses the file. Upgrade every installed CLI to cli-core 1.0 first, and migrate with `serve`, `mcp` and + syncs stopped, since the copy holds the write lock. Tables that other tools add to the file are left as they are. +- **The migration refuses to run without a rollback copy.** If the copy of the store cannot be written, for example + because the disk is full, the store stays at its version and nothing changes. `store migrate --no-backup` + migrates anyway, with no way back to the older tools. +- **The store checks rules that never change, with `CHECK` constraints:** a JSON column holds valid JSON, a pointer + pair (`*_type`, `*_id`) is whole or empty, and an amount is not negative. On upgrade, text that is not JSON is kept + whole as a JSON string, and the rows are named in a warning and in `store_settings` (`migration:73:repaired`). A + half-set pointer or a negative amount stops the migration, naming the rows, and changes nothing. +- **A reference that already pointed at a deleted row no longer stops the migration.** Such rows are kept as they + were, named in a warning by table, column and ids, and listed in `store_settings` (`migration:73:broken-references`). + Only a reference the copy itself would break stops it, naming the rows. So does a copy that would change how many + rows a table holds, naming the table and both counts. A refused or failed migration deletes the rollback copy it + wrote, so a retry does not add another; older copies stay. + A new store creates its empty tables directly instead of copying them, so its first open takes about as long as + before version 73. +- **Deleting a message, chat, note, document, memory or email no longer scans every tagging:** `taggings` has an index + on `(taggable_type, taggable_id)`. +- **Linking replies to their thread no longer scans the chat:** `messages` has an index on + `(chat_id, thread_external_id)` for the messages not yet linked to a thread root. diff --git a/changes/1.0-surface.md b/changes/1.0-surface.md new file mode 100644 index 000000000..d669593fb --- /dev/null +++ b/changes/1.0-surface.md @@ -0,0 +1,42 @@ +### Added + +- **A stable API under semver.** `package.json` lists the stable entry points in `wirecat.stable`: `.`, `./cli`, + `./cli/start`, `./mcp`, `./sends`, `./skill-validation`, `./sqlite-runtime`, `./store`, `./testing` and `./update`. + Inside them, a name whose doc comment says `@experimental` is outside the promise, and so is every other entry point. + From 1.0.0 a break of the stable API needs a major; a change to experimental names needs only a minor. The stable + names are the ones two or more CLIs import (or the CLI template), and the types those names reach. `MessageStore` + is now `MessageStoreCore` (stable: `accounts`, `chats`, `messages`, `people`, `tags`, `close`) plus + `MessageStoreAreas` (experimental: every other area, like the family entry points `./meetings`, `./mail`, `./crm` + and the rest they belong to). Code that names `MessageStore` needs no change. + +- **A CLI's own declarations compile when they infer a type cli-core returns.** Every module's types can be named + at `@wirecat/cli-core/internal/`, types only: TypeScript writes that path into a declaration it infers, so a + CLI that keeps a returned value without a type annotation no longer fails with TS2883. Nothing can be imported + from it at run time, and it is experimental, outside `wirecat.stable`. + +### Changed — may break callers + +- **The peer ranges are bounded for 1.0.** `@wirecat/cli-base` is `^1.0.0-0`: cli-core's types name the codegen + types from `@wirecat/cli-base/codegen/runtime`, cli-base 1.0's stable part, which older cli-base lacks. `commander` is `^15.0.0` (it was `>=15`): the command skeleton reads + a few commander fields that have no public accessor, now all in one internal module with a test, and a new + commander major is accepted only after that test passes on it. + +- **`@wirecat/cli-core/store` no longer re-exports the SQLite implementation.** About 390 names declared under + `src/store/sqlite/` (maintenance helpers such as `resetAttachmentWords` and `backfillNormalized`, row types, + query constants and the area interfaces) left the entry. `openStore`, `StoreOptions`, `MessageStore`, `storePath` + and the other names declared outside `src/store/sqlite/` stay. The 80 of them that CLIs import moved to the new + experimental entry `@wirecat/cli-core/store/areas` under the same names: change the import path. The rest have no + importer; their types are still reachable as members of `MessageStore`, for example `MessageStore["mail"]`. + +- **`./cli` no longer re-exports five cli-base names** that are cli-base's own: `assertSharedContracts`, + `customizeSharedCommand`, `SharedContractOverride`, `sharedContractOverrides` and `sharedContracts`. Import them + from `@wirecat/cli-base/commands`. + +### Removed + +- **`searchAllIncludingMeetings` and its types** (`ResourceWithMeetings`, `MeetingSearchCursor`, + `SearchAllIncludingMeetingsRequest`, `MeetingSearchCoverage`, `SearchAllIncludingMeetingsFound`) from + `@wirecat/cli-core/services`. Call `searchAll` with `scope.meetings` and read `SearchAllFound`. +- **`SyncOptions.limitError`** (document sync), which nothing called: a walk past `maxEntries` already goes on in the next sync. +- **`MeetingTranscriptDocumentStore.transcriptMeetings`**. `documentMeetings` gives each document's meeting with its + role; keep the entries whose role is `transcript`. diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index feffb2541..d9cfe9afd 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -804,20 +804,20 @@ fragments in `changes/` until then; there is no gap to keep between releases and jobs build tg-cli, max-cli and whatsapp-cli from their `main` against every pull request; a change that fails there, or passes only against a CLI branch made for it, needs those CLI branches ready before it is released. -**Before 1.0, any release may break a caller.** A change that does is listed in the changelog under -"Changed — may break callers", with what to change in a consumer. - -The exports below are the ones consumers lean on most. A change to them is made with the most care and -always says what to change. - -| Export | Stable | -|---|---| -| `.` | the domain types (`Chat`, `Message`, `Contact`, `Page`, …), the message locator | -| `./cli` | `Messenger`, `MessengerAdapter` and its method groups (`MessengerCore` required; `ServerReads` and the rest optional), `createProgram`, `run`, `messengerContext`, the command factories' names and arguments | -| `./store` | `openStore`, `MessageStore`, `storePath`, and the file format: `minCompatible` rises only in a release that lists it under "Changed — may break callers" | -| `./sends` | `sendGuard`, `SendJournal`, the journal's line format | -| `./speech` | The pinned speech-model catalogue, shared directories, verified installer and installed-only bounded PCM recognizer. Importing it does not load a recognizer or download a model | -| `./services` | `servicesFor`, `Override` and the service names | -| `./background` | `lockPath`, `readLock`, `holdLock`, `releaseLock`, `servingProfiles`, `alive`, `carries`, `holdersOf`, `ServerSystem`, `thisMachine`, `platformFor` and the systemd and launchd units · the serve relay: `listenRelay(path, run)`, `relayCommand(path, request, options)`, `relayPath(lockPath)`, `RELAY_PROTOCOL` | - -`./testing` and `./parity` are not on this list. tg-cli and max-cli take new versions through Dependabot pull requests. +**From 1.0.0, only the stable API follows semver.** `wirecat.stable` in `package.json` lists the stable entry +points: `.`, `./cli`, `./cli/start`, `./mcp`, `./sends`, `./skill-validation`, `./sqlite-runtime`, `./store`, +`./testing` and `./update`. Inside them, a name whose doc comment carries `@experimental` is outside the promise, and +every entry point not on the list is experimental as a whole (`./meetings`, `./mail`, `./crm`, `./store/areas`, …). + +- A break of a stable name raises the major, and comes first as a deprecation in a minor. It is listed under + "Changed — may break callers" or "Removed". +- A change to an experimental name raises the minor. Pin an exact version if you use one. +- `MessageStore` is `MessageStoreCore & MessageStoreAreas`. `MessageStoreCore` is stable: `accounts`, `chats`, + `messages`, `people`, `tags` and `close`. `MessageStoreAreas`, every other area, is experimental, as are the family + entry points it serves. +- The store file format is stable too: `minCompatible` rises only in a major. +- The error reasons are stable too. [Error reasons](reasons.md) lists every one with its code; removing, renaming + or recoding one is a break. + +The stable names are the ones that two or more WireCat CLIs import, or the CLI template, plus every type those +names reach. tg-cli and max-cli take new versions through Dependabot pull requests. diff --git a/docs/dev/ARCHITECTURE.md b/docs/dev/ARCHITECTURE.md index c887720c4..e218d3a8e 100644 --- a/docs/dev/ARCHITECTURE.md +++ b/docs/dev/ARCHITECTURE.md @@ -740,6 +740,12 @@ it by editing that line in a PR of its own, merged before the migration. full-text triggers. Choose a change drizzle-kit can express as `ALTER TABLE … ADD` — a new column is nullable or has a default — or a new table. The test "never rebuild a base table" (`src/store/sqlite/manifest.test.ts:14-19`, `:46`) refuses the rest. + A breaking version (its `minCompatible` is its own number, as 73 is) may keep drizzle-kit's copies: the runner + turns foreign keys off before `BEGIN`, refuses a table with a column the copy would lose, puts back every trigger + and index of the copied tables and checks their foreign keys before `COMMIT` (`src/store/sqlite/rebuild.ts`). + Since version 73 most base tables carry table-level `CHECK`s (`scripts/schema/checks.mjs`, frozen). SQLite cannot add + one in place, so a column added later gets a `RAISE(ABORT)` trigger instead, and a column a `CHECK` names can only + be dropped by such a copy. 4. **Triggers, FTS5 tables and data fills go in a custom migration**, since `schema.ts` holds neither triggers nor FTS: `pnpm db:generate --custom --name version--`, then write the SQL into the empty file. Put `--> statement-breakpoint` between statements — the bundle splits on nothing @@ -832,7 +838,11 @@ The MCP server (`src/mcp/server.ts`) holds one connection for minutes and runs o the CLI's commands (`toolsFromCommands`, `src/mcp/agent.ts`), each run in-process through the CLI's own `run` (`runCommandForAgent`) on that connection, so a tool answers and refuses exactly as the command does. What only an agent needs comes from the command's metadata: `mcp: false` and `ownerOnlyOption` keep a command or an option off -MCP, `grantsAuthority` offers a command only where the profile allows `mcp.authority`, `bot api` only where it allows `bot.api`, `readsStdin` turns what a command reads on stdin into an input field. The tools that answer with an image +MCP, `grantsAuthority` offers a command only where the profile allows `mcp.authority`, `bot api` only where it allows `bot.api`, `readsStdin` turns what a command reads on stdin into an input field. Before any call runs, `refuseAgentPaths` +(`src/cli/path-options.ts`, from `run()`'s `preAction`) checks every local path it names by its real path: no credential +folder, no WireCat tool's folder, not the store. An option whose placeholder names a file or folder, and an argument so +named, is a local path unless `notLocalPaths` says it names a remote file, a title or a command path; a test fails on +an input named like a path that is neither. The tools that answer with an image (`messages photo`, `attachments show`, `stats charts`) stay definitions of their own (`src/mcp/tools.ts`). `mcp --http` (`src/mcp/http/`, CLI-58) serves the same factory over Streamable HTTP on 127.0.0.1 behind the diff --git a/docs/dev/BACKLOG.md b/docs/dev/BACKLOG.md index 9ab03e2a2..f795202aa 100644 --- a/docs/dev/BACKLOG.md +++ b/docs/dev/BACKLOG.md @@ -51,8 +51,6 @@ None open. - **CORE-59** · P2 · A meeting's `attached` link keeps pointing at a deleted document when Drive later stores the same file as a new document: only a link with no document is resolved again (`linkAttached`), so `meetings show` says `null`. Re-resolve links whose document is deleted. `src/store/sqlite/files.ts` (`linkAttached`). -- **CORE-60** · P3 · `MeetingTranscriptDocumentStore.transcriptMeetings` has no caller but tests since `search all` - reads `documentMeetings`. Drop it at the next breaking release. `src/meetings/transcript-store.ts`. - **CORE-61** · P2 · A shared Google sign-in module in `./google` (`accountEmail`, `session start`/`status`/`end`): gcal, drive and meet each copy ~450 lines of it. `src/google/`. - **CORE-52** · P2 · Tasks from an external task tool, Todoist first (owner, 2026-11-09: soon, not now). Import diff --git a/docs/dev/CONVENTIONS.md b/docs/dev/CONVENTIONS.md index 2367b80d2..e1cd5e35b 100644 --- a/docs/dev/CONVENTIONS.md +++ b/docs/dev/CONVENTIONS.md @@ -28,7 +28,9 @@ What differs here: vendor clients and vendor adapters stay outside Core, and `biome.json` refuses their imports. Persistence and CLI/MCP adapters implement shared contracts inside Core. - **The changelog** has these headings, each at most once per version: `Added`, - `Changed — may break callers`, `Fixed`, `Security`, `Removed`. A pull request adds its entries as a fragment, + `Changed — may break callers`, `Changed — experimental`, `Deprecated`, `Fixed`, `Security`, `Removed`. From 1.0.0 + on, `Changed — may break callers` and `Removed` are breaks of the stable API and need a major; the other three need + a minor. A pull request adds its entries as a fragment, `changes/.md`, under those headings; the release pull request collects every fragment into `## — DD.MM.YYYY` and deletes them. Only `bin/release` edits `CHANGELOG.md`; the `standards` check fails any other pull request that changes it. No backlog or decision ids. diff --git a/docs/dev/COORDINATION.md b/docs/dev/COORDINATION.md index abd8f667d..8a2e625c8 100644 --- a/docs/dev/COORDINATION.md +++ b/docs/dev/COORDINATION.md @@ -4,7 +4,7 @@ Several sessions work on cli-core, tg-cli and max-cli at once. This page is what ## Store migrations -**The next free migration version is 73.** Version 72 is taken by document history (`document_revisions.title`, `front_matter` and `reason`, so a version keeps what the document was and why it was replaced: edited, deleted, unavailable or unsynced. `documents.removal`, why a removed document left the copy, its text kept when unavailable. `document_changes`, the change log of synced documents with no foreign key, and the trigger `document_changes_account_bd` that drops an account's rows with it. Columns, a table, an index and a trigger added only, forward-only, `minCompatible` stays 56. IDEA-2862 in cli-private's Notion roadmap, owner's answers NEED-2802, NEED-2803 A and NEED-2805, 2026-11-23. Reserved in the same pull request, as version 67 was, announced on issue #3157). Version 71 is reserved for the content category (`content_channels`, `content_authors`, `content_terms`, `content_posts` with the body as Markdown and its hash and its terms, authors and media as JSON (no `content_post_terms`: a post is found by a term through its JSON and its taggings), `content_post_revisions` (the title, body and status a sync or a write replaced, and a post the source deleted, kept before the change), `content_metrics` (snapshots in time, never overwritten) and the contentless word index `content_post_words` kept by triggers; a post becomes a taggable type `post`, with a trigger that drops its taggings when the post row goes; blog posts and pages of a site such as WordPress, later social posts; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; content category plan C5 in cli-private, owner's ruling NEED-2722 A, 2026-11-18). Version 70 is reserved for the tracker category (`tracker_items`: one row per team, user, workflow state, label, project, issue or comment of an issue tracker account such as Linear, with its source id, parent, title, text, source times, archive and deletion marks and the rest as JSON; `tracker_item_words`, a contentless word index over titles and text kept by triggers; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-2717 A, source-manifest plan L3 in cli-private, 2026-11-17). Version 69 is reserved for stored conversation readiness (`conversation_readiness`: per built chat and embedding model, the counts `search conversations` reports — messages new, edited or deleted since the build, chunks with current, stale and missing vectors — saved when first counted and dropped by triggers when the chat's messages, revisions, build or that model's vectors change, so a search reads them instead of recounting every chat; table and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-63 A, 2026-11-17). Version 68 is taken by CRM client files (`crm_files`: one row per downloaded file of a deal, lead, contact or company, with its owner record, source kind, name, size, type, local path and extracted text in its own word index, never a download link; CRM files plan in cli-private, 2026-11-16). Version 67 is taken by the facts removal log and phone-call fields on meetings (`fact_removals`: one row per removed fact with its id, the reference of what it was about, who removed it, when and why, never its text or value; `meetings.direction` and `client_phone`, set by a phone-line source; table, columns and indexes added only, forward-only, `minCompatible` stays 56; owner's rulings NEED-2614 B and the call-fields decision A, 2026-11-13; reserved in the same pull request under the one-PR rule for that round, announced on issue #849). Version 66 is reserved for the person-kind trigger on account names (`person_kind_identity_au` recreated to watch `identities.name` too, so a person with no name of their own has their kind and name order worked out again when an account's name changes; triggers only, forward-only, `minCompatible` stays 56; RISK-2268, 2026-11-11). Version 65 is taken by titles of found tasks (the migration sets a `store_settings` key only in a store holding a task still titled ` — `, and the next writable open gives each such task the first line of its source message, as `tasks list` already shows it, in batches, then deletes the key; tasks whose message is missing, deleted or empty keep their title; no schema change, forward-only, `minCompatible` stays 56; owner's ruling NEED-2517 B, 2026-11-10). Version 64 is taken by faster person-kind triggers on deal links (`person_kind_deal_link_ai`, `_ad` and `_au` recreated so their lookup of a deal's other links uses the `(from_type, from_id)` index, and `person_kind_deal_owner_moved_au` and `_owner_person_au` so they find the owner's links by person; version 63's read every person link per row, about 24 ms each on 118k links; triggers only, forward-only, `minCompatible` stays 56; removing CRM contacts outside the scope, owner's ruling 2026-11-10). Version 63 is reserved for people's ties from messages and CRM deals (triggers that clear a stored person kind when a deal or lead names the person or changes its owner, and when a chat whose message senders count as ties changes kind or crosses the small-group size; triggers only, forward-only, `minCompatible` stays 56; BUG-676 and the owner's ruling NEED-2500 A, 2026-11-10). Version 62 is reserved for stored person kinds (columns on `persons` for each person's kind, name order, message count, task count and newest contact, filled lazily and cleared by triggers when anything that decides them changes, so `people list` filters, sorts, pages and counts in SQL; columns, a partial index and triggers added only, forward-only, `minCompatible` stays 56; Desktop page speed plan item 1, 2026-11-10). Version 61 is reserved for people's ties to the owner (a phone-book marker written by `contacts sync`, indexes the tie checks need, and a stored ties table only if the benchmark in cli-testing `performance/people/ties` says reading them is too slow; columns and indexes added only, forward-only, `minCompatible` stays 56; people-clients-digests plan CC-2, 2026-11-09). Version 60 is reserved for WireCat base stages (`pipeline_stages.base_stage_id`, the stage of the owner's base set of its kind another pipeline's stage maps to, and `base_confirmed`, whether the owner confirmed that mapping or it is still a suggestion; columns added only, no table rebuild; forward-only, `minCompatible` stays 56; TASK-947, #2720, 2026-11-08). Version 59 is reserved for owner-edited message templates (`templates`: one row per key, such as `report/morning-digest`, channel, `telegram`, `email` or `text`, and language, the body the owner saved over the shipped default, when and by whom; `templates_history`, every body a save or a reset replaced, so an edit can be undone; forward-only, `minCompatible` stays 56; digest format plan §9 in max-cli, PR 5b, 2026-11-08). Version 58 is reserved for write-time enrichment (`enrichments`: per note, document or email, the standalone facts and reworded questions a hosted model wrote about it, with the hash of the text it read, the provider, the model and the tokens; triggers drop a record's row when the record is deleted; off by default, turned on by the owner with a consent; forward-only, `minCompatible` stays 56; feat/enrichment-setting, 2026-11-08). Version 57 is reserved for business entities (`catalog_items`, `order_lines`, `contracts`, `subscriptions` and `subscription_prices`, `financial_accounts`, `financial_transactions`, `transaction_splits`; `payments.refund_of` with net paid; contract, subscription, product and deal columns on invoices, payments, orders and their lines; `record_relations.as_role`, `records.created_entity`; forward-only, `minCompatible` as version 56 leaves it; business entities plan, `docs/dev/business-entities-plan.md`, #2649). Version 56 is reserved for business relationship links (`links.account_id`, the source account that reported a relationship; `links.starts_at` and `ends_at`, when it held, never guessed; `links.deleted_at`, the source stopped reporting it; `link_revisions`, one row per change of a relationship link written by triggers; a unique key on relationship links with the role and the account in it, after folding duplicates; CRM links stored so far become unconfirmed and name their account; forward-only; it raises `minCompatible` to 56, since an older build writing CRM links would bring back confirmed rows with no account (NEED-2406 A, pending); CRM relationships plan in cli-private `plans/2026-11-07-crm-relations/`, owner's ruling NEED-2372 A, 2026-11-07). Version 55 is taken by `decision_requests` (the one-time keys behind the buttons of a message that asks the owner to decide a batch from Telegram: only a token's digest is kept, using one cancels its siblings; forward-only, `minCompatible` stays 34; mail review from Telegram, plan §12 step 3 in max-cli, 2026-11-07). Version 54 is taken by CRM field definitions (`crm_fields`: a CRM account's own fields per kind, `deal`, `lead`, `person` or `organization`, with their code, label, type, whether they hold several values, whether a list can filter by them and a list field's options, written by the CRM sync and read by `fields list` and the desktop; values stay in each row's `metadata` keyed by code; forward-only, `minCompatible` stays 34; b24 plan §4.4, 2026-11-06). Version 53 is taken by CRM pipelines keyed by kind (the unique index on `pipelines` becomes `(account_id, kind, external_id)`, so a deal pipeline and a lead pipeline of one CRM account may share an id, and `pipelines.deleted_at` and `pipeline_stages.deleted_at` mark what the CRM deleted, kept because deals may still stand in it; forward-only, `minCompatible` stays 34; CRM write port, 2026-11-06). Version 52 is taken by deals and leads, amended in place on 2026-11-06 since no published CLI used 0.585.0, 0.586.0 or 0.587.0 (`pipelines` with a ref, a kind and an optional CRM account, `pipeline_stages` with an outcome, `deals`, `leads`, `pipeline_stage_changes` written by triggers, and a seeded `Leads` pipeline; agents write directly, no review; slice B2 of the business data plan). It keeps `minCompatible` at 34. Version 51 is taken by task links (`tasks.provider` and `tasks.external_id`, the task's id in an outside service such as an Avito conversation or listing, kept apart per service and given as `:`; `tasks.source_url` and `orders.source_url`, the http or https page the task or order is about, such as an Avito ad or an Amazon order; owner's ruling NEED-2245 A, 2026-11-05). It keeps `minCompatible` at 34. Version 50 is taken by orders (`orders`: what the owner or a client bought or sold, for whom (`customer_*`, a `person:` or `organization:`) and whether it is `personal`, `business`, `client` or `other`, the shop as the mail names it plus an optional `supplier_*` reference, the shop's order number, amount and currency in minor units, status `placed` | `shipped` | `delivered` | `cancelled` | `returned`, optional links to an invoice and a payment, and the audit and `review` columns invoices have; the mail-triage agent proposes them as `order` and `order_update` mail findings; BUG-531, owner's ruling NEED-2241 A, 2026-11-05). It keeps `minCompatible` at 34. Version 49 is taken by amounts on record relations (`record_relations.amount`, the share of a payment a `settles` relation of the records envelope names, as a decimal in the payment's currency, so an import allocates a payment split across invoices as its source says; WireCat records import, 2026-11-05). It keeps `minCompatible` at 34. Version 48 is taken by removing leaked test accounts (every account of provider `chat`, the fake messenger of `src/testing/shared-program.ts`, that tests wrote into the owner's real store before #2438; the migration sets a flag only in a store that holds one, and the next writable open purges each such account through `purgeAccount`; owner's choice NEED-250 A in the desktop journal, 2026-11-02). It keeps `minCompatible` at 34. Version 47 is taken by source records (`records`, `record_relations`: what each import said, unique per account, type and external id, with a fingerprint and the source's revision, mapped to at most one entity and never by name; relations to a record not yet imported wait for it; TASK-886 slice B1b, 2026-11-02). It keeps `minCompatible` at 34. Version 46 is taken by retiring payment facts (triggers `facts_no_payment_bi` and `facts_no_payment_bu` refuse a `payment` fact, and the next writable open moves stored payment facts into `payments` and `invoices` rows: a paid one a payment, an expected one an invoice, accepted ones confirmed and proposed ones proposed; owner's ruling NEED-2167 A, TASK-886 slice B0, 2026-11-02). It keeps `minCompatible` at 34. Version 45 is taken by finance tables (`invoices`, `invoice_lines`, `payments`, `payment_allocations`: money as integer minor units per ISO 4217 currency, invoice status derived from confirmed allocations, an agent's or an import's entry a proposal only the owner decides; triggers keep allocations within the payment, within the invoice and in one currency; TASK-886 slice B1a, 2026-11-02). It keeps `minCompatible` at 34. Version 44 is taken by proposals in one place (`relationships.purpose`, a chat's purpose in a project from the purposes memo's config lists, no fixed set in the store, null meaning `work`, beside the free-text `role`; unconfirmed links an agent or a rule proposed move from `links` into `proposed_actions` as `relationship` and `key_document` proposals with their bot, reason and time, while Drive editor links stay; TASK-834.d slice D2, 2026-11-02). It keeps `minCompatible` at 34. Version 43 is reserved for `memories.project_id` (a memory may name the project it belongs to, as a fact does, so the WireCat Desktop Memory page can group and filter memories by project; owner's choice NEED-198 A in the desktop journal, 2026-11-01). It keeps `minCompatible` at 34. Version 42 is reserved for narrowing the task revision (`tasks.revision` goes up only for a change a person could conflict with: title, description, status, priority, agent, due date, project and parent, and by triggers on `task_assignments` and task `taggings`; never for a claim, a follow-up time or a close suggestion; WireCat Desktop Tasks page, RISK-77, 2026-11-01). It keeps `minCompatible` at 34. Version 41 is taken by project task fields (`tasks.priority_score`, a decimal priority in [0, 1] that also orders a board column, kept in step with the old 0–4 `priority` by triggers; `tasks.agent`; `tasks.revision`, for a stale-write check; WireCat Desktop Tasks page, owner's choices NEED-176, NEED-178, NEED-180, 2026-11-01). It keeps `minCompatible` at 34. Version 40 is reserved for the trigram indexes of notes and documents (`note_trigrams`, `document_trigrams`: contentless FTS5 trigram tables over the normalized title and text, so notes, documents, knowledge annotations and contacts `--notes` are found by any part of a word in any letter case; owner's ruling A2, 2026-10-30). Version 39 is taken by `email_locations` (each stored email's place in an IMAP folder: folder, UIDVALIDITY and UID, so a quick mail sync proves deletions and refreshes flags for mail it does not read again; owner's choice NEED-1905 B in the private journal, 2026-10-30). Version 38 is reserved for folded copies of every remaining name a filter or lookup compares (project names and keys, tags, organizations, people and chat titles and the other text filters SQLite's ASCII-only `lower()` misses), with indexes on them, so every search ignores case in any script (owner's ruling, 2026-10-29). Version 37 is reserved for `identities.phone` (a person's phone as the messenger showed it, saved by `contacts sync` and by an online profile read, so `contacts show --offline` has it) and for the queue triggers that put a shared contact card's phone into `mentions` (tg-cli phones in the store, 2026-10-29). Version 36 is reserved for `attachments.contact` (a shared contact card's name, first and last name, whole phone and account id as JSON, so a card read from the store is the card the messenger sent; tg-cli contact cards, 2026-10-29). Version 35 is reserved for neutral calendar storage (`calendar_entries.series_external_id`, the provider's series id moved out of `metadata`, and RFC 5545-based words in the calendar columns; gcal plan lane C2, 2026-10-27). Version 34 is reserved for the vector index (`vector_indexes`, `vector_index_redo` and the triggers that keep one sqlite-vec `vec0` table per embedding model in step with `chunks` and `embeddings`; it raises `minCompatible` to 34, since a build without the extension can no longer write chunks; owner's choice 2026-10-25, stacked on #1979). Version 33 is reserved for calendar tables (`calendars`, `calendar_entries`, `calendar_entry_revisions`, `calendar_entry_participants`, `event_index_pending` and the events words index; `events.status`, `all_day`, `source_deleted_at`; `join_key` on `meetings` and `calendar_entries`; Wave 3 requirements 3.4). Version 32 is reserved for `files` (documents' source records, path plus parent), folder accounts' provider `folder` becoming `local` or `obsidian`, `entity_link_events`, the link review list and `identities.email`, with a backfill of one `files` row per `documents` row (Wave 3 requirements 3.3, 3.5, 3.6). Both ship in the same breaking release as versions 30 and 31 (owner's choice NEED-1780 A in the private journal, 2026-10-25). Version 31 is reserved for moving Drive documents from their stand-in notes-folder account (`folder`, `google-drive:`) to the `google-drive` account, so Drive is a provider of its own rather than a folder (owner's choice NEED-1727 A in the private journal, 2026-10-24). It ships only in the same release as version 30 (#1577) and raises `minCompatible` with it, so older CLIs refuse the store once, for both changes; it never ships on its own. Version 30 is reserved for reviewed tag redirects and text-free consolidation receipts, including a structural tag/automatic-claim compatibility boundary (Codex meetings/tag work, 2026-10-18; draft #1577, moved from 25 by the owner's choice NEED-1559, 2026-10-19, from 26 on 2026-10-21, from 27, 28 and 29 on 2026-10-22 because versions may not leave a gap and #1577 waits on a breaking release). Version 29 is taken by the voice-note transcript index (`transcript_words`, `transcript_words_vocab`, `transcript_stems` and its queue: a transcript found in any form of a word and widened to the spellings speech recognition garbles, as meetings are; owner's choice NEED-1635 B in the private journal, 2026-10-22). Version 28 is taken by chat state (`chats.muted`, `muted_until`, `archived`, `marked_unread` and `unread_counted_at`: a chat muted, archived or marked unread on the phone, and the point a messenger's unread count was taken, from which the store counts new messages for a messenger that opts in; wa, 2026-10-22). Version 27 is taken by `messages.delivery` (whether the owner's own message in a one-to-one chat was delivered or read, from the messenger's receipts; it only moves forward; wa, 2026-10-22). Version 26 is taken by `message_reactions` (each person's newest reaction to a message, from a messenger that sends reactions one person at a time; the store derives `messages.reactions` totals from them; wa, 2026-10-21). Its implementation and activation remain gated on a coordinated breaking release and consumer rollout; this reservation does not authorize raising `minCompatible` or publishing a new package major. Version 25 is taken by `chat_revisions` (one row per change to a chat's external id, title, membership, scope, search visibility or parent, written by a trigger in the same transaction; an offline read by a re-keyed chat's old id follows it; #1658, owner's choices NEED-1555 and NEED-1559, 2026-10-19). Version 24 is taken by `messages.starred` (the owner's star on a stored message, set by `messages star`/`unstar` and by the messenger's pushed star changes, read by `messages list starred:true` and `search messages is:starred`; wa S3 for S1, 2026-10-18). Version 23 is taken by `chat_events` and `chat_event_people` (who joined, left, was added, removed, promoted or demoted in a chat, and title changes, kept for a messenger whose history is pushed to the store; wa S3 for S2, 2026-10-18). Version 22 is taken by `account_identities.mail_demoted` (memo marks a sender whose fraud signals rank its mail lower in search; owner's choice NEED-1432, 2026-10-17). Version 21 is taken by resumable provider-neutral document annotation transfer receipts and reference mappings (Drive transfer, 2026-10-17). Version 20 is taken by `poll_votes` (each voter's newest vote in a poll the store holds, applied from the messenger's vote events and the owner's own votes; wa gaps, 2026-10-17). Version 19 is taken by the mail sender score (`account_identities.mail_score`, `mail_signals`, `mail_scored_at`: memo's spam score per sender and account, shown on email hits; owner's choice NEED-1403, 2026-10-17). Version 18 is taken by `places` (addresses found in text as records of their own, linked from `place` mentions; mentions plan phase 3, 2026-10-16). Version 17 is taken by the agent's close of a task (`tasks.close_certainty` and the close a task waits on the owner for — `close_suggested_as`, `_by`, `_certainty`, `_reason`, `_at`; tasks plan, follow-up-of and agent close, 2026-10-16). Version 16 is taken by mentions in documents, notes and mail (triggers that queue `documents.body`, `notes.body` and `emails` subject and text for mentions, as messages and attachments are; mentions plan phase 1e, 2026-10-15). Version 15 is taken by `task_pairs` (pairs of tasks that may be one job and every decision on them — review, unsure, merged, rejected, attach, new — with the levels the score came from; tasks plan step 5, 2026-10-15). Version 14 is taken by `task_words` / `task_stems` (full-text tables +**The next free migration version is 74.** Version 73 is taken by cli-core 1.0's store (every base table with an integer `id`, 101 of them, copied once to become `AUTOINCREMENT`, each counter started 1,000 above the largest id the store still knows; `CHECK`s for valid JSON in JSON columns, whole-or-empty pointer pairs and non-negative amounts; the index `taggings_by_taggable_type_taggable_id`; the runner turns foreign keys off before `BEGIN` for a migration that copies tables, puts back their triggers and indexes and checks their foreign keys before `COMMIT`; it raises `minCompatible` to 73 and refuses to run without a rollback copy unless `store migrate --no-backup`; owner's ruling NEED-2872 A, cli-core 1.0 plan phase 4, 2026-11-23). Version 72 is taken by document history (`document_revisions.title`, `front_matter` and `reason`, so a version keeps what the document was and why it was replaced: edited, deleted, unavailable or unsynced. `documents.removal`, why a removed document left the copy, its text kept when unavailable. `document_changes`, the change log of synced documents with no foreign key, and the trigger `document_changes_account_bd` that drops an account's rows with it. Columns, a table, an index and a trigger added only, forward-only, `minCompatible` stays 56. IDEA-2862 in cli-private's Notion roadmap, owner's answers NEED-2802, NEED-2803 A and NEED-2805, 2026-11-23. Reserved in the same pull request, as version 67 was, announced on issue #3157). Version 71 is reserved for the content category (`content_channels`, `content_authors`, `content_terms`, `content_posts` with the body as Markdown and its hash and its terms, authors and media as JSON (no `content_post_terms`: a post is found by a term through its JSON and its taggings), `content_post_revisions` (the title, body and status a sync or a write replaced, and a post the source deleted, kept before the change), `content_metrics` (snapshots in time, never overwritten) and the contentless word index `content_post_words` kept by triggers; a post becomes a taggable type `post`, with a trigger that drops its taggings when the post row goes; blog posts and pages of a site such as WordPress, later social posts; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; content category plan C5 in cli-private, owner's ruling NEED-2722 A, 2026-11-18). Version 70 is reserved for the tracker category (`tracker_items`: one row per team, user, workflow state, label, project, issue or comment of an issue tracker account such as Linear, with its source id, parent, title, text, source times, archive and deletion marks and the rest as JSON; `tracker_item_words`, a contentless word index over titles and text kept by triggers; tables, indexes and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-2717 A, source-manifest plan L3 in cli-private, 2026-11-17). Version 69 is reserved for stored conversation readiness (`conversation_readiness`: per built chat and embedding model, the counts `search conversations` reports — messages new, edited or deleted since the build, chunks with current, stale and missing vectors — saved when first counted and dropped by triggers when the chat's messages, revisions, build or that model's vectors change, so a search reads them instead of recounting every chat; table and triggers added only, forward-only, `minCompatible` stays 56; owner's ruling NEED-63 A, 2026-11-17). Version 68 is taken by CRM client files (`crm_files`: one row per downloaded file of a deal, lead, contact or company, with its owner record, source kind, name, size, type, local path and extracted text in its own word index, never a download link; CRM files plan in cli-private, 2026-11-16). Version 67 is taken by the facts removal log and phone-call fields on meetings (`fact_removals`: one row per removed fact with its id, the reference of what it was about, who removed it, when and why, never its text or value; `meetings.direction` and `client_phone`, set by a phone-line source; table, columns and indexes added only, forward-only, `minCompatible` stays 56; owner's rulings NEED-2614 B and the call-fields decision A, 2026-11-13; reserved in the same pull request under the one-PR rule for that round, announced on issue #849). Version 66 is reserved for the person-kind trigger on account names (`person_kind_identity_au` recreated to watch `identities.name` too, so a person with no name of their own has their kind and name order worked out again when an account's name changes; triggers only, forward-only, `minCompatible` stays 56; RISK-2268, 2026-11-11). Version 65 is taken by titles of found tasks (the migration sets a `store_settings` key only in a store holding a task still titled ` — `, and the next writable open gives each such task the first line of its source message, as `tasks list` already shows it, in batches, then deletes the key; tasks whose message is missing, deleted or empty keep their title; no schema change, forward-only, `minCompatible` stays 56; owner's ruling NEED-2517 B, 2026-11-10). Version 64 is taken by faster person-kind triggers on deal links (`person_kind_deal_link_ai`, `_ad` and `_au` recreated so their lookup of a deal's other links uses the `(from_type, from_id)` index, and `person_kind_deal_owner_moved_au` and `_owner_person_au` so they find the owner's links by person; version 63's read every person link per row, about 24 ms each on 118k links; triggers only, forward-only, `minCompatible` stays 56; removing CRM contacts outside the scope, owner's ruling 2026-11-10). Version 63 is reserved for people's ties from messages and CRM deals (triggers that clear a stored person kind when a deal or lead names the person or changes its owner, and when a chat whose message senders count as ties changes kind or crosses the small-group size; triggers only, forward-only, `minCompatible` stays 56; BUG-676 and the owner's ruling NEED-2500 A, 2026-11-10). Version 62 is reserved for stored person kinds (columns on `persons` for each person's kind, name order, message count, task count and newest contact, filled lazily and cleared by triggers when anything that decides them changes, so `people list` filters, sorts, pages and counts in SQL; columns, a partial index and triggers added only, forward-only, `minCompatible` stays 56; Desktop page speed plan item 1, 2026-11-10). Version 61 is reserved for people's ties to the owner (a phone-book marker written by `contacts sync`, indexes the tie checks need, and a stored ties table only if the benchmark in cli-testing `performance/people/ties` says reading them is too slow; columns and indexes added only, forward-only, `minCompatible` stays 56; people-clients-digests plan CC-2, 2026-11-09). Version 60 is reserved for WireCat base stages (`pipeline_stages.base_stage_id`, the stage of the owner's base set of its kind another pipeline's stage maps to, and `base_confirmed`, whether the owner confirmed that mapping or it is still a suggestion; columns added only, no table rebuild; forward-only, `minCompatible` stays 56; TASK-947, #2720, 2026-11-08). Version 59 is reserved for owner-edited message templates (`templates`: one row per key, such as `report/morning-digest`, channel, `telegram`, `email` or `text`, and language, the body the owner saved over the shipped default, when and by whom; `templates_history`, every body a save or a reset replaced, so an edit can be undone; forward-only, `minCompatible` stays 56; digest format plan §9 in max-cli, PR 5b, 2026-11-08). Version 58 is reserved for write-time enrichment (`enrichments`: per note, document or email, the standalone facts and reworded questions a hosted model wrote about it, with the hash of the text it read, the provider, the model and the tokens; triggers drop a record's row when the record is deleted; off by default, turned on by the owner with a consent; forward-only, `minCompatible` stays 56; feat/enrichment-setting, 2026-11-08). Version 57 is reserved for business entities (`catalog_items`, `order_lines`, `contracts`, `subscriptions` and `subscription_prices`, `financial_accounts`, `financial_transactions`, `transaction_splits`; `payments.refund_of` with net paid; contract, subscription, product and deal columns on invoices, payments, orders and their lines; `record_relations.as_role`, `records.created_entity`; forward-only, `minCompatible` as version 56 leaves it; business entities plan, `docs/dev/business-entities-plan.md`, #2649). Version 56 is reserved for business relationship links (`links.account_id`, the source account that reported a relationship; `links.starts_at` and `ends_at`, when it held, never guessed; `links.deleted_at`, the source stopped reporting it; `link_revisions`, one row per change of a relationship link written by triggers; a unique key on relationship links with the role and the account in it, after folding duplicates; CRM links stored so far become unconfirmed and name their account; forward-only; it raises `minCompatible` to 56, since an older build writing CRM links would bring back confirmed rows with no account (NEED-2406 A, pending); CRM relationships plan in cli-private `plans/2026-11-07-crm-relations/`, owner's ruling NEED-2372 A, 2026-11-07). Version 55 is taken by `decision_requests` (the one-time keys behind the buttons of a message that asks the owner to decide a batch from Telegram: only a token's digest is kept, using one cancels its siblings; forward-only, `minCompatible` stays 34; mail review from Telegram, plan §12 step 3 in max-cli, 2026-11-07). Version 54 is taken by CRM field definitions (`crm_fields`: a CRM account's own fields per kind, `deal`, `lead`, `person` or `organization`, with their code, label, type, whether they hold several values, whether a list can filter by them and a list field's options, written by the CRM sync and read by `fields list` and the desktop; values stay in each row's `metadata` keyed by code; forward-only, `minCompatible` stays 34; b24 plan §4.4, 2026-11-06). Version 53 is taken by CRM pipelines keyed by kind (the unique index on `pipelines` becomes `(account_id, kind, external_id)`, so a deal pipeline and a lead pipeline of one CRM account may share an id, and `pipelines.deleted_at` and `pipeline_stages.deleted_at` mark what the CRM deleted, kept because deals may still stand in it; forward-only, `minCompatible` stays 34; CRM write port, 2026-11-06). Version 52 is taken by deals and leads, amended in place on 2026-11-06 since no published CLI used 0.585.0, 0.586.0 or 0.587.0 (`pipelines` with a ref, a kind and an optional CRM account, `pipeline_stages` with an outcome, `deals`, `leads`, `pipeline_stage_changes` written by triggers, and a seeded `Leads` pipeline; agents write directly, no review; slice B2 of the business data plan). It keeps `minCompatible` at 34. Version 51 is taken by task links (`tasks.provider` and `tasks.external_id`, the task's id in an outside service such as an Avito conversation or listing, kept apart per service and given as `:`; `tasks.source_url` and `orders.source_url`, the http or https page the task or order is about, such as an Avito ad or an Amazon order; owner's ruling NEED-2245 A, 2026-11-05). It keeps `minCompatible` at 34. Version 50 is taken by orders (`orders`: what the owner or a client bought or sold, for whom (`customer_*`, a `person:` or `organization:`) and whether it is `personal`, `business`, `client` or `other`, the shop as the mail names it plus an optional `supplier_*` reference, the shop's order number, amount and currency in minor units, status `placed` | `shipped` | `delivered` | `cancelled` | `returned`, optional links to an invoice and a payment, and the audit and `review` columns invoices have; the mail-triage agent proposes them as `order` and `order_update` mail findings; BUG-531, owner's ruling NEED-2241 A, 2026-11-05). It keeps `minCompatible` at 34. Version 49 is taken by amounts on record relations (`record_relations.amount`, the share of a payment a `settles` relation of the records envelope names, as a decimal in the payment's currency, so an import allocates a payment split across invoices as its source says; WireCat records import, 2026-11-05). It keeps `minCompatible` at 34. Version 48 is taken by removing leaked test accounts (every account of provider `chat`, the fake messenger of `src/testing/shared-program.ts`, that tests wrote into the owner's real store before #2438; the migration sets a flag only in a store that holds one, and the next writable open purges each such account through `purgeAccount`; owner's choice NEED-250 A in the desktop journal, 2026-11-02). It keeps `minCompatible` at 34. Version 47 is taken by source records (`records`, `record_relations`: what each import said, unique per account, type and external id, with a fingerprint and the source's revision, mapped to at most one entity and never by name; relations to a record not yet imported wait for it; TASK-886 slice B1b, 2026-11-02). It keeps `minCompatible` at 34. Version 46 is taken by retiring payment facts (triggers `facts_no_payment_bi` and `facts_no_payment_bu` refuse a `payment` fact, and the next writable open moves stored payment facts into `payments` and `invoices` rows: a paid one a payment, an expected one an invoice, accepted ones confirmed and proposed ones proposed; owner's ruling NEED-2167 A, TASK-886 slice B0, 2026-11-02). It keeps `minCompatible` at 34. Version 45 is taken by finance tables (`invoices`, `invoice_lines`, `payments`, `payment_allocations`: money as integer minor units per ISO 4217 currency, invoice status derived from confirmed allocations, an agent's or an import's entry a proposal only the owner decides; triggers keep allocations within the payment, within the invoice and in one currency; TASK-886 slice B1a, 2026-11-02). It keeps `minCompatible` at 34. Version 44 is taken by proposals in one place (`relationships.purpose`, a chat's purpose in a project from the purposes memo's config lists, no fixed set in the store, null meaning `work`, beside the free-text `role`; unconfirmed links an agent or a rule proposed move from `links` into `proposed_actions` as `relationship` and `key_document` proposals with their bot, reason and time, while Drive editor links stay; TASK-834.d slice D2, 2026-11-02). It keeps `minCompatible` at 34. Version 43 is reserved for `memories.project_id` (a memory may name the project it belongs to, as a fact does, so the WireCat Desktop Memory page can group and filter memories by project; owner's choice NEED-198 A in the desktop journal, 2026-11-01). It keeps `minCompatible` at 34. Version 42 is reserved for narrowing the task revision (`tasks.revision` goes up only for a change a person could conflict with: title, description, status, priority, agent, due date, project and parent, and by triggers on `task_assignments` and task `taggings`; never for a claim, a follow-up time or a close suggestion; WireCat Desktop Tasks page, RISK-77, 2026-11-01). It keeps `minCompatible` at 34. Version 41 is taken by project task fields (`tasks.priority_score`, a decimal priority in [0, 1] that also orders a board column, kept in step with the old 0–4 `priority` by triggers; `tasks.agent`; `tasks.revision`, for a stale-write check; WireCat Desktop Tasks page, owner's choices NEED-176, NEED-178, NEED-180, 2026-11-01). It keeps `minCompatible` at 34. Version 40 is reserved for the trigram indexes of notes and documents (`note_trigrams`, `document_trigrams`: contentless FTS5 trigram tables over the normalized title and text, so notes, documents, knowledge annotations and contacts `--notes` are found by any part of a word in any letter case; owner's ruling A2, 2026-10-30). Version 39 is taken by `email_locations` (each stored email's place in an IMAP folder: folder, UIDVALIDITY and UID, so a quick mail sync proves deletions and refreshes flags for mail it does not read again; owner's choice NEED-1905 B in the private journal, 2026-10-30). Version 38 is reserved for folded copies of every remaining name a filter or lookup compares (project names and keys, tags, organizations, people and chat titles and the other text filters SQLite's ASCII-only `lower()` misses), with indexes on them, so every search ignores case in any script (owner's ruling, 2026-10-29). Version 37 is reserved for `identities.phone` (a person's phone as the messenger showed it, saved by `contacts sync` and by an online profile read, so `contacts show --offline` has it) and for the queue triggers that put a shared contact card's phone into `mentions` (tg-cli phones in the store, 2026-10-29). Version 36 is reserved for `attachments.contact` (a shared contact card's name, first and last name, whole phone and account id as JSON, so a card read from the store is the card the messenger sent; tg-cli contact cards, 2026-10-29). Version 35 is reserved for neutral calendar storage (`calendar_entries.series_external_id`, the provider's series id moved out of `metadata`, and RFC 5545-based words in the calendar columns; gcal plan lane C2, 2026-10-27). Version 34 is reserved for the vector index (`vector_indexes`, `vector_index_redo` and the triggers that keep one sqlite-vec `vec0` table per embedding model in step with `chunks` and `embeddings`; it raises `minCompatible` to 34, since a build without the extension can no longer write chunks; owner's choice 2026-10-25, stacked on #1979). Version 33 is reserved for calendar tables (`calendars`, `calendar_entries`, `calendar_entry_revisions`, `calendar_entry_participants`, `event_index_pending` and the events words index; `events.status`, `all_day`, `source_deleted_at`; `join_key` on `meetings` and `calendar_entries`; Wave 3 requirements 3.4). Version 32 is reserved for `files` (documents' source records, path plus parent), folder accounts' provider `folder` becoming `local` or `obsidian`, `entity_link_events`, the link review list and `identities.email`, with a backfill of one `files` row per `documents` row (Wave 3 requirements 3.3, 3.5, 3.6). Both ship in the same breaking release as versions 30 and 31 (owner's choice NEED-1780 A in the private journal, 2026-10-25). Version 31 is reserved for moving Drive documents from their stand-in notes-folder account (`folder`, `google-drive:`) to the `google-drive` account, so Drive is a provider of its own rather than a folder (owner's choice NEED-1727 A in the private journal, 2026-10-24). It ships only in the same release as version 30 (#1577) and raises `minCompatible` with it, so older CLIs refuse the store once, for both changes; it never ships on its own. Version 30 is reserved for reviewed tag redirects and text-free consolidation receipts, including a structural tag/automatic-claim compatibility boundary (Codex meetings/tag work, 2026-10-18; draft #1577, moved from 25 by the owner's choice NEED-1559, 2026-10-19, from 26 on 2026-10-21, from 27, 28 and 29 on 2026-10-22 because versions may not leave a gap and #1577 waits on a breaking release). Version 29 is taken by the voice-note transcript index (`transcript_words`, `transcript_words_vocab`, `transcript_stems` and its queue: a transcript found in any form of a word and widened to the spellings speech recognition garbles, as meetings are; owner's choice NEED-1635 B in the private journal, 2026-10-22). Version 28 is taken by chat state (`chats.muted`, `muted_until`, `archived`, `marked_unread` and `unread_counted_at`: a chat muted, archived or marked unread on the phone, and the point a messenger's unread count was taken, from which the store counts new messages for a messenger that opts in; wa, 2026-10-22). Version 27 is taken by `messages.delivery` (whether the owner's own message in a one-to-one chat was delivered or read, from the messenger's receipts; it only moves forward; wa, 2026-10-22). Version 26 is taken by `message_reactions` (each person's newest reaction to a message, from a messenger that sends reactions one person at a time; the store derives `messages.reactions` totals from them; wa, 2026-10-21). Its implementation and activation remain gated on a coordinated breaking release and consumer rollout; this reservation does not authorize raising `minCompatible` or publishing a new package major. Version 25 is taken by `chat_revisions` (one row per change to a chat's external id, title, membership, scope, search visibility or parent, written by a trigger in the same transaction; an offline read by a re-keyed chat's old id follows it; #1658, owner's choices NEED-1555 and NEED-1559, 2026-10-19). Version 24 is taken by `messages.starred` (the owner's star on a stored message, set by `messages star`/`unstar` and by the messenger's pushed star changes, read by `messages list starred:true` and `search messages is:starred`; wa S3 for S1, 2026-10-18). Version 23 is taken by `chat_events` and `chat_event_people` (who joined, left, was added, removed, promoted or demoted in a chat, and title changes, kept for a messenger whose history is pushed to the store; wa S3 for S2, 2026-10-18). Version 22 is taken by `account_identities.mail_demoted` (memo marks a sender whose fraud signals rank its mail lower in search; owner's choice NEED-1432, 2026-10-17). Version 21 is taken by resumable provider-neutral document annotation transfer receipts and reference mappings (Drive transfer, 2026-10-17). Version 20 is taken by `poll_votes` (each voter's newest vote in a poll the store holds, applied from the messenger's vote events and the owner's own votes; wa gaps, 2026-10-17). Version 19 is taken by the mail sender score (`account_identities.mail_score`, `mail_signals`, `mail_scored_at`: memo's spam score per sender and account, shown on email hits; owner's choice NEED-1403, 2026-10-17). Version 18 is taken by `places` (addresses found in text as records of their own, linked from `place` mentions; mentions plan phase 3, 2026-10-16). Version 17 is taken by the agent's close of a task (`tasks.close_certainty` and the close a task waits on the owner for — `close_suggested_as`, `_by`, `_certainty`, `_reason`, `_at`; tasks plan, follow-up-of and agent close, 2026-10-16). Version 16 is taken by mentions in documents, notes and mail (triggers that queue `documents.body`, `notes.body` and `emails` subject and text for mentions, as messages and attachments are; mentions plan phase 1e, 2026-10-15). Version 15 is taken by `task_pairs` (pairs of tasks that may be one job and every decision on them — review, unsure, merged, rejected, attach, new — with the levels the score came from; tasks plan step 5, 2026-10-15). Version 14 is taken by `task_words` / `task_stems` (full-text tables for tasks, kept by task writes, for the duplicate check's candidate lookup; tasks plan step 3, 2026-10-15). Version 13 is taken by task fields (`category`, `claimed_by`, `claimed_until`, per-type keys for message tasks, tasks as a taggable type; tasks plan step 2, 2026-10-14). Version 12 is taken by `mail_rules` (mail rules move from memo's config into the store, with the rule that decided each email; universal mail rules plan in cli-memo, 2026-10-14). diff --git a/docs/dev/KNOWLEDGE.md b/docs/dev/KNOWLEDGE.md index 4d63d6ac0..2e25fc647 100644 --- a/docs/dev/KNOWLEDGE.md +++ b/docs/dev/KNOWLEDGE.md @@ -422,7 +422,8 @@ with it fills every deal's and lead's `assignee` (a source contract case checks records it, since the copy's offline readers take its rule for that user. Out of scope is a deleted mark, as for a row the CRM deleted: `mine` hides those rows from lists and search, but their earlier copy stays in the store file. Deleting a copy touches no relationship, so the owner's confirmed links stay and return with the row. An id list that is empty -never marks rows deleted without `--rescan`, whatever the copy's size. `store status` reads both without a sync: each deal and lead row's +never marks rows deleted without `--allow-deletions`, whatever the copy's size, and a pass after the adapter reported +a gap for the kind never marks any. `store status` reads both without a sync: each deal and lead row's `scope` gives the setting, the scope its cursor reads new pages under (`all` under a source without `self()`), and `held` while the cursor's `narrowing` keeps stored rows outside it. diff --git a/docs/dev/STANDARD.md b/docs/dev/STANDARD.md index 9563396c2..ccbefe60e 100644 --- a/docs/dev/STANDARD.md +++ b/docs/dev/STANDARD.md @@ -1184,7 +1184,7 @@ its meaning, and this table is regenerated from it. **Bold** marks a clash still | `--newest` | | newest first instead of best first | | `bot search messages` (planned), `search messages`, `searches create` | | `--no-approval` | | anyone with it joins at once | | `chats links update` (tg-only) | | `--no-as-reply` | | send without linking to the matched message | | `replies edit` | -| `--no-backup` | | delete the store without backing it up first | | `store reset` | +| `--no-backup` | | delete the store without backing it up first | | `store migrate`, `store reset` | | `--no-block` | | remove without banning; by default a removed person cannot come back by the link | | `bot chats moderate` (planned) | | `--no-buttons` | | take the buttons off the message | | `bot messages edit` (planned) | | `--no-catch-up` | | skip local preparation after this run | | `messages sync`, `projects evidence`, `store gaps repair` | diff --git a/docs/dev/TESTING.md b/docs/dev/TESTING.md index fdb3a4a8c..ff00a68ce 100644 --- a/docs/dev/TESTING.md +++ b/docs/dev/TESTING.md @@ -24,11 +24,15 @@ that CLI has an open pull request (a draft counts) from that branch, and at its with adoption pull requests in the CLIs can pass before they merge. A branch with no pull request is not built ([`scripts/parity/app-ref.sh`](../../scripts/parity/app-ref.sh)). A release takes the adoption branches with `bin/release --app-ref `. -Parity's `downstream` job builds every CLI listed in -[`scripts/parity/downstream.json`](../../scripts/parity/downstream.json) against the branch, in parallel. One required +Parity's `downstream` job builds the CLIs listed in +[`scripts/parity/downstream.json`](../../scripts/parity/downstream.json) against the branch, in parallel: all of them +on a release (which also runs their tests), the monthly run and a run by hand, and only those marked `"pr": true` on a +pull request and a push to `main`, to spare the Actions minutes every WireCat repository shares. The marked ones are +tg, max and wa (the manifest and wording jobs read their builds), memo, mail, drive and attio. One required check, `validation / parity / downstream`, sums the matrix ([`scripts/parity/downstream-result.sh`](../../scripts/parity/downstream-result.sh)); its summary has a row per CLI. -A new CLI on cli-core is one line in that file; a private repository cannot be listed (the job checks out without a +A new CLI on cli-core is one line in that file, `cli` being the file name in its `dist/bin/` (`slack` for `slk`); +a private repository cannot be listed (the job checks out without a token). The same blocking steps run locally before a push: [`bin/downstream-check`](../../bin/downstream-check) packs the diff --git a/docs/dev/TRACKER.md b/docs/dev/TRACKER.md index 514619302..b521a3e0d 100644 --- a/docs/dev/TRACKER.md +++ b/docs/dev/TRACKER.md @@ -72,8 +72,9 @@ stops keeps its ids and the page it reached. round, so a budget smaller than the number of kinds still moves on. - **Held passes.** A pass is held (`pass: "held"`, with the reason in `held`) and marks nothing when the list is empty while rows are stored, or when it would mark more than half of ten or more stored rows deleted: a tracker that lost - rights lists none of what it can no longer see. `--rescan` lets those through. A pass after the sign-in reported a - gap for the kind is held even then: what it could not read is not gone. + rights lists none of what it can no longer see. Only `--allow-deletions ` (`allowDeletions`), an owner-only + flag, lets up to that many through; `--rescan` does not. A pass after the sign-in reported a gap for the kind, in + this run or an earlier run of the same pass, is held even then: what it could not read is not gone. - **Failures.** A kind that fails is named in its result's `error` and the others still sync. A page that says there is more but gives no next page fails the kind. - **The owner's tasks.** After the kinds, a sync whose tracker has `self` and issues brings the owner's tasks in line @@ -83,8 +84,8 @@ stops keeps its ids and the page it reached. or in a cancelled run, the answer has no `tasks`. When the budget is spent before the id is read, or the id or a task cannot be read or written, the tasks are left as they were and `tasks.skipped` says why; the copy is saved either way. -- **`rescan`.** Lists everything again and every id, dropping a round in progress, and lets a held pass through unless a - gap held it. A rescan that stops goes on as one in the next run. +- **`rescan`.** Lists everything again and every id, dropping a round in progress. It keeps the held-pass guard. A + rescan that stops goes on as one in the next run. - **What the answer says.** `synced[].saved` and `progress.saved` count the rows that changed in the copy (new, different, deleted or back again), so a sync with nothing new answers 0; `store.tracker.save` answers the same. `deletions: { checked, due }` says when the id pass last ran for every kind (`null` before the first) and when it is diff --git a/docs/reasons.md b/docs/reasons.md new file mode 100644 index 000000000..001f3306c --- /dev/null +++ b/docs/reasons.md @@ -0,0 +1,662 @@ +# Error reasons + +Every error a WireCat CLI built on cli-core prints carries a `reason` beside its `code`: + +```json +{"error":{"code":"not_found","reason":"item.not-found","message":"…"}} +``` + +The `code` is one of the few classes every WireCat CLI shares, the +[error codes](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/output.md). The `reason` says which +failure it was, so a script or an agent can act on it without reading the message. This page lists every reason +cli-core raises, as `CORE_REASONS` exports them. A CLI adds its own on top of these (`failureContext`). + +## What may change + +The reasons are part of cli-core's contract, under the same semver as its stable exports: + +- **A new reason** can come in any release. Handle a reason you do not know by its `code`. +- **A message** may be reworded in any release. Match on the `reason`, never on the message. +- **Removing or renaming a reason, or moving it to another code,** breaks callers. It is listed in the changelog + under "Changed — may break callers" or "Removed", and from 1.0.0 on it needs a major release. +- **The detail keys** a reason lists are the ones its error may carry under `details`. A key may be added in any + release. + +The table is generated from `src/errors/reasons.ts` with `pnpm reasons:docs`, and `pnpm docs:check` fails when the +two disagree. Neither drops a reason this page lists until a fragment in `changes/` names it under one of those two +headings. + +## All reasons + + + +| Reason | Code | Meaning | Details | +|---|---|---|---| +| `access.denied` | `permission_error` | the provider refused this account access to the item | | +| `account-remove.account-shared` | `conflict` | another profile reads the same account, whose copy the store shares | | +| `account-remove.account-unknown` | `conflict` | which account another profile holds could not be read, so --delete-data waits | | +| `account-remove.busy` | `conflict` | a serve or a sync runs for this profile; stop it first | | +| `account-remove.folder-outside` | `configuration_error` | the tool named a folder of its own outside the home folder | | +| `account-remove.no-choice` | `validation_error` | account remove needs --keep-data or --delete-data, one of them | | +| `account-remove.path-outside` | `configuration_error` | the tool named a path outside its own folders | | +| `account-remove.unconfirmed` | `confirmation_required` | removing an account asks first; add --yes | | +| `account-remove.unknown-profile` | `not_found` | no profile by this name on this computer | | +| `account-rename.bot` | `conflict` | the profile is also a bot profile, which keeps its name | | +| `account-rename.busy` | `conflict` | a serve, a background service, a schedule or a sync uses this profile | | +| `account-rename.config` | `configuration_error` | the config file cannot be read | | +| `account-rename.moved-run` | `permission_error` | a run with moved folders never renames a profile | | +| `account-rename.taken` | `conflict` | the new name, or a file or keyring entry under it, already exists | | +| `account-rename.unconfirmed` | `confirmation_required` | renaming a profile asks first; add --yes | | +| `account-rename.unpaired` | `configuration_error` | the tool named different paths for the old and new name | | +| `agent.cost-unknown` | `validation_error` | the agent reports no cost, so a cost cap cannot stop it | | +| `agent.refused` | `permission_error` | the schedule changed since it was saved, or starts no agent a schedule may run | | +| `agent.unrestricted` | `permission_error` | nothing holds this agent to the CLI's commands, so no schedule starts it | | +| `ai.images-not-allowed` | `permission_error` | the AI model may not read pictures; models ai set --allow-remote | | +| `ai.key-missing` | `configuration_error` | no API key is stored for the AI model's address | | +| `ai.not-set` | `configuration_error` | no AI model is chosen; models ai set chooses one | | +| `ai.ok` | `invalid_response` | models ai check: the model answered (a result, never raised) | | +| `ai.owner-only` | `permission_error` | only the owner chooses, unsets, checks or removes the AI model and its key, or revokes its consent | | +| `ai.setting-invalid` | `configuration_error` | the ai section or the model given is not one WireCat can use | | +| `api.disabled` | `configuration_error` | the provider's API is turned off for this OAuth project | | +| `api.unknown-method` | `validation_error` | the provider has no method by this name | | +| `busy.feed` | `validation_error` | a feed calendar has no busy times to ask; read its events with events list | | +| `busy.no-calendars` | `validation_error` | no calendar syncs and no person was named, so there is nobody to ask | | +| `busy.offline` | `permission_error` | calendars busy asks the provider; --offline was given | | +| `busy.unanswered` | `provider_error` | the provider gave no busy times for a calendar or person that was asked | | +| `calendar.ambiguous` | `validation_error` | two or more calendars have this name; name one by its id | | +| `calendar.no-upcoming` | `not_found` | no upcoming meeting with other attendees is stored for this account | | +| `calendar.read-only` | `permission_error` | the calendar takes no new events from this account | | +| `calendar.sync-incomplete` | `not_found` | a synced calendar's sync never finished or is mid-round | | +| `calendar.unsynced` | `not_found` | the calendar account has no synced calendar in the store | | +| `catalog.cycle` | `invalid_response` | local folder ancestry contains a cycle | | +| `catalog.depth-invalid` | `validation_error` | tree depth must be between 0 and 50 | | +| `catalog.not-found` | `not_found` | the file or folder is not in the local catalog; run catalog import or sync | | +| `catalog.tree-limit` | `validation_error` | the tree is over 10000 entries; name a smaller folder or lower --depth | | +| `catalog.unavailable` | `configuration_error` | the store has no shared catalog for this account | | +| `chat-sending.ask` | `confirmation_required` | models chats is ask: pass --yes, or the owner sets it to allowed | `emails`, `threads`, `tokens`, `host`, `model`, `estimated_cost_usd` | +| `chat-sending.denied` | `permission_error` | models chats is denied: chat text never goes to a model off this computer, even with --yes | | +| `chat-sending.owner-only` | `permission_error` | only the owner makes models chats less strict, not an agent | | +| `chat.not-read` | `not_found` | a chat shared with this person is not held whole in the store | | +| `config.unrepairable` | `configuration_error` | the settings file's damage has more than one reading; nothing was changed, so it is fixed by hand | | +| `content.already-published` | `validation_error` | a published post cannot be scheduled; unpublish it first | | +| `content.conflict` | `validation_error` | the post changed at the source since the last sync; sync, then write again | | +| `content.empty` | `validation_error` | a write names no field to set | | +| `content.get-unsupported` | `configuration_error` | the source cannot read one post, author or term by its id | | +| `content.lossy-body` | `validation_error` | the post's text holds blocks or embeds Markdown does not keep; --replace-body | | +| `content.schedule-past` | `validation_error` | a post is scheduled for a time to come, not one that passed | | +| `content.unlisted-held` | `validation_error` | a content id list would mark too much deleted, the sign-in read only part, or the site moved; nothing was | | +| `content.write-unsupported` | `validation_error` | the source does not take this write, such as a deletion past the trash | | +| `context.read-budget` | `validation_error` | the selected context reads exceed their text or request allowance | | +| `contract.field` | `validation_error` | a field of the contract is not valid | | +| `contract.ref` | `validation_error` | the reference names no contract, or no deal for it | | +| `contract.unacknowledged-override` | `configuration_error` | a shared command contract changed without an explicit override | | +| `crm.activities-failed` | `validation_error` | the activities and tasks could not be read; the deals and leads were synced | | +| `crm.activities-unlisted-held` | `validation_error` | a full list would mark most activities deleted; held until --rescan | | +| `crm.activity-field` | `validation_error` | a comment's or task's field is not valid, or the kind does not take it | | +| `crm.amount-unkept` | `validation_error` | a CRM deal's amount is in a currency or with decimals the store cannot hold: the deal is kept without it | | +| `crm.client-reads-admin-only` | `permission_error` | a raw api call that reads contacts or companies is the CRM administrator's | | +| `crm.email-ambiguous` | `validation_error` | a CRM contact's email belongs to more than one person; the owner decides | | +| `crm.file-exists` | `conflict` | the --dir folder already holds a file of that name, which a download never overwrites | | +| `crm.file-too-large` | `validation_error` | the file is larger than the download may take; --max-size raises it up to 2048 MB | | +| `crm.file-unavailable` | `provider_error` | the CRM did not give the file; its link is never shown | | +| `crm.files-denied` | `permission_error` | the profile's files.download level stops downloading files | | +| `crm.files-disk-full` | `validation_error` | the account's files folder is at its files.max_total_mb even after dropping | | +| `crm.files-limit-range` | `validation_error` | a files setting takes a whole number within its range; it is never clamped | | +| `crm.foreign-contacts-spent` | `permission_error` | the day's reads of records that are not yours (contacts, companies, other people's files) are spent | | +| `crm.item-invalid` | `validation_error` | a CRM item has a field the store refuses, such as a status it does not know | | +| `crm.narrowing-held` | `validation_error` | the default scope mine would mark most of a kind's stored rows deleted; none is, until the owner sets the scope | | +| `crm.not-reported` | `validation_error` | the CRM did not list users or departments; what they would say is unknown, nothing withdrawn | | +| `crm.own-unknown` | `validation_error` | no own company of the CRM account is stored, so its users are no one's employees yet | | +| `crm.owner-unknown` | `validation_error` | owner: names no CRM user: me without a known sign-in user, or not a user id | | +| `crm.pending-dropped` | `validation_error` | relationships waited too long for an end that never came; they were dropped | | +| `crm.pipeline-required` | `validation_error` | the CRM has more than one pipeline of the kind; the command names one | | +| `crm.record-ambiguous` | `validation_error` | more than one contact or company has that name; name one by its id | | +| `crm.record-field` | `validation_error` | a contact's or company's field is not valid | | +| `crm.reference-unknown` | `validation_error` | a CRM row names a contact, company or user the store does not hold; that link was not made | | +| `crm.scope-missing` | `permission_error` | the CRM sign-in lacks a scope one kind of a record's files needs | | +| `crm.self-from-sync` | `validation_error` | only a sync records whose CRM copy it is; config unset hands the copy to the next sync | | +| `crm.stage-history-failed` | `validation_error` | the CRM's stage history could not be read; stage tasks wait for the next sync | | +| `crm.stage-unknown` | `validation_error` | a CRM item stands in a stage the store does not hold; it was not kept | | +| `crm.unassigned-dropped` | `validation_error` | the CRM does not let this sign-in choose a user in unassigned; that user's deals are not copied | | +| `crm.unlisted-held` | `validation_error` | a list of every id would mark most of a kind deleted, or the sign-in read only part; nothing was | | +| `crm.write-unsupported` | `validation_error` | the CRM does not take this write, or does not recognise a repeated one | | +| `db.failed` | `provider_error` | the database server failed the query | | +| `db.no-database` | `not_found` | the database server has no such database | | +| `db.no-select` | `permission_error` | the database user may not read the table; grant it SELECT | | +| `db.no-table` | `not_found` | the database has no such table | | +| `db.read-only` | `permission_error` | the database refused a write: the connection only reads | | +| `db.refused` | `authentication_error` | the database server refused the user or password | | +| `db.timeout` | `timeout` | the database server did not answer in time | | +| `deal.closed` | `validation_error` | a deleted deal or lead does not move or close | | +| `deal.copy` | `validation_error` | a CRM's copy changes in the CRM; its next sync brings the change here | | +| `deal.denied` | `permission_error` | the profile denies listing deals or leads, so none is answered | | +| `deal.field` | `validation_error` | a field of the deal or lead is not valid | | +| `deal.not-readable` | `not_found` | the deal or lead is a copy the profile's CRM sign-in may not read | | +| `deal.out-of-scope` | `not_found` | the deal or lead is a copy from an account outside the accounts asked for | | +| `deal.ref` | `validation_error` | the reference names no deal or lead | | +| `deal.stage` | `validation_error` | no stage of that name, or a stage name more than one pipeline has | | +| `decision.request-invalid` | `validation_error` | a decision request needs its batch, message, owner and distinct known actions | | +| `decision.token-cancelled` | `permission_error` | another button of the message was pressed, or the feature was turned off | | +| `decision.token-expired` | `permission_error` | this button is older than 72 hours | | +| `decision.token-mismatch` | `permission_error` | the press came from another chat, message or user than the button was sent to | | +| `decision.token-unknown` | `not_found` | no button has this token | | +| `decision.token-used` | `permission_error` | this button was already pressed | | +| `doctor.report-exists` | `validation_error` | the report's file exists; a problem report never overwrites a file | | +| `document.changed` | `validation_error` | the document changed while it was read; nothing was saved | | +| `document.needs-ocr` | `validation_error` | the PDF has no text layer; a documents sync reads it with OCR (read_scans) | | +| `document.not-found` | `not_found` | no listed document has that reference | | +| `document.not-imported` | `not_found` | the document is not imported in this source account | | +| `document.scan-later` | `validation_error` | OCR stopped at its page limit or a busy model; the next sync goes on | | +| `document.scan-unread` | `validation_error` | OCR could not read the scan or picture; a sync tries again once the file changes | | +| `document.scan-unturned` | `configuration_error` | tesseract has no osd data, so a page on its side is read as it lies; install it to read scans again | | +| `document.version-missing` | `not_found` | the local copy holds no such version of the document | | +| `documents.other-account` | `configuration_error` | the documents are signed in as another account than the tracker copy of the same provider | | +| `download.mismatch` | `invalid_response` | the downloaded file has other content than the listing said | | +| `enrichment.owner-only` | `permission_error` | only the owner turns enrichment on, not an agent | | +| `event.conference-exists` | `validation_error` | the event has a meeting link already, which its attendees use | | +| `event.conflict` | `validation_error` | the event changed at the provider since the last sync; sync and try again | | +| `event.notify-required` | `validation_error` | the event has other attendees; say whether to notify them | | +| `event.quick-add-ambiguous` | `validation_error` | more than one event could be the one a lost quick add made | | +| `event.repeat-count` | `validation_error` | a COUNT series is split only with a rule for its new part | | +| `event.repeat-invalid` | `validation_error` | the repeat rule is outside the RFC 5545 subset the calendars take | | +| `event.repeat-kind` | `validation_error` | the series' rule holds a date or a time of the kind the event is leaving | | +| `event.repeat-split` | `validation_error` | the series cannot be split at this occurrence, or was split there already | | +| `event.text-with-fields` | `validation_error` | --text takes the whole event from its line, so no field option goes with it | | +| `event.unmovable` | `validation_error` | the provider keeps this kind of event on its calendar | | +| `evidence-findings.dedicated-review` | `validation_error` | review evidence findings through the dedicated findings command | | +| `evidence-findings.stale` | `validation_error` | evidence findings changed since they were read; stage a new batch | | +| `evidence.quote-length` | `validation_error` | a quote from the evidence is empty or over 500 characters | | +| `evidence.quote-not-found` | `validation_error` | the cited source does not say the quoted words | | +| `evidence.row-too-large` | `validation_error` | one evidence row is over its size limit | | +| `export.exists` | `validation_error` | the output file already exists | | +| `export.too-many` | `validation_error` | the query finds more events than one export writes | | +| `extraction.invalid-proposals` | `invalid_response` | the model's memory proposals could not be used | | +| `extraction.text-too-long` | `validation_error` | the text is too long for memory extraction | | +| `fact.not-accepted` | `validation_error` | only an accepted fact can be revoked | | +| `fact.owner-written` | `validation_error` | the owner wrote this fact; it was never proposed, so it cannot be revoked | | +| `fact.payment-retired` | `validation_error` | a payment is a payments row in store.finance, not a fact | | +| `fact.revoke-correction` | `validation_error` | an accepted correction cannot be revoked; its superseded fact stays | | +| `feed.address-invalid` | `validation_error` | a feed address is an http, https or webcal URL with no user or password in it | | +| `feed.duplicate` | `validation_error` | this profile follows a feed at this address already | | +| `feed.gone` | `not_found` | the feed's server has no feed at this address any more | | +| `feed.no-address` | `configuration_error` | the feed's address is no longer kept on this computer | | +| `feed.not-a-feed` | `validation_error` | the calendar is not a feed this profile follows | | +| `feed.redirect-refused` | `validation_error` | the feed sent the request on to an address that is not https | | +| `feed.refused` | `provider_error` | the feed's server refused the request | | +| `feed.timeout` | `timeout` | the feed's server did not answer in time | | +| `feed.too-large` | `validation_error` | the feed is larger than one sync reads | | +| `feed.unreachable` | `network_error` | the feed's server could not be reached | | +| `field.ambiguous` | `validation_error` | more than one custom field has that label; name one by its code | | +| `field.ambiguous-option` | `validation_error` | more than one option of the list field has that label; name one by its id | | +| `field.not-filterable` | `validation_error` | the CRM cannot filter a list by that custom field | | +| `field.unknown` | `validation_error` | no custom field of the kind has that code or label; `fields list` lists them | | +| `field.unknown-kind` | `validation_error` | fields are listed for deals, leads, people and organizations only | | +| `field.unknown-option` | `validation_error` | the list field has no option with that id or label | | +| `file.denied` | `permission_error` | the file cannot be opened: permission denied | | +| `file.locked` | `validation_error` | another process holds the file's lock | | +| `file.not-a-file` | `validation_error` | the path names a folder or another thing that is not a file | | +| `file.not-found` | `not_found` | the file named, or its folder, does not exist | | +| `file.not-plain-text` | `validation_error` | the file's text is extracted on a read; writing it back would replace the file | | +| `file.too-large` | `validation_error` | the file is larger than the limit set for this read | | +| `finance.allocate` | `validation_error` | the invoice or payment cannot take an allocation in its state | | +| `finance.below-paid` | `validation_error` | the invoice's lines would total less than is paid on it | | +| `finance.currency` | `validation_error` | the payment and the invoice are in different currencies; nothing is converted | | +| `finance.field` | `validation_error` | a field of the invoice or payment is not valid | | +| `finance.line` | `validation_error` | an invoice keeps at least one line: reject or void it instead | | +| `finance.line-amount` | `validation_error` | an invoice line's amount is not its quantity times its unit price | | +| `finance.lines` | `validation_error` | the invoice's lines are not valid | | +| `finance.no-line` | `not_found` | the invoice has no line at that position | | +| `finance.not-allocated` | `not_found` | the payment is not allocated to that invoice | | +| `finance.over-invoice` | `validation_error` | the allocation would settle more than the invoice's total | | +| `finance.over-payment` | `validation_error` | the allocation would use more than the payment's amount | | +| `finance.over-refund` | `validation_error` | the refunds would take back more than the payment, or than it gave an invoice | | +| `finance.owner-only` | `permission_error` | only the owner does this with money | | +| `finance.party` | `validation_error` | a party is a person: or organization: reference | | +| `finance.ref` | `validation_error` | the reference names no invoice or payment | | +| `finance.refund` | `validation_error` | a refund goes the other way in the same currency, of a live payment confirmed first, to an invoice it paid | | +| `finance.refunded` | `validation_error` | a refund of the payment still stands; reject it or take it back first | | +| `finance.status` | `validation_error` | the invoice's status does not allow this | | +| `finance.total` | `validation_error` | the invoice's total is not the sum of its lines | | +| `finance.unallocate` | `validation_error` | a rejected or deleted payment's allocations are not taken back | | +| `finding.missing-field` | `validation_error` | a finding leaves out a field its kind needs | | +| `finding.quote-not-found` | `validation_error` | a finding's quote is not in the text it cites, word for word | | +| `finding.unknown-field` | `validation_error` | a finding has a field its kind does not take | | +| `folder.not-a-folder` | `validation_error` | what was named is not a folder the account can read | | +| `folder.not-chosen` | `not_found` | the folder is not among the chosen folders | | +| `group.outside` | `permission_error` | the process is locked to a group, and this belongs to accounts outside it | | +| `ics.no-events` | `validation_error` | the file holds no event that can be imported | | +| `ics.not-icalendar` | `validation_error` | the file is not iCalendar | | +| `ics.too-large` | `validation_error` | the file is larger than one import reads | | +| `ics.too-many` | `validation_error` | the file holds more events than one import sends | | +| `identity-link.dedicated-review` | `validation_error` | an identity link is staged and decided through the people review | | +| `identity-split.dedicated-review` | `validation_error` | a split of a person is staged and decided through the people review | | +| `identity.agent-unnamed` | `validation_error` | an agent's link names the agent, and never as the owner | | +| `identity.common-name` | `validation_error` | more than six people have the name, so it proposes no one | | +| `identity.held-elsewhere` | `validation_error` | the identity sits on another person than the one named; name that person to take it off them | | +| `identity.kept-together` | `conflict` | the owner kept these identities together by turning down their split; only the owner splits them | | +| `identity.merge-conflict` | `conflict` | a row of the renamed identity has no counterpart on the identity it merges into; the pair is left as it was | | +| `identity.no-merge` | `not_found` | nothing of that person is merged into the other; people show lists the merges | | +| `identity.none` | `not_found` | the provider shows no accounts on a document | | +| `identity.not-a-person` | `validation_error` | a bot, a program or an organization is never proposed as a person by name | | +| `identity.not-shared` | `validation_error` | only a match on a shared mailbox can say the mailbox is a company's | | +| `identity.nothing-left` | `validation_error` | a split leaves at least one identity with the person | | +| `identity.owner` | `validation_error` | one side is the owner's person, and only the owner joins anyone to themselves | | +| `identity.owner-only` | `permission_error` | only the owner undoes a merge, splits a person, confirms or undoes a link, or links an identity to themselves | | +| `identity.rejected` | `conflict` | the owner rejected linking these people on this evidence; only a new signal or identity proposes them again | | +| `identity.same` | `validation_error` | the two identities are one person already | | +| `identity.separated` | `conflict` | the owner separated this identity from that person; only the owner links it again | | +| `identity.several-persons` | `validation_error` | the identities that leave a person are all of that one person | | +| `identity.shared-email` | `validation_error` | more than six people share the address, so it proposes no one | | +| `identity.shared-phone` | `validation_error` | more than six people share the phone number, so it proposes no one | | +| `identity.stale` | `conflict` | the people a merge or a proposed link names changed since; undo the later merge, or propose the link again | | +| `index.not-ready` | `validation_error` | the search index is still being built | | +| `input.closed` | `validation_error` | the input closed before the answer | | +| `input.empty` | `validation_error` | a hidden prompt got an empty answer three times | | +| `input.field-conflict` | `validation_error` | the input fields conflict | `fields` | +| `input.field-unsupported` | `validation_error` | the input field is not supported | `fields` | +| `input.incomplete` | `validation_error` | the answers stop before the step that checks them | | +| `input.required` | `validation_error` | the command needs an answer and cannot ask for one | | +| `input.too-large` | `validation_error` | the input is over its size limit | | +| `item.not-found` | `not_found` | the provider has no item by this id, or this account cannot see it | | +| `listing.source-not-found` | `not_found` | a source: term names no account holding what is listed | | +| `listing.too-large` | `provider_error` | the listing is over its bound; the checkpoint was kept | | +| `local-only.owner-only` | `permission_error` | only the owner turns local only off, not an agent | | +| `local-only.refused` | `permission_error` | local only is on and the address is not on this computer; nothing was sent | | +| `mail-findings.dedicated-review` | `validation_error` | review mail findings through the dedicated findings command | | +| `mail-findings.invalid` | `validation_error` | a checked mail findings batch would be refused; details.problems names why, finding by finding | | +| `mail-findings.key-used` | `validation_error` | the findings batch key was already used for different input | | +| `mail-findings.not-stored` | `not_found` | a mail finding cites an email the store does not hold | | +| `mail-findings.partial` | `validation_error` | a cited email is not stored whole yet; cite it once it is | | +| `mail-findings.stale` | `validation_error` | mail findings cite mail that changed since it was read; stage a new batch | | +| `mail.attachments-unread` | `provider_unavailable` | the email could not be read again, so its skipped attachments have no text | | +| `mail.cursor-ahead` | `validation_error` | an acknowledge cursor is past the newest stored email | | +| `mail.holder-not-yours` | `permission_error` | a run moves only the mark of the holder its schedule names | | +| `mail.inbox-agent` | `permission_error` | an agent sorts mail itself from review; inbox --offline lists | | +| `mail.inbox-answer-invalid` | `invalid_response` | the AI model's answer to inbox is not the JSON it asks for | | +| `mail.no-mark` | `not_found` | the holder has no mark in the mailbox yet; its first review starts it | | +| `mail.reset-owner-only` | `permission_error` | only the owner moves a holder's mark back | | +| `mail.search-refused` | `provider_error` | the mail server refused to search a folder | | +| `mail.source-failed` | `provider_error` | the mail server refused or did not complete a request | | +| `manifest.invalid` | `configuration_error` | the source manifest does not match its shape or the generated API | | +| `meeting-findings.dedicated-review` | `validation_error` | review meeting findings through the dedicated findings command | | +| `meeting-findings.stale` | `validation_error` | meeting findings changed since they were read; stage a new batch | | +| `meeting-project.stale` | `conflict` | the meeting's project changed meanwhile | | +| `meeting.not-found` | `not_found` | no meeting row has that event or meeting reference | | +| `meetings.index-pending` | `not_found` | some stored meetings are not indexed by person yet | | +| `meetings.server-capped` | `outcome_unknown` | the meetings service may hold more matches than the calls and pages one list asks | | +| `meetings.server-failed` | `provider_error` | the meetings service could not be read, or what it returned kept | | +| `meetings.server-offline` | `permission_error` | meetings list and show ask the service; --offline was given | | +| `meetings.server-rate-limited` | `rate_limited` | the meetings service asked to wait before more requests | | +| `meetings.server-refused` | `permission_error` | the meetings service refused the request | | +| `meetings.server-signed-out` | `authentication_error` | the meetings service needs a sign-in | | +| `meetings.server-unreachable` | `network_error` | the meetings service could not be reached | | +| `memory.already-superseded` | `validation_error` | the memory was already replaced by another | | +| `memory.evidence-required` | `validation_error` | a memory needs its evidence | | +| `memory.scope-required` | `validation_error` | a memory needs its scope | | +| `mirror.bad-exclusion` | `validation_error` | the exclusion is not a path pattern inside the mirror | | +| `mirror.local-changed` | `conflict` | the local file changed since the conflict was found; nothing was written | | +| `mirror.no-conflict` | `not_found` | the path has no recorded conflict; the last sync settled it or never saw one | | +| `mirror.no-space` | `validation_error` | the sync needs more free space than the local drive has | | +| `mirror.none` | `not_found` | the profile has no mirrors; add one with mirrors add | | +| `mirror.not-folder` | `validation_error` | the path to mirror is not a folder | | +| `mirror.not-found` | `not_found` | no such mirror in this profile; see mirrors list | | +| `mirror.partial` | `provider_error` | some mirrored files were not synced | | +| `mirror.remote-changed` | `conflict` | the remote file changed since the listing; the next sync settles it | | +| `mirror.stopped` | `timeout` | the mirror's run reached its deadline before it was done; run it again with more time | | +| `mirror.symlink` | `validation_error` | the file is under a symbolic link, which the sync does not follow | | +| `mirror.too-many-deletions` | `confirmation_required` | the sync would delete more files than the guard allows; check them with --dry-run and allow them explicitly | | +| `mirror.too-many-replacements` | `confirmation_required` | the sync would replace more files than the guard allows; check them with --dry-run and allow them explicitly | | +| `mirror.version-not-kept` | `provider_error` | the earlier content could not be kept in the version store, so the sync did not replace it | | +| `model.address-refused` | `validation_error` | the model address is refused: https, or plain http and Ollama only on this computer | | +| `model.empty-answer` | `invalid_response` | the model answered nothing; given a picture, it may not read pictures — choose a vision model | | +| `model.key-rejected` | `invalid_response` | the model provider refused the API key (401 or 403) | | +| `model.not-downloaded` | `not_found` | the model is not downloaded on this machine | | +| `model.offline` | `permission_error` | downloading a model needs the network; --offline was requested | | +| `model.unreachable` | `invalid_response` | the model provider could not be reached over the network | | +| `money.amount` | `validation_error` | the amount is not a decimal string in the currency's scale | | +| `money.currency` | `validation_error` | the currency is not one the store keeps money in | | +| `money.quantity` | `validation_error` | the quantity is not a decimal above 0 | | +| `name.invalid` | `validation_error` | the name is not valid | | +| `name.taken` | `validation_error` | the name is already used | | +| `network.host-undeclared` | `configuration_error` | the request went to a host the CLI does not declare, or not the model address's own; nothing was sent | | +| `oauth.declined` | `authentication_error` | the provider's consent was declined | | +| `oauth.expired` | `authentication_error` | the provider refused the saved sign-in; sign in again | | +| `oauth.failed` | `authentication_error` | the provider returned no offline refresh token | | +| `oauth.invalid` | `authentication_error` | the saved sign-in cannot be read | | +| `oauth.invalid-response` | `invalid_response` | the provider's token response could not be used | | +| `oauth.locked` | `provider_unavailable` | another process holds this sign-in's lock | | +| `oauth.mismatch` | `authentication_error` | the pasted sign-in result belongs to another sign-in | | +| `oauth.moved-rotating` | `authentication_error` | a run with moved folders cannot refresh a sign-in whose refresh token rotates | | +| `oauth.no-response` | `outcome_unknown` | the token request did not finish | | +| `oauth.not-saved` | `configuration_error` | the sign-in cannot be saved or read where it is kept | | +| `oauth.revoke-failed` | `outcome_unknown` | the provider did not confirm the revoke | | +| `oauth.scope-missing` | `permission_error` | the sign-in lacks a permission this command needs | | +| `oauth.timeout` | `timeout` | the sign-in was not finished in time | | +| `oauth.unavailable` | `provider_unavailable` | the provider's token endpoint is unavailable | | +| `office.array-formula` | `validation_error` | the cell is part of an array formula; change it in Excel | | +| `office.bookmark` | `validation_error` | the paragraph holds a bookmark a cross-reference may point at | | +| `office.duplicate-edit` | `validation_error` | the same cell or paragraph is changed twice in one call | | +| `office.file-exists` | `conflict` | a file is there already; create never replaces one, update changes it | | +| `office.formula-cell` | `validation_error` | the cell holds a formula; --replace writes the value over it | | +| `office.implicit-cells` | `validation_error` | the row has cells without addresses, so a cell cannot be added | | +| `office.implicit-rows` | `validation_error` | the sheet has rows without numbers, so a row cannot be added | | +| `office.invalid-cell` | `validation_error` | a cell is not an address like B7 | | +| `office.invalid-sheet-name` | `validation_error` | a new sheet's name is empty, too long, repeated or holds a character Excel refuses | | +| `office.invalid-value` | `validation_error` | a value cannot be written: an infinite number, a cell text too long, an unknown style | | +| `office.last-paragraph` | `validation_error` | the delete would leave the document or a table cell without a paragraph | | +| `office.no-paragraph` | `validation_error` | the document has no paragraph at that index | | +| `office.no-sheet` | `validation_error` | the workbook has no such sheet, or several when none is named | | +| `office.rich-value` | `validation_error` | the cell holds a picture or a linked data type, which the editor does not replace | | +| `office.section-break` | `validation_error` | the paragraph ends a section; deleting it would merge two sections | | +| `office.shared-formula` | `validation_error` | the cell holds a formula other cells share; replacing it would break theirs | | +| `office.table-header` | `validation_error` | the cell is a table's header or total, whose part repeats the text; change it in Excel | | +| `office.tracked-change` | `validation_error` | the paragraph holds a tracked change | | +| `office.unsafe-paragraph` | `validation_error` | the paragraph cannot be edited safely; documents show gives the reason | | +| `office.wrong-format` | `validation_error` | the file is not the Office format the command edits, or its parts cannot be read | | +| `offline.refused` | `permission_error` | this command needs the provider; --offline was given | | +| `order.currency` | `validation_error` | the product is priced in another currency than the order | | +| `order.duplicate` | `validation_error` | the shop's order with this number is already stored; change its status instead | | +| `order.field` | `validation_error` | a field of the order is not valid | | +| `order.line` | `validation_error` | an order keeps at least one line: reject or cancel it instead | | +| `order.line-amount` | `validation_error` | an order line's amount is not its quantity times its unit price | | +| `order.lines` | `validation_error` | the order's lines are not valid | | +| `order.no-line` | `not_found` | the order has no line at that position | | +| `order.not-found` | `not_found` | no stored order of that shop has that number | | +| `order.owner-only` | `permission_error` | only the owner changes a confirmed order's lines | | +| `order.proposed` | `validation_error` | the shop's order with this number already waits for the owner in a findings batch | | +| `order.ref` | `validation_error` | the reference names no order, or a shop's number names more than one | | +| `order.source-url` | `validation_error` | an order's source URL is not an http or https address | | +| `order.status` | `validation_error` | a rejected or deleted order's status does not change | | +| `order.total` | `validation_error` | an order with lines names its currency and totals their sum | | +| `organization.ambiguous` | `validation_error` | more than one organization matches; name the one meant as a reference | | +| `organization.erase-blocked` | `validation_error` | an invoice, order, subscription or a row the organization wrote still names it; change those first, nothing was deleted | | +| `organization.not-found` | `not_found` | no stored organization has that id | | +| `organization.own` | `validation_error` | the organization is one of your own companies and is never deleted | | +| `organization.unnamed` | `validation_error` | a free mailbox names no company; name the organization or the company | | +| `output.choose-fields` | `validation_error` | at a terminal, --json names the fields it prints | | +| `output.conflict` | `validation_error` | two output switches ask for different output | | +| `output.one-object` | `validation_error` | a report is one JSON object; --jsonl streams lists only | | +| `output.unknown-field` | `validation_error` | the answer has no field by that name | | +| `period.ambiguous` | `validation_error` | the period can be read more than one way | | +| `person.erase-blocked` | `validation_error` | an invoice, order, subscription or a row the person wrote still names them; change those first, nothing was deleted | | +| `person.from-required` | `validation_error` | say whom the identity leaves: --from person:, or person:me for the owner | | +| `person.no-doubt` | `not_found` | nothing about that person is in doubt; people links check lists who is | | +| `person.no-identity` | `validation_error` | a person with no identity is not test data; there is nothing to hide | | +| `person.no-owner` | `not_found` | no person is marked as the owner in the store | | +| `person.owner` | `validation_error` | the owner's own person is not test data, and is never deleted | | +| `person.unknown` | `not_found` | the store has no person by that reference; people list gives person: | | +| `picture-reading.agent-missing` | `validation_error` | choose the agent that reads: --agent claude or --agent codex | | +| `picture-reading.failed` | `invalid_response` | the coding agent failed or answered nothing | | +| `picture-reading.not-a-picture` | `validation_error` | the file is not a PNG, JPEG or WebP picture | | +| `picture-reading.off` | `permission_error` | picture reading is never; models picture-reading set request | | +| `picture-reading.owner-only` | `permission_error` | only the owner turns picture reading on, not an agent | | +| `picture-reading.timeout` | `timeout` | the coding agent gave no answer in time | | +| `picture-reading.unavailable` | `configuration_error` | the chosen coding agent is not installed | | +| `picture-reading.unavailable-file` | `not_found` | the picture could not be fetched, or is over the size limit | | +| `pipeline.ambiguous` | `validation_error` | more than one pipeline has that name; name it by its pipeline: reference | | +| `pipeline.duplicate` | `validation_error` | a pipeline of that name and kind is already stored | | +| `pipeline.field` | `validation_error` | a pipeline needs a name and at least one stage, each named once | | +| `pipeline.not-found` | `not_found` | no stored pipeline has that name or reference | | +| `press.owner-hand-only` | `permission_error` | this button decides something for the owner; only a hand presses it | | +| `product.duplicate` | `validation_error` | a product with that code is already stored for that supplier | | +| `product.field` | `validation_error` | a field of the product is not valid | | +| `product.ref` | `validation_error` | the reference names no product | | +| `profile.account-taken` | `conflict` | another profile here already uses this provider account | | +| `profile.busy` | `provider_unavailable` | another sync or write holds this profile's local copy | | +| `profile.locked` | `permission_error` | a profile lock pins this process to its own account | | +| `profile.missing` | `validation_error` | no profile named, and none is picked for the owner; details.profiles lists the ones here | | +| `profile.not-synced` | `not_found` | the profile has no local copy yet; sync it first | | +| `profile.other-account` | `conflict` | this profile's copy was synced from another provider account | | +| `profile.reserved` | `validation_error` | the profile name is a folder every CRM account shares; pick another | | +| `profile.unknown` | `not_found` | no profile by this name on this computer; details.profiles lists the ones here | | +| `profile.wrong-account` | `authentication_error` | the signed-in source account does not match this profile | | +| `proposal.decider-required` | `validation_error` | a decision names who decides: the owner or an agent with a reason | | +| `proposal.ids` | `validation_error` | the proposal ids cannot be read | | +| `proposal.own` | `permission_error` | an agent never decides its own proposal | | +| `proposal.owner-only` | `permission_error` | only the owner decides this proposal | | +| `proposal.reason-required` | `validation_error` | an agent deciding for the owner, or proposing a link, gives a reason | | +| `proposal.unknown-kind` | `not_found` | no registered proposal kind holds this id | | +| `proposal.wrong-state` | `validation_error` | the proposal is not in a state that allows this | | +| `proposals.agent-decisions-off` | `permission_error` | agent decisions are turned off; the owner decides | | +| `provider.failed` | `provider_error` | a read from the provider failed | | +| `provider.usage-limit` | `rate_limited` | the account's usage limit at the provider is reached; wait, do not retry | | +| `push.too-many-files` | `validation_error` | the folder holds more files than one push takes | | +| `push.unreadable` | `validation_error` | the folder to push could not be read | | +| `query.aborted` | `validation_error` | the search was stopped before it finished | | +| `query.bad-value` | `validation_error` | a term's value is not the kind its field takes, such as an id or a number | | +| `query.bare-word` | `validation_error` | a word in the query has no field | `span`, `alternative`, `guide`, `word` | +| `query.conflict` | `validation_error` | two parts of the query contradict each other | | +| `query.empty-window` | `validation_error` | the time window ends before it starts, so no row can fall in it | | +| `query.invalid-ast` | `validation_error` | the query tree is not valid | `span`, `alternative`, `guide` | +| `query.invalid-context` | `validation_error` | the context size is out of range | | +| `query.invalid-date` | `validation_error` | a date in the query cannot be read | `span`, `alternative`, `guide` | +| `query.invalid-duration` | `validation_error` | a duration in the query cannot be read | | +| `query.invalid-escape` | `validation_error` | an escape in the query is not valid | `span`, `alternative`, `guide` | +| `query.invalid-limit` | `validation_error` | the limit is out of range | | +| `query.invalid-number` | `validation_error` | a number in the query cannot be read | `span`, `alternative`, `guide` | +| `query.invalid-reference` | `validation_error` | a reference in the query is not valid | | +| `query.invalid-regex` | `validation_error` | a regular expression in the query is not valid | `span`, `alternative`, `guide` | +| `query.invalid-scope` | `validation_error` | the query selects no account | | +| `query.invalid-size` | `validation_error` | a size in the query cannot be read | | +| `query.invalid-syntax` | `validation_error` | the query cannot be parsed | `span`, `alternative`, `guide` | +| `query.invalid-tag` | `validation_error` | a tag in the query is not valid | | +| `query.invalid-timezone` | `validation_error` | the time zone is not known | `span`, `alternative`, `guide` | +| `query.invalid-topic` | `validation_error` | a topic in the query is not valid | | +| `query.legacy-date-field` | `validation_error` | after: and before: are written date>= and date< | | +| `query.missing-value` | `validation_error` | a field in the query has no value | `span`, `alternative`, `guide` | +| `query.no-match` | `not_found` | no person or chat in the store fits a name in the query | | +| `query.short-text` | `validation_error` | a search by part of a name or a title needs three characters or more | | +| `query.time-limit` | `timeout` | the search took longer than its time limit; the query itself is valid | | +| `query.too-large` | `validation_error` | the query is over one of its limits | `span`, `alternative`, `guide` | +| `query.topic-scope` | `validation_error` | a topic needs its chat in the query | | +| `query.unclosed-literal` | `validation_error` | a quote or bracket in the query is not closed | `span`, `alternative`, `guide` | +| `query.unknown-field` | `validation_error` | a field in the query is not known | `span`, `alternative`, `guide`, `fields` | +| `query.unknown-value` | `validation_error` | a value in the query is not known | `span`, `alternative`, `guide` | +| `query.unsupported-field` | `validation_error` | this list cannot filter by that field | `span`, `alternative`, `guide`, `supported` | +| `query.unsupported-operator` | `validation_error` | this field does not take that operator | `span`, `alternative`, `guide` | +| `query.unsupported-placement` | `validation_error` | this field works only as a required term | `span`, `alternative`, `guide` | +| `query.unsupported-regex` | `validation_error` | that regular expression is not supported | `span`, `alternative`, `guide` | +| `query.unsupported-regex-flags` | `validation_error` | regular expression flags are not supported | `span`, `alternative`, `guide` | +| `query.unsupported-version` | `validation_error` | the query version is not supported | `span`, `alternative`, `guide` | +| `ranking.invalid` | `validation_error` | the ranking is not valid | | +| `reactions.broadcast` | `permission_error` | a channel does not show who reacted to its posts | | +| `reactions.list-hidden` | `permission_error` | the chat does not let its members see who reacted | | +| `read-only.output-outside` | `permission_error` | a read-only process writes files only inside its working folder | | +| `record.ambiguous` | `validation_error` | the record's identifiers point at more than one entity; the owner says which | | +| `record.chat` | `validation_error` | the chat an SMS names is not an imported one: a sync owns it | | +| `record.entity` | `validation_error` | the entity or proposal the record stands for was refused | | +| `record.identifier` | `validation_error` | a free-mail domain names no organization: anyone has an address there | | +| `record.invalid` | `validation_error` | a field of the record is not the kind the entity needs | | +| `record.map-owner-only` | `permission_error` | only the owner says which entity a source record is | | +| `record.map-type` | `validation_error` | a record maps only to an entity of its own type | | +| `record.mapped` | `validation_error` | the record already stands for another entity | | +| `record.moved` | `validation_error` | an SMS stays in its thread: delete it and send it again under a new external_id | | +| `record.not-found` | `validation_error` | the store holds no such record to delete | | +| `record.over-payment` | `validation_error` | the record's settles amounts add up to more than the payment | | +| `record.phone-region` | `validation_error` | a phone without + is read only in the envelope's phone_region; kept as data | | +| `record.provider-not-imported` | `validation_error` | SMS and calls are imported only under an import-only provider, such as phone | | +| `record.reference-not-found` | `validation_error` | a reference in the record's fields is not in the store | | +| `record.relation-ambiguous` | `validation_error` | the record names more than one target for a role that takes one | | +| `record.separated` | `validation_error` | the owner told the one entity these identifiers match apart from them | | +| `record.stale-revision` | `validation_error` | the store holds a newer revision of the record | | +| `ref.malformed` | `validation_error` | the reference has a known kind but not its shape | | +| `ref.unknown-kind` | `validation_error` | the text names no kind of reference | | +| `ref.wrong-account` | `validation_error` | the reference belongs to another account than this profile's | | +| `ref.wrong-kind` | `validation_error` | the reference names another kind of thing than the argument takes | | +| `ref.wrong-provider` | `validation_error` | the reference belongs to another messenger; open it with that CLI | | +| `relationship.engagement-ends` | `validation_error` | only a person's member-of a project takes an engagement level | | +| `relationship.engagement-unknown` | `validation_error` | the engagement level is not none, low, medium or high | | +| `relationship.exists` | `validation_error` | a confirmed relationship already links them | | +| `relationship.invalid` | `validation_error` | a reported relationship joins ends or takes a role the registry refuses | | +| `relationship.reference-unknown` | `validation_error` | a reported relationship names something the store does not hold | | +| `relationship.role-built-in` | `validation_error` | a built-in role stays on its list | | +| `relationship.role-exists` | `validation_error` | the role list holds that role already | | +| `relationship.role-in-use` | `validation_error` | relationships still hold that role; change them first (details.count) | | +| `relationship.role-unknown` | `validation_error` | the role is not one the relationship takes; the message lists them | | +| `remind.hook-failed` | `configuration_error` | the reminder program failed for some events; the next run retries them | | +| `remind.running` | `validation_error` | another events remind is running; this run did nothing | | +| `remind.window` | `validation_error` | --due-within is outside 1m to 1d | | +| `schedule.outside-folder` | `permission_error` | schedule exec runs only a schedule file in the tool's own schedules folder | | +| `search-harder.owner-only` | `permission_error` | only the owner allows search all --harder, not an agent | | +| `search.all-denied` | `permission_error` | the profile denies every kind search all would read | | +| `search.kind` | `validation_error` | the saved search belongs to another kind of search: messages or meetings | | +| `search.no-calendars` | `validation_error` | no calendar of this profile syncs yet, so the provider has nothing to search | | +| `search.offline` | `permission_error` | search --backend server asks the provider; --offline was given | | +| `search.one-backend` | `validation_error` | search answers from one backend at a time: archive or server | | +| `search.server-capped` | `outcome_unknown` | the server found more than one search reads, or a branch was not sent | | +| `search.server-failed` | `provider_unavailable` | the server did not answer a search | | +| `search.server-no-criteria` | `validation_error` | the query has nothing the server can search, so only the store is read | | +| `search.server-not-allowed` | `permission_error` | the profile does not allow messages.server-search | | +| `search.server-options` | `validation_error` | search --backend server takes neither --exact, --cursor nor --newest | | +| `search.server-partial` | `outcome_unknown` | a message the server found was stored without its attachments; the next sync reads it whole | | +| `search.server-rate-limited` | `rate_limited` | the server refused a search as too many requests | | +| `search.server-timeout` | `timeout` | the server did not answer within --server-time | | +| `search.server-unsupported` | `provider_error` | this source's server cannot search | | +| `selection.changed` | `validation_error` | the stored selection changed meanwhile | | +| `selection.invalid` | `validation_error` | the selection is not valid | | +| `selection.out-of-scope` | `permission_error` | the selection reaches outside what this profile may read | | +| `serve.outdated` | `configuration_error` | the store or the installed version is newer than this serve; it stopped so its unit starts the installed one | | +| `session.duplicate` | `conflict` | another profile here already signs in to this account as this user | | +| `session.missing` | `authentication_error` | this profile is not signed in: no saved sign-in or API token | | +| `session.unreadable` | `configuration_error` | the profile's stored secrets cannot be read; sign in again | | +| `sftp.auth-missing` | `configuration_error` | an SFTP connection needs a password or a private key | | +| `sftp.closed` | `validation_error` | the SFTP connection was closed before the operation | | +| `sftp.file-changed` | `validation_error` | the file changed on the server while a stream read it; read it again | | +| `sftp.host-key-mismatch` | `authentication_error` | the SFTP server's host key is not the pinned one | | +| `sftp.host-key-missing` | `configuration_error` | no host key is pinned for the SFTP server | | +| `sftp.key-invalid` | `configuration_error` | the SFTP private key or its passphrase cannot be read | | +| `sftp.library-missing` | `configuration_error` | SFTP needs the ssh2 package in the CLI's dependencies | | +| `sftp.timeout` | `timeout` | the SFTP server did not answer in time | | +| `sftp.too-large` | `validation_error` | the file is larger than the read's byte limit | | +| `sign-in.client-file-invalid` | `configuration_error` | the file is not a Desktop app OAuth client JSON | | +| `sign-in.client-file-open` | `configuration_error` | other users of this computer can read the client file | | +| `sign-in.client-rejected` | `configuration_error` | the provider rejected the OAuth client | | +| `sign-in.secret-without-id` | `configuration_error` | an OAuth client secret is set without its client id | | +| `source-review.dedicated-review` | `validation_error` | decide a source review through the review of memories and facts | | +| `source-review.evidence-required` | `validation_error` | a challenge cites 1–20 references that contradict it | | +| `source-review.not-holding` | `validation_error` | the memory or fact no longer holds, so there is nothing to challenge | | +| `source-review.reason-required` | `validation_error` | a challenge says why in 1–2000 characters | | +| `source-review.suggestion-length` | `validation_error` | a suggestion with a challenge takes 1–2000 characters | | +| `source.changes-too-many` | `invalid_response` | more changed since one sync than a round reads, and the provider does not list changes oldest first | | +| `source.deletions-unchecked` | `permission_error` | the provider refused its deletions; sync --rescan finds them | | +| `source.engine-missing` | `configuration_error` | reading this source needs a reader package that is not installed | | +| `source.needs-sign-in` | `authentication_error` | the page asks for a sign-in; add a private Google document with drive documents add --profiles | | +| `source.no-account` | `invalid_response` | the provider's answer does not name the signed-in account | | +| `source.no-id` | `invalid_response` | a row of the provider's answer has no id where the source manifest says | | +| `source.no-text` | `validation_error` | the source holds no text to keep | | +| `source.token-invalid` | `validation_error` | the change token is not one this source gave | | +| `source.too-large` | `validation_error` | the source is larger than one read takes | | +| `source.unreadable` | `validation_error` | the reader could not read the source | | +| `source.unsupported` | `validation_error` | no reader takes this kind of source | | +| `source.url-redirects` | `provider_error` | the page sent the request on too many times | | +| `source.url-refused` | `validation_error` | the link is not an http or https page on the public internet | | +| `source.url-status` | `provider_error` | the page's server answered with an error status | | +| `source.url-timeout` | `timeout` | the page did not arrive in time | | +| `source.url-unreachable` | `network_error` | the page's server could not be found or reached | | +| `spreadsheet.unreadable` | `validation_error` | the workbook could not be read | | +| `sql.bad-identifier` | `validation_error` | a table or column name is not a plain identifier | | +| `sql.library-missing` | `configuration_error` | this database needs the mysql2 or pg package in the CLI | | +| `ssh.forward-failed` | `network_error` | the SSH server could not reach the address behind it | | +| `ssh.forward-refused` | `permission_error` | the SSH server does not allow forwarding to that address | | +| `stage.answer-invalid` | `validation_error` | the agent's answer to stages suggest is not the JSON stage map it asks for | | +| `stage.base-field` | `validation_error` | a base stage needs a name its set has once and a position within the set | | +| `stage.base-in-use` | `validation_error` | the owner's own deals or leads stand or stood in that base stage | | +| `stage.base-outcome` | `validation_error` | a base set keeps at least one stage of each outcome: open, won and lost | | +| `stage.choice-required` | `validation_error` | more than one stage of the row's pipeline maps to that base stage; move to one of the candidates | | +| `stage.model-agent` | `permission_error` | an agent's run does not send stages to the AI model; it answers the task itself with --dry-run and --text-file | | +| `stage.model-answer-invalid` | `invalid_response` | the AI model's answer to stages suggest is not the stage map | | +| `stage.not-found` | `not_found` | no stored stage has that reference or name | | +| `stage.owner-only` | `permission_error` | only the owner confirms mappings and edits a base set, not an agent | | +| `stage.ref` | `validation_error` | a stage is named by its stage: reference | | +| `stage.unmapped` | `validation_error` | no stage of the row's pipeline maps to that base stage; map one first | | +| `state.invalid` | `configuration_error` | the saved sync state is unreadable or invalid; it is kept, not reset | | +| `state.unreadable` | `configuration_error` | a sync state file cannot be read; move it away and sync again | | +| `stemmer.invalid` | `validation_error` | the stemmer is not valid for that script | | +| `stemmer.newer` | `validation_error` | the stems were built by a newer tool | | +| `stemmer.unknown` | `validation_error` | the store asks for stemmers this tool does not know | | +| `store.changed-during-recovery` | `validation_error` | the store was written to during the recovery, so it was left as it was | | +| `store.damaged` | `configuration_error` | the store file is damaged; store recover says what is lost and recovers it | | +| `store.dry-run` | `conflict` | a dry run of an import holds the store; the read or write waits for it to end | | +| `store.file-damaged` | `validation_error` | the named store file is damaged or not a database | | +| `store.foreign-keys` | `configuration_error` | a migration would break references between rows, so it was not run; the store is whole | | +| `store.in-use` | `validation_error` | a process or a scheduled timer has the store open; stop it, then recover the store | | +| `store.journal-replaced` | `conflict` | another program deleted or replaced the store's journal file while it was open; store recover says what to do | | +| `store.not-writable` | `permission_error` | the message store cannot be written from this process | | +| `store.recovering` | `validation_error` | another recovery of the store is running; wait for it to finish | | +| `store.recovery-failed` | `validation_error` | the recovered store did not pass its check, so the store was left as it was | | +| `store.refused` | `validation_error` | the local store refused the document text | | +| `store.rows-break-checks` | `configuration_error` | the store holds rows the new schema refuses, so it was not migrated; the rows are named | | +| `store.rows-lost` | `configuration_error` | a migration would change how many rows a table holds, so it was not run; the tables and counts are named | | +| `store.sqlite3-missing` | `configuration_error` | recovering the store needs the sqlite3 program, 3.43 or newer, with its .recover command | | +| `store.unknown-columns` | `configuration_error` | a migration would drop columns this store has and this build does not know; nothing was changed | | +| `store.unopenable` | `configuration_error` | the store file cannot be opened at its path; details.path names it | | +| `store.unreadable` | `configuration_error` | the store file's header or schema is damaged, so it cannot be recovered | | +| `store.vector-extension-failed` | `configuration_error` | the sqlite-vec extension did not load; reinstall the CLI | | +| `store.vector-extension-missing` | `configuration_error` | the install has no sqlite-vec extension for this platform; reinstall the CLI | | +| `store.vector-invalid` | `validation_error` | a vector to store had a non-finite value | | +| `subscription.field` | `validation_error` | a field of the subscription is not valid | | +| `subscription.interval` | `validation_error` | an interval is a count and a unit, such as 1-month | | +| `subscription.no-price` | `not_found` | no stored subscription price has that id | | +| `subscription.price` | `validation_error` | a price is never changed: reject it and add a new one, after its subscription | | +| `subscription.ref` | `validation_error` | the reference names no subscription, product or contract for it | | +| `sync.failed` | `provider_error` | the sync failed; the answer comes from what the store already holds | | +| `sync.partial` | `provider_error` | some sources did not sync; the next sync retries them | | +| `tag-review.over-budget` | `validation_error` | the tag review is over its budget | | +| `tag-review.required` | `validation_error` | the tag needs the owner's review first | | +| `tag-review.stale` | `configuration_error` | the tag review changed meanwhile | | +| `tag.invalid` | `validation_error` | the tag is not valid | | +| `task.already-read` | `validation_error` | the message was already read for tasks: a read again only updates and closes tasks unless --open-new | | +| `task.category-unknown` | `validation_error` | the category is not in the task category list | | +| `task.certainty-required` | `validation_error` | an agent closes a task with its certainty, 0 to 1 | | +| `task.claimed` | `validation_error` | someone else holds the task | | +| `task.closed` | `validation_error` | the task is already closed | | +| `task.column` | `validation_error` | the task beside which it moves is in another column than the status asked for | | +| `task.dependency-cycle` | `validation_error` | the task would depend on itself | | +| `task.duplicate-candidates` | `validation_error` | open tasks may be the same job: attach to one, or add it as new | | +| `task.external-id` | `validation_error` | an external id is :, such as avito:4512345678 | | +| `task.is-subtask` | `validation_error` | a subtask moves to another project alone only when it is detached from its parent in the same write | | +| `task.merged` | `validation_error` | the task was merged into another; use that one | | +| `task.no-close-suggestion` | `validation_error` | the task has no agent's close waiting on the owner | | +| `task.not-merged` | `validation_error` | the task was not merged into another | | +| `task.pair-decided` | `permission_error` | the owner already decided the pair; an agent does not change it | | +| `task.source-url` | `validation_error` | a task's source URL is not an http or https address | | +| `task.stale` | `conflict` | the task changed since it was read; read it again | | +| `template.check-failed` | `validation_error` | the template failed its check and was not saved; the message says why | | +| `template.no-editor` | `validation_error` | no editor is set: set VISUAL or EDITOR, or pass the template with --file | | +| `template.no-history` | `validation_error` | the template has no earlier body to put back | | +| `template.no-renderer` | `validation_error` | nothing renders that template key yet, so a template for it cannot be checked | | +| `template.owner-only` | `permission_error` | only the owner changes a message template, not an agent | | +| `template.unknown-key` | `validation_error` | there is no message template by that key | | +| `template.unknown-language` | `validation_error` | cli-core ships no template in that language, so one would never be used | | +| `topic.owner-only` | `permission_error` | only the owner may use this topic | | +| `tracker.field` | `validation_error` | a field of an issue or a comment the tracker's write does not take as given | | +| `tracker.kind-unread` | `permission_error` | the sign-in cannot read this kind of the tracker; the copy has none of it | | +| `tracker.no-record` | `invalid_response` | the tracker answered a write with no record and no error; sync and look | | +| `tracker.reference` | `validation_error` | a team, state, label, project or user no single row of the copy has by that name | | +| `tracker.team-required` | `validation_error` | a new issue needs its team: name one, or sync a copy that holds one | | +| `tracker.unlisted-held` | `validation_error` | a tracker's id list would mark too much deleted, or the sign-in read only part; nothing was | | +| `tracker.write-unsupported` | `validation_error` | the tracker does not take this write, or does not recognise a repeated one | | +| `transaction.field` | `validation_error` | a field of the transaction is not valid | | +| `transaction.no-split` | `not_found` | the transaction has no split at that position | | +| `transaction.payment` | `validation_error` | the payment is not the same money: currency, direction and amount differ | | +| `transaction.ref` | `validation_error` | the reference names no transaction or wallet | | +| `transaction.split` | `validation_error` | the splits come to more than the transaction, or name no category | | +| `transcription.no-key` | `authentication_error` | no OpenAI key is set for transcription | | +| `transcription.quota-exhausted` | `permission_error` | the transcription provider account has no credit or limit left | | +| `transcription.too-large` | `validation_error` | the audio is over the transcription provider's size limit | | +| `upgrade.install-failed` | `provider_error` | the installer failed; the old version stays | | +| `upload.mismatch` | `conflict` | the uploaded file reads back with other content; the local file changed meanwhile | | +| `upload.replace-interrupted` | `conflict` | another file took the path during a replace; the new content is kept | | +| `usage.unknown-command` | `validation_error` | no command by this name; the CLI's help lists them | | +| `usage.unknown-option` | `validation_error` | the command takes no option by this name; its help lists them | | +| `verify.no-id` | `provider_error` | the answer to the sign-in check holds no account id where auth.verify says | | +| `vocabulary.alias-conflict` | `configuration_error` | two vocabulary entries claim one alias | | +| `vocabulary.consolidation-over-budget` | `validation_error` | the selected tag dependencies exceed the preview budget | `table` | +| `vocabulary.over-byte-budget` | `validation_error` | the vocabulary is over its size budget | | +| `vocabulary.over-entry-budget` | `validation_error` | the vocabulary has too many entries | | +| `vocabulary.stale` | `configuration_error` | the vocabulary changed meanwhile | | +| `wallet.field` | `validation_error` | a field of the wallet is not valid | | +| `wallet.number` | `validation_error` | a wallet keeps only the last 4 characters of a number | | +| `wallet.ref` | `validation_error` | the reference names no wallet | | + + diff --git a/docs/storage/schema.md b/docs/storage/schema.md index f728269f2..b368997d3 100644 --- a/docs/storage/schema.md +++ b/docs/storage/schema.md @@ -18,6 +18,8 @@ checks every table and column of a new store against this page. - Booleans without `is_`. Times are epoch milliseconds, integers: they sort and range without a format to agree on. - One search index per corpus: messages, emails, attachments, documents, notes, memories, meetings. - Every foreign key and every polymorphic pair is indexed; listed under each table as *Indexes*. +- Every base table with an integer `id` key is `AUTOINCREMENT` (store version 73): an id is never handed out twice, so an old reference never names another row. +- `CHECK` constraints hold only rules that never change: a JSON column holds valid JSON, a pointer pair is whole or empty, an amount is not negative. Evolving rules stay in triggers. ## Sources @@ -42,6 +44,8 @@ Every integration the owner connects: a messenger account, a mailbox, Zoom, a no *Keys and indexes:* `UNIQUE (provider, external_id)`, `INDEX (organization_id)` +*Checks:* `CHECK ("settings" IS NULL OR json_valid("settings"))` + ### `sync_cursors` Per account, what a sync remembers between runs: a delta marker, when a list was last complete. @@ -100,6 +104,8 @@ Every update a bot account received through the Bot API, kept as it came, so it *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (account_id, received_at DESC)` +*Checks:* `CHECK ("payload" IS NULL OR json_valid("payload"))` + ### `syncs` One run of an integration's sync: what it did and how it ended. @@ -119,6 +125,8 @@ One run of an integration's sync: what it did and how it ended. *Keys and indexes:* `INDEX (account_id)` +*Checks:* `CHECK ("counts" IS NULL OR json_valid("counts"))` + ## People, organizations and bots Humans, the per-source identities they have, the organizations they belong to, and the agents that work here. @@ -163,6 +171,8 @@ A real person, whatever accounts they write from: their identities point here. ` *Keys and indexes:* `UNIQUE (provider, external_id)`, `INDEX (email) WHERE email IS NOT NULL`, `INDEX (id) WHERE name IS NOT NULL AND name_folded IS NULL` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `identity_links` | Column | Type | Constraints | References | Meaning | @@ -208,6 +218,8 @@ Each profile a person was seen with, a row when it differs from the one before; *Keys and indexes:* `INDEX (identity_id, created_at)` +*Checks:* `CHECK ("marks" IS NULL OR json_valid("marks"))` + ### `account_identities` | Column | Type | Constraints | References | Meaning | @@ -267,6 +279,8 @@ A company, team, family or community the owner deals with. Projects, work accoun | `updated_at` | integer | not null | | when this row last changed here | | `deleted_at` | integer | | | gone at the source; sync never hard-deletes | +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `places` A street address as a record of its own: a confirmed `place` mention; later mentions of it start linked. @@ -317,6 +331,8 @@ An AI agent or a script that works here: it registers itself, owns projects and *Keys and indexes:* `INDEX (owner_person_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ## Chats and messages What messengers bring. @@ -356,6 +372,8 @@ A chat, group or channel of one account, with what the messenger last said about *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (account_id, last_message_at DESC)`, `INDEX (id) WHERE title IS NOT NULL AND title_folded IS NULL`, `INDEX (parent_chat_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `chat_members` Who is in a chat, as the account last saw it: a list replaces the chat's membership whole. @@ -435,7 +453,9 @@ A group's size once a day: the messenger's own count and how many members one re | `starred` | integer | | | 1 when the owner starred the message; only this account sees the star | | `delivery` | integer | | | own message: 1 delivered, 2 read; null when no receipt came; only rises | -*Keys and indexes:* `UNIQUE (chat_id, external_id)`, `INDEX (chat_id, sent_at DESC)`, `INDEX (chat_id, sent_at DESC) WHERE starred = 1`, `INDEX (chat_id, reply_to_external_id) WHERE reply_to_external_id IS NOT NULL AND deleted_at IS NULL`, `INDEX (account_id, external_id)`, `INDEX (id) WHERE normalized_text IS NULL AND deleted_at IS NULL`, `INDEX (sender_identity_id)`, `INDEX (thread_root_id)` +*Keys and indexes:* `UNIQUE (chat_id, external_id)`, `INDEX (chat_id, sent_at DESC)`, `INDEX (chat_id, sent_at DESC) WHERE starred = 1`, `INDEX (chat_id, reply_to_external_id) WHERE reply_to_external_id IS NOT NULL AND deleted_at IS NULL`, `INDEX (account_id, external_id)`, `INDEX (id) WHERE normalized_text IS NULL AND deleted_at IS NULL`, `INDEX (chat_id, thread_external_id) WHERE thread_root_id IS NULL AND thread_external_id IS NOT NULL`, `INDEX (sender_identity_id)`, `INDEX (thread_root_id)` + +*Checks:* `CHECK ("reply_to" IS NULL OR json_valid("reply_to"))`, `CHECK ("forward" IS NULL OR json_valid("forward"))`, `CHECK ("reactions" IS NULL OR json_valid("reactions"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK ("mentions" IS NULL OR json_valid("mentions"))` ### `message_revisions` @@ -560,6 +580,8 @@ Each voter's newest vote in a poll, where the messenger sends votes one by one ( *Keys and indexes:* `UNIQUE (chat_id, message_external_id, identity_id)`, `INDEX (identity_id)` +*Checks:* `CHECK ("answers" IS NULL OR json_valid("answers"))` + ### `link_revisions` One row per change of a relationship link (the kinds of `RELATIONS`: `member-of`, `related-to`, `reports-to`, `customer-of`, `partner-of`). Triggers on `links` write it in the changing statement's transaction, so a hard delete keeps its trail; a change of `updated_at` alone writes none. Links of any other kind never write one. No foreign key: the link may be gone. @@ -577,6 +599,8 @@ One row per change of a relationship link (the kinds of `RELATIONS`: `member-of` *Keys and indexes:* `INDEX (link_id, created_at)` +*Checks:* `CHECK ("before" IS NULL OR json_valid("before"))` + ### `chat_revisions` One row per field a chat changed: its external id on a re-key, title, membership, scope, search visibility or parent. A trigger on `chats` writes it in the changing statement's transaction, for every build and writer, and only when the value differs. No foreign keys, so an older build's purge still works; a trigger drops a purged chat's rows. Nothing indexes it for search. @@ -706,6 +730,8 @@ A conversation by mail. *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (id) WHERE subject IS NOT NULL AND subject_folded IS NULL` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `emails` One email. @@ -741,6 +767,8 @@ One email. *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (account_id, sent_at DESC)`, `INDEX (mail_rule_id) WHERE mail_rule_id IS NOT NULL`, `INDEX (email_thread_id)`, `INDEX (from_identity_id)` +*Checks:* `CHECK ("references" IS NULL OR json_valid("references"))`, `CHECK ("headers" IS NULL OR json_valid("headers"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `mail_rules` A mail rule of one account: conditions an email must match, and what to do with it (store in full, as an envelope, skip, tag). @@ -760,6 +788,8 @@ A mail rule of one account: conditions an email must match, and what to do with *Keys and indexes:* `UNIQUE (account_id, conditions)` +*Checks:* `CHECK ("conditions" IS NULL OR json_valid("conditions"))`, `CHECK ("actions" IS NULL OR json_valid("actions"))` + ### `email_recipients` One address on an email. @@ -888,6 +918,8 @@ A file of a message, an email or a meeting, with its extracted text. *Keys and indexes:* `UNIQUE (attachable_type, attachable_id, position)`, `INDEX (name_folded)`, `INDEX (id) WHERE local_path IS NOT NULL AND local_path_folded IS NULL` +*Checks:* `CHECK ("provider_ref" IS NULL OR json_valid("provider_ref"))`, `CHECK ("contact" IS NULL OR json_valid("contact"))` + ### `attachment_words` Full-text index. @@ -990,6 +1022,8 @@ A file or page that stands on its own: a file in a notes folder (md, pdf, docx, *Keys and indexes:* `UNIQUE (account_id, external_id)` +*Checks:* `CHECK ("front_matter" IS NULL OR json_valid("front_matter"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `files` One item in one place, the source record of a document: a file under a local or Obsidian folder, a Drive file or folder. A folder is a row of its own (`kind` folder), so a subtree is a prefix of `path_folded` and a folder has a row for its own facts. `documents` stays the entity every `document:` names. @@ -1019,6 +1053,8 @@ One item in one place, the source record of a document: a file under a local or *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (account_id, path_folded)`, `INDEX (id) WHERE path_folded IS NULL`, `INDEX (parent_id)`, `INDEX (document_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `document_revisions` Earlier versions of a document, each kept before a sync or an import replaced or removed it. @@ -1036,6 +1072,8 @@ Earlier versions of a document, each kept before a sync or an import replaced or *Keys and indexes:* `INDEX (document_id)` +*Checks:* `CHECK ("front_matter" IS NULL OR json_valid("front_matter"))` + ### `document_changes` The change log of synced documents: one row per document a sync or an import added, changed, removed or brought back. It outlives the document row, so it keeps the title and the path. A trigger drops an account's rows with the account. @@ -1109,6 +1147,8 @@ Short text about something: a person, a chat, an event, a document, a task. Comm *Keys and indexes:* `INDEX (notable_type, notable_id)`, `INDEX (author_type, author_id)` +*Checks:* `CHECK (("author_type" IS NULL) = ("author_id" IS NULL))` + ### `note_revisions` Earlier bodies of a note. @@ -1185,6 +1225,8 @@ What an agent concluded: a summary, a daily digest, a preference. Derived and fa *Keys and indexes:* `INDEX (subject_type, subject_id)`, `INDEX (author_type, author_id)`, `INDEX (supersedes_id)`, `INDEX (project_id)` +*Checks:* `CHECK (("subject_type" IS NULL) = ("subject_id" IS NULL))` + ### `memory_words` Word index over memories. @@ -1307,6 +1349,8 @@ One calendar's copy of an event, a series or one occurrence of a series: the sou *Keys and indexes:* `UNIQUE (calendar_id, external_id)`, `UNIQUE (series_entry_id, original_starts_at)`, `INDEX (calendar_id, starts_at)`, `INDEX (ical_uid) WHERE ical_uid IS NOT NULL`, `INDEX (join_key) WHERE join_key IS NOT NULL`, `INDEX (calendar_id, series_external_id) WHERE series_external_id IS NOT NULL`, `INDEX (event_id)`, `INDEX (event_series_id)`, `INDEX (event_type, event_id)`, `INDEX (organizer_identity_id)` +*Checks:* `CHECK ("recurrence" IS NULL OR json_valid("recurrence"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `calendar_entry_revisions` A calendar entry's tracked fields as they were before a change: a moved meeting keeps its old time, a series shortened by "this and following" its old rule. @@ -1436,6 +1480,8 @@ A provider's recurring or scheduled meeting. *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (event_series_id)`, `INDEX (host_identity_id)` +*Checks:* `CHECK ("recurrence" IS NULL OR json_valid("recurrence"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meetings` One occurrence: it happened once, at one time. @@ -1468,6 +1514,8 @@ One occurrence: it happened once, at one time. *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (join_key) WHERE join_key IS NOT NULL`, `INDEX (id) WHERE join_url IS NOT NULL AND join_key IS NULL`, `INDEX (account_id, started_at DESC)`, `INDEX (account_id, title_folded)`, `INDEX (id) WHERE title IS NOT NULL AND title_folded IS NULL`, `INDEX (meeting_series_id)`, `INDEX (event_id)`, `INDEX (host_identity_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_participants` One person in one meeting, as that meeting saw them; the name and email stay with this meeting. @@ -1497,6 +1545,8 @@ names, and an absent stable identity key is rejected rather than guessed from a *Keys and indexes:* `UNIQUE (meeting_id, identity_id)`, `INDEX (identity_id)` +*Checks:* `CHECK ("sessions" IS NULL OR json_valid("sessions"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_transcripts` One transcript of a meeting: Zoom's, a bot's, or a corrected version, which supersedes the old one. @@ -1518,6 +1568,8 @@ One transcript of a meeting: Zoom's, a bot's, or a corrected version, which supe *Keys and indexes:* `INDEX (meeting_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_transcript_rows` One row of a transcript (a WebVTT cue): who spoke, when, and what they said. @@ -1538,6 +1590,8 @@ One row of a transcript (a WebVTT cue): who spoke, when, and what they said. *Keys and indexes:* `UNIQUE (meeting_transcript_id, position)`, `INDEX (speaker_participant_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_chat_messages` The in-meeting chat. @@ -1559,6 +1613,8 @@ The in-meeting chat. *Keys and indexes:* `UNIQUE (meeting_id, external_id) WHERE external_id IS NOT NULL`, `INDEX (meeting_id)`, `INDEX (sender_participant_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_summaries` A summary of a meeting, from the provider's AI, a bot, the owner or an LLM run here. @@ -1582,6 +1638,8 @@ A summary of a meeting, from the provider's AI, a bot, the owner or an LLM run h *Keys and indexes:* `UNIQUE (meeting_id, source)` +*Checks:* `CHECK ("sections" IS NULL OR json_valid("sections"))`, `CHECK ("next_steps" IS NULL OR json_valid("next_steps"))`, `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `meeting_words` Word index over transcript rows, meeting chat and summaries. @@ -1659,6 +1717,8 @@ A place for tasks, with the short key their ids start with (`MEET-12`). *Keys and indexes:* `INDEX (name_folded)`, `INDEX (id) WHERE name_folded IS NULL`, `INDEX (organization_id)`, `INDEX (account_id)`, `INDEX (owner_type, owner_id)` +*Checks:* `CHECK (("owner_type" IS NULL) = ("owner_id" IS NULL))` + ### `tasks` A task or ticket, for people and agents alike. Everything it concerns — people, messages, emails, documents, meetings — is a `links` row; its tags are taggings; its comments are notes. @@ -1716,6 +1776,8 @@ A task or ticket, for people and agents alike. Everything it concerns — people *Keys and indexes:* `UNIQUE (project_id, number)`, `INDEX (title_folded)`, `INDEX (id) WHERE close_reason IS NOT NULL AND close_reason_folded IS NULL`, `INDEX (project_id, status, due_at)`, `INDEX (project_id, status, next_check_at)`, `INDEX (project_id, source_locator)`, `INDEX (source_group)`, `INDEX (provider, external_id) WHERE external_id IS NOT NULL`, `INDEX (parent_id)`, `INDEX (closed_by_type, closed_by_id)`, `INDEX (author_type, author_id)`, `INDEX (close_suggested_by_type, close_suggested_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("closed_by_type" IS NULL) = ("closed_by_id" IS NULL))`, `CHECK (("close_suggested_by_type" IS NULL) = ("close_suggested_by_id" IS NULL))` + ### `task_key_counters` The last number given out per key prefix of a task found in a message (`Q`, `REQ`, `M`, `PR`). @@ -1757,6 +1819,8 @@ The history of a task: created, status changed, assigned, due date moved. *Keys and indexes:* `INDEX (task_id)`, `INDEX (actor_type, actor_id)` +*Checks:* `CHECK ("changes" IS NULL OR json_valid("changes"))`, `CHECK (("actor_type" IS NULL) = ("actor_id" IS NULL))` + ### `task_pairs` Two tasks that may be one job, and what was decided about them: the review list the duplicate check leaves, and every merge, rejection, `--into` and `--new` as a labelled pair. A merge never deletes; `tasks unmerge` undoes one. @@ -1780,6 +1844,8 @@ Two tasks that may be one job, and what was decided about them: the review list *Keys and indexes:* `UNIQUE (task_id, other_id)`, `INDEX (decision, created_at)`, `INDEX (other_id)`, `INDEX (decided_by_type, decided_by_id)` +*Checks:* `CHECK ("levels" IS NULL OR json_valid("levels"))`, `CHECK ("reasons" IS NULL OR json_valid("reasons"))`, `CHECK (("decided_by_type" IS NULL) = ("decided_by_id" IS NULL))` + ### `task_words` Word index over task titles and descriptions, digit groups joined. @@ -1830,6 +1896,8 @@ Replaced by `facts` (a decision is a fact of type `decision`) in store version 2 *Keys and indexes:* `INDEX (project_id)`, `INDEX (supersedes_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))` + ### `facts` What happened, as its evidence shows: a fact, a statement, a question, a decision or a promise; money is `payments` and `invoices`, and triggers refuse a `payment` fact. Its evidence is `links` of kind `evidence`; a question's answer is a `links` row of kind `answered-by`. A payment's amount, currency, direction, due date and state are in `metadata.payment`. Replaces `decisions`, which stays empty. @@ -1859,6 +1927,8 @@ What happened, as its evidence shows: a fact, a statement, a question, a decisio *Keys and indexes:* `INDEX (project_id)`, `INDEX (subject_type, subject_id)`, `INDEX (supersedes_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("subject_type" IS NULL) = ("subject_id" IS NULL))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))` + ### `fact_removals` One row per fact removed: that it was removed, by whom, when and why. Never the fact's text or value: removing a fact forgets it, and this log keeps only the removal. Append-only. @@ -1914,6 +1984,8 @@ An invoice the owner issued or received. Its lines are `invoice_lines` and its t *Keys and indexes:* `INDEX (issuer_type, issuer_id)`, `INDEX (counterparty_type, counterparty_id)`, `INDEX (project_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)`, `INDEX (contract_id)`, `INDEX (subscription_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("issuer_type" IS NULL) = ("issuer_id" IS NULL))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))`, `CHECK ("total" IS NULL OR "total" >= 0)` + ### `invoice_lines` One line of an invoice, in its currency. @@ -1933,6 +2005,8 @@ One line of an invoice, in its currency. *Keys and indexes:* `UNIQUE (invoice_id, position)`, `INDEX (catalog_item_id)` +*Checks:* `CHECK ("amount" IS NULL OR "amount" >= 0)`, `CHECK ("unit_price" IS NULL OR "unit_price" >= 0)` + ### `payments` Money that moved to or from the owner. A refund is a payment the other way with `refund_of`, allocated only to an invoice its payment is allocated to; paid is net of confirmed refunds. @@ -1966,6 +2040,8 @@ Money that moved to or from the owner. A refund is a payment the other way with *Keys and indexes:* `INDEX (payer_type, payer_id)`, `INDEX (payee_type, payee_id)`, `INDEX (project_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)`, `INDEX (refund_of)`, `INDEX (subscription_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("payer_type" IS NULL) = ("payer_id" IS NULL))`, `CHECK (("payee_type" IS NULL) = ("payee_id" IS NULL))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))` + ### `payment_allocations` How much of a payment settles an invoice. A payment's allocations never exceed it, an invoice's never exceed its total, and both sides share one currency (triggers refuse the rest). Only a confirmed payment's allocations count towards the invoice's status. @@ -2023,6 +2099,8 @@ An order the owner placed with a shop or a supplier, or took from a client: for *Keys and indexes:* `INDEX (customer_type, customer_id)`, `INDEX (supplier_type, supplier_id)`, `INDEX (invoice_id)`, `INDEX (payment_id)`, `INDEX (project_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)`, `INDEX (contract_id)`, `INDEX (deal_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("supplier_type" IS NULL) = ("supplier_id" IS NULL))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))`, `CHECK ("total" IS NULL OR "total" >= 0)` + ## Deals The owner's sales pipelines and the deals in them, with the expected amount in exact minor units. A deal's stage and its status (open, won, lost) are kept apart. @@ -2096,6 +2174,8 @@ A deal (`deal:`): what the owner hopes to sell, to whom, where it stands in *Keys and indexes:* `UNIQUE (account_id, external_id) WHERE account_id IS NOT NULL AND external_id IS NOT NULL`, `INDEX (organization_id)`, `INDEX (project_id)`, `INDEX (stage_id)`, `INDEX (author_type, author_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK ("amount" IS NULL OR "amount" >= 0)` + ### `leads` A lead (`lead:`): a first contact in a lead pipeline, before it is a deal. People on it are `links` as on a deal. @@ -2127,6 +2207,8 @@ A lead (`lead:`): a first contact in a lead pipeline, before it is a deal. P *Keys and indexes:* `UNIQUE (account_id, external_id) WHERE account_id IS NOT NULL AND external_id IS NOT NULL`, `INDEX (organization_id)`, `INDEX (project_id)`, `INDEX (stage_id)`, `INDEX (deal_id)`, `INDEX (author_type, author_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK ("amount" IS NULL OR "amount" >= 0)` + ### `pipeline_stage_changes` Each stage a deal or a lead entered and when, written by triggers on `deals` and `leads` (a new row enters its first stage), so conversion between stages can be counted. @@ -2165,6 +2247,8 @@ A CRM account's own fields on its deals, leads, contacts or companies, as its sy *Keys and indexes:* `UNIQUE (account_id, kind, code)` +*Checks:* `CHECK ("options" IS NULL OR json_valid("options"))` + ### `crm_files` A file of a CRM deal, lead, contact or company that the owner downloaded, with its extracted text. Never a download link: the CRM is asked for a fresh one each time. Only CRM code reads it, under the copy's viewer rule. @@ -2236,6 +2320,8 @@ What the owner or a supplier sells: a product or a service, with its price. Writ *Keys and indexes:* `UNIQUE (supplier_type, supplier_id, sku) WHERE supplier_id IS NOT NULL AND sku IS NOT NULL AND deleted_at IS NULL`, `UNIQUE (sku) WHERE supplier_id IS NULL AND sku IS NOT NULL AND deleted_at IS NULL`, `INDEX (name_folded)`, `INDEX (author_type, author_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("supplier_type" IS NULL) = ("supplier_id" IS NULL))`, `CHECK ("unit_price" IS NULL OR "unit_price" >= 0)` + ### `order_lines` One line of an order, in its currency. An order with lines totals their sum; lines change only while the order is proposed (by its author) or by the owner. @@ -2255,6 +2341,8 @@ One line of an order, in its currency. An order with lines totals their sum; lin *Keys and indexes:* `UNIQUE (order_id, position)`, `INDEX (catalog_item_id)` +*Checks:* `CHECK ("amount" IS NULL OR "amount" >= 0)`, `CHECK ("unit_price" IS NULL OR "unit_price" >= 0)` + ### `contracts` A contract the owner works under. Its parties are relationships with a role and its document an `attached` link. One with a value from an agent or an import is a proposal; one without a value is written confirmed, with `confirmed_by` null: nobody decided it, and `author` says who wrote it. @@ -2292,6 +2380,8 @@ A contract the owner works under. Its parties are relationships with a role and *Keys and indexes:* `INDEX (project_id)`, `INDEX (deal_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))`, `CHECK ("value" IS NULL OR "value" >= 0)` + ### `subscriptions` A subscription the owner bills (receivable) or pays (payable): one supplier, one customer, an interval and its dates. Its prices are `subscription_prices`, each a row of its own. @@ -2330,6 +2420,8 @@ A subscription the owner bills (receivable) or pays (payable): one supplier, one *Keys and indexes:* `INDEX (supplier_type, supplier_id)`, `INDEX (customer_type, customer_id)`, `INDEX (catalog_item_id)`, `INDEX (contract_id)`, `INDEX (project_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))` + ### `subscription_prices` A subscription's price from a day on, never overwritten: a correction is a rejection and a new row. The current price is the confirmed row with the latest `effective_from` up to today. @@ -2354,6 +2446,8 @@ A subscription's price from a day on, never overwritten: a correction is a rejec *Keys and indexes:* `UNIQUE (subscription_id, effective_from) WHERE review <> 'rejected'`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))`, `CHECK ("amount" IS NULL OR "amount" >= 0)` + ### `financial_accounts` A bank account, card, cash box or wallet (`wallet:`), in one currency: a multi-currency bank account is one row per currency. Its balance is computed from its transactions, never stored; only the owner sets the opening balance. @@ -2383,6 +2477,8 @@ A bank account, card, cash box or wallet (`wallet:`), in one currency: a mul *Keys and indexes:* `INDEX (name_folded)`, `INDEX (holder_type, holder_id)`, `INDEX (author_type, author_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("holder_type" IS NULL) = ("holder_id" IS NULL))` + ### `financial_transactions` What a statement says moved on a financial account (`transaction:`). A payment is the settlement between parties; the two meet only through `payment_id`, of the same currency, direction and amount. @@ -2418,6 +2514,8 @@ What a statement says moved on a financial account (`transaction:`). A payme *Keys and indexes:* `INDEX (financial_account_id, booked_date)`, `UNIQUE (payment_id) WHERE payment_id IS NOT NULL AND deleted_at IS NULL`, `INDEX (counterparty_type, counterparty_id)`, `INDEX (project_id)`, `INDEX (author_type, author_id)`, `INDEX (confirmed_by_type, confirmed_by_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))`, `CHECK (("counterparty_type" IS NULL) = ("counterparty_id" IS NULL))`, `CHECK (("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL))` + ### `transaction_splits` A part of a transaction under a category. The splits never exceed the transaction's amount; the rest is uncategorized. @@ -2549,6 +2647,8 @@ What a source said about one of its records (a payment row of a sheet, a deal of *Keys and indexes:* `UNIQUE (account_id, type, external_id)`, `INDEX (account_id, batch_id)`, `INDEX (entity_type, entity_id)` +*Checks:* `CHECK ("fields" IS NULL OR json_valid("fields"))`, `CHECK (("entity_type" IS NULL) = ("entity_id" IS NULL))` + ### `record_relations` A record's reference to another record of the same account. A target not yet imported stays unresolved until it arrives. @@ -2599,6 +2699,8 @@ Something an agent wants done outside the store — reply, send, delete, ban, mu *Keys and indexes:* `INDEX (status, created_at)`, `INDEX (account_id)`, `INDEX (target_type, target_id)`, `INDEX (proposed_by_type, proposed_by_id)`, `INDEX (decided_by_type, decided_by_id)` +*Checks:* `CHECK ("payload" IS NULL OR json_valid("payload"))`, `CHECK ("result" IS NULL OR json_valid("result"))`, `CHECK (("target_type" IS NULL) = ("target_id" IS NULL))`, `CHECK (("decided_by_type" IS NULL) = ("decided_by_id" IS NULL))` + ### `agent_actions` Every tool an agent called through the CLIs or MCP: who, which tool, at what access tier, on what. The audit trail of what agents did. @@ -2620,6 +2722,8 @@ Every tool an agent called through the CLIs or MCP: who, which tool, at what acc *Keys and indexes:* `INDEX (started_at DESC)`, `INDEX (actor_type, actor_id)`, `INDEX (target_type, target_id)` +*Checks:* `CHECK (("target_type" IS NULL) = ("target_id" IS NULL))` + ## Tags, links and saved searches Polymorphic: `_type` text + `_id` integer. @@ -2681,6 +2785,8 @@ Every connection between two things that no column holds. Kinds: `blocked-by` (a *Keys and indexes:* `INDEX (target_folded) WHERE to_id IS NULL`, `UNIQUE (kind, from_type, from_id, to_type, to_id, ifnull(anchor, ''), ifnull(role, ''), ifnull(account_id, 0)) WHERE kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL`, `INDEX (from_type, from_id)`, `INDEX (to_type, to_id)` +*Checks:* `CHECK ("metadata" IS NULL OR json_valid("metadata"))` + ### `searches` Every run of `search messages` and `stats messages show`, with the parameters as the caller gave them — never a message or a result. A row with a name is a saved search; an identical unnamed run counts on its row. @@ -2701,6 +2807,8 @@ Every run of `search messages` and `stats messages show`, with the parameters as *Keys and indexes:* `UNIQUE (command, params) WHERE name IS NULL`, `INDEX (last_run_at DESC)` +*Checks:* `CHECK ("params" IS NULL OR json_valid("params"))` + ### `taggings` One tag on one thing. @@ -2718,7 +2826,9 @@ One tag on one thing. | `created_at` | integer | not null | | when this row was saved here | | `updated_at` | integer | not null | | when this row last changed here | -*Keys and indexes:* `UNIQUE (tag_id, taggable_type, taggable_id)`, `UNIQUE (taggable_type, taggable_id) WHERE main = 1`, `INDEX (author_type, author_id)` +*Keys and indexes:* `UNIQUE (tag_id, taggable_type, taggable_id)`, `UNIQUE (taggable_type, taggable_id) WHERE main = 1`, `INDEX (taggable_type, taggable_id)`, `INDEX (author_type, author_id)` + +*Checks:* `CHECK (("author_type" IS NULL) = ("author_id" IS NULL))` ### `tag_redirects` @@ -2754,6 +2864,8 @@ Immutable text-free receipts for owner-reviewed tag consolidation. IDs, hashes a *Keys and indexes:* `INDEX (source_id)`, `INDEX (survivor_id)`, `INDEX (actor_type, actor_id)` +*Checks:* `CHECK ("source_member_ids" IS NULL OR json_valid("source_member_ids"))`, `CHECK ("survivor_member_ids" IS NULL OR json_valid("survivor_member_ids"))`, `CHECK ("counts" IS NULL OR json_valid("counts"))` + ### `entity_link_events` Every change of the entity a source record belongs to — a calendar entry or Zoom meeting to its event, a file to its document — as `identity_link_events` records it for contacts. @@ -2794,6 +2906,8 @@ The owner's review list: a source record with two or more equally good entities, *Keys and indexes:* `UNIQUE (linkable_type, linkable_id, entity_type)`, `INDEX (status, created_at)` +*Checks:* `CHECK ("candidates" IS NULL OR json_valid("candidates"))` + ## Chunks, embeddings and search state Derived: can be rebuilt from the tables above. Every long text is cut into `chunks`; each chunk's text has one row in `embeddings`. @@ -3055,6 +3169,8 @@ One team, user, workflow state, label, project, issue or comment of an issue tra *Keys and indexes:* `UNIQUE (account_id, kind, external_id)`, `INDEX (account_id, kind, parent_id)` +*Checks:* `CHECK ("data" IS NULL OR json_valid("data"))` + ### `tracker_item_words` Word index over a tracker item's title and text, rowid = `tracker_items.id`. @@ -3105,6 +3221,8 @@ A user of a content source who writes posts. Joined to a person by exact e-mail *Keys and indexes:* `UNIQUE (account_id, external_id)` +*Checks:* `CHECK ("data" IS NULL OR json_valid("data"))` + ### `content_terms` A tag or category of a content source, kept with its own id for writes; a post is tagged with the shared tag of its slug or name. @@ -3126,6 +3244,8 @@ A tag or category of a content source, kept with its own id for writes; a post i *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (tag_id)` +*Checks:* `CHECK ("data" IS NULL OR json_valid("data"))` + ### `content_posts` A post or page of a blog, or a social post, as last synced or written, with its text as Markdown. @@ -3154,6 +3274,8 @@ A post or page of a blog, or a social post, as last synced or written, with its *Keys and indexes:* `UNIQUE (account_id, external_id)`, `INDEX (account_id, status)`, `INDEX (account_id, published_at)` +*Checks:* `CHECK ("data" IS NULL OR json_valid("data"))` + ### `content_post_revisions` What a sync or a write replaced in a post, and a post the source deleted, kept before the change: the local versions of a post. @@ -3190,6 +3312,8 @@ One reading of a post's numbers; each reading is a new row, never an overwrite. *Keys and indexes:* `INDEX (post_id, at)` +*Checks:* `CHECK ("raw" IS NULL OR json_valid("raw"))` + ### `content_post_words` Word index over a post's title and text, rowid = `content_posts.id`. diff --git a/drizzle/20261123230507_version-73-autoincrement/migration.sql b/drizzle/20261123230507_version-73-autoincrement/migration.sql new file mode 100644 index 000000000..e4c965775 --- /dev/null +++ b/drizzle/20261123230507_version-73-autoincrement/migration.sql @@ -0,0 +1,2558 @@ +CREATE TABLE `__new_accounts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `provider` text NOT NULL, + `external_id` text NOT NULL, + `name` text, + `created_at` integer NOT NULL, + `settings` text, + `status` text, + `updated_at` integer NOT NULL, + `scope` text DEFAULT 'personal' NOT NULL, + `organization_id` integer, + CONSTRAINT `fk_accounts_organization_id_organizations_id_fk` FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`), + CONSTRAINT `accounts_provider_external_id_unique` UNIQUE(`provider`,`external_id`), + CONSTRAINT "accounts_settings_json" CHECK("settings" IS NULL OR json_valid("settings")) +); +--> statement-breakpoint +INSERT INTO `__new_accounts`(`id`, `provider`, `external_id`, `name`, `created_at`, `settings`, `status`, `updated_at`, `scope`, `organization_id`) SELECT `id`, `provider`, `external_id`, `name`, `created_at`, `settings`, `status`, `updated_at`, `scope`, `organization_id` FROM `accounts`;--> statement-breakpoint +DROP TABLE `accounts`;--> statement-breakpoint +ALTER TABLE `__new_accounts` RENAME TO `accounts`;--> statement-breakpoint +CREATE TABLE `__new_agent_actions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `actor_type` text NOT NULL, + `actor_id` integer NOT NULL, + `tool` text NOT NULL, + `tier` text NOT NULL, + `target_type` text, + `target_id` integer, + `status` text NOT NULL, + `error` text, + `started_at` integer NOT NULL, + `finished_at` integer, + `created_at` integer NOT NULL, + CONSTRAINT "agent_actions_target_pair" CHECK(("target_type" IS NULL) = ("target_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_agent_actions`(`id`, `actor_type`, `actor_id`, `tool`, `tier`, `target_type`, `target_id`, `status`, `error`, `started_at`, `finished_at`, `created_at`) SELECT `id`, `actor_type`, `actor_id`, `tool`, `tier`, `target_type`, `target_id`, `status`, `error`, `started_at`, `finished_at`, `created_at` FROM `agent_actions`;--> statement-breakpoint +DROP TABLE `agent_actions`;--> statement-breakpoint +ALTER TABLE `__new_agent_actions` RENAME TO `agent_actions`;--> statement-breakpoint +CREATE TABLE `__new_attachments` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `attachable_type` text NOT NULL, + `attachable_id` integer NOT NULL, + `position` integer NOT NULL, + `kind` text NOT NULL, + `mime` text, + `name` text, + `title` text, + `url` text, + `size` integer, + `width` integer, + `height` integer, + `duration` real, + `provider_ref` text, + `local_path` text, + `text` text, + `normalized_text` text, + `extraction` text, + `extractor` text, + `extraction_error` text, + `content_sha256` text, + `extracted_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `name_folded` text, + `local_path_folded` text, + `contact` text, + CONSTRAINT `attachments_attachable_type_attachable_id_position_unique` UNIQUE(`attachable_type`,`attachable_id`,`position`), + CONSTRAINT "attachments_provider_ref_json" CHECK("provider_ref" IS NULL OR json_valid("provider_ref")), + CONSTRAINT "attachments_contact_json" CHECK("contact" IS NULL OR json_valid("contact")) +); +--> statement-breakpoint +INSERT INTO `__new_attachments`(`id`, `attachable_type`, `attachable_id`, `position`, `kind`, `mime`, `name`, `title`, `url`, `size`, `width`, `height`, `duration`, `provider_ref`, `local_path`, `text`, `normalized_text`, `extraction`, `extractor`, `extraction_error`, `content_sha256`, `extracted_at`, `created_at`, `updated_at`, `name_folded`, `local_path_folded`, `contact`) SELECT `id`, `attachable_type`, `attachable_id`, `position`, `kind`, `mime`, `name`, `title`, `url`, `size`, `width`, `height`, `duration`, `provider_ref`, `local_path`, `text`, `normalized_text`, `extraction`, `extractor`, `extraction_error`, `content_sha256`, `extracted_at`, `created_at`, `updated_at`, `name_folded`, `local_path_folded`, `contact` FROM `attachments`;--> statement-breakpoint +DROP TABLE `attachments`;--> statement-breakpoint +ALTER TABLE `__new_attachments` RENAME TO `attachments`;--> statement-breakpoint +CREATE TABLE `__new_bot_updates` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `payload` text NOT NULL, + `received_at` integer NOT NULL, + `handled_at` integer, + `error` text, + `replayed_at` integer, + `created_at` integer NOT NULL, + CONSTRAINT `fk_bot_updates_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `bot_updates_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "bot_updates_payload_json" CHECK("payload" IS NULL OR json_valid("payload")) +); +--> statement-breakpoint +INSERT INTO `__new_bot_updates`(`id`, `account_id`, `external_id`, `kind`, `payload`, `received_at`, `handled_at`, `error`, `replayed_at`, `created_at`) SELECT `id`, `account_id`, `external_id`, `kind`, `payload`, `received_at`, `handled_at`, `error`, `replayed_at`, `created_at` FROM `bot_updates`;--> statement-breakpoint +DROP TABLE `bot_updates`;--> statement-breakpoint +ALTER TABLE `__new_bot_updates` RENAME TO `bot_updates`;--> statement-breakpoint +CREATE TABLE `__new_bots` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL UNIQUE, + `kind` text NOT NULL, + `description` text, + `owner_person_id` integer, + `model` text, + `token_digest` text, + `last_seen_at` integer, + `disabled_at` integer, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_bots_owner_person_id_persons_id_fk` FOREIGN KEY (`owner_person_id`) REFERENCES `persons`(`id`), + CONSTRAINT "bots_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_bots`(`id`, `name`, `kind`, `description`, `owner_person_id`, `model`, `token_digest`, `last_seen_at`, `disabled_at`, `metadata`, `created_at`, `updated_at`) SELECT `id`, `name`, `kind`, `description`, `owner_person_id`, `model`, `token_digest`, `last_seen_at`, `disabled_at`, `metadata`, `created_at`, `updated_at` FROM `bots`;--> statement-breakpoint +DROP TABLE `bots`;--> statement-breakpoint +ALTER TABLE `__new_bots` RENAME TO `bots`;--> statement-breakpoint +CREATE TABLE `__new_calendar_entries` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `calendar_id` integer NOT NULL, + `kind` text NOT NULL, + `series_entry_id` integer, + `event_id` integer, + `event_series_id` integer, + `external_id` text NOT NULL, + `ical_uid` text, + `original_starts_at` integer, + `exception` integer NOT NULL, + `status` text NOT NULL, + `title` text, + `description` text, + `location` text, + `starts_at` integer, + `ends_at` integer, + `all_day` integer NOT NULL, + `start_date` text, + `end_date` text, + `timezone` text, + `recurrence` text, + `recurrence_ends_at` integer, + `event_type` text, + `transparency` text, + `visibility` text, + `own_response` text, + `organizer_identity_id` integer, + `join_url` text, + `join_key` text, + `conference` text, + `url` text, + `sequence` integer, + `etag` text, + `external_updated_at` integer, + `metadata` text, + `seen_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `series_external_id` text, + CONSTRAINT `fk_calendar_entries_calendar_id_calendars_id_fk` FOREIGN KEY (`calendar_id`) REFERENCES `calendars`(`id`), + CONSTRAINT `fk_calendar_entries_series_entry_id_calendar_entries_id_fk` FOREIGN KEY (`series_entry_id`) REFERENCES `calendar_entries`(`id`), + CONSTRAINT `fk_calendar_entries_event_id_events_id_fk` FOREIGN KEY (`event_id`) REFERENCES `events`(`id`), + CONSTRAINT `fk_calendar_entries_event_series_id_event_series_id_fk` FOREIGN KEY (`event_series_id`) REFERENCES `event_series`(`id`), + CONSTRAINT `fk_calendar_entries_organizer_identity_id_identities_id_fk` FOREIGN KEY (`organizer_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `calendar_entries_calendar_id_external_id_unique` UNIQUE(`calendar_id`,`external_id`), + CONSTRAINT `calendar_entries_series_entry_id_original_starts_at_unique` UNIQUE(`series_entry_id`,`original_starts_at`), + CONSTRAINT "calendar_entries_recurrence_json" CHECK("recurrence" IS NULL OR json_valid("recurrence")), + CONSTRAINT "calendar_entries_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_calendar_entries`(`id`, `calendar_id`, `kind`, `series_entry_id`, `event_id`, `event_series_id`, `external_id`, `ical_uid`, `original_starts_at`, `exception`, `status`, `title`, `description`, `location`, `starts_at`, `ends_at`, `all_day`, `start_date`, `end_date`, `timezone`, `recurrence`, `recurrence_ends_at`, `event_type`, `transparency`, `visibility`, `own_response`, `organizer_identity_id`, `join_url`, `join_key`, `conference`, `url`, `sequence`, `etag`, `external_updated_at`, `metadata`, `seen_at`, `created_at`, `updated_at`, `deleted_at`, `series_external_id`) SELECT `id`, `calendar_id`, `kind`, `series_entry_id`, `event_id`, `event_series_id`, `external_id`, `ical_uid`, `original_starts_at`, `exception`, `status`, `title`, `description`, `location`, `starts_at`, `ends_at`, `all_day`, `start_date`, `end_date`, `timezone`, `recurrence`, `recurrence_ends_at`, `event_type`, `transparency`, `visibility`, `own_response`, `organizer_identity_id`, `join_url`, `join_key`, `conference`, `url`, `sequence`, `etag`, `external_updated_at`, `metadata`, `seen_at`, `created_at`, `updated_at`, `deleted_at`, `series_external_id` FROM `calendar_entries`;--> statement-breakpoint +DROP TABLE `calendar_entries`;--> statement-breakpoint +ALTER TABLE `__new_calendar_entries` RENAME TO `calendar_entries`;--> statement-breakpoint +CREATE TABLE `__new_catalog_items` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `kind` text NOT NULL, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `sku` text, + `supplier_type` text, + `supplier_id` integer, + `unit` text, + `unit_price` integer, + `currency` text, + `description` text, + `archived_date` text, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT "catalog_items_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "catalog_items_supplier_pair" CHECK(("supplier_type" IS NULL) = ("supplier_id" IS NULL)), + CONSTRAINT "catalog_items_unit_price_not_negative" CHECK("unit_price" IS NULL OR "unit_price" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_catalog_items`(`id`, `kind`, `name`, `name_folded`, `sku`, `supplier_type`, `supplier_id`, `unit`, `unit_price`, `currency`, `description`, `archived_date`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `kind`, `name`, `name_folded`, `sku`, `supplier_type`, `supplier_id`, `unit`, `unit_price`, `currency`, `description`, `archived_date`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `catalog_items`;--> statement-breakpoint +DROP TABLE `catalog_items`;--> statement-breakpoint +ALTER TABLE `__new_catalog_items` RENAME TO `catalog_items`;--> statement-breakpoint +CREATE TABLE `__new_chats` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `title` text, + `unread_count` integer, + `last_message_at` integer, + `participants_count` integer, + `metadata` text, + `updated_at` integer NOT NULL, + `username` text, + `membership_state` text, + `searchable` integer DEFAULT 1 NOT NULL, + `message_count` integer DEFAULT 0 NOT NULL, + `members_tracked_at` integer, + `description` text, + `details_fetched_at` integer, + `created_at` integer NOT NULL, + `parent_chat_id` integer, + `scope` text, + `muted` integer, + `muted_until` integer, + `archived` integer, + `marked_unread` integer, + `unread_counted_at` integer, + `title_folded` text, + CONSTRAINT `fk_chats_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_chats_parent_chat_id_chats_id_fk` FOREIGN KEY (`parent_chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `chats_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "chats_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_chats`(`id`, `account_id`, `external_id`, `kind`, `title`, `unread_count`, `last_message_at`, `participants_count`, `metadata`, `updated_at`, `username`, `membership_state`, `searchable`, `message_count`, `members_tracked_at`, `description`, `details_fetched_at`, `created_at`, `parent_chat_id`, `scope`, `muted`, `muted_until`, `archived`, `marked_unread`, `unread_counted_at`, `title_folded`) SELECT `id`, `account_id`, `external_id`, `kind`, `title`, `unread_count`, `last_message_at`, `participants_count`, `metadata`, `updated_at`, `username`, `membership_state`, `searchable`, `message_count`, `members_tracked_at`, `description`, `details_fetched_at`, `created_at`, `parent_chat_id`, `scope`, `muted`, `muted_until`, `archived`, `marked_unread`, `unread_counted_at`, `title_folded` FROM `chats`;--> statement-breakpoint +DROP TABLE `chats`;--> statement-breakpoint +ALTER TABLE `__new_chats` RENAME TO `chats`;--> statement-breakpoint +CREATE TABLE `__new_content_authors` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `name` text NOT NULL, + `email` text, + `data` text NOT NULL, + `source_updated_at` integer, + `deleted_at` integer, + `synced_at` integer NOT NULL, + CONSTRAINT `fk_content_authors_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `content_authors_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "content_authors_data_json" CHECK("data" IS NULL OR json_valid("data")) +); +--> statement-breakpoint +INSERT INTO `__new_content_authors`(`id`, `account_id`, `external_id`, `name`, `email`, `data`, `source_updated_at`, `deleted_at`, `synced_at`) SELECT `id`, `account_id`, `external_id`, `name`, `email`, `data`, `source_updated_at`, `deleted_at`, `synced_at` FROM `content_authors`;--> statement-breakpoint +DROP TABLE `content_authors`;--> statement-breakpoint +ALTER TABLE `__new_content_authors` RENAME TO `content_authors`;--> statement-breakpoint +CREATE TABLE `__new_content_metrics` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `post_id` integer NOT NULL, + `at` integer NOT NULL, + `views` integer, + `reactions` integer, + `comments` integer, + `shares` integer, + `clicks` integer, + `raw` text, + CONSTRAINT `fk_content_metrics_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`), + CONSTRAINT "content_metrics_raw_json" CHECK("raw" IS NULL OR json_valid("raw")) +); +--> statement-breakpoint +INSERT INTO `__new_content_metrics`(`id`, `post_id`, `at`, `views`, `reactions`, `comments`, `shares`, `clicks`, `raw`) SELECT `id`, `post_id`, `at`, `views`, `reactions`, `comments`, `shares`, `clicks`, `raw` FROM `content_metrics`;--> statement-breakpoint +DROP TABLE `content_metrics`;--> statement-breakpoint +ALTER TABLE `__new_content_metrics` RENAME TO `content_metrics`;--> statement-breakpoint +CREATE TABLE `__new_content_posts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `channel_id` text, + `type` text NOT NULL, + `title` text, + `title_folded` text NOT NULL, + `body` text, + `content_hash` text NOT NULL, + `status` text NOT NULL, + `published_at` integer, + `scheduled_for` integer, + `source_created_at` integer, + `source_updated_at` integer, + `version` text, + `normalized_text` text NOT NULL, + `data` text NOT NULL, + `deleted_at` integer, + `synced_at` integer NOT NULL, + CONSTRAINT `fk_content_posts_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `content_posts_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "content_posts_data_json" CHECK("data" IS NULL OR json_valid("data")) +); +--> statement-breakpoint +INSERT INTO `__new_content_posts`(`id`, `account_id`, `external_id`, `channel_id`, `type`, `title`, `title_folded`, `body`, `content_hash`, `status`, `published_at`, `scheduled_for`, `source_created_at`, `source_updated_at`, `version`, `normalized_text`, `data`, `deleted_at`, `synced_at`) SELECT `id`, `account_id`, `external_id`, `channel_id`, `type`, `title`, `title_folded`, `body`, `content_hash`, `status`, `published_at`, `scheduled_for`, `source_created_at`, `source_updated_at`, `version`, `normalized_text`, `data`, `deleted_at`, `synced_at` FROM `content_posts`;--> statement-breakpoint +DROP TABLE `content_posts`;--> statement-breakpoint +ALTER TABLE `__new_content_posts` RENAME TO `content_posts`;--> statement-breakpoint +CREATE TABLE `__new_content_terms` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `name` text NOT NULL, + `slug` text, + `parent_id` text, + `tag_id` integer, + `data` text NOT NULL, + `source_updated_at` integer, + `deleted_at` integer, + `synced_at` integer NOT NULL, + CONSTRAINT `fk_content_terms_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_content_terms_tag_id_canonical_tags_id_fk` FOREIGN KEY (`tag_id`) REFERENCES `canonical_tags`(`id`), + CONSTRAINT `content_terms_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "content_terms_data_json" CHECK("data" IS NULL OR json_valid("data")) +); +--> statement-breakpoint +INSERT INTO `__new_content_terms`(`id`, `account_id`, `external_id`, `kind`, `name`, `slug`, `parent_id`, `tag_id`, `data`, `source_updated_at`, `deleted_at`, `synced_at`) SELECT `id`, `account_id`, `external_id`, `kind`, `name`, `slug`, `parent_id`, `tag_id`, `data`, `source_updated_at`, `deleted_at`, `synced_at` FROM `content_terms`;--> statement-breakpoint +DROP TABLE `content_terms`;--> statement-breakpoint +ALTER TABLE `__new_content_terms` RENAME TO `content_terms`;--> statement-breakpoint +CREATE TABLE `__new_contracts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL, + `number` text, + `kind` text NOT NULL, + `status` text NOT NULL, + `signed_date` text, + `effective_date` text, + `expiration_date` text, + `auto_renew` integer DEFAULT 0 NOT NULL, + `renewal_count` integer, + `renewal_unit` text, + `notice_days` integer, + `terms` text, + `value` integer, + `currency` text, + `project_id` integer, + `deal_id` integer, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_contracts_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_contracts_deal_id_deals_id_fk` FOREIGN KEY (`deal_id`) REFERENCES `deals`(`id`), + CONSTRAINT "contracts_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "contracts_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)), + CONSTRAINT "contracts_value_not_negative" CHECK("value" IS NULL OR "value" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_contracts`(`id`, `name`, `number`, `kind`, `status`, `signed_date`, `effective_date`, `expiration_date`, `auto_renew`, `renewal_count`, `renewal_unit`, `notice_days`, `terms`, `value`, `currency`, `project_id`, `deal_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `name`, `number`, `kind`, `status`, `signed_date`, `effective_date`, `expiration_date`, `auto_renew`, `renewal_count`, `renewal_unit`, `notice_days`, `terms`, `value`, `currency`, `project_id`, `deal_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `contracts`;--> statement-breakpoint +DROP TABLE `contracts`;--> statement-breakpoint +ALTER TABLE `__new_contracts` RENAME TO `contracts`;--> statement-breakpoint +CREATE TABLE `__new_crm_fields` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `kind` text NOT NULL, + `code` text NOT NULL, + `label` text, + `type` text NOT NULL, + `multiple` integer NOT NULL, + `filterable` integer NOT NULL, + `options` text, + `position` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_crm_fields_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `crm_fields_account_id_kind_code_unique` UNIQUE(`account_id`,`kind`,`code`), + CONSTRAINT "crm_fields_options_json" CHECK("options" IS NULL OR json_valid("options")) +); +--> statement-breakpoint +INSERT INTO `__new_crm_fields`(`id`, `account_id`, `kind`, `code`, `label`, `type`, `multiple`, `filterable`, `options`, `position`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `account_id`, `kind`, `code`, `label`, `type`, `multiple`, `filterable`, `options`, `position`, `created_at`, `updated_at`, `deleted_at` FROM `crm_fields`;--> statement-breakpoint +DROP TABLE `crm_fields`;--> statement-breakpoint +ALTER TABLE `__new_crm_fields` RENAME TO `crm_fields`;--> statement-breakpoint +CREATE TABLE `__new_deals` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `title` text NOT NULL, + `organization_id` integer, + `project_id` integer, + `stage_id` integer NOT NULL, + `status` text NOT NULL, + `currency` text, + `amount` integer, + `close_date` text, + `closed_date` text, + `rank` real, + `account_id` integer, + `external_id` text, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_deals_organization_id_organizations_id_fk` FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`), + CONSTRAINT `fk_deals_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_deals_stage_id_pipeline_stages_id_fk` FOREIGN KEY (`stage_id`) REFERENCES `pipeline_stages`(`id`), + CONSTRAINT `fk_deals_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT "deals_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "deals_amount_not_negative" CHECK("amount" IS NULL OR "amount" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_deals`(`id`, `title`, `organization_id`, `project_id`, `stage_id`, `status`, `currency`, `amount`, `close_date`, `closed_date`, `rank`, `account_id`, `external_id`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `title`, `organization_id`, `project_id`, `stage_id`, `status`, `currency`, `amount`, `close_date`, `closed_date`, `rank`, `account_id`, `external_id`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `deals`;--> statement-breakpoint +DROP TABLE `deals`;--> statement-breakpoint +ALTER TABLE `__new_deals` RENAME TO `deals`;--> statement-breakpoint +CREATE TABLE `__new_decisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `project_id` integer, + `statement` text NOT NULL, + `status` text NOT NULL, + `decided_at` integer, + `supersedes_id` integer, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_decisions_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_decisions_supersedes_id_decisions_id_fk` FOREIGN KEY (`supersedes_id`) REFERENCES `decisions`(`id`), + CONSTRAINT "decisions_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "decisions_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_decisions`(`id`, `project_id`, `statement`, `status`, `decided_at`, `supersedes_id`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `project_id`, `statement`, `status`, `decided_at`, `supersedes_id`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `decisions`;--> statement-breakpoint +DROP TABLE `decisions`;--> statement-breakpoint +ALTER TABLE `__new_decisions` RENAME TO `decisions`;--> statement-breakpoint +CREATE TABLE `__new_document_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `document_id` integer NOT NULL, + `body` text NOT NULL, + `revision` integer NOT NULL, + `created_at` integer NOT NULL, + `title` text, + `front_matter` text, + `reason` text, + CONSTRAINT `fk_document_revisions_document_id_documents_id_fk` FOREIGN KEY (`document_id`) REFERENCES `documents`(`id`), + CONSTRAINT "document_revisions_front_matter_json" CHECK("front_matter" IS NULL OR json_valid("front_matter")) +); +--> statement-breakpoint +INSERT INTO `__new_document_revisions`(`id`, `document_id`, `body`, `revision`, `created_at`, `title`, `front_matter`, `reason`) SELECT `id`, `document_id`, `body`, `revision`, `created_at`, `title`, `front_matter`, `reason` FROM `document_revisions`;--> statement-breakpoint +DROP TABLE `document_revisions`;--> statement-breakpoint +ALTER TABLE `__new_document_revisions` RENAME TO `document_revisions`;--> statement-breakpoint +CREATE TABLE `__new_documents` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `title` text, + `location` text, + `file_name` text, + `extension` text, + `url` text, + `storage` text, + `local_path` text, + `mime` text, + `size` integer, + `content_hash` text, + `front_matter` text, + `body` text, + `normalized_text` text, + `extraction` text, + `extraction_error` text, + `language` text, + `revision` integer DEFAULT 1 NOT NULL, + `export_path` text, + `external_created_at` integer, + `external_updated_at` integer, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `pinned_file_id` integer, + `removal` text, + CONSTRAINT `fk_documents_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `documents_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "documents_front_matter_json" CHECK("front_matter" IS NULL OR json_valid("front_matter")), + CONSTRAINT "documents_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_documents`(`id`, `account_id`, `external_id`, `kind`, `title`, `location`, `file_name`, `extension`, `url`, `storage`, `local_path`, `mime`, `size`, `content_hash`, `front_matter`, `body`, `normalized_text`, `extraction`, `extraction_error`, `language`, `revision`, `export_path`, `external_created_at`, `external_updated_at`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `pinned_file_id`, `removal`) SELECT `id`, `account_id`, `external_id`, `kind`, `title`, `location`, `file_name`, `extension`, `url`, `storage`, `local_path`, `mime`, `size`, `content_hash`, `front_matter`, `body`, `normalized_text`, `extraction`, `extraction_error`, `language`, `revision`, `export_path`, `external_created_at`, `external_updated_at`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `pinned_file_id`, `removal` FROM `documents`;--> statement-breakpoint +DROP TABLE `documents`;--> statement-breakpoint +ALTER TABLE `__new_documents` RENAME TO `documents`;--> statement-breakpoint +CREATE TABLE `__new_email_threads` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `subject` text, + `last_email_at` integer, + `emails_count` integer DEFAULT 0 NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `subject_folded` text, + CONSTRAINT `fk_email_threads_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `email_threads_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "email_threads_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_email_threads`(`id`, `account_id`, `external_id`, `subject`, `last_email_at`, `emails_count`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `subject_folded`) SELECT `id`, `account_id`, `external_id`, `subject`, `last_email_at`, `emails_count`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `subject_folded` FROM `email_threads`;--> statement-breakpoint +DROP TABLE `email_threads`;--> statement-breakpoint +ALTER TABLE `__new_email_threads` RENAME TO `email_threads`;--> statement-breakpoint +CREATE TABLE `__new_emails` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `email_thread_id` integer NOT NULL, + `external_id` text NOT NULL, + `subject` text, + `from_identity_id` integer, + `from_address` text, + `from_name` text, + `sent_at` integer, + `received_at` integer, + `in_reply_to` text, + `references` text, + `body_text` text, + `body_html` text, + `snippet` text, + `outgoing` integer, + `read` integer, + `flagged` integer, + `draft` integer, + `size` integer, + `headers` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `mail_rule_id` integer, + CONSTRAINT `fk_emails_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_emails_email_thread_id_email_threads_id_fk` FOREIGN KEY (`email_thread_id`) REFERENCES `email_threads`(`id`), + CONSTRAINT `fk_emails_from_identity_id_identities_id_fk` FOREIGN KEY (`from_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `emails_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "emails_references_json" CHECK("references" IS NULL OR json_valid("references")), + CONSTRAINT "emails_headers_json" CHECK("headers" IS NULL OR json_valid("headers")), + CONSTRAINT "emails_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_emails`(`id`, `account_id`, `email_thread_id`, `external_id`, `subject`, `from_identity_id`, `from_address`, `from_name`, `sent_at`, `received_at`, `in_reply_to`, `references`, `body_text`, `body_html`, `snippet`, `outgoing`, `read`, `flagged`, `draft`, `size`, `headers`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `mail_rule_id`) SELECT `id`, `account_id`, `email_thread_id`, `external_id`, `subject`, `from_identity_id`, `from_address`, `from_name`, `sent_at`, `received_at`, `in_reply_to`, `references`, `body_text`, `body_html`, `snippet`, `outgoing`, `read`, `flagged`, `draft`, `size`, `headers`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `mail_rule_id` FROM `emails`;--> statement-breakpoint +DROP TABLE `emails`;--> statement-breakpoint +ALTER TABLE `__new_emails` RENAME TO `emails`;--> statement-breakpoint +CREATE TABLE `__new_facts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `type` text NOT NULL, + `statement` text NOT NULL, + `status` text NOT NULL, + `project_id` integer, + `subject_type` text, + `subject_id` integer, + `occurred_at` integer, + `supersedes_id` integer, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `scope` text, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_facts_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_facts_supersedes_id_facts_id_fk` FOREIGN KEY (`supersedes_id`) REFERENCES `facts`(`id`), + CONSTRAINT "facts_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "facts_subject_pair" CHECK(("subject_type" IS NULL) = ("subject_id" IS NULL)), + CONSTRAINT "facts_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_facts`(`id`, `type`, `statement`, `status`, `project_id`, `subject_type`, `subject_id`, `occurred_at`, `supersedes_id`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `scope`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `type`, `statement`, `status`, `project_id`, `subject_type`, `subject_id`, `occurred_at`, `supersedes_id`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `scope`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `facts`;--> statement-breakpoint +DROP TABLE `facts`;--> statement-breakpoint +ALTER TABLE `__new_facts` RENAME TO `facts`;--> statement-breakpoint +CREATE TABLE `__new_files` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `name` text NOT NULL, + `path` text NOT NULL, + `path_folded` text, + `parent_id` integer, + `document_id` integer, + `mime` text, + `size` integer, + `content_hash` text, + `url` text, + `external_created_at` integer, + `external_updated_at` integer, + `metadata` text, + `seen_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_files_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_files_parent_id_files_id_fk` FOREIGN KEY (`parent_id`) REFERENCES `files`(`id`), + CONSTRAINT `fk_files_document_id_documents_id_fk` FOREIGN KEY (`document_id`) REFERENCES `documents`(`id`), + CONSTRAINT `files_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "files_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_files`(`id`, `account_id`, `external_id`, `kind`, `name`, `path`, `path_folded`, `parent_id`, `document_id`, `mime`, `size`, `content_hash`, `url`, `external_created_at`, `external_updated_at`, `metadata`, `seen_at`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `account_id`, `external_id`, `kind`, `name`, `path`, `path_folded`, `parent_id`, `document_id`, `mime`, `size`, `content_hash`, `url`, `external_created_at`, `external_updated_at`, `metadata`, `seen_at`, `created_at`, `updated_at`, `deleted_at` FROM `files`;--> statement-breakpoint +DROP TABLE `files`;--> statement-breakpoint +ALTER TABLE `__new_files` RENAME TO `files`;--> statement-breakpoint +CREATE TABLE `__new_financial_accounts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `kind` text NOT NULL, + `currency` text NOT NULL, + `institution` text, + `number_hint` text, + `holder_type` text, + `holder_id` integer, + `opening_balance` integer, + `opening_date` text, + `closed_date` text, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT "financial_accounts_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "financial_accounts_holder_pair" CHECK(("holder_type" IS NULL) = ("holder_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_financial_accounts`(`id`, `name`, `name_folded`, `kind`, `currency`, `institution`, `number_hint`, `holder_type`, `holder_id`, `opening_balance`, `opening_date`, `closed_date`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `name`, `name_folded`, `kind`, `currency`, `institution`, `number_hint`, `holder_type`, `holder_id`, `opening_balance`, `opening_date`, `closed_date`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `financial_accounts`;--> statement-breakpoint +DROP TABLE `financial_accounts`;--> statement-breakpoint +ALTER TABLE `__new_financial_accounts` RENAME TO `financial_accounts`;--> statement-breakpoint +CREATE TABLE `__new_financial_transactions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `financial_account_id` integer NOT NULL, + `direction` text NOT NULL, + `amount` integer NOT NULL, + `currency` text NOT NULL, + `status` text NOT NULL, + `statement_date` text NOT NULL, + `booked_date` text, + `description` text, + `counterparty_name` text, + `counterparty_type` text, + `counterparty_id` integer, + `reference` text, + `payment_id` integer, + `project_id` integer, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_financial_transactions_financial_account_id_financial_accounts_id_fk` FOREIGN KEY (`financial_account_id`) REFERENCES `financial_accounts`(`id`), + CONSTRAINT `fk_financial_transactions_payment_id_payments_id_fk` FOREIGN KEY (`payment_id`) REFERENCES `payments`(`id`), + CONSTRAINT `fk_financial_transactions_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT "financial_transactions_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "financial_transactions_counterparty_pair" CHECK(("counterparty_type" IS NULL) = ("counterparty_id" IS NULL)), + CONSTRAINT "financial_transactions_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_financial_transactions`(`id`, `financial_account_id`, `direction`, `amount`, `currency`, `status`, `statement_date`, `booked_date`, `description`, `counterparty_name`, `counterparty_type`, `counterparty_id`, `reference`, `payment_id`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `financial_account_id`, `direction`, `amount`, `currency`, `status`, `statement_date`, `booked_date`, `description`, `counterparty_name`, `counterparty_type`, `counterparty_id`, `reference`, `payment_id`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `financial_transactions`;--> statement-breakpoint +DROP TABLE `financial_transactions`;--> statement-breakpoint +ALTER TABLE `__new_financial_transactions` RENAME TO `financial_transactions`;--> statement-breakpoint +CREATE TABLE `__new_identities` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `provider` text NOT NULL, + `external_id` text NOT NULL, + `username` text, + `name` text, + `bot` integer, + `phone_hmac` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `description` text, + `email` text, + `phone` text, + `name_folded` text, + CONSTRAINT `identities_provider_external_id_unique` UNIQUE(`provider`,`external_id`), + CONSTRAINT "identities_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_identities`(`id`, `provider`, `external_id`, `username`, `name`, `bot`, `phone_hmac`, `metadata`, `created_at`, `updated_at`, `description`, `email`, `phone`, `name_folded`) SELECT `id`, `provider`, `external_id`, `username`, `name`, `bot`, `phone_hmac`, `metadata`, `created_at`, `updated_at`, `description`, `email`, `phone`, `name_folded` FROM `identities`;--> statement-breakpoint +DROP TABLE `identities`;--> statement-breakpoint +ALTER TABLE `__new_identities` RENAME TO `identities`;--> statement-breakpoint +CREATE TABLE `__new_identity_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `identity_id` integer NOT NULL, + `name` text, + `username` text, + `description` text, + `marks` text, + `created_at` integer NOT NULL, + CONSTRAINT `fk_identity_revisions_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT "identity_revisions_marks_json" CHECK("marks" IS NULL OR json_valid("marks")) +); +--> statement-breakpoint +INSERT INTO `__new_identity_revisions`(`id`, `identity_id`, `name`, `username`, `description`, `marks`, `created_at`) SELECT `id`, `identity_id`, `name`, `username`, `description`, `marks`, `created_at` FROM `identity_revisions`;--> statement-breakpoint +DROP TABLE `identity_revisions`;--> statement-breakpoint +ALTER TABLE `__new_identity_revisions` RENAME TO `identity_revisions`;--> statement-breakpoint +CREATE TABLE `__new_invoice_lines` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `invoice_id` integer NOT NULL, + `position` integer NOT NULL, + `description` text NOT NULL, + `quantity` text NOT NULL, + `unit_price` integer, + `amount` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `catalog_item_id` integer, + CONSTRAINT `fk_invoice_lines_invoice_id_invoices_id_fk` FOREIGN KEY (`invoice_id`) REFERENCES `invoices`(`id`), + CONSTRAINT `fk_invoice_lines_catalog_item_id_catalog_items_id_fk` FOREIGN KEY (`catalog_item_id`) REFERENCES `catalog_items`(`id`), + CONSTRAINT `invoice_lines_invoice_id_position_unique` UNIQUE(`invoice_id`,`position`), + CONSTRAINT "invoice_lines_amount_not_negative" CHECK("amount" IS NULL OR "amount" >= 0), + CONSTRAINT "invoice_lines_unit_price_not_negative" CHECK("unit_price" IS NULL OR "unit_price" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_invoice_lines`(`id`, `invoice_id`, `position`, `description`, `quantity`, `unit_price`, `amount`, `created_at`, `updated_at`, `catalog_item_id`) SELECT `id`, `invoice_id`, `position`, `description`, `quantity`, `unit_price`, `amount`, `created_at`, `updated_at`, `catalog_item_id` FROM `invoice_lines`;--> statement-breakpoint +DROP TABLE `invoice_lines`;--> statement-breakpoint +ALTER TABLE `__new_invoice_lines` RENAME TO `invoice_lines`;--> statement-breakpoint +CREATE TABLE `__new_invoices` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `direction` text NOT NULL, + `number` text, + `issuer_type` text, + `issuer_id` integer, + `counterparty_type` text NOT NULL, + `counterparty_id` integer NOT NULL, + `project_id` integer, + `currency` text NOT NULL, + `total` integer NOT NULL, + `issue_date` text, + `due_date` text, + `status` text NOT NULL, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `contract_id` integer, + `subscription_id` integer, + CONSTRAINT `fk_invoices_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_invoices_contract_id_contracts_id_fk` FOREIGN KEY (`contract_id`) REFERENCES `contracts`(`id`), + CONSTRAINT `fk_invoices_subscription_id_subscriptions_id_fk` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions`(`id`), + CONSTRAINT "invoices_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "invoices_issuer_pair" CHECK(("issuer_type" IS NULL) = ("issuer_id" IS NULL)), + CONSTRAINT "invoices_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)), + CONSTRAINT "invoices_total_not_negative" CHECK("total" IS NULL OR "total" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_invoices`(`id`, `direction`, `number`, `issuer_type`, `issuer_id`, `counterparty_type`, `counterparty_id`, `project_id`, `currency`, `total`, `issue_date`, `due_date`, `status`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `contract_id`, `subscription_id`) SELECT `id`, `direction`, `number`, `issuer_type`, `issuer_id`, `counterparty_type`, `counterparty_id`, `project_id`, `currency`, `total`, `issue_date`, `due_date`, `status`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `contract_id`, `subscription_id` FROM `invoices`;--> statement-breakpoint +DROP TABLE `invoices`;--> statement-breakpoint +ALTER TABLE `__new_invoices` RENAME TO `invoices`;--> statement-breakpoint +CREATE TABLE `__new_leads` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `title` text NOT NULL, + `organization_id` integer, + `project_id` integer, + `stage_id` integer NOT NULL, + `status` text NOT NULL, + `currency` text, + `amount` integer, + `close_date` text, + `closed_date` text, + `rank` real, + `deal_id` integer, + `account_id` integer, + `external_id` text, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_leads_organization_id_organizations_id_fk` FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`), + CONSTRAINT `fk_leads_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_leads_stage_id_pipeline_stages_id_fk` FOREIGN KEY (`stage_id`) REFERENCES `pipeline_stages`(`id`), + CONSTRAINT `fk_leads_deal_id_deals_id_fk` FOREIGN KEY (`deal_id`) REFERENCES `deals`(`id`), + CONSTRAINT `fk_leads_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT "leads_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "leads_amount_not_negative" CHECK("amount" IS NULL OR "amount" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_leads`(`id`, `title`, `organization_id`, `project_id`, `stage_id`, `status`, `currency`, `amount`, `close_date`, `closed_date`, `rank`, `deal_id`, `account_id`, `external_id`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `title`, `organization_id`, `project_id`, `stage_id`, `status`, `currency`, `amount`, `close_date`, `closed_date`, `rank`, `deal_id`, `account_id`, `external_id`, `author_type`, `author_id`, `model`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `leads`;--> statement-breakpoint +DROP TABLE `leads`;--> statement-breakpoint +ALTER TABLE `__new_leads` RENAME TO `leads`;--> statement-breakpoint +CREATE TABLE `__new_link_reviews` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `linkable_type` text NOT NULL, + `linkable_id` integer NOT NULL, + `entity_type` text NOT NULL, + `candidates` text NOT NULL, + `reason` text NOT NULL, + `status` text NOT NULL, + `chosen_id` integer, + `decided_by` text, + `decided_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `link_reviews_linkable_type_linkable_id_entity_type_unique` UNIQUE(`linkable_type`,`linkable_id`,`entity_type`), + CONSTRAINT "link_reviews_candidates_json" CHECK("candidates" IS NULL OR json_valid("candidates")) +); +--> statement-breakpoint +INSERT INTO `__new_link_reviews`(`id`, `linkable_type`, `linkable_id`, `entity_type`, `candidates`, `reason`, `status`, `chosen_id`, `decided_by`, `decided_at`, `created_at`, `updated_at`) SELECT `id`, `linkable_type`, `linkable_id`, `entity_type`, `candidates`, `reason`, `status`, `chosen_id`, `decided_by`, `decided_at`, `created_at`, `updated_at` FROM `link_reviews`;--> statement-breakpoint +DROP TABLE `link_reviews`;--> statement-breakpoint +ALTER TABLE `__new_link_reviews` RENAME TO `link_reviews`;--> statement-breakpoint +CREATE TABLE `__new_link_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `link_id` integer NOT NULL, + `change` text NOT NULL, + `before` text, + `after` text, + `author` text, + `account_id` integer, + `created_at` integer NOT NULL, + CONSTRAINT "link_revisions_before_json" CHECK("before" IS NULL OR json_valid("before")) +); +--> statement-breakpoint +INSERT INTO `__new_link_revisions`(`id`, `link_id`, `change`, `before`, `after`, `author`, `account_id`, `created_at`) SELECT `id`, `link_id`, `change`, `before`, `after`, `author`, `account_id`, `created_at` FROM `link_revisions`;--> statement-breakpoint +DROP TABLE `link_revisions`;--> statement-breakpoint +ALTER TABLE `__new_link_revisions` RENAME TO `link_revisions`;--> statement-breakpoint +CREATE TABLE `__new_links` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `from_type` text NOT NULL, + `from_id` integer NOT NULL, + `to_type` text, + `to_id` integer, + `kind` text NOT NULL, + `anchor` text, + `source` text NOT NULL, + `target_text` text, + `target_folded` text, + `role` text, + `evidence` text, + `metadata` text, + `confirmed` integer DEFAULT 1 NOT NULL, + `created_at` integer NOT NULL, + `author` text, + `updated_at` integer NOT NULL, + `purpose` text, + `account_id` integer, + `starts_at` integer, + `ends_at` integer, + `deleted_at` integer, + CONSTRAINT "links_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_links`(`id`, `from_type`, `from_id`, `to_type`, `to_id`, `kind`, `anchor`, `source`, `target_text`, `target_folded`, `role`, `evidence`, `metadata`, `confirmed`, `created_at`, `author`, `updated_at`, `purpose`, `account_id`, `starts_at`, `ends_at`, `deleted_at`) SELECT `id`, `from_type`, `from_id`, `to_type`, `to_id`, `kind`, `anchor`, `source`, `target_text`, `target_folded`, `role`, `evidence`, `metadata`, `confirmed`, `created_at`, `author`, `updated_at`, `purpose`, `account_id`, `starts_at`, `ends_at`, `deleted_at` FROM `links`;--> statement-breakpoint +DROP TABLE `links`;--> statement-breakpoint +ALTER TABLE `__new_links` RENAME TO `links`;--> statement-breakpoint +CREATE TABLE `__new_mail_rules` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `conditions` text NOT NULL, + `actions` text NOT NULL, + `protected` integer DEFAULT 0 NOT NULL, + `source` text NOT NULL, + `reason` text, + `decided_at` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_mail_rules_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `mail_rules_account_id_conditions_unique` UNIQUE(`account_id`,`conditions`), + CONSTRAINT "mail_rules_conditions_json" CHECK("conditions" IS NULL OR json_valid("conditions")), + CONSTRAINT "mail_rules_actions_json" CHECK("actions" IS NULL OR json_valid("actions")) +); +--> statement-breakpoint +INSERT INTO `__new_mail_rules`(`id`, `account_id`, `conditions`, `actions`, `protected`, `source`, `reason`, `decided_at`, `created_at`, `updated_at`) SELECT `id`, `account_id`, `conditions`, `actions`, `protected`, `source`, `reason`, `decided_at`, `created_at`, `updated_at` FROM `mail_rules`;--> statement-breakpoint +DROP TABLE `mail_rules`;--> statement-breakpoint +ALTER TABLE `__new_mail_rules` RENAME TO `mail_rules`;--> statement-breakpoint +CREATE TABLE `__new_meeting_chat_messages` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `meeting_id` integer NOT NULL, + `external_id` text, + `sent_at` integer NOT NULL, + `sender_participant_id` integer, + `sender_name` text, + `recipient` text, + `text` text NOT NULL, + `normalized_text` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_meeting_chat_messages_meeting_id_meetings_id_fk` FOREIGN KEY (`meeting_id`) REFERENCES `meetings`(`id`), + CONSTRAINT `fk_meeting_chat_messages_sender_participant_id_meeting_participants_id_fk` FOREIGN KEY (`sender_participant_id`) REFERENCES `meeting_participants`(`id`), + CONSTRAINT "meeting_chat_messages_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_chat_messages`(`id`, `meeting_id`, `external_id`, `sent_at`, `sender_participant_id`, `sender_name`, `recipient`, `text`, `normalized_text`, `metadata`, `created_at`, `updated_at`) SELECT `id`, `meeting_id`, `external_id`, `sent_at`, `sender_participant_id`, `sender_name`, `recipient`, `text`, `normalized_text`, `metadata`, `created_at`, `updated_at` FROM `meeting_chat_messages`;--> statement-breakpoint +DROP TABLE `meeting_chat_messages`;--> statement-breakpoint +ALTER TABLE `__new_meeting_chat_messages` RENAME TO `meeting_chat_messages`;--> statement-breakpoint +CREATE TABLE `__new_meeting_participants` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `meeting_id` integer NOT NULL, + `identity_id` integer NOT NULL, + `display_name` text, + `email` text, + `role` text, + `joined_at` integer, + `left_at` integer, + `duration_ms` integer, + `sessions` text, + `external_id` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_meeting_participants_meeting_id_meetings_id_fk` FOREIGN KEY (`meeting_id`) REFERENCES `meetings`(`id`), + CONSTRAINT `fk_meeting_participants_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `meeting_participants_meeting_id_identity_id_unique` UNIQUE(`meeting_id`,`identity_id`), + CONSTRAINT "meeting_participants_sessions_json" CHECK("sessions" IS NULL OR json_valid("sessions")), + CONSTRAINT "meeting_participants_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_participants`(`id`, `meeting_id`, `identity_id`, `display_name`, `email`, `role`, `joined_at`, `left_at`, `duration_ms`, `sessions`, `external_id`, `metadata`, `created_at`, `updated_at`) SELECT `id`, `meeting_id`, `identity_id`, `display_name`, `email`, `role`, `joined_at`, `left_at`, `duration_ms`, `sessions`, `external_id`, `metadata`, `created_at`, `updated_at` FROM `meeting_participants`;--> statement-breakpoint +DROP TABLE `meeting_participants`;--> statement-breakpoint +ALTER TABLE `__new_meeting_participants` RENAME TO `meeting_participants`;--> statement-breakpoint +CREATE TABLE `__new_meeting_series` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `event_series_id` integer, + `title` text, + `description` text, + `kind` text, + `recurrence` text, + `host_identity_id` integer, + `join_url` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_meeting_series_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_meeting_series_event_series_id_event_series_id_fk` FOREIGN KEY (`event_series_id`) REFERENCES `event_series`(`id`), + CONSTRAINT `fk_meeting_series_host_identity_id_identities_id_fk` FOREIGN KEY (`host_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `meeting_series_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "meeting_series_recurrence_json" CHECK("recurrence" IS NULL OR json_valid("recurrence")), + CONSTRAINT "meeting_series_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_series`(`id`, `account_id`, `external_id`, `event_series_id`, `title`, `description`, `kind`, `recurrence`, `host_identity_id`, `join_url`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `account_id`, `external_id`, `event_series_id`, `title`, `description`, `kind`, `recurrence`, `host_identity_id`, `join_url`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `meeting_series`;--> statement-breakpoint +DROP TABLE `meeting_series`;--> statement-breakpoint +ALTER TABLE `__new_meeting_series` RENAME TO `meeting_series`;--> statement-breakpoint +CREATE TABLE `__new_meeting_summaries` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `meeting_id` integer NOT NULL, + `source` text NOT NULL, + `title` text, + `overview` text, + `sections` text, + `next_steps` text, + `content` text, + `doc_url` text, + `external_created_at` integer, + `external_updated_at` integer, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_meeting_summaries_meeting_id_meetings_id_fk` FOREIGN KEY (`meeting_id`) REFERENCES `meetings`(`id`), + CONSTRAINT `meeting_summaries_meeting_id_source_unique` UNIQUE(`meeting_id`,`source`), + CONSTRAINT "meeting_summaries_sections_json" CHECK("sections" IS NULL OR json_valid("sections")), + CONSTRAINT "meeting_summaries_next_steps_json" CHECK("next_steps" IS NULL OR json_valid("next_steps")), + CONSTRAINT "meeting_summaries_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_summaries`(`id`, `meeting_id`, `source`, `title`, `overview`, `sections`, `next_steps`, `content`, `doc_url`, `external_created_at`, `external_updated_at`, `metadata`, `created_at`, `updated_at`) SELECT `id`, `meeting_id`, `source`, `title`, `overview`, `sections`, `next_steps`, `content`, `doc_url`, `external_created_at`, `external_updated_at`, `metadata`, `created_at`, `updated_at` FROM `meeting_summaries`;--> statement-breakpoint +DROP TABLE `meeting_summaries`;--> statement-breakpoint +ALTER TABLE `__new_meeting_summaries` RENAME TO `meeting_summaries`;--> statement-breakpoint +CREATE TABLE `__new_meeting_transcript_rows` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `meeting_transcript_id` integer NOT NULL, + `position` integer NOT NULL, + `start_ms` integer NOT NULL, + `end_ms` integer NOT NULL, + `speaker_participant_id` integer, + `speaker_name` text, + `text` text NOT NULL, + `normalized_text` text, + `metadata` text, + `created_at` integer NOT NULL, + CONSTRAINT `fk_meeting_transcript_rows_meeting_transcript_id_meeting_transcripts_id_fk` FOREIGN KEY (`meeting_transcript_id`) REFERENCES `meeting_transcripts`(`id`), + CONSTRAINT `fk_meeting_transcript_rows_speaker_participant_id_meeting_participants_id_fk` FOREIGN KEY (`speaker_participant_id`) REFERENCES `meeting_participants`(`id`), + CONSTRAINT `meeting_transcript_rows_meeting_transcript_id_position_unique` UNIQUE(`meeting_transcript_id`,`position`), + CONSTRAINT "meeting_transcript_rows_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_transcript_rows`(`id`, `meeting_transcript_id`, `position`, `start_ms`, `end_ms`, `speaker_participant_id`, `speaker_name`, `text`, `normalized_text`, `metadata`, `created_at`) SELECT `id`, `meeting_transcript_id`, `position`, `start_ms`, `end_ms`, `speaker_participant_id`, `speaker_name`, `text`, `normalized_text`, `metadata`, `created_at` FROM `meeting_transcript_rows`;--> statement-breakpoint +DROP TABLE `meeting_transcript_rows`;--> statement-breakpoint +ALTER TABLE `__new_meeting_transcript_rows` RENAME TO `meeting_transcript_rows`;--> statement-breakpoint +CREATE TABLE `__new_meeting_transcripts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `meeting_id` integer NOT NULL, + `source` text NOT NULL, + `format` text, + `language` text, + `content_hash` text, + `external_created_at` integer, + `superseded_at` integer, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_meeting_transcripts_meeting_id_meetings_id_fk` FOREIGN KEY (`meeting_id`) REFERENCES `meetings`(`id`), + CONSTRAINT "meeting_transcripts_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meeting_transcripts`(`id`, `meeting_id`, `source`, `format`, `language`, `content_hash`, `external_created_at`, `superseded_at`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `meeting_id`, `source`, `format`, `language`, `content_hash`, `external_created_at`, `superseded_at`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `meeting_transcripts`;--> statement-breakpoint +DROP TABLE `meeting_transcripts`;--> statement-breakpoint +ALTER TABLE `__new_meeting_transcripts` RENAME TO `meeting_transcripts`;--> statement-breakpoint +CREATE TABLE `__new_meetings` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `meeting_series_id` integer, + `event_id` integer, + `external_id` text NOT NULL, + `title` text, + `description` text, + `location` text, + `join_url` text, + `started_at` integer, + `ended_at` integer, + `duration_ms` integer, + `timezone` text, + `host_identity_id` integer, + `participants_count` integer, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `title_folded` text, + `join_key` text, + `direction` text, + `client_phone` text, + CONSTRAINT `fk_meetings_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_meetings_meeting_series_id_meeting_series_id_fk` FOREIGN KEY (`meeting_series_id`) REFERENCES `meeting_series`(`id`), + CONSTRAINT `fk_meetings_event_id_events_id_fk` FOREIGN KEY (`event_id`) REFERENCES `events`(`id`), + CONSTRAINT `fk_meetings_host_identity_id_identities_id_fk` FOREIGN KEY (`host_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `meetings_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`), + CONSTRAINT "meetings_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_meetings`(`id`, `account_id`, `meeting_series_id`, `event_id`, `external_id`, `title`, `description`, `location`, `join_url`, `started_at`, `ended_at`, `duration_ms`, `timezone`, `host_identity_id`, `participants_count`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `title_folded`, `join_key`, `direction`, `client_phone`) SELECT `id`, `account_id`, `meeting_series_id`, `event_id`, `external_id`, `title`, `description`, `location`, `join_url`, `started_at`, `ended_at`, `duration_ms`, `timezone`, `host_identity_id`, `participants_count`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `title_folded`, `join_key`, `direction`, `client_phone` FROM `meetings`;--> statement-breakpoint +DROP TABLE `meetings`;--> statement-breakpoint +ALTER TABLE `__new_meetings` RENAME TO `meetings`;--> statement-breakpoint +CREATE TABLE `__new_memories` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `kind` text NOT NULL, + `body` text NOT NULL, + `subject_type` text, + `subject_id` integer, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confidence` real, + `status` text NOT NULL, + `last_verified_at` integer, + `supersedes_id` integer, + `scope` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `project_id` integer, + CONSTRAINT `fk_memories_supersedes_id_memories_id_fk` FOREIGN KEY (`supersedes_id`) REFERENCES `memories`(`id`), + CONSTRAINT `fk_memories_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT "memories_subject_pair" CHECK(("subject_type" IS NULL) = ("subject_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_memories`(`id`, `kind`, `body`, `subject_type`, `subject_id`, `author_type`, `author_id`, `model`, `confidence`, `status`, `last_verified_at`, `supersedes_id`, `scope`, `created_at`, `updated_at`, `deleted_at`, `project_id`) SELECT `id`, `kind`, `body`, `subject_type`, `subject_id`, `author_type`, `author_id`, `model`, `confidence`, `status`, `last_verified_at`, `supersedes_id`, `scope`, `created_at`, `updated_at`, `deleted_at`, `project_id` FROM `memories`;--> statement-breakpoint +DROP TABLE `memories`;--> statement-breakpoint +ALTER TABLE `__new_memories` RENAME TO `memories`;--> statement-breakpoint +CREATE TABLE `__new_messages` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `thread_external_id` text, + `sender_identity_id` integer, + `sender_chat_external_id` text, + `sender_name` text, + `sent_at` integer NOT NULL, + `edited_at` integer, + `deleted_at` integer, + `text` text NOT NULL, + `reply_to_external_id` text, + `reply_to` text, + `forward` text, + `outgoing` integer, + `reactions` text, + `metadata` text, + `created_at` integer NOT NULL, + `source` text NOT NULL, + `normalized_text` text, + `normalizer_version` integer, + `mentions` text, + `updated_at` integer NOT NULL, + `thread_root_id` integer, + `starred` integer, + `delivery` integer, + CONSTRAINT `fk_messages_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `fk_messages_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `fk_messages_sender_identity_id_identities_id_fk` FOREIGN KEY (`sender_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `fk_messages_thread_root_id_messages_id_fk` FOREIGN KEY (`thread_root_id`) REFERENCES `messages`(`id`), + CONSTRAINT `messages_chat_id_external_id_unique` UNIQUE(`chat_id`,`external_id`), + CONSTRAINT "messages_reply_to_json" CHECK("reply_to" IS NULL OR json_valid("reply_to")), + CONSTRAINT "messages_forward_json" CHECK("forward" IS NULL OR json_valid("forward")), + CONSTRAINT "messages_reactions_json" CHECK("reactions" IS NULL OR json_valid("reactions")), + CONSTRAINT "messages_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "messages_mentions_json" CHECK("mentions" IS NULL OR json_valid("mentions")) +); +--> statement-breakpoint +INSERT INTO `__new_messages`(`id`, `chat_id`, `account_id`, `external_id`, `thread_external_id`, `sender_identity_id`, `sender_chat_external_id`, `sender_name`, `sent_at`, `edited_at`, `deleted_at`, `text`, `reply_to_external_id`, `reply_to`, `forward`, `outgoing`, `reactions`, `metadata`, `created_at`, `source`, `normalized_text`, `normalizer_version`, `mentions`, `updated_at`, `thread_root_id`, `starred`, `delivery`) SELECT `id`, `chat_id`, `account_id`, `external_id`, `thread_external_id`, `sender_identity_id`, `sender_chat_external_id`, `sender_name`, `sent_at`, `edited_at`, `deleted_at`, `text`, `reply_to_external_id`, `reply_to`, `forward`, `outgoing`, `reactions`, `metadata`, `created_at`, `source`, `normalized_text`, `normalizer_version`, `mentions`, `updated_at`, `thread_root_id`, `starred`, `delivery` FROM `messages`;--> statement-breakpoint +DROP TABLE `messages`;--> statement-breakpoint +ALTER TABLE `__new_messages` RENAME TO `messages`;--> statement-breakpoint +CREATE TABLE `__new_notes` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `notable_type` text NOT NULL, + `notable_id` integer NOT NULL, + `title` text, + `body` text NOT NULL, + `author_type` text, + `author_id` integer, + `revision` integer DEFAULT 1 NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT "notes_author_pair" CHECK(("author_type" IS NULL) = ("author_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_notes`(`id`, `notable_type`, `notable_id`, `title`, `body`, `author_type`, `author_id`, `revision`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `notable_type`, `notable_id`, `title`, `body`, `author_type`, `author_id`, `revision`, `created_at`, `updated_at`, `deleted_at` FROM `notes`;--> statement-breakpoint +DROP TABLE `notes`;--> statement-breakpoint +ALTER TABLE `__new_notes` RENAME TO `notes`;--> statement-breakpoint +CREATE TABLE `__new_order_lines` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `order_id` integer NOT NULL, + `position` integer NOT NULL, + `description` text NOT NULL, + `quantity` text NOT NULL, + `unit_price` integer, + `amount` integer NOT NULL, + `catalog_item_id` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_order_lines_order_id_orders_id_fk` FOREIGN KEY (`order_id`) REFERENCES `orders`(`id`), + CONSTRAINT `fk_order_lines_catalog_item_id_catalog_items_id_fk` FOREIGN KEY (`catalog_item_id`) REFERENCES `catalog_items`(`id`), + CONSTRAINT `order_lines_order_id_position_unique` UNIQUE(`order_id`,`position`), + CONSTRAINT "order_lines_amount_not_negative" CHECK("amount" IS NULL OR "amount" >= 0), + CONSTRAINT "order_lines_unit_price_not_negative" CHECK("unit_price" IS NULL OR "unit_price" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_order_lines`(`id`, `order_id`, `position`, `description`, `quantity`, `unit_price`, `amount`, `catalog_item_id`, `created_at`, `updated_at`) SELECT `id`, `order_id`, `position`, `description`, `quantity`, `unit_price`, `amount`, `catalog_item_id`, `created_at`, `updated_at` FROM `order_lines`;--> statement-breakpoint +DROP TABLE `order_lines`;--> statement-breakpoint +ALTER TABLE `__new_order_lines` RENAME TO `order_lines`;--> statement-breakpoint +CREATE TABLE `__new_orders` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `customer_type` text NOT NULL, + `customer_id` integer NOT NULL, + `purpose` text NOT NULL, + `supplier_type` text, + `supplier_id` integer, + `supplier_name` text NOT NULL, + `number` text, + `currency` text, + `total` integer, + `status` text NOT NULL, + `order_date` text, + `fulfilled_date` text, + `invoice_id` integer, + `payment_id` integer, + `project_id` integer, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `source_url` text, + `contract_id` integer, + `deal_id` integer, + `direction` text DEFAULT 'purchase' NOT NULL, + CONSTRAINT `fk_orders_invoice_id_invoices_id_fk` FOREIGN KEY (`invoice_id`) REFERENCES `invoices`(`id`), + CONSTRAINT `fk_orders_payment_id_payments_id_fk` FOREIGN KEY (`payment_id`) REFERENCES `payments`(`id`), + CONSTRAINT `fk_orders_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_orders_contract_id_contracts_id_fk` FOREIGN KEY (`contract_id`) REFERENCES `contracts`(`id`), + CONSTRAINT `fk_orders_deal_id_deals_id_fk` FOREIGN KEY (`deal_id`) REFERENCES `deals`(`id`), + CONSTRAINT "orders_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "orders_supplier_pair" CHECK(("supplier_type" IS NULL) = ("supplier_id" IS NULL)), + CONSTRAINT "orders_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)), + CONSTRAINT "orders_total_not_negative" CHECK("total" IS NULL OR "total" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_orders`(`id`, `customer_type`, `customer_id`, `purpose`, `supplier_type`, `supplier_id`, `supplier_name`, `number`, `currency`, `total`, `status`, `order_date`, `fulfilled_date`, `invoice_id`, `payment_id`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `source_url`, `contract_id`, `deal_id`, `direction`) SELECT `id`, `customer_type`, `customer_id`, `purpose`, `supplier_type`, `supplier_id`, `supplier_name`, `number`, `currency`, `total`, `status`, `order_date`, `fulfilled_date`, `invoice_id`, `payment_id`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `source_url`, `contract_id`, `deal_id`, `direction` FROM `orders`;--> statement-breakpoint +DROP TABLE `orders`;--> statement-breakpoint +ALTER TABLE `__new_orders` RENAME TO `orders`;--> statement-breakpoint +CREATE TABLE `__new_organizations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `kind` text NOT NULL, + `name` text NOT NULL, + `scope` text DEFAULT 'personal' NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT "organizations_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")) +); +--> statement-breakpoint +INSERT INTO `__new_organizations`(`id`, `kind`, `name`, `scope`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `kind`, `name`, `scope`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `organizations`;--> statement-breakpoint +DROP TABLE `organizations`;--> statement-breakpoint +ALTER TABLE `__new_organizations` RENAME TO `organizations`;--> statement-breakpoint +CREATE TABLE `__new_payments` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `direction` text NOT NULL, + `payer_type` text, + `payer_id` integer, + `payee_type` text, + `payee_id` integer, + `amount` integer NOT NULL, + `currency` text NOT NULL, + `payment_date` text NOT NULL, + `reference` text, + `project_id` integer, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `refund_of` integer, + `subscription_id` integer, + CONSTRAINT `fk_payments_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_payments_refund_of_payments_id_fk` FOREIGN KEY (`refund_of`) REFERENCES `payments`(`id`), + CONSTRAINT `fk_payments_subscription_id_subscriptions_id_fk` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions`(`id`), + CONSTRAINT "payments_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "payments_payer_pair" CHECK(("payer_type" IS NULL) = ("payer_id" IS NULL)), + CONSTRAINT "payments_payee_pair" CHECK(("payee_type" IS NULL) = ("payee_id" IS NULL)), + CONSTRAINT "payments_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_payments`(`id`, `direction`, `payer_type`, `payer_id`, `payee_type`, `payee_id`, `amount`, `currency`, `payment_date`, `reference`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `refund_of`, `subscription_id`) SELECT `id`, `direction`, `payer_type`, `payer_id`, `payee_type`, `payee_id`, `amount`, `currency`, `payment_date`, `reference`, `project_id`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `refund_of`, `subscription_id` FROM `payments`;--> statement-breakpoint +DROP TABLE `payments`;--> statement-breakpoint +ALTER TABLE `__new_payments` RENAME TO `payments`;--> statement-breakpoint +CREATE TABLE `__new_poll_votes` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `message_external_id` text NOT NULL, + `identity_id` integer NOT NULL, + `answers` text NOT NULL, + `voted_at` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_poll_votes_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `fk_poll_votes_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `poll_votes_chat_id_message_external_id_identity_id_unique` UNIQUE(`chat_id`,`message_external_id`,`identity_id`), + CONSTRAINT "poll_votes_answers_json" CHECK("answers" IS NULL OR json_valid("answers")) +); +--> statement-breakpoint +INSERT INTO `__new_poll_votes`(`id`, `chat_id`, `message_external_id`, `identity_id`, `answers`, `voted_at`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `message_external_id`, `identity_id`, `answers`, `voted_at`, `created_at`, `updated_at` FROM `poll_votes`;--> statement-breakpoint +DROP TABLE `poll_votes`;--> statement-breakpoint +ALTER TABLE `__new_poll_votes` RENAME TO `poll_votes`;--> statement-breakpoint +CREATE TABLE `__new_projects` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `key` text NOT NULL UNIQUE, + `name` text NOT NULL, + `description` text, + `type` text NOT NULL, + `organization_id` integer, + `account_id` integer, + `scope` text DEFAULT 'personal' NOT NULL, + `owner_type` text, + `owner_id` integer, + `tasks_count` integer DEFAULT 0 NOT NULL, + `status` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `name_folded` text, + CONSTRAINT `fk_projects_organization_id_organizations_id_fk` FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`), + CONSTRAINT `fk_projects_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT "projects_owner_pair" CHECK(("owner_type" IS NULL) = ("owner_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_projects`(`id`, `key`, `name`, `description`, `type`, `organization_id`, `account_id`, `scope`, `owner_type`, `owner_id`, `tasks_count`, `status`, `created_at`, `updated_at`, `deleted_at`, `name_folded`) SELECT `id`, `key`, `name`, `description`, `type`, `organization_id`, `account_id`, `scope`, `owner_type`, `owner_id`, `tasks_count`, `status`, `created_at`, `updated_at`, `deleted_at`, `name_folded` FROM `projects`;--> statement-breakpoint +DROP TABLE `projects`;--> statement-breakpoint +ALTER TABLE `__new_projects` RENAME TO `projects`;--> statement-breakpoint +CREATE TABLE `__new_proposed_actions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `kind` text NOT NULL, + `account_id` integer, + `target_type` text, + `target_id` integer, + `payload` text, + `reason` text, + `status` text NOT NULL, + `proposed_by_type` text NOT NULL, + `proposed_by_id` integer NOT NULL, + `decided_by_type` text, + `decided_by_id` integer, + `decided_at` integer, + `executed_at` integer, + `result` text, + `error` text, + `verdict` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_proposed_actions_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT "proposed_actions_payload_json" CHECK("payload" IS NULL OR json_valid("payload")), + CONSTRAINT "proposed_actions_result_json" CHECK("result" IS NULL OR json_valid("result")), + CONSTRAINT "proposed_actions_target_pair" CHECK(("target_type" IS NULL) = ("target_id" IS NULL)), + CONSTRAINT "proposed_actions_decided_by_pair" CHECK(("decided_by_type" IS NULL) = ("decided_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_proposed_actions`(`id`, `kind`, `account_id`, `target_type`, `target_id`, `payload`, `reason`, `status`, `proposed_by_type`, `proposed_by_id`, `decided_by_type`, `decided_by_id`, `decided_at`, `executed_at`, `result`, `error`, `verdict`, `created_at`, `updated_at`) SELECT `id`, `kind`, `account_id`, `target_type`, `target_id`, `payload`, `reason`, `status`, `proposed_by_type`, `proposed_by_id`, `decided_by_type`, `decided_by_id`, `decided_at`, `executed_at`, `result`, `error`, `verdict`, `created_at`, `updated_at` FROM `proposed_actions`;--> statement-breakpoint +DROP TABLE `proposed_actions`;--> statement-breakpoint +ALTER TABLE `__new_proposed_actions` RENAME TO `proposed_actions`;--> statement-breakpoint +CREATE TABLE `__new_records` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `type` text NOT NULL, + `external_id` text NOT NULL, + `fields` text NOT NULL, + `revision` integer, + `fingerprint` text NOT NULL, + `entity_type` text, + `entity_id` integer, + `projected_fingerprint` text, + `batch_id` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `created_entity` integer DEFAULT 0 NOT NULL, + CONSTRAINT `fk_records_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `records_account_id_type_external_id_unique` UNIQUE(`account_id`,`type`,`external_id`), + CONSTRAINT "records_fields_json" CHECK("fields" IS NULL OR json_valid("fields")), + CONSTRAINT "records_entity_pair" CHECK(("entity_type" IS NULL) = ("entity_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_records`(`id`, `account_id`, `type`, `external_id`, `fields`, `revision`, `fingerprint`, `entity_type`, `entity_id`, `projected_fingerprint`, `batch_id`, `created_at`, `updated_at`, `deleted_at`, `created_entity`) SELECT `id`, `account_id`, `type`, `external_id`, `fields`, `revision`, `fingerprint`, `entity_type`, `entity_id`, `projected_fingerprint`, `batch_id`, `created_at`, `updated_at`, `deleted_at`, `created_entity` FROM `records`;--> statement-breakpoint +DROP TABLE `records`;--> statement-breakpoint +ALTER TABLE `__new_records` RENAME TO `records`;--> statement-breakpoint +CREATE TABLE `__new_searches` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text UNIQUE, + `command` text NOT NULL, + `params` text NOT NULL, + `language` text NOT NULL, + `version` integer NOT NULL, + `fields_version` integer NOT NULL, + `created_at` integer NOT NULL, + `last_run_at` integer, + `runs` integer DEFAULT 0 NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT "searches_params_json" CHECK("params" IS NULL OR json_valid("params")) +); +--> statement-breakpoint +INSERT INTO `__new_searches`(`id`, `name`, `command`, `params`, `language`, `version`, `fields_version`, `created_at`, `last_run_at`, `runs`, `updated_at`) SELECT `id`, `name`, `command`, `params`, `language`, `version`, `fields_version`, `created_at`, `last_run_at`, `runs`, `updated_at` FROM `searches`;--> statement-breakpoint +DROP TABLE `searches`;--> statement-breakpoint +ALTER TABLE `__new_searches` RENAME TO `searches`;--> statement-breakpoint +CREATE TABLE `__new_subscription_prices` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `subscription_id` integer NOT NULL, + `amount` integer NOT NULL, + `currency` text NOT NULL, + `effective_from` text NOT NULL, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_subscription_prices_subscription_id_subscriptions_id_fk` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions`(`id`), + CONSTRAINT "subscription_prices_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "subscription_prices_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)), + CONSTRAINT "subscription_prices_amount_not_negative" CHECK("amount" IS NULL OR "amount" >= 0) +); +--> statement-breakpoint +INSERT INTO `__new_subscription_prices`(`id`, `subscription_id`, `amount`, `currency`, `effective_from`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`) SELECT `id`, `subscription_id`, `amount`, `currency`, `effective_from`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at` FROM `subscription_prices`;--> statement-breakpoint +DROP TABLE `subscription_prices`;--> statement-breakpoint +ALTER TABLE `__new_subscription_prices` RENAME TO `subscription_prices`;--> statement-breakpoint +CREATE TABLE `__new_subscriptions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL, + `direction` text NOT NULL, + `supplier_type` text NOT NULL, + `supplier_id` integer NOT NULL, + `customer_type` text NOT NULL, + `customer_id` integer NOT NULL, + `catalog_item_id` integer, + `contract_id` integer, + `project_id` integer, + `status` text NOT NULL, + `interval_count` integer NOT NULL, + `interval_unit` text NOT NULL, + `start_date` text NOT NULL, + `trial_end_date` text, + `next_renewal_date` text, + `cancelled_date` text, + `end_date` text, + `review` text NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `model` text, + `confirmed_by_type` text, + `confirmed_by_id` integer, + `source` text NOT NULL, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_subscriptions_catalog_item_id_catalog_items_id_fk` FOREIGN KEY (`catalog_item_id`) REFERENCES `catalog_items`(`id`), + CONSTRAINT `fk_subscriptions_contract_id_contracts_id_fk` FOREIGN KEY (`contract_id`) REFERENCES `contracts`(`id`), + CONSTRAINT `fk_subscriptions_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT "subscriptions_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "subscriptions_confirmed_by_pair" CHECK(("confirmed_by_type" IS NULL) = ("confirmed_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_subscriptions`(`id`, `name`, `direction`, `supplier_type`, `supplier_id`, `customer_type`, `customer_id`, `catalog_item_id`, `contract_id`, `project_id`, `status`, `interval_count`, `interval_unit`, `start_date`, `trial_end_date`, `next_renewal_date`, `cancelled_date`, `end_date`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `name`, `direction`, `supplier_type`, `supplier_id`, `customer_type`, `customer_id`, `catalog_item_id`, `contract_id`, `project_id`, `status`, `interval_count`, `interval_unit`, `start_date`, `trial_end_date`, `next_renewal_date`, `cancelled_date`, `end_date`, `review`, `author_type`, `author_id`, `model`, `confirmed_by_type`, `confirmed_by_id`, `source`, `metadata`, `created_at`, `updated_at`, `deleted_at` FROM `subscriptions`;--> statement-breakpoint +DROP TABLE `subscriptions`;--> statement-breakpoint +ALTER TABLE `__new_subscriptions` RENAME TO `subscriptions`;--> statement-breakpoint +CREATE TABLE `__new_syncs` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `kind` text NOT NULL, + `started_at` integer NOT NULL, + `finished_at` integer, + `status` text NOT NULL, + `counts` text, + `error` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_syncs_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT "syncs_counts_json" CHECK("counts" IS NULL OR json_valid("counts")) +); +--> statement-breakpoint +INSERT INTO `__new_syncs`(`id`, `account_id`, `kind`, `started_at`, `finished_at`, `status`, `counts`, `error`, `created_at`, `updated_at`) SELECT `id`, `account_id`, `kind`, `started_at`, `finished_at`, `status`, `counts`, `error`, `created_at`, `updated_at` FROM `syncs`;--> statement-breakpoint +DROP TABLE `syncs`;--> statement-breakpoint +ALTER TABLE `__new_syncs` RENAME TO `syncs`;--> statement-breakpoint +CREATE TABLE `__new_tag_consolidations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `source_id` integer NOT NULL, + `survivor_id` integer NOT NULL, + `source_member_ids` text NOT NULL, + `survivor_member_ids` text NOT NULL, + `actor_type` text NOT NULL, + `actor_id` integer NOT NULL, + `created_at` integer NOT NULL, + `idempotency_key` text NOT NULL UNIQUE, + `vocabulary_fingerprint` text NOT NULL, + `preview_fingerprint` text NOT NULL, + `counts` text NOT NULL, + `request_fingerprint` text NOT NULL, + CONSTRAINT `fk_tag_consolidations_source_id_canonical_tags_id_fk` FOREIGN KEY (`source_id`) REFERENCES `canonical_tags`(`id`), + CONSTRAINT `fk_tag_consolidations_survivor_id_canonical_tags_id_fk` FOREIGN KEY (`survivor_id`) REFERENCES `canonical_tags`(`id`), + CONSTRAINT "tag_consolidations_source_member_ids_json" CHECK("source_member_ids" IS NULL OR json_valid("source_member_ids")), + CONSTRAINT "tag_consolidations_survivor_member_ids_json" CHECK("survivor_member_ids" IS NULL OR json_valid("survivor_member_ids")), + CONSTRAINT "tag_consolidations_counts_json" CHECK("counts" IS NULL OR json_valid("counts")) +); +--> statement-breakpoint +INSERT INTO `__new_tag_consolidations`(`id`, `source_id`, `survivor_id`, `source_member_ids`, `survivor_member_ids`, `actor_type`, `actor_id`, `created_at`, `idempotency_key`, `vocabulary_fingerprint`, `preview_fingerprint`, `counts`, `request_fingerprint`) SELECT `id`, `source_id`, `survivor_id`, `source_member_ids`, `survivor_member_ids`, `actor_type`, `actor_id`, `created_at`, `idempotency_key`, `vocabulary_fingerprint`, `preview_fingerprint`, `counts`, `request_fingerprint` FROM `tag_consolidations`;--> statement-breakpoint +DROP TABLE `tag_consolidations`;--> statement-breakpoint +ALTER TABLE `__new_tag_consolidations` RENAME TO `tag_consolidations`;--> statement-breakpoint +CREATE TABLE `__new_taggings` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `tag_id` integer NOT NULL, + `taggable_type` text NOT NULL, + `taggable_id` integer NOT NULL, + `main` integer DEFAULT 0 NOT NULL, + `source` text NOT NULL, + `author_type` text, + `author_id` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_taggings_tag_id_tags_id_fk` FOREIGN KEY (`tag_id`) REFERENCES `canonical_tags`(`id`), + CONSTRAINT `taggings_tag_id_taggable_type_taggable_id_unique` UNIQUE(`tag_id`,`taggable_type`,`taggable_id`), + CONSTRAINT "taggings_author_pair" CHECK(("author_type" IS NULL) = ("author_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_taggings`(`id`, `tag_id`, `taggable_type`, `taggable_id`, `main`, `source`, `author_type`, `author_id`, `created_at`, `updated_at`) SELECT `id`, `tag_id`, `taggable_type`, `taggable_id`, `main`, `source`, `author_type`, `author_id`, `created_at`, `updated_at` FROM `taggings`;--> statement-breakpoint +DROP TABLE `taggings`;--> statement-breakpoint +ALTER TABLE `__new_taggings` RENAME TO `taggings`;--> statement-breakpoint +CREATE TABLE `__new_task_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `task_id` integer NOT NULL, + `actor_type` text, + `actor_id` integer, + `kind` text NOT NULL, + `changes` text, + `created_at` integer NOT NULL, + CONSTRAINT `fk_task_events_task_id_tasks_id_fk` FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`), + CONSTRAINT "task_events_changes_json" CHECK("changes" IS NULL OR json_valid("changes")), + CONSTRAINT "task_events_actor_pair" CHECK(("actor_type" IS NULL) = ("actor_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_task_events`(`id`, `task_id`, `actor_type`, `actor_id`, `kind`, `changes`, `created_at`) SELECT `id`, `task_id`, `actor_type`, `actor_id`, `kind`, `changes`, `created_at` FROM `task_events`;--> statement-breakpoint +DROP TABLE `task_events`;--> statement-breakpoint +ALTER TABLE `__new_task_events` RENAME TO `task_events`;--> statement-breakpoint +CREATE TABLE `__new_task_pairs` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `task_id` integer, + `source_locator` text, + `other_id` integer NOT NULL, + `score` integer NOT NULL, + `band` text NOT NULL, + `levels` text NOT NULL, + `reasons` text NOT NULL, + `decision` text NOT NULL, + `decided_by_type` text, + `decided_by_id` integer, + `decided_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_task_pairs_task_id_tasks_id_fk` FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`), + CONSTRAINT `fk_task_pairs_other_id_tasks_id_fk` FOREIGN KEY (`other_id`) REFERENCES `tasks`(`id`), + CONSTRAINT `task_pairs_task_id_other_id_unique` UNIQUE(`task_id`,`other_id`), + CONSTRAINT "task_pairs_levels_json" CHECK("levels" IS NULL OR json_valid("levels")), + CONSTRAINT "task_pairs_reasons_json" CHECK("reasons" IS NULL OR json_valid("reasons")), + CONSTRAINT "task_pairs_decided_by_pair" CHECK(("decided_by_type" IS NULL) = ("decided_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_task_pairs`(`id`, `task_id`, `source_locator`, `other_id`, `score`, `band`, `levels`, `reasons`, `decision`, `decided_by_type`, `decided_by_id`, `decided_at`, `created_at`, `updated_at`) SELECT `id`, `task_id`, `source_locator`, `other_id`, `score`, `band`, `levels`, `reasons`, `decision`, `decided_by_type`, `decided_by_id`, `decided_at`, `created_at`, `updated_at` FROM `task_pairs`;--> statement-breakpoint +DROP TABLE `task_pairs`;--> statement-breakpoint +ALTER TABLE `__new_task_pairs` RENAME TO `task_pairs`;--> statement-breakpoint +CREATE TABLE `__new_tasks` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `project_id` integer NOT NULL, + `number` integer NOT NULL, + `key` text NOT NULL UNIQUE, + `title` text NOT NULL, + `description` text, + `type` text NOT NULL, + `status` text NOT NULL, + `priority` integer, + `parent_id` integer, + `due_at` integer, + `started_at` integer, + `closed_at` integer, + `closed_by_type` text, + `closed_by_id` integer, + `close_reason` text, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `source` text NOT NULL, + `package_id` text UNIQUE, + `source_locator` text, + `source_kind` text, + `source_group` text, + `resolution` text, + `verdict` text, + `metadata` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `next_check_at` integer, + `title_folded` text, + `close_reason_folded` text, + `category` text, + `claimed_by` text, + `claimed_until` integer, + `close_certainty` real, + `close_suggested_as` text, + `close_suggested_by_type` text, + `close_suggested_by_id` integer, + `close_suggested_certainty` real, + `close_suggested_reason` text, + `close_suggested_at` integer, + `priority_score` real, + `agent` text, + `revision` integer DEFAULT 1 NOT NULL, + `provider` text, + `external_id` text, + `source_url` text, + CONSTRAINT `fk_tasks_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `fk_tasks_parent_id_tasks_id_fk` FOREIGN KEY (`parent_id`) REFERENCES `tasks`(`id`), + CONSTRAINT `tasks_project_id_number_unique` UNIQUE(`project_id`,`number`), + CONSTRAINT "tasks_metadata_json" CHECK("metadata" IS NULL OR json_valid("metadata")), + CONSTRAINT "tasks_closed_by_pair" CHECK(("closed_by_type" IS NULL) = ("closed_by_id" IS NULL)), + CONSTRAINT "tasks_close_suggested_by_pair" CHECK(("close_suggested_by_type" IS NULL) = ("close_suggested_by_id" IS NULL)) +); +--> statement-breakpoint +INSERT INTO `__new_tasks`(`id`, `project_id`, `number`, `key`, `title`, `description`, `type`, `status`, `priority`, `parent_id`, `due_at`, `started_at`, `closed_at`, `closed_by_type`, `closed_by_id`, `close_reason`, `author_type`, `author_id`, `source`, `package_id`, `source_locator`, `source_kind`, `source_group`, `resolution`, `verdict`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `next_check_at`, `title_folded`, `close_reason_folded`, `category`, `claimed_by`, `claimed_until`, `close_certainty`, `close_suggested_as`, `close_suggested_by_type`, `close_suggested_by_id`, `close_suggested_certainty`, `close_suggested_reason`, `close_suggested_at`, `priority_score`, `agent`, `revision`, `provider`, `external_id`, `source_url`) SELECT `id`, `project_id`, `number`, `key`, `title`, `description`, `type`, `status`, `priority`, `parent_id`, `due_at`, `started_at`, `closed_at`, `closed_by_type`, `closed_by_id`, `close_reason`, `author_type`, `author_id`, `source`, `package_id`, `source_locator`, `source_kind`, `source_group`, `resolution`, `verdict`, `metadata`, `created_at`, `updated_at`, `deleted_at`, `next_check_at`, `title_folded`, `close_reason_folded`, `category`, `claimed_by`, `claimed_until`, `close_certainty`, `close_suggested_as`, `close_suggested_by_type`, `close_suggested_by_id`, `close_suggested_certainty`, `close_suggested_reason`, `close_suggested_at`, `priority_score`, `agent`, `revision`, `provider`, `external_id`, `source_url` FROM `tasks`;--> statement-breakpoint +DROP TABLE `tasks`;--> statement-breakpoint +ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint +CREATE TABLE `__new_tracker_items` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `kind` text NOT NULL, + `external_id` text NOT NULL, + `parent_id` text, + `title` text NOT NULL, + `title_folded` text NOT NULL, + `body` text, + `normalized_text` text NOT NULL, + `data` text NOT NULL, + `source_created_at` integer, + `source_updated_at` integer, + `archived_at` integer, + `deleted_at` integer, + `synced_at` integer NOT NULL, + CONSTRAINT `fk_tracker_items_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `tracker_items_account_id_kind_external_id_unique` UNIQUE(`account_id`,`kind`,`external_id`), + CONSTRAINT "tracker_items_data_json" CHECK("data" IS NULL OR json_valid("data")) +); +--> statement-breakpoint +INSERT INTO `__new_tracker_items`(`id`, `account_id`, `kind`, `external_id`, `parent_id`, `title`, `title_folded`, `body`, `normalized_text`, `data`, `source_created_at`, `source_updated_at`, `archived_at`, `deleted_at`, `synced_at`) SELECT `id`, `account_id`, `kind`, `external_id`, `parent_id`, `title`, `title_folded`, `body`, `normalized_text`, `data`, `source_created_at`, `source_updated_at`, `archived_at`, `deleted_at`, `synced_at` FROM `tracker_items`;--> statement-breakpoint +DROP TABLE `tracker_items`;--> statement-breakpoint +ALTER TABLE `__new_tracker_items` RENAME TO `tracker_items`;--> statement-breakpoint +CREATE TABLE `__new_aliases` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `aliasable_type` text NOT NULL, + `aliasable_id` integer NOT NULL, + `account_id` integer, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `display` integer DEFAULT 0 NOT NULL, + `source` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_aliases_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_aliases`(`id`, `aliasable_type`, `aliasable_id`, `account_id`, `name`, `name_folded`, `display`, `source`, `created_at`, `updated_at`) SELECT `id`, `aliasable_type`, `aliasable_id`, `account_id`, `name`, `name_folded`, `display`, `source`, `created_at`, `updated_at` FROM `aliases`;--> statement-breakpoint +DROP TABLE `aliases`;--> statement-breakpoint +ALTER TABLE `__new_aliases` RENAME TO `aliases`;--> statement-breakpoint +CREATE TABLE `__new_calendar_entry_participants` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `entry_id` integer NOT NULL, + `identity_id` integer, + `email` text NOT NULL, + `name` text, + `response` text, + `optional` integer NOT NULL, + `organizer` integer NOT NULL, + `self` integer NOT NULL, + `resource` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_calendar_entry_participants_entry_id_calendar_entries_id_fk` FOREIGN KEY (`entry_id`) REFERENCES `calendar_entries`(`id`), + CONSTRAINT `fk_calendar_entry_participants_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `calendar_entry_participants_entry_id_email_unique` UNIQUE(`entry_id`,`email`) +); +--> statement-breakpoint +INSERT INTO `__new_calendar_entry_participants`(`id`, `entry_id`, `identity_id`, `email`, `name`, `response`, `optional`, `organizer`, `self`, `resource`, `created_at`, `updated_at`) SELECT `id`, `entry_id`, `identity_id`, `email`, `name`, `response`, `optional`, `organizer`, `self`, `resource`, `created_at`, `updated_at` FROM `calendar_entry_participants`;--> statement-breakpoint +DROP TABLE `calendar_entry_participants`;--> statement-breakpoint +ALTER TABLE `__new_calendar_entry_participants` RENAME TO `calendar_entry_participants`;--> statement-breakpoint +CREATE TABLE `__new_calendar_entry_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `entry_id` integer NOT NULL, + `title` text, + `starts_at` integer, + `ends_at` integer, + `location` text, + `status` text, + `recurrence` text, + `recurrence_ends_at` integer, + `external_updated_at` integer, + `created_at` integer NOT NULL, + CONSTRAINT `fk_calendar_entry_revisions_entry_id_calendar_entries_id_fk` FOREIGN KEY (`entry_id`) REFERENCES `calendar_entries`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_calendar_entry_revisions`(`id`, `entry_id`, `title`, `starts_at`, `ends_at`, `location`, `status`, `recurrence`, `recurrence_ends_at`, `external_updated_at`, `created_at`) SELECT `id`, `entry_id`, `title`, `starts_at`, `ends_at`, `location`, `status`, `recurrence`, `recurrence_ends_at`, `external_updated_at`, `created_at` FROM `calendar_entry_revisions`;--> statement-breakpoint +DROP TABLE `calendar_entry_revisions`;--> statement-breakpoint +ALTER TABLE `__new_calendar_entry_revisions` RENAME TO `calendar_entry_revisions`;--> statement-breakpoint +CREATE TABLE `__new_calendars` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `title` text, + `timezone` text, + `access_role` text, + `primary_calendar` integer NOT NULL, + `synced` integer NOT NULL, + `seen_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_calendars_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `calendars_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_calendars`(`id`, `account_id`, `external_id`, `title`, `timezone`, `access_role`, `primary_calendar`, `synced`, `seen_at`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `account_id`, `external_id`, `title`, `timezone`, `access_role`, `primary_calendar`, `synced`, `seen_at`, `created_at`, `updated_at`, `deleted_at` FROM `calendars`;--> statement-breakpoint +DROP TABLE `calendars`;--> statement-breakpoint +ALTER TABLE `__new_calendars` RENAME TO `calendars`;--> statement-breakpoint +CREATE TABLE `__new_canonical_tags` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text NOT NULL UNIQUE, + `kind` text DEFAULT 'tag' NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_canonical_tags`(`id`, `name`, `kind`, `created_at`, `updated_at`) SELECT `id`, `name`, `kind`, `created_at`, `updated_at` FROM `canonical_tags`;--> statement-breakpoint +DROP TABLE `canonical_tags`;--> statement-breakpoint +ALTER TABLE `__new_canonical_tags` RENAME TO `canonical_tags`;--> statement-breakpoint +CREATE TABLE `__new_chat_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `source_id` text NOT NULL, + `action` text NOT NULL, + `actor_identity_id` integer, + `title` text, + `happened_at` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_chat_events_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `fk_chat_events_actor_identity_id_identities_id_fk` FOREIGN KEY (`actor_identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `chat_events_chat_id_source_id_unique` UNIQUE(`chat_id`,`source_id`) +); +--> statement-breakpoint +INSERT INTO `__new_chat_events`(`id`, `chat_id`, `source_id`, `action`, `actor_identity_id`, `title`, `happened_at`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `source_id`, `action`, `actor_identity_id`, `title`, `happened_at`, `created_at`, `updated_at` FROM `chat_events`;--> statement-breakpoint +DROP TABLE `chat_events`;--> statement-breakpoint +ALTER TABLE `__new_chat_events` RENAME TO `chat_events`;--> statement-breakpoint +CREATE TABLE `__new_chat_revision_source` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `source` text NOT NULL, + `at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_chat_revision_source`(`id`, `source`, `at`) SELECT `id`, `source`, `at` FROM `chat_revision_source`;--> statement-breakpoint +DROP TABLE `chat_revision_source`;--> statement-breakpoint +ALTER TABLE `__new_chat_revision_source` RENAME TO `chat_revision_source`;--> statement-breakpoint +CREATE TABLE `__new_chat_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `account_id` integer NOT NULL, + `field` text NOT NULL, + `old_value` text, + `new_value` text, + `source` text, + `created_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_chat_revisions`(`id`, `chat_id`, `account_id`, `field`, `old_value`, `new_value`, `source`, `created_at`) SELECT `id`, `chat_id`, `account_id`, `field`, `old_value`, `new_value`, `source`, `created_at` FROM `chat_revisions`;--> statement-breakpoint +DROP TABLE `chat_revisions`;--> statement-breakpoint +ALTER TABLE `__new_chat_revisions` RENAME TO `chat_revisions`;--> statement-breakpoint +CREATE TABLE `__new_content_channels` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `kind` text NOT NULL, + `network` text NOT NULL, + `name` text NOT NULL, + `url` text, + `handle` text, + `deleted_at` integer, + `synced_at` integer NOT NULL, + CONSTRAINT `fk_content_channels_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `content_channels_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_content_channels`(`id`, `account_id`, `external_id`, `kind`, `network`, `name`, `url`, `handle`, `deleted_at`, `synced_at`) SELECT `id`, `account_id`, `external_id`, `kind`, `network`, `name`, `url`, `handle`, `deleted_at`, `synced_at` FROM `content_channels`;--> statement-breakpoint +DROP TABLE `content_channels`;--> statement-breakpoint +ALTER TABLE `__new_content_channels` RENAME TO `content_channels`;--> statement-breakpoint +CREATE TABLE `__new_content_post_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `post_id` integer NOT NULL, + `title` text, + `body` text, + `status` text NOT NULL, + `content_hash` text NOT NULL, + `version` text, + `reason` text NOT NULL, + `created_at` integer NOT NULL, + CONSTRAINT `fk_content_post_revisions_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_content_post_revisions`(`id`, `post_id`, `title`, `body`, `status`, `content_hash`, `version`, `reason`, `created_at`) SELECT `id`, `post_id`, `title`, `body`, `status`, `content_hash`, `version`, `reason`, `created_at` FROM `content_post_revisions`;--> statement-breakpoint +DROP TABLE `content_post_revisions`;--> statement-breakpoint +ALTER TABLE `__new_content_post_revisions` RENAME TO `content_post_revisions`;--> statement-breakpoint +CREATE TABLE `__new_conversations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `first_message_id` integer NOT NULL, + `build` integer NOT NULL, + `first_at` integer NOT NULL, + `last_at` integer NOT NULL, + `message_count` integer NOT NULL, + `built_at` integer NOT NULL, + `algorithm_version` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_conversations_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_conversations_first_message_id_messages_id_fk` FOREIGN KEY (`first_message_id`) REFERENCES `messages`(`id`) ON DELETE CASCADE +); +--> statement-breakpoint +INSERT INTO `__new_conversations`(`id`, `chat_id`, `first_message_id`, `build`, `first_at`, `last_at`, `message_count`, `built_at`, `algorithm_version`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `first_message_id`, `build`, `first_at`, `last_at`, `message_count`, `built_at`, `algorithm_version`, `created_at`, `updated_at` FROM `conversations`;--> statement-breakpoint +DROP TABLE `conversations`;--> statement-breakpoint +ALTER TABLE `__new_conversations` RENAME TO `conversations`;--> statement-breakpoint +CREATE TABLE `__new_crm_files` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `owner_kind` text NOT NULL, + `owner_id` text NOT NULL, + `owner_assignee` text, + `source` text NOT NULL, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `mime` text, + `size` integer, + `external_created_at` integer, + `local_path` text, + `content_sha256` text, + `text` text, + `normalized_text` text, + `extraction` text, + `extraction_error` text, + `downloaded_by` text, + `downloaded_at` integer NOT NULL, + CONSTRAINT `fk_crm_files_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `crm_files_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_crm_files`(`id`, `account_id`, `external_id`, `owner_kind`, `owner_id`, `owner_assignee`, `source`, `name`, `name_folded`, `mime`, `size`, `external_created_at`, `local_path`, `content_sha256`, `text`, `normalized_text`, `extraction`, `extraction_error`, `downloaded_by`, `downloaded_at`) SELECT `id`, `account_id`, `external_id`, `owner_kind`, `owner_id`, `owner_assignee`, `source`, `name`, `name_folded`, `mime`, `size`, `external_created_at`, `local_path`, `content_sha256`, `text`, `normalized_text`, `extraction`, `extraction_error`, `downloaded_by`, `downloaded_at` FROM `crm_files`;--> statement-breakpoint +DROP TABLE `crm_files`;--> statement-breakpoint +ALTER TABLE `__new_crm_files` RENAME TO `crm_files`;--> statement-breakpoint +CREATE TABLE `__new_decision_requests` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `token_digest` text NOT NULL UNIQUE, + `proposal_id` text NOT NULL, + `action` text NOT NULL, + `batch_digest` text NOT NULL, + `channel` text NOT NULL, + `bot_profile` text NOT NULL, + `chat_id` text NOT NULL, + `message_id` text NOT NULL, + `owner_user_id` text NOT NULL, + `created_at` integer NOT NULL, + `expires_at` integer NOT NULL, + `used_at` integer, + `cancelled_at` integer +); +--> statement-breakpoint +INSERT INTO `__new_decision_requests`(`id`, `token_digest`, `proposal_id`, `action`, `batch_digest`, `channel`, `bot_profile`, `chat_id`, `message_id`, `owner_user_id`, `created_at`, `expires_at`, `used_at`, `cancelled_at`) SELECT `id`, `token_digest`, `proposal_id`, `action`, `batch_digest`, `channel`, `bot_profile`, `chat_id`, `message_id`, `owner_user_id`, `created_at`, `expires_at`, `used_at`, `cancelled_at` FROM `decision_requests`;--> statement-breakpoint +DROP TABLE `decision_requests`;--> statement-breakpoint +ALTER TABLE `__new_decision_requests` RENAME TO `decision_requests`;--> statement-breakpoint +CREATE TABLE `__new_document_changes` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `document_id` integer NOT NULL, + `path` text NOT NULL, + `title` text, + `event` text NOT NULL, + `revision` integer NOT NULL, + `at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_document_changes`(`id`, `account_id`, `document_id`, `path`, `title`, `event`, `revision`, `at`) SELECT `id`, `account_id`, `document_id`, `path`, `title`, `event`, `revision`, `at` FROM `document_changes`;--> statement-breakpoint +DROP TABLE `document_changes`;--> statement-breakpoint +ALTER TABLE `__new_document_changes` RENAME TO `document_changes`;--> statement-breakpoint +CREATE TABLE `__new_email_recipients` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `email_id` integer NOT NULL, + `identity_id` integer, + `address` text NOT NULL, + `name` text, + `role` text NOT NULL, + `position` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_email_recipients_email_id_emails_id_fk` FOREIGN KEY (`email_id`) REFERENCES `emails`(`id`), + CONSTRAINT `fk_email_recipients_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_email_recipients`(`id`, `email_id`, `identity_id`, `address`, `name`, `role`, `position`, `created_at`, `updated_at`) SELECT `id`, `email_id`, `identity_id`, `address`, `name`, `role`, `position`, `created_at`, `updated_at` FROM `email_recipients`;--> statement-breakpoint +DROP TABLE `email_recipients`;--> statement-breakpoint +ALTER TABLE `__new_email_recipients` RENAME TO `email_recipients`;--> statement-breakpoint +CREATE TABLE `__new_entity_link_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `linkable_type` text NOT NULL, + `linkable_id` integer NOT NULL, + `entity_type` text NOT NULL, + `from_entity_id` integer, + `to_entity_id` integer, + `method` text NOT NULL, + `confidence` real, + `author` text NOT NULL, + `created_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_entity_link_events`(`id`, `linkable_type`, `linkable_id`, `entity_type`, `from_entity_id`, `to_entity_id`, `method`, `confidence`, `author`, `created_at`) SELECT `id`, `linkable_type`, `linkable_id`, `entity_type`, `from_entity_id`, `to_entity_id`, `method`, `confidence`, `author`, `created_at` FROM `entity_link_events`;--> statement-breakpoint +DROP TABLE `entity_link_events`;--> statement-breakpoint +ALTER TABLE `__new_entity_link_events` RENAME TO `entity_link_events`;--> statement-breakpoint +CREATE TABLE `__new_event_series` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `title` text, + `recurrence` text, + `origin` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_event_series`(`id`, `title`, `recurrence`, `origin`, `created_at`, `updated_at`) SELECT `id`, `title`, `recurrence`, `origin`, `created_at`, `updated_at` FROM `event_series`;--> statement-breakpoint +DROP TABLE `event_series`;--> statement-breakpoint +ALTER TABLE `__new_event_series` RENAME TO `event_series`;--> statement-breakpoint +CREATE TABLE `__new_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `event_series_id` integer, + `title` text, + `description` text, + `location` text, + `starts_at` integer, + `ends_at` integer, + `timezone` text, + `origin` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `status` text, + `all_day` integer, + `source_deleted_at` integer, + CONSTRAINT `fk_events_event_series_id_event_series_id_fk` FOREIGN KEY (`event_series_id`) REFERENCES `event_series`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_events`(`id`, `event_series_id`, `title`, `description`, `location`, `starts_at`, `ends_at`, `timezone`, `origin`, `created_at`, `updated_at`, `deleted_at`, `status`, `all_day`, `source_deleted_at`) SELECT `id`, `event_series_id`, `title`, `description`, `location`, `starts_at`, `ends_at`, `timezone`, `origin`, `created_at`, `updated_at`, `deleted_at`, `status`, `all_day`, `source_deleted_at` FROM `events`;--> statement-breakpoint +DROP TABLE `events`;--> statement-breakpoint +ALTER TABLE `__new_events` RENAME TO `events`;--> statement-breakpoint +CREATE TABLE `__new_fact_removals` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `fact_id` integer NOT NULL, + `subject` text, + `removed_by` text NOT NULL, + `bot` text, + `reason` text, + `removed_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_fact_removals`(`id`, `fact_id`, `subject`, `removed_by`, `bot`, `reason`, `removed_at`) SELECT `id`, `fact_id`, `subject`, `removed_by`, `bot`, `reason`, `removed_at` FROM `fact_removals`;--> statement-breakpoint +DROP TABLE `fact_removals`;--> statement-breakpoint +ALTER TABLE `__new_fact_removals` RENAME TO `fact_removals`;--> statement-breakpoint +CREATE TABLE `__new_identity_link_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `identity_id` integer NOT NULL, + `from_person_id` integer, + `to_person_id` integer NOT NULL, + `method` text NOT NULL, + `created_at` integer NOT NULL, + `author` text NOT NULL, + CONSTRAINT `fk_identity_link_events_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `fk_identity_link_events_from_person_id_persons_id_fk` FOREIGN KEY (`from_person_id`) REFERENCES `persons`(`id`), + CONSTRAINT `fk_identity_link_events_to_person_id_persons_id_fk` FOREIGN KEY (`to_person_id`) REFERENCES `persons`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_identity_link_events`(`id`, `identity_id`, `from_person_id`, `to_person_id`, `method`, `created_at`, `author`) SELECT `id`, `identity_id`, `from_person_id`, `to_person_id`, `method`, `created_at`, `author` FROM `identity_link_events`;--> statement-breakpoint +DROP TABLE `identity_link_events`;--> statement-breakpoint +ALTER TABLE `__new_identity_link_events` RENAME TO `identity_link_events`;--> statement-breakpoint +CREATE TABLE `__new_mailboxes` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer NOT NULL, + `external_id` text NOT NULL, + `name` text NOT NULL, + `kind` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `name_folded` text, + CONSTRAINT `fk_mailboxes_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`), + CONSTRAINT `mailboxes_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_mailboxes`(`id`, `account_id`, `external_id`, `name`, `kind`, `created_at`, `updated_at`, `name_folded`) SELECT `id`, `account_id`, `external_id`, `name`, `kind`, `created_at`, `updated_at`, `name_folded` FROM `mailboxes`;--> statement-breakpoint +DROP TABLE `mailboxes`;--> statement-breakpoint +ALTER TABLE `__new_mailboxes` RENAME TO `mailboxes`;--> statement-breakpoint +CREATE TABLE `__new_member_observations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `observed_at` integer NOT NULL, + `started_at` integer, + `complete` integer NOT NULL, + `reported_count` integer, + `listed_count` integer NOT NULL, + `source` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_member_observations_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_member_observations`(`id`, `chat_id`, `observed_at`, `started_at`, `complete`, `reported_count`, `listed_count`, `source`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `observed_at`, `started_at`, `complete`, `reported_count`, `listed_count`, `source`, `created_at`, `updated_at` FROM `member_observations`;--> statement-breakpoint +DROP TABLE `member_observations`;--> statement-breakpoint +ALTER TABLE `__new_member_observations` RENAME TO `member_observations`;--> statement-breakpoint +CREATE TABLE `__new_member_stays` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `identity_id` integer NOT NULL, + `first_seen_at` integer NOT NULL, + `last_seen_at` integer NOT NULL, + `joined_at` integer, + `invited_by_identity_id` integer, + `role` text, + `left_at` integer, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_member_stays_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `fk_member_stays_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `fk_member_stays_invited_by_identity_id_identities_id_fk` FOREIGN KEY (`invited_by_identity_id`) REFERENCES `identities`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_member_stays`(`id`, `chat_id`, `identity_id`, `first_seen_at`, `last_seen_at`, `joined_at`, `invited_by_identity_id`, `role`, `left_at`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `identity_id`, `first_seen_at`, `last_seen_at`, `joined_at`, `invited_by_identity_id`, `role`, `left_at`, `created_at`, `updated_at` FROM `member_stays`;--> statement-breakpoint +DROP TABLE `member_stays`;--> statement-breakpoint +ALTER TABLE `__new_member_stays` RENAME TO `member_stays`;--> statement-breakpoint +CREATE TABLE `__new_message_links` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `message_id` integer NOT NULL, + `parent_id` integer, + `source` text NOT NULL, + `kind` text NOT NULL, + `confidence` real NOT NULL, + `method` text NOT NULL, + `version` text, + `batch` text, + `build` integer, + `created_at` integer NOT NULL, + `stale_at` integer, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_message_links_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_message_links_message_id_messages_id_fk` FOREIGN KEY (`message_id`) REFERENCES `messages`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_message_links_parent_id_messages_id_fk` FOREIGN KEY (`parent_id`) REFERENCES `messages`(`id`) ON DELETE CASCADE +); +--> statement-breakpoint +INSERT INTO `__new_message_links`(`id`, `chat_id`, `message_id`, `parent_id`, `source`, `kind`, `confidence`, `method`, `version`, `batch`, `build`, `created_at`, `stale_at`, `updated_at`) SELECT `id`, `chat_id`, `message_id`, `parent_id`, `source`, `kind`, `confidence`, `method`, `version`, `batch`, `build`, `created_at`, `stale_at`, `updated_at` FROM `message_links`;--> statement-breakpoint +DROP TABLE `message_links`;--> statement-breakpoint +ALTER TABLE `__new_message_links` RENAME TO `message_links`;--> statement-breakpoint +CREATE TABLE `__new_message_reactions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `chat_id` integer NOT NULL, + `message_external_id` text NOT NULL, + `identity_id` integer NOT NULL, + `own` integer NOT NULL, + `reaction` text, + `reacted_at` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_message_reactions_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `fk_message_reactions_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `message_reactions_chat_id_message_external_id_identity_id_unique` UNIQUE(`chat_id`,`message_external_id`,`identity_id`) +); +--> statement-breakpoint +INSERT INTO `__new_message_reactions`(`id`, `chat_id`, `message_external_id`, `identity_id`, `own`, `reaction`, `reacted_at`, `created_at`, `updated_at`) SELECT `id`, `chat_id`, `message_external_id`, `identity_id`, `own`, `reaction`, `reacted_at`, `created_at`, `updated_at` FROM `message_reactions`;--> statement-breakpoint +DROP TABLE `message_reactions`;--> statement-breakpoint +ALTER TABLE `__new_message_reactions` RENAME TO `message_reactions`;--> statement-breakpoint +CREATE TABLE `__new_message_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `message_id` integer NOT NULL, + `text` text NOT NULL, + `edited_at` integer, + `created_at` integer NOT NULL, + CONSTRAINT `fk_message_revisions_message_id_messages_id_fk` FOREIGN KEY (`message_id`) REFERENCES `messages`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_message_revisions`(`id`, `message_id`, `text`, `edited_at`, `created_at`) SELECT `id`, `message_id`, `text`, `edited_at`, `created_at` FROM `message_revisions`;--> statement-breakpoint +DROP TABLE `message_revisions`;--> statement-breakpoint +ALTER TABLE `__new_message_revisions` RENAME TO `message_revisions`;--> statement-breakpoint +CREATE TABLE `__new_message_transcripts` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `message_id` integer, + `chat_id` integer NOT NULL, + `message_external_id` text NOT NULL, + `text` text NOT NULL, + `source` text NOT NULL, + `heard_at` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_message_transcripts_message_id_messages_id_fk` FOREIGN KEY (`message_id`) REFERENCES `messages`(`id`), + CONSTRAINT `fk_message_transcripts_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`), + CONSTRAINT `message_transcripts_chat_id_message_external_id_unique` UNIQUE(`chat_id`,`message_external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_message_transcripts`(`id`, `message_id`, `chat_id`, `message_external_id`, `text`, `source`, `heard_at`, `created_at`, `updated_at`) SELECT `id`, `message_id`, `chat_id`, `message_external_id`, `text`, `source`, `heard_at`, `created_at`, `updated_at` FROM `message_transcripts`;--> statement-breakpoint +DROP TABLE `message_transcripts`;--> statement-breakpoint +ALTER TABLE `__new_message_transcripts` RENAME TO `message_transcripts`;--> statement-breakpoint +CREATE TABLE `__new_note_revisions` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `note_id` integer NOT NULL, + `body` text NOT NULL, + `revision` integer NOT NULL, + `created_at` integer NOT NULL, + CONSTRAINT `fk_note_revisions_note_id_notes_id_fk` FOREIGN KEY (`note_id`) REFERENCES `notes`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_note_revisions`(`id`, `note_id`, `body`, `revision`, `created_at`) SELECT `id`, `note_id`, `body`, `revision`, `created_at` FROM `note_revisions`;--> statement-breakpoint +DROP TABLE `note_revisions`;--> statement-breakpoint +ALTER TABLE `__new_note_revisions` RENAME TO `note_revisions`;--> statement-breakpoint +CREATE TABLE `__new_organization_identities` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `identity_id` integer NOT NULL, + `organization_id` integer NOT NULL, + `method` text NOT NULL, + `author` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_organization_identities_identity_id_identities_id_fk` FOREIGN KEY (`identity_id`) REFERENCES `identities`(`id`), + CONSTRAINT `fk_organization_identities_organization_id_organizations_id_fk` FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`), + CONSTRAINT `organization_identities_identity_id_organization_id_unique` UNIQUE(`identity_id`,`organization_id`) +); +--> statement-breakpoint +INSERT INTO `__new_organization_identities`(`id`, `identity_id`, `organization_id`, `method`, `author`, `created_at`, `updated_at`) SELECT `id`, `identity_id`, `organization_id`, `method`, `author`, `created_at`, `updated_at` FROM `organization_identities`;--> statement-breakpoint +DROP TABLE `organization_identities`;--> statement-breakpoint +ALTER TABLE `__new_organization_identities` RENAME TO `organization_identities`;--> statement-breakpoint +CREATE TABLE `__new_payment_allocations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `payment_id` integer NOT NULL, + `invoice_id` integer NOT NULL, + `amount` integer NOT NULL, + `author_type` text NOT NULL, + `author_id` integer NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_payment_allocations_payment_id_payments_id_fk` FOREIGN KEY (`payment_id`) REFERENCES `payments`(`id`), + CONSTRAINT `fk_payment_allocations_invoice_id_invoices_id_fk` FOREIGN KEY (`invoice_id`) REFERENCES `invoices`(`id`), + CONSTRAINT `payment_allocations_payment_id_invoice_id_unique` UNIQUE(`payment_id`,`invoice_id`) +); +--> statement-breakpoint +INSERT INTO `__new_payment_allocations`(`id`, `payment_id`, `invoice_id`, `amount`, `author_type`, `author_id`, `created_at`, `updated_at`) SELECT `id`, `payment_id`, `invoice_id`, `amount`, `author_type`, `author_id`, `created_at`, `updated_at` FROM `payment_allocations`;--> statement-breakpoint +DROP TABLE `payment_allocations`;--> statement-breakpoint +ALTER TABLE `__new_payment_allocations` RENAME TO `payment_allocations`;--> statement-breakpoint +CREATE TABLE `__new_persons` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `name` text, + `owner` integer DEFAULT 0 NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `kind` text, + `name_order` text, + `messages_from` integer, + `task_count` integer, + `last_contact` integer +); +--> statement-breakpoint +INSERT INTO `__new_persons`(`id`, `name`, `owner`, `created_at`, `updated_at`, `kind`, `name_order`, `messages_from`, `task_count`, `last_contact`) SELECT `id`, `name`, `owner`, `created_at`, `updated_at`, `kind`, `name_order`, `messages_from`, `task_count`, `last_contact` FROM `persons`;--> statement-breakpoint +DROP TABLE `persons`;--> statement-breakpoint +ALTER TABLE `__new_persons` RENAME TO `persons`;--> statement-breakpoint +CREATE TABLE `__new_pipeline_stage_changes` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `item_type` text NOT NULL, + `item_id` integer NOT NULL, + `pipeline_id` integer NOT NULL, + `from_stage_id` integer, + `to_stage_id` integer NOT NULL, + `changed_at` integer NOT NULL, + CONSTRAINT `fk_pipeline_stage_changes_pipeline_id_pipelines_id_fk` FOREIGN KEY (`pipeline_id`) REFERENCES `pipelines`(`id`), + CONSTRAINT `fk_pipeline_stage_changes_from_stage_id_pipeline_stages_id_fk` FOREIGN KEY (`from_stage_id`) REFERENCES `pipeline_stages`(`id`), + CONSTRAINT `fk_pipeline_stage_changes_to_stage_id_pipeline_stages_id_fk` FOREIGN KEY (`to_stage_id`) REFERENCES `pipeline_stages`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_pipeline_stage_changes`(`id`, `item_type`, `item_id`, `pipeline_id`, `from_stage_id`, `to_stage_id`, `changed_at`) SELECT `id`, `item_type`, `item_id`, `pipeline_id`, `from_stage_id`, `to_stage_id`, `changed_at` FROM `pipeline_stage_changes`;--> statement-breakpoint +DROP TABLE `pipeline_stage_changes`;--> statement-breakpoint +ALTER TABLE `__new_pipeline_stage_changes` RENAME TO `pipeline_stage_changes`;--> statement-breakpoint +CREATE TABLE `__new_pipeline_stages` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `pipeline_id` integer NOT NULL, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `position` integer NOT NULL, + `outcome` text DEFAULT 'open' NOT NULL, + `external_id` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + `base_stage_id` integer, + `base_confirmed` integer DEFAULT 0 NOT NULL, + CONSTRAINT `fk_pipeline_stages_pipeline_id_pipelines_id_fk` FOREIGN KEY (`pipeline_id`) REFERENCES `pipelines`(`id`), + CONSTRAINT `fk_pipeline_stages_base_stage_id_pipeline_stages_id_fk` FOREIGN KEY (`base_stage_id`) REFERENCES `pipeline_stages`(`id`), + CONSTRAINT `pipeline_stages_pipeline_id_name_folded_unique` UNIQUE(`pipeline_id`,`name_folded`) +); +--> statement-breakpoint +INSERT INTO `__new_pipeline_stages`(`id`, `pipeline_id`, `name`, `name_folded`, `position`, `outcome`, `external_id`, `created_at`, `updated_at`, `deleted_at`, `base_stage_id`, `base_confirmed`) SELECT `id`, `pipeline_id`, `name`, `name_folded`, `position`, `outcome`, `external_id`, `created_at`, `updated_at`, `deleted_at`, `base_stage_id`, `base_confirmed` FROM `pipeline_stages`;--> statement-breakpoint +DROP TABLE `pipeline_stages`;--> statement-breakpoint +ALTER TABLE `__new_pipeline_stages` RENAME TO `pipeline_stages`;--> statement-breakpoint +CREATE TABLE `__new_pipelines` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `account_id` integer, + `external_id` text, + `kind` text DEFAULT 'deal' NOT NULL, + `name` text NOT NULL, + `name_folded` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + `deleted_at` integer, + CONSTRAINT `fk_pipelines_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_pipelines`(`id`, `account_id`, `external_id`, `kind`, `name`, `name_folded`, `created_at`, `updated_at`, `deleted_at`) SELECT `id`, `account_id`, `external_id`, `kind`, `name`, `name_folded`, `created_at`, `updated_at`, `deleted_at` FROM `pipelines`;--> statement-breakpoint +DROP TABLE `pipelines`;--> statement-breakpoint +ALTER TABLE `__new_pipelines` RENAME TO `pipelines`;--> statement-breakpoint +CREATE TABLE `__new_places` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `address` text NOT NULL, + `folded` text NOT NULL UNIQUE, + `author` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_places`(`id`, `address`, `folded`, `author`, `created_at`, `updated_at`) SELECT `id`, `address`, `folded`, `author`, `created_at`, `updated_at` FROM `places`;--> statement-breakpoint +DROP TABLE `places`;--> statement-breakpoint +ALTER TABLE `__new_places` RENAME TO `places`;--> statement-breakpoint +CREATE TABLE `__new_record_relations` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `record_id` integer NOT NULL, + `role` text NOT NULL, + `target_type` text NOT NULL, + `target_external_id` text NOT NULL, + `target_id` integer, + `created_at` integer NOT NULL, + `amount` text, + `as_role` text, + CONSTRAINT `fk_record_relations_record_id_records_id_fk` FOREIGN KEY (`record_id`) REFERENCES `records`(`id`), + CONSTRAINT `fk_record_relations_target_id_records_id_fk` FOREIGN KEY (`target_id`) REFERENCES `records`(`id`), + CONSTRAINT `record_relations_record_id_role_target_type_target_external_id_unique` UNIQUE(`record_id`,`role`,`target_type`,`target_external_id`) +); +--> statement-breakpoint +INSERT INTO `__new_record_relations`(`id`, `record_id`, `role`, `target_type`, `target_external_id`, `target_id`, `created_at`, `amount`, `as_role`) SELECT `id`, `record_id`, `role`, `target_type`, `target_external_id`, `target_id`, `created_at`, `amount`, `as_role` FROM `record_relations`;--> statement-breakpoint +DROP TABLE `record_relations`;--> statement-breakpoint +ALTER TABLE `__new_record_relations` RENAME TO `record_relations`;--> statement-breakpoint +CREATE TABLE `__new_reminders` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `task_id` integer NOT NULL, + `account_id` integer NOT NULL, + `due_at` integer NOT NULL, + `timezone` text NOT NULL, + `state` text NOT NULL, + `revision` integer DEFAULT 1 NOT NULL, + `lease_until` integer, + `receipt` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_reminders_task_id_tasks_id_fk` FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`), + CONSTRAINT `fk_reminders_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) +); +--> statement-breakpoint +INSERT INTO `__new_reminders`(`id`, `task_id`, `account_id`, `due_at`, `timezone`, `state`, `revision`, `lease_until`, `receipt`, `created_at`, `updated_at`) SELECT `id`, `task_id`, `account_id`, `due_at`, `timezone`, `state`, `revision`, `lease_until`, `receipt`, `created_at`, `updated_at` FROM `reminders`;--> statement-breakpoint +DROP TABLE `reminders`;--> statement-breakpoint +ALTER TABLE `__new_reminders` RENAME TO `reminders`;--> statement-breakpoint +CREATE TABLE `__new_task_assignments` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `task_id` integer NOT NULL, + `assignee_type` text NOT NULL, + `assignee_id` integer NOT NULL, + `role` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_task_assignments_task_id_tasks_id_fk` FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`), + CONSTRAINT `task_assignments_task_id_assignee_type_assignee_id_role_unique` UNIQUE(`task_id`,`assignee_type`,`assignee_id`,`role`) +); +--> statement-breakpoint +INSERT INTO `__new_task_assignments`(`id`, `task_id`, `assignee_type`, `assignee_id`, `role`, `created_at`, `updated_at`) SELECT `id`, `task_id`, `assignee_type`, `assignee_id`, `role`, `created_at`, `updated_at` FROM `task_assignments`;--> statement-breakpoint +DROP TABLE `task_assignments`;--> statement-breakpoint +ALTER TABLE `__new_task_assignments` RENAME TO `task_assignments`;--> statement-breakpoint +CREATE TABLE `__new_templates_history` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `key` text NOT NULL, + `channel` text NOT NULL, + `language` text NOT NULL, + `body` text NOT NULL, + `saved_at` integer NOT NULL, + `saved_by` text NOT NULL, + `replaced_at` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_templates_history`(`id`, `key`, `channel`, `language`, `body`, `saved_at`, `saved_by`, `replaced_at`) SELECT `id`, `key`, `channel`, `language`, `body`, `saved_at`, `saved_by`, `replaced_at` FROM `templates_history`;--> statement-breakpoint +DROP TABLE `templates_history`;--> statement-breakpoint +ALTER TABLE `__new_templates_history` RENAME TO `templates_history`;--> statement-breakpoint +CREATE TABLE `__new_transaction_splits` ( + `id` integer PRIMARY KEY AUTOINCREMENT, + `transaction_id` integer NOT NULL, + `position` integer NOT NULL, + `category` text NOT NULL, + `category_folded` text NOT NULL, + `amount` integer NOT NULL, + `project_id` integer, + `note` text, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + CONSTRAINT `fk_transaction_splits_transaction_id_financial_transactions_id_fk` FOREIGN KEY (`transaction_id`) REFERENCES `financial_transactions`(`id`), + CONSTRAINT `fk_transaction_splits_project_id_projects_id_fk` FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`), + CONSTRAINT `transaction_splits_transaction_id_position_unique` UNIQUE(`transaction_id`,`position`) +); +--> statement-breakpoint +INSERT INTO `__new_transaction_splits`(`id`, `transaction_id`, `position`, `category`, `category_folded`, `amount`, `project_id`, `note`, `created_at`, `updated_at`) SELECT `id`, `transaction_id`, `position`, `category`, `category_folded`, `amount`, `project_id`, `note`, `created_at`, `updated_at` FROM `transaction_splits`;--> statement-breakpoint +DROP TABLE `transaction_splits`;--> statement-breakpoint +ALTER TABLE `__new_transaction_splits` RENAME TO `transaction_splits`;--> statement-breakpoint +CREATE INDEX `accounts_by_organization_id` ON `accounts` (`organization_id`);--> statement-breakpoint +CREATE INDEX `agent_actions_by_started_at_desc` ON `agent_actions` ("started_at" desc);--> statement-breakpoint +CREATE INDEX `agent_actions_by_actor_type_actor_id` ON `agent_actions` (`actor_type`,`actor_id`);--> statement-breakpoint +CREATE INDEX `agent_actions_by_target_type_target_id` ON `agent_actions` (`target_type`,`target_id`);--> statement-breakpoint +CREATE INDEX `attachments_by_name_folded` ON `attachments` (`name_folded`);--> statement-breakpoint +CREATE INDEX `attachments_local_path_to_fold` ON `attachments` (`id`) WHERE local_path IS NOT NULL AND local_path_folded IS NULL;--> statement-breakpoint +CREATE INDEX `bot_updates_by_account_id_received_at_desc` ON `bot_updates` (`account_id`,"received_at" desc);--> statement-breakpoint +CREATE INDEX `bots_by_owner_person_id` ON `bots` (`owner_person_id`);--> statement-breakpoint +CREATE INDEX `calendar_entries_by_calendar_id_starts_at` ON `calendar_entries` (`calendar_id`,`starts_at`);--> statement-breakpoint +CREATE INDEX `calendar_entries_by_ical_uid` ON `calendar_entries` (`ical_uid`) WHERE ical_uid IS NOT NULL;--> statement-breakpoint +CREATE INDEX `calendar_entries_by_join_key` ON `calendar_entries` (`join_key`) WHERE join_key IS NOT NULL;--> statement-breakpoint +CREATE INDEX `calendar_entries_by_calendar_id_series_external_id` ON `calendar_entries` (`calendar_id`,`series_external_id`) WHERE series_external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `calendar_entries_by_event_id` ON `calendar_entries` (`event_id`);--> statement-breakpoint +CREATE INDEX `calendar_entries_by_event_series_id` ON `calendar_entries` (`event_series_id`);--> statement-breakpoint +CREATE INDEX `calendar_entries_by_event_type_event_id` ON `calendar_entries` (`event_type`,`event_id`);--> statement-breakpoint +CREATE INDEX `calendar_entries_by_organizer_identity_id` ON `calendar_entries` (`organizer_identity_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `catalog_items_by_supplier_type_supplier_id_sku` ON `catalog_items` (`supplier_type`,`supplier_id`,`sku`) WHERE supplier_id IS NOT NULL AND sku IS NOT NULL AND deleted_at IS NULL;--> statement-breakpoint +CREATE UNIQUE INDEX `catalog_items_by_sku` ON `catalog_items` (`sku`) WHERE supplier_id IS NULL AND sku IS NOT NULL AND deleted_at IS NULL;--> statement-breakpoint +CREATE INDEX `catalog_items_by_name_folded` ON `catalog_items` (`name_folded`);--> statement-breakpoint +CREATE INDEX `catalog_items_by_author_type_author_id` ON `catalog_items` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `chats_by_recency` ON `chats` (`account_id`,"last_message_at" desc);--> statement-breakpoint +CREATE INDEX `chats_title_to_fold` ON `chats` (`id`) WHERE title IS NOT NULL AND title_folded IS NULL;--> statement-breakpoint +CREATE INDEX `chats_by_parent_chat_id` ON `chats` (`parent_chat_id`);--> statement-breakpoint +CREATE INDEX `content_metrics_by_post_id_at` ON `content_metrics` (`post_id`,`at`);--> statement-breakpoint +CREATE INDEX `content_posts_by_account_id_status` ON `content_posts` (`account_id`,`status`);--> statement-breakpoint +CREATE INDEX `content_posts_by_account_id_published_at` ON `content_posts` (`account_id`,`published_at`);--> statement-breakpoint +CREATE INDEX `content_terms_by_tag_id` ON `content_terms` (`tag_id`);--> statement-breakpoint +CREATE INDEX `contracts_by_project_id` ON `contracts` (`project_id`);--> statement-breakpoint +CREATE INDEX `contracts_by_deal_id` ON `contracts` (`deal_id`);--> statement-breakpoint +CREATE INDEX `contracts_by_author_type_author_id` ON `contracts` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `contracts_by_confirmed_by_type_confirmed_by_id` ON `contracts` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `deals_by_account_id_external_id` ON `deals` (`account_id`,`external_id`) WHERE account_id IS NOT NULL AND external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `deals_by_organization_id` ON `deals` (`organization_id`);--> statement-breakpoint +CREATE INDEX `deals_by_project_id` ON `deals` (`project_id`);--> statement-breakpoint +CREATE INDEX `deals_by_stage_id` ON `deals` (`stage_id`);--> statement-breakpoint +CREATE INDEX `deals_by_author_type_author_id` ON `deals` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `decisions_by_project_id` ON `decisions` (`project_id`);--> statement-breakpoint +CREATE INDEX `decisions_by_supersedes_id` ON `decisions` (`supersedes_id`);--> statement-breakpoint +CREATE INDEX `decisions_by_confirmed_by_type_confirmed_by_id` ON `decisions` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `document_revisions_by_document_id` ON `document_revisions` (`document_id`);--> statement-breakpoint +CREATE INDEX `email_threads_subject_to_fold` ON `email_threads` (`id`) WHERE subject IS NOT NULL AND subject_folded IS NULL;--> statement-breakpoint +CREATE INDEX `emails_by_time` ON `emails` (`account_id`,"sent_at" desc);--> statement-breakpoint +CREATE INDEX `emails_by_mail_rule_id` ON `emails` (`mail_rule_id`) WHERE mail_rule_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `emails_by_email_thread_id` ON `emails` (`email_thread_id`);--> statement-breakpoint +CREATE INDEX `emails_by_from_identity_id` ON `emails` (`from_identity_id`);--> statement-breakpoint +CREATE INDEX `facts_by_project_id` ON `facts` (`project_id`);--> statement-breakpoint +CREATE INDEX `facts_by_subject_type_subject_id` ON `facts` (`subject_type`,`subject_id`);--> statement-breakpoint +CREATE INDEX `facts_by_supersedes_id` ON `facts` (`supersedes_id`);--> statement-breakpoint +CREATE INDEX `facts_by_author_type_author_id` ON `facts` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `facts_by_confirmed_by_type_confirmed_by_id` ON `facts` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `files_by_account_id_path_folded` ON `files` (`account_id`,`path_folded`);--> statement-breakpoint +CREATE INDEX `files_path_to_fold` ON `files` (`id`) WHERE path_folded IS NULL;--> statement-breakpoint +CREATE INDEX `files_by_parent_id` ON `files` (`parent_id`);--> statement-breakpoint +CREATE INDEX `files_by_document_id` ON `files` (`document_id`);--> statement-breakpoint +CREATE INDEX `financial_accounts_by_name_folded` ON `financial_accounts` (`name_folded`);--> statement-breakpoint +CREATE INDEX `financial_accounts_by_holder_type_holder_id` ON `financial_accounts` (`holder_type`,`holder_id`);--> statement-breakpoint +CREATE INDEX `financial_accounts_by_author_type_author_id` ON `financial_accounts` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `financial_transactions_by_financial_account_id_booked_date` ON `financial_transactions` (`financial_account_id`,`booked_date`);--> statement-breakpoint +CREATE UNIQUE INDEX `financial_transactions_by_payment_id` ON `financial_transactions` (`payment_id`) WHERE payment_id IS NOT NULL AND deleted_at IS NULL;--> statement-breakpoint +CREATE INDEX `financial_transactions_by_counterparty_type_counterparty_id` ON `financial_transactions` (`counterparty_type`,`counterparty_id`);--> statement-breakpoint +CREATE INDEX `financial_transactions_by_project_id` ON `financial_transactions` (`project_id`);--> statement-breakpoint +CREATE INDEX `financial_transactions_by_author_type_author_id` ON `financial_transactions` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `financial_transactions_by_confirmed_by_type_confirmed_by_id` ON `financial_transactions` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `identities_by_email` ON `identities` (`email`) WHERE email IS NOT NULL;--> statement-breakpoint +CREATE INDEX `identities_name_to_fold` ON `identities` (`id`) WHERE name IS NOT NULL AND name_folded IS NULL;--> statement-breakpoint +CREATE INDEX `identity_revisions_by_identity` ON `identity_revisions` (`identity_id`,`created_at`);--> statement-breakpoint +CREATE INDEX `invoice_lines_by_catalog_item_id` ON `invoice_lines` (`catalog_item_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_issuer_type_issuer_id` ON `invoices` (`issuer_type`,`issuer_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_counterparty_type_counterparty_id` ON `invoices` (`counterparty_type`,`counterparty_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_project_id` ON `invoices` (`project_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_author_type_author_id` ON `invoices` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_confirmed_by_type_confirmed_by_id` ON `invoices` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_contract_id` ON `invoices` (`contract_id`);--> statement-breakpoint +CREATE INDEX `invoices_by_subscription_id` ON `invoices` (`subscription_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `leads_by_account_id_external_id` ON `leads` (`account_id`,`external_id`) WHERE account_id IS NOT NULL AND external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `leads_by_organization_id` ON `leads` (`organization_id`);--> statement-breakpoint +CREATE INDEX `leads_by_project_id` ON `leads` (`project_id`);--> statement-breakpoint +CREATE INDEX `leads_by_stage_id` ON `leads` (`stage_id`);--> statement-breakpoint +CREATE INDEX `leads_by_deal_id` ON `leads` (`deal_id`);--> statement-breakpoint +CREATE INDEX `leads_by_author_type_author_id` ON `leads` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `link_reviews_by_status_created_at` ON `link_reviews` (`status`,`created_at`);--> statement-breakpoint +CREATE INDEX `link_revisions_by_link_id_created_at` ON `link_revisions` (`link_id`,`created_at`);--> statement-breakpoint +CREATE INDEX `links_unresolved` ON `links` (`target_folded`) WHERE to_id IS NULL;--> statement-breakpoint +CREATE UNIQUE INDEX `links_relationship_key` ON `links` (`kind`,`from_type`,`from_id`,`to_type`,`to_id`,ifnull("anchor", ''),ifnull("role", ''),ifnull("account_id", 0)) WHERE kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `links_by_from_type_from_id` ON `links` (`from_type`,`from_id`);--> statement-breakpoint +CREATE INDEX `links_by_to_type_to_id` ON `links` (`to_type`,`to_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `meeting_chat_messages_by_meeting_id_external_id` ON `meeting_chat_messages` (`meeting_id`,`external_id`) WHERE external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `meeting_chat_messages_by_meeting_id` ON `meeting_chat_messages` (`meeting_id`);--> statement-breakpoint +CREATE INDEX `meeting_chat_messages_by_sender_participant_id` ON `meeting_chat_messages` (`sender_participant_id`);--> statement-breakpoint +CREATE INDEX `meeting_participants_by_identity_id` ON `meeting_participants` (`identity_id`);--> statement-breakpoint +CREATE INDEX `meeting_series_by_event_series_id` ON `meeting_series` (`event_series_id`);--> statement-breakpoint +CREATE INDEX `meeting_series_by_host_identity_id` ON `meeting_series` (`host_identity_id`);--> statement-breakpoint +CREATE INDEX `meeting_transcript_rows_by_speaker_participant_id` ON `meeting_transcript_rows` (`speaker_participant_id`);--> statement-breakpoint +CREATE INDEX `meeting_transcripts_by_meeting_id` ON `meeting_transcripts` (`meeting_id`);--> statement-breakpoint +CREATE INDEX `meetings_by_join_key` ON `meetings` (`join_key`) WHERE join_key IS NOT NULL;--> statement-breakpoint +CREATE INDEX `meetings_join_key_to_fill` ON `meetings` (`id`) WHERE join_url IS NOT NULL AND join_key IS NULL;--> statement-breakpoint +CREATE INDEX `meetings_by_time` ON `meetings` (`account_id`,"started_at" desc);--> statement-breakpoint +CREATE INDEX `meetings_by_account_id_title_folded` ON `meetings` (`account_id`,`title_folded`);--> statement-breakpoint +CREATE INDEX `meetings_title_to_fold` ON `meetings` (`id`) WHERE title IS NOT NULL AND title_folded IS NULL;--> statement-breakpoint +CREATE INDEX `meetings_by_meeting_series_id` ON `meetings` (`meeting_series_id`);--> statement-breakpoint +CREATE INDEX `meetings_by_event_id` ON `meetings` (`event_id`);--> statement-breakpoint +CREATE INDEX `meetings_by_host_identity_id` ON `meetings` (`host_identity_id`);--> statement-breakpoint +CREATE INDEX `memories_by_subject_type_subject_id` ON `memories` (`subject_type`,`subject_id`);--> statement-breakpoint +CREATE INDEX `memories_by_author_type_author_id` ON `memories` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `memories_by_supersedes_id` ON `memories` (`supersedes_id`);--> statement-breakpoint +CREATE INDEX `memories_by_project_id` ON `memories` (`project_id`);--> statement-breakpoint +CREATE INDEX `messages_by_time` ON `messages` (`chat_id`,"sent_at" desc);--> statement-breakpoint +CREATE INDEX `messages_starred_by_time` ON `messages` (`chat_id`,"sent_at" desc) WHERE starred = 1;--> statement-breakpoint +CREATE INDEX `messages_by_reply` ON `messages` (`chat_id`,`reply_to_external_id`) WHERE reply_to_external_id IS NOT NULL AND deleted_at IS NULL;--> statement-breakpoint +CREATE INDEX `messages_by_account` ON `messages` (`account_id`,`external_id`);--> statement-breakpoint +CREATE INDEX `messages_to_normalize` ON `messages` (`id`) WHERE normalized_text IS NULL AND deleted_at IS NULL;--> statement-breakpoint +CREATE INDEX `messages_by_sender_identity_id` ON `messages` (`sender_identity_id`);--> statement-breakpoint +CREATE INDEX `messages_by_thread_root_id` ON `messages` (`thread_root_id`);--> statement-breakpoint +CREATE INDEX `messages_by_chat_id_thread_external_id` ON `messages` (`chat_id`,`thread_external_id`) WHERE thread_root_id IS NULL AND thread_external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `notes_by_notable_type_notable_id` ON `notes` (`notable_type`,`notable_id`);--> statement-breakpoint +CREATE INDEX `notes_by_author_type_author_id` ON `notes` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `order_lines_by_catalog_item_id` ON `order_lines` (`catalog_item_id`);--> statement-breakpoint +CREATE INDEX `orders_by_customer_type_customer_id` ON `orders` (`customer_type`,`customer_id`);--> statement-breakpoint +CREATE INDEX `orders_by_supplier_type_supplier_id` ON `orders` (`supplier_type`,`supplier_id`);--> statement-breakpoint +CREATE INDEX `orders_by_invoice_id` ON `orders` (`invoice_id`);--> statement-breakpoint +CREATE INDEX `orders_by_payment_id` ON `orders` (`payment_id`);--> statement-breakpoint +CREATE INDEX `orders_by_project_id` ON `orders` (`project_id`);--> statement-breakpoint +CREATE INDEX `orders_by_author_type_author_id` ON `orders` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `orders_by_confirmed_by_type_confirmed_by_id` ON `orders` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `orders_by_contract_id` ON `orders` (`contract_id`);--> statement-breakpoint +CREATE INDEX `orders_by_deal_id` ON `orders` (`deal_id`);--> statement-breakpoint +CREATE INDEX `payments_by_payer_type_payer_id` ON `payments` (`payer_type`,`payer_id`);--> statement-breakpoint +CREATE INDEX `payments_by_payee_type_payee_id` ON `payments` (`payee_type`,`payee_id`);--> statement-breakpoint +CREATE INDEX `payments_by_project_id` ON `payments` (`project_id`);--> statement-breakpoint +CREATE INDEX `payments_by_author_type_author_id` ON `payments` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `payments_by_confirmed_by_type_confirmed_by_id` ON `payments` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `payments_by_refund_of` ON `payments` (`refund_of`);--> statement-breakpoint +CREATE INDEX `payments_by_subscription_id` ON `payments` (`subscription_id`);--> statement-breakpoint +CREATE INDEX `poll_votes_by_identity_id` ON `poll_votes` (`identity_id`);--> statement-breakpoint +CREATE INDEX `projects_by_name_folded` ON `projects` (`name_folded`);--> statement-breakpoint +CREATE INDEX `projects_name_to_fold` ON `projects` (`id`) WHERE name_folded IS NULL;--> statement-breakpoint +CREATE INDEX `projects_by_organization_id` ON `projects` (`organization_id`);--> statement-breakpoint +CREATE INDEX `projects_by_account_id` ON `projects` (`account_id`);--> statement-breakpoint +CREATE INDEX `projects_by_owner_type_owner_id` ON `projects` (`owner_type`,`owner_id`);--> statement-breakpoint +CREATE INDEX `proposed_actions_by_status_created_at` ON `proposed_actions` (`status`,`created_at`);--> statement-breakpoint +CREATE INDEX `proposed_actions_by_account_id` ON `proposed_actions` (`account_id`);--> statement-breakpoint +CREATE INDEX `proposed_actions_by_target_type_target_id` ON `proposed_actions` (`target_type`,`target_id`);--> statement-breakpoint +CREATE INDEX `proposed_actions_by_proposed_by_type_proposed_by_id` ON `proposed_actions` (`proposed_by_type`,`proposed_by_id`);--> statement-breakpoint +CREATE INDEX `proposed_actions_by_decided_by_type_decided_by_id` ON `proposed_actions` (`decided_by_type`,`decided_by_id`);--> statement-breakpoint +CREATE INDEX `records_by_account_id_batch_id` ON `records` (`account_id`,`batch_id`);--> statement-breakpoint +CREATE INDEX `records_by_entity_type_entity_id` ON `records` (`entity_type`,`entity_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `searches_history` ON `searches` (`command`,`params`) WHERE name IS NULL;--> statement-breakpoint +CREATE INDEX `searches_by_last_run` ON `searches` ("last_run_at" desc);--> statement-breakpoint +CREATE UNIQUE INDEX `subscription_prices_by_subscription_id_effective_from` ON `subscription_prices` (`subscription_id`,`effective_from`) WHERE review <> 'rejected';--> statement-breakpoint +CREATE INDEX `subscription_prices_by_author_type_author_id` ON `subscription_prices` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `subscription_prices_by_confirmed_by_type_confirmed_by_id` ON `subscription_prices` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_supplier_type_supplier_id` ON `subscriptions` (`supplier_type`,`supplier_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_customer_type_customer_id` ON `subscriptions` (`customer_type`,`customer_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_catalog_item_id` ON `subscriptions` (`catalog_item_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_contract_id` ON `subscriptions` (`contract_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_project_id` ON `subscriptions` (`project_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_author_type_author_id` ON `subscriptions` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `subscriptions_by_confirmed_by_type_confirmed_by_id` ON `subscriptions` (`confirmed_by_type`,`confirmed_by_id`);--> statement-breakpoint +CREATE INDEX `syncs_by_account_id` ON `syncs` (`account_id`);--> statement-breakpoint +CREATE INDEX `tag_consolidations_by_source_id` ON `tag_consolidations` (`source_id`);--> statement-breakpoint +CREATE INDEX `tag_consolidations_by_survivor_id` ON `tag_consolidations` (`survivor_id`);--> statement-breakpoint +CREATE INDEX `tag_consolidations_by_actor_type_actor_id` ON `tag_consolidations` (`actor_type`,`actor_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `taggings_main_topic` ON `taggings` (`taggable_type`,`taggable_id`) WHERE main = 1;--> statement-breakpoint +CREATE INDEX `taggings_by_taggable_type_taggable_id` ON `taggings` (`taggable_type`,`taggable_id`);--> statement-breakpoint +CREATE INDEX `taggings_by_author_type_author_id` ON `taggings` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `task_events_by_task_id` ON `task_events` (`task_id`);--> statement-breakpoint +CREATE INDEX `task_events_by_actor_type_actor_id` ON `task_events` (`actor_type`,`actor_id`);--> statement-breakpoint +CREATE INDEX `task_pairs_by_decision_created_at` ON `task_pairs` (`decision`,`created_at`);--> statement-breakpoint +CREATE INDEX `task_pairs_by_other_id` ON `task_pairs` (`other_id`);--> statement-breakpoint +CREATE INDEX `task_pairs_by_decided_by_type_decided_by_id` ON `task_pairs` (`decided_by_type`,`decided_by_id`);--> statement-breakpoint +CREATE INDEX `tasks_by_title_folded` ON `tasks` (`title_folded`);--> statement-breakpoint +CREATE INDEX `tasks_close_reason_to_fold` ON `tasks` (`id`) WHERE close_reason IS NOT NULL AND close_reason_folded IS NULL;--> statement-breakpoint +CREATE INDEX `tasks_by_status` ON `tasks` (`project_id`,`status`,`due_at`);--> statement-breakpoint +CREATE INDEX `tasks_by_project_id_status_next_check_at` ON `tasks` (`project_id`,`status`,`next_check_at`);--> statement-breakpoint +CREATE INDEX `tasks_by_project_id_source_locator` ON `tasks` (`project_id`,`source_locator`);--> statement-breakpoint +CREATE INDEX `tasks_by_source_group` ON `tasks` (`source_group`);--> statement-breakpoint +CREATE INDEX `tasks_by_provider_external_id` ON `tasks` (`provider`,`external_id`) WHERE external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `tasks_by_parent_id` ON `tasks` (`parent_id`);--> statement-breakpoint +CREATE INDEX `tasks_by_closed_by_type_closed_by_id` ON `tasks` (`closed_by_type`,`closed_by_id`);--> statement-breakpoint +CREATE INDEX `tasks_by_author_type_author_id` ON `tasks` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `tasks_by_close_suggested_by_type_close_suggested_by_id` ON `tasks` (`close_suggested_by_type`,`close_suggested_by_id`);--> statement-breakpoint +CREATE INDEX `tracker_items_by_account_id_kind_parent_id` ON `tracker_items` (`account_id`,`kind`,`parent_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `aliases_displayed` ON `aliases` (`aliasable_type`,`aliasable_id`,ifnull("account_id", 0)) WHERE display = 1;--> statement-breakpoint +CREATE UNIQUE INDEX `aliases_by_aliasable_type_aliasable_id_name_folded` ON `aliases` (`aliasable_type`,`aliasable_id`,`name_folded`) WHERE account_id IS NULL AND aliasable_type = 'project' OR account_id IS NULL AND aliasable_type = 'tag';--> statement-breakpoint +CREATE INDEX `aliases_by_aliasable_type_aliasable_id` ON `aliases` (`aliasable_type`,`aliasable_id`);--> statement-breakpoint +CREATE INDEX `aliases_by_account_id` ON `aliases` (`account_id`);--> statement-breakpoint +CREATE INDEX `calendar_entry_participants_by_identity_id` ON `calendar_entry_participants` (`identity_id`);--> statement-breakpoint +CREATE INDEX `calendar_entry_revisions_by_entry_id_created_at` ON `calendar_entry_revisions` (`entry_id`,`created_at`);--> statement-breakpoint +CREATE INDEX `chat_events_by_chat_id_happened_at` ON `chat_events` (`chat_id`,`happened_at`);--> statement-breakpoint +CREATE INDEX `chat_events_by_actor_identity_id` ON `chat_events` (`actor_identity_id`);--> statement-breakpoint +CREATE INDEX `chat_revisions_by_chat_id_created_at` ON `chat_revisions` (`chat_id`,`created_at`);--> statement-breakpoint +CREATE INDEX `chat_revisions_by_account_id_old_value` ON `chat_revisions` (`account_id`,`old_value`) WHERE field = 'external_id';--> statement-breakpoint +CREATE INDEX `content_post_revisions_by_post_id_created_at` ON `content_post_revisions` (`post_id`,`created_at`);--> statement-breakpoint +CREATE INDEX `conversations_by_chat` ON `conversations` (`chat_id`,`build`,`first_at`);--> statement-breakpoint +CREATE INDEX `conversations_by_first_message_id` ON `conversations` (`first_message_id`);--> statement-breakpoint +CREATE INDEX `crm_files_by_account_id_owner_kind_owner_id` ON `crm_files` (`account_id`,`owner_kind`,`owner_id`);--> statement-breakpoint +CREATE INDEX `decision_requests_by_channel_bot_profile_chat_id_message_id` ON `decision_requests` (`channel`,`bot_profile`,`chat_id`,`message_id`);--> statement-breakpoint +CREATE INDEX `document_changes_by_account_id_at` ON `document_changes` (`account_id`,`at`);--> statement-breakpoint +CREATE INDEX `email_recipients_by_email_id` ON `email_recipients` (`email_id`);--> statement-breakpoint +CREATE INDEX `email_recipients_by_identity_id` ON `email_recipients` (`identity_id`);--> statement-breakpoint +CREATE INDEX `entity_link_events_by_linkable_type_linkable_id` ON `entity_link_events` (`linkable_type`,`linkable_id`);--> statement-breakpoint +CREATE INDEX `entity_link_events_by_entity_type_to_entity_id` ON `entity_link_events` (`entity_type`,`to_entity_id`);--> statement-breakpoint +CREATE INDEX `events_by_time` ON `events` (`starts_at`);--> statement-breakpoint +CREATE INDEX `events_by_event_series_id` ON `events` (`event_series_id`);--> statement-breakpoint +CREATE INDEX `fact_removals_by_removed_at` ON `fact_removals` (`removed_at`);--> statement-breakpoint +CREATE INDEX `identity_link_events_by_identity_id` ON `identity_link_events` (`identity_id`);--> statement-breakpoint +CREATE INDEX `identity_link_events_by_from_person_id` ON `identity_link_events` (`from_person_id`);--> statement-breakpoint +CREATE INDEX `identity_link_events_by_to_person_id` ON `identity_link_events` (`to_person_id`);--> statement-breakpoint +CREATE INDEX `mailboxes_by_name_folded` ON `mailboxes` (`name_folded`);--> statement-breakpoint +CREATE INDEX `mailboxes_name_to_fold` ON `mailboxes` (`id`) WHERE name_folded IS NULL;--> statement-breakpoint +CREATE INDEX `member_observations_by_chat_id_observed_at_id` ON `member_observations` (`chat_id`,`observed_at`,`id`);--> statement-breakpoint +CREATE UNIQUE INDEX `member_stays_open` ON `member_stays` (`chat_id`,`identity_id`) WHERE left_at IS NULL;--> statement-breakpoint +CREATE INDEX `member_stays_by_identity_id` ON `member_stays` (`identity_id`);--> statement-breakpoint +CREATE INDEX `member_stays_by_invited_by_identity_id` ON `member_stays` (`invited_by_identity_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `message_links_unique` ON `message_links` (`message_id`,ifnull("parent_id", 0),`source`,`kind`,ifnull("build", 0));--> statement-breakpoint +CREATE INDEX `message_links_by_build` ON `message_links` (`chat_id`,`build`);--> statement-breakpoint +CREATE INDEX `message_links_by_parent_id` ON `message_links` (`parent_id`);--> statement-breakpoint +CREATE INDEX `message_reactions_by_identity_id` ON `message_reactions` (`identity_id`);--> statement-breakpoint +CREATE INDEX `message_revisions_by_message_id` ON `message_revisions` (`message_id`);--> statement-breakpoint +CREATE INDEX `message_transcripts_by_message_id` ON `message_transcripts` (`message_id`);--> statement-breakpoint +CREATE INDEX `note_revisions_by_note_id` ON `note_revisions` (`note_id`);--> statement-breakpoint +CREATE INDEX `organization_identities_by_organization_id` ON `organization_identities` (`organization_id`);--> statement-breakpoint +CREATE INDEX `payment_allocations_by_invoice_id` ON `payment_allocations` (`invoice_id`);--> statement-breakpoint +CREATE INDEX `payment_allocations_by_author_type_author_id` ON `payment_allocations` (`author_type`,`author_id`);--> statement-breakpoint +CREATE INDEX `persons_by_kind` ON `persons` (`kind`);--> statement-breakpoint +CREATE INDEX `persons_kind_to_work_out` ON `persons` (`id`) WHERE kind IS NULL;--> statement-breakpoint +CREATE INDEX `pipeline_stage_changes_by_item_type_item_id` ON `pipeline_stage_changes` (`item_type`,`item_id`);--> statement-breakpoint +CREATE INDEX `pipeline_stage_changes_by_pipeline_id` ON `pipeline_stage_changes` (`pipeline_id`);--> statement-breakpoint +CREATE INDEX `pipeline_stage_changes_by_from_stage_id` ON `pipeline_stage_changes` (`from_stage_id`);--> statement-breakpoint +CREATE INDEX `pipeline_stage_changes_by_to_stage_id` ON `pipeline_stage_changes` (`to_stage_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `pipeline_stages_by_pipeline_id_external_id` ON `pipeline_stages` (`pipeline_id`,`external_id`) WHERE external_id IS NOT NULL;--> statement-breakpoint +CREATE INDEX `pipeline_stages_by_pipeline_id_position` ON `pipeline_stages` (`pipeline_id`,`position`);--> statement-breakpoint +CREATE INDEX `pipeline_stages_by_base_stage_id` ON `pipeline_stages` (`base_stage_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `pipelines_by_account_id_kind_external_id` ON `pipelines` (`account_id`,`kind`,`external_id`) WHERE account_id IS NOT NULL AND external_id IS NOT NULL;--> statement-breakpoint +CREATE UNIQUE INDEX `pipelines_by_name_folded_kind` ON `pipelines` (`name_folded`,`kind`) WHERE account_id IS NULL;--> statement-breakpoint +CREATE INDEX `record_relations_by_target_type_target_external_id` ON `record_relations` (`target_type`,`target_external_id`);--> statement-breakpoint +CREATE INDEX `record_relations_by_target_id` ON `record_relations` (`target_id`);--> statement-breakpoint +CREATE INDEX `reminders_due` ON `reminders` (`account_id`,`state`,`due_at`);--> statement-breakpoint +CREATE INDEX `reminders_by_task_id` ON `reminders` (`task_id`);--> statement-breakpoint +CREATE INDEX `task_assignments_by_assignee_type_assignee_id` ON `task_assignments` (`assignee_type`,`assignee_id`);--> statement-breakpoint +CREATE INDEX `templates_history_by_key_channel_language_id` ON `templates_history` (`key`,`channel`,`language`,`id`);--> statement-breakpoint +CREATE INDEX `transaction_splits_by_category_folded` ON `transaction_splits` (`category_folded`);--> statement-breakpoint +CREATE INDEX `transaction_splits_by_project_id` ON `transaction_splits` (`project_id`); \ No newline at end of file diff --git a/drizzle/20261123230507_version-73-autoincrement/snapshot.json b/drizzle/20261123230507_version-73-autoincrement/snapshot.json new file mode 100644 index 000000000..d21d3204e --- /dev/null +++ b/drizzle/20261123230507_version-73-autoincrement/snapshot.json @@ -0,0 +1,26311 @@ +{ + "version": "7", + "dialect": "sqlite", + "id": "ca9fb6f2-be10-4e33-8089-c8a42ea87d5c", + "prevIds": [ + "3bad429c-070a-4786-888b-f59e9c2a968a" + ], + "ddl": [ + { + "name": "account_identities", + "entityType": "tables" + }, + { + "name": "accounts", + "entityType": "tables" + }, + { + "name": "agent_actions", + "entityType": "tables" + }, + { + "name": "aliases", + "entityType": "tables" + }, + { + "name": "attachments", + "entityType": "tables" + }, + { + "name": "bot_updates", + "entityType": "tables" + }, + { + "name": "bots", + "entityType": "tables" + }, + { + "name": "calendar_entries", + "entityType": "tables" + }, + { + "name": "calendar_entry_participants", + "entityType": "tables" + }, + { + "name": "calendar_entry_revisions", + "entityType": "tables" + }, + { + "name": "calendars", + "entityType": "tables" + }, + { + "name": "canonical_auto_tag_claims", + "entityType": "tables" + }, + { + "name": "canonical_tags", + "entityType": "tables" + }, + { + "name": "catalog_items", + "entityType": "tables" + }, + { + "name": "chat_event_people", + "entityType": "tables" + }, + { + "name": "chat_events", + "entityType": "tables" + }, + { + "name": "chat_members", + "entityType": "tables" + }, + { + "name": "chat_revision_source", + "entityType": "tables" + }, + { + "name": "chat_revisions", + "entityType": "tables" + }, + { + "name": "chats", + "entityType": "tables" + }, + { + "name": "chunk_messages", + "entityType": "tables" + }, + { + "name": "chunks", + "entityType": "tables" + }, + { + "name": "content_authors", + "entityType": "tables" + }, + { + "name": "content_channels", + "entityType": "tables" + }, + { + "name": "content_metrics", + "entityType": "tables" + }, + { + "name": "content_post_revisions", + "entityType": "tables" + }, + { + "name": "content_posts", + "entityType": "tables" + }, + { + "name": "content_terms", + "entityType": "tables" + }, + { + "name": "contracts", + "entityType": "tables" + }, + { + "name": "conversation_messages", + "entityType": "tables" + }, + { + "name": "conversation_readiness", + "entityType": "tables" + }, + { + "name": "conversation_state", + "entityType": "tables" + }, + { + "name": "conversations", + "entityType": "tables" + }, + { + "name": "crm_fields", + "entityType": "tables" + }, + { + "name": "crm_files", + "entityType": "tables" + }, + { + "name": "deals", + "entityType": "tables" + }, + { + "name": "decision_requests", + "entityType": "tables" + }, + { + "name": "decisions", + "entityType": "tables" + }, + { + "name": "document_annotation_transfers", + "entityType": "tables" + }, + { + "name": "document_changes", + "entityType": "tables" + }, + { + "name": "document_index_pending", + "entityType": "tables" + }, + { + "name": "document_revisions", + "entityType": "tables" + }, + { + "name": "documents", + "entityType": "tables" + }, + { + "name": "email_index_pending", + "entityType": "tables" + }, + { + "name": "email_locations", + "entityType": "tables" + }, + { + "name": "email_mailboxes", + "entityType": "tables" + }, + { + "name": "email_recipients", + "entityType": "tables" + }, + { + "name": "email_threads", + "entityType": "tables" + }, + { + "name": "emails", + "entityType": "tables" + }, + { + "name": "embeddings", + "entityType": "tables" + }, + { + "name": "enrichments", + "entityType": "tables" + }, + { + "name": "entity_link_events", + "entityType": "tables" + }, + { + "name": "event_index_pending", + "entityType": "tables" + }, + { + "name": "event_series", + "entityType": "tables" + }, + { + "name": "events", + "entityType": "tables" + }, + { + "name": "fact_removals", + "entityType": "tables" + }, + { + "name": "facts", + "entityType": "tables" + }, + { + "name": "fetch_leases", + "entityType": "tables" + }, + { + "name": "files", + "entityType": "tables" + }, + { + "name": "financial_accounts", + "entityType": "tables" + }, + { + "name": "financial_transactions", + "entityType": "tables" + }, + { + "name": "identities", + "entityType": "tables" + }, + { + "name": "identity_link_events", + "entityType": "tables" + }, + { + "name": "identity_links", + "entityType": "tables" + }, + { + "name": "identity_revisions", + "entityType": "tables" + }, + { + "name": "invoice_lines", + "entityType": "tables" + }, + { + "name": "invoices", + "entityType": "tables" + }, + { + "name": "involvement_pending", + "entityType": "tables" + }, + { + "name": "involvements", + "entityType": "tables" + }, + { + "name": "leads", + "entityType": "tables" + }, + { + "name": "link_reviews", + "entityType": "tables" + }, + { + "name": "link_revisions", + "entityType": "tables" + }, + { + "name": "links", + "entityType": "tables" + }, + { + "name": "mail_rules", + "entityType": "tables" + }, + { + "name": "mailboxes", + "entityType": "tables" + }, + { + "name": "meeting_chat_messages", + "entityType": "tables" + }, + { + "name": "meeting_index_pending", + "entityType": "tables" + }, + { + "name": "meeting_participants", + "entityType": "tables" + }, + { + "name": "meeting_series", + "entityType": "tables" + }, + { + "name": "meeting_summaries", + "entityType": "tables" + }, + { + "name": "meeting_transcript_rows", + "entityType": "tables" + }, + { + "name": "meeting_transcripts", + "entityType": "tables" + }, + { + "name": "meetings", + "entityType": "tables" + }, + { + "name": "member_counts", + "entityType": "tables" + }, + { + "name": "member_observation_members", + "entityType": "tables" + }, + { + "name": "member_observations", + "entityType": "tables" + }, + { + "name": "member_stays", + "entityType": "tables" + }, + { + "name": "memories", + "entityType": "tables" + }, + { + "name": "memory_index_pending", + "entityType": "tables" + }, + { + "name": "mention_pending", + "entityType": "tables" + }, + { + "name": "mentions", + "entityType": "tables" + }, + { + "name": "message_counter_observations", + "entityType": "tables" + }, + { + "name": "message_links", + "entityType": "tables" + }, + { + "name": "message_reactions", + "entityType": "tables" + }, + { + "name": "message_revisions", + "entityType": "tables" + }, + { + "name": "message_stems_pending", + "entityType": "tables" + }, + { + "name": "message_transcripts", + "entityType": "tables" + }, + { + "name": "messages", + "entityType": "tables" + }, + { + "name": "note_index_pending", + "entityType": "tables" + }, + { + "name": "note_revisions", + "entityType": "tables" + }, + { + "name": "notes", + "entityType": "tables" + }, + { + "name": "order_lines", + "entityType": "tables" + }, + { + "name": "orders", + "entityType": "tables" + }, + { + "name": "organization_identities", + "entityType": "tables" + }, + { + "name": "organizations", + "entityType": "tables" + }, + { + "name": "payment_allocations", + "entityType": "tables" + }, + { + "name": "payments", + "entityType": "tables" + }, + { + "name": "persons", + "entityType": "tables" + }, + { + "name": "pipeline_stage_changes", + "entityType": "tables" + }, + { + "name": "pipeline_stages", + "entityType": "tables" + }, + { + "name": "pipelines", + "entityType": "tables" + }, + { + "name": "places", + "entityType": "tables" + }, + { + "name": "poll_votes", + "entityType": "tables" + }, + { + "name": "projects", + "entityType": "tables" + }, + { + "name": "proposed_actions", + "entityType": "tables" + }, + { + "name": "record_relations", + "entityType": "tables" + }, + { + "name": "records", + "entityType": "tables" + }, + { + "name": "reminders", + "entityType": "tables" + }, + { + "name": "search_index_state", + "entityType": "tables" + }, + { + "name": "searches", + "entityType": "tables" + }, + { + "name": "store_settings", + "entityType": "tables" + }, + { + "name": "subscription_prices", + "entityType": "tables" + }, + { + "name": "subscriptions", + "entityType": "tables" + }, + { + "name": "sync_cursors", + "entityType": "tables" + }, + { + "name": "sync_ranges", + "entityType": "tables" + }, + { + "name": "syncs", + "entityType": "tables" + }, + { + "name": "tag_consolidations", + "entityType": "tables" + }, + { + "name": "tag_redirects", + "entityType": "tables" + }, + { + "name": "taggings", + "entityType": "tables" + }, + { + "name": "task_assignments", + "entityType": "tables" + }, + { + "name": "task_events", + "entityType": "tables" + }, + { + "name": "task_index_pending", + "entityType": "tables" + }, + { + "name": "task_key_counters", + "entityType": "tables" + }, + { + "name": "task_pairs", + "entityType": "tables" + }, + { + "name": "tasks", + "entityType": "tables" + }, + { + "name": "templates", + "entityType": "tables" + }, + { + "name": "templates_history", + "entityType": "tables" + }, + { + "name": "tracker_items", + "entityType": "tables" + }, + { + "name": "transaction_splits", + "entityType": "tables" + }, + { + "name": "transcript_index_pending", + "entityType": "tables" + }, + { + "name": "vector_index_redo", + "entityType": "tables" + }, + { + "name": "vector_indexes", + "entityType": "tables" + }, + { + "table": "account_identities", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "last_messaged_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "mail_score", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "mail_signals", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "mail_scored_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "mail_demoted", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "address_book", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "provider", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "settings", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "status", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "scope", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'personal'", + "generated": null, + "entityType": "columns" + }, + { + "table": "accounts", + "name": "organization_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "actor_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "actor_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "tool", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "tier", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "target_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "target_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "started_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "finished_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "agent_actions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "aliasable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "aliasable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "display", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "aliases", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "attachable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "attachable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "mime", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "size", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "width", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "height", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "duration", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "provider_ref", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "local_path", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "extraction", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "extractor", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "extraction_error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "content_sha256", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "extracted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "name_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "local_path_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "attachments", + "name": "contact", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "payload", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "received_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "handled_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "replayed_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bot_updates", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "owner_person_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "token_digest", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "last_seen_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "disabled_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "bots", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "calendar_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "series_entry_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "event_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "event_series_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "ical_uid", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "original_starts_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "exception", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "location", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "starts_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "all_day", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "start_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "end_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "timezone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "recurrence", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "recurrence_ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "event_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "transparency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "visibility", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "own_response", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "organizer_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "join_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "join_key", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "conference", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "sequence", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "etag", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "external_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "seen_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entries", + "name": "series_external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "entry_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "email", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "response", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "optional", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "organizer", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "self", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "resource", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_participants", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "entry_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "starts_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "location", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "status", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "recurrence", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "recurrence_ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "external_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendar_entry_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "timezone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "access_role", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "primary_calendar", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "synced", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "seen_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "calendars", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "tag_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "algorithm", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "score", + "type": "real", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "fields", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_auto_tag_claims", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_tags", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_tags", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_tags", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'tag'", + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_tags", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "canonical_tags", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "sku", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "supplier_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "supplier_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "unit", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "unit_price", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "currency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "archived_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "catalog_items", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_event_people", + "name": "chat_event_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_event_people", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "source_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "action", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "actor_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "happened_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_events", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_members", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_members", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_members", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revision_source", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revision_source", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revision_source", + "name": "at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "field", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "old_value", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "new_value", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "source", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chat_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "unread_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "last_message_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "participants_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "username", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "membership_state", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "searchable", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "message_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "members_tracked_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "details_fetched_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "parent_chat_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "scope", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "muted", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "muted_until", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "archived", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "marked_unread", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "unread_counted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chats", + "name": "title_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunk_messages", + "name": "chunk_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunk_messages", + "name": "first_message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunk_messages", + "name": "last_message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunk_messages", + "name": "text_start", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunk_messages", + "name": "text_end", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "chunkable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "chunkable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "start_offset", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "end_offset", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "content_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "scope", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "occurred_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "chunks", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "email", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "data", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "source_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_authors", + "name": "synced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "network", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "handle", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_channels", + "name": "synced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "post_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "views", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "reactions", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "comments", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "shares", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "clicks", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_metrics", + "name": "raw", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "post_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "body", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "content_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "version", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "reason", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_post_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "channel_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "title_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "body", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "content_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "published_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "scheduled_for", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "source_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "source_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "version", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "normalized_text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "data", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_posts", + "name": "synced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "slug", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "parent_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "tag_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "data", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "source_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "content_terms", + "name": "synced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "number", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "signed_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "effective_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "expiration_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "auto_renew", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "renewal_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "renewal_unit", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "notice_days", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "terms", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "value", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "currency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "deal_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "contracts", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_messages", + "name": "conversation_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_messages", + "name": "message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "model", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "new_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "edited_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "deleted_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "chunks", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "embedded_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "current", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "stale", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_readiness", + "name": "counted_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_state", + "name": "chat_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_state", + "name": "enabled_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_state", + "name": "built_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_state", + "name": "algorithm_version", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversation_state", + "name": "current_build", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "first_message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "build", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "first_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "last_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "message_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "built_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "algorithm_version", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "conversations", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "code", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "label", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "multiple", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "filterable", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "options", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_fields", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "owner_kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "owner_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "owner_assignee", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "mime", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "size", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "external_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "local_path", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "content_sha256", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "extraction", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "extraction_error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "downloaded_by", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "crm_files", + "name": "downloaded_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "title", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "organization_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "stage_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "currency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "amount", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "close_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "closed_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "rank", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "deals", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "token_digest", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "proposal_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "action", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "batch_digest", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "channel", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "bot_profile", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "chat_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "message_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "owner_user_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "expires_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "used_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decision_requests", + "name": "cancelled_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "statement", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "decided_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "supersedes_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "decisions", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "source_key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "collection", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "snapshot_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "bindings_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "reference_map", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_annotation_transfers", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "document_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "path", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "event", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_changes", + "name": "at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "document_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "front_matter", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "document_revisions", + "name": "reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "location", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "file_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "extension", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "storage", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "local_path", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "mime", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "size", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "content_hash", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "front_matter", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "body", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "extraction", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "extraction_error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "language", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "export_path", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "external_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "external_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "pinned_file_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "documents", + "name": "removal", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_locations", + "name": "mailbox_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_locations", + "name": "uidvalidity", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_locations", + "name": "uid", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_locations", + "name": "email_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_mailboxes", + "name": "email_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_mailboxes", + "name": "mailbox_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_mailboxes", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "email_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "address", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "role", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_recipients", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "subject", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "last_email_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "emails_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "email_threads", + "name": "subject_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "email_thread_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "subject", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "from_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "from_address", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "from_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "sent_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "received_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "in_reply_to", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "references", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "body_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "body_html", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "snippet", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "outgoing", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "read", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "flagged", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "draft", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "size", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "headers", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "emails", + "name": "mail_rule_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "model", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "content_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "dims", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "vector", + "type": "blob", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "embeddings", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "subject_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "subject_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "source_hash", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "provider", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "model", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "tokens", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "enrichments", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "linkable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "linkable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "entity_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "from_entity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "to_entity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "confidence", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "author", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "entity_link_events", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "recurrence", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "origin", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "event_series", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "event_series_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "location", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "starts_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "timezone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "origin", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "status", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "all_day", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "events", + "name": "source_deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "fact_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "subject", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "removed_by", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "bot", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fact_removals", + "name": "removed_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "statement", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "subject_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "subject_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "occurred_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "supersedes_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "scope", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "facts", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fetch_leases", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fetch_leases", + "name": "anchor", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fetch_leases", + "name": "holder", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "fetch_leases", + "name": "expires_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "path", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "path_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "parent_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "document_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "mime", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "size", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "content_hash", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "external_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "external_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "seen_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "files", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "currency", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "institution", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "number_hint", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "holder_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "holder_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "opening_balance", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "opening_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "closed_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_accounts", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "financial_account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "direction", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "currency", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "statement_date", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "booked_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "counterparty_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "counterparty_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "counterparty_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "reference", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "payment_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "financial_transactions", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "provider", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "username", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "bot", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "phone_hmac", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "email", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "phone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identities", + "name": "name_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "from_person_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "to_person_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_link_events", + "name": "author", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "person_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "confidence", + "type": "real", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "author", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "source", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_links", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "username", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "marks", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "identity_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "invoice_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "description", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "quantity", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "unit_price", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoice_lines", + "name": "catalog_item_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "direction", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "number", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "issuer_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "issuer_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "counterparty_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "counterparty_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "currency", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "total", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "issue_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "due_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "contract_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "invoices", + "name": "subscription_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvement_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvement_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "person_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "subject_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "subject_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "role", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "occurred_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "scope", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "involvements", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "title", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "organization_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "stage_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "currency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "amount", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "close_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "closed_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "rank", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "deal_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "leads", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "linkable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "linkable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "entity_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "candidates", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "reason", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "chosen_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "decided_by", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "decided_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_reviews", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "link_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "change", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "before", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "after", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "author", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "link_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "from_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "from_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "to_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "to_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "anchor", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "target_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "target_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "role", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "evidence", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "confirmed", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "author", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "purpose", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "starts_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "ends_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "links", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "conditions", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "actions", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "protected", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "decided_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mail_rules", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "kind", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mailboxes", + "name": "name_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "sent_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "sender_participant_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "sender_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "recipient", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_chat_messages", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "meeting_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "display_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "email", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "role", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "joined_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "left_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "duration_ms", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "sessions", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_participants", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "event_series_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "kind", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "recurrence", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "host_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "join_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_series", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "meeting_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "overview", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "sections", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "next_steps", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "content", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "doc_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "external_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "external_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_summaries", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "meeting_transcript_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "start_ms", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "end_ms", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "speaker_participant_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "speaker_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcript_rows", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "meeting_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "format", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "language", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "content_hash", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "external_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "superseded_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meeting_transcripts", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "meeting_series_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "event_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "location", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "join_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "started_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "ended_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "duration_ms", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "timezone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "host_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "participants_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "title_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "join_key", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "direction", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "meetings", + "name": "client_phone", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "date", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "reported_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "listed_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "complete_list", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_counts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observation_members", + "name": "member_observation_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observation_members", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observation_members", + "name": "member_stay_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "observed_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "started_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "complete", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "reported_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "listed_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_observations", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "first_seen_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "last_seen_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "joined_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "invited_by_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "role", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "left_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "member_stays", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "subject_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "subject_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "confidence", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "last_verified_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "supersedes_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "scope", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memories", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memory_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "memory_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mention_pending", + "name": "source_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mention_pending", + "name": "source_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "source_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "source_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "source_field", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "start_offset", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "end_offset", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "value", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "domain", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "version", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "confidence", + "type": "real", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "target_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "target_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "author", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "mentions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_counter_observations", + "name": "message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_counter_observations", + "name": "counter", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_counter_observations", + "name": "value", + "type": "real", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_counter_observations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_counter_observations", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "parent_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "confidence", + "type": "real", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "version", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "batch", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "build", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "stale_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_links", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "message_external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "own", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "reaction", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "reacted_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_reactions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_revisions", + "name": "message_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_revisions", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_revisions", + "name": "edited_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_stems_pending", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "message_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "message_external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "heard_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "message_transcripts", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "thread_external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "sender_identity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "sender_chat_external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "sender_name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "sent_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "edited_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "reply_to_external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "reply_to", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "forward", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "outgoing", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "reactions", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "normalized_text", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "normalizer_version", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "mentions", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "thread_root_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "starred", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "messages", + "name": "delivery", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_revisions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_revisions", + "name": "note_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_revisions", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_revisions", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "note_revisions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "notable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "notable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "title", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "author_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "author_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "notes", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "order_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "description", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "quantity", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "unit_price", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "catalog_item_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "order_lines", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "customer_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "customer_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "purpose", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "supplier_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "supplier_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "supplier_name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "number", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "currency", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "total", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "order_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "fulfilled_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "invoice_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "payment_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "source_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "contract_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "deal_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "orders", + "name": "direction", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'purchase'", + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "organization_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "method", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "author", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organization_identities", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "scope", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'personal'", + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "organizations", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "payment_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "invoice_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payment_allocations", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "direction", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "payer_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "payer_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "payee_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "payee_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "currency", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "payment_date", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "reference", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "refund_of", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "payments", + "name": "subscription_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "owner", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "kind", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "name_order", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "messages_from", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "task_count", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "persons", + "name": "last_contact", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "item_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "item_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "from_stage_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "to_stage_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stage_changes", + "name": "changed_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "pipeline_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "outcome", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'open'", + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "base_stage_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipeline_stages", + "name": "base_confirmed", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'deal'", + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "name_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "pipelines", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "address", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "author", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "places", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "message_external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "identity_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "answers", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "voted_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "poll_votes", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "organization_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "scope", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'personal'", + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "owner_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "owner_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "tasks_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "status", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "projects", + "name": "name_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "account_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "target_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "target_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "payload", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "proposed_by_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "proposed_by_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "decided_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "decided_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "decided_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "executed_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "result", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "verdict", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "proposed_actions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "record_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "role", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "target_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "target_external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "target_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "amount", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "record_relations", + "name": "as_role", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "fields", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "revision", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "fingerprint", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "entity_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "entity_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "projected_fingerprint", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "batch_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "records", + "name": "created_entity", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "task_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "due_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "timezone", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "state", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "lease_until", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "receipt", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "reminders", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "watermark", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "filled_through", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "terms_through", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "normalizer_version", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "built_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "search_index_state", + "name": "analyzer", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "name", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "command", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "params", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "language", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "version", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "fields_version", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "last_run_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "runs", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "searches", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "store_settings", + "name": "key", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "store_settings", + "name": "value", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "store_settings", + "name": "at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "subscription_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "currency", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "effective_from", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscription_prices", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "name", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "direction", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "supplier_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "supplier_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "customer_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "customer_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "catalog_item_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "contract_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "interval_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "interval_unit", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "start_date", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "trial_end_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "next_renewal_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "cancelled_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "end_date", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "review", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "model", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "confirmed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "confirmed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "subscriptions", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_cursors", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_cursors", + "name": "key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_cursors", + "name": "value", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_cursors", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_cursors", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_ranges", + "name": "chat_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_ranges", + "name": "from_key", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_ranges", + "name": "to_key", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_ranges", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "sync_ranges", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "started_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "finished_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "counts", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "error", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "syncs", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "source_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "survivor_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "source_member_ids", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "survivor_member_ids", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "actor_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "actor_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "idempotency_key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "vocabulary_fingerprint", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "preview_fingerprint", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "counts", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_consolidations", + "name": "request_fingerprint", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_redirects", + "name": "source_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_redirects", + "name": "survivor_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tag_redirects", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "tag_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "taggable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "taggable_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "main", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "0", + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "author_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "author_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "taggings", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "task_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "assignee_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "assignee_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "role", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_assignments", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "task_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "actor_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "actor_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "changes", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_events", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_key_counters", + "name": "prefix", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_key_counters", + "name": "tasks_count", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "task_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "source_locator", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "other_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "score", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "band", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "levels", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "reasons", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "decision", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "decided_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "decided_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "decided_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "task_pairs", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "project_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "number", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "title", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "description", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "status", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "priority", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "parent_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "due_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "started_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "closed_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "closed_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "closed_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "author_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "author_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "source", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "package_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "source_locator", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "source_kind", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "source_group", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "resolution", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "verdict", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "metadata", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "next_check_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "title_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_reason_folded", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "category", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "claimed_by", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "claimed_until", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_certainty", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_as", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_by_type", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_by_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_certainty", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_reason", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "close_suggested_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "priority_score", + "type": "real", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "agent", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "revision", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "provider", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "external_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tasks", + "name": "source_url", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "channel", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "language", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates", + "name": "updated_by", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "key", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "channel", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "language", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "body", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "saved_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "saved_by", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "templates_history", + "name": "replaced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "account_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "kind", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "external_id", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "parent_id", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "title", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "title_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "body", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "normalized_text", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "data", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "source_created_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "source_updated_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "archived_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "deleted_at", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "tracker_items", + "name": "synced_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "transaction_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "position", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "category", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "category_folded", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "amount", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "project_id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "note", + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "created_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transaction_splits", + "name": "updated_at", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transcript_index_pending", + "name": "id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "transcript_index_pending", + "name": "indexable_type", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_index_redo", + "name": "chunk_id", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_indexes", + "name": "id", + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_indexes", + "name": "model", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_indexes", + "name": "dims", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_indexes", + "name": "ready", + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "vector_indexes", + "name": "filled_through", + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "entityType": "columns" + }, + { + "table": "account_identities", + "name": "account_identities_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "account_identities", + "name": "account_identities_in_address_book", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "address_book = 1", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "accounts", + "name": "accounts_by_organization_id", + "columns": [ + { + "value": "organization_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "agent_actions", + "name": "agent_actions_by_started_at_desc", + "columns": [ + { + "value": "\"started_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "agent_actions", + "name": "agent_actions_by_actor_type_actor_id", + "columns": [ + { + "value": "actor_type", + "isExpression": false + }, + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "agent_actions", + "name": "agent_actions_by_target_type_target_id", + "columns": [ + { + "value": "target_type", + "isExpression": false + }, + { + "value": "target_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "aliases", + "name": "aliases_displayed", + "columns": [ + { + "value": "aliasable_type", + "isExpression": false + }, + { + "value": "aliasable_id", + "isExpression": false + }, + { + "value": "ifnull(\"account_id\", 0)", + "isExpression": true + } + ], + "isUnique": true, + "where": "display = 1", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "aliases", + "name": "aliases_by_aliasable_type_aliasable_id_name_folded", + "columns": [ + { + "value": "aliasable_type", + "isExpression": false + }, + { + "value": "aliasable_id", + "isExpression": false + }, + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": true, + "where": "account_id IS NULL AND aliasable_type = 'project' OR account_id IS NULL AND aliasable_type = 'tag'", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "aliases", + "name": "aliases_by_aliasable_type_aliasable_id", + "columns": [ + { + "value": "aliasable_type", + "isExpression": false + }, + { + "value": "aliasable_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "aliases", + "name": "aliases_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "attachments", + "name": "attachments_by_name_folded", + "columns": [ + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "attachments", + "name": "attachments_local_path_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "local_path IS NOT NULL AND local_path_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "bot_updates", + "name": "bot_updates_by_account_id_received_at_desc", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "\"received_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "bots", + "name": "bots_by_owner_person_id", + "columns": [ + { + "value": "owner_person_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_calendar_id_starts_at", + "columns": [ + { + "value": "calendar_id", + "isExpression": false + }, + { + "value": "starts_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_ical_uid", + "columns": [ + { + "value": "ical_uid", + "isExpression": false + } + ], + "isUnique": false, + "where": "ical_uid IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_join_key", + "columns": [ + { + "value": "join_key", + "isExpression": false + } + ], + "isUnique": false, + "where": "join_key IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_calendar_id_series_external_id", + "columns": [ + { + "value": "calendar_id", + "isExpression": false + }, + { + "value": "series_external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "series_external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_event_id", + "columns": [ + { + "value": "event_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_event_series_id", + "columns": [ + { + "value": "event_series_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_event_type_event_id", + "columns": [ + { + "value": "event_type", + "isExpression": false + }, + { + "value": "event_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_by_organizer_identity_id", + "columns": [ + { + "value": "organizer_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entry_participants", + "name": "calendar_entry_participants_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "calendar_entry_revisions", + "name": "calendar_entry_revisions_by_entry_id_created_at", + "columns": [ + { + "value": "entry_id", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "canonical_auto_tag_claims", + "name": "canonical_auto_tag_claims_by_tag_id", + "columns": [ + { + "value": "tag_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "catalog_items", + "name": "catalog_items_by_supplier_type_supplier_id_sku", + "columns": [ + { + "value": "supplier_type", + "isExpression": false + }, + { + "value": "supplier_id", + "isExpression": false + }, + { + "value": "sku", + "isExpression": false + } + ], + "isUnique": true, + "where": "supplier_id IS NOT NULL AND sku IS NOT NULL AND deleted_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "catalog_items", + "name": "catalog_items_by_sku", + "columns": [ + { + "value": "sku", + "isExpression": false + } + ], + "isUnique": true, + "where": "supplier_id IS NULL AND sku IS NOT NULL AND deleted_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "catalog_items", + "name": "catalog_items_by_name_folded", + "columns": [ + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "catalog_items", + "name": "catalog_items_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_event_people", + "name": "chat_event_people_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_events", + "name": "chat_events_by_chat_id_happened_at", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "happened_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_events", + "name": "chat_events_by_actor_identity_id", + "columns": [ + { + "value": "actor_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_members", + "name": "chat_members_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_revisions", + "name": "chat_revisions_by_chat_id_created_at", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chat_revisions", + "name": "chat_revisions_by_account_id_old_value", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "old_value", + "isExpression": false + } + ], + "isUnique": false, + "where": "field = 'external_id'", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chats", + "name": "chats_by_recency", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "\"last_message_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chats", + "name": "chats_title_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "title IS NOT NULL AND title_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chats", + "name": "chats_by_parent_chat_id", + "columns": [ + { + "value": "parent_chat_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunk_messages", + "name": "chunk_messages_by_first_message_id", + "columns": [ + { + "value": "first_message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunk_messages", + "name": "chunk_messages_by_last_message_id", + "columns": [ + { + "value": "last_message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunks", + "name": "chunks_by_content_hash", + "columns": [ + { + "value": "content_hash", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunks", + "name": "chunks_by_scope_occurred_at", + "columns": [ + { + "value": "scope", + "isExpression": false + }, + { + "value": "occurred_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunks", + "name": "chunks_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "chunks", + "name": "chunks_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "content_metrics", + "name": "content_metrics_by_post_id_at", + "columns": [ + { + "value": "post_id", + "isExpression": false + }, + { + "value": "at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "content_post_revisions", + "name": "content_post_revisions_by_post_id_created_at", + "columns": [ + { + "value": "post_id", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "content_posts", + "name": "content_posts_by_account_id_status", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "status", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "content_posts", + "name": "content_posts_by_account_id_published_at", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "published_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "content_terms", + "name": "content_terms_by_tag_id", + "columns": [ + { + "value": "tag_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "contracts", + "name": "contracts_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "contracts", + "name": "contracts_by_deal_id", + "columns": [ + { + "value": "deal_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "contracts", + "name": "contracts_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "contracts", + "name": "contracts_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "conversation_messages", + "name": "conversation_messages_by_message_id", + "columns": [ + { + "value": "message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "conversation_readiness", + "name": "conversation_readiness_by_model", + "columns": [ + { + "value": "model", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "conversations", + "name": "conversations_by_chat", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "build", + "isExpression": false + }, + { + "value": "first_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "conversations", + "name": "conversations_by_first_message_id", + "columns": [ + { + "value": "first_message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "crm_files", + "name": "crm_files_by_account_id_owner_kind_owner_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "owner_kind", + "isExpression": false + }, + { + "value": "owner_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "deals", + "name": "deals_by_account_id_external_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "account_id IS NOT NULL AND external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "deals", + "name": "deals_by_organization_id", + "columns": [ + { + "value": "organization_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "deals", + "name": "deals_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "deals", + "name": "deals_by_stage_id", + "columns": [ + { + "value": "stage_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "deals", + "name": "deals_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "decision_requests", + "name": "decision_requests_by_channel_bot_profile_chat_id_message_id", + "columns": [ + { + "value": "channel", + "isExpression": false + }, + { + "value": "bot_profile", + "isExpression": false + }, + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "decisions", + "name": "decisions_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "decisions", + "name": "decisions_by_supersedes_id", + "columns": [ + { + "value": "supersedes_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "decisions", + "name": "decisions_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "document_changes", + "name": "document_changes_by_account_id_at", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "document_revisions", + "name": "document_revisions_by_document_id", + "columns": [ + { + "value": "document_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "email_locations", + "name": "email_locations_by_email_id", + "columns": [ + { + "value": "email_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "email_mailboxes", + "name": "email_mailboxes_by_mailbox_id", + "columns": [ + { + "value": "mailbox_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "email_recipients", + "name": "email_recipients_by_email_id", + "columns": [ + { + "value": "email_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "email_recipients", + "name": "email_recipients_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "email_threads", + "name": "email_threads_subject_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "subject IS NOT NULL AND subject_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "emails", + "name": "emails_by_time", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "\"sent_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "emails", + "name": "emails_by_mail_rule_id", + "columns": [ + { + "value": "mail_rule_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "mail_rule_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "emails", + "name": "emails_by_email_thread_id", + "columns": [ + { + "value": "email_thread_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "emails", + "name": "emails_by_from_identity_id", + "columns": [ + { + "value": "from_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "entity_link_events", + "name": "entity_link_events_by_linkable_type_linkable_id", + "columns": [ + { + "value": "linkable_type", + "isExpression": false + }, + { + "value": "linkable_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "entity_link_events", + "name": "entity_link_events_by_entity_type_to_entity_id", + "columns": [ + { + "value": "entity_type", + "isExpression": false + }, + { + "value": "to_entity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "events", + "name": "events_by_time", + "columns": [ + { + "value": "starts_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "events", + "name": "events_by_event_series_id", + "columns": [ + { + "value": "event_series_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "fact_removals", + "name": "fact_removals_by_removed_at", + "columns": [ + { + "value": "removed_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "facts", + "name": "facts_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "facts", + "name": "facts_by_subject_type_subject_id", + "columns": [ + { + "value": "subject_type", + "isExpression": false + }, + { + "value": "subject_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "facts", + "name": "facts_by_supersedes_id", + "columns": [ + { + "value": "supersedes_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "facts", + "name": "facts_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "facts", + "name": "facts_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "files", + "name": "files_by_account_id_path_folded", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "path_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "files", + "name": "files_path_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "path_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "files", + "name": "files_by_parent_id", + "columns": [ + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "files", + "name": "files_by_document_id", + "columns": [ + { + "value": "document_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_by_name_folded", + "columns": [ + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_by_holder_type_holder_id", + "columns": [ + { + "value": "holder_type", + "isExpression": false + }, + { + "value": "holder_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_financial_account_id_booked_date", + "columns": [ + { + "value": "financial_account_id", + "isExpression": false + }, + { + "value": "booked_date", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_payment_id", + "columns": [ + { + "value": "payment_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "payment_id IS NOT NULL AND deleted_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_counterparty_type_counterparty_id", + "columns": [ + { + "value": "counterparty_type", + "isExpression": false + }, + { + "value": "counterparty_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identities", + "name": "identities_by_email", + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "where": "email IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identities", + "name": "identities_name_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "name IS NOT NULL AND name_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identity_link_events", + "name": "identity_link_events_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identity_link_events", + "name": "identity_link_events_by_from_person_id", + "columns": [ + { + "value": "from_person_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identity_link_events", + "name": "identity_link_events_by_to_person_id", + "columns": [ + { + "value": "to_person_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identity_links", + "name": "identity_links_by_person_id", + "columns": [ + { + "value": "person_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "identity_revisions", + "name": "identity_revisions_by_identity", + "columns": [ + { + "value": "identity_id", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoice_lines", + "name": "invoice_lines_by_catalog_item_id", + "columns": [ + { + "value": "catalog_item_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_issuer_type_issuer_id", + "columns": [ + { + "value": "issuer_type", + "isExpression": false + }, + { + "value": "issuer_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_counterparty_type_counterparty_id", + "columns": [ + { + "value": "counterparty_type", + "isExpression": false + }, + { + "value": "counterparty_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_contract_id", + "columns": [ + { + "value": "contract_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "invoices", + "name": "invoices_by_subscription_id", + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "involvements", + "name": "involvements_by_person", + "columns": [ + { + "value": "person_id", + "isExpression": false + }, + { + "value": "\"occurred_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "involvements", + "name": "involvements_by_identity", + "columns": [ + { + "value": "identity_id", + "isExpression": false + }, + { + "value": "\"occurred_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "involvements", + "name": "involvements_by_subject_type_subject_id", + "columns": [ + { + "value": "subject_type", + "isExpression": false + }, + { + "value": "subject_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "involvements", + "name": "involvements_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "involvements", + "name": "involvements_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_account_id_external_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "account_id IS NOT NULL AND external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_organization_id", + "columns": [ + { + "value": "organization_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_stage_id", + "columns": [ + { + "value": "stage_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_deal_id", + "columns": [ + { + "value": "deal_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "leads", + "name": "leads_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "link_reviews", + "name": "link_reviews_by_status_created_at", + "columns": [ + { + "value": "status", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "link_revisions", + "name": "link_revisions_by_link_id_created_at", + "columns": [ + { + "value": "link_id", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "links", + "name": "links_unresolved", + "columns": [ + { + "value": "target_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": "to_id IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "links", + "name": "links_relationship_key", + "columns": [ + { + "value": "kind", + "isExpression": false + }, + { + "value": "from_type", + "isExpression": false + }, + { + "value": "from_id", + "isExpression": false + }, + { + "value": "to_type", + "isExpression": false + }, + { + "value": "to_id", + "isExpression": false + }, + { + "value": "ifnull(\"anchor\", '')", + "isExpression": true + }, + { + "value": "ifnull(\"role\", '')", + "isExpression": true + }, + { + "value": "ifnull(\"account_id\", 0)", + "isExpression": true + } + ], + "isUnique": true, + "where": "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "links", + "name": "links_by_from_type_from_id", + "columns": [ + { + "value": "from_type", + "isExpression": false + }, + { + "value": "from_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "links", + "name": "links_by_to_type_to_id", + "columns": [ + { + "value": "to_type", + "isExpression": false + }, + { + "value": "to_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mailboxes", + "name": "mailboxes_by_name_folded", + "columns": [ + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mailboxes", + "name": "mailboxes_name_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "name_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_chat_messages_by_meeting_id_external_id", + "columns": [ + { + "value": "meeting_id", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_chat_messages_by_meeting_id", + "columns": [ + { + "value": "meeting_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_chat_messages_by_sender_participant_id", + "columns": [ + { + "value": "sender_participant_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_participants", + "name": "meeting_participants_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_series", + "name": "meeting_series_by_event_series_id", + "columns": [ + { + "value": "event_series_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_series", + "name": "meeting_series_by_host_identity_id", + "columns": [ + { + "value": "host_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_transcript_rows", + "name": "meeting_transcript_rows_by_speaker_participant_id", + "columns": [ + { + "value": "speaker_participant_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meeting_transcripts", + "name": "meeting_transcripts_by_meeting_id", + "columns": [ + { + "value": "meeting_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_join_key", + "columns": [ + { + "value": "join_key", + "isExpression": false + } + ], + "isUnique": false, + "where": "join_key IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_join_key_to_fill", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "join_url IS NOT NULL AND join_key IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_time", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "\"started_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_account_id_title_folded", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "title_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_title_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "title IS NOT NULL AND title_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_meeting_series_id", + "columns": [ + { + "value": "meeting_series_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_event_id", + "columns": [ + { + "value": "event_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "meetings", + "name": "meetings_by_host_identity_id", + "columns": [ + { + "value": "host_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_observation_members", + "name": "member_observation_members_by_member_stay_id", + "columns": [ + { + "value": "member_stay_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_observation_members", + "name": "member_observation_members_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_observations", + "name": "member_observations_by_chat_id_observed_at_id", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "observed_at", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_stays", + "name": "member_stays_open", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "left_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_stays", + "name": "member_stays_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "member_stays", + "name": "member_stays_by_invited_by_identity_id", + "columns": [ + { + "value": "invited_by_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "memories", + "name": "memories_by_subject_type_subject_id", + "columns": [ + { + "value": "subject_type", + "isExpression": false + }, + { + "value": "subject_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "memories", + "name": "memories_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "memories", + "name": "memories_by_supersedes_id", + "columns": [ + { + "value": "supersedes_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "memories", + "name": "memories_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mentions", + "name": "mentions_by_kind_value", + "columns": [ + { + "value": "kind", + "isExpression": false + }, + { + "value": "value", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mentions", + "name": "mentions_by_domain", + "columns": [ + { + "value": "domain", + "isExpression": false + } + ], + "isUnique": false, + "where": "domain IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mentions", + "name": "mentions_by_status_kind", + "columns": [ + { + "value": "status", + "isExpression": false + }, + { + "value": "kind", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "mentions", + "name": "mentions_by_target_type_target_id", + "columns": [ + { + "value": "target_type", + "isExpression": false + }, + { + "value": "target_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "target_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_links", + "name": "message_links_unique", + "columns": [ + { + "value": "message_id", + "isExpression": false + }, + { + "value": "ifnull(\"parent_id\", 0)", + "isExpression": true + }, + { + "value": "source", + "isExpression": false + }, + { + "value": "kind", + "isExpression": false + }, + { + "value": "ifnull(\"build\", 0)", + "isExpression": true + } + ], + "isUnique": true, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_links", + "name": "message_links_by_build", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "build", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_links", + "name": "message_links_by_parent_id", + "columns": [ + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_reactions", + "name": "message_reactions_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_revisions", + "name": "message_revisions_by_message_id", + "columns": [ + { + "value": "message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "message_transcripts", + "name": "message_transcripts_by_message_id", + "columns": [ + { + "value": "message_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_time", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "\"sent_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_starred_by_time", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "\"sent_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": "starred = 1", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_reply", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "reply_to_external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "reply_to_external_id IS NOT NULL AND deleted_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_account", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_to_normalize", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "normalized_text IS NULL AND deleted_at IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_sender_identity_id", + "columns": [ + { + "value": "sender_identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_thread_root_id", + "columns": [ + { + "value": "thread_root_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "messages", + "name": "messages_by_chat_id_thread_external_id", + "columns": [ + { + "value": "chat_id", + "isExpression": false + }, + { + "value": "thread_external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "thread_root_id IS NULL AND thread_external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "note_revisions", + "name": "note_revisions_by_note_id", + "columns": [ + { + "value": "note_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "notes", + "name": "notes_by_notable_type_notable_id", + "columns": [ + { + "value": "notable_type", + "isExpression": false + }, + { + "value": "notable_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "notes", + "name": "notes_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "order_lines", + "name": "order_lines_by_catalog_item_id", + "columns": [ + { + "value": "catalog_item_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_customer_type_customer_id", + "columns": [ + { + "value": "customer_type", + "isExpression": false + }, + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_supplier_type_supplier_id", + "columns": [ + { + "value": "supplier_type", + "isExpression": false + }, + { + "value": "supplier_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_invoice_id", + "columns": [ + { + "value": "invoice_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_payment_id", + "columns": [ + { + "value": "payment_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_contract_id", + "columns": [ + { + "value": "contract_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "orders", + "name": "orders_by_deal_id", + "columns": [ + { + "value": "deal_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "organization_identities", + "name": "organization_identities_by_organization_id", + "columns": [ + { + "value": "organization_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payment_allocations", + "name": "payment_allocations_by_invoice_id", + "columns": [ + { + "value": "invoice_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payment_allocations", + "name": "payment_allocations_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_payer_type_payer_id", + "columns": [ + { + "value": "payer_type", + "isExpression": false + }, + { + "value": "payer_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_payee_type_payee_id", + "columns": [ + { + "value": "payee_type", + "isExpression": false + }, + { + "value": "payee_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_refund_of", + "columns": [ + { + "value": "refund_of", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "payments", + "name": "payments_by_subscription_id", + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "persons", + "name": "persons_by_kind", + "columns": [ + { + "value": "kind", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "persons", + "name": "persons_kind_to_work_out", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "kind IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_stage_changes_by_item_type_item_id", + "columns": [ + { + "value": "item_type", + "isExpression": false + }, + { + "value": "item_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_stage_changes_by_pipeline_id", + "columns": [ + { + "value": "pipeline_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_stage_changes_by_from_stage_id", + "columns": [ + { + "value": "from_stage_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_stage_changes_by_to_stage_id", + "columns": [ + { + "value": "to_stage_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stages", + "name": "pipeline_stages_by_pipeline_id_external_id", + "columns": [ + { + "value": "pipeline_id", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stages", + "name": "pipeline_stages_by_pipeline_id_position", + "columns": [ + { + "value": "pipeline_id", + "isExpression": false + }, + { + "value": "position", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipeline_stages", + "name": "pipeline_stages_by_base_stage_id", + "columns": [ + { + "value": "base_stage_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipelines", + "name": "pipelines_by_account_id_kind_external_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "kind", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "account_id IS NOT NULL AND external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "pipelines", + "name": "pipelines_by_name_folded_kind", + "columns": [ + { + "value": "name_folded", + "isExpression": false + }, + { + "value": "kind", + "isExpression": false + } + ], + "isUnique": true, + "where": "account_id IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "poll_votes", + "name": "poll_votes_by_identity_id", + "columns": [ + { + "value": "identity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "projects", + "name": "projects_by_name_folded", + "columns": [ + { + "value": "name_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "projects", + "name": "projects_name_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "name_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "projects", + "name": "projects_by_organization_id", + "columns": [ + { + "value": "organization_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "projects", + "name": "projects_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "projects", + "name": "projects_by_owner_type_owner_id", + "columns": [ + { + "value": "owner_type", + "isExpression": false + }, + { + "value": "owner_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_by_status_created_at", + "columns": [ + { + "value": "status", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_by_target_type_target_id", + "columns": [ + { + "value": "target_type", + "isExpression": false + }, + { + "value": "target_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_by_proposed_by_type_proposed_by_id", + "columns": [ + { + "value": "proposed_by_type", + "isExpression": false + }, + { + "value": "proposed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_by_decided_by_type_decided_by_id", + "columns": [ + { + "value": "decided_by_type", + "isExpression": false + }, + { + "value": "decided_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "record_relations", + "name": "record_relations_by_target_type_target_external_id", + "columns": [ + { + "value": "target_type", + "isExpression": false + }, + { + "value": "target_external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "record_relations", + "name": "record_relations_by_target_id", + "columns": [ + { + "value": "target_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "records", + "name": "records_by_account_id_batch_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "batch_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "records", + "name": "records_by_entity_type_entity_id", + "columns": [ + { + "value": "entity_type", + "isExpression": false + }, + { + "value": "entity_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "reminders", + "name": "reminders_due", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "state", + "isExpression": false + }, + { + "value": "due_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "reminders", + "name": "reminders_by_task_id", + "columns": [ + { + "value": "task_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "searches", + "name": "searches_history", + "columns": [ + { + "value": "command", + "isExpression": false + }, + { + "value": "params", + "isExpression": false + } + ], + "isUnique": true, + "where": "name IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "searches", + "name": "searches_by_last_run", + "columns": [ + { + "value": "\"last_run_at\" desc", + "isExpression": true + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_by_subscription_id_effective_from", + "columns": [ + { + "value": "subscription_id", + "isExpression": false + }, + { + "value": "effective_from", + "isExpression": false + } + ], + "isUnique": true, + "where": "review <> 'rejected'", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_supplier_type_supplier_id", + "columns": [ + { + "value": "supplier_type", + "isExpression": false + }, + { + "value": "supplier_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_customer_type_customer_id", + "columns": [ + { + "value": "customer_type", + "isExpression": false + }, + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_catalog_item_id", + "columns": [ + { + "value": "catalog_item_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_contract_id", + "columns": [ + { + "value": "contract_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "subscriptions", + "name": "subscriptions_by_confirmed_by_type_confirmed_by_id", + "columns": [ + { + "value": "confirmed_by_type", + "isExpression": false + }, + { + "value": "confirmed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "syncs", + "name": "syncs_by_account_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_by_source_id", + "columns": [ + { + "value": "source_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_by_survivor_id", + "columns": [ + { + "value": "survivor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_by_actor_type_actor_id", + "columns": [ + { + "value": "actor_type", + "isExpression": false + }, + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tag_redirects", + "name": "tag_redirects_by_survivor_id", + "columns": [ + { + "value": "survivor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "taggings", + "name": "taggings_main_topic", + "columns": [ + { + "value": "taggable_type", + "isExpression": false + }, + { + "value": "taggable_id", + "isExpression": false + } + ], + "isUnique": true, + "where": "main = 1", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "taggings", + "name": "taggings_by_taggable_type_taggable_id", + "columns": [ + { + "value": "taggable_type", + "isExpression": false + }, + { + "value": "taggable_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "taggings", + "name": "taggings_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_assignments", + "name": "task_assignments_by_assignee_type_assignee_id", + "columns": [ + { + "value": "assignee_type", + "isExpression": false + }, + { + "value": "assignee_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_events", + "name": "task_events_by_task_id", + "columns": [ + { + "value": "task_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_events", + "name": "task_events_by_actor_type_actor_id", + "columns": [ + { + "value": "actor_type", + "isExpression": false + }, + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_pairs", + "name": "task_pairs_by_decision_created_at", + "columns": [ + { + "value": "decision", + "isExpression": false + }, + { + "value": "created_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_pairs", + "name": "task_pairs_by_other_id", + "columns": [ + { + "value": "other_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "task_pairs", + "name": "task_pairs_by_decided_by_type_decided_by_id", + "columns": [ + { + "value": "decided_by_type", + "isExpression": false + }, + { + "value": "decided_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_title_folded", + "columns": [ + { + "value": "title_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_close_reason_to_fold", + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": "close_reason IS NOT NULL AND close_reason_folded IS NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_status", + "columns": [ + { + "value": "project_id", + "isExpression": false + }, + { + "value": "status", + "isExpression": false + }, + { + "value": "due_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_project_id_status_next_check_at", + "columns": [ + { + "value": "project_id", + "isExpression": false + }, + { + "value": "status", + "isExpression": false + }, + { + "value": "next_check_at", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_project_id_source_locator", + "columns": [ + { + "value": "project_id", + "isExpression": false + }, + { + "value": "source_locator", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_source_group", + "columns": [ + { + "value": "source_group", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_provider_external_id", + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "external_id", + "isExpression": false + } + ], + "isUnique": false, + "where": "external_id IS NOT NULL", + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_parent_id", + "columns": [ + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_closed_by_type_closed_by_id", + "columns": [ + { + "value": "closed_by_type", + "isExpression": false + }, + { + "value": "closed_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_author_type_author_id", + "columns": [ + { + "value": "author_type", + "isExpression": false + }, + { + "value": "author_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tasks", + "name": "tasks_by_close_suggested_by_type_close_suggested_by_id", + "columns": [ + { + "value": "close_suggested_by_type", + "isExpression": false + }, + { + "value": "close_suggested_by_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "templates_history", + "name": "templates_history_by_key_channel_language_id", + "columns": [ + { + "value": "key", + "isExpression": false + }, + { + "value": "channel", + "isExpression": false + }, + { + "value": "language", + "isExpression": false + }, + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "tracker_items", + "name": "tracker_items_by_account_id_kind_parent_id", + "columns": [ + { + "value": "account_id", + "isExpression": false + }, + { + "value": "kind", + "isExpression": false + }, + { + "value": "parent_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "transaction_splits", + "name": "transaction_splits_by_category_folded", + "columns": [ + { + "value": "category_folded", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "transaction_splits", + "name": "transaction_splits_by_project_id", + "columns": [ + { + "value": "project_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "entityType": "indexes" + }, + { + "table": "account_identities", + "name": "fk_account_identities_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "account_identities", + "name": "fk_account_identities_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "accounts", + "name": "fk_accounts_organization_id_organizations_id_fk", + "columns": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "aliases", + "name": "fk_aliases_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "bot_updates", + "name": "fk_bot_updates_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "bots", + "name": "fk_bots_owner_person_id_persons_id_fk", + "columns": [ + "owner_person_id" + ], + "tableTo": "persons", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entries", + "name": "fk_calendar_entries_calendar_id_calendars_id_fk", + "columns": [ + "calendar_id" + ], + "tableTo": "calendars", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entries", + "name": "fk_calendar_entries_series_entry_id_calendar_entries_id_fk", + "columns": [ + "series_entry_id" + ], + "tableTo": "calendar_entries", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entries", + "name": "fk_calendar_entries_event_id_events_id_fk", + "columns": [ + "event_id" + ], + "tableTo": "events", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entries", + "name": "fk_calendar_entries_event_series_id_event_series_id_fk", + "columns": [ + "event_series_id" + ], + "tableTo": "event_series", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entries", + "name": "fk_calendar_entries_organizer_identity_id_identities_id_fk", + "columns": [ + "organizer_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entry_participants", + "name": "fk_calendar_entry_participants_entry_id_calendar_entries_id_fk", + "columns": [ + "entry_id" + ], + "tableTo": "calendar_entries", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entry_participants", + "name": "fk_calendar_entry_participants_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendar_entry_revisions", + "name": "fk_calendar_entry_revisions_entry_id_calendar_entries_id_fk", + "columns": [ + "entry_id" + ], + "tableTo": "calendar_entries", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "calendars", + "name": "fk_calendars_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "canonical_auto_tag_claims", + "name": "fk_auto_tag_claims_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "canonical_auto_tag_claims", + "name": "fk_auto_tag_claims_tag_id_tags_id_fk", + "columns": [ + "tag_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_event_people", + "name": "fk_chat_event_people_chat_event_id_chat_events_id_fk", + "columns": [ + "chat_event_id" + ], + "tableTo": "chat_events", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_event_people", + "name": "fk_chat_event_people_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_events", + "name": "fk_chat_events_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_events", + "name": "fk_chat_events_actor_identity_id_identities_id_fk", + "columns": [ + "actor_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_members", + "name": "fk_chat_members_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chat_members", + "name": "fk_chat_members_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chats", + "name": "fk_chats_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chats", + "name": "fk_chats_parent_chat_id_chats_id_fk", + "columns": [ + "parent_chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chunk_messages", + "name": "fk_chunk_messages_chunk_id_chunks_id_fk", + "columns": [ + "chunk_id" + ], + "tableTo": "chunks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chunk_messages", + "name": "fk_chunk_messages_first_message_id_messages_id_fk", + "columns": [ + "first_message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chunk_messages", + "name": "fk_chunk_messages_last_message_id_messages_id_fk", + "columns": [ + "last_message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chunks", + "name": "fk_chunks_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "chunks", + "name": "fk_chunks_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_authors", + "name": "fk_content_authors_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_channels", + "name": "fk_content_channels_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_metrics", + "name": "fk_content_metrics_post_id_content_posts_id_fk", + "columns": [ + "post_id" + ], + "tableTo": "content_posts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_post_revisions", + "name": "fk_content_post_revisions_post_id_content_posts_id_fk", + "columns": [ + "post_id" + ], + "tableTo": "content_posts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_posts", + "name": "fk_content_posts_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_terms", + "name": "fk_content_terms_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "content_terms", + "name": "fk_content_terms_tag_id_canonical_tags_id_fk", + "columns": [ + "tag_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "contracts", + "name": "fk_contracts_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "contracts", + "name": "fk_contracts_deal_id_deals_id_fk", + "columns": [ + "deal_id" + ], + "tableTo": "deals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversation_messages", + "name": "fk_conversation_messages_conversation_id_conversations_id_fk", + "columns": [ + "conversation_id" + ], + "tableTo": "conversations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversation_messages", + "name": "fk_conversation_messages_message_id_messages_id_fk", + "columns": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversation_readiness", + "name": "fk_conversation_readiness_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversation_state", + "name": "fk_conversation_state_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversations", + "name": "fk_conversations_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "conversations", + "name": "fk_conversations_first_message_id_messages_id_fk", + "columns": [ + "first_message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "crm_fields", + "name": "fk_crm_fields_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "crm_files", + "name": "fk_crm_files_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "deals", + "name": "fk_deals_organization_id_organizations_id_fk", + "columns": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "deals", + "name": "fk_deals_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "deals", + "name": "fk_deals_stage_id_pipeline_stages_id_fk", + "columns": [ + "stage_id" + ], + "tableTo": "pipeline_stages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "deals", + "name": "fk_deals_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "decisions", + "name": "fk_decisions_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "decisions", + "name": "fk_decisions_supersedes_id_decisions_id_fk", + "columns": [ + "supersedes_id" + ], + "tableTo": "decisions", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "document_revisions", + "name": "fk_document_revisions_document_id_documents_id_fk", + "columns": [ + "document_id" + ], + "tableTo": "documents", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "documents", + "name": "fk_documents_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_locations", + "name": "fk_email_locations_mailbox_id_mailboxes_id_fk", + "columns": [ + "mailbox_id" + ], + "tableTo": "mailboxes", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_locations", + "name": "fk_email_locations_email_id_emails_id_fk", + "columns": [ + "email_id" + ], + "tableTo": "emails", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_mailboxes", + "name": "fk_email_mailboxes_email_id_emails_id_fk", + "columns": [ + "email_id" + ], + "tableTo": "emails", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_mailboxes", + "name": "fk_email_mailboxes_mailbox_id_mailboxes_id_fk", + "columns": [ + "mailbox_id" + ], + "tableTo": "mailboxes", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_recipients", + "name": "fk_email_recipients_email_id_emails_id_fk", + "columns": [ + "email_id" + ], + "tableTo": "emails", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_recipients", + "name": "fk_email_recipients_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "email_threads", + "name": "fk_email_threads_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "emails", + "name": "fk_emails_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "emails", + "name": "fk_emails_email_thread_id_email_threads_id_fk", + "columns": [ + "email_thread_id" + ], + "tableTo": "email_threads", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "emails", + "name": "fk_emails_from_identity_id_identities_id_fk", + "columns": [ + "from_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "events", + "name": "fk_events_event_series_id_event_series_id_fk", + "columns": [ + "event_series_id" + ], + "tableTo": "event_series", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "facts", + "name": "fk_facts_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "facts", + "name": "fk_facts_supersedes_id_facts_id_fk", + "columns": [ + "supersedes_id" + ], + "tableTo": "facts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "fetch_leases", + "name": "fk_fetch_leases_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "files", + "name": "fk_files_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "files", + "name": "fk_files_parent_id_files_id_fk", + "columns": [ + "parent_id" + ], + "tableTo": "files", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "files", + "name": "fk_files_document_id_documents_id_fk", + "columns": [ + "document_id" + ], + "tableTo": "documents", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "financial_transactions", + "name": "fk_financial_transactions_financial_account_id_financial_accounts_id_fk", + "columns": [ + "financial_account_id" + ], + "tableTo": "financial_accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "financial_transactions", + "name": "fk_financial_transactions_payment_id_payments_id_fk", + "columns": [ + "payment_id" + ], + "tableTo": "payments", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "financial_transactions", + "name": "fk_financial_transactions_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_link_events", + "name": "fk_identity_link_events_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_link_events", + "name": "fk_identity_link_events_from_person_id_persons_id_fk", + "columns": [ + "from_person_id" + ], + "tableTo": "persons", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_link_events", + "name": "fk_identity_link_events_to_person_id_persons_id_fk", + "columns": [ + "to_person_id" + ], + "tableTo": "persons", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_links", + "name": "fk_identity_links_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_links", + "name": "fk_identity_links_person_id_persons_id_fk", + "columns": [ + "person_id" + ], + "tableTo": "persons", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "identity_revisions", + "name": "fk_identity_revisions_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "invoice_lines", + "name": "fk_invoice_lines_invoice_id_invoices_id_fk", + "columns": [ + "invoice_id" + ], + "tableTo": "invoices", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "invoice_lines", + "name": "fk_invoice_lines_catalog_item_id_catalog_items_id_fk", + "columns": [ + "catalog_item_id" + ], + "tableTo": "catalog_items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "invoices", + "name": "fk_invoices_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "invoices", + "name": "fk_invoices_contract_id_contracts_id_fk", + "columns": [ + "contract_id" + ], + "tableTo": "contracts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "invoices", + "name": "fk_invoices_subscription_id_subscriptions_id_fk", + "columns": [ + "subscription_id" + ], + "tableTo": "subscriptions", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "involvements", + "name": "fk_involvements_person_id_persons_id_fk", + "columns": [ + "person_id" + ], + "tableTo": "persons", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "involvements", + "name": "fk_involvements_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "involvements", + "name": "fk_involvements_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "involvements", + "name": "fk_involvements_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "leads", + "name": "fk_leads_organization_id_organizations_id_fk", + "columns": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "leads", + "name": "fk_leads_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "leads", + "name": "fk_leads_stage_id_pipeline_stages_id_fk", + "columns": [ + "stage_id" + ], + "tableTo": "pipeline_stages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "leads", + "name": "fk_leads_deal_id_deals_id_fk", + "columns": [ + "deal_id" + ], + "tableTo": "deals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "leads", + "name": "fk_leads_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "mail_rules", + "name": "fk_mail_rules_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "mailboxes", + "name": "fk_mailboxes_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_chat_messages", + "name": "fk_meeting_chat_messages_meeting_id_meetings_id_fk", + "columns": [ + "meeting_id" + ], + "tableTo": "meetings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_chat_messages", + "name": "fk_meeting_chat_messages_sender_participant_id_meeting_participants_id_fk", + "columns": [ + "sender_participant_id" + ], + "tableTo": "meeting_participants", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_participants", + "name": "fk_meeting_participants_meeting_id_meetings_id_fk", + "columns": [ + "meeting_id" + ], + "tableTo": "meetings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_participants", + "name": "fk_meeting_participants_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_series", + "name": "fk_meeting_series_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_series", + "name": "fk_meeting_series_event_series_id_event_series_id_fk", + "columns": [ + "event_series_id" + ], + "tableTo": "event_series", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_series", + "name": "fk_meeting_series_host_identity_id_identities_id_fk", + "columns": [ + "host_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_summaries", + "name": "fk_meeting_summaries_meeting_id_meetings_id_fk", + "columns": [ + "meeting_id" + ], + "tableTo": "meetings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_transcript_rows", + "name": "fk_meeting_transcript_rows_meeting_transcript_id_meeting_transcripts_id_fk", + "columns": [ + "meeting_transcript_id" + ], + "tableTo": "meeting_transcripts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_transcript_rows", + "name": "fk_meeting_transcript_rows_speaker_participant_id_meeting_participants_id_fk", + "columns": [ + "speaker_participant_id" + ], + "tableTo": "meeting_participants", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meeting_transcripts", + "name": "fk_meeting_transcripts_meeting_id_meetings_id_fk", + "columns": [ + "meeting_id" + ], + "tableTo": "meetings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meetings", + "name": "fk_meetings_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meetings", + "name": "fk_meetings_meeting_series_id_meeting_series_id_fk", + "columns": [ + "meeting_series_id" + ], + "tableTo": "meeting_series", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meetings", + "name": "fk_meetings_event_id_events_id_fk", + "columns": [ + "event_id" + ], + "tableTo": "events", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "meetings", + "name": "fk_meetings_host_identity_id_identities_id_fk", + "columns": [ + "host_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_counts", + "name": "fk_member_counts_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_observation_members", + "name": "fk_member_observation_members_member_observation_id_member_observations_id_fk", + "columns": [ + "member_observation_id" + ], + "tableTo": "member_observations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_observation_members", + "name": "fk_member_observation_members_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_observation_members", + "name": "fk_member_observation_members_member_stay_id_member_stays_id_fk", + "columns": [ + "member_stay_id" + ], + "tableTo": "member_stays", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_observations", + "name": "fk_member_observations_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_stays", + "name": "fk_member_stays_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_stays", + "name": "fk_member_stays_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "member_stays", + "name": "fk_member_stays_invited_by_identity_id_identities_id_fk", + "columns": [ + "invited_by_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "memories", + "name": "fk_memories_supersedes_id_memories_id_fk", + "columns": [ + "supersedes_id" + ], + "tableTo": "memories", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "memories", + "name": "fk_memories_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_counter_observations", + "name": "fk_message_counter_observations_message_id_messages_id_fk", + "columns": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_links", + "name": "fk_message_links_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_links", + "name": "fk_message_links_message_id_messages_id_fk", + "columns": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_links", + "name": "fk_message_links_parent_id_messages_id_fk", + "columns": [ + "parent_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_reactions", + "name": "fk_message_reactions_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_reactions", + "name": "fk_message_reactions_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_revisions", + "name": "fk_message_revisions_message_id_messages_id_fk", + "columns": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_transcripts", + "name": "fk_message_transcripts_message_id_messages_id_fk", + "columns": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "message_transcripts", + "name": "fk_message_transcripts_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "messages", + "name": "fk_messages_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "messages", + "name": "fk_messages_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "messages", + "name": "fk_messages_sender_identity_id_identities_id_fk", + "columns": [ + "sender_identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "messages", + "name": "fk_messages_thread_root_id_messages_id_fk", + "columns": [ + "thread_root_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "note_revisions", + "name": "fk_note_revisions_note_id_notes_id_fk", + "columns": [ + "note_id" + ], + "tableTo": "notes", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "order_lines", + "name": "fk_order_lines_order_id_orders_id_fk", + "columns": [ + "order_id" + ], + "tableTo": "orders", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "order_lines", + "name": "fk_order_lines_catalog_item_id_catalog_items_id_fk", + "columns": [ + "catalog_item_id" + ], + "tableTo": "catalog_items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "orders", + "name": "fk_orders_invoice_id_invoices_id_fk", + "columns": [ + "invoice_id" + ], + "tableTo": "invoices", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "orders", + "name": "fk_orders_payment_id_payments_id_fk", + "columns": [ + "payment_id" + ], + "tableTo": "payments", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "orders", + "name": "fk_orders_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "orders", + "name": "fk_orders_contract_id_contracts_id_fk", + "columns": [ + "contract_id" + ], + "tableTo": "contracts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "orders", + "name": "fk_orders_deal_id_deals_id_fk", + "columns": [ + "deal_id" + ], + "tableTo": "deals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "organization_identities", + "name": "fk_organization_identities_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "organization_identities", + "name": "fk_organization_identities_organization_id_organizations_id_fk", + "columns": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "payment_allocations", + "name": "fk_payment_allocations_payment_id_payments_id_fk", + "columns": [ + "payment_id" + ], + "tableTo": "payments", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "payment_allocations", + "name": "fk_payment_allocations_invoice_id_invoices_id_fk", + "columns": [ + "invoice_id" + ], + "tableTo": "invoices", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "payments", + "name": "fk_payments_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "payments", + "name": "fk_payments_refund_of_payments_id_fk", + "columns": [ + "refund_of" + ], + "tableTo": "payments", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "payments", + "name": "fk_payments_subscription_id_subscriptions_id_fk", + "columns": [ + "subscription_id" + ], + "tableTo": "subscriptions", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipeline_stage_changes", + "name": "fk_pipeline_stage_changes_pipeline_id_pipelines_id_fk", + "columns": [ + "pipeline_id" + ], + "tableTo": "pipelines", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipeline_stage_changes", + "name": "fk_pipeline_stage_changes_from_stage_id_pipeline_stages_id_fk", + "columns": [ + "from_stage_id" + ], + "tableTo": "pipeline_stages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipeline_stage_changes", + "name": "fk_pipeline_stage_changes_to_stage_id_pipeline_stages_id_fk", + "columns": [ + "to_stage_id" + ], + "tableTo": "pipeline_stages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipeline_stages", + "name": "fk_pipeline_stages_pipeline_id_pipelines_id_fk", + "columns": [ + "pipeline_id" + ], + "tableTo": "pipelines", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipeline_stages", + "name": "fk_pipeline_stages_base_stage_id_pipeline_stages_id_fk", + "columns": [ + "base_stage_id" + ], + "tableTo": "pipeline_stages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "pipelines", + "name": "fk_pipelines_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "poll_votes", + "name": "fk_poll_votes_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "poll_votes", + "name": "fk_poll_votes_identity_id_identities_id_fk", + "columns": [ + "identity_id" + ], + "tableTo": "identities", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "projects", + "name": "fk_projects_organization_id_organizations_id_fk", + "columns": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "projects", + "name": "fk_projects_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "proposed_actions", + "name": "fk_proposed_actions_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "record_relations", + "name": "fk_record_relations_record_id_records_id_fk", + "columns": [ + "record_id" + ], + "tableTo": "records", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "record_relations", + "name": "fk_record_relations_target_id_records_id_fk", + "columns": [ + "target_id" + ], + "tableTo": "records", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "records", + "name": "fk_records_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "reminders", + "name": "fk_reminders_task_id_tasks_id_fk", + "columns": [ + "task_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "reminders", + "name": "fk_reminders_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "subscription_prices", + "name": "fk_subscription_prices_subscription_id_subscriptions_id_fk", + "columns": [ + "subscription_id" + ], + "tableTo": "subscriptions", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "subscriptions", + "name": "fk_subscriptions_catalog_item_id_catalog_items_id_fk", + "columns": [ + "catalog_item_id" + ], + "tableTo": "catalog_items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "subscriptions", + "name": "fk_subscriptions_contract_id_contracts_id_fk", + "columns": [ + "contract_id" + ], + "tableTo": "contracts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "subscriptions", + "name": "fk_subscriptions_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "sync_cursors", + "name": "fk_sync_cursors_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "sync_ranges", + "name": "fk_sync_ranges_chat_id_chats_id_fk", + "columns": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "syncs", + "name": "fk_syncs_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tag_consolidations", + "name": "fk_tag_consolidations_source_id_canonical_tags_id_fk", + "columns": [ + "source_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tag_consolidations", + "name": "fk_tag_consolidations_survivor_id_canonical_tags_id_fk", + "columns": [ + "survivor_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tag_redirects", + "name": "fk_tag_redirects_source_id_canonical_tags_id_fk", + "columns": [ + "source_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tag_redirects", + "name": "fk_tag_redirects_survivor_id_canonical_tags_id_fk", + "columns": [ + "survivor_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "taggings", + "name": "fk_taggings_tag_id_tags_id_fk", + "columns": [ + "tag_id" + ], + "tableTo": "canonical_tags", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "task_assignments", + "name": "fk_task_assignments_task_id_tasks_id_fk", + "columns": [ + "task_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "task_events", + "name": "fk_task_events_task_id_tasks_id_fk", + "columns": [ + "task_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "task_pairs", + "name": "fk_task_pairs_task_id_tasks_id_fk", + "columns": [ + "task_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "task_pairs", + "name": "fk_task_pairs_other_id_tasks_id_fk", + "columns": [ + "other_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tasks", + "name": "fk_tasks_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tasks", + "name": "fk_tasks_parent_id_tasks_id_fk", + "columns": [ + "parent_id" + ], + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "tracker_items", + "name": "fk_tracker_items_account_id_accounts_id_fk", + "columns": [ + "account_id" + ], + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "transaction_splits", + "name": "fk_transaction_splits_transaction_id_financial_transactions_id_fk", + "columns": [ + "transaction_id" + ], + "tableTo": "financial_transactions", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "transaction_splits", + "name": "fk_transaction_splits_project_id_projects_id_fk", + "columns": [ + "project_id" + ], + "tableTo": "projects", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "entityType": "fks" + }, + { + "table": "account_identities", + "name": "account_identities_pk", + "columns": [ + "account_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "canonical_auto_tag_claims", + "name": "auto_tag_claims_pk", + "columns": [ + "chat_id", + "tag_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chat_event_people", + "name": "chat_event_people_pk", + "columns": [ + "chat_event_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chat_members", + "name": "chat_members_pk", + "columns": [ + "chat_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "conversation_messages", + "name": "conversation_messages_pk", + "columns": [ + "conversation_id", + "message_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "conversation_readiness", + "name": "conversation_readiness_pk", + "columns": [ + "chat_id", + "model" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "document_annotation_transfers", + "name": "document_annotation_transfers_pk", + "columns": [ + "source_key", + "collection" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "document_index_pending", + "name": "document_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "email_index_pending", + "name": "email_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "email_locations", + "name": "email_locations_pk", + "columns": [ + "mailbox_id", + "uidvalidity", + "uid" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "email_mailboxes", + "name": "email_mailboxes_pk", + "columns": [ + "email_id", + "mailbox_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "embeddings", + "name": "embeddings_pk", + "columns": [ + "model", + "content_hash" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "enrichments", + "name": "enrichments_pk", + "columns": [ + "subject_type", + "subject_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "event_index_pending", + "name": "event_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "fetch_leases", + "name": "fetch_leases_pk", + "columns": [ + "chat_id", + "anchor" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "involvement_pending", + "name": "involvement_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_index_pending", + "name": "meeting_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "member_counts", + "name": "member_counts_pk", + "columns": [ + "chat_id", + "date" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "member_observation_members", + "name": "member_observation_members_pk", + "columns": [ + "member_observation_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "memory_index_pending", + "name": "memory_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "mention_pending", + "name": "mention_pending_pk", + "columns": [ + "source_type", + "source_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_counter_observations", + "name": "message_counter_observations_pk", + "columns": [ + "message_id", + "counter" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "note_index_pending", + "name": "note_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "sync_cursors", + "name": "sync_cursors_pk", + "columns": [ + "account_id", + "key" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "sync_ranges", + "name": "sync_ranges_pk", + "columns": [ + "chat_id", + "from_key" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "task_index_pending", + "name": "task_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "templates", + "name": "templates_pk", + "columns": [ + "key", + "channel", + "language" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "transcript_index_pending", + "name": "transcript_index_pending_pk", + "columns": [ + "indexable_type", + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "accounts", + "name": "accounts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "agent_actions", + "name": "agent_actions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "aliases", + "name": "aliases_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "attachments", + "name": "attachments_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "bot_updates", + "name": "bot_updates_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "bots", + "name": "bots_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "calendar_entry_participants", + "name": "calendar_entry_participants_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "calendar_entry_revisions", + "name": "calendar_entry_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "calendars", + "name": "calendars_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "canonical_tags", + "name": "tags_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "catalog_items", + "name": "catalog_items_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chat_events", + "name": "chat_events_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chat_revision_source", + "name": "chat_revision_source_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chat_revisions", + "name": "chat_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chats", + "name": "chats_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chunk_messages", + "name": "chunk_messages_pk", + "columns": [ + "chunk_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "chunks", + "name": "chunks_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_authors", + "name": "content_authors_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_channels", + "name": "content_channels_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_metrics", + "name": "content_metrics_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_post_revisions", + "name": "content_post_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_posts", + "name": "content_posts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "content_terms", + "name": "content_terms_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "contracts", + "name": "contracts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "conversation_state", + "name": "conversation_state_pk", + "columns": [ + "chat_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "conversations", + "name": "conversations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "crm_fields", + "name": "crm_fields_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "crm_files", + "name": "crm_files_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "deals", + "name": "deals_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "decision_requests", + "name": "decision_requests_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "decisions", + "name": "decisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "document_changes", + "name": "document_changes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "document_revisions", + "name": "document_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "documents", + "name": "documents_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "email_recipients", + "name": "email_recipients_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "email_threads", + "name": "email_threads_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "emails", + "name": "emails_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "entity_link_events", + "name": "entity_link_events_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "event_series", + "name": "event_series_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "events", + "name": "events_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "fact_removals", + "name": "fact_removals_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "facts", + "name": "facts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "files", + "name": "files_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "identities", + "name": "identities_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "identity_link_events", + "name": "identity_link_events_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "identity_links", + "name": "identity_links_pk", + "columns": [ + "identity_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "identity_revisions", + "name": "identity_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "invoice_lines", + "name": "invoice_lines_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "invoices", + "name": "invoices_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "involvements", + "name": "involvements_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "leads", + "name": "leads_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "link_reviews", + "name": "link_reviews_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "link_revisions", + "name": "link_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "links", + "name": "links_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "mail_rules", + "name": "mail_rules_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "mailboxes", + "name": "mailboxes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_chat_messages_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_participants", + "name": "meeting_participants_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_series", + "name": "meeting_series_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_summaries", + "name": "meeting_summaries_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_transcript_rows", + "name": "meeting_transcript_rows_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meeting_transcripts", + "name": "meeting_transcripts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "meetings", + "name": "meetings_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "member_observations", + "name": "member_observations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "member_stays", + "name": "member_stays_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "memories", + "name": "memories_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "mentions", + "name": "mentions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_links", + "name": "message_links_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_reactions", + "name": "message_reactions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_revisions", + "name": "message_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_stems_pending", + "name": "message_stems_pending_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "message_transcripts", + "name": "message_transcripts_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "messages", + "name": "messages_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "note_revisions", + "name": "note_revisions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "notes", + "name": "notes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "order_lines", + "name": "order_lines_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "orders", + "name": "orders_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "organization_identities", + "name": "organization_identities_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "organizations", + "name": "organizations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "payment_allocations", + "name": "payment_allocations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "payments", + "name": "payments_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "persons", + "name": "persons_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "pipeline_stage_changes", + "name": "pipeline_stage_changes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "pipeline_stages", + "name": "pipeline_stages_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "pipelines", + "name": "pipelines_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "places", + "name": "places_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "poll_votes", + "name": "poll_votes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "projects", + "name": "projects_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "record_relations", + "name": "record_relations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "records", + "name": "records_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "reminders", + "name": "reminders_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "search_index_state", + "name": "search_index_state_pk", + "columns": [ + "name" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "searches", + "name": "searches_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "store_settings", + "name": "store_settings_pk", + "columns": [ + "key" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "subscriptions", + "name": "subscriptions_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "syncs", + "name": "syncs_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "tag_redirects", + "name": "tag_redirects_pk", + "columns": [ + "source_id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "taggings", + "name": "taggings_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "task_assignments", + "name": "task_assignments_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "task_events", + "name": "task_events_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "task_key_counters", + "name": "task_key_counters_pk", + "columns": [ + "prefix" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "task_pairs", + "name": "task_pairs_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "tasks", + "name": "tasks_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "templates_history", + "name": "templates_history_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "tracker_items", + "name": "tracker_items_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "transaction_splits", + "name": "transaction_splits_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "vector_indexes", + "name": "vector_indexes_pk", + "columns": [ + "id" + ], + "nameExplicit": false, + "entityType": "pks" + }, + { + "table": "accounts", + "name": "accounts_provider_external_id_unique", + "columns": [ + "provider", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "attachments", + "name": "attachments_attachable_type_attachable_id_position_unique", + "columns": [ + "attachable_type", + "attachable_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "bot_updates", + "name": "bot_updates_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_calendar_id_external_id_unique", + "columns": [ + "calendar_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_series_entry_id_original_starts_at_unique", + "columns": [ + "series_entry_id", + "original_starts_at" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "calendar_entry_participants", + "name": "calendar_entry_participants_entry_id_email_unique", + "columns": [ + "entry_id", + "email" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "calendars", + "name": "calendars_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "chat_events", + "name": "chat_events_chat_id_source_id_unique", + "columns": [ + "chat_id", + "source_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "chats", + "name": "chats_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "chunks", + "name": "chunks_chunkable_type_chunkable_id_position_unique", + "columns": [ + "chunkable_type", + "chunkable_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "content_authors", + "name": "content_authors_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "content_channels", + "name": "content_channels_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "content_posts", + "name": "content_posts_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "content_terms", + "name": "content_terms_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "crm_fields", + "name": "crm_fields_account_id_kind_code_unique", + "columns": [ + "account_id", + "kind", + "code" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "crm_files", + "name": "crm_files_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "documents", + "name": "documents_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "email_threads", + "name": "email_threads_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "emails", + "name": "emails_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "files", + "name": "files_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "identities", + "name": "identities_provider_external_id_unique", + "columns": [ + "provider", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "invoice_lines", + "name": "invoice_lines_invoice_id_position_unique", + "columns": [ + "invoice_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "link_reviews", + "name": "link_reviews_linkable_type_linkable_id_entity_type_unique", + "columns": [ + "linkable_type", + "linkable_id", + "entity_type" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "mail_rules", + "name": "mail_rules_account_id_conditions_unique", + "columns": [ + "account_id", + "conditions" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "mailboxes", + "name": "mailboxes_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "meeting_participants", + "name": "meeting_participants_meeting_id_identity_id_unique", + "columns": [ + "meeting_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "meeting_series", + "name": "meeting_series_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "meeting_summaries", + "name": "meeting_summaries_meeting_id_source_unique", + "columns": [ + "meeting_id", + "source" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "meeting_transcript_rows", + "name": "meeting_transcript_rows_meeting_transcript_id_position_unique", + "columns": [ + "meeting_transcript_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "meetings", + "name": "meetings_account_id_external_id_unique", + "columns": [ + "account_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "mentions", + "name": "mentions_source_type_source_id_source_field_start_offset_kind_unique", + "columns": [ + "source_type", + "source_id", + "source_field", + "start_offset", + "kind" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "message_reactions", + "name": "message_reactions_chat_id_message_external_id_identity_id_unique", + "columns": [ + "chat_id", + "message_external_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "message_transcripts", + "name": "message_transcripts_chat_id_message_external_id_unique", + "columns": [ + "chat_id", + "message_external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "messages", + "name": "messages_chat_id_external_id_unique", + "columns": [ + "chat_id", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "order_lines", + "name": "order_lines_order_id_position_unique", + "columns": [ + "order_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "organization_identities", + "name": "organization_identities_identity_id_organization_id_unique", + "columns": [ + "identity_id", + "organization_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "payment_allocations", + "name": "payment_allocations_payment_id_invoice_id_unique", + "columns": [ + "payment_id", + "invoice_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "pipeline_stages", + "name": "pipeline_stages_pipeline_id_name_folded_unique", + "columns": [ + "pipeline_id", + "name_folded" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "poll_votes", + "name": "poll_votes_chat_id_message_external_id_identity_id_unique", + "columns": [ + "chat_id", + "message_external_id", + "identity_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "record_relations", + "name": "record_relations_record_id_role_target_type_target_external_id_unique", + "columns": [ + "record_id", + "role", + "target_type", + "target_external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "records", + "name": "records_account_id_type_external_id_unique", + "columns": [ + "account_id", + "type", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "taggings", + "name": "taggings_tag_id_taggable_type_taggable_id_unique", + "columns": [ + "tag_id", + "taggable_type", + "taggable_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "task_assignments", + "name": "task_assignments_task_id_assignee_type_assignee_id_role_unique", + "columns": [ + "task_id", + "assignee_type", + "assignee_id", + "role" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "task_pairs", + "name": "task_pairs_task_id_other_id_unique", + "columns": [ + "task_id", + "other_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "tasks", + "name": "tasks_project_id_number_unique", + "columns": [ + "project_id", + "number" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "tracker_items", + "name": "tracker_items_account_id_kind_external_id_unique", + "columns": [ + "account_id", + "kind", + "external_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "transaction_splits", + "name": "transaction_splits_transaction_id_position_unique", + "columns": [ + "transaction_id", + "position" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "bots", + "name": "bots_name_unique", + "columns": [ + "name" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "canonical_tags", + "name": "tags_name_unique", + "columns": [ + "name" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "decision_requests", + "name": "decision_requests_token_digest_unique", + "columns": [ + "token_digest" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "places", + "name": "places_folded_unique", + "columns": [ + "folded" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "projects", + "name": "projects_key_unique", + "columns": [ + "key" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "searches", + "name": "searches_name_unique", + "columns": [ + "name" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_idempotency_key_unique", + "columns": [ + "idempotency_key" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "tasks", + "name": "tasks_key_unique", + "columns": [ + "key" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "tasks", + "name": "tasks_package_id_unique", + "columns": [ + "package_id" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "vector_indexes", + "name": "vector_indexes_model_unique", + "columns": [ + "model" + ], + "nameExplicit": false, + "entityType": "uniques" + }, + { + "table": "accounts", + "name": "accounts_settings_json", + "value": "\"settings\" IS NULL OR json_valid(\"settings\")", + "entityType": "checks" + }, + { + "table": "agent_actions", + "name": "agent_actions_target_pair", + "value": "(\"target_type\" IS NULL) = (\"target_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "attachments", + "name": "attachments_provider_ref_json", + "value": "\"provider_ref\" IS NULL OR json_valid(\"provider_ref\")", + "entityType": "checks" + }, + { + "table": "attachments", + "name": "attachments_contact_json", + "value": "\"contact\" IS NULL OR json_valid(\"contact\")", + "entityType": "checks" + }, + { + "table": "bot_updates", + "name": "bot_updates_payload_json", + "value": "\"payload\" IS NULL OR json_valid(\"payload\")", + "entityType": "checks" + }, + { + "table": "bots", + "name": "bots_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_recurrence_json", + "value": "\"recurrence\" IS NULL OR json_valid(\"recurrence\")", + "entityType": "checks" + }, + { + "table": "calendar_entries", + "name": "calendar_entries_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "catalog_items", + "name": "catalog_items_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "catalog_items", + "name": "catalog_items_supplier_pair", + "value": "(\"supplier_type\" IS NULL) = (\"supplier_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "catalog_items", + "name": "catalog_items_unit_price_not_negative", + "value": "\"unit_price\" IS NULL OR \"unit_price\" >= 0", + "entityType": "checks" + }, + { + "table": "chats", + "name": "chats_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "content_authors", + "name": "content_authors_data_json", + "value": "\"data\" IS NULL OR json_valid(\"data\")", + "entityType": "checks" + }, + { + "table": "content_metrics", + "name": "content_metrics_raw_json", + "value": "\"raw\" IS NULL OR json_valid(\"raw\")", + "entityType": "checks" + }, + { + "table": "content_posts", + "name": "content_posts_data_json", + "value": "\"data\" IS NULL OR json_valid(\"data\")", + "entityType": "checks" + }, + { + "table": "content_terms", + "name": "content_terms_data_json", + "value": "\"data\" IS NULL OR json_valid(\"data\")", + "entityType": "checks" + }, + { + "table": "contracts", + "name": "contracts_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "contracts", + "name": "contracts_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "contracts", + "name": "contracts_value_not_negative", + "value": "\"value\" IS NULL OR \"value\" >= 0", + "entityType": "checks" + }, + { + "table": "crm_fields", + "name": "crm_fields_options_json", + "value": "\"options\" IS NULL OR json_valid(\"options\")", + "entityType": "checks" + }, + { + "table": "deals", + "name": "deals_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "deals", + "name": "deals_amount_not_negative", + "value": "\"amount\" IS NULL OR \"amount\" >= 0", + "entityType": "checks" + }, + { + "table": "decisions", + "name": "decisions_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "decisions", + "name": "decisions_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "document_revisions", + "name": "document_revisions_front_matter_json", + "value": "\"front_matter\" IS NULL OR json_valid(\"front_matter\")", + "entityType": "checks" + }, + { + "table": "documents", + "name": "documents_front_matter_json", + "value": "\"front_matter\" IS NULL OR json_valid(\"front_matter\")", + "entityType": "checks" + }, + { + "table": "documents", + "name": "documents_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "email_threads", + "name": "email_threads_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "emails", + "name": "emails_references_json", + "value": "\"references\" IS NULL OR json_valid(\"references\")", + "entityType": "checks" + }, + { + "table": "emails", + "name": "emails_headers_json", + "value": "\"headers\" IS NULL OR json_valid(\"headers\")", + "entityType": "checks" + }, + { + "table": "emails", + "name": "emails_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "facts", + "name": "facts_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "facts", + "name": "facts_subject_pair", + "value": "(\"subject_type\" IS NULL) = (\"subject_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "facts", + "name": "facts_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "files", + "name": "files_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "financial_accounts", + "name": "financial_accounts_holder_pair", + "value": "(\"holder_type\" IS NULL) = (\"holder_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_counterparty_pair", + "value": "(\"counterparty_type\" IS NULL) = (\"counterparty_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "financial_transactions", + "name": "financial_transactions_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "identities", + "name": "identities_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "identity_revisions", + "name": "identity_revisions_marks_json", + "value": "\"marks\" IS NULL OR json_valid(\"marks\")", + "entityType": "checks" + }, + { + "table": "invoice_lines", + "name": "invoice_lines_amount_not_negative", + "value": "\"amount\" IS NULL OR \"amount\" >= 0", + "entityType": "checks" + }, + { + "table": "invoice_lines", + "name": "invoice_lines_unit_price_not_negative", + "value": "\"unit_price\" IS NULL OR \"unit_price\" >= 0", + "entityType": "checks" + }, + { + "table": "invoices", + "name": "invoices_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "invoices", + "name": "invoices_issuer_pair", + "value": "(\"issuer_type\" IS NULL) = (\"issuer_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "invoices", + "name": "invoices_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "invoices", + "name": "invoices_total_not_negative", + "value": "\"total\" IS NULL OR \"total\" >= 0", + "entityType": "checks" + }, + { + "table": "leads", + "name": "leads_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "leads", + "name": "leads_amount_not_negative", + "value": "\"amount\" IS NULL OR \"amount\" >= 0", + "entityType": "checks" + }, + { + "table": "link_reviews", + "name": "link_reviews_candidates_json", + "value": "\"candidates\" IS NULL OR json_valid(\"candidates\")", + "entityType": "checks" + }, + { + "table": "link_revisions", + "name": "link_revisions_before_json", + "value": "\"before\" IS NULL OR json_valid(\"before\")", + "entityType": "checks" + }, + { + "table": "links", + "name": "links_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "mail_rules", + "name": "mail_rules_conditions_json", + "value": "\"conditions\" IS NULL OR json_valid(\"conditions\")", + "entityType": "checks" + }, + { + "table": "mail_rules", + "name": "mail_rules_actions_json", + "value": "\"actions\" IS NULL OR json_valid(\"actions\")", + "entityType": "checks" + }, + { + "table": "meeting_chat_messages", + "name": "meeting_chat_messages_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meeting_participants", + "name": "meeting_participants_sessions_json", + "value": "\"sessions\" IS NULL OR json_valid(\"sessions\")", + "entityType": "checks" + }, + { + "table": "meeting_participants", + "name": "meeting_participants_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meeting_series", + "name": "meeting_series_recurrence_json", + "value": "\"recurrence\" IS NULL OR json_valid(\"recurrence\")", + "entityType": "checks" + }, + { + "table": "meeting_series", + "name": "meeting_series_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meeting_summaries", + "name": "meeting_summaries_sections_json", + "value": "\"sections\" IS NULL OR json_valid(\"sections\")", + "entityType": "checks" + }, + { + "table": "meeting_summaries", + "name": "meeting_summaries_next_steps_json", + "value": "\"next_steps\" IS NULL OR json_valid(\"next_steps\")", + "entityType": "checks" + }, + { + "table": "meeting_summaries", + "name": "meeting_summaries_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meeting_transcript_rows", + "name": "meeting_transcript_rows_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meeting_transcripts", + "name": "meeting_transcripts_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "meetings", + "name": "meetings_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "memories", + "name": "memories_subject_pair", + "value": "(\"subject_type\" IS NULL) = (\"subject_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "messages", + "name": "messages_reply_to_json", + "value": "\"reply_to\" IS NULL OR json_valid(\"reply_to\")", + "entityType": "checks" + }, + { + "table": "messages", + "name": "messages_forward_json", + "value": "\"forward\" IS NULL OR json_valid(\"forward\")", + "entityType": "checks" + }, + { + "table": "messages", + "name": "messages_reactions_json", + "value": "\"reactions\" IS NULL OR json_valid(\"reactions\")", + "entityType": "checks" + }, + { + "table": "messages", + "name": "messages_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "messages", + "name": "messages_mentions_json", + "value": "\"mentions\" IS NULL OR json_valid(\"mentions\")", + "entityType": "checks" + }, + { + "table": "notes", + "name": "notes_author_pair", + "value": "(\"author_type\" IS NULL) = (\"author_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "order_lines", + "name": "order_lines_amount_not_negative", + "value": "\"amount\" IS NULL OR \"amount\" >= 0", + "entityType": "checks" + }, + { + "table": "order_lines", + "name": "order_lines_unit_price_not_negative", + "value": "\"unit_price\" IS NULL OR \"unit_price\" >= 0", + "entityType": "checks" + }, + { + "table": "orders", + "name": "orders_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "orders", + "name": "orders_supplier_pair", + "value": "(\"supplier_type\" IS NULL) = (\"supplier_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "orders", + "name": "orders_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "orders", + "name": "orders_total_not_negative", + "value": "\"total\" IS NULL OR \"total\" >= 0", + "entityType": "checks" + }, + { + "table": "organizations", + "name": "organizations_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "payments", + "name": "payments_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "payments", + "name": "payments_payer_pair", + "value": "(\"payer_type\" IS NULL) = (\"payer_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "payments", + "name": "payments_payee_pair", + "value": "(\"payee_type\" IS NULL) = (\"payee_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "payments", + "name": "payments_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "poll_votes", + "name": "poll_votes_answers_json", + "value": "\"answers\" IS NULL OR json_valid(\"answers\")", + "entityType": "checks" + }, + { + "table": "projects", + "name": "projects_owner_pair", + "value": "(\"owner_type\" IS NULL) = (\"owner_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_payload_json", + "value": "\"payload\" IS NULL OR json_valid(\"payload\")", + "entityType": "checks" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_result_json", + "value": "\"result\" IS NULL OR json_valid(\"result\")", + "entityType": "checks" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_target_pair", + "value": "(\"target_type\" IS NULL) = (\"target_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "proposed_actions", + "name": "proposed_actions_decided_by_pair", + "value": "(\"decided_by_type\" IS NULL) = (\"decided_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "records", + "name": "records_fields_json", + "value": "\"fields\" IS NULL OR json_valid(\"fields\")", + "entityType": "checks" + }, + { + "table": "records", + "name": "records_entity_pair", + "value": "(\"entity_type\" IS NULL) = (\"entity_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "searches", + "name": "searches_params_json", + "value": "\"params\" IS NULL OR json_valid(\"params\")", + "entityType": "checks" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "subscription_prices", + "name": "subscription_prices_amount_not_negative", + "value": "\"amount\" IS NULL OR \"amount\" >= 0", + "entityType": "checks" + }, + { + "table": "subscriptions", + "name": "subscriptions_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "subscriptions", + "name": "subscriptions_confirmed_by_pair", + "value": "(\"confirmed_by_type\" IS NULL) = (\"confirmed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "syncs", + "name": "syncs_counts_json", + "value": "\"counts\" IS NULL OR json_valid(\"counts\")", + "entityType": "checks" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_source_member_ids_json", + "value": "\"source_member_ids\" IS NULL OR json_valid(\"source_member_ids\")", + "entityType": "checks" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_survivor_member_ids_json", + "value": "\"survivor_member_ids\" IS NULL OR json_valid(\"survivor_member_ids\")", + "entityType": "checks" + }, + { + "table": "tag_consolidations", + "name": "tag_consolidations_counts_json", + "value": "\"counts\" IS NULL OR json_valid(\"counts\")", + "entityType": "checks" + }, + { + "table": "taggings", + "name": "taggings_author_pair", + "value": "(\"author_type\" IS NULL) = (\"author_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "task_events", + "name": "task_events_changes_json", + "value": "\"changes\" IS NULL OR json_valid(\"changes\")", + "entityType": "checks" + }, + { + "table": "task_events", + "name": "task_events_actor_pair", + "value": "(\"actor_type\" IS NULL) = (\"actor_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "task_pairs", + "name": "task_pairs_levels_json", + "value": "\"levels\" IS NULL OR json_valid(\"levels\")", + "entityType": "checks" + }, + { + "table": "task_pairs", + "name": "task_pairs_reasons_json", + "value": "\"reasons\" IS NULL OR json_valid(\"reasons\")", + "entityType": "checks" + }, + { + "table": "task_pairs", + "name": "task_pairs_decided_by_pair", + "value": "(\"decided_by_type\" IS NULL) = (\"decided_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "tasks", + "name": "tasks_metadata_json", + "value": "\"metadata\" IS NULL OR json_valid(\"metadata\")", + "entityType": "checks" + }, + { + "table": "tasks", + "name": "tasks_closed_by_pair", + "value": "(\"closed_by_type\" IS NULL) = (\"closed_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "tasks", + "name": "tasks_close_suggested_by_pair", + "value": "(\"close_suggested_by_type\" IS NULL) = (\"close_suggested_by_id\" IS NULL)", + "entityType": "checks" + }, + { + "table": "tracker_items", + "name": "tracker_items_data_json", + "value": "\"data\" IS NULL OR json_valid(\"data\")", + "entityType": "checks" + } + ], + "renames": [] +} diff --git a/package.json b/package.json index dd92cdd9b..ae627e538 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wirecat/cli-core", - "version": "0.753.0", + "version": "1.0.0-rc.0", "description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store", "license": "Apache-2.0", "author": "Viacheslav Ptsarev", @@ -14,9 +14,21 @@ }, "type": "module", "wirecat": { + "stable": [ + ".", + "./cli", + "./cli/start", + "./mcp", + "./sends", + "./skill-validation", + "./sqlite-runtime", + "./store", + "./testing", + "./update" + ], "store": { - "speaks": 72, - "minCompatible": 56 + "speaks": 73, + "minCompatible": 73 } }, "engines": { @@ -59,8 +71,12 @@ "default": "./dist/sqlite-runtime.js" }, "./store": { - "types": "./dist/store/index.d.ts", - "default": "./dist/store/index.js" + "types": "./dist/store/public.d.ts", + "default": "./dist/store/public.js" + }, + "./store/areas": { + "types": "./dist/store/areas.d.ts", + "default": "./dist/store/areas.js" }, "./cli": { "types": "./dist/cli/index.d.ts", @@ -238,6 +254,9 @@ "./constants": { "types": "./dist/constants/index.d.ts", "default": "./dist/constants/index.js" + }, + "./internal/*": { + "types": "./dist/*.d.ts" } }, "scripts": { @@ -248,7 +267,7 @@ "lint:fix": "biome check --write .", "db:generate": "drizzle-kit generate", "db:bundle": "node scripts/bundle-migrations.ts", - "docs:check": "pnpm build && node --experimental-strip-types scripts/docs-check.ts && node scripts/search-docs.ts --check && node scripts/standard-docs.ts --check", + "docs:check": "pnpm build && node --experimental-strip-types scripts/docs-check.ts && node scripts/search-docs.ts --check && node scripts/standard-docs.ts --check && node scripts/reasons-docs.ts --check", "standard:docs": "node scripts/standard-docs.ts", "test": "vitest run", "test:watch": "vitest", @@ -269,6 +288,7 @@ "standards:check": "node config/wirecat/check.mjs", "docs:images": "node docs/images/src/render.ts", "docs:lint": "markdownlint-cli2", + "reasons:docs": "node scripts/reasons-docs.ts", "docs:spell": "cspell lint --config cspell.json --no-progress README.md", "ci:quick": "pnpm typecheck && vitest run src/cli/command-lint.test.ts", "help:examples": "HELP_EXAMPLES_REPORT=1 vitest run scripts/help-examples.test.ts --silent=false" @@ -334,7 +354,7 @@ "@types/pngjs": "6.0.5", "@types/ssh2": "1.15.5", "@vitest/coverage-v8": "^5.0.5", - "@wirecat/cli-base": "0.132.0", + "@wirecat/cli-base": "1.0.0-rc.0", "@wirecat/cli-core-legacy-tags": "npm:@wirecat/cli-core@0.414.0", "ajv": "8.17.1", "commander": "15.0.0", @@ -358,8 +378,8 @@ }, "peerDependencies": { "@napi-rs/canvas": ">=0.1.69 <2", - "@wirecat/cli-base": ">=0.125.0 <1.0.0", - "commander": ">=15", + "@wirecat/cli-base": "^1.0.0-0", + "commander": "^15.0.0", "mysql2": "^3.24.6", "pg": "^8.23.1", "ssh2": "^1.17.0" diff --git a/parity.json b/parity.json index 3e3a2b503..c83246342 100644 --- a/parity.json +++ b/parity.json @@ -4987,7 +4987,10 @@ "in": "all" }, "store migrate": { - "in": "all" + "in": "all", + "options": { + "--no-backup": "all" + } }, "store rebuild": { "in": "all" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93625fa3d..3c9815498 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -192,11 +192,11 @@ importers: specifier: ^5.0.5 version: 5.0.5(vitest@5.0.5) '@wirecat/cli-base': - specifier: 0.132.0 - version: 0.132.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + specifier: 1.0.0-rc.0 + version: 1.0.0-rc.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core-legacy-tags': specifier: npm:@wirecat/cli-core@0.414.0 - version: '@wirecat/cli-core@0.414.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@0.132.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)' + version: '@wirecat/cli-core@0.414.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@1.0.0-rc.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)' ajv: specifier: 8.17.1 version: 8.17.1 @@ -1394,16 +1394,16 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.132.0': - resolution: {integrity: sha512-y43hIGVFDUgVFTksTFnlK0KdLuROBDcv0smqme4/WSjkUS3PaGQnuAvu09G2VvW0zmvM2+OHFuQaZEN3Hir8nQ==} - engines: {node: '>=22'} + '@wirecat/cli-base@1.0.0-rc.0': + resolution: {integrity: sha512-vRfE2U3c3mUJGkyaaUQngxscRLCbKyL2/TiBj3Hy4hvA8rwkIgsr2jecRhB7z+0iUH8EkoEhChVaOvYD6H4xbA==} + engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@scalar/openapi-upgrader': ^0.4.6 - commander: '>=15' + commander: ^15.0.0 esbuild: ^0.28.0 swagger-converter: ^2.1.0 - vitest: '>=5' + vitest: ^5.0.0 peerDependenciesMeta: '@scalar/openapi-upgrader': optional: true @@ -3890,7 +3890,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.132.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': + '@wirecat/cli-base@1.0.0-rc.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': dependencies: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) cli-table3: 0.6.5 @@ -3917,7 +3917,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.414.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@0.132.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': + '@wirecat/cli-core@0.414.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@1.0.0-rc.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': dependencies: '@anthropic-ai/sdk': 0.131.0(zod@4.6.7) '@bomb.sh/tab': 0.0.22(commander@15.0.0) @@ -3925,7 +3925,7 @@ snapshots: '@modelcontextprotocol/server': 2.3.0 '@resvg/resvg-js': 2.6.2 '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) - '@wirecat/cli-base': 0.132.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + '@wirecat/cli-base': 1.0.0-rc.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core-onnx': 1.0.1 '@wirecat/cli-core-sqlite': 1.0.1 '@xmldom/xmldom': 0.9.12 diff --git a/scripts/changelog-fragments.test.ts b/scripts/changelog-fragments.test.ts index 29d2818d4..ee919630a 100644 --- a/scripts/changelog-fragments.test.ts +++ b/scripts/changelog-fragments.test.ts @@ -77,7 +77,7 @@ describe("fragmentProblems", () => { "changes/Feat/X.md:1: text before the first ### heading", 'changes/Feat/X.md:2: only "### " headings; the release adds the version', "changes/Feat/X.md:2: text before the first ### heading", - 'changes/Feat/X.md:3: "Fixes" is not one of: Added, Changed — may break callers, Fixed, Security, Removed', + 'changes/Feat/X.md:3: "Fixes" is not one of: Added, Changed — may break callers, Changed — experimental, Deprecated, Fixed, Security, Removed', 'changes/Feat/X.md:7: "Fixed" twice', "changes/Feat/X.md:8: internal id IDEA-260 — say what changed instead", ]) diff --git a/scripts/changelog-shape.ts b/scripts/changelog-shape.ts index 5dc556dd7..25a04cd71 100644 --- a/scripts/changelog-shape.ts +++ b/scripts/changelog-shape.ts @@ -1,6 +1,8 @@ import { execFileSync } from "node:child_process" +import { CHANGELOG_HEADINGS } from "@wirecat/cli-base/release" -export const HEADINGS = ["Added", "Changed — may break callers", "Fixed", "Security", "Removed"] +// In cli-base's order, which fragments are collected in. +export const HEADINGS: readonly string[] = CHANGELOG_HEADINGS const UNRELEASED = "Unreleased" const VERSION_HEADING = /^## (\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?) — (\d{2})\.(\d{2})\.(\d{4})$/ const CONFLICT_MARKER = /^(<{7}|\|{7}|={7}|>{7})( |$)/ diff --git a/scripts/check-dist.ts b/scripts/check-dist.ts index 003b88483..201713b69 100644 --- a/scripts/check-dist.ts +++ b/scripts/check-dist.ts @@ -34,7 +34,7 @@ const rows = await store.orm.select().from(accounts) store.database.close() if (rows.length !== 1) throw new Error(`bundled Drizzle read ${rows.length} rows, not 1`) -const { openStore } = await import(join(root, "store/index.js")) +const { openStore } = await import(join(root, "store/public.js")) const messages = await openStore({ path: join(scratch("cli-messaging-dist-"), "messages.db") }) const key = { provider: "telegram", account: "1" } const message = { diff --git a/scripts/docs-check.ts b/scripts/docs-check.ts index e1c018a63..5412fc39e 100644 --- a/scripts/docs-check.ts +++ b/scripts/docs-check.ts @@ -9,7 +9,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs" import { dirname, join, relative, resolve, sep } from "node:path" import { fileURLToPath } from "node:url" import { fragmentProblems, readFragments } from "./changelog-fragments.ts" -import { changelogProblems, taggedVersions } from "./changelog-shape.ts" +import { changelogProblems, ID, taggedVersions } from "./changelog-shape.ts" const SKIPPED = new Set(["node_modules", "dist", "coverage", ".git", ".worktrees", "docs_ai"]) @@ -101,7 +101,22 @@ const linkProblems = (base: string): string[] => { return problems } +/** Doc comments ship in the `.d.ts` files of this public package, where a private journal's ids mean nothing. */ +const declarationIdProblems = (dist: string): string[] => + existsSync(dist) + ? readdirSync(dist, { recursive: true, encoding: "utf8" }) + .filter((name) => name.endsWith(".d.ts")) + .flatMap((name) => + readFileSync(join(dist, name), "utf8") + .split("\n") + .flatMap((line, index) => + (line.match(ID) ?? []).map((id) => `dist/${name}:${index + 1}: internal id ${id} — say why instead`), + ), + ) + : [] + const problems = [ + ...declarationIdProblems(join(root, "dist")), ...changelogProblems(readFileSync(join(root, "CHANGELOG.md"), "utf8"), taggedVersions(root)), ...readFragments(root).flatMap(fragmentProblems), ...linkProblems(root), diff --git a/scripts/next-version.mjs b/scripts/next-version.mjs index 71a19a861..cea491f0a 100644 --- a/scripts/next-version.mjs +++ b/scripts/next-version.mjs @@ -1,44 +1,77 @@ // The version bin/release publishes: the one in package.json when npm has not taken it and it is // above npm's latest, else the next free one at the same bump level (x.y.0 → minor, x.y.z → patch). +// With the repository's root, the version is then raised to the level its changelog section needs, the changes/ +// fragments included (cli-base's levelledVersion): a stable break after 1.0.0 makes it a major. // -// node scripts/next-version.mjs +// node scripts/next-version.mjs [] // // npm's answers are arguments, not calls, so CI and a shell test can hand it any registry state. -const [wanted = "", latest = "", versionsJson = ""] = process.argv.slice(2) +import { readFileSync } from "node:fs" +import { join } from "node:path" const parse = (version) => /^(\d+)\.(\d+)\.(\d+)$/.exec(version)?.slice(1).map(Number) const compare = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2] +// A levelled x.0.0 that is taken stays a major: 2.0.0 taken goes to 3.0.0, never to 2.1.0. +const stepOf = (version) => + version[1] === 0 && version[2] === 0 && version[0] >= 1 + ? ([major]) => [major + 1, 0, 0] + : version[2] === 0 + ? ([major, minor]) => [major, minor + 1, 0] + : ([major, minor, patch]) => [major, minor, patch + 1] -const want = parse(wanted) -if (!want) { - // A pre-release is picked by hand; bin/release still refuses it if npm has it. - console.log(wanted) - process.exit(0) +const freeVersion = (wanted, latest, taken) => { + const want = parse(wanted) + const top = parse(latest) + if (!top) { + if (taken.has(wanted)) + throw new Error(`${wanted} is on npm, and npm's latest "${latest}" is not a plain x.y.z version`) + return wanted + } + if (!taken.has(wanted) && compare(want, top) > 0) return wanted + // A taken x.y.0 steps the minor even after 1.0.0: package.json keeps the last release's number, and a taken 1.0.0 + // stepped as a major would make every later release one. + const step = + want[2] === 0 ? ([major, minor]) => [major, minor + 1, 0] : ([major, minor, patch]) => [major, minor, patch + 1] + let next = step(top) + while (taken.has(next.join("."))) next = step(next) + return next.join(".") } -let published = [] -try { - published = [JSON.parse(versionsJson || "[]")].flat() -} catch {} -const taken = new Set(published) - -const top = parse(latest) -if (!top) { - if (taken.has(wanted)) { - console.error(`${wanted} is on npm, and npm's latest "${latest}" is not a plain x.y.z version`) - process.exit(1) - } - console.log(wanted) - process.exit(0) +// The section the release will publish: the fragments collected into the version's own unpublished section, or into a +// new one above the last release. +const wouldBe = (changelog, wanted, version, taken, fragments, collectFragments) => { + const own = !taken.has(wanted) && changelog.includes(`\n## ${wanted} — `) ? wanted : undefined + const target = own ?? version + const text = own ? changelog : changelog.replace(/\n## /, `\n## ${version} — 01.01.1970\n\n## `) + return fragments.length > 0 ? collectFragments(text, target, fragments) : text } -if (!taken.has(wanted) && compare(want, top) > 0) { - console.log(wanted) - process.exit(0) +export const nextVersion = async (wanted, latest, versionsJson, root) => { + // A pre-release is picked by hand; bin/release still refuses it if npm has it. + if (!parse(wanted)) return wanted + let published = [] + try { + published = [JSON.parse(versionsJson || "[]")].flat() + } catch {} + const taken = new Set(published) + const version = freeVersion(wanted, latest, taken) + if (!root) return version + const { levelledVersion } = await import("@wirecat/cli-base/release") + const { collectFragments, readFragments } = await import("./changelog-fragments.ts") + const changelog = readFileSync(join(root, "CHANGELOG.md"), "utf8") + const text = wouldBe(changelog, wanted, version, taken, readFragments(root), collectFragments) + let levelled = parse(levelledVersion(text, version)) + const step = stepOf(levelled) + while (taken.has(levelled.join("."))) levelled = step(levelled) + return levelled.join(".") } -const step = - want[2] === 0 ? ([major, minor]) => [major, minor + 1, 0] : ([major, minor, patch]) => [major, minor, patch + 1] -let next = step(top) -while (taken.has(next.join("."))) next = step(next) -console.log(next.join(".")) +if (import.meta.main) { + const [wanted = "", latest = "", versionsJson = "", root] = process.argv.slice(2) + try { + console.log(await nextVersion(wanted, latest, versionsJson, root)) + } catch (error) { + console.error(error.message) + process.exit(1) + } +} diff --git a/scripts/next-version.test.ts b/scripts/next-version.test.ts new file mode 100644 index 000000000..b288a6097 --- /dev/null +++ b/scripts/next-version.test.ts @@ -0,0 +1,45 @@ +import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs" +import { tmpdir } from "node:os" +import { join } from "node:path" +import { describe, expect, it } from "vitest" +// @ts-expect-error a plain .mjs script, untyped +import { nextVersion } from "./next-version.mjs" + +const repo = (changelog: string, fragments: Record = {}) => { + const root = mkdtempSync(join(tmpdir(), "next-version-")) + writeFileSync(join(root, "CHANGELOG.md"), changelog) + mkdirSync(join(root, "changes")) + for (const [name, text] of Object.entries(fragments)) writeFileSync(join(root, "changes", name), text) + return root +} + +const released = (version: string) => `# Changelog\n\n## ${version} — 20.11.2026\n\n### Fixed\n\n- **A fix.**\n` +const fragment = (heading: string) => ({ "x.md": `### ${heading}\n\n- **Something.**\n` }) + +describe("nextVersion", () => { + it("keeps the 0.x minor steps without a root, as ci.yml's version job calls it", async () => { + expect(await nextVersion("0.736.0", "0.736.0", '["0.736.0"]')).toBe("0.737.0") + expect(await nextVersion("0.737.0", "0.736.0", '["0.736.0"]')).toBe("0.737.0") + expect(await nextVersion("1.0.0-rc.1", "0.736.0", '["0.736.0"]')).toBe("1.0.0-rc.1") + }) + + it("makes a break of the stable API after 1.0.0 a major, from the fragments", async () => { + const root = repo(released("1.0.0"), fragment("Changed — may break callers")) + expect(await nextVersion("1.0.0", "1.0.0", '["1.0.0"]', root)).toBe("2.0.0") + }) + + it("keeps a minor when the fragments add or fix only", async () => { + expect(await nextVersion("1.0.0", "1.0.0", '["1.0.0"]', repo(released("1.0.0"), fragment("Fixed")))).toBe("1.1.0") + expect(await nextVersion("1.0.0", "1.0.0", '["1.0.0"]', repo(released("1.0.0"), fragment("Added")))).toBe("1.1.0") + }) + + it("levels a section dated by hand with the fragments collected into it", async () => { + const root = repo(`# Changelog\n\n## 1.1.0 — 23.11.2026\n\n${released("1.0.0").slice(13)}`, fragment("Removed")) + expect(await nextVersion("1.1.0", "1.0.0", '["1.0.0"]', root)).toBe("2.0.0") + }) + + it("keeps a 0.x break a minor", async () => { + const root = repo(released("0.736.0"), fragment("Changed — may break callers")) + expect(await nextVersion("0.736.0", "0.736.0", '["0.736.0"]', root)).toBe("0.737.0") + }) +}) diff --git a/scripts/parity/downstream-result.sh b/scripts/parity/downstream-result.sh index c40724ff7..e951de718 100755 --- a/scripts/parity/downstream-result.sh +++ b/scripts/parity/downstream-result.sh @@ -8,6 +8,7 @@ # # outcomes dir one .json per matrix leg, written by its "Record the outcome" step # RESULT needs.downstream.result +# CLIS the matrix's list as JSON (downstream-list), when it is not all of downstream.json # PR LABEL GH_TOKEN GITHUB_REPOSITORY PR is empty outside a pull request: no label can apply set -uo pipefail @@ -26,7 +27,7 @@ known_until() { jq -r --arg r "$1" --arg t "$today" '.[] | select(.repo == $r an echo "| CLI | ref | build | typecheck | start | tests | command lint | docs |" echo "| --- | --- | --- | --- | --- | --- | --- | --- |" } >>"$summary" -for repo in $(jq -r '.[].repo' "$here/downstream.json"); do +for repo in $(jq -r '.[].repo' <<<"${CLIS:-$(cat "$here/downstream.json")}"); do file="$dir/$repo.json" if [ ! -f "$file" ]; then echo "| $repo | | no result | | | | | |" >>"$summary" diff --git a/scripts/parity/downstream.json b/scripts/parity/downstream.json index 7289c3b59..7b9783043 100644 --- a/scripts/parity/downstream.json +++ b/scripts/parity/downstream.json @@ -1,11 +1,21 @@ [ - { "cli": "mail", "repo": "mail-cli" }, - { "cli": "memo", "repo": "cli-memo" }, - { "cli": "tg", "repo": "tg-cli" }, - { "cli": "max", "repo": "max-cli" }, - { "cli": "wa", "repo": "whatsapp-cli" }, - { "cli": "drive", "repo": "drive-cli" }, + { "cli": "mail", "repo": "mail-cli", "pr": true }, + { "cli": "memo", "repo": "cli-memo", "pr": true }, + { "cli": "tg", "repo": "tg-cli", "pr": true }, + { "cli": "max", "repo": "max-cli", "pr": true }, + { "cli": "wa", "repo": "whatsapp-cli", "pr": true }, + { "cli": "drive", "repo": "drive-cli", "pr": true }, + { "cli": "attio", "repo": "attio-cli", "pr": true }, { "cli": "gcal", "repo": "gcal-cli" }, { "cli": "zm", "repo": "zoom-cli" }, - { "cli": "b24", "repo": "bitrix24-cli" } + { "cli": "b24", "repo": "bitrix24-cli" }, + { "cli": "amo", "repo": "amo-cli" }, + { "cli": "pbx", "repo": "asterisk-cli" }, + { "cli": "beeline", "repo": "beeline-cli" }, + { "cli": "hubspot", "repo": "hubspot-cli" }, + { "cli": "linear", "repo": "linear-cli" }, + { "cli": "notion", "repo": "notion-cli" }, + { "cli": "slack", "repo": "slack-cli" }, + { "cli": "wordpress", "repo": "wordpress-cli" }, + { "cli": "ydisk", "repo": "ydisk-cli" } ] diff --git a/scripts/parity/known-broken.json b/scripts/parity/known-broken.json index b8911408b..3013ac514 100644 --- a/scripts/parity/known-broken.json +++ b/scripts/parity/known-broken.json @@ -1,26 +1,8 @@ [ - { - "repo": "cli-memo", - "pr": 3258, - "until": "2026-11-30", - "reason": "#3258 no longer offers schedule exec over MCP; src/mcp/server.test.ts still expects it available to an agent" - }, - { - "repo": "mail-cli", - "pr": 3258, - "until": "2026-11-30", - "reason": "#3258 no longer offers schedule exec over MCP; src/mcp.test.ts still expects it in the catalogue as a write" - }, { "repo": "bitrix24-cli", "pr": 3258, "until": "2026-11-30", "reason": "#3258 no longer offers schedule exec over MCP; src/mcp.test.ts still pins it among the offered schedule commands" - }, - { - "repo": "max-cli", - "pr": 3258, - "until": "2026-11-30", - "reason": "#3258 no longer offers schedule exec over MCP; docs/mcp.md must list it among the commands kept off MCP (src/mcp-catalogue.test.ts)" } ] diff --git a/scripts/reasons-docs.test.ts b/scripts/reasons-docs.test.ts new file mode 100644 index 000000000..b7269e7be --- /dev/null +++ b/scripts/reasons-docs.test.ts @@ -0,0 +1,39 @@ +import { describe, expect, it } from "vitest" +import { breakProblems, documented, reasonsTable } from "./reasons-docs.ts" + +const reasons = [ + { reason: "item.not-found", code: "not_found", message: "no item | by this id", details: ["id"] }, + { reason: "db.timeout", code: "timeout", message: "the database did not answer" }, +] +const page = `intro\n\n\n\n${reasonsTable(reasons)}\n\n\n` +const fragment = (heading: string, line: string) => [{ name: "x.md", text: `### ${heading}\n\n- ${line}\n` }] + +describe("reasons docs", () => { + it("lists each reason sorted, with its code and detail keys", () => { + expect(reasonsTable(reasons).split("\n").slice(2)).toEqual([ + "| `db.timeout` | `timeout` | the database did not answer | |", + "| `item.not-found` | `not_found` | no item \\| by this id | `id` |", + ]) + expect(documented(page)).toEqual( + new Map([ + ["db.timeout", "timeout"], + ["item.not-found", "not_found"], + ]), + ) + }) + + it("refuses a documented reason that is gone or recoded without a fragment", () => { + const now = [{ ...reasons[0], code: "conflict" }] as typeof reasons + expect(breakProblems(documented(page), now, [])).toEqual([ + expect.stringMatching(/^`db\.timeout` is gone from REASONS/), + expect.stringMatching(/^`item\.not-found` changed its code from not_found to conflict/), + ]) + }) + + it("takes the removal once a fragment names it under a break heading, not under another", () => { + const now = reasons.slice(0, 1) + expect(breakProblems(documented(page), now, fragment("Removed", "**`db.timeout`** is gone."))).toEqual([]) + expect(breakProblems(documented(page), now, fragment("Changed — may break callers", "`db.timeout`"))).toEqual([]) + expect(breakProblems(documented(page), now, fragment("Fixed", "`db.timeout`"))).toHaveLength(1) + }) +}) diff --git a/scripts/reasons-docs.ts b/scripts/reasons-docs.ts new file mode 100644 index 000000000..9a0f78a0b --- /dev/null +++ b/scripts/reasons-docs.ts @@ -0,0 +1,86 @@ +/** + * Writes docs/reasons.md's table from `REASONS`, the error reasons cli-core raises (`CORE_REASONS`). The committed page + * is the contract: a reason it lists that `REASONS` no longer has, or has under another code, breaks callers that + * match on it, so neither mode drops that row until a changes/ fragment names the reason under a break heading. + * + * pnpm reasons:docs write the table (after pnpm build) + * node scripts/reasons-docs.ts --check fail when the page and REASONS disagree (in docs:check) + */ +import { readFileSync, writeFileSync } from "node:fs" +import { join } from "node:path" +import { pathToFileURL } from "node:url" +import { type Fragment, readFragments } from "./changelog-fragments.ts" +import { cell, withGenerated } from "./generated-blocks.ts" + +export type Reason = { reason: string; code: string; message: string; details?: readonly string[] } + +const BREAKS = ["Changed — may break callers", "Removed"] +const BLOCK = "reasons" +const ROW = /^\| `([^`]+)` \| `([^`]+)` \|/ + +export const documented = (text: string): Map => { + const start = text.indexOf(``) + const end = text.indexOf(``) + const rows = new Map() + for (const line of text.slice(start, end).split("\n")) { + const found = ROW.exec(line) + if (found?.[1] && found[2]) rows.set(found[1], found[2]) + } + return rows +} + +const announced = (fragments: Fragment[]): Set => { + const names = new Set() + for (const { text } of fragments) { + let heading = "" + for (const line of text.split("\n")) { + if (line.startsWith("### ")) heading = line.slice(4).trim() + else if (BREAKS.includes(heading)) for (const [, name] of line.matchAll(/`([^`\s]+)`/g)) names.add(name ?? "") + } + } + return names +} + +/** The documented reasons that are gone or recoded without a fragment saying so. */ +export const breakProblems = (rows: Map, reasons: readonly Reason[], fragments: Fragment[]) => { + const now = new Map(reasons.map((entry) => [entry.reason, entry.code])) + const told = announced(fragments) + const problems: string[] = [] + for (const [reason, code] of rows) { + if (told.has(reason)) continue + const current = now.get(reason) + if (current === undefined) + problems.push(`\`${reason}\` is gone from REASONS: removing or renaming a reason breaks callers`) + else if (current !== code) problems.push(`\`${reason}\` changed its code from ${code} to ${current}`) + } + return problems.map( + (problem) => + `${problem}. Name it in a changes/ fragment under "${BREAKS.join('" or "')}", then run pnpm reasons:docs`, + ) +} + +export const reasonsTable = (reasons: readonly Reason[]): string => { + const rows = [...reasons] + .sort((a, b) => (a.reason < b.reason ? -1 : 1)) + .map((entry) => { + const details = (entry.details ?? []).map((key) => `\`${key}\``).join(", ") + return `| \`${entry.reason}\` | \`${entry.code}\` | ${cell(entry.message)} | ${details} |` + }) + return ["| Reason | Code | Meaning | Details |", "|---|---|---|---|", ...rows].join("\n") +} + +if (import.meta.main) { + const root = join(import.meta.dirname, "..") + const page = join(root, "docs/reasons.md") + const { REASONS } = (await import(pathToFileURL(join(root, "dist/errors/reasons.js")).href)) as { REASONS: Reason[] } + const text = readFileSync(page, "utf8") + const problems = breakProblems(documented(text), REASONS, readFragments(root)) + const result = withGenerated(text, [[BLOCK, reasonsTable(REASONS)]]) + if (process.argv.includes("--check") && result !== text) + problems.push("docs/reasons.md drifts from REASONS in src/errors/reasons.ts — run pnpm reasons:docs") + if (problems.length > 0) { + for (const problem of problems) console.error(problem) + process.exit(1) + } + if (!process.argv.includes("--check")) writeFileSync(page, result) +} diff --git a/scripts/schema/checks.mjs b/scripts/schema/checks.mjs new file mode 100644 index 000000000..1ec5e6fff --- /dev/null +++ b/scripts/schema/checks.mjs @@ -0,0 +1,250 @@ +// Store version 73: what every base table with an integer `id` gets in the 1.0 rebuild. Only rules that never change +// go in a CHECK, since changing one takes another rebuild; evolving enums stay in triggers. + +const DERIVED = + /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/ + +/** Ids are never handed out twice, so an old `organization:2766` never names another row. */ +export const autoIncrements = (table) => + !table.virtual && + !DERIVED.test(table.name) && + (table.cols ?? []).some((col) => col.name === "id" && col.pk && col.type === "integer") + +/** + * Frozen at version 73: JSON columns, pointer pairs (`_type` and `_id`, whole or empty) and amounts a + * validation trigger already keeps non-negative. SQLite cannot add a table CHECK in place, so a column added later + * gets a `RAISE(ABORT)` trigger instead; a new table lists its own here when it is created. + */ +const CHECKS = { + accounts: { + json: ["settings"], + }, + bot_updates: { + json: ["payload"], + }, + syncs: { + json: ["counts"], + }, + identities: { + json: ["metadata"], + }, + identity_revisions: { + json: ["marks"], + }, + organizations: { + json: ["metadata"], + }, + bots: { + json: ["metadata"], + }, + chats: { + json: ["metadata"], + }, + messages: { + json: ["reply_to", "forward", "reactions", "metadata", "mentions"], + }, + poll_votes: { + json: ["answers"], + }, + link_revisions: { + json: ["before"], + }, + email_threads: { + json: ["metadata"], + }, + emails: { + json: ["references", "headers", "metadata"], + }, + mail_rules: { + json: ["conditions", "actions"], + }, + attachments: { + json: ["provider_ref", "contact"], + }, + documents: { + json: ["front_matter", "metadata"], + }, + files: { + json: ["metadata"], + }, + document_revisions: { + json: ["front_matter"], + }, + notes: { + pairs: ["author"], + }, + memories: { + pairs: ["subject"], + }, + calendar_entries: { + json: ["recurrence", "metadata"], + }, + meeting_series: { + json: ["recurrence", "metadata"], + }, + meetings: { + json: ["metadata"], + }, + meeting_participants: { + json: ["sessions", "metadata"], + }, + meeting_transcripts: { + json: ["metadata"], + }, + meeting_transcript_rows: { + json: ["metadata"], + }, + meeting_chat_messages: { + json: ["metadata"], + }, + meeting_summaries: { + json: ["sections", "next_steps", "metadata"], + }, + projects: { + pairs: ["owner"], + }, + tasks: { + json: ["metadata"], + pairs: ["closed_by", "close_suggested_by"], + }, + task_events: { + json: ["changes"], + pairs: ["actor"], + }, + task_pairs: { + json: ["levels", "reasons"], + pairs: ["decided_by"], + }, + decisions: { + json: ["metadata"], + pairs: ["confirmed_by"], + }, + facts: { + json: ["metadata"], + pairs: ["subject", "confirmed_by"], + }, + invoices: { + json: ["metadata"], + pairs: ["issuer", "confirmed_by"], + amounts: ["total"], + }, + invoice_lines: { + amounts: ["amount", "unit_price"], + }, + payments: { + json: ["metadata"], + pairs: ["payer", "payee", "confirmed_by"], + }, + orders: { + json: ["metadata"], + pairs: ["supplier", "confirmed_by"], + amounts: ["total"], + }, + deals: { + json: ["metadata"], + amounts: ["amount"], + }, + leads: { + json: ["metadata"], + amounts: ["amount"], + }, + crm_fields: { + json: ["options"], + }, + catalog_items: { + json: ["metadata"], + pairs: ["supplier"], + amounts: ["unit_price"], + }, + order_lines: { + amounts: ["amount", "unit_price"], + }, + contracts: { + json: ["metadata"], + pairs: ["confirmed_by"], + amounts: ["value"], + }, + subscriptions: { + json: ["metadata"], + pairs: ["confirmed_by"], + }, + subscription_prices: { + json: ["metadata"], + pairs: ["confirmed_by"], + amounts: ["amount"], + }, + financial_accounts: { + json: ["metadata"], + pairs: ["holder"], + }, + financial_transactions: { + json: ["metadata"], + pairs: ["counterparty", "confirmed_by"], + }, + records: { + json: ["fields"], + pairs: ["entity"], + }, + proposed_actions: { + json: ["payload", "result"], + pairs: ["target", "decided_by"], + }, + agent_actions: { + pairs: ["target"], + }, + links: { + json: ["metadata"], + }, + searches: { + json: ["params"], + }, + taggings: { + pairs: ["author"], + }, + tag_consolidations: { + json: ["source_member_ids", "survivor_member_ids", "counts"], + }, + link_reviews: { + json: ["candidates"], + }, + tracker_items: { + json: ["data"], + }, + content_authors: { + json: ["data"], + }, + content_terms: { + json: ["data"], + }, + content_posts: { + json: ["data"], + }, + content_metrics: { + json: ["raw"], + }, +} + +/** `{ name, kind, columns, sql }` per rule, in a fixed order: JSON columns, pointer pairs, amounts. */ +export const checksOf = (table) => { + const { json = [], pairs = [], amounts = [] } = CHECKS[table.name] ?? {} + return [ + ...json.map((col) => ({ + name: `${table.name}_${col}_json`, + kind: "json", + columns: [col], + sql: `"${col}" IS NULL OR json_valid("${col}")`, + })), + ...pairs.map((pointer) => ({ + name: `${table.name}_${pointer}_pair`, + kind: "pair", + columns: [`${pointer}_type`, `${pointer}_id`], + sql: `("${pointer}_type" IS NULL) = ("${pointer}_id" IS NULL)`, + })), + ...amounts.map((col) => ({ + name: `${table.name}_${col}_not_negative`, + kind: "amount", + columns: [col], + sql: `"${col}" IS NULL OR "${col}" >= 0`, + })), + ] +} diff --git a/scripts/schema/codegen/gen-schema.mjs b/scripts/schema/codegen/gen-schema.mjs index 34a7856cc..b43caa333 100644 --- a/scripts/schema/codegen/gen-schema.mjs +++ b/scripts/schema/codegen/gen-schema.mjs @@ -1,4 +1,5 @@ import { readFileSync, writeFileSync } from "node:fs" +import { autoIncrements, checksOf } from "../checks.mjs" const model = JSON.parse(readFileSync(process.argv[2], "utf8")) const HAND_WRITTEN = new Set(["search_terms", "search_term_trigrams", "schema_migrations"]) @@ -139,7 +140,7 @@ for (const t of model) { const keyed = new Set((t.keys ?? []).filter((k) => k.startsWith("PRIMARY KEY")).flatMap((k) => parseKey(k).cols)) const lines = cols.map((c) => { let s = `${camel(c.name)}: ${c.type === "blob" ? `blob("${c.name}", { mode: "buffer" })` : `${c.type}("${c.name}")`}` - if (c.pk) s += ".primaryKey()" + if (c.pk) s += c.name === "id" && autoIncrements(t) ? ".primaryKey({ autoIncrement: true })" : ".primaryKey()" else if (c.notnull || keyed.has(c.name)) s += ".notNull()" if (c.unique) s += ".unique()" const d = DEFAULTS[`${t.name}.${c.name}`] @@ -152,11 +153,12 @@ for (const t of model) { } return ` ${s},` }) - const constraints = [...(t.keys ?? []), ...t.fkIndexes].map((k) => keyCode(t.name, k)) + const keys = [...(t.keys ?? []), ...t.fkIndexes].map((k) => keyCode(t.name, k)) + const constraints = [...keys, ...checksOf(t).map(({ name, sql }) => `check("${name}", sql\`${sql}\`)`)] const body = `{\n${lines.join("\n")}\n }` out.push( constraints.length - ? `export const ${camel(t.name)} = sqliteTable(\n "${t.name}",\n ${body},\n (table) => [\n${constraints.map((c) => ` ${c},`).join("\n")}\n ],\n)\n` + ? `export const ${camel(t.name)} = sqliteTable(\n "${t.name}",\n ${body},\n ${keys.length ? "(table)" : "()"} => [\n${constraints.map((c) => ` ${c},`).join("\n")}\n ],\n)\n` : `export const ${camel(t.name)} = sqliteTable("${t.name}", ${body.replace(/\n {4}/g, "\n ").replace(/\n {2}\}$/, "\n}")})\n`, ) } @@ -164,6 +166,7 @@ for (const t of model) { const header = `import { type AnySQLiteColumn, blob, + check, desc, index, integer, diff --git a/scripts/schema/render.mjs b/scripts/schema/render.mjs index 833cb74fd..b28aac3da 100644 --- a/scripts/schema/render.mjs +++ b/scripts/schema/render.mjs @@ -1,4 +1,5 @@ import { writeFileSync } from "node:fs" +import { checksOf } from "./checks.mjs" import { indexes, model } from "./spec.mjs" const mdPath = process.argv[2] ?? new URL("../../docs/storage/schema.md", import.meta.url).pathname @@ -17,6 +18,8 @@ const CONVENTIONS = [ "Booleans without `is_`. Times are epoch milliseconds, integers: they sort and range without a format to agree on.", "One search index per corpus: messages, emails, attachments, documents, notes, memories, meetings.", "Every foreign key and every polymorphic pair is indexed; listed under each table as *Indexes*.", + "Every base table with an integer `id` key is `AUTOINCREMENT` (store version 73): an id is never handed out twice, so an old reference never names another row.", + "`CHECK` constraints hold only rules that never change: a JSON column holds valid JSON, a pointer pair is whole or empty, an amount is not negative. Evolving rules stay in triggers.", ] const flags = (col) => @@ -53,6 +56,7 @@ const md = [ `| \`${col.name}\` | ${col.type} | ${flags(col)} | ${col.ref ? `→ \`${col.ref}\`` : ""} | ${mdEsc(col.note)} |`, ) const keys = [...(t.keys ?? []), ...indexes(t)] + const checks = checksOf(t) return [ ...head, "| Column | Type | Constraints | References | Meaning |", @@ -60,6 +64,7 @@ const md = [ ...rows, "", ...(keys.length ? [`*Keys and indexes:* ${keys.map((k) => `\`${k}\``).join(", ")}`, ""] : []), + ...(checks.length ? [`*Checks:* ${checks.map(({ sql }) => `\`CHECK (${sql})\``).join(", ")}`, ""] : []), ] }), ]), diff --git a/scripts/schema/spec.mjs b/scripts/schema/spec.mjs index 4cf5c211c..de5c75649 100644 --- a/scripts/schema/spec.mjs +++ b/scripts/schema/spec.mjs @@ -233,6 +233,7 @@ const EDITS = { "INDEX (chat_id, reply_to_external_id) WHERE reply_to_external_id IS NOT NULL AND deleted_at IS NULL", "INDEX (account_id, external_id)", "INDEX (id) WHERE normalized_text IS NULL AND deleted_at IS NULL", + "INDEX (chat_id, thread_external_id) WHERE thread_root_id IS NULL AND thread_external_id IS NOT NULL", ], }, message_revisions: { addPk: true, cols: { captured_at: "created_at" } }, diff --git a/scripts/schema/tag-consolidations.mjs b/scripts/schema/tag-consolidations.mjs index 3ca4509e1..a8add1fc0 100644 --- a/scripts/schema/tag-consolidations.mjs +++ b/scripts/schema/tag-consolidations.mjs @@ -45,5 +45,9 @@ export const taggingTable = { ...actor("author"), ...ts(), ], - keys: ["UNIQUE (tag_id, taggable_type, taggable_id)", "UNIQUE (taggable_type, taggable_id) WHERE main = 1"], + keys: [ + "UNIQUE (tag_id, taggable_type, taggable_id)", + "UNIQUE (taggable_type, taggable_id) WHERE main = 1", + "INDEX (taggable_type, taggable_id)", + ], } diff --git a/src/analysis/settings.ts b/src/analysis/settings.ts index be8f0e6b8..53e3fccce 100644 --- a/src/analysis/settings.ts +++ b/src/analysis/settings.ts @@ -16,7 +16,7 @@ const AI_FIELDS = { } const fileKey = (key: string) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`) -/** The AI settings as the config file names them, in snake_case; `AISettings` is what the code reads. */ +/** The AI settings as the config file names them, in snake_case; `AISettings` is what the code reads. @experimental */ export const AI_ENTRIES = Object.fromEntries( Object.entries(AI_FIELDS).map(([key, schema]) => [fileKey(key), schema]), ) as { @@ -26,9 +26,11 @@ export const AI_ENTRIES = Object.fromEntries( embedding_dims: (typeof AI_FIELDS)["embeddingDims"] models: (typeof AI_FIELDS)["models"] } +/** @experimental */ export type AISettings = v.InferOutput> export const AI_DEFAULTS: AISettings = { embeddingProvider: "local" } +/** @experimental */ export const AI_SETTING_KEYS = Object.keys(AI_FIELDS) as (keyof AISettings)[] export const resolveAISettings = ( diff --git a/src/attachments/extract.ts b/src/attachments/extract.ts index d273fdbe2..71226b4ea 100644 --- a/src/attachments/extract.ts +++ b/src/attachments/extract.ts @@ -15,7 +15,7 @@ const extensionOf = ({ name, path }: FileHint) => extname(name ?? path).toLowerC /** * Only an exact text layer: plain text, a Word document, a PDF that carries its text. A photo, a scan - * or a PDF of pictures is an agent's to read (owner, NEED-546: no OCR in the tool). + * or a PDF of pictures is an agent's to read (the owner's decision: no OCR in the tool). */ export const extractText = async ( bytes: Uint8Array, diff --git a/src/background/deliver.ts b/src/background/deliver.ts index 149c886ea..35cccd0df 100644 --- a/src/background/deliver.ts +++ b/src/background/deliver.ts @@ -25,8 +25,10 @@ const CHAT = /^(-?\d+|user:\d+)$/ const PROFILE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/ const ADDRESS = /^[^\s@/,<>"]+@[^\s@/,<>"]+\.[^\s@/,<>"]+$/ +/** @experimental */ export const ROUTE_HELP = "telegram-bot:/, or email:/
" +/** @experimental */ export const parseRoute = (text: string): Route => { const [, kind = "", profile = "", target = ""] = /^([a-z-]+):([^/]+)\/(.+)$/.exec(text.trim()) ?? [] const refuse = (why: string) => new CliError("validation_error", `--deliver-to ${text}: ${why} — ${ROUTE_HELP}`) @@ -40,6 +42,7 @@ export const parseRoute = (text: string): Route => { return { kind: "email", profile, address: target } } +/** @experimental */ export const routeText = (route: Route): string => `${route.kind}:${route.profile}/${route.kind === "telegram-bot" ? route.chat : route.address}` diff --git a/src/background/lock.ts b/src/background/lock.ts index 383a1b3d7..cf7f9fd23 100644 --- a/src/background/lock.ts +++ b/src/background/lock.ts @@ -80,7 +80,7 @@ export const readCurrent = (lock: string): string | undefined => { } } -/** The profiles a serve is running for now — what an update must restart for its new code to run. */ +/** The profiles a serve is running for now — what an update must restart for its new code to run. @experimental */ export const servingProfiles = (app: AppIdentity, env: NodeJS.ProcessEnv): string[] => { const dir = dirname(lockPath(app, "default", env)) if (!existsSync(dir)) return [] diff --git a/src/background/schedules.ts b/src/background/schedules.ts index 7aa12c2d4..e9f16f287 100644 --- a/src/background/schedules.ts +++ b/src/background/schedules.ts @@ -101,7 +101,10 @@ export type Notify = (typeof NOTIFY_WHEN)[number] export const notifyOf = (schedule: Pick): Notify => schedule.notify ?? (schedule.kind === "agent" && "every" in schedule.when ? "failures" : "always") -/** What a gated agent waits for, and what a day of its runs may cost, when neither its flags nor the config say. */ +/** + * What a gated agent waits for, and what a day of its runs may cost, when neither its flags nor the config say. + * @experimental + */ export const SCHEDULE_DEFAULTS = { mailWaitMinutes: 30, mailBatch: 10, maxCostPerDay: 5 } as const /** One local day's cost of a schedule's runs, as the harness reported it (`spend.json` beside the schedule). */ @@ -116,7 +119,7 @@ export const localDay = (at: Date): string => const spendFile = (file: string) => join(file, "..", "spend.json") -/** What the schedule's runs cost today; nothing before its first priced run of the day. */ +/** What the schedule's runs cost today; nothing before its first priced run of the day. @experimental */ export const spentToday = (file: string, now = new Date()): number => { try { const spend = JSON.parse(readFileSync(spendFile(file), "utf8")) as DaySpend @@ -171,7 +174,10 @@ const reportOf = (stdout: Buffer): { text: Buffer; costUsd?: number; failed?: tr */ export type AgentInput = (schedule: Schedule, run: (argv: string[]) => Promise) => Promise -/** The most an agent's input may hold; a longer one is cut, so a mailbox in flood cannot grow every turn's context. */ +/** + * The most an agent's input may hold; a longer one is cut, so a mailbox in flood cannot grow every turn's context. + * @experimental + */ export const AGENT_INPUT_MAX_CHARS = 60_000 const capped = (input: string): string => @@ -341,6 +347,7 @@ export const failingNotice = ( const NAME = /^[a-z0-9][a-z0-9-]{0,39}$/ +/** @experimental */ export const scheduleName = (name: string): string => { if (!NAME.test(name)) { throw new CliError("validation_error", `a schedule name is lowercase letters, digits and dashes — not "${name}"`) @@ -349,13 +356,16 @@ export const scheduleName = (name: string): string => { } export const schedulesDir = (state: string) => join(state, "schedules") +/** @experimental */ export const scheduleFile = (state: string, name: string) => join(schedulesDir(state), name, "schedule.json") +/** @experimental */ export const readSchedule = (file: string): Schedule => { if (!existsSync(file)) throw new CliError("not_found", `no schedule at ${file}`) return JSON.parse(readFileSync(file, "utf8")) as Schedule } +/** @experimental */ export const lastRun = (file: string): LastRun | undefined => readRun(join(file, "..", "last.json")) /** The CLI's own schedules with their last runs, for `failingNotice`; a broken file is skipped, not thrown. */ diff --git a/src/background/when.ts b/src/background/when.ts index d9c6d9a61..5fcbbd836 100644 --- a/src/background/when.ts +++ b/src/background/when.ts @@ -1,5 +1,6 @@ -/** The days `--on` takes, Monday first. */ +/** The days `--on` takes, Monday first. @experimental */ export const WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] as const +/** @experimental */ export type Weekday = (typeof WEEKDAYS)[number] /** One calendar time: `HH:MM` local, every day or on one weekday. */ @@ -19,6 +20,7 @@ export type When = | { calendar: Slot[] } | { once: string } +/** @experimental */ export type CalendarWhen = Extract const SYSTEMD_DAYS: Record = { @@ -40,14 +42,18 @@ export const WINDOWS_DAYS: Record = { sun: "Sunday", } +/** @experimental */ export const isCalendar = (when: When): when is CalendarWhen => "daily" in when || "weekly" in when || "calendar" in when -/** A calendar schedule's times, whichever shape it was saved in. */ +/** A calendar schedule's times, whichever shape it was saved in. @experimental */ export const slotsOf = (when: CalendarWhen): Slot[] => "daily" in when ? [{ at: when.daily }] : "weekly" in when ? [{ at: when.weekly, on: when.on }] : when.calendar -/** The shape a schedule is saved in: one slot as `daily` or `weekly`, so files and their wording stay as they were. */ +/** + * The shape a schedule is saved in: one slot as `daily` or `weekly`, so files and their wording stay as they were. + * @experimental + */ export const calendarOf = (slots: readonly Slot[]): CalendarWhen => { const seen = new Map(slots.map((slot) => [`${slot.on ?? ""} ${slot.at}`, slot])) const unique = [...seen.values()].sort( @@ -67,6 +73,7 @@ const describeSlots = (slots: Slot[]): string => { return `at ${slots.map((slot) => (slot.on ? `${SYSTEMD_DAYS[slot.on]} ${slot.at}` : `daily ${slot.at}`)).join(", ")}` } +/** @experimental */ export const describeWhen = (when: When): string => "every" in when ? `every ${when.every % 1440 === 0 ? `${when.every / 1440}d` : when.every % 60 === 0 ? `${when.every / 60}h` : `${when.every}m`}` @@ -80,7 +87,10 @@ export const onCalendar = (when: Exclude): string[] => ? [localStamp(when.once)] : slotsOf(when).map((slot) => (slot.on ? `${SYSTEMD_DAYS[slot.on]} *-*-* ${slot.at}:00` : `*-*-* ${slot.at}:00`)) -/** The local moments of a calendar schedule's runs from `from` (inclusive) to `to` (exclusive), oldest first. */ +/** + * The local moments of a calendar schedule's runs from `from` (inclusive) to `to` (exclusive), oldest first. + * @experimental + */ export const runsBetween = (when: CalendarWhen, from: number, to: number): number[] => { const slots = slotsOf(when) const moments: number[] = [] @@ -105,9 +115,13 @@ const daysFrom = (at: number, days: number) => { return moved.getTime() } -/** The run a calendar schedule has next after `now`, or the one before or at it; eight days hold every slot. */ +/** + * The run a calendar schedule has next after `now`, or the one before or at it; eight days hold every slot. + * @experimental + */ export const nextRun = (when: CalendarWhen, now: number): number | undefined => runsBetween(when, now + 1, daysFrom(now, 8))[0] +/** @experimental */ export const previousRun = (when: CalendarWhen, now: number): number | undefined => runsBetween(when, daysFrom(now, -8), now + 1).at(-1) diff --git a/src/calendar/cli/answers.ts b/src/calendar/cli/answers.ts index d5a3d5a9c..0bc59c596 100644 --- a/src/calendar/cli/answers.ts +++ b/src/calendar/cli/answers.ts @@ -58,6 +58,7 @@ const syncedCalendar = v.strictObject({ removed: count, occurrences: count, unseen: count, + held: v.optional(text), error: v.optional(text), }) diff --git a/src/calendar/cli/index.ts b/src/calendar/cli/index.ts index a461d0189..9e67cfb2d 100644 --- a/src/calendar/cli/index.ts +++ b/src/calendar/cli/index.ts @@ -5,7 +5,7 @@ import { clockMeta, type Effects, type NextStep } from "@wirecat/cli-base/standa import { Argument, type Command, InvalidArgumentError, Option } from "commander" import { environmentOf, inCommandRun, outputFor, runBudgetOf } from "../../cli/context.js" import { honoursDryRun } from "../../cli/dry-run-guard.js" -import { changesStore, ownerOnlyOption, writesFileOnlyWith } from "../../cli/effects.js" +import { allowDeletionsOption, changesStore, ownerOnlyOption, writesFileOnlyWith } from "../../cli/effects.js" import { type Body, renderAnswer } from "../../cli/envelope.js" import { queryTerms, withQuery } from "../../cli/list-query.js" import { terminalAsker } from "../../cli/messenger/ask.js" @@ -173,6 +173,13 @@ const minutes = (text: string) => { const readsOnly = (command: Command): boolean => metaOf(command).effects?.local !== "write" && pathOf(command)[0] !== "search" +interface CalendarSyncFlags { + embed?: boolean + maxPages?: number + rescan?: boolean + allowDeletions?: number +} + const addCalendarCommandsDefinition = (program: Command, options: CalendarCommandOptions): void => { const mounted = new Set(program.commands) const now = () => options.now?.() ?? Date.now() @@ -339,13 +346,14 @@ const addCalendarCommandsDefinition = (program: Command, options: CalendarComman "sync --timeout 2m", ) .option("--rescan", "list every synced calendar's window again, dropping a round in progress") + .addOption(allowDeletionsOption()) .option( "--max-pages ", "at most this many requests to the provider in this run; as many as fit the deadline if not given", integer, ) .option("--embed", "also index new events for meaning search, with a model already downloaded") - .action(async (opts: { embed?: boolean; maxPages?: number; rescan?: boolean }, command: Command) => { + .action(async (opts: CalendarSyncFlags, command: Command) => { // --full is the shared program's output flag; it used to start the round over here, and silently would not now. if (command.optsWithGlobals<{ full?: boolean }>().full) throw new CliError("validation_error", "sync starts over with --rescan; --full only widens output") @@ -359,6 +367,7 @@ const addCalendarCommandsDefinition = (program: Command, options: CalendarComman budget: runBudgetOf(command, opts.maxPages), ...(signal ? { signal } : {}), ...(opts.rescan ? { full: true } : {}), + ...(opts.allowDeletions ? { allowDeletions: opts.allowDeletions } : {}), ...(run.expand ? { expand: run.expand } : {}), }) // A run its budget stopped has no time left for the model; the run that finishes the round embeds. diff --git a/src/calendar/feeds.test.ts b/src/calendar/feeds.test.ts index 8c4f8ba33..a007fbc39 100644 --- a/src/calendar/feeds.test.ts +++ b/src/calendar/feeds.test.ts @@ -313,6 +313,44 @@ describe("feed calendars", () => { await expect(cli("calendars", "add", ADDRESS)).rejects.toMatchObject({ details: { reason: "feed.duplicate" } }) }) + // INT-6: the feed still holds the event; only this build cannot read it, which is no sign it was deleted. + it("keeps an event the feed still holds when it stops parsing", async () => { + const { cli, serve } = await setup() + const feed = String((await cli("calendars", "add", ADDRESS)).id) + await cli("sync") + serve( + ics( + HOLIDAY, + MATCH.replace("DTSTART:20261028T180000Z", "DTSTART;TZID=Customized Time Zone:20261028T180000"), + WEEKLY, + ), + ) + const report = await cli("sync") + expect(report).toMatchObject({ feeds: [{ calendar_id: Number(feed), skipped: 1 }] }) + const live = (await cli("events", "list", `calendar:${feed}`)).items + .filter((one) => one.status !== "cancelled") + .map((one) => one.title) + expect(live).toContain("Example match") + }) + + it("an empty feed marks nothing deleted until the owner passes --allow-deletions", async () => { + const { cli, serve } = await setup() + const feed = String((await cli("calendars", "add", ADDRESS)).id) + await cli("sync") + const live = async () => + (await cli("events", "list", `calendar:${feed}`)).items + .filter((one) => one.status !== "cancelled") + .map((one) => one.title) + const before = await live() + serve(ics()) + const held = await cli("sync") + expect(JSON.stringify(held)).toMatch(/allow-deletions 6/) + expect(await live()).toEqual(before) + serve(ics()) + await cli("sync", "--allow-deletions", "100") + expect(await live()).toEqual([]) + }) + it("calendars remove deletes the feed's events and what was built from them, and keeps a Google copy", async () => { const { cli, saved, serve, source, path } = await setup() source.put("primary", { diff --git a/src/calendar/feeds.ts b/src/calendar/feeds.ts index 419534694..2683cbbf0 100644 --- a/src/calendar/feeds.ts +++ b/src/calendar/feeds.ts @@ -283,6 +283,8 @@ export interface FeedRead { timezone: string | null events: number skipped: number + /** The UIDs of events the feed still holds but this build could not read: not read is not deleted. */ + unread: string[] } /** A feed's events inside the window, its series with their overrides, and what it could not take. */ @@ -291,11 +293,13 @@ export const readFeed = (text: string, zone: string, window?: SyncWindow): FeedR const where = zoneOk(named) ? named : zone const read = readIcs(text, where, { overrides: true }) let skipped = read.skipped.length + const unread = read.skipped.flatMap(({ uid }) => (uid ? [uid] : [])) const entries: EntryInput[] = [] for (const event of read.events) { const entry = feedEntry(event, where) if (entry.kind === "series" && unexpandable(entry.recurrence) !== null) { skipped++ + unread.push(entry.externalId) continue } if (!window || inWindow(entry, window)) entries.push(entry) @@ -318,6 +322,7 @@ export const readFeed = (text: string, zone: string, window?: SyncWindow): FeedR timezone: zoneOk(named) ? named : null, events: read.events.length + read.overrides.length, skipped, + unread, } } @@ -418,7 +423,13 @@ export const icsFeeds = (options: IcsFeedsOptions): CalendarFeeds => { validators.etag || validators.lastModified ? { v: 1, validators, window, events: found.events, skipped: found.skipped } : null - return { items: found.entries, hasMore: false, removed: [], cursor: next && JSON.stringify(next) } + return { + items: found.entries, + hasMore: false, + removed: [], + ...(found.unread.length ? { kept: found.unread } : {}), + cursor: next && JSON.stringify(next), + } }, } diff --git a/src/calendar/source.ts b/src/calendar/source.ts index 3e836d0cd..301e6031f 100644 --- a/src/calendar/source.ts +++ b/src/calendar/source.ts @@ -29,6 +29,11 @@ export interface ChangePage { * answered 404). Never an entry that only left the window. */ removed: string[] + /** + * Entries the source still has but could not read this time (an ICS event that no longer parses): a full round + * counts them as seen and keeps their stored fields, since not reading one is no sign it was deleted. + */ + kept?: string[] /** More pages in this round, read from `nextCursor`. */ hasMore: boolean nextCursor?: string diff --git a/src/calendar/sync.test.ts b/src/calendar/sync.test.ts index e4b4d089a..44af46385 100644 --- a/src/calendar/sync.test.ts +++ b/src/calendar/sync.test.ts @@ -1,3 +1,4 @@ +import { CliError } from "@wirecat/cli-base" import { describe, expect, it } from "vitest" import { calendarSyncWindow, parseCalendarCursor, syncCalendars } from "./index.js" import { fakeCalendarSource, memoryEventStore } from "./testing/index.js" @@ -104,4 +105,77 @@ describe("syncCalendars", () => { await syncCalendars(source, store, { accountId: 1, now: NOW + 7_200_000 }) expect((await store.entry(id, "second"))?.deletedAt).not.toBeNull() }) + + // INT-2: a series deleted between its listing and its slots call no longer stalls every later round. + it("finishes a round whose series the provider no longer finds, keeping its stored slots", async () => { + const store = memoryEventStore() + const source = fakeCalendarSource() + const at = NOW + 86_400_000 + const series = { + externalId: "weekly", + kind: "series" as const, + status: "confirmed" as const, + title: "Weekly", + startsAt: at, + endsAt: at + 1_800_000, + recurrence: ["RRULE:FREQ=WEEKLY;COUNT=2"], + } + const { recurrence: _, ...plain } = series + const slot = { ...plain, externalId: "weekly_1", kind: "occurrence" as const, seriesExternalId: "weekly" } + const slots = [{ ...slot, originalStartsAt: at }] + source.put("primary", series) + source.setOccurrences("weekly", slots) + await syncCalendars(source, store, { accountId: 1, now: NOW }) + const gone = { + ...source, + occurrences: async () => { + throw new CliError("not_found", "the series is gone") + }, + } + source.put("primary", { ...series, title: "Weekly, renamed" }) + + const report = await syncCalendars(gone, store, { accountId: 1, now: NOW + 3_600_000 }) + + expect(report.synced[0]).toMatchObject({ state: "complete" }) + const [calendar] = await store.calendars(1) + expect(parseCalendarCursor(await store.cursor(calendar?.id as number))?.round).toBeNull() + expect((await store.entry(calendar?.id as number, "weekly_1"))?.deletedAt).toBeNull() + }) + + // INT-6: the calendar engine now has the share guard the mail, CRM and tracker engines have. + it("holds a full round that would mark most of ten or more entries deleted, until --allow-deletions", async () => { + const store = memoryEventStore() + const source = fakeCalendarSource() + const ids = Array.from({ length: 12 }, (_, n) => `e${n}`) + for (const [n, id] of ids.entries()) + source.put("primary", { + externalId: id, + kind: "single", + status: "confirmed", + title: `Review ${n}`, + startsAt: NOW + n * 3_600_000, + endsAt: NOW + n * 3_600_000 + 1_800_000, + }) + await syncCalendars(source, store, { accountId: 1, now: NOW }) + source.drop("primary", ...ids.slice(0, 8)) + const [calendar] = await store.calendars(1) + const live = async () => { + let count = 0 + for (const id of ids) if ((await store.entry(calendar?.id as number, id))?.deletedAt === null) count += 1 + return count + } + + const held = await syncCalendars(source, store, { accountId: 1, now: NOW + 3_600_000, full: true }) + expect(held.synced[0]).toMatchObject({ state: "complete", unseen: 0, held: expect.stringMatching(/8 of the 12/) }) + expect(await live()).toBe(12) + + const through = await syncCalendars(source, store, { + accountId: 1, + now: NOW + 7_200_000, + full: true, + allowDeletions: 8, + }) + expect(through.synced[0]).toMatchObject({ unseen: 8 }) + expect(await live()).toBe(4) + }) }) diff --git a/src/calendar/sync.ts b/src/calendar/sync.ts index a6132435c..e9c5604ab 100644 --- a/src/calendar/sync.ts +++ b/src/calendar/sync.ts @@ -14,6 +14,9 @@ const SLOTS_EVERY = 7 * DAY /** Series whose slots one transaction saves: a short one, so another process waits for the lock briefly. */ const BATCH_SERIES = 50 const BATCH_SLOTS = 250 +/** A full round that would mark more than this share of ten or more stored entries deleted is held. */ +const MOST_UNSEEN = 0.5 +const GUARDED_FROM = 10 /** * A round that stopped before its end: where its listing is, and the series still to ask for their slots. A rerun @@ -39,6 +42,8 @@ export interface PendingRound { everySeries?: boolean /** The source said its list is unchanged since `from`: the round marks nothing unseen. */ unchanged?: true + /** Entries the source still has but could not read in this round (`ChangePage.kept`): never marked unseen. */ + kept?: string[] } /** What the engine keeps in `EventStore.cursor`. Version 1 had no `round`, `updatedAt` or `done`. */ @@ -79,10 +84,11 @@ const roundOf = (value: unknown): PendingRound | null | undefined => { !isToken(round.next) || !Array.isArray(round.series) || round.series.some((id) => typeof id !== "string") || - (round.everySeries !== undefined && typeof round.everySeries !== "boolean") + (round.everySeries !== undefined && typeof round.everySeries !== "boolean") || + (round.kept !== undefined && (!Array.isArray(round.kept) || round.kept.some((id) => typeof id !== "string"))) ) return undefined - const { full, from, window, startedAt, reset, page, listed, next, series, everySeries, unchanged } = + const { full, from, window, startedAt, reset, page, listed, next, series, everySeries, unchanged, kept } = round as PendingRound return { full, @@ -96,6 +102,7 @@ const roundOf = (value: unknown): PendingRound | null | undefined => { series, ...(everySeries === false ? { everySeries } : {}), ...(unchanged === true ? { unchanged } : {}), + ...(kept?.length ? { kept } : {}), } } @@ -136,7 +143,7 @@ export const parseCalendarCursor = (value: string | null): CalendarCursor | null } /** - * One year back and three months ahead (NEED-1706), from the start of today in UTC. Whole days, so the window moves + * One year back and three months ahead, from the start of today in UTC. Whole days, so the window moves * once a day: a source whose cursor holds the window lists everything again once a day, not on every run. */ export const calendarSyncWindow = (now: number): SyncWindow => { @@ -159,6 +166,8 @@ export interface CalendarSyncOptions { budget?: RunBudget /** The run's signal, checked before each save: a cancelled run stops after its current step and keeps its work. */ signal?: AbortSignal + /** Let a full round the guard holds mark up to this many entries deleted: `sync --allow-deletions `. */ + allowDeletions?: number } export interface CalendarSyncResult { @@ -177,6 +186,8 @@ export interface CalendarSyncResult { occurrences: number /** Entries a full round did not return, now marked deleted. */ unseen: number + /** Why a full round marked nothing deleted although it did not return some entries, and how to let it through. */ + held?: string /** Set when the calendar failed; its cursor stays at its last saved page, so the next run goes on from there. */ error?: string } @@ -220,6 +231,7 @@ interface Plan { expand: CalendarExpander | undefined budget: RunBudget signal: AbortSignal | undefined + allowDeletions: number /** Called on each page or series saved. */ moved: () => void } @@ -273,7 +285,7 @@ const deadList = (provider: string) => * at most the step it was on. Returns why it stopped, or `null` when the round finished. */ const syncOne = async ( - { source, store, calendar, window, now, expand, budget, signal, moved }: Plan, + { source, store, calendar, window, now, expand, budget, signal, allowDeletions, moved }: Plan, stored: CalendarCursor | null, result: CalendarSyncResult, ): Promise => { @@ -367,6 +379,7 @@ const syncOne = async ( } } if (page.removed.length) result.removed += await store.removeEntries(calendar.id, page.removed, now) + if (page.kept?.length) round = { ...round, kept: [...new Set([...(round.kept ?? []), ...page.kept])] } if (page.unchanged && source.traits.fullListOnly && page.items.length === 0 && !page.hasMore) round = { ...round, page: null, listed: true, next: page.cursor ?? null, unchanged: true } else if (!page.hasMore) round = { ...round, page: null, listed: true, next: page.cursor ?? null } @@ -396,7 +409,15 @@ const syncOne = async ( for (const series of [...round.series]) { const why = stop() if (why) return why - const slots = await occurrences.call(source, calendar, series, round.window) + let slots: SeriesSlots["slots"] + try { + slots = await occurrences.call(source, calendar, series, round.window) + } catch (error) { + // A series gone between its listing and this call proves nothing yet: its slots stay as stored, and the + // next listing, which names a deleted series, cancels them. + if (!(isCliFailure(error) && error.code === "not_found")) throw error + slots = null + } if (signal?.aborted) return "cancelled" batch.push({ series, slots }) moved() @@ -407,8 +428,19 @@ const syncOne = async ( await flush() } if (signal?.aborted) return "cancelled" - result.unseen = - round.full && !round.unchanged ? await store.markUnseen(calendar.id, round.startedAt, round.window, now) : 0 + if (round.full && !round.unchanged) { + const keep = { keep: round.kept ?? [] } + const unseen = await store.markUnseen(calendar.id, round.startedAt, round.window, now, { ...keep, dryRun: true }) + const stored = await store.markUnseen(calendar.id, Number.MAX_SAFE_INTEGER, round.window, now, { dryRun: true }) + // The round's count of saved entries and slots: none at all, and the list was empty. + const many = cursor.done === 0 || (stored >= GUARDED_FROM && unseen > stored * MOST_UNSEEN) + if (unseen > 0 && many && unseen > allowDeletions) + result.held = + `${source.provider} did not list ${unseen} of the ${stored} entries stored in this calendar's window; none ` + + `was marked deleted. Check the calendar at the source, then run sync --allow-deletions ${unseen} to let ` + + "them through" + else result.unseen = await store.markUnseen(calendar.id, round.startedAt, round.window, now, keep) + } await save({ token: round.next, window: round.window, @@ -516,6 +548,7 @@ export const syncCalendars = async ( expand: options.expand, budget, signal: options.signal, + allowDeletions: options.allowDeletions ?? 0, moved: () => { steps += 1 }, diff --git a/src/calendar/testing/memory.ts b/src/calendar/testing/memory.ts index 997ca0890..3b3f6a409 100644 --- a/src/calendar/testing/memory.ts +++ b/src/calendar/testing/memory.ts @@ -449,14 +449,18 @@ export const memoryEventStore = (): EventStore => { ) return removed.length }, - async markUnseen(calendarId, seenBefore, window, now) { + async markUnseen(calendarId, seenBefore, window, now, { keep = [], dryRun = false } = {}) { + const kept = new Set(keep) const marked = entries.filter( (one) => one.calendarId === calendarId && one.deletedAt === null && (one.seenAt === null || one.seenAt < seenBefore) && - entryInWindow(one, window), + entryInWindow(one, window) && + !kept.has(one.externalId) && + (one.seriesExternalId === null || !kept.has(one.seriesExternalId)), ) + if (dryRun) return marked.length for (const one of marked) Object.assign(one, { deletedAt: now, updatedAt: now }) for (const eventId of new Set(marked.map(({ eventId }) => eventId))) if (eventId !== null) refreshEvent(eventId, now) diff --git a/src/calendar/testing/sync-contract.ts b/src/calendar/testing/sync-contract.ts index 126cb7585..3d1856764 100644 --- a/src/calendar/testing/sync-contract.ts +++ b/src/calendar/testing/sync-contract.ts @@ -135,7 +135,8 @@ export const calendarSyncContract = (make: () => CalendarSyncFixture | Promise { - source.put("primary", single("e1")) + // e2 stays: a full list that returns nothing at all is held, not taken as every entry deleted. + source.put("primary", single("e1"), single("e2", AT + HOUR)) await sync(NOW) source.remove("primary", "e1") const after = (await sync(NOW + HOUR)).synced[0] diff --git a/src/cli/account-rename.ts b/src/cli/account-rename.ts index 5239a3a34..e62be4f2c 100644 --- a/src/cli/account-rename.ts +++ b/src/cli/account-rename.ts @@ -30,8 +30,10 @@ import { usableProfileName } from "./profile.js" import { profileFiles } from "./profile-files.js" import type { GlobalFlags, ResolveOptions, Settings } from "./settings.js" +/** @experimental */ export type AccountRenaming = AccountRemoval & Required> +/** @experimental */ export interface AccountRenameOptions { /** Unset: the one `run()` set. */ resolveSettings?: (flags: GlobalFlags, options?: ResolveOptions) => Settings @@ -71,6 +73,7 @@ const withValue = (raw: unknown, path: readonly string[], value: unknown): unkno * ` account rename `: gives the profile another name and moves everything it owns on this * computer — the sign-in, its other keyring entries, its settings, its files and what the store records of it. The * account's data in the store is keyed by the account, not the name, and stays where it is. Asks first, or `--yes`. + * @experimental */ export const accountRenameCommand = ( app: AppIdentity, diff --git a/src/cli/after-dashes.ts b/src/cli/after-dashes.ts index 84136b35a..0797437bb 100644 --- a/src/cli/after-dashes.ts +++ b/src/cli/after-dashes.ts @@ -22,6 +22,7 @@ const optionsOf = (command: Command): Map => { * `messages sync -- -100 --json` as `messages sync --json -- -100`: agents copy `-- --json` from old skill * text, and a negative id needs no `--` anyway. Only a word that is exactly one of the command's options moves, with * the value it takes; a command marked `literal_after_dashes` keeps every word after `--` as it is. + * @experimental */ export const liftOptionsAfterDashes = ( argv: readonly string[], diff --git a/src/cli/agent-evaluation.ts b/src/cli/agent-evaluation.ts index d26771625..d34a403c6 100644 --- a/src/cli/agent-evaluation.ts +++ b/src/cli/agent-evaluation.ts @@ -2,12 +2,14 @@ import { captureStreams } from "@wirecat/cli-base" import type { ProgramDefinition, RunOptions } from "./program.js" import { run } from "./program.js" +/** @experimental */ export interface AgentTask { id: string request: string maxCalls: number check: (observations: readonly Observation[]) => boolean } +/** @experimental */ export interface Observation { argv: readonly string[] exitCode: number @@ -15,10 +17,12 @@ export interface Observation { stderr: readonly string[] outputBytes: number } +/** @experimental */ export type AgentPolicy = ( task: Pick, call: (argv: string[]) => Promise, ) => Promise +/** @experimental */ export interface EvaluationResult { task: string correct: boolean @@ -27,7 +31,10 @@ export interface EvaluationResult { failure?: "call_limit" | "agent_failed" | "incorrect" } -/** The harness records metrics, never message bodies, credentials, request operands or policy reasoning. */ +/** + * The harness records metrics, never message bodies, credentials, request operands or policy reasoning. + * @experimental + */ export const evaluateAgent = async ( tasks: readonly AgentTask[], agent: AgentPolicy, diff --git a/src/cli/app-doctor-command.ts b/src/cli/app-doctor-command.ts index 425dbd8a9..0dbc15807 100644 --- a/src/cli/app-doctor-command.ts +++ b/src/cli/app-doctor-command.ts @@ -100,6 +100,7 @@ const configFiles = (path: string) => { * Run when everything else is broken, so a problem in the config file or the OAuth setting is a field, never a throw. * It reads no keyring, opens no store and calls no service: each can hang or prompt. `fixes` are the `chmod` commands * that make the config private; they go to stderr, not into the answer. + * @experimental */ export const appDoctorReport = ( app: AppIdentity, diff --git a/src/cli/ask-before-write.ts b/src/cli/ask-before-write.ts index b8b91e3b3..157cfb1e7 100644 --- a/src/cli/ask-before-write.ts +++ b/src/cli/ask-before-write.ts @@ -11,6 +11,7 @@ import { commandPathKey } from "./permission-keys.js" * already stopped it before it ran (`refuseByCommandPermissions`), and `ask` is left to the command. At `ask` the owner * is asked, `--yes` answers, an agent goes ahead, and with nobody to answer it refuses. Outside the CLI's run, where * the profile's levels are not known, it refuses too. + * @experimental */ export const askBeforeWrite = async (command: Command): Promise => { const key = commandPathKey(commandPathOf(command)) diff --git a/src/cli/author.ts b/src/cli/author.ts index 8be6f78bd..aaa71acbd 100644 --- a/src/cli/author.ts +++ b/src/cli/author.ts @@ -12,7 +12,7 @@ export const authorOf = (env: NodeJS.ProcessEnv, asOwner?: boolean): string => /** * Who holds a task claim — one agent session, not the agent's name, so two sessions of one agent do not share one - * claim (owner, NEED-1119). `--holder`, then `WIRECAT_HOLDER`, then the agent's own session id where it sets one + * claim (the owner's decision). `--holder`, then `WIRECAT_HOLDER`, then the agent's own session id where it sets one * (Claude Code, Codex, OpenCode, Hermes), else the agent's name. */ export const holderOf = (env: NodeJS.ProcessEnv, flag?: string): string => { diff --git a/src/cli/base-stages-command.ts b/src/cli/base-stages-command.ts index fa4a6c7a3..1fb8c028a 100644 --- a/src/cli/base-stages-command.ts +++ b/src/cli/base-stages-command.ts @@ -19,6 +19,7 @@ import { queryTerms, termField, withQuery } from "./list-query.js" import { readAll } from "./messenger/stdin.js" import { ANSWER_SHAPE, askModel, parseProposals, recordProposals, suggestJobOf } from "./stage-suggest.js" +/** @experimental */ export interface BaseStagesCommandOptions { /** The run's environment, read for an agent's markers: an agent suggests mappings, the owner confirms and edits. */ env: () => NodeJS.ProcessEnv @@ -115,6 +116,7 @@ const kindArgument = () => new Argument("", "deal or lead: which base set" /** * `stages …`: the owner's base stages of deals and of leads, and the stages of every other pipeline mapped onto them. memo mounts it; a CRM * CLI moves a card to a base stage with `deals move stage:`. + * @experimental */ export const baseStagesCommand = (app: AppIdentity, options: BaseStagesCommandOptions): Command => { const isAgent = (command: Command) => Boolean(environmentOf(command).agent || agentOf(options.env())) diff --git a/src/cli/bot/api-http.ts b/src/cli/bot/api-http.ts index e4e76a18d..d41c890a4 100644 --- a/src/cli/bot/api-http.ts +++ b/src/cli/bot/api-http.ts @@ -1,5 +1,5 @@ import { CliError, type ErrorCode, wallClock } from "@wirecat/cli-base" -import { type GraphqlBinding, graphqlDocument, type ManifestOperation } from "@wirecat/cli-base/codegen" +import { type GraphqlBinding, graphqlDocument, type ManifestOperation } from "@wirecat/cli-base/codegen/runtime" import { type FetchLike, providerWaitMs, readJsonResponse, statusToCode } from "@wirecat/cli-base/http" import type { Command } from "commander" import { providerRequest } from "../command-runs.js" @@ -8,6 +8,7 @@ import { itemOf, renderAnswer } from "../envelope.js" import type { ApiCommandInput } from "./api.js" import { apiJson, graphqlVariables, parseApiJson, sendsBytes } from "./api-input.js" +/** @experimental */ export interface HttpApiRequest { method: string url: URL @@ -18,6 +19,7 @@ export interface HttpApiRequest { redirect?: "follow" | "manual" | "error" } +/** @experimental */ export interface HttpApiExecutorOptions { /** The service's name in messages: "Notion". */ service: string @@ -56,7 +58,10 @@ const segment = (name: string, value: string | undefined): string => { return encodeURIComponent(value) } -/** Why the generated command cannot send the operation's body, or `undefined` when it can: JSON, or an upload's bytes. */ +/** + * Why the generated command cannot send the operation's body, or `undefined` when it can: JSON, or an upload's bytes. + * @experimental + */ export const unsendableBody = (operation: ManifestOperation): string | undefined => { const type = operation.request?.contentType return type === undefined || sendsBytes(operation) @@ -64,7 +69,7 @@ export const unsendableBody = (operation: ManifestOperation): string | undefined : `it sends ${type}, which the generated command cannot send` } -/** One generated HTTP operation and its flags as the request they stand for; nothing is sent. */ +/** One generated HTTP operation and its flags as the request they stand for; nothing is sent. @experimental */ export const httpApiRequest = ( operation: ManifestOperation, input: ApiCommandInput, @@ -275,6 +280,7 @@ export const httpApiSend = (options: HttpApiSendOptions) => { * The `execute` of `generatedApiCommand` for any OpenAPI CLI: fills the path, adds the query, sends the JSON body * with the caller's headers through the caller's fetch, and prints the answer. Nothing here retries: a write is * never sent twice, since the first may have landed (WC-OUT-20). + * @experimental */ export const httpApiExecutor = (options: HttpApiExecutorOptions) => diff --git a/src/cli/bot/api-input.ts b/src/cli/bot/api-input.ts index 1d5e575cf..dda7c5e53 100644 --- a/src/cli/bot/api-input.ts +++ b/src/cli/bot/api-input.ts @@ -1,6 +1,6 @@ import { readFileSync } from "node:fs" import { CliError } from "@wirecat/cli-base" -import { identifier, type ManifestOperation, type SchemaNode } from "@wirecat/cli-base/codegen" +import { identifier, type ManifestOperation, type SchemaNode } from "@wirecat/cli-base/codegen/runtime" import { isLosslessNumber, isSafeNumber, LosslessNumber, parse, stringify } from "lossless-json" import * as v from "valibot" @@ -14,6 +14,7 @@ export const apiFlagOf = (name: string): string => .replace(/([a-z0-9])([A-Z])/g, "$1-$2") .toLowerCase() +/** @experimental */ export const apiOptionKey = (name: string): string => apiFlagOf(name).replace(/-([a-z0-9])/g, (_, letter: string) => letter.toUpperCase()) @@ -75,7 +76,7 @@ export const sendsBytes = (operation: ManifestOperation): boolean => { return type !== undefined && !JSON_BODY.test(type) && !FORM_BODY.test(type) } -/** The file `--body-file` names, `-` for stdin, as the bytes an upload sends. */ +/** The file `--body-file` names, `-` for stdin, as the bytes an upload sends. @experimental */ export const readApiBytes = ( path: string, read: (path: string | number) => Uint8Array = (from) => new Uint8Array(readFileSync(from)), diff --git a/src/cli/bot/api-rpc.ts b/src/cli/bot/api-rpc.ts index 15ea74c09..fedc80300 100644 --- a/src/cli/bot/api-rpc.ts +++ b/src/cli/bot/api-rpc.ts @@ -1,5 +1,5 @@ import { CliError } from "@wirecat/cli-base" -import { identifier, type ManifestOperation, type SchemaNode } from "@wirecat/cli-base/codegen" +import { identifier, type ManifestOperation, type SchemaNode } from "@wirecat/cli-base/codegen/runtime" import { isLosslessNumber, LosslessNumber } from "lossless-json" import type { ApiCommandInput } from "./api.js" import { apiJson, parseApiJson } from "./api-input.js" @@ -7,6 +7,7 @@ import { apiJson, parseApiJson } from "./api-input.js" type Definitions = Readonly> type ObjectValue = Record +/** @experimental */ export interface RpcApiBody { text?: string value: ObjectValue @@ -107,6 +108,7 @@ const flagValue = (raw: string, original: SchemaNode, definitions: Definitions): throw new CliError("validation_error", "an API parameter does not match its declared type") } +/** @experimental */ export const prepareRpcApiBody = ( operation: ManifestOperation, input: ApiCommandInput, diff --git a/src/cli/bot/api.ts b/src/cli/bot/api.ts index 5f4f05889..a74c562f0 100644 --- a/src/cli/bot/api.ts +++ b/src/cli/bot/api.ts @@ -1,5 +1,5 @@ import { CliError } from "@wirecat/cli-base" -import type { ManifestOperation, SchemaNode } from "@wirecat/cli-base/codegen" +import type { ManifestOperation, SchemaNode } from "@wirecat/cli-base/codegen/runtime" import { annotate } from "@wirecat/cli-base/commands" import { Command, Option } from "commander" import { secretInput } from "../../runs/run-context.js" diff --git a/src/cli/bot/context.ts b/src/cli/bot/context.ts index 5599d32eb..65b4d9343 100644 --- a/src/cli/bot/context.ts +++ b/src/cli/bot/context.ts @@ -18,7 +18,7 @@ import type { BotAdapter, BotChatRef, BotConnectOptions, BotMessenger } from "./ import { botFiles, ChatRegistry } from "./registry.js" import { BotTokenStore } from "./token.js" -/** How the owner types this bot — `max sales bot` — so a refusal names the command that fixes it. */ +/** How the owner types this bot — `max sales bot` — so a refusal names the command that fixes it. @experimental */ export const botWords = (bot: BotMessenger, profile: string): string => `${bot.app.command} ${asFirstWord(profile)}bot` /** What a messenger command refuses before it connects, for a bot: an unknown key, then a denied read. */ @@ -128,6 +128,7 @@ export const botContext = ( } } +/** @experimental */ export type BotContext = ReturnType /** `--offline` reads the local copy; a command that has to ask the messenger refuses it rather than ignoring it. */ diff --git a/src/cli/bot/copy.ts b/src/cli/bot/copy.ts index da82363c2..57cd4ee7e 100644 --- a/src/cli/bot/copy.ts +++ b/src/cli/bot/copy.ts @@ -135,4 +135,5 @@ export const botCopy = (provider: Provider) => { } } +/** @experimental */ export type BotCopy = ReturnType diff --git a/src/cli/bot/messages.ts b/src/cli/bot/messages.ts index 4ea7a0b5a..46a984c9b 100644 --- a/src/cli/bot/messages.ts +++ b/src/cli/bot/messages.ts @@ -21,7 +21,7 @@ import { botExamples } from "./examples.js" import { BOT_MESSAGES_QUERY, botMessageWindow } from "./list-queries.js" import type { BotAdapter, BotMessenger } from "./port.js" -/** The adapter's `method`, or a refusal naming what this messenger's bot cannot do. */ +/** The adapter's `method`, or a refusal naming what this messenger's bot cannot do. @experimental */ export const botCan = ( adapter: BotAdapter, method: K, @@ -35,7 +35,10 @@ export const botCan = ( return found.bind(adapter) as NonNullable } -/** The bot's own id — the key its local copy is kept under — remembered after the first time it is asked. */ +/** + * The bot's own id — the key its local copy is kept under — remembered after the first time it is asked. + * @experimental + */ export const botIdOf = async (context: BotContext, adapter: BotAdapter): Promise => { const known = context.registry.botId() if (known) return known diff --git a/src/cli/bot/port.ts b/src/cli/bot/port.ts index b67292234..b2ccac52b 100644 --- a/src/cli/bot/port.ts +++ b/src/cli/bot/port.ts @@ -84,7 +84,7 @@ export interface BotPeople { senders(): PersonFacts[] } -/** What a bot shows in a chat while it works. */ +/** What a bot shows in a chat while it works. @experimental */ export const BOT_ACTIONS = ["typing", "photo", "video", "voice", "file"] as const export type BotAction = (typeof BOT_ACTIONS)[number] @@ -120,7 +120,7 @@ export interface BotChatMembers { removeMember(chat: BotChatRef, person: Id, options: { block: boolean }): Promise } -/** One command in the menu people see when they type `/`. */ +/** One command in the menu people see when they type `/`. @experimental */ export interface BotMenuEntry { /** Without the `/`. */ name: string @@ -134,7 +134,7 @@ export interface BotMenu { setMenu(entries: BotMenuEntry[]): Promise } -/** Where a pressed button was, as `bot watch` kept it. */ +/** Where a pressed button was, as `bot watch` kept it. @experimental */ export interface BotPress { chatId: Id messageId: Id @@ -164,7 +164,7 @@ export interface BotWebhooks { deleteWebhook(url: string): Promise } -/** What happened in the bot's chats besides messages: a button, people coming and going, a start. */ +/** What happened in the bot's chats besides messages: a button, people coming and going, a start. @experimental */ export type BotNotice = | { event: "callback" @@ -190,7 +190,10 @@ export interface BotUpdateRef { /** One update as `bot watch` prints it; without `update`, a redelivery is printed and kept again. */ export type BotEvent = (MessageEvent | BotNotice) & { update?: BotUpdateRef } -/** One request as it reached `bot watch --public-url`: the body exactly as sent, never parsed and written again. */ +/** + * One request as it reached `bot watch --public-url`: the body exactly as sent, never parsed and written again. + * @experimental + */ export interface BotWebhookRequest { method: string /** Path and query, against the local listener. */ @@ -199,7 +202,7 @@ export interface BotWebhookRequest { body: Uint8Array } -/** What the receiver answers a request that is not a delivery. */ +/** What the receiver answers a request that is not a delivery. @experimental */ export interface BotWebhookAnswer { status: number body?: string @@ -226,6 +229,7 @@ export interface BotSecret { description: string } +/** @experimental */ export interface BotUpdatesPage { events: BotEvent[] /** Where the next call starts; the same as given when nothing came. Opaque to the caller. */ diff --git a/src/cli/bot/registry.ts b/src/cli/bot/registry.ts index 9ebb2aef2..f13896961 100644 --- a/src/cli/bot/registry.ts +++ b/src/cli/bot/registry.ts @@ -9,11 +9,14 @@ export interface SeenChat extends Chat { lastSeenAt: string } -/** Everything this machine keeps about its bots: seen chats, recipients, the send journal. */ +/** Everything this machine keeps about its bots: seen chats, recipients, the send journal. @experimental */ export const botsDirectory = (app: AppIdentity, env: NodeJS.ProcessEnv = process.env): string => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots") -/** One bot's files. The names are what max-cli has always used: a moved path would lose a recipient list, and with it the limit. */ +/** + * One bot's files. The names are what max-cli has always used: a moved path would lose a recipient list, and with it the limit. + * @experimental + */ export const botFiles = (app: AppIdentity, profile: string, env: NodeJS.ProcessEnv = process.env) => { const directory = botsDirectory(app, env) return { @@ -106,7 +109,7 @@ export class ChatRegistry { } } -/** Every profile that has ever kept a registry — the bots this machine has used. */ +/** Every profile that has ever kept a registry — the bots this machine has used. @experimental */ export const registryProfiles = (app: AppIdentity, env: NodeJS.ProcessEnv = process.env): string[] => { const directory = botsDirectory(app, env) if (!existsSync(directory)) return [] diff --git a/src/cli/bot/updates.ts b/src/cli/bot/updates.ts index a21bf05ef..4a7da8b48 100644 --- a/src/cli/bot/updates.ts +++ b/src/cli/bot/updates.ts @@ -6,6 +6,7 @@ import type { BotPress } from "./port.js" * Where the bot's next poll starts. State, not cache: a poll with it confirms everything before it * to the messenger for every reader of this bot, so losing it prints a batch twice and never loses * one. `{ "marker": … }`, the shape max-cli has always written. + * @experimental */ export class UpdatesCursor { readonly #path: string @@ -37,7 +38,7 @@ interface KeptPress extends BotPress { const KEPT_PRESSES = 500 const PRESS_LIFETIME_MS = 24 * 60 * 60 * 1000 -/** The buttons `bot watch` saw pressed, so `bot callbacks answer --text` can find the message later. */ +/** The buttons `bot watch` saw pressed, so `bot callbacks answer --text` can find the message later. @experimental */ export class PressLog { readonly #path: string diff --git a/src/cli/call-stats-command.ts b/src/cli/call-stats-command.ts index cca43beae..e836dad67 100644 --- a/src/cli/call-stats-command.ts +++ b/src/cli/call-stats-command.ts @@ -9,8 +9,10 @@ import { outputFor } from "./context.js" import { LOCAL_READ, NO_EFFECTS } from "./effects.js" import { type Body, itemOf, renderAnswer } from "./envelope.js" +/** @experimental */ export type CallStatsRead = (request: Omit) => Promise +/** @experimental */ export interface CallStatsCommandDeps { /** The calls of the profile's own account; opened when the command runs. */ read: () => Promise @@ -39,6 +41,7 @@ const positive = (value: string) => { /** * `stats calls show`, for a host whose meetings are phone calls: it mounts the command, so a host of video meetings * never shows it. Numbers over the stored calls only; nothing is read from the phone system. + * @experimental */ export const addCallStatsCommand = (program: Command, deps: CallStatsCommandDeps): void => { const stats = diff --git a/src/cli/command-contract.ts b/src/cli/command-contract.ts index cc563467c..ac42c6458 100644 --- a/src/cli/command-contract.ts +++ b/src/cli/command-contract.ts @@ -6,7 +6,9 @@ import { keyForCommand } from "../sends/permissions.js" import { answerEntitySchema, answerProjectionSchema } from "./answer-entity.js" import { answerSchema } from "./envelope.js" +/** @experimental */ export type JsonSchema = Record +/** @experimental */ export const SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema" /** @@ -40,6 +42,7 @@ export const findCommand = (root: Command, path: readonly string[]): Command => return at } +/** @experimental */ export const commandContract = (command: Command) => { const path = commandPathOf(command) const ancestors: Command[] = [] diff --git a/src/cli/command-runs.ts b/src/cli/command-runs.ts index 3d178c70b..15303efd2 100644 --- a/src/cli/command-runs.ts +++ b/src/cli/command-runs.ts @@ -27,6 +27,7 @@ export interface SavedRunSettings { recordInput?: RecordInput | undefined } +/** @experimental */ export interface RunSettings { record: boolean keepFailedRuns: boolean @@ -39,6 +40,7 @@ export interface RunSettings { /** * `--record`/`--no-record` first, then the config: every run is kept unless it says `record: false`, which keeps * failures only; `--no-record` keeps nothing (WC-LIFE-15). + * @experimental */ export const runSettings = (flag: boolean | undefined, saved: SavedRunSettings = {}): RunSettings => { const record = flag ?? saved.record ?? true @@ -198,7 +200,7 @@ interface Parse { const parses = new AsyncLocalStorage() -/** The id `runs show` takes for the command under way, so a write can name the run that made it. */ +/** The id `runs show` takes for the command under way, so a write can name the run that made it. @experimental */ export const commandRunId = (): string | undefined => parses.getStore()?.runs.runId() /** diff --git a/src/cli/commander-internals.test.ts b/src/cli/commander-internals.test.ts new file mode 100644 index 000000000..931fce70d --- /dev/null +++ b/src/cli/commander-internals.test.ts @@ -0,0 +1,55 @@ +import { Command } from "commander" +import { describe, expect, it } from "vitest" +import { + hasOwnAction, + helpOptionOf, + hide, + isHidden, + onUnknownOption, + rejectUnknownOption, +} from "./commander-internals.js" + +const program = () => { + const root = new Command("app").exitOverride() + root + .command("group") + .command("leaf") + .action(() => {}) + return root +} + +describe("the commander fields the skeleton reads", () => { + it("tells a command with an action from a group", () => { + const root = program() + const group = root.commands[0] as Command + expect(hasOwnAction(group)).toBe(false) + expect(hasOwnAction(group.commands[0] as Command)).toBe(true) + }) + + it("hides a command after it was added, and commander's help leaves it out", () => { + const root = program() + const group = root.commands[0] as Command + expect(isHidden(group)).toBe(false) + hide(group) + expect(isHidden(group)).toBe(true) + expect(root.helpInformation()).not.toContain("group") + }) + + it("finds the help option", () => { + const help = helpOptionOf(program()) + expect(help?.long).toBe("--help") + expect([help?.is("-h"), help?.is("--help"), help?.is("--nope")]).toEqual([true, true, false]) + }) + + it("fails on an unknown option, and lets a handler replace that failure", () => { + const root = program().configureOutput({ writeErr: () => {} }) + expect(() => rejectUnknownOption(root, "--nope")).toThrow( + expect.objectContaining({ code: "commander.unknownOption" }), + ) + onUnknownOption(root, (flag, fallback) => (flag === "--nope" ? root.error("hinted") : fallback(flag))) + expect(() => rejectUnknownOption(root, "--nope")).toThrow("hinted") + expect(() => rejectUnknownOption(root, "--other")).toThrow( + expect.objectContaining({ code: "commander.unknownOption" }), + ) + }) +}) diff --git a/src/cli/commander-internals.ts b/src/cli/commander-internals.ts new file mode 100644 index 000000000..b1183ae5b --- /dev/null +++ b/src/cli/commander-internals.ts @@ -0,0 +1,43 @@ +import type { Command, Option } from "commander" + +/** + * The commander fields with no public accessor that the command skeleton relies on. They are read here only, so a + * commander release that renames one fails `commander-internals.test.ts` rather than a CLI at run time. Not exported + * from any entry point. + */ +interface Internals { + _actionHandler?: unknown + _hidden?: boolean + _getHelpOption(): HelpOption | null + unknownOption(flag: string): never +} + +/** `is` matches the long or short flag, as commander checks it. */ +type HelpOption = Option & { is(word: string): boolean } + +const internals = (command: Command): Internals => command as unknown as Internals + +/** Whether the command runs an action of its own, rather than only grouping others. */ +export const hasOwnAction = (command: Command): boolean => internals(command)._actionHandler != null + +export const isHidden = (command: Command): boolean => internals(command)._hidden === true + +/** Hides a command already added, as `{ hidden: true }` does when it is added. */ +export const hide = (command: Command): void => { + internals(command)._hidden = true +} + +export const helpOptionOf = (command: Command): HelpOption | null => internals(command)._getHelpOption() + +/** Fails as commander does for an option the command does not take. */ +export const rejectUnknownOption = (command: Command, flag: string): never => internals(command).unknownOption(flag) + +/** Replaces commander's failure for an unknown option; `fallback` is commander's own. */ +export const onUnknownOption = ( + command: Command, + handle: (flag: string, fallback: (flag: string) => never) => never, +) => { + const own = internals(command) + const fallback = own.unknownOption.bind(command) + own.unknownOption = (flag) => handle(flag, fallback) +} diff --git a/src/cli/commands-command.ts b/src/cli/commands-command.ts index cf49c0963..7d3ce2cd7 100644 --- a/src/cli/commands-command.ts +++ b/src/cli/commands-command.ts @@ -11,12 +11,14 @@ import { DISCOVERY_DESCRIPTIONS } from "./discovery-descriptions.js" import { NO_EFFECTS } from "./effects.js" import { renderDocument } from "./envelope.js" import { commandsText } from "./help/commands-text.js" +import { notLocalPaths } from "./path-options.js" import { rootOf } from "./profile.js" import { hasSharedContract } from "./shared-contracts.js" /** * The major version of the JSON every command prints. The output types live in this package, so the * contract is this package's: raise it with a major version, when a field is removed or renamed. + * @experimental */ export const CONTRACT = 3 @@ -25,7 +27,7 @@ export const CONTRACT = 3 * settings file without a named profile. A named profile adds availability without hiding commands. */ export const commandsCommand = (app: AppIdentity): Command => { - const command = annotate(new Command("commands"), { effects: NO_EFFECTS }) + const command = notLocalPaths(annotate(new Command("commands"), { effects: NO_EFFECTS }), "path") .description(DISCOVERY_DESCRIPTIONS.commands) .hook("preAction", (_command, action) => { if (action.optsWithGlobals<{ jsonl?: boolean }>().jsonl) diff --git a/src/cli/compact.ts b/src/cli/compact.ts index 4ff83c329..c25b00194 100644 --- a/src/cli/compact.ts +++ b/src/cli/compact.ts @@ -7,7 +7,7 @@ import { answerRow } from "./answer-entity.js" import type { Body } from "./envelope.js" import { STATUS_ROWS } from "./project-status-rows.js" -/** How one column prints. `text` by default. */ +/** How one column prints. `text` by default. @experimental */ export type RowValue = "text" | "time" | "day" | "count" | "files" | "reply" | "forward" export interface RowColumn { @@ -38,6 +38,7 @@ export interface RowShape { oneLine?: boolean } +/** @experimental */ export interface CompactOptions { /** IANA zone for times; the answer's `meta.timezone` wins. */ timezone: string @@ -118,7 +119,7 @@ const EVIDENCE_ROWS: Readonly> = { }, } -/** Rows for cli-core's shared entities. */ +/** Rows for cli-core's shared entities. @experimental */ export const SHARED_ROWS: Readonly> = { message: messageRow, "message.summary": messageRow, @@ -145,7 +146,7 @@ export const SHARED_ROWS: Readonly> = { ...EVIDENCE_ROWS, } -/** Any record: what names it, what it is called, what state it is in, then what it says. */ +/** Any record: what names it, what it is called, what state it is in, then what it says. @experimental */ export const GENERIC_ROW: RowShape = { columns: [ { field: ["key", "ref", "id"] }, @@ -155,12 +156,16 @@ export const GENERIC_ROW: RowShape = { text: ["text", "excerpt"], } +/** @experimental */ export type RowsResolver = (command: Command | undefined) => RowShape | undefined -/** An app's own rows by entity name (or `name.view`). */ +/** An app's own rows by entity name (or `name.view`). @experimental */ export type RowTable = Readonly> -/** The row an entity named in a section is drawn with: the app's, the shared one, else the generic one. */ +/** + * The row an entity named in a section is drawn with: the app's, the shared one, else the generic one. + * @experimental + */ export const rowsOfEntity = (table: RowTable = {}) => (entity: string): RowShape => @@ -172,7 +177,7 @@ const declaredNames = (command: Command | undefined): string[] => { return output.view ? [`${output.entity}.${output.view}`, output.entity] : [output.entity] } -/** An app's own rows by entity name, as `entityFields` takes its fields; a shared name is refused. */ +/** An app's own rows by entity name, as `entityFields` takes its fields; a shared name is refused. @experimental */ export const entityRows = (table: RowTable): RowsResolver => { const shared = Object.keys(table).filter((name) => name in ENTITIES || name in SHARED_ROWS) if (shared.length > 0) throw new Error(`entityRows: ${shared.join(", ")} is cli-core's entity; name yours apart`) @@ -182,7 +187,7 @@ export const entityRows = (table: RowTable): RowsResolver => { } } -/** The row a command's answer is drawn with: its own, its app's, the shared one, else the generic one. */ +/** The row a command's answer is drawn with: its own, its app's, the shared one, else the generic one. @experimental */ export const rowShapeOf = (command: Command | undefined, resolve?: RowsResolver): RowShape => { const own = answerRow(command) ?? resolve?.(command) if (own) return own @@ -477,7 +482,7 @@ const usableZone = (zone: string | undefined): string | undefined => { } } -/** The whole answer as compact text: header, rows, footer. Pure: no store, no clock. */ +/** The whole answer as compact text: header, rows, footer. Pure: no store, no clock. @experimental */ export const compactText = ( body: Body, shape: RowShape, diff --git a/src/cli/config-command.ts b/src/cli/config-command.ts index e05c95274..98ee5e02d 100644 --- a/src/cli/config-command.ts +++ b/src/cli/config-command.ts @@ -266,7 +266,7 @@ const migrateCommand = (app: AppIdentity, config: Configuration): Command => }) /** - * Mends JSON syntax with one reading and keeps every value (NEED-2178): no network, no AI, since the file may hold + * Mends JSON syntax with one reading and keeps every value: no network, no AI, since the file may hold * keys. Anything else is refused with nothing changed. */ const repairCommand = (app: AppIdentity, config: Configuration): Command => @@ -337,8 +337,9 @@ const repairCommand = (app: AppIdentity, config: Configuration): Command => }) /** - * A key no command or write is checked against would be saved and do nothing (BUG-137) — whether it + * A key no command or write is checked against would be saved and do nothing — whether it * comes as `permissions.` or inside a whole `permissions` object. + * @experimental */ export const refuseUnknownKey = ( command: Command, @@ -372,8 +373,7 @@ export const refuseUnknownKey = ( /** * An agent may hold `mcp.authority` or `bot.api` and change other settings, but never the key that let it in: on any - * profile, in the defaults, or by replacing `permissions` whole. Only the owner, in a terminal, turns it on or off - * (NEED-1662, NEED-1679). + * profile, in the defaults, or by replacing `permissions` whole. Only the owner, in a terminal, turns it on or off. */ export const refuseGuardedKey = (setting: string, value: string | undefined, ownerOnly: OwnerOnlySettings): void => { if (ownerOnly.settings?.includes(setting)) diff --git a/src/cli/config-issues.ts b/src/cli/config-issues.ts index 8a766e594..f8a5d1873 100644 --- a/src/cli/config-issues.ts +++ b/src/cli/config-issues.ts @@ -275,7 +275,7 @@ export const savedPermissionKeys = (raw: unknown): { key: string; at: string[] } : [], ) -/** A saved key no command checks would do nothing (BUG-137): one issue per key, wherever it is saved. */ +/** A saved key no command checks would do nothing: one issue per key, wherever it is saved. */ export const permissionIssues = ( saved: readonly { key: string; at: readonly string[] }[], known: ReadonlySet, @@ -335,7 +335,7 @@ export const withoutIssues = (raw: unknown, issues: readonly LocatedIssue[]): un issues.map(({ at }) => at), ).pruned -/** The path `config unset ` names: a permission key keeps its dots; a number is a list item. */ +/** The path `config unset ` names: a permission key keeps its dots; a number is a list item. @experimental */ export const settingPathOf = (setting: string): string[] => setting.startsWith("permissions.") ? ["permissions", setting.slice("permissions.".length)] : setting.split(".") @@ -357,7 +357,10 @@ export const withoutPath = (raw: unknown, at: readonly string[]): { config: unkn return { config: prune(raw, [gone]).pruned, removed: true } } -/** `withoutPath` for a setting as `config unset` takes it: `mail.accounts.0.colour`, `permissions.messages.send`. */ +/** + * `withoutPath` for a setting as `config unset` takes it: `mail.accounts.0.colour`, `permissions.messages.send`. + * @experimental + */ export const withoutSetting = (raw: unknown, setting: string) => withoutPath(raw, settingPathOf(setting)) /** The public shape: where in the file is the loader's own business. */ @@ -427,6 +430,7 @@ const wholeFile = (file: string, what: string): ConfigIssue => ({ kind: "invalid /** * A config file's text, `undefined` when there is no file, or the issue when one is there and cannot be read: a * folder at the path, or a file this user may not read. Neither has a fix `config` could run. + * @experimental */ export const readConfigText = (path: string): { text: string | undefined } | { issue: ConfigIssue } => { try { diff --git a/src/cli/config-keys.ts b/src/cli/config-keys.ts index fca97c456..8d1751ee5 100644 --- a/src/cli/config-keys.ts +++ b/src/cli/config-keys.ts @@ -21,7 +21,10 @@ const problemOf = (issues: [v.BaseIssue, ...v.BaseIssue[]]): s return `${v.getDotPath(issue) ?? "the whole file"} ${reasonOf(issue)}${count}` } -/** Reads and checks a config file; a missing one is the fallback, a broken one an error naming its first problem. */ +/** + * Reads and checks a config file; a missing one is the fallback, a broken one an error naming its first problem. + * @experimental + */ export const loadSnakeCaseConfig = ( path: string, schema: T, diff --git a/src/cli/context.ts b/src/cli/context.ts index cabafcf53..1702cd8be 100644 --- a/src/cli/context.ts +++ b/src/cli/context.ts @@ -98,7 +98,7 @@ export interface BaseEnvironment { /** * The command's answer and error go to the MCP server as objects, never as text. A write at level `ask` goes - * ahead (NEED-773): nobody is at a terminal, and the profile's permissions already decided. + * ahead: nobody is at a terminal, and the profile's permissions already decided. */ export interface AgentRun { result: (value: unknown) => void @@ -157,7 +157,10 @@ export const environmentOf = (comma const PAGING = ["page", "limit", "all"] -/** A generated API command's own `--page`, `--limit` or `--all` is the service's parameter, not the CLI's paging. */ +/** + * A generated API command's own `--page`, `--limit` or `--all` is the service's parameter, not the CLI's paging. + * @experimental + */ export const withoutOwnPaging = (command: Command, flags: F): F => { if (metaOf(command).origin !== "generated") return flags const own = PAGING.filter((name) => command.options.some((option) => option.attributeName() === name)) @@ -169,6 +172,7 @@ export const withoutOwnPaging = (command: Command, flags: F): /** * The command's flags as settings read them, an MCP server's `--permission` levels first: they reach a run on its * agent, never in argv. + * @experimental */ export const withAgentLevels = (command: Command, flags: F): F => { const overrides = environmentOf(command).agent?.overrides ?? [] diff --git a/src/cli/contract-evidence.ts b/src/cli/contract-evidence.ts index cfa7a1c94..8eb0a6155 100644 --- a/src/cli/contract-evidence.ts +++ b/src/cli/contract-evidence.ts @@ -16,6 +16,7 @@ export interface ContractEvidenceOptions { errors?: AppErrors } +/** @experimental */ export const contractEvidence = (root: Command, { fields, errors }: ContractEvidenceOptions = {}) => { const schemas: Record = { ...entityDefinitions() } const fieldOnly: string[] = [] diff --git a/src/cli/csv.ts b/src/cli/csv.ts index 3b682fc8a..cd5e6013e 100644 --- a/src/cli/csv.ts +++ b/src/cli/csv.ts @@ -8,6 +8,7 @@ const FORMULA = /^[=+\-@\t\r]/ /** * One cell as RFC 4180 writes it, safe to open in a spreadsheet: text that would start a formula gets a leading `'`, * since every cell may be what someone else typed into the CRM. + * @experimental */ export const csvCell = (value: unknown): string => { if (value === null || value === undefined) return "" @@ -16,11 +17,11 @@ export const csvCell = (value: unknown): string => { return /[",\r\n]/.test(safe) ? `"${safe.replaceAll('"', '""')}"` : safe } -/** A header and its rows as RFC 4180 records, without line ends; the header is guarded like any cell. */ +/** A header and its rows as RFC 4180 records, without line ends; the header is guarded like any cell. @experimental */ export const csvRecords = (header: readonly string[], rows: readonly (readonly unknown[])[]): string[] => [header, ...rows].map((row) => row.map(csvCell).join(",")) -/** The table on stdout and nothing else, every record ending in CRLF. */ +/** The table on stdout and nothing else, every record ending in CRLF. @experimental */ export const writeCsv = ( streams: Pick, header: readonly string[], diff --git a/src/cli/default-config.ts b/src/cli/default-config.ts index dbd8ef98b..96eccf7eb 100644 --- a/src/cli/default-config.ts +++ b/src/cli/default-config.ts @@ -1,6 +1,7 @@ import { existsSync, linkSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs" import { dirname, join } from "node:path" +/** @experimental */ export const DEFAULT_CONFIG = { defaults: { limit: 20, keep_runs_for_days: 30, sends_per_hour: 30, update_check: true, skill_hint: true }, profiles: {}, @@ -10,6 +11,7 @@ export const DEFAULT_CONFIG = { * Publish a complete starter file without replacing a concurrent first run or the owner's settings. `config` is * `DEFAULT_CONFIG` spelled as the reading schema declares it: an app with a schema of its own may not yet say * `keep_runs_for_days`. + * @experimental */ export function ensureDefaultConfig(path: string, config: unknown = DEFAULT_CONFIG): void { if (existsSync(path)) return diff --git a/src/cli/doctor-reports-command.ts b/src/cli/doctor-reports-command.ts index a4f57c074..5b44d34d5 100644 --- a/src/cli/doctor-reports-command.ts +++ b/src/cli/doctor-reports-command.ts @@ -14,6 +14,7 @@ import { buildReport, reportFileName } from "./messenger/report.js" import { ownPackageRoot } from "./messenger/serve-outdated.js" import { lineOf, nextStep, rootOf } from "./steps.js" +/** @experimental */ export interface DoctorReportsSource { app: AppIdentity /** What the file holds and never holds, as `doctor reports show` lists it. */ @@ -92,7 +93,10 @@ export const issueUrlFor = ( return `${app.issues}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}` } -/** `doctor reports show|create`: one file for the author, the same for every CLI; `collect` says what it holds. */ +/** + * `doctor reports show|create`: one file for the author, the same for every CLI; `collect` says what it holds. + * @experimental + */ export const doctorReportsCommand = (source: DoctorReportsSource): Command => { const { app, includes, excludes } = source const reports = annotate(new Command("reports"), { effects: NO_EFFECTS }).description("problem reports") diff --git a/src/cli/documents/catalog.ts b/src/cli/documents/catalog.ts index 970f8c988..1a535a2f5 100644 --- a/src/cli/documents/catalog.ts +++ b/src/cli/documents/catalog.ts @@ -6,6 +6,7 @@ import { CATALOG_QUERY, type CatalogEntry, type CatalogQuery } from "../../store import { honoursDryRun } from "../dry-run-guard.js" import { LOCAL_READ, LOCAL_WRITE } from "../effects.js" import { type Body, itemOf, listOf } from "../envelope.js" +import { notLocalPaths } from "../path-options.js" import { DOCUMENT_UNTRUSTED, marksUntrusted } from "../untrusted-marks.js" import type { DocumentKnowledgePort } from "./knowledge.js" import { bindQuery, documentQueries, tagRow, termsOf } from "./queries.js" @@ -211,7 +212,7 @@ const addDocumentCatalogCommandsDefinition = (program: Command, helpers: Documen const { prefix, text } = wording const queries = documentQueries() const view = "catalog" - const catalog = local(program.command("catalog")).description(text.catalog) + const catalog = notLocalPaths(local(program.command("catalog")), "file", "folder").description(text.catalog) const run = ( fn: (index: DocumentCatalogStores & { catalog: DocumentCatalog }, principal: string) => Promise, write = false, diff --git a/src/cli/documents/file-conflicts.ts b/src/cli/documents/file-conflicts.ts index 3f7a65282..8bdd2cb84 100644 --- a/src/cli/documents/file-conflicts.ts +++ b/src/cli/documents/file-conflicts.ts @@ -17,6 +17,7 @@ import { refusedPlace } from "../../sends/upload.js" import { environmentOf } from "../context.js" import { LOCAL_READ, ownerOnlyOption, REMOTE_WRITE } from "../effects.js" import { type Body, itemOf, listOf, snakeKeys } from "../envelope.js" +import { notLocalPaths } from "../path-options.js" import { marksUntrusted } from "../untrusted-marks.js" /** What a file-mirror CLI gives `fileConflictsCommand`: its mirrors, their state and stores, and its remote. */ @@ -66,7 +67,7 @@ export const fileConflictsCommand = (helpers: FileConflictCommands): Command => const { remote, identity } = helpers const app = identity.command const one = (command: Command, id: string) => helpers.mirrors(command, id)[0] as Mirror - return annotate(new Command("conflicts"), { effects: LOCAL_READ }) + return notLocalPaths(annotate(new Command("conflicts"), { effects: LOCAL_READ }), "path") .summary("files changed on both sides that a sync could not merge") .description( `files changed on both sides that a sync could not merge: list them, show the three versions and the lines ` + diff --git a/src/cli/documents/file-edit.ts b/src/cli/documents/file-edit.ts index 4b5743fe8..9c47bf8df 100644 --- a/src/cli/documents/file-edit.ts +++ b/src/cli/documents/file-edit.ts @@ -22,6 +22,7 @@ import { guardedFileWrite, remoteChanged } from "../../services/files/guarded-wr import { honoursDryRun } from "../dry-run-guard.js" import { REMOTE_READ, REMOTE_WRITE } from "../effects.js" import { itemOf } from "../envelope.js" +import { notLocalPaths } from "../path-options.js" import { marksUntrusted } from "../untrusted-marks.js" import { addFileUpdateCommand, @@ -320,7 +321,7 @@ const addFileEditCommandsDefinition = (files: Command, helpers: FileEditCommands helpers.output(itemOf(item), command) } - const sheets = annotate(files.command("sheets"), { effects: REMOTE_READ }).description( + const sheets = notLocalPaths(annotate(files.command("sheets"), { effects: REMOTE_READ }), "path").description( `the cells of an Excel workbook (.xlsx) on ${place}, read and changed in place`, ) examples( @@ -471,7 +472,7 @@ const addFileEditCommandsDefinition = (files: Command, helpers: FileEditCommands }) }) - const documents = annotate(files.command("documents"), { effects: REMOTE_READ }).description( + const documents = notLocalPaths(annotate(files.command("documents"), { effects: REMOTE_READ }), "path").description( `the paragraphs of a Word document (.docx) on ${place}, read and changed in place`, ) examples( @@ -565,7 +566,7 @@ const addFileEditCommandsDefinition = (files: Command, helpers: FileEditCommands }) examples( - annotate(files.command("history"), { effects: REMOTE_READ, offline: false }) + notLocalPaths(annotate(files.command("history"), { effects: REMOTE_READ, offline: false }), "path") .summary("list the earlier versions of a file kept on this computer") .description( "list what the writes and syncs of this profile replaced in a file, newest last. Each entry's version is the " + @@ -597,7 +598,7 @@ const addFileEditCommandsDefinition = (files: Command, helpers: FileEditCommands const trash = helpers.restoreFromTrash examples( - annotate(files.command("restore"), { effects: REMOTE_WRITE, offline: false }) + notLocalPaths(annotate(files.command("restore"), { effects: REMOTE_WRITE, offline: false }), "path") .summary( trash ? "bring a file back from the trash, or put back a version kept here" diff --git a/src/cli/documents/file-mirrors.ts b/src/cli/documents/file-mirrors.ts index f84834ad4..c41751bc2 100644 --- a/src/cli/documents/file-mirrors.ts +++ b/src/cli/documents/file-mirrors.ts @@ -36,6 +36,7 @@ import { FETCH, LOCAL_READ, LOCAL_WRITE, ownerOnlyOption, REMOTE_READ, REMOTE_WR import { type Body, itemOf, jsonlRecords, listOf, snakeKeys } from "../envelope.js" import { commandPath } from "../list-query.js" import { terminalAsker } from "../messenger/ask.js" +import { notLocalPaths } from "../path-options.js" import { marksUntrusted } from "../untrusted-marks.js" import { fileConflictsCommand } from "./file-conflicts.js" @@ -470,12 +471,15 @@ export const fileMirrorsCommand = (helpers: FileMirrorCommands): Command => { const keepOf = (side?: string): Keep | undefined => (side === REMOTE ? "remote" : (side as Keep | undefined)) const addCommand = () => - annotate(new Command("add"), { - effects: FETCH, - offline: false, - mcp: false, - examples: helpers.root.examples.map((example) => `${CLI} personal mirrors add ${example}`), - }) + notLocalPaths( + annotate(new Command("add"), { + effects: FETCH, + offline: false, + mcp: false, + examples: helpers.root.examples.map((example) => `${CLI} personal mirrors add ${example}`), + }), + "folder", + ) .summary(`mirror a local folder and a ${helpers.root.place} both ways`) .description( `mirror a local folder and a ${helpers.root.place} both ways: checks the ${helpers.root.place} and saves the ` + @@ -917,7 +921,7 @@ export const fileMirrorsCommand = (helpers: FileMirrorCommands): Command => { }) const versionsCommand = () => - annotate(new Command("versions"), { effects: LOCAL_READ, mcp: false }) + notLocalPaths(annotate(new Command("versions"), { effects: LOCAL_READ, mcp: false }), "path") .summary("versions of mirrored files that syncs replaced or deleted") .description("the versions of a mirrored file that syncs replaced or deleted, kept on this computer") .addCommand( diff --git a/src/cli/documents/file-update.ts b/src/cli/documents/file-update.ts index cbc4f58d1..5a8bf5be1 100644 --- a/src/cli/documents/file-update.ts +++ b/src/cli/documents/file-update.ts @@ -11,6 +11,7 @@ import { honoursDryRun } from "../dry-run-guard.js" import { REMOTE_WRITE } from "../effects.js" import { type Body, itemOf } from "../envelope.js" import { bufferedInput, MAX_BUFFERED_INPUT } from "../input-policy.js" +import { notLocalPaths } from "../path-options.js" import { type DocumentWords, examples, wordsOf } from "./words.js" /** What `files update` writes through, signed in for one run. */ @@ -85,7 +86,7 @@ const addFileUpdateCommandDefinition = (files: Command, helpers: FileUpdateComma const group = files.name() const deleteKey = helpers.deleteKey ?? "files.delete" return examples( - annotate(files.command("update"), { effects: REMOTE_WRITE, offline: false }) + notLocalPaths(annotate(files.command("update"), { effects: REMOTE_WRITE, offline: false }), "path") .summary(`replace a ${place} file's text, or create a text file`) .description( `replace a ${place} file's text, or create a text file. A file already there is replaced only with ` + diff --git a/src/cli/documents/folders.ts b/src/cli/documents/folders.ts index 9f7f263e2..c629e180e 100644 --- a/src/cli/documents/folders.ts +++ b/src/cli/documents/folders.ts @@ -3,6 +3,7 @@ import type { Command } from "commander" import { honoursDryRun } from "../dry-run-guard.js" import { FETCH, LOCAL_READ, LOCAL_WRITE } from "../effects.js" import { type Body, itemOf } from "../envelope.js" +import { notLocalPaths } from "../path-options.js" import { DOCUMENT_UNTRUSTED, marksUntrusted } from "../untrusted-marks.js" import { bindQuery, documentQueries, folderRow, termsOf } from "./queries.js" import { allOf, type DocumentWords, examples, wordsOf } from "./words.js" @@ -25,7 +26,9 @@ const addDocumentFolderCommandsDefinition = (program: Command, helpers: Document const wording = wordsOf(helpers.words) const { prefix, text } = wording const queries = documentQueries() - const folders = annotate(program.command("folders"), { effects: LOCAL_READ }).description(text.folders) + const folders = notLocalPaths(annotate(program.command("folders"), { effects: LOCAL_READ }), "folder").description( + text.folders, + ) examples( annotate(folders.command("add"), { effects: FETCH }) .argument("", text.folderArgument) diff --git a/src/cli/documents/manifest/source.ts b/src/cli/documents/manifest/source.ts index af69c8824..54ef822d4 100644 --- a/src/cli/documents/manifest/source.ts +++ b/src/cli/documents/manifest/source.ts @@ -1,5 +1,5 @@ import { CliError, isCliError } from "@wirecat/cli-base" -import type { Pagination } from "@wirecat/cli-base/codegen" +import type { Pagination } from "@wirecat/cli-base/codegen/runtime" import type { DocumentSource, FeedlessDocumentSource, diff --git a/src/cli/early-refusal.ts b/src/cli/early-refusal.ts index e68331181..42a7e9924 100644 --- a/src/cli/early-refusal.ts +++ b/src/cli/early-refusal.ts @@ -40,10 +40,10 @@ export const refuseOfflineCommand = (action: Command, app: AppIdentity, offline: type Resolve = (flags: object, options: { env: NodeJS.ProcessEnv; needsProfile: false; readOnly: true }) => object /** - * Refuses a change on the messenger the read-only lock or the profile's level stops, before anything connects - * (SEC-62). The send guard would refuse it too, but only after the command connected and found its chat. The journal + * Refuses a change on the messenger the read-only lock or the profile's level stops, before anything connects. + * The send guard would refuse it too, but only after the command connected and found its chat. The journal * gets the shorter line this knows: the command's key and kind, and the chat only when the command was given its id. - * A preview journals nothing, and the lock refuses it as well: it answers as the write would (SEC-65). + * A preview journals nothing, and the lock refuses it as well: it answers as the write would. */ export const refuseWriteBeforeConnecting = ( action: Command, @@ -107,7 +107,7 @@ export const refuseWriteBeforeConnecting = ( * the read-only lock stops a write to the service; a command that declares no effects counts as both. `ask` is left to the write * guard, which can put the question. A saved or `--permission` key that names no command stops every keyed command; * housekeeping still runs, so `config unset` can remove it. Under the lock a non-messenger CLI still previews a - * `--dry-run`, which sends nothing (WC-PERM-12); a messenger's preview stays refused (SEC-65). + * `--dry-run`, which sends nothing (WC-PERM-12); a messenger's preview stays refused. */ export const refuseByCommandPermissions = ( action: Command, diff --git a/src/cli/effects.ts b/src/cli/effects.ts index b2e2825ae..64b83f2cf 100644 --- a/src/cli/effects.ts +++ b/src/cli/effects.ts @@ -7,7 +7,7 @@ import { stepTargets, } from "@wirecat/cli-base/commands" import type { Effects, StepInput } from "@wirecat/cli-base/standards" -import { type Command, Option } from "commander" +import { type Command, InvalidArgumentError, Option } from "commander" import { type AppIdentity, readOnlyLockOf, readOnlyRefusal } from "../ports/app.js" import { keyForCommand } from "../sends/permissions.js" import { environmentOf } from "./context.js" @@ -27,8 +27,8 @@ const AUTHORITY = new WeakMap() /** * Marks a local write that changes what a later run may do: a schedule, a setting, the recipient list, an * auto-reply, an agent's setup. `_READ_ONLY` refuses it, or an agent under the lock could hand an - * unlocked run the send it may not make itself (SEC-47). For the same reason an MCP server permits execution only where the - * profile allows `mcp.authority`, which is off until the owner turns it on (NEED-1662). + * unlocked run the send it may not make itself. For the same reason an MCP server permits execution only where the + * profile allows `mcp.authority`, which is off until the owner turns it on. * `unless` names a flag that makes the run only look (`upgrade --check`), which the lock lets through. */ export const grantsAuthority = (command: T, { unless }: { unless?: string } = {}): T => { @@ -47,6 +47,7 @@ export const changesAuthorityAt = return at !== undefined && changesAuthority(at) } +/** @experimental */ export const changesAuthorityNow = (command: Command): boolean => { if (!AUTHORITY.has(command)) return false const unless = AUTHORITY.get(command) @@ -65,6 +66,7 @@ export const logsInOrOut = (command: T): T => { return command } +/** @experimental */ export const isLogin = (command: Command): boolean => LOGIN.has(command) const KEPT_UNDER_LOCK = new WeakSet() @@ -74,6 +76,7 @@ const KEPT_UNDER_LOCK = new WeakSet() * back: what the store rebuilds from its messages (vectors, a backfill job, the mention index), a new file (a backup, * a chart, a report), or the task bookkeeping a scheduled agent does, which only adds, is undone by its pair * (merge/unmerge, claim/release) or keeps the old value in the task's history; under the lock a close only suggests. + * @experimental */ export const destroysNothing = (command: T): T => { KEPT_UNDER_LOCK.add(command) @@ -85,6 +88,7 @@ export const destroysNothing = (command: T): T => { * appends a proposal the owner decides or moves its caller's own processing mark, and nothing else. A command must * be marked `proposesOnly` **and** end with one of these paths; adding a path widens what a read-only agent can * write, so it needs its own review. + * @experimental */ export const PROPOSE_COMMANDS = [ "messages acknowledge", @@ -95,12 +99,16 @@ export const PROPOSE_COMMANDS = [ const PROPOSES = new WeakSet() -/** Marks a command of the `propose` tier; the lock lets it through only when its path is in `PROPOSE_COMMANDS`. */ +/** + * Marks a command of the `propose` tier; the lock lets it through only when its path is in `PROPOSE_COMMANDS`. + * @experimental + */ export const proposesOnly = (command: T): T => { PROPOSES.add(command) return command } +/** @experimental */ export const isProposal = (command: Command): boolean => { if (!PROPOSES.has(command)) return false const path = pathOf(command).join(" ") @@ -112,17 +120,22 @@ export const isProposal = (command: Command): boolean => { * scheduled mail triage run. Such a command is marked `narrowsUnderLock` **and** has one of these paths, and under the * lock it narrows itself: it only adds what the owner can list and remove, and replaces nothing. Adding a path widens * what a read-only agent decides for later runs, so it needs its own review. + * @experimental */ export const LOCKED_AUTHORITY_COMMANDS = ["rules add"] as const const NARROWS = new WeakSet() -/** Marks an authority change that checks the lock itself; the lock lets it through only when its path is listed. */ +/** + * Marks an authority change that checks the lock itself; the lock lets it through only when its path is listed. + * @experimental + */ export const narrowsUnderLock = (command: T): T => { NARROWS.add(command) return command } +/** @experimental */ export const admittedUnderLock = (command: Command): boolean => { if (!NARROWS.has(command)) return false const path = pathOf(command).join(" ") @@ -176,7 +189,10 @@ export const fetchesOnly = (command: Command): boolean => { ) } -/** `fetchesOnly` by command path under `root`, as an MCP catalogue asks it; an unknown path is not one. */ +/** + * `fetchesOnly` by command path under `root`, as an MCP catalogue asks it; an unknown path is not one. + * @experimental + */ export const fetchesOnlyAt = (root: Command) => (path: readonly string[]): boolean => { @@ -192,6 +208,7 @@ const FILE_OPTION = new WeakMap() * effects stay a write, as WC-CMD-17 asks, but a run without the option only reads. An MCP tool never offers the * option, so it runs through `read`; `_READ_ONLY` refuses only a run that gives it. `option` is the option's * attribute name, `output`. + * @experimental */ export const writesFileOnlyWith = (command: T, option: string): T => { const flag = command.options.find((one) => one.attributeName() === option) @@ -252,11 +269,17 @@ export const isStoreChange = (command: Command): boolean => { export const STORE_CHANGE_REFUSAL = "change the message store" -/** ` --dry-run` where the program has it, so an example of a command that calls a provider calls nothing. */ +/** + * ` --dry-run` where the program has it, so an example of a command that calls a provider calls nothing. + * @experimental + */ export const previewFlag = (program: Command): string => program.options.some((option) => option.long === "--dry-run") ? " --dry-run" : "" -/** What a read-only refusal says the command would do: the store holds more than messages outside a messenger. */ +/** + * What a read-only refusal says the command would do: the store holds more than messages outside a messenger. + * @experimental + */ export const storeChangeRefusal = (app: Pick): string => app.messenger === false ? "change the local store" : STORE_CHANGE_REFUSAL @@ -273,8 +296,8 @@ const pathOf = (command: Command): string[] => { } /** - * A change on the messenger, judged from the command alone, so the read-only lock refuses it before anything connects - * (SEC-62): the send guard refuses it too, but only once the command has connected and found its chat. A server that runs until stopped, a call to another service and a login (no key) have rules of their own. + * A change on the messenger, judged from the command alone, so the read-only lock refuses it before anything connects: + * the send guard refuses it too, but only once the command has connected and found its chat. A server that runs until stopped, a call to another service and a login (no key) have rules of their own. */ export const changesMessenger = ( command: Command | Pick, @@ -296,12 +319,14 @@ const OTHER_SERVICE = new WeakSet() * model host. Its effects still say what leaves the machine, but serve's relay has no connection to lend it, so it * always runs here. Its description says `reaches: "other_service"`, so the commands page does not call it a change * in the messenger. + * @experimental */ export const reachesOtherService = (command: T): T => { OTHER_SERVICE.add(command) return annotate(command, { reaches: "other_service" }) } +/** @experimental */ export const isOtherServiceCall = (command: Command): boolean => OTHER_SERVICE.has(command) /** An option only the owner passes: MCP tools leave it out of their input (`mcp: false`). */ @@ -309,7 +334,21 @@ export const ownerOnlyOption = (flags: string, description: string): Option => annotateOption(new Option(flags, description), { mcp: false }) /** - * The effects a retry or an unasked step is judged on (NEED-1073): only what the service sees. Running a sync or a + * `sync --allow-deletions `: the only way past a sync's mass-deletion guard, for as many as the held pass + * named, and never offered to an MCP agent. + */ +export const allowDeletionsOption = (): Option => + ownerOnlyOption( + "--allow-deletions ", + "let this run mark deleted up to this many of what its full list no longer has, when the guard holds it", + ).argParser((text) => { + const count = Number(text) + if (!Number.isSafeInteger(count) || count < 1) throw new InvalidArgumentError("a whole number, 1 or more") + return count + }) + +/** + * The effects a retry or an unasked step is judged on: only what the service sees. Running a sync or a * cached read twice rewrites the same local rows, so a local write alone never makes either unsafe. Unknown stays * unknown, which cli-base counts as a write. */ @@ -319,12 +358,12 @@ export const judgedEffects = (effects: Effects | undefined): Effects | undefined /** * An unasked step is judged stricter than a retry: only a fetch's local write is incidental. A command that reads * nothing remotely and writes here (`server restart`, `store rebuild`) is the whole point of the step, so it waits - * to be asked (RISK-1211). + * to be asked. */ const judgedStepEffects = (effects: Effects | undefined): Effects | undefined => effects?.remote === "none" ? effects : judgedEffects(effects) -/** `stepTargets`, with each command's effects judged for running unasked. */ +/** `stepTargets`, with each command's effects judged for running unasked. @experimental */ export const judgedTargets = (root: Command): NonNullable => { const targets = stepTargets(root) return (command) => { diff --git a/src/cli/entry.ts b/src/cli/entry.ts index 3510d50b5..508075cdb 100644 --- a/src/cli/entry.ts +++ b/src/cli/entry.ts @@ -160,7 +160,10 @@ export const startCli = async (entry: CliEntry): Promise => { else if (code !== undefined) io.setExitCode(code) } -/** The first-run questions, before the command acts. A dry run writes nothing, and these write the shared config. */ +/** + * The first-run questions, before the command acts. A dry run writes nothing, and these write the shared config. + * @experimental + */ export const firstRunAt = (entry: CliEntry, io: EntryIo, headless: (command: Command) => boolean) => async (command: Command): Promise => { diff --git a/src/cli/envelope.ts b/src/cli/envelope.ts index ded268804..17dc2a7f5 100644 --- a/src/cli/envelope.ts +++ b/src/cli/envelope.ts @@ -113,6 +113,7 @@ const snake = (key: string) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLo /** * `snakeKeys` that keeps everything under the listed keys as written: a note's front matter, an email's headers — the * owner's or a provider's words, not field names. The key itself still goes snake_case; either spelling matches. + * @experimental */ export const snakeKeysKeeping = (verbatim: Iterable): ((value: unknown) => unknown) => { const kept = new Set(verbatim) @@ -158,14 +159,20 @@ const refuse = (value: unknown): never => { throw new Error(`not an answer envelope (keys: ${keys}) — build it with itemOf or listOf`) } -/** The answer with each next step judged by `targets` — for MCP, which prints no command line to check them by. */ +/** + * The answer with each next step judged by `targets` — for MCP, which prints no command line to check them by. + * @experimental + */ export const judgedAnswer = (value: T, targets: NonNullable): T => { if (!isBody(value)) return refuse(value) if (!value.next) return value return { ...value, next: withSafety(value.next, targets) } as T } -/** `meta` from the run the answer belongs to, so `runs show ` finds it. Complete unless it names an issue. */ +/** + * `meta` from the run the answer belongs to, so `runs show ` finds it. Complete unless it names an issue. + * @experimental + */ export const metaNow = (extra: Partial = {}): Meta => { const run = currentRun() return { @@ -176,7 +183,7 @@ export const metaNow = (extra: Partial = {}): Meta => { } } -/** The one place an answer gets its `meta`, for the CLI and MCP alike. */ +/** The one place an answer gets its `meta`, for the CLI and MCP alike. @experimental */ export const sealed = (value: T): T => { if (!isBody(value)) return refuse(value) const { meta, ...rest } = withoutProviderRefs(value) @@ -296,7 +303,10 @@ export const renderAnswer = ( export const renderDocument = ({ renderer }: Pick, document: object): void => renderer.result(document) -/** One thing as a sealed `{ item, meta }` answer, for a command that prints without `renderAnswer`'s steps. */ +/** + * One thing as a sealed `{ item, meta }` answer, for a command that prints without `renderAnswer`'s steps. + * @experimental + */ export const itemAnswer = (item: T) => sealed(itemOf(item)) /** Prints one thing: the envelope in `--json`, one record and the end line in `--jsonl`, the thing itself to a person. */ diff --git a/src/cli/execution.ts b/src/cli/execution.ts index ab3ef543f..45ce14954 100644 --- a/src/cli/execution.ts +++ b/src/cli/execution.ts @@ -204,6 +204,7 @@ export const execution = ( } } +/** @experimental */ export const withAbort = async (signal: AbortSignal | undefined, body: () => Promise): Promise => { if (!signal) return body() if (signal.aborted) throw signal.reason diff --git a/src/cli/findings-input.ts b/src/cli/findings-input.ts index ba8d2b2d3..6cc9ef676 100644 --- a/src/cli/findings-input.ts +++ b/src/cli/findings-input.ts @@ -51,13 +51,21 @@ const parseFindingsJson = (text: string, label: string, validate: (input: T) } return validate(decode(raw) as T) } +/** @experimental */ export const parseMeetingFindingsJson = (text: string): MeetingFindingsInput => parseFindingsJson(text, "meeting findings", validateMeetingFindings) +/** @experimental */ export const parseEvidenceFindingsJson = (text: string): FindingsInput => parseFindingsJson(text, "evidence findings", validateEvidenceFindings) -/** A mail findings batch as `mail findings add --dry-run` reads it: snake_case JSON, for `mailFindings.check`. */ +/** + * A mail findings batch as `mail findings add --dry-run` reads it: snake_case JSON, for `mailFindings.check`. + * @experimental + */ export const readMailFindingsJson = (text: string): MailFindingsInput => parseFindingsJson(text, "mail findings", (input: MailFindingsInput) => input) -/** A mail findings batch as `mail findings add` reads it: snake_case JSON, checked for shape before the store. */ +/** + * A mail findings batch as `mail findings add` reads it: snake_case JSON, checked for shape before the store. + * @experimental + */ export const parseMailFindingsJson = (text: string): MailFindingsInput => parseFindingsJson(text, "mail findings", validateMailFindings) diff --git a/src/cli/first-run.ts b/src/cli/first-run.ts index e98d09614..11a829d08 100644 --- a/src/cli/first-run.ts +++ b/src/cli/first-run.ts @@ -16,13 +16,14 @@ import { writeSetupAnswers, } from "./setup-answers.js" -/** The languages cli-core stems and has a dictionary for; each is one stemmer of its alphabet. */ +/** The languages cli-core stems and has a dictionary for; each is one stemmer of its alphabet. @experimental */ export interface FirstRunIo { ask: (prompt: string) => Promise say: (text: string) => void } +/** @experimental */ export interface FirstRun { command: string env: NodeJS.ProcessEnv @@ -43,6 +44,7 @@ const SKIPPED = new Set(["help", "guide", "completion", "mcp", "serve", "server" /** * Only a person at a terminal is asked. An agent in a real terminal passes every terminal check and would wait on * the question forever; a process locked read-only must write nothing, and every answer writes something. + * @experimental */ export const asksAtStart = (start: { headless: boolean @@ -58,7 +60,10 @@ export const asksAtStart = (start: { start.readOnlyLock === undefined && !SKIPPED.has(start.path[0] ?? "") -/** The system's language, as the first locale variable set names it: `LC_ALL`, `LC_MESSAGES`, `LANG`, `LANGUAGE`. */ +/** + * The system's language, as the first locale variable set names it: `LC_ALL`, `LC_MESSAGES`, `LANG`, `LANGUAGE`. + * @experimental + */ export const systemLanguage = (env: NodeJS.ProcessEnv): string | undefined => { const named = [env.LC_ALL, env.LC_MESSAGES, env.LANG, ...(env.LANGUAGE ?? "").split(":")] .map((value) => value?.trim()) @@ -232,6 +237,7 @@ const answersAt = (path: string): SetupAnswers => { /** * The questions every WireCat tool shares, asked once for all of them: the answers go to the shared config * file, the languages to the store. Only this, at a terminal, writes the permission answer. + * @experimental */ export const askSetupQuestions = async (run: FirstRun): Promise => { const path = sharedConfigPath(storePath(run.env), run.env) @@ -254,6 +260,7 @@ export const askSetupQuestions = async (run: FirstRun): Promise => { * The first-run step a tool runs before each command: asks when `asksAtStart` says so, and lets the command run * whatever happens to the questions. `setup` asks all three again, since a refusal sends the owner there. * A tool that builds its own program gets it from `startCli` as `entry.atStart`. + * @experimental */ export const setupAtStart = async (start: { command: string diff --git a/src/cli/group-lock.ts b/src/cli/group-lock.ts index 69ae79a73..494dedc79 100644 --- a/src/cli/group-lock.ts +++ b/src/cli/group-lock.ts @@ -13,12 +13,14 @@ const keepsToGroup = new WeakSet() /** * Marks a command, and every command under it, as one that keeps to the run's account group: it scopes its reads * and writes with `scopeToGroup`. Under `_GROUP_LOCK` every other command is refused (WC-ACCT-13). + * @experimental */ export const groupAware = (command: T): T => { keepsToGroup.add(command) return command } +/** @experimental */ export const isGroupAware = (command: Command): boolean => { let top: Command | undefined for (let at: Command | null = command; at?.parent; at = at.parent) { @@ -34,6 +36,7 @@ const valuesOf = (value: unknown): string[] => /** * What a bare id names: a referenced thing's kind, a proposed action (`action`, as `actions confirm 17` takes it), or * a proposal id of the review registry (`proposal`: `17070`, `17080/f1`, `link:17`, `fact:512`). + * @experimental */ export type RefKind = SimpleReference | "action" | "proposal" @@ -45,6 +48,7 @@ const declared = new WeakMap>>() * after a kind needs no entry. Under the lock a bare value there is checked as `:`; a command that * declares nothing has any other argument value refused, since what it names is unknown (`1e0`, `+1`, `link:1`). * `{}` says no argument takes an id, so free text passes. + * @experimental */ export const refKinds = (command: T, kinds: Readonly>): T => { declared.set(command, kinds) @@ -61,6 +65,7 @@ const kindAt = (command: Command, name: string, implicit: string): RefKind | und * Every reference typed into the run: each word of each argument and option value that is a reference, and each bare * id in a position whose kind is known, as `:`. `unknown` holds every other argument value of a command * that declares no kinds. + * @experimental */ export const referencesIn = (command: Command): { references: string[]; unknown: string[] } => { const references = new Set() @@ -109,6 +114,7 @@ const pathOf = (command: Command): string => { * Under `_GROUP_LOCK`, refuses a command that does not keep to a group, and a reference whose thing belongs * only to accounts outside the group. A thing no account brought is the owner's and passes in every group, a note * written in memo included; a person passes when one of their identities is in the group. + * @experimental */ export const refuseOutsideGroup = async ( command: Command, diff --git a/src/cli/guide.ts b/src/cli/guide.ts index 8a7788436..d8231a904 100644 --- a/src/cli/guide.ts +++ b/src/cli/guide.ts @@ -4,6 +4,7 @@ import { CliError } from "@wirecat/cli-base" import { annotate } from "@wirecat/cli-base/commands" import { Command, type Option } from "commander" import type { AppIdentity } from "../ports/app.js" +import { hasOwnAction, helpOptionOf } from "./commander-internals.js" import { environmentOf, outputFor } from "./context.js" import { NO_EFFECTS } from "./effects.js" import { itemOf, listOf, renderAnswer } from "./envelope.js" @@ -270,7 +271,7 @@ const scan = (line: string): { words: string[]; live: string[]; open: boolean } const words = (line: string): string[] => scan(line).words -/** Characters in a step that a shell would act on: the person who copies it would run something else. */ +/** Characters in a step that a shell would act on: the person who copies it would run something else. @experimental */ export const shellProblems = (run: string): string[] => { const { live, open } = scan(run) return [ @@ -303,7 +304,10 @@ const isProfileWord = (word: string | undefined): boolean => { } } -/** What is wrong with one step on this program: the path, each option and its value, the arguments. Never runs it. */ +/** + * What is wrong with one step on this program: the path, each option and its value, the arguments. Never runs it. + * @experimental + */ export const checkStep = (program: Command, run: string): string[] => { const [tool, ...rest] = words(run) if (tool !== program.name()) return [`starts with "${tool ?? ""}", not ${program.name()}`] @@ -319,11 +323,11 @@ export const checkStep = (program: Command, run: string): string[] => { } // A mistyped command reads like a profile word; when nothing follows that is a command, name the first word. if (at === program) return [`no command "${rest[0] ?? ""}"`] - const help = (at as unknown as { _getHelpOption: () => Option | null })._getHelpOption() + const help = helpOptionOf(at) const beforeDashes = rest.slice(index, rest.includes("--") ? rest.indexOf("--") : undefined) if (help && beforeDashes.some((word) => word === help.long || word === help.short)) return [] // A group with an action of its own runs as typed rather than asking for one of its children. - const runsItself = (at as unknown as { _actionHandler: unknown })._actionHandler != null + const runsItself = hasOwnAction(at) if (at.commands.length > 0 && !runsItself) return [`needs one of: ${at.commands.map((one) => one.name()).join(", ")}`] for (const command of chain) silent(command) const problems: string[] = [] diff --git a/src/cli/help/command-help.ts b/src/cli/help/command-help.ts index ecae64061..c90820c9e 100644 --- a/src/cli/help/command-help.ts +++ b/src/cli/help/command-help.ts @@ -2,6 +2,7 @@ import { metaOf } from "@wirecat/cli-base/commands" import { writes } from "@wirecat/cli-base/standards" import type { Argument, Command } from "commander" import { commandPathOf, outputOf } from "../command-contract.js" +import { hasOwnAction, isHidden } from "../commander-internals.js" import { environmentOf } from "../context.js" import { takesProfile } from "../profile.js" import { commandAt } from "../steps.js" @@ -87,6 +88,7 @@ const SAMPLES: Readonly> = { const MAX_NEXT = 3 +/** @experimental */ export interface NextChoice { /** Command paths shown first, in this order: `messages context`. */ pin?: readonly string[] @@ -96,7 +98,10 @@ export interface NextChoice { const choices = new WeakMap() -/** Overrides the "Next usually" a command's help derives from types. Kept off `annotate`, like its section. */ +/** + * Overrides the "Next usually" a command's help derives from types. Kept off `annotate`, like its section. + * @experimental + */ export const nextUsually = (command: T, choice: NextChoice): T => { choices.set(command, choice) return command @@ -104,13 +109,12 @@ export const nextUsually = (command: T, choice: NextChoice): const kindOfArgument = (argument: Argument): Kind | undefined => ARGUMENT_KINDS[argument.name()] -const runs = (command: Command): boolean => - command.commands.length === 0 || Boolean((command as Command & { _actionHandler?: unknown })._actionHandler) +const runs = (command: Command): boolean => command.commands.length === 0 || hasOwnAction(command) /** Every command that runs: the leaves, and a group that also runs on its own, such as `doctor`. */ const leaves = (command: Command): Command[] => command.commands - .filter((child) => !(child as Command & { _hidden?: boolean })._hidden) + .filter((child) => !isHidden(child)) .flatMap((child) => [...(runs(child) ? [child] : []), ...leaves(child)]) const rootOf = (command: Command): Command => { @@ -214,6 +218,7 @@ const withProfile = (command: Command, example: string): string => { : example } +/** @experimental */ export interface CommandHelp { /** Empty when the command declares no output entity: its description already says what it does. */ returns: string @@ -223,7 +228,7 @@ export interface CommandHelp { origin: "written" | "generated" } -/** Returns, Next usually and Example for one command, from its definition alone. */ +/** Returns, Next usually and Example for one command, from its definition alone. @experimental */ export const commandHelp = (command: Command): CommandHelp => { const written = metaOf(command).examples ?? [] return { @@ -236,7 +241,7 @@ export const commandHelp = (command: Command): CommandHelp => { const LABEL = 15 -/** The lines `--help` prints after a command's options. */ +/** The lines `--help` prints after a command's options. @experimental */ export const commandHelpText = (command: Command): string => { const { returns, next, examples } = commandHelp(command) const rows = (label: string, values: readonly string[]) => @@ -287,7 +292,10 @@ export const installCommandHelp = (program: Command, { profile = true }: { profi for (const command of leaves(program)) command.addHelpText("after", () => commandHelpText(command)) } -/** Which leaf commands still show a generated example, so the important ones get a written one. Report only. */ +/** + * Which leaf commands still show a generated example, so the important ones get a written one. Report only. + * @experimental + */ export const exampleReport = (program: Command): { written: string[]; generated: string[]; text: string } => { const written: string[] = [] const generated: string[] = [] diff --git a/src/cli/help/first-screen.ts b/src/cli/help/first-screen.ts index ae851248f..a00044a8a 100644 --- a/src/cli/help/first-screen.ts +++ b/src/cli/help/first-screen.ts @@ -73,6 +73,7 @@ const pointers = (program: Command, cli: string, start: string | undefined, prof /** * The screen ` --help` and a bare `` show: what the tool is for, what it does that a client would not, * the other tools, and where the full list, the scenarios and the options are. It never lists every command. + * @experimental */ export const firstScreen = (program: Command, screen: FirstScreen = {}): string => { const cli = program.name() @@ -113,6 +114,7 @@ const optionsScreen = (program: Command): string => { * command's `--help`. `help options` prints the options for every command, `--help-all` the full commander help; * both are hidden, so `commands --json` and MCP do not change. For a tool that builds its own program; * `createProgram` calls it for tg, max and wa. + * @experimental */ export const installHelp = (program: Command, screen: FirstScreen = {}): Command => { let full = false diff --git a/src/cli/help/sections.ts b/src/cli/help/sections.ts index cf6aca18a..ca095f7fc 100644 --- a/src/cli/help/sections.ts +++ b/src/cli/help/sections.ts @@ -1,5 +1,6 @@ import type { Command } from "commander" +/** @experimental */ export const SECTIONS = { read: "Read", write: "Write", diff --git a/src/cli/index.ts b/src/cli/index.ts index dc51d08b5..01946bad8 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -616,6 +616,7 @@ export { oauthSessionCommand, } from "./oauth-session.js" export { pagingOf, positiveCount, window, withPaging } from "./paging.js" +export { notLocalPaths } from "./path-options.js" export { type CommandPermissions, type ConditionalKey, @@ -806,15 +807,7 @@ export { upgradeCommand, watchCommand, } from "./shared-command-exports.js" -export { - assertSharedContracts, - customizeSharedCommand, - hasSharedContract, - overrideSharedContract, - type SharedContractOverride, - sharedContractOverrides, - sharedContracts, -} from "./shared-contracts.js" +export { hasSharedContract, overrideSharedContract } from "./shared-contracts.js" export { runnable, withSafety } from "./steps.js" export { type StoreInfo, sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js" export { diff --git a/src/cli/input-policy.ts b/src/cli/input-policy.ts index eb8dcef1e..dfa85a4a6 100644 --- a/src/cli/input-policy.ts +++ b/src/cli/input-policy.ts @@ -1,6 +1,8 @@ import { CliError } from "@wirecat/cli-base" +/** @experimental */ export const MAX_BUFFERED_INPUT = 16 * 1024 * 1024 +/** @experimental */ export const MAX_SECRET_INPUT = 64 * 1024 export interface InputPolicy { @@ -13,6 +15,7 @@ const policies = new WeakMap() export const inputPolicy = (input: NodeJS.ReadableStream): InputPolicy => policies.get(input) ?? {} +/** @experimental */ export const provideInputPolicy = (input: NodeJS.ReadableStream, policy: InputPolicy): (() => void) => { const previous = policies.get(input) policies.set(input, policy) diff --git a/src/cli/json-fields.ts b/src/cli/json-fields.ts index 34764ab16..10f54ac88 100644 --- a/src/cli/json-fields.ts +++ b/src/cli/json-fields.ts @@ -72,6 +72,7 @@ export interface JsonRequest { * `--json=a,b` or `--json a,b` keeps those fields, a bare `--json` all of them. The separate word is taken only when * every name in it is a field of the command's answer, so `--json chats list` and `messages list --json 111` keep * their words. Commander sees a plain `--json` either way. + * @experimental */ export const liftJson = ( argv: readonly string[], diff --git a/src/cli/list-query.ts b/src/cli/list-query.ts index 1745b3867..1e9835e4d 100644 --- a/src/cli/list-query.ts +++ b/src/cli/list-query.ts @@ -25,6 +25,7 @@ import { queryWordsAfterOptions } from "../meetings/cli/index.js" import { type ListBody, type ListInput, listOf } from "./envelope.js" import type { Settings } from "./settings.js" +/** @experimental */ export const LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md" /** `[query...]`'s help, which points at the Fields section; an MCP tool has none and says the fields instead. */ @@ -156,11 +157,14 @@ export const pagedList = ( const askable = (registry: QueryRegistry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields -/** An MCP list's `query` argument: the language the CLI list takes after its arguments. */ +/** An MCP list's `query` argument: the language the CLI list takes after its arguments. @experimental */ export const queryArgument = (registry: QueryRegistry) => v.optional(v.pipe(v.string(), v.maxLength(QUERY_LIMITS.bytes), v.description(queryDescription(registry)))) -/** The fields a native list can also leave out, `-field:value`: what `nativeTermLists` keeps under `-field`. */ +/** + * The fields a native list can also leave out, `-field:value`: what `nativeTermLists` keeps under `-field`. + * @experimental + */ export const negatableOf = (registry: QueryRegistry): string[] => askable(registry) .filter((field) => field.negatable) @@ -177,6 +181,7 @@ export const nativeTerms = (ast: QueryAst | undefined, command: string): Map` start; `from` is the first moment taken, for a reader * that takes its start. + * @experimental */ export const timeBounds = ( term: Predicate | undefined, @@ -289,11 +295,11 @@ export const timeBounds = ( } } -/** A text term as the plain words a provider searches by: `name:ana`, `name:"Ana K"`, `name:*ana*`. */ +/** A text term as the plain words a provider searches by: `name:ana`, `name:"Ana K"`, `name:*ana*`. @experimental */ export const searchText = (term: Predicate | undefined): string | undefined => term === undefined ? undefined : term.value.replace(/^\*+|\*+$/g, "") -/** A field the provider filters itself; names follow the search language, as in `search messages`. */ +/** A field the provider filters itself; names follow the search language, as in `search messages`. @experimental */ export const nativeField = (field: Omit): FieldSpec => ({ ...field, native: true }) /** A field the store filters by whole values only, as `queryTerms` reads them. */ @@ -311,5 +317,5 @@ export const termField = ( ...more, }) -/** The Fields section of a list's help, for a list that places its own `[query...]`. */ +/** The Fields section of a list's help, for a list that places its own `[query...]`. @experimental */ export const queryHelp = (registry: QueryRegistry): string => `\n${fieldsHelp(registry, LIST_QUERY_GUIDE)}` diff --git a/src/cli/listings.ts b/src/cli/listings.ts index 3c8960979..621b6c6b1 100644 --- a/src/cli/listings.ts +++ b/src/cli/listings.ts @@ -17,7 +17,7 @@ const SOURCE = termField("source", "kw", 'source:"google-drive:ana@example.com"' relation: "one account, provider:account, or every account of a provider; repeat for several", }) -/** `documents list`: what the store filters, and `text`, which the notes search answers first. */ +/** `documents list`: what the store filters, and `text`, which the notes search answers first. @experimental */ export const DOCUMENTS_LIST_QUERY = { entity: "document_entry", backend: "native", @@ -46,7 +46,7 @@ export const DOCUMENTS_LIST_QUERY = { ], } as const satisfies QueryRegistry -/** `meetings list`: the time window, and filters every row answers. */ +/** `meetings list`: the time window, and filters every row answers. @experimental */ export const MEETINGS_LIST_QUERY = { entity: "meeting_entry", backend: "native", @@ -76,8 +76,12 @@ export const MEETINGS_LIST_QUERY = { ], } as const satisfies QueryRegistry -/** Without `started_at`, the meetings list reads the last 30 days and the next 7: calls are all in the past. */ +/** + * Without `started_at`, the meetings list reads the last 30 days and the next 7: calls are all in the past. + * @experimental + */ export const MEETINGS_RECENT_DAYS = 30 +/** @experimental */ export const MEETINGS_AHEAD_DAYS = 7 const REPEATABLE = ["text", "source", "kind", "tag", "person"] @@ -110,7 +114,7 @@ const storeQueryOf = (terms: Map, fields: readonly string[] return { version: 1, language: "lucene-v1", root: { kind: "boolean", clauses, span } } } -/** `documents list`'s query and page, as `listDocuments` takes them. */ +/** `documents list`'s query and page, as `listDocuments` takes them. @experimental */ export const documentListRequest = ( words: QueryWords, { limit, page, zone = timezoneOf(), now = Date.now() }: { limit: number; page: number; zone?: string; now?: number }, @@ -150,12 +154,16 @@ const windowOf = (node: Predicate, zone: string, now: number) => { } } +/** @experimental */ export interface MeetingWindowMeta { timezone: string window: { since?: string; until?: string } } -/** `meetings list`'s query and page, as `listMeetingEntries` takes them, and the window it read for `meta`. */ +/** + * `meetings list`'s query and page, as `listMeetingEntries` takes them, and the window it read for `meta`. + * @experimental + */ export const meetingListRequest = ( words: QueryWords, { diff --git a/src/cli/local-times.ts b/src/cli/local-times.ts index 37446e052..4411fb747 100644 --- a/src/cli/local-times.ts +++ b/src/cli/local-times.ts @@ -5,7 +5,7 @@ import { type AnswerOutput, type Body, renderAnswer } from "./envelope.js" export const UTC_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/u -/** `YYYY-MM-DD HH:MM` on the wall clock of `zone`, with no offset: the answer names the zone once. */ +/** `YYYY-MM-DD HH:MM` on the wall clock of `zone`, with no offset: the answer names the zone once. @experimental */ export const wallClock = (zone: string) => { const format = new Intl.DateTimeFormat("en-CA", { timeZone: zone, @@ -31,7 +31,7 @@ export const wallClock = (zone: string) => { } } -/** Turns a UTC time into the shown one; any other text comes back as it was. */ +/** Turns a UTC time into the shown one; any other text comes back as it was. @experimental */ export type ShownTime = (value: string) => string const localised = (value: unknown, shown: ShownTime): unknown => { @@ -46,6 +46,7 @@ const localised = (value: unknown, shown: ShownTime): unknown => { * Answers as `renderAnswer` does, and a person reads every UTC time in the zone in use (`zone`, else the computer's), * with one line naming it (WC-TIME-4). A `view` builds its text with the `shown` it is given. JSON, JSONL, compact * rows and agents keep UTC (WC-TIME-2), and `next` is left alone: its args run. + * @experimental */ export const answerLocally = ( command: Command, diff --git a/src/cli/mcp-server-command.ts b/src/cli/mcp-server-command.ts index e07979d89..deac55a2b 100644 --- a/src/cli/mcp-server-command.ts +++ b/src/cli/mcp-server-command.ts @@ -17,10 +17,11 @@ import { } from "../mcp/http/state.js" import { destroysNothing, LOCAL_READ, LOCAL_WRITE } from "./effects.js" +/** @experimental */ export const MCP_HTTP_DEFAULT_PORT = 8765 const LOOKS = 120 -/** What one CLI tells `mcp server` about the server it would run. */ +/** What one CLI tells `mcp server` about the server it would run. @experimental */ export interface McpServerTarget { /** What a person types before `mcp`: `tg personal`, `memo`. */ invocation: string @@ -38,6 +39,7 @@ export interface McpServerTarget { version: string } +/** @experimental */ export interface McpServerOptions { /** How help shows the CLI before `mcp`: `tg personal`. */ example: string @@ -118,6 +120,7 @@ const clientLines = (clients: ReturnType) => * keeps a lock beside its token file (`state.ts`) with its port, address and login code, so status * survives the shell that started it, and `stop` ends only a process that carries this CLI's marker. * None of it is offered over MCP: status holds a live login code. + * @experimental */ export const mcpServerCommand = ({ example, diff --git a/src/cli/meeting-batch.ts b/src/cli/meeting-batch.ts index 8474e8697..30dbd081f 100644 --- a/src/cli/meeting-batch.ts +++ b/src/cli/meeting-batch.ts @@ -134,7 +134,7 @@ const handlers = (reader: MeetingBatchReader, meta: () => Meta, limit: number): ] } -/** `limit` is a search's page without `--limit`: the profile's `defaults.limit`. */ +/** `limit` is a search's page without `--limit`: the profile's `defaults.limit`. @experimental */ export const prepareMeetingBatch = (input: string, reader: MeetingBatchReader, meta: () => Meta, limit: number) => prepareBatch(input, handlers(reader, meta, limit)) @@ -153,6 +153,7 @@ const textResult = (result: BatchResult, format: "text" | "markdown") => { .join("\n") return `${title}\n${hits.map(hitText).join("\n\n")}\nCoverage: ${JSON.stringify({ page: "page" in body ? body.page : undefined, missing: body.missing, meta: body.meta })}\n` } +/** @experimental */ export const formatMeetingBatch = (report: BatchReport, format: "text" | "markdown") => report.items.map((result) => textResult(result, format)).join("\n") diff --git a/src/cli/meeting-evidence-answer.ts b/src/cli/meeting-evidence-answer.ts index 285c49df6..83d094202 100644 --- a/src/cli/meeting-evidence-answer.ts +++ b/src/cli/meeting-evidence-answer.ts @@ -18,10 +18,10 @@ export const mapEvidence = (evidence: MeetingEvidencePacket) => ({ items: evidence.items.map(mapCue), }) -/** `meetings evidence`: the `meeting_evidence` entity. */ +/** `meetings evidence`: the `meeting_evidence` entity. @experimental */ export const meetingEvidenceItem = (evidence: MeetingEvidencePacket) => snakeKeys(mapEvidence(evidence)) -/** `meetings context`: the `meeting_person_context` entity. */ +/** `meetings context`: the `meeting_person_context` entity. @experimental */ export const meetingPersonContextItem = (context: PersonMeetingContext) => snakeKeys({ ...context, diff --git a/src/cli/meeting-meaning-command.ts b/src/cli/meeting-meaning-command.ts index 90922cfac..e54fff58a 100644 --- a/src/cli/meeting-meaning-command.ts +++ b/src/cli/meeting-meaning-command.ts @@ -100,6 +100,7 @@ const withMeaningOptions = (command: Command): Command => .option("--max-text-bytes ", "by meaning: most transcript text to read (default 4 MiB)", count) }) +/** @experimental */ export interface MeetingCombinedSearchDeps { words: () => Promise meaning: () => Promise @@ -111,11 +112,13 @@ export interface MeetingCombinedSearchDeps { examples: string[] } +/** @experimental */ export type MeetingSearchRun = (query: string, options: SearchFlags, command: Command) => Promise /** * `search meetings` by words, and by words and meaning ranked together with `--model`, for any host of stored * meetings. Returns the run, so a host's saved searches replay it. + * @experimental */ export const addMeetingCombinedSearchCommand = ( program: Command, @@ -166,6 +169,7 @@ export const addMeetingCombinedSearchCommand = ( return execute } +/** @experimental */ export interface MeetingEmbeddingCommandDeps { meaning: () => Promise /** The local model used without `--model`: the `models` command's default text model. */ @@ -180,6 +184,7 @@ export interface MeetingEmbeddingCommandDeps { /** * `meetings embed`: previews the vectors a search by meaning needs, and `--yes` splits every transcript and embeds one * batch of the passages without a vector; run it again for the next batch. + * @experimental */ export const addMeetingEmbeddingCommand = (program: Command, deps: MeetingEmbeddingCommandDeps): void => { const meetings = program.commands.find((command) => command.name() === "meetings") diff --git a/src/cli/meeting-passage-text.ts b/src/cli/meeting-passage-text.ts index d0db0a944..0ae226136 100644 --- a/src/cli/meeting-passage-text.ts +++ b/src/cli/meeting-passage-text.ts @@ -7,6 +7,7 @@ import { runMarkOf, withUntrustedMarked } from "./untrusted-marks.js" * The passage as the host prints it from `meetings passage`'s `output`, or as `callMeetingPassageTool` answers it: in a scheduled agent's run, text and Markdown * are formatted again from the marked cues. The meetings module cannot read the run's mark; JSON is marked by * `renderAnswer`. + * @experimental */ export const passageForRun = ( command: Command, diff --git a/src/cli/meeting-preparation-answer.ts b/src/cli/meeting-preparation-answer.ts index 129bff6a8..83c49d351 100644 --- a/src/cli/meeting-preparation-answer.ts +++ b/src/cli/meeting-preparation-answer.ts @@ -21,6 +21,7 @@ const mapMeeting = (meeting: MeetingPreparation["items"][number]["meeting"]) => updatedAt: at(meeting.updatedAt), } } +/** @experimental */ export const meetingPreparationAnswer = (packet: MeetingPreparation) => { const candidate = packet.upcoming.candidate const mapped = snakeKeys({ diff --git a/src/cli/meeting-preparation-read.ts b/src/cli/meeting-preparation-read.ts index 51a9c09df..43d8d09aa 100644 --- a/src/cli/meeting-preparation-read.ts +++ b/src/cli/meeting-preparation-read.ts @@ -20,6 +20,7 @@ const bound = (name: keyof typeof MEETING_PREPARATION_LIMITS) => { const { min, max } = MEETING_PREPARATION_LIMITS[name] return v.optional(v.pipe(v.number(), v.integer(), v.minValue(min), v.maxValue(max))) } +/** @experimental */ export const meetingPreparationInput = v.strictObject({ series_id: v.pipe(v.string(), v.minLength(1), v.maxLength(1000)), communications: v.optional( @@ -38,6 +39,7 @@ export const meetingPreparationInput = v.strictObject({ // A date alone ends a window at the end of that day and starts one at its start. const instant = (value: string | undefined, fallback: number, field: string, now: number, end = false) => value === undefined ? fallback : momentOf(value, field, now, { end }) +/** @experimental */ export const readMeetingPreparation = async ( read: MeetingPreparationReader, input: unknown, diff --git a/src/cli/meeting-project-candidates-read.ts b/src/cli/meeting-project-candidates-read.ts index 142bb424a..9c75897a1 100644 --- a/src/cli/meeting-project-candidates-read.ts +++ b/src/cli/meeting-project-candidates-read.ts @@ -17,6 +17,7 @@ export const meetingProjectCandidatesInput = v.strictObject({ cursor: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(200))), }) +/** @experimental */ export const readMeetingProjectCandidates = async ( read: StoredMeetingProjectCandidateReader, input: unknown, diff --git a/src/cli/meeting-results.ts b/src/cli/meeting-results.ts index ead00d73f..fd515b8bf 100644 --- a/src/cli/meeting-results.ts +++ b/src/cli/meeting-results.ts @@ -21,7 +21,10 @@ const publicValue = (value: unknown, key = ""): unknown => { return value } -/** Store IDs stay numeric below the CLI; public receipts use the shared string IDs and validated wire fields. */ +/** + * Store IDs stay numeric below the CLI; public receipts use the shared string IDs and validated wire fields. + * @experimental + */ export const meetingResultItem = (entity: keyof typeof MEETING_RESULT_ENTITIES, value: unknown): unknown => { const parsed = v.safeParse(MEETING_RESULT_ENTITIES[entity] as v.GenericSchema, publicValue(snakeKeys(value))) if (!parsed.success) { diff --git a/src/cli/meeting-series-inventory-read.ts b/src/cli/meeting-series-inventory-read.ts index 53419f9af..8544dd8ee 100644 --- a/src/cli/meeting-series-inventory-read.ts +++ b/src/cli/meeting-series-inventory-read.ts @@ -9,6 +9,7 @@ import { import { momentOf } from "../services/moment.js" import { itemOf, metaNow, sealed, snakeKeys } from "./envelope.js" +/** @experimental */ export type MeetingSeriesInventoryReader = ( request: MeetingSeriesInventoryRequest, ) => Promise @@ -38,6 +39,7 @@ export const boundMeetingSeriesInventoryItem = (item: { limits: { bytes: number "meeting inventory bytes cannot fit the provider page; increase bytes or lower limit", ) } +/** @experimental */ export const readMeetingSeriesInventory = async ( read: MeetingSeriesInventoryReader, input: unknown, diff --git a/src/cli/meeting-tags-command.ts b/src/cli/meeting-tags-command.ts index 1552cf3aa..2b6f742ca 100644 --- a/src/cli/meeting-tags-command.ts +++ b/src/cli/meeting-tags-command.ts @@ -9,6 +9,7 @@ import { LOCAL_READ, LOCAL_WRITE, NO_EFFECTS } from "./effects.js" import { type Body, itemOf, listOf, renderAnswer } from "./envelope.js" import { queryTerms, termField, withQuery } from "./list-query.js" +/** @experimental */ export interface MeetingTagsCommandDeps { /** The tags of the profile's own meetings account; opened when the command runs. */ read: () => Promise @@ -53,6 +54,7 @@ const groupOf = (program: Command): Command => * `tags add|remove|list` for a host whose things to label are its meetings, such as pbx's phone calls. A host of * chats mounts the messenger's `tags` instead. `--matching` takes `search meetings`'s query, so "search, then tag" is * one command, and a rerun after new calls are transcribed marks only those. + * @experimental */ export const addMeetingTagsCommand = (program: Command, deps: MeetingTagsCommandDeps): void => { const tags = groupOf(program) diff --git a/src/cli/messenger/admin-folders-command.ts b/src/cli/messenger/admin-folders-command.ts index fb7defa83..2f5a6fab2 100644 --- a/src/cli/messenger/admin-folders-command.ts +++ b/src/cli/messenger/admin-folders-command.ts @@ -7,6 +7,7 @@ import type { FolderRulesEdit } from "../../services/folders.js" import { REMOTE_READ, REMOTE_WRITE } from "../effects.js" import { itemOf, renderAnswer } from "../envelope.js" import { listQuery, typedQuery, unfilteredQuery, withQuery } from "../list-query.js" +import { notLocalPaths } from "../path-options.js" import { folderAnswer, lines, renderItem, wholeList } from "./chat-answers.js" import { type Messenger, messengerContext } from "./context.js" @@ -64,7 +65,9 @@ const FOLDERS_QUERY = unfilteredQuery("folder", folderEntity) /** `chats folders …`, in max-cli's words. */ export const foldersCommand = (messenger: Messenger): Command => { - const folders = annotate(new Command("folders"), { offline: false }).description("your chat folders") + const folders = notLocalPaths(annotate(new Command("folders"), { offline: false }), "folder", "folders").description( + "your chat folders", + ) folders.addCommand( withQuery( annotate(new Command("list"), { effects: REMOTE_READ }).description( diff --git a/src/cli/messenger/admin-moderation-command.ts b/src/cli/messenger/admin-moderation-command.ts index a217b54cb..35a25c51e 100644 --- a/src/cli/messenger/admin-moderation-command.ts +++ b/src/cli/messenger/admin-moderation-command.ts @@ -47,7 +47,7 @@ export const rulesCommand = (messenger: Messenger): Command => { } /** - * **The one command that acts on a group's rules** (max-cli `NEED-306`): typing it is the consent + * **The one command that acts on a group's rules**: typing it is the consent * for what the rules name, within each action's level in the group's rules. Nothing watches groups * in the background. */ diff --git a/src/cli/messenger/ask.ts b/src/cli/messenger/ask.ts index 97e63b264..588b17802 100644 --- a/src/cli/messenger/ask.ts +++ b/src/cli/messenger/ask.ts @@ -55,7 +55,7 @@ export const answerOf = async (command: Command, question: string): Promise { chatArgument: "a chat", accountOf: () => ({ provider: "chat", account: "500" }), } + const env = sandbox() + // Built before the clock starts: a new store runs every migration, which is not the wait this measures. + await (await openStore({ path: env.MESSAGING_STORE })).close() const streams = captureStreams() const started = performance.now() const code = await run( ["account", "show", "--json"], { app, commands: () => [accountCommand(messenger)] }, - { streams, tty: false, env: sandbox(), closeWaitMs: 10, rekeyPacing: { lockMs: 1000, pauseMs: 0 } }, + { streams, tty: false, env, closeWaitMs: 10, rekeyPacing: { lockMs: 1000, pauseMs: 0 } }, ) expect(code).toBe(0) diff --git a/src/cli/messenger/context.ts b/src/cli/messenger/context.ts index 092dc5966..37256a0ca 100644 --- a/src/cli/messenger/context.ts +++ b/src/cli/messenger/context.ts @@ -331,6 +331,7 @@ export interface Messenger extends ServiceMessenger { /** * The messenger's connection — or, in a command serve runs for a client, serve's own, borrowed. Every connect * goes through here, so a relayed command never opens a second connection. + * @experimental */ export const connectFor = ( command: Command, @@ -356,7 +357,7 @@ export type ReadConnection = (work: (adapter: MessengerAdapter) => Promise export interface MessengerContext extends BaseContext { profile: string - /** Run for an agent over MCP, where a write at level `ask` goes ahead: nobody is at a terminal (NEED-773). */ + /** Run for an agent over MCP, where a write at level `ask` goes ahead: nobody is at a terminal. */ agent: boolean stdin: NodeJS.ReadableStream & { isTTY?: boolean } /** The local speech recognizer, where a test hands one in. */ diff --git a/src/cli/messenger/doctor-command.ts b/src/cli/messenger/doctor-command.ts index 78a87086f..f27eb66ca 100644 --- a/src/cli/messenger/doctor-command.ts +++ b/src/cli/messenger/doctor-command.ts @@ -59,6 +59,7 @@ export const doctorCommand = (messenger: Messenger): Command => { return command } +/** @experimental */ export const DOCTOR_DEEP_OPTION = "also read every page of the store and check every search index (about 30 s for 6 GB); without it, only the file header and schema" @@ -69,7 +70,7 @@ const summaryOptions = (command: Command, app: { command: string; version: strin version: app.version, }) -/** The plain-words account of a damaged store, under the answer. */ +/** The plain-words account of a damaged store, under the answer. @experimental */ export const damageNotes = (store: unknown): string[] => { const { damage, damage_mark_cleared: cleared } = (store as diff --git a/src/cli/messenger/inbox.ts b/src/cli/messenger/inbox.ts index f31c58929..cebe20820 100644 --- a/src/cli/messenger/inbox.ts +++ b/src/cli/messenger/inbox.ts @@ -21,13 +21,13 @@ export const PARTIAL_NOTE = "the messenger did not list every chat, and did not say how many it left out; one may have more" /** - * Two questions, one command — max-cli's `inbox` (its `NEED-171`). + * Two questions, one command — max-cli's `inbox`. * * **Plain `inbox` — what is unread**, as the messenger counts it. For a person. * * **`--new` — what arrived since the last check.** For a scheduled run: the point it starts from is * kept per chat and moved only by a run that printed, so each message shows once, and a run that - * fails shows it again rather than never (max-cli `NEED-162`). `lastCheckAt`, the first check, stays + * fails shows it again rather than never. `lastCheckAt`, the first check, stays * put: it is where a chat never read yet starts, so a chat skipped by one run is not lost. * `date>2h` is a one-off look from a time of your choosing and leaves the points where they were. */ diff --git a/src/cli/messenger/lacks.ts b/src/cli/messenger/lacks.ts index 6c78e94e9..873f6ff38 100644 --- a/src/cli/messenger/lacks.ts +++ b/src/cli/messenger/lacks.ts @@ -1,6 +1,7 @@ import { CliError } from "@wirecat/cli-base" import type { Command } from "commander" import type { MessengerAdapter } from "../../ports/messenger.js" +import { hide, isHidden } from "../commander-internals.js" type Need = readonly [method: keyof MessengerAdapter, what: string] @@ -8,6 +9,7 @@ type Need = readonly [method: keyof MessengerAdapter, what: string] * The commands that do one thing only an adapter method can, with the words `capability()` refuses in. * `Messenger.lacks` names the methods a messenger never has, so these refuse before anything connects; * a test holds each entry to the live refusal it stands in for. + * @experimental */ export const COMMAND_NEEDS: Readonly> = { "account update": ["updateProfile", "change the profile"], @@ -68,8 +70,6 @@ export const refuseLacking = (messenger: Lacking | undefined, path: readonly str if (need) throw new CliError("validation_error", `this messenger cannot ${need[1]}`) } -type Hideable = Command & { _hidden: boolean } - /** * Hides under `group` each command whose one method this messenger can `never` have, from help, `commands` and MCP; * typed anyway, it still refuses. A group left with nothing in sight is hidden too, since an empty group lists @@ -80,10 +80,9 @@ export const hideNever = (messenger: Lacking, group: T): T => for (const child of command.commands) { const at = [...path, child.name()] const need = COMMAND_NEEDS[at.join(" ")] - if (need && messenger.never?.includes(need[0])) (child as Hideable)._hidden = true + if (need && messenger.never?.includes(need[0])) hide(child) walk(child, at) - if (child.commands.length > 0 && child.commands.every((one) => (one as Hideable)._hidden)) - (child as Hideable)._hidden = true + if (child.commands.length > 0 && child.commands.every(isHidden)) hide(child) } } walk(group, [group.name()]) diff --git a/src/cli/messenger/mcp-command.ts b/src/cli/messenger/mcp-command.ts index 5e754f31f..4933e902f 100644 --- a/src/cli/messenger/mcp-command.ts +++ b/src/cli/messenger/mcp-command.ts @@ -23,7 +23,7 @@ import { nextStep } from "../steps.js" import { recalledAccount } from "./accounts.js" import { type Messenger, type MessengerContext, messengerContext } from "./context.js" -/** Where the running CLI really lives; a test hands in its own. */ +/** Where the running CLI really lives; a test hands in its own. @experimental */ export interface McpEnvironment extends BaseEnvironment { mcp?: { scriptPath?: string; execPath?: string } system?: ServerSystem @@ -60,7 +60,7 @@ export interface ProfileSet { } /** - * The profile or profiles an MCP server is for, always named (NEED-1881, WC-MCP-9): a leading profile, or + * The profile or profiles an MCP server is for, always named (WC-MCP-9): a leading profile, or * `--profiles` with a list or `all`. Neither, or both, is refused with the profiles on this computer. `--profiles` * takes the place of `_PROFILE`; under `_PROFILE_LOCK` it may name the locked profile only * (WC-ACCT-5). @@ -132,7 +132,10 @@ const withProfiles = (command: Command): Command => "serve several profiles from one server instead of one: names, comma-separated, or all for every profile", ) -/** Where `mcp serve --http` keeps the hashes of the tokens it issued — per profile, in the state folder. */ +/** + * Where `mcp serve --http` keeps the hashes of the tokens it issued — per profile, in the state folder. + * @experimental + */ export const httpTokenFile = (app: AppIdentity, profile: string, env: NodeJS.ProcessEnv): string => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "mcp-http", `${profile}.json`) @@ -147,6 +150,7 @@ const withFlags = (command: Command, example: string): Command => * What the `mcp` group needs of the CLI it serves. A messenger serves through its one connection (`messengerHost`); * a CLI that is not a messenger through its own program (`appMcpCommand`). The commands, flags and answers are the * same in both, so every WireCat CLI has one `mcp`. + * @experimental */ export interface McpHost { app: AppIdentity @@ -688,6 +692,7 @@ const VERSION_MANAGER = /[\\/](\.nvm|nvm|\.fnm|fnm|fnm_multishells|\.volta|volta * keyring entry and the store, so a server without them would answer "no session" or search another * store. So is `XDG_RUNTIME_DIR`: the keyring is reached through it, and an MCP client that starts * servers with a trimmed environment leaves it out (measured 2026-09-28). Credentials are never copied. + * @experimental */ export const serverEntry = ( app: AppIdentity, diff --git a/src/cli/messenger/message-items.ts b/src/cli/messenger/message-items.ts index 0925283cb..8ded90d32 100644 --- a/src/cli/messenger/message-items.ts +++ b/src/cli/messenger/message-items.ts @@ -14,9 +14,10 @@ import type { MessengerAdapter } from "../../ports/messenger.js" import type { AccountKey } from "../../store/store.js" import type { Messenger, MessengerContext } from "./context.js" +/** @experimental */ export type MessageItem = v.InferOutput -/** What a read hands over: a message, sometimes found by a search, heard, or the anchor of a window. */ +/** What a read hands over: a message, sometimes found by a search, heard, or the anchor of a window. @experimental */ export type ReadMessage = Message & Partial> & { locator?: string @@ -69,6 +70,7 @@ const mailPerson = ({ name, address, ref }: MailPerson) => ({ name, address, ref /** * A message as every command answers it. The ref is the message's locator: the one a store hit carries, else * built from the account that read it. What only the adapter needs (`providerRef`) stays behind. + * @experimental */ export const messageItem = (message: ReadMessage, reader: AccountKey): MessageItem => { const { provider, account } = message.locator === undefined ? reader : parseLocator(message.locator) diff --git a/src/cli/messenger/messages-delete-command.ts b/src/cli/messenger/messages-delete-command.ts index 48fdcfdfa..fb5e28106 100644 --- a/src/cli/messenger/messages-delete-command.ts +++ b/src/cli/messenger/messages-delete-command.ts @@ -11,7 +11,7 @@ import { type Messenger, messengerContext } from "./context.js" /** * Deletes without a question at the default level, `allow` (owner, 2026-11-14); a profile at `ask` gets the * question, and `--allow-dangerous` is the yes. For everyone only - * with `--for-everyone` (max-cli `NEED-239`), and never for an agent (NEED-1423). + * with `--for-everyone`, and never for an agent. */ export const deleteCommand = (messenger: Messenger): Command => { const command = annotate(new Command("delete"), { diff --git a/src/cli/messenger/report.ts b/src/cli/messenger/report.ts index 00d489da1..d83a3c857 100644 --- a/src/cli/messenger/report.ts +++ b/src/cli/messenger/report.ts @@ -9,6 +9,7 @@ import type { SendEntry } from "../../sends/journal.js" const RECENT_SENDS = 20 +/** @experimental */ export interface Report> { createdAt: string /** What `doctor --json` answers — versions, paths, counts and the messenger's own checks. */ @@ -19,7 +20,7 @@ export interface Report> { sends: SendEntry[] } -/** Optional technical context supplied by a consumer; it is redacted with the rest of the report. */ +/** Optional technical context supplied by a consumer; it is redacted with the rest of the report. @experimental */ export interface ReportContext { createdAt?: never doctor?: never @@ -57,6 +58,7 @@ const EVENT_FIELDS = [ * **Everything a report holds is already free of content** — the doctor, the run log and the send * journal are built that way. Two things are added: every id becomes a label, and the home * directory is hidden, since paths name the person's account on this machine. + * @experimental */ export const buildReport = >({ doctor, @@ -172,6 +174,7 @@ const labelled = (entry: SendEntry, label: (id: string) => string): SendEntry => return copy as unknown as SendEntry } +/** @experimental */ export const reportFileName = (app: string, now: Date): string => `${app}-report-${now .toISOString() diff --git a/src/cli/messenger/search-answers.ts b/src/cli/messenger/search-answers.ts index 0236e5c03..d474b6443 100644 --- a/src/cli/messenger/search-answers.ts +++ b/src/cli/messenger/search-answers.ts @@ -15,7 +15,6 @@ import { MAX_SEARCH_OFFSET } from "../../services/messages-archive-search.js" import type { MeaningSkipped } from "../../services/messages-discovery.js" import type { FoundNote, NotesFoundOf } from "../../services/notes-search.js" import type { SearchAllFound, SearchAllItem } from "../../services/search-all.js" -import type { SearchAllIncludingMeetingsFound } from "../../services/search-all-deprecated.js" import type { StoredHistorySkip } from "../../store/store.js" import { type ListBody, listOf } from "../envelope.js" import { nextStep } from "../steps.js" @@ -26,8 +25,11 @@ import { historyLimitGaps } from "./history-gaps.js" export const SOURCE_SEARCHED = ["messages", "notes", "events", "meetings"] as const export type SourceSearched = (typeof SOURCE_SEARCHED)[number] +/** @experimental */ export type MessageHitItem = InferOutput<(typeof ENTITIES)["message.hit"]> +/** @experimental */ export type NoteHitItem = InferOutput<(typeof ENTITIES)["note.hit"]> +/** @experimental */ export type HitItem = InferOutput<(typeof ENTITIES)["hit"]> const nonEmpty = (list: T[]): T[] | undefined => (list.length > 0 ? list : undefined) @@ -60,6 +62,7 @@ export const MAIL_HIT_UNTRUSTED = [ "email.reply_addresses.name", ] +/** @experimental */ export const messageHitItem = (hit: FoundMessage, query = ""): MessageHitItem => { const at = parseLocator(hit.locator) const around = hit.thread?.items ?? hit.context @@ -184,6 +187,7 @@ const chatGaps = (rows: ChatCoverage[], since?: string): { next: NextStep[]; mis /** * What the archive lacked for this answer, and the step that would fill it. From a search's coverage, or from the * chats an answer is about (`since` is the start of the window it was asked for). + * @experimental */ export const coverageGaps = ( found: Pick | ChatCoverage[], @@ -296,7 +300,7 @@ export interface Paging { archiveOnly?: boolean } -/** "showing 20 of 144", for the human view under a page of hits; `+` when the total is a lower bound. */ +/** "showing 20 of 144", for the human view under a page of hits; `+` when the total is a lower bound. @experimental */ export const shownOf = (shown: number, offset: number, total: SearchTotal | undefined): string | undefined => total === undefined || shown === 0 ? undefined @@ -334,6 +338,7 @@ export const messagesAnswer = ( */ const DOCUMENT_HIT_UNTRUSTED = ["title", "excerpt"] +/** @experimental */ export const noteHitItem = (hit: FoundNote): NoteHitItem => defined({ ...hit, untrusted: hit.kind === "document" ? DOCUMENT_HIT_UNTRUSTED : undefined }) @@ -362,6 +367,7 @@ const ALL_HIT_UNTRUSTED: Record = { ...BUSINESS_UNTRUSTED, } +/** @experimental */ export const allHitItem = (item: SearchAllItem): HitItem => item.kind === "meeting" ? { @@ -444,10 +450,10 @@ export const notesAnswer = ( meta: metaOf(found.accounts, found.skipped), }) -/** `search all`, CLI and MCP alike. A meeting account whose index is still being built says so. */ +/** `search all`, CLI and MCP alike. A meeting account whose index is still being built says so. @experimental */ export const allAnswer = ( command: string, - found: SearchAllFound | SearchAllIncludingMeetingsFound, + found: SearchAllFound, { limit, page, again }: Paging, exact = false, skips: StoredHistorySkip[] = [], diff --git a/src/cli/messenger/searches-command.ts b/src/cli/messenger/searches-command.ts index fa1506614..2331af3a7 100644 --- a/src/cli/messenger/searches-command.ts +++ b/src/cli/messenger/searches-command.ts @@ -25,7 +25,10 @@ const line = ({ id, name, command, params, runs, lastRunAt }: StoredSearch) => lastRunAt?.slice(0, 16).replace("T", " ") ?? "never run", ].join(" ") -/** `searches list` takes a query over the saved search fields, none of them a filter: the list is short and whole. */ +/** + * `searches list` takes a query over the saved search fields, none of them a filter: the list is short and whole. + * @experimental + */ export const SEARCHES_QUERY = unfilteredQuery("saved_search", savedSearch) /** Saved searches and the history of `search messages` and `stats messages show`, in the local store only. */ diff --git a/src/cli/messenger/serve-command.ts b/src/cli/messenger/serve-command.ts index fe70685c1..cc5d38f44 100644 --- a/src/cli/messenger/serve-command.ts +++ b/src/cli/messenger/serve-command.ts @@ -41,7 +41,7 @@ const CURRENT_EVERY_MS = 60_000 /** * Keeps the store current: every new message, edit, deletion and reaction, and on start what arrived * while nothing listened. **One per profile**, held by a lock file; a lock whose process is gone is - * taken over. Started by a person, a service unit or `server start` — never by itself (NEED-9). + * taken over. Started by a person, a service unit or `server start` — never by itself. */ export const serveCommand = (messenger: Messenger): Command => { const command = annotate(new Command("serve"), { diff --git a/src/cli/messenger/serve-members.ts b/src/cli/messenger/serve-members.ts index f5f503184..7c9f11d0c 100644 --- a/src/cli/messenger/serve-members.ts +++ b/src/cli/messenger/serve-members.ts @@ -2,10 +2,12 @@ import { failureKey } from "../../errors/failures.js" import type { AccountKey, MessageStore } from "../../store/store.js" import type { ServeNotice } from "./serve-notice.js" -/** After connecting, `serve` waits this long before its first member fetch: catch-up comes first. */ +/** After connecting, `serve` waits this long before its first member fetch: catch-up comes first. @experimental */ export const FIRST_FETCH_MS = 60_000 +/** @experimental */ export const DAY_MS = 86_400_000 +/** @experimental */ export interface MemberFetches { /** Starts the daily round; a second call is ignored. */ start(): void @@ -17,6 +19,7 @@ export interface MemberFetches { /** * `serve`'s daily fetch of every tracked chat's member list, one chat after another, each under the fetch's * own page budget and pause. A chat already fetched today is skipped, so a restart does not fetch it again. + * @experimental */ export const memberFetches = ({ withStore, diff --git a/src/cli/messenger/serve-outdated.ts b/src/cli/messenger/serve-outdated.ts index 05b84d648..cc4eb9ac1 100644 --- a/src/cli/messenger/serve-outdated.ts +++ b/src/cli/messenger/serve-outdated.ts @@ -3,9 +3,13 @@ import { dirname, join } from "node:path" import { fileSchemaOf, SPEAKS, writableBy } from "../../store/compatibility.js" import { openSqlite } from "../../store/store.js" +/** @experimental */ export const OUTDATED_CHECK_MS = 60_000 -/** The folder of the package this process was started from, when its `package.json` still names `running`. */ +/** + * The folder of the package this process was started from, when its `package.json` still names `running`. + * @experimental + */ export const ownPackageRoot = (running: string, script = process.argv[1]): string | undefined => { let dir: string try { @@ -40,8 +44,9 @@ const newer = (one: string, other: string): boolean => { } /** - * Why this serve should stop so its unit starts the installed build (BUG-643): the store moved past what this build + * Why this serve should stop so its unit starts the installed build: the store moved past what this build * may write, or a newer version was installed over it. A store that cannot be read now is not a reason. + * @experimental */ export const outdatedReason = async ({ command, @@ -79,7 +84,7 @@ export const outdatedReason = async ({ ) } -/** Runs `check` every `everyMs` and calls `onOutdated` once with its first reason. */ +/** Runs `check` every `everyMs` and calls `onOutdated` once with its first reason. @experimental */ export const watchOutdated = ({ check, onOutdated, diff --git a/src/cli/messenger/serve-relay.ts b/src/cli/messenger/serve-relay.ts index 6b1807c6e..d12d98803 100644 --- a/src/cli/messenger/serve-relay.ts +++ b/src/cli/messenger/serve-relay.ts @@ -49,7 +49,7 @@ export const lentConnection = ( } as unknown as MessengerAdapter) /** - * serve's side of the relay (NEED-1389): it keeps the raw connection its messenger opened and lends it to the + * serve's side of the relay: it keeps the raw connection its messenger opened and lends it to the * commands clients send it. A borrowed connection never closes serve's, never feeds the store a second time, and * listens through serve's own events instead of a second `watch`. */ diff --git a/src/cli/messenger/serve-stems.ts b/src/cli/messenger/serve-stems.ts index 3af9b3859..7d17a924e 100644 --- a/src/cli/messenger/serve-stems.ts +++ b/src/cli/messenger/serve-stems.ts @@ -2,9 +2,12 @@ import { failureKey } from "../../errors/failures.js" import type { MessageStore } from "../../store/store.js" import type { ServeNotice } from "./serve-notice.js" +/** @experimental */ export const STEMS_EVERY_MS = 30_000 +/** @experimental */ export const STEMS_SLICE_MS = 2_000 +/** @experimental */ export interface StemFills { /** Starts filling; a second call is ignored. */ start(): void @@ -17,6 +20,7 @@ export interface StemFills { * `serve`'s fill of stems still building — after an upgrade changed the default stemmers, a large store * would otherwise wait for a search or `store migrate`. A short slice per interval, so the store stays free * for everything else; it ends when the stems are ready, and never touches stems waiting for a reindex. + * @experimental */ export const stemFills = ({ withStore, diff --git a/src/cli/messenger/server-command.ts b/src/cli/messenger/server-command.ts index d47c5fbe2..7f35f96e5 100644 --- a/src/cli/messenger/server-command.ts +++ b/src/cli/messenger/server-command.ts @@ -107,7 +107,7 @@ const lockProcess = /** * `serve` in the background: `start`, `stop`, `restart`, `status`, `logs`. Without a unit, `start` * runs `serve` as a process of its own; with one — `install`, a systemd user unit or a launchd - * agent — it goes through systemd or launchd. **Nothing starts now until `start` is typed** (NEED-9): + * agent — it goes through systemd or launchd. **Nothing starts now until `start` is typed**: * `install` writes the file and enables it, so it starts with every session from the next login (or boot, * under linger) until `uninstall`. What the server does stays each CLI's; `options.process` says how to find, * start and stop it. diff --git a/src/cli/messenger/store-maintenance-command.ts b/src/cli/messenger/store-maintenance-command.ts index 33b751ae5..a4c56a197 100644 --- a/src/cli/messenger/store-maintenance-command.ts +++ b/src/cli/messenger/store-maintenance-command.ts @@ -58,6 +58,7 @@ import { import { environmentOf, outputFor } from "../context.js" import { destroysNothing, grantsAuthority, LOCAL_READ, LOCAL_WRITE } from "../effects.js" import { itemOf, renderAnswer, snakeKeys } from "../envelope.js" +import { inStoreBackups } from "../path-options.js" import { commandAt, lineOf, nextStep } from "../steps.js" import { storeInfoCommand } from "../store-info.js" import { storeRecoverCommand } from "../store-recover.js" @@ -189,6 +190,7 @@ const result = (command: Command, value: unknown, next: NextStep[] = []) => /** * Who mounts the store file's commands: a messenger, or any CLI on the shared store. Without a `provider` nothing is * said about chats. + * @experimental */ export type StoreOwner = { app: AppIdentity } & Partial> @@ -535,8 +537,13 @@ const migrateCommand = (owner: StoreOwner): Command => .description( "bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it", ) + .option( + "--no-backup", + "migrate even when no rollback copy can be written; older tools then cannot open the store again", + ) .action(async function (this: Command) { const { renderer } = outputFor(this) + const { backup = true } = this.opts<{ backup?: boolean }>() const path = storePath(environmentOf(this).env ?? process.env) if (!existsSync(path)) { result(this, { path, exists: false }) @@ -545,11 +552,12 @@ const migrateCommand = (owner: StoreOwner): Command => } const answer = await reading(path, (database) => { const from = schemaOf(database).version - migrate(database, { + const notice = migrate(database, { command: owner.app.command, version: owner.app.version, - rollback: { store: path, warn: (line) => renderer.warn(line) }, + rollback: { store: path, warn: (line) => renderer.warn(line), withoutCopy: !backup }, }) + if (notice) renderer.warn(notice) const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note)) const stemmed = buildStems(database, (note) => renderer.note(note)) const notes = buildNoteIndex(database, (note) => renderer.note(note)) @@ -668,7 +676,10 @@ const vacuumInto = async (path: string, target: string) => { const stampNow = () => new Date().toISOString().replace(/[:.]/g, "-") const backupCommand = (): Command => - destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })) + inStoreBackups( + destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })), + "file", + ) .description("copy the store into a new file, while it is in use; never overwrites a file") .argument("", "the new file") .option(...ENCRYPT_OPTION) @@ -731,7 +742,10 @@ const decryptCommand = (): Command => * `serve` runs: that opens the store on its first write, so until then it holds nothing to see. */ const restoreCommand = (owner: StoreOwner): Command => - grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })) + inStoreBackups( + grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })), + "file", + ) .summary("restore a backup and keep the current store, or roll back a breaking upgrade") .description( "put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback " + diff --git a/src/cli/messenger/stored.ts b/src/cli/messenger/stored.ts index 07ddbd7ae..5e0fd5564 100644 --- a/src/cli/messenger/stored.ts +++ b/src/cli/messenger/stored.ts @@ -18,6 +18,7 @@ import type { AccountKey, DeletionScope, IngestedVia, MessageStore } from "../.. const REKEY_PACING = { lockMs: 50, pauseMs: 25 } +/** @experimental */ export interface Saving { account: AccountKey /** Opened on the first save, not before: a command that reads nothing has no reason to touch the file. */ @@ -63,6 +64,7 @@ export interface Saving { * `resolve` is not saved: a chat found by name has no unread count or last message, and writing it * would erase what `chats list` stored. Nor are `chat` and `contact`: a card's member list is not * known to be whole, and `saveMembers` replaces the list. + * @experimental */ export const stored = ( messenger: MessengerAdapter, diff --git a/src/cli/messenger/tasks-command.ts b/src/cli/messenger/tasks-command.ts index 364821c9d..7ad822e87 100644 --- a/src/cli/messenger/tasks-command.ts +++ b/src/cli/messenger/tasks-command.ts @@ -145,6 +145,7 @@ const pairLine = (pair: TaskPair) => /** * `none` clears a date; anything else is a time ahead. Not `null`: commander stores a parser's `null` as "". With * `end`, a date alone is the end of that day: a task due on the 20th is not overdue all of the 20th. + * @experimental */ export const dateOrNone = (flag: string, { end = false }: { end?: boolean } = {}) => diff --git a/src/cli/model-catalogue-command.ts b/src/cli/model-catalogue-command.ts index c7d2f2569..57edc31ab 100644 --- a/src/cli/model-catalogue-command.ts +++ b/src/cli/model-catalogue-command.ts @@ -23,6 +23,7 @@ import { localOnlyCommand } from "./local-only-command.js" import { pictureReadingCommand } from "./picture-reading-command.js" import { harderConsentsCommand } from "./search-harder-consents-command.js" +/** @experimental */ export const MODEL_CATALOGUE_QUERY = defineQuery({ entity: "model", backend: "native", diff --git a/src/cli/oauth-session.ts b/src/cli/oauth-session.ts index 4c02fc381..d08c2f40e 100644 --- a/src/cli/oauth-session.ts +++ b/src/cli/oauth-session.ts @@ -1,5 +1,5 @@ import { CliError, isMovedRun, type KeyringStore, resolvePaths, systemKeyring } from "@wirecat/cli-base" -import type { OAuthFlow } from "@wirecat/cli-base/codegen" +import type { OAuthFlow } from "@wirecat/cli-base/codegen/runtime" import { annotate } from "@wirecat/cli-base/commands" import { hostFetch } from "@wirecat/cli-base/http" import { Command } from "commander" @@ -21,7 +21,10 @@ import type { ServiceApiManifest } from "./service-api-manifest.js" import type { GlobalFlags, ResolveOptions, Settings } from "./settings.js" import { storageOf } from "./token-session.js" -/** The authorization code flow an OpenAPI spec declares; a GraphQL service (Linear) writes the same object by hand. */ +/** + * The authorization code flow an OpenAPI spec declares; a GraphQL service (Linear) writes the same object by hand. + * @experimental + */ export const oauthFlowOf = (manifest: ServiceApiManifest, scheme?: string): OAuthFlow => { const schemes = Object.entries(manifest.securitySchemes ?? {}).filter( ([name, one]) => (scheme === undefined || name === scheme) && one.flows?.authorizationCode !== undefined, @@ -37,6 +40,7 @@ export const oauthFlowOf = (manifest: ServiceApiManifest, scheme?: string): OAut return flow } +/** @experimental */ export interface OAuthPresetOptions { /** A short word, part of the keyring account: `attio`. */ id: string @@ -53,13 +57,17 @@ export interface OAuthPresetOptions { rotating?: boolean } +/** @experimental */ export interface OAuthPreset { provider: OAuthProvider scopes: readonly string[] rotating: boolean } -/** An installed app's sign-in (authorization code with PKCE) from the flow a spec declares, and the scopes it asks. */ +/** + * An installed app's sign-in (authorization code with PKCE) from the flow a spec declares, and the scopes it asks. + * @experimental + */ export const oauthPreset = (flow: OAuthFlow, options: OAuthPresetOptions): OAuthPreset => { const known = Object.keys(flow.scopes) const unknown = options.scopes.filter((scope) => !known.includes(scope)) @@ -93,13 +101,14 @@ export const oauthPreset = (flow: OAuthFlow, options: OAuthPresetOptions): OAuth return { provider, scopes: [...options.scopes], rotating: options.rotating === true } } -/** What the CLI's entry hands `run()` beside cli-core's own; a test hands a fake service and browser. */ +/** What the CLI's entry hands `run()` beside cli-core's own; a test hands a fake service and browser. @experimental */ export interface OAuthEnvironment extends BaseEnvironment { fetch?: typeof fetch /** Gets the command, so the entry opens nothing under `--json`, `--no-input`, CI or without a terminal. */ openBrowser?: (url: string, command?: Command) => Promise } +/** @experimental */ export interface OAuthSessionOptions { app: AppIdentity resolveSettings: (flags: GlobalFlags, options?: ResolveOptions) => Settings @@ -122,6 +131,7 @@ export interface OAuthSessionOptions { * `session start | status | end | list` for a service signed in in the browser (WC-SECR-22): PKCE on the loopback, * the account checked before the tokens are kept, refreshes under one lock, and a run with moved folders that never * removes the owner's sign-in. + * @experimental */ export const oauthSessionCommand = (options: OAuthSessionOptions): Command => { const { app, providerId, service } = options diff --git a/src/cli/option-hints.ts b/src/cli/option-hints.ts index 6e0980f36..6b3b24c48 100644 --- a/src/cli/option-hints.ts +++ b/src/cli/option-hints.ts @@ -1,19 +1,18 @@ import { CliError, isCliError } from "@wirecat/cli-base" import type { Command } from "commander" import { commandPathOf } from "./command-contract.js" +import { onUnknownOption } from "./commander-internals.js" /** * A flag a command does not take, but an agent is likely to type, fails with what to type instead rather than * commander's bare "unknown option". */ export const withOptionHints = (command: Command, hints: Readonly>): Command => { - const unknown = command as unknown as { unknownOption: (flag: string) => never } - const fallback = unknown.unknownOption.bind(command) - unknown.unknownOption = (flag) => { + onUnknownOption(command, (flag, fallback) => { const hint = hints[flag.split("=")[0] as string] if (hint === undefined) return fallback(flag) return command.error(`unknown option '${flag}' — ${hint}`, { code: "commander.unknownOption" }) - } + }) return command } diff --git a/src/cli/paging.ts b/src/cli/paging.ts index 6c1548129..73635da0e 100644 --- a/src/cli/paging.ts +++ b/src/cli/paging.ts @@ -43,6 +43,7 @@ export const withPaging = (command: Command): Command => * ⚠ **A page number over a live list can repeat or skip a row.** The order is most-recent-first, * so a message arriving between page one and page two pushes somebody across the boundary. Every * CLI that pages this way has this; it is in `--help` rather than engineered away. + * @experimental */ export const window = ({ limit, page, all }: Settings): { limit?: number; offset: number } => all ? { offset: 0 } : { limit, offset: (page - 1) * limit } diff --git a/src/cli/path-options.test.ts b/src/cli/path-options.test.ts new file mode 100644 index 000000000..7578bfaec --- /dev/null +++ b/src/cli/path-options.test.ts @@ -0,0 +1,281 @@ +import { mkdirSync, mkdtempSync, symlinkSync } from "node:fs" +import { tmpdir } from "node:os" +import { basename, dirname, join } from "node:path" +import { captureStreams, resolvePaths } from "@wirecat/cli-base" +import type { ErrorObject } from "@wirecat/cli-base/standards" +import { Command } from "commander" +import { describe, expect, it } from "vitest" +import { wirecatDirectory } from "../store/path.js" +import { app, sharedProgram } from "../testing/shared-program.js" +import { addTrackerCommands } from "../tracker/cli/index.js" +import { TRACKER_WRITES } from "../tracker/writer.js" +import { fileConflictsCommand } from "./documents/file-conflicts.js" +import { addFileEditCommands } from "./documents/file-edit.js" +import { fileMirrorsCommand } from "./documents/file-mirrors.js" +import { addDocumentHistoryCommands } from "./documents/history.js" +import { addDocumentCatalogCommands } from "./documents/index.js" +import { + inStoreBackups, + isLocalPathArgument, + isLocalPathOption, + isNotLocalPath, + looksLikePath, + notLocalPaths, + refuseAgentPaths, +} from "./path-options.js" +import { createProgram, run } from "./program.js" +import { absolutePaths } from "./relay-route.js" + +const sandbox = () => { + const home = mkdtempSync(join(tmpdir(), "path-options-")) + const env = { HOME: home, USERPROFILE: home } + const store = join(wirecatDirectory(env), "wirecat.db") + return { home, env: { ...env, MESSAGING_STORE: store }, store } +} + +/** `export --output --input [dir]`, with the values given, as preAction would see them. */ +const parsed = (args: string[], shape: (command: Command) => Command = (one) => one) => { + const root = new Command("chat").exitOverride() + let seen: Command | undefined + const leaf = shape( + root + .command("export") + .option("--output ", "where") + .option("--input ", "what") + .option("--title ", "a remote path") + .option("--archive ", "where else", "/proc/self") + .argument("[dir]", "a folder"), + ).action(function (this: Command) { + seen = this + }) + root.parse(["export", ...args], { from: "user" }) + return seen ?? leaf +} + +const refusal = (args: string[], env: NodeJS.ProcessEnv, shape?: (command: Command) => Command) => { + try { + refuseAgentPaths(parsed(args, shape), app, env) + return undefined + } catch (error) { + return error as Error & { code?: string } + } +} + +describe("refuseAgentPaths: one check for every path an MCP call names", () => { + it("refuses a credential folder, by option and by argument, and lets an ordinary folder through", () => { + const { home, env } = sandbox() + const elsewhere = mkdtempSync(join(tmpdir(), "path-options-out-")) + + expect(refusal(["--output", join(home, ".ssh", "id_new")], env)).toMatchObject({ code: "permission_error" }) + expect(refusal([join(home, ".config", "autostart")], env)?.message).toMatch(/^ /) + expect(refusal(["--input", join(elsewhere, "a"), join(home, ".aws", "credentials")], env)?.message).toMatch( + /^--input /, + ) + expect(refusal(["--output", join(elsewhere, "copy.db"), elsewhere], env)).toBeUndefined() + expect(refusal(["--output", "-"], env)).toBeUndefined() + }) + + it("refuses through a link and through ..", () => { + const { home, env } = sandbox() + const elsewhere = mkdtempSync(join(tmpdir(), "path-options-out-")) + mkdirSync(join(home, ".ssh"), { recursive: true }) + symlinkSync(join(home, ".ssh"), join(elsewhere, "keys")) + + expect(refusal(["--output", join(elsewhere, "keys", "id_new")], env)).toMatchObject({ code: "permission_error" }) + expect(refusal(["--output", `${elsewhere}/inner/../../${basename(home)}/.gnupg/x`], env)).toBeDefined() + }) + + it("refuses this tool's own folders, another WireCat tool's, the WireCat folder and the store", () => { + const { env, store } = sandbox() + const own = resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }) + const other = resolvePaths({ appName: "tg-cli", prefix: "TG", env }) + + for (const place of [ + join(own.config, "config.json"), + join(own.state, "schedules", "x.json"), + join(other.config, "session"), + join(wirecatDirectory(env), "models", "x"), + store, + `${store}-wal`, + "/proc/self/environ", + ]) + expect(refusal(["--output", place], env), place).toMatchObject({ code: "permission_error" }) + }) + + it("leaves out a default the command chose, an input marked not local, and a URL", () => { + const { home, env } = sandbox() + const remote = join(home, ".ssh", "on-the-disk") + + expect(refusal([], env)).toBeUndefined() + expect(refusal(["--archive", "/proc/self"], env)).toBeDefined() + expect(refusal(["--title", remote], env, (one) => notLocalPaths(one, "title"))).toBeUndefined() + expect(refusal(["--output", "https://example.com/.ssh/x"], env)).toBeUndefined() + }) + + it("leaves out a path the owner set in the environment", () => { + const { home, env } = sandbox() + const from = (source: string) => (one: Command) => + one.option("--state-dir ", "state").setOptionValueWithSource("stateDir", join(home, ".ssh"), source) + + expect(refusal([], env, from("env"))).toBeUndefined() + expect(refusal([], env, from("cli"))).toBeDefined() + }) + + it("lets a command marked for it name the store's backups folder, and nothing else of the WireCat folder", () => { + const { env, store } = sandbox() + const backups = join(dirname(store), "backups") + const marked = (one: Command) => inStoreBackups(one, "output") + const elsewhere = mkdtempSync(join(tmpdir(), "path-options-out-")) + mkdirSync(backups, { recursive: true }) + mkdirSync(join(env.HOME, ".ssh"), { recursive: true }) + symlinkSync(join(env.HOME, ".ssh"), join(backups, "keys")) + + expect(refusal(["--output", join(backups, "copy.db")], env, marked)).toBeUndefined() + expect(refusal(["--output", join(backups, "copy.db")], env)).toBeDefined() + expect(refusal(["--output", store], env, marked)).toBeDefined() + expect(refusal(["--output", join(backups, "keys", "id")], env, marked)).toBeDefined() + expect(refusal(["--output", join(backups, "..", "wirecat.db")], env, marked)).toBeDefined() + expect(refusal(["--output", join(elsewhere, "copy.db")], env, marked)).toBeUndefined() + }) +}) + +it("serve makes only local paths absolute against the client's folder, not a folder's title", () => { + const root = notLocalPaths(new Command("chat"), "folder") + let seen: Command | undefined + root + .command("show") + .argument("") + .option("--output ") + .action(function (this: Command) { + seen = this + }) + root.parse(["show", "Work", "--output", "copy.txt"], { from: "user" }) + absolutePaths(seen as Command, "/client") + + expect(seen?.processedArgs).toEqual(["Work"]) + expect(seen?.opts()).toEqual({ output: "/client/copy.txt" }) +}) + +describe("the program applies it to MCP calls only", () => { + const call = async (argv: string[], agent: boolean) => { + const { env } = sandbox() + const streams = captureStreams() + let failure: ErrorObject | undefined + await run(argv, sharedProgram, { + streams, + tty: false, + env: { ...env, CHAT_PROFILE: "default" }, + ...(agent ? { agent: { result: () => {}, failure: (one) => (failure = one) } } : {}), + }) + return { failure, stderr: streams.stderr.join("") } + } + + it("an agent's store backup into a credential folder is refused before it runs; the owner's is not", async () => { + const target = join(mkdtempSync(join(tmpdir(), "path-options-home-")), ".ssh", "copy.db") + + const agent = await call(["store", "backup", target], true) + expect(agent.failure?.error).toMatchObject({ code: "permission_error", param: "" }) + expect(agent.failure?.error.message).toMatch(/^ .*credential folder/) + + const owner = await call(["store", "backup", target], false) + expect(owner.stderr).not.toMatch(/credential folder/) + expect(owner.stderr).toMatch(/no store at/) + }) +}) + +describe("every input named like a path is declared", () => { + const refuse = async (): Promise => { + throw new Error("not run") + } + const trees = (): Command[] => { + const disk = { command: "disk", appName: "disk-cli", envPrefix: "DISK", description: "x", version: "1.0.0" } + const files = new Command("disk").command("files") + addFileEditCommands(files, { + words: { app: "disk", remote: "disk", provider: "Disk", source: "disk" }, + output: () => undefined, + path: (input) => input, + reread: (input) => input, + stdin: () => undefined, + read: refuse, + write: refuse, + restoreFromTrash: refuse, + }) + const history = new Command("disk") + addDocumentHistoryCommands(history, { + words: { app: "disk", remote: "disk", provider: "Disk", source: "disk" }, + output: () => undefined, + run: refuse, + id: (input) => input, + }) + const catalog = new Command("disk") + addDocumentCatalogCommands(catalog, { + words: { app: "disk", remote: "disk", provider: "Disk", source: "disk" }, + output: () => undefined, + run: refuse, + id: (input) => input, + roots: () => [], + }) + const tracker = new Command("tracker") + addTrackerCommands(tracker, { app: disk, open: refuse, writes: TRACKER_WRITES }) + const never = (): never => { + throw new Error("not run") + } + return [ + createProgram(sharedProgram), + files, + history, + catalog, + tracker, + fileMirrorsCommand({ + identity: disk, + service: "Disk", + remote: "disk", + root: { place: "Disk folder", description: "the Disk folder", examples: ["/Notes ./notes", "/ ~/Disk"] }, + output: never, + profile: never, + stateDir: never, + keepForDays: never, + connect: never, + writeGuard: never, + keysOf: never, + }), + fileConflictsCommand({ + identity: disk, + remote: "disk", + output: never, + mirrors: never, + pathOf: never, + stateOf: never, + versionsOf: never, + connect: never, + }), + ] + } + const all = (command: Command): Command[] => [command, ...command.commands.flatMap(all)] + + it("as a local path, which MCP calls check, or as not local", () => { + const undeclared = trees() + .flatMap(all) + .flatMap((command) => [ + ...command.options + .filter((option) => (option.required || option.optional) && looksLikePath(option.name())) + .filter((option) => !isLocalPathOption(command, option) && !isNotLocalPath(command, option.attributeName())) + .map((option) => `${command.name()} ${option.flags}`), + ...command.registeredArguments + .filter((argument) => looksLikePath(argument.name())) + .filter((argument) => !isLocalPathArgument(command, argument) && !isNotLocalPath(command, argument.name())) + .map((argument) => `${command.name()} <${argument.name()}>`), + ]) + + expect(undeclared).toEqual([]) + }) + + it("the remote paths of the files commands are not taken for local ones", () => { + const remote = trees() + .flatMap(all) + .filter((command) => ["sheets", "documents", "catalog"].includes(command.parent?.name() ?? "")) + .flatMap((command) => command.registeredArguments.filter((argument) => isLocalPathArgument(command, argument))) + + expect(remote).toEqual([]) + }) +}) diff --git a/src/cli/path-options.ts b/src/cli/path-options.ts new file mode 100644 index 000000000..70eba51ea --- /dev/null +++ b/src/cli/path-options.ts @@ -0,0 +1,110 @@ +import { dirname, isAbsolute, join, resolve } from "node:path" +import { CliError } from "@wirecat/cli-base" +import type { Argument, Command, Option } from "commander" +import type { AppIdentity } from "../ports/app.js" +import { inside, realPathOf, refusedPlace } from "../sends/upload.js" +import { storePath } from "../store/path.js" + +const PATH_NAME = /^([a-z]+-)*(file|path|dir|directory|folder)s?$/ +const PATH_PLACEHOLDER = /[<[]([a-z]+-)*(file|path|dir|directory|folder)s?(\.\.\.)?[>\]]/ + +const NOT_LOCAL = new WeakMap>() +const IN_BACKUPS = new WeakMap>() + +const mark = (marks: WeakMap>, command: T, names: string[]): T => { + marks.set(command, new Set([...(marks.get(command) ?? []), ...names])) + return command +} + +/** + * Inputs of `command`, and of the commands under it, whose name or placeholder reads like a path but that name no file + * here: a path on the remote side, a chat folder's title, a command path. By an argument's name or an option's + * attribute name (`outputDir`). + * @experimental + */ +export const notLocalPaths = (command: T, ...names: string[]): T => mark(NOT_LOCAL, command, names) + +/** Local paths of `command` that may also name the store's own backups folder, inside the WireCat folder. */ +export const inStoreBackups = (command: T, ...names: string[]): T => mark(IN_BACKUPS, command, names) + +/** A mark on a group holds for every command under it. */ +const marked = (marks: WeakMap>, command: Command, name: string): boolean => { + for (let at: Command | null = command; at; at = at.parent) if (marks.get(at)?.has(name)) return true + return false +} + +/** An option whose value is a file or folder on this machine: its placeholder says so, and nothing marked it not. */ +export const isLocalPathOption = (command: Command, option: Option): boolean => + PATH_PLACEHOLDER.test(option.flags) && !marked(NOT_LOCAL, command, option.attributeName()) + +export const isLocalPathArgument = (command: Command, argument: Argument): boolean => + PATH_NAME.test(argument.name()) && !marked(NOT_LOCAL, command, argument.name()) + +/** An option or argument named like a path, which `isLocalPath…` must take or `notLocalPaths` must name. */ +export const looksLikePath = (name: string): boolean => + /(^|-)(file|path|dir|directory|folder)s?$/.test(name) || /^output(-|$)/.test(name) + +export const isNotLocalPath = (command: Command, name: string): boolean => marked(NOT_LOCAL, command, name) + +const isNamed = (value: string) => value !== "" && value !== "-" && !value.includes("://") + +const valuesOf = (value: unknown): string[] => + (Array.isArray(value) ? value : [value]).filter((one): one is string => typeof one === "string" && isNamed(one)) + +export interface LocalPathInput { + /** As help shows it: `--output-dir` or ``. */ + flag: string + value: string + inBackups: boolean +} + +/** + * Every file or folder on this machine the run was given, as the command's options (its parents' too) and arguments + * hold them. Only what the caller named: a default, an environment variable or a config value the owner set is left + * out. + */ +export const localPathsOf = (action: Command): LocalPathInput[] => { + const found: LocalPathInput[] = [] + for (let at: Command | null = action; at; at = at.parent) { + for (const option of at.options) { + const key = option.attributeName() + if (!isLocalPathOption(at, option) || at.getOptionValueSource(key) !== "cli") continue + const flag = option.long ?? option.flags + for (const value of valuesOf(at.getOptionValue(key))) + found.push({ flag, value, inBackups: marked(IN_BACKUPS, at, key) }) + } + } + action.registeredArguments.forEach((argument, index) => { + const value = action.processedArgs[index] + if (!isLocalPathArgument(action, argument) || value === argument.defaultValue) return + for (const one of valuesOf(value)) + found.push({ flag: `<${argument.name()}>`, value: one, inBackups: marked(IN_BACKUPS, action, argument.name()) }) + }) + return found +} + +/** + * Refuses an MCP agent's call that names a credential folder, a folder of this or another WireCat tool, or the store + * (`refusedPlace`), by its real path, so neither a link nor `..` gets past. The owner's own shell runs are not + * checked here; the commands that guard a path for them still do. + */ +export const refuseAgentPaths = (action: Command, app: AppIdentity, env: NodeJS.ProcessEnv): void => { + const backups = join(dirname(resolve(storePath(env))), "backups") + for (const { flag, value, inBackups } of localPathsOf(action)) { + if (inBackups && inside(realPathOf(value), realPathOf(backups))) continue + if (refusedPlace(value, app, env)) + throw new CliError( + "permission_error", + `${flag} ${value}: an agent's call reads and writes no credential folder, no folder of a WireCat tool and ` + + "not the message store — the owner runs it in a terminal", + { param: flag, sent: false }, + ) + } +} + +/** A path made absolute against `cwd`, the client's working folder, for a command serve runs for it. */ +export const absoluteFrom = (cwd: string, value: unknown): unknown => { + if (Array.isArray(value)) return value.map((one) => absoluteFrom(cwd, one)) + if (typeof value !== "string" || !isNamed(value) || isAbsolute(value)) return value + return resolve(cwd, value) +} diff --git a/src/cli/permission-keys.ts b/src/cli/permission-keys.ts index 1daa253c7..52389c99c 100644 --- a/src/cli/permission-keys.ts +++ b/src/cli/permission-keys.ts @@ -39,7 +39,7 @@ export interface ConditionalKey { when: string } -/** Either way of naming a program's keys: a messenger's per-command mapping, or a declared CLI's own. */ +/** Either way of naming a program's keys: a messenger's per-command mapping, or a declared CLI's own. @experimental */ export type PermissionKeySource = PermissionKeyOf | CommandPermissions const HOUSEKEEPING = new Set([ @@ -90,7 +90,8 @@ const everyCommand = (command: Command): Command[] => [command, ...command.comma /** * The keys `permissions` may name: every command of the program, every write key, and each of their - * parents. A key outside it is a typo that would otherwise do nothing (BUG-137). + * parents. A key outside it is a typo that would otherwise do nothing. + * @experimental */ export const knownPermissionKeys = ( command: Command, @@ -131,7 +132,7 @@ export const markRenamedPermissionKeys = (command: Command, renamed: ReadonlyMap export const renamedPermissionKeys = (command: Command): Map => new Map(everyCommand(rootOf(command)).flatMap((one) => [...(RENAMED.get(one) ?? [])])) -/** The known keys one level under the unknown key's parent, to name in the refusal. */ +/** The known keys one level under the unknown key's parent, to name in the refusal. @experimental */ export const knownBeside = (key: PermissionKey, known: ReadonlySet): PermissionKey[] => { const parent = key.split(".").slice(0, -1).join(".") const depth = parent === "" ? 1 : parent.split(".").length + 1 @@ -140,12 +141,16 @@ export const knownBeside = (key: PermissionKey, known: ReadonlySet>, known: ReadonlySet, ): PermissionKey[] => Object.keys(levels).filter((key) => key !== CEILING_KEY && !known.has(key)) -/** Every unknown permission key saved in the file, in every section and profile, with the unset that removes it. */ +/** + * Every unknown permission key saved in the file, in every section and profile, with the unset that removes it. + * @experimental + */ export const unknownPermissionIssues = ( command: Command, settings: Pick, @@ -168,6 +173,7 @@ export const unknownPermissionIssues = ( /** * A saved key no command checks would do nothing, so the command refuses to run and names the unset that removes * it. A `--permission` key is checked too: it is no file's, so the flag is the fix. + * @experimental */ export const refuseUnknownPermissionKeys = ( command: Command, diff --git a/src/cli/profile.ts b/src/cli/profile.ts index 4743ebfe3..581b59e9d 100644 --- a/src/cli/profile.ts +++ b/src/cli/profile.ts @@ -41,7 +41,10 @@ export const profileFree = (command: T): T => { return command } -/** Whether the command line puts a profile before this command: not for `PROFILE_FREE` or a `profileFree` one. */ +/** + * Whether the command line puts a profile before this command: not for `PROFILE_FREE` or a `profileFree` one. + * @experimental + */ export const takesProfile = (command: Command): boolean => { let top: Command | undefined for (let at: Command | null = command; at?.parent; at = at.parent) { @@ -81,6 +84,7 @@ export const liftProfile = ( * The group a run reads, from the first word (`liftProfile` lifts it) or `_GROUP`; `all`, the default, is * every account, so no restriction. Under `_GROUP_LOCK` any other group, `all` included, is refused, as the * profile lock refuses another profile (WC-ACCT-5); a lock of `all` locks nothing. + * @experimental */ export const runGroup = (app: AppIdentity, env: NodeJS.ProcessEnv, word?: string): RunGroup | undefined => { const GROUP = envName(app, "GROUP") diff --git a/src/cli/program.ts b/src/cli/program.ts index e0e08a8e5..5a746046a 100644 --- a/src/cli/program.ts +++ b/src/cli/program.ts @@ -65,6 +65,7 @@ import { MAX_BUFFERED_INPUT, provideInputPolicy } from "./input-policy.js" import { checkJson, liftJson } from "./json-fields.js" import { queryAfterDashes, siblingOption } from "./option-hints.js" import { tooLargeSteps } from "./output-budget.js" +import { refuseAgentPaths } from "./path-options.js" import type { CommandPermissions } from "./permission-keys.js" import { PreviewComplete, preview } from "./preview.js" import { commandWords, isProfileName, liftProfile, sampleCommand, takesProfile, valuedOptions } from "./profile.js" @@ -486,6 +487,7 @@ const runOnce = async (typed: string[], definition: ProgramDefinition, options: if (lock && isLogin(action) && !flags.dryRun) throw readOnlyRefusal(lock, "log in or out") if (lock && isStoreChange(action) && !flags.dryRun) throw readOnlyRefusal(lock, storeChangeRefusal(definition.app)) if (lock) refuseLockedOutputs(action, definition.app, commandEnv) + if (options.agent) refuseAgentPaths(action, definition.app, commandEnv) refuseWriteBeforeConnecting(action, { app: definition.app, env: commandEnv, diff --git a/src/cli/project-evidence.ts b/src/cli/project-evidence.ts index 7adb7fce1..562acecff 100644 --- a/src/cli/project-evidence.ts +++ b/src/cli/project-evidence.ts @@ -7,7 +7,10 @@ import type { LeftOutChat, StoredProjectGathering } from "../services/stored-pro import { coverageGaps, heldPhrase } from "./messenger/search-answers.js" import { heldInWindow } from "./project-status.js" -/** Days back (`90d`) or a start date (`2026-09-01`); either way the run freezes its end, so a resume keeps it. */ +/** + * Days back (`90d`) or a start date (`2026-09-01`); either way the run freezes its end, so a resume keeps it. + * @experimental + */ export const projectWindowOf = (value: string): { days: number } | { after: number } => { const days = /^([1-9]\d{0,2})d$/.exec(value)?.[1] if (days !== undefined && Number(days) <= 730) return { days: Number(days) } @@ -20,6 +23,7 @@ export const projectWindowOf = (value: string): { days: number } | { after: numb ) } +/** @experimental */ export const projectCutoffTime = (value: string): number => { const parsed = v.safeParse(v.pipe(v.string(), v.isoTimestamp()), value) const at = parsed.success ? Date.parse(parsed.output) : Number.NaN @@ -48,6 +52,7 @@ const coverageRows = ({ linkedChats }: StoredProjectGathering): ChatCoverage[] = /** * The zone a typed start date was read in, and the window the run used, in UTC. `complete` is "the answer is whole": * reads finished and every linked chat held in full; the answer's own `complete` stays "reads finished". + * @experimental */ export const projectAnswerParts = ( sinceTime: string, @@ -85,6 +90,7 @@ export const projectAnswerParts = ( /** * The gathering with each linked chat's `syncCommand`: the line that syncs a chat held in part back to the window * start, or null when it needs none or no command here can. JSON readers get what the text says per chat. + * @experimental */ export const withSyncCommands = ( found: StoredProjectGathering, @@ -100,6 +106,7 @@ export const withSyncCommands = ( leftOut: found.leftOut.map((one) => ({ ...one, readCommand: read?.(one, day(found.window.after)) ?? null })), }) +/** @experimental */ export interface ProjectTextHints { /** The command that syncs one linked chat back to `since` (`YYYY-MM-DD`), or null when no command here can. */ sync: (chat: StoredProjectGathering["linkedChats"][number], since: string) => string | null @@ -135,6 +142,7 @@ const FETCH_STATES: Record = { skipped: "not synced, the fetch time ran out first", } +/** @experimental */ export const projectEvidenceText = (found: StoredProjectGathering, hints: ProjectTextHints) => { const lanes = new Map( found.lanes.map((lane) => [ diff --git a/src/cli/project-status-rows.ts b/src/cli/project-status-rows.ts index 2eaa891ea..575f5b22c 100644 --- a/src/cli/project-status-rows.ts +++ b/src/cli/project-status-rows.ts @@ -9,6 +9,7 @@ export const ON_CHAT_ROW: ReadonlySet = new Set(["reply-next", "coverage /** * The compact row of each listed status signal's items, by `status.`; a signal's file and its row are the * two places a new signal touches. They live here because a service may not import the CLI's row type. + * @experimental */ export const STATUS_SIGNAL_ROWS: Readonly> = { "status.questions": { @@ -61,7 +62,7 @@ export const STATUS_SIGNAL_ROWS: Readonly> = { }, } -/** The rest of a `project_status` answer: its chats, open money, chats left out, and failed signals. */ +/** The rest of a `project_status` answer: its chats, open money, chats left out, and failed signals. @experimental */ export const STATUS_ROWS: Readonly> = { ...STATUS_SIGNAL_ROWS, "status.chat": { diff --git a/src/cli/project-status.ts b/src/cli/project-status.ts index 904c81e1d..0e166d8fd 100644 --- a/src/cli/project-status.ts +++ b/src/cli/project-status.ts @@ -16,6 +16,7 @@ import { snakeKeys } from "./envelope.js" import { heldPhrase } from "./messenger/search-answers.js" import { ON_CHAT_ROW, STATUS_SIGNAL_ROWS } from "./project-status-rows.js" +/** @experimental */ export interface ProjectStatusHints { /** The step that syncs a chat held in part back to `since` (`YYYY-MM-DD`); null when no command here can. */ sync: (chat: StatusChatSummary, since: string) => NextStep | null @@ -37,7 +38,10 @@ const SECTIONS = { failed: "status.failed", } -/** The `project_status` answer drawn by `--compact`: a row per chat, then each listed signal with its own row. */ +/** + * The `project_status` answer drawn by `--compact`: a row per chat, then each listed signal with its own row. + * @experimental + */ export const projectStatusRow = (signals: readonly { id: string }[]): RowShape => ({ columns: [], hidden: ["project", "purposes", "signals"], @@ -62,7 +66,10 @@ const statusItem = v.looseObject({ data: v.record(v.string(), v.unknown()), }) -/** Where a project stands: per chat signals, open money, and what was left out. Empty lists are left out. */ +/** + * Where a project stands: per chat signals, open money, and what was left out. Empty lists are left out. + * @experimental + */ export const projectStatusSchema = v.looseObject({ project: v.string(), key: v.nullable(v.string()), @@ -113,6 +120,7 @@ export const projectStatusSchema = v.looseObject({ ), }) +/** @experimental */ export type ProjectStatusItem = v.InferOutput const coverageOf = (found: ProjectStatus, chat: string) => @@ -306,7 +314,7 @@ const chatRow = (found: ProjectStatus, hints: ProjectStatusHints, chat: StatusCh } } -/** The answer of `projects status`: the item, two steps at most, what is missing, and the window. */ +/** The answer of `projects status`: the item, two steps at most, what is missing, and the window. @experimental */ export const projectStatusAnswer = (found: ProjectStatus, hints: ProjectStatusHints) => { const unlisted = unlistedOf(found) const lists = Object.fromEntries( @@ -414,7 +422,7 @@ const moneyLine = (one: StatusItem, titles: Map) => { return ` ${words.padEnd(7)} ${sum}${asks}${where} · ${one.evidence[0]?.ref ?? ""} [${one.basis}]` } -/** The human form: header, money, a line per chat with what is open, then the steps. */ +/** The human form: header, money, a line per chat with what is open, then the steps. @experimental */ export const projectStatusText = (found: ProjectStatus, hints: ProjectStatusHints): string => { const titles = new Map(found.chats.map((chat) => [chat.ref, chat.title])) const { next } = projectStatusAnswer(found, hints) diff --git a/src/cli/provider-refs.ts b/src/cli/provider-refs.ts index aaaee9f1f..04fc6e53b 100644 --- a/src/cli/provider-refs.ts +++ b/src/cli/provider-refs.ts @@ -2,7 +2,7 @@ const HIDDEN = new Set(["providerRef", "provider_ref"]) /** * The value with every `providerRef` taken out, at any depth. An adapter keeps there what it needs to fetch a file - * again — WhatsApp's media path and decryption keys, a MAX bot's token — so it never leaves the process (SEC-54). + * again — WhatsApp's media path and decryption keys, a MAX bot's token — so it never leaves the process. */ export const withoutProviderRefs = (value: T): T => strip(value) as T diff --git a/src/cli/relay-route.ts b/src/cli/relay-route.ts index 8f99d16ef..4c762f7c8 100644 --- a/src/cli/relay-route.ts +++ b/src/cli/relay-route.ts @@ -1,4 +1,3 @@ -import { isAbsolute, resolve } from "node:path" import { CliError } from "@wirecat/cli-base" import { metaOf } from "@wirecat/cli-base/commands" import type { Command } from "commander" @@ -8,6 +7,7 @@ import { RELAY_PROTOCOL } from "../background/relay.js" import type { AppIdentity } from "../ports/app.js" import { commandPathOf } from "./command-contract.js" import { isLogin, isOtherServiceCall } from "./effects.js" +import { absoluteFrom, isLocalPathArgument, isLocalPathOption } from "./path-options.js" /** Not through serve: serve itself, its unit, and what has no messenger profile. */ const LOCAL_ROOTS = new Set(["serve", "server", "bot"]) @@ -61,16 +61,6 @@ export const relayTarget = ( return { lock: lock as RelayTarget["lock"], profile } } -const PATH_NAME = /^(file|path|dir|directory|folder)s?$/ -const PATH_PLACEHOLDER = /[<[](file|path|dir|directory|folder)s?(\.\.\.)?[>\]]/ - -const absolute = (cwd: string, value: unknown): unknown => { - if (Array.isArray(value)) return value.map((one) => absolute(cwd, one)) - if (typeof value !== "string" || value === "-" || value === "" || isAbsolute(value) || value.includes("://")) - return value - return resolve(cwd, value) -} - /** * A command serve runs for a client reads the client's files: a value whose placeholder names a path is made * absolute against the client's working directory before the action sees it. @@ -78,13 +68,14 @@ const absolute = (cwd: string, value: unknown): unknown => { export const absolutePaths = (action: Command, cwd: string): void => { for (let at: Command | null = action; at; at = at.parent) { for (const option of at.options) { - if (!PATH_PLACEHOLDER.test(option.flags)) continue + if (!isLocalPathOption(at, option)) continue const key = option.attributeName() const value = at.getOptionValue(key) - if (value !== undefined) at.setOptionValueWithSource(key, absolute(cwd, value), at.getOptionValueSource(key)) + if (value !== undefined) at.setOptionValueWithSource(key, absoluteFrom(cwd, value), at.getOptionValueSource(key)) } } action.registeredArguments.forEach((argument, index) => { - if (PATH_NAME.test(argument.name())) action.processedArgs[index] = absolute(cwd, action.processedArgs[index]) + if (isLocalPathArgument(action, argument)) + action.processedArgs[index] = absoluteFrom(cwd, action.processedArgs[index]) }) } diff --git a/src/cli/result-fields.ts b/src/cli/result-fields.ts index be8e77c2e..2e72d0915 100644 --- a/src/cli/result-fields.ts +++ b/src/cli/result-fields.ts @@ -13,6 +13,7 @@ const named = (work: () => T): T => { } } +/** @experimental */ export const fieldsOf = (value: string): string[] => named(() => coreFieldsOf(value)) const projectCommands = (commands: readonly CommandInfo[], fields: readonly string[]): unknown[] => @@ -25,6 +26,7 @@ const projectCommands = (commands: readonly CommandInfo[], fields: readonly stri commands: projectCommands(command.commands, fields), })) +/** @experimental */ export const projectFields = (value: unknown, fields: readonly string[]): unknown => named(() => { if ( diff --git a/src/cli/schedule/harnesses.ts b/src/cli/schedule/harnesses.ts index 93244d61a..ac8eb4a51 100644 --- a/src/cli/schedule/harnesses.ts +++ b/src/cli/schedule/harnesses.ts @@ -292,11 +292,12 @@ const AGENT_HARNESSES = { }, } as const satisfies Record +/** @experimental */ export type Harness = keyof typeof AGENT_HARNESSES /** The variables a harness reads its limits from; a run rebuilds them, so a saved one is never taken from the file. */ export const HARNESS_VARIABLES = ["GEMINI_CLI_SYSTEM_SETTINGS_PATH", "OPENCODE_CONFIG_CONTENT"] as const -/** Every agent a schedule may start, as `schedule agent ` and a digest's agent take it. */ +/** Every agent a schedule may start, as `schedule agent ` and a digest's agent take it. @experimental */ export const HARNESSES = Object.keys(AGENT_HARNESSES) as readonly Harness[] export const AGENT_MODELS = Object.fromEntries(HARNESSES.map((id) => [id, AGENT_HARNESSES[id].model])) as Record< Harness, @@ -306,9 +307,10 @@ export const AGENT_MODELS = Object.fromEntries(HARNESSES.map((id) => [id, AGENT_ export const harnessOf = (id: Harness): HarnessKind => AGENT_HARNESSES[id] export const COSTED = HARNESSES.filter((id) => harnessOf(id).reportsCost).join(", ") +/** @experimental */ export const isHarness = (id: string): id is Harness => (HARNESSES as readonly string[]).includes(id) -/** An agent's name, programs and what holds it, as `schedule agents list` answers them. */ +/** An agent's name, programs and what holds it, as `schedule agents list` answers them. @experimental */ export const harnessInfo = (harness: Harness) => { const { name, programs, reportsCost, restricted, restrictedReason, allowedWithAck } = harnessOf(harness) return { @@ -322,7 +324,7 @@ export const harnessInfo = (harness: Harness) => { } } -/** Whether the harness reports what a run cost; the cost caps hold only for one that does. */ +/** Whether the harness reports what a run cost; the cost caps hold only for one that does. @experimental */ export const reportsCost = (harness: Harness): boolean => harnessOf(harness).reportsCost /** The harness's program on PATH, by the first of its names found. */ @@ -331,7 +333,10 @@ export const programOf = (harness: Harness, env: NodeJS.ProcessEnv, platform: No .programs.map((name) => findProgram(name, env, platform)) .find(Boolean) -/** Which harness an agent schedule's argv starts, by its program's name; null for one no harness here knows. */ +/** + * Which harness an agent schedule's argv starts, by its program's name; null for one no harness here knows. + * @experimental + */ export const harnessOfArgv = (argv: readonly string[]): Harness | null => { const name = basename(argv[0] ?? "") .replace(/\.(exe|cmd)$/i, "") @@ -351,7 +356,7 @@ export const harnessRefusal = (harness: Harness, accepted: boolean): string | un return `${kind.name} cannot run on a schedule: ${kind.restrictedReason}` } -/** Each harness, with its program when it is on PATH: what `schedule agents list` answers. */ +/** Each harness, with its program when it is on PATH: what `schedule agents list` answers. @experimental */ export const harnessesOn = (env: NodeJS.ProcessEnv, platform: NodeJS.Platform) => HARNESSES.map((id) => { const path = programOf(id, env, platform) ?? null diff --git a/src/cli/schedule/schedule-command.ts b/src/cli/schedule/schedule-command.ts index 0b6eeb795..135c31c3a 100644 --- a/src/cli/schedule/schedule-command.ts +++ b/src/cli/schedule/schedule-command.ts @@ -85,7 +85,7 @@ interface WhenOptions { const CLOCK = /^([01]\d|2[0-3]):[0-5]\d$/ -/** One `--at`: `HH:MM` every day, or weekdays and a time, `mon 09:00` or `mon,fri 09:00`. */ +/** One `--at`: `HH:MM` every day, or weekdays and a time, `mon 09:00` or `mon,fri 09:00`. @experimental */ export const slotsOfAt = (at: string): Slot[] => { const [, words, clock = ""] = /^\s*(?:([a-z,]+)\s+)?(\S+)\s*$/i.exec(at) ?? [] if (!CLOCK.test(clock)) @@ -343,6 +343,7 @@ const reportTemplatesOf = /** * One past day's run of the agent schedule in `file`, as `backfillSchedule` makes it, with the owner's language and * templates as `schedule run` renders them; a stop of the command stops the agent. + * @experimental */ export const backfillScheduleRun = ( command: Command, @@ -366,7 +367,10 @@ export const backfillScheduleRun = ( ) } -/** Where a schedule is written and for whom: the CLI, the machine, the run's variables and its profile. */ +/** + * Where a schedule is written and for whom: the CLI, the machine, the run's variables and its profile. + * @experimental + */ export interface ScheduleSite { app: AppIdentity system: ServerSystem @@ -378,7 +382,7 @@ export interface ScheduleSite { limits?: ScheduleLimits } -/** The tool's state folder, which holds its schedules. */ +/** The tool's state folder, which holds its schedules. @experimental */ export const scheduleState = ({ app, env }: Pick) => resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state @@ -403,7 +407,7 @@ const scheduleEnvironment = ({ app, env, profile }: ScheduleSite): Record { const { app, system, env, agentRuns = [], limits = {} } = site const { harness, prompt, when } = spec @@ -475,6 +482,7 @@ export const agentSchedule = (site: ScheduleSite, spec: AgentScheduleSpec): Sche /** * Writes the schedule's file and puts it on its timer, or takes it off when it is paused. A name another profile's * schedule holds is refused. + * @experimental */ export const writeSchedule = async ( site: ScheduleSite, @@ -524,6 +532,7 @@ const ownRoutes = (schedule: Schedule, routes: readonly string[] | undefined) => /** * Takes a schedule off its timer and keeps its file, or puts it back. It keeps the profile it was made for, as pausing * names no new one. + * @experimental */ export const pauseSchedule = async (site: ScheduleSite, name: string, paused: boolean) => { const file = scheduleFile(scheduleState(site), scheduleName(name)) @@ -534,7 +543,7 @@ export const pauseSchedule = async (site: ScheduleSite, name: string, paused: bo return { schedule: kept, ...(await writeSchedule({ ...site, profile: owner }, kept)) } } -/** Takes the schedule off its timer and removes its file; its past runs stay. */ +/** Takes the schedule off its timer and removes its file; its past runs stay. @experimental */ export const removeSchedule = async (site: ScheduleSite, name: string): Promise => { const file = scheduleFile(scheduleState(site), scheduleName(name)) if (!existsSync(file)) throw new CliError("not_found", `no schedule ${name}`) @@ -545,6 +554,7 @@ export const removeSchedule = async (site: ScheduleSite, name: string): Promise< /** * Runs the schedule in `file` now, as `schedule run` does: its report rendered with the owner's language and templates * and sent along `routes` (its own when absent, none when empty). A stop of the command stops the agent. + * @experimental */ export const runScheduleNow = async ( command: Command, diff --git a/src/cli/search-left-out.ts b/src/cli/search-left-out.ts index 3831f1218..4ae53904d 100644 --- a/src/cli/search-left-out.ts +++ b/src/cli/search-left-out.ts @@ -21,8 +21,10 @@ const LIST_KEYS = { tracker: "issues.list", } as const satisfies Record +/** @experimental */ export type SearchedKind = keyof typeof LIST_KEYS +/** @experimental */ export interface LeftOut { kind: K key: PermissionKey @@ -33,6 +35,7 @@ export interface LeftOut { /** * The kinds whose list `permissions` deny, for a CLI with levels of its own, such as memo's: `by` names who denies in * `why` (`memo's permissions`). + * @experimental */ export const deniedKindsOf = ( permissions: Readonly>, @@ -47,8 +50,9 @@ export const deniedKindsOf = ( /** * The kinds whose list the profile denies, so `search all` leaves them out rather than show their titles and excerpts - * under another key (SEC-144). Levels as the run judged the command: the profile's, `--permission`, and an MCP + * under another key. Levels as the run judged the command: the profile's, `--permission`, and an MCP * server's own stricter ones. + * @experimental */ export const deniedKinds = ( command: Command, diff --git a/src/cli/service-api-basic.test.ts b/src/cli/service-api-basic.test.ts index d961a8179..5a5b664bb 100644 --- a/src/cli/service-api-basic.test.ts +++ b/src/cli/service-api-basic.test.ts @@ -3,8 +3,8 @@ import type { ServiceApiManifest } from "./service-api-manifest.js" import { signRequest } from "./service-api-manifest.js" // A cli-base that signs Basic itself, as cli-base #643 makes it: cli-core's own rules must still hold over it. -vi.mock("@wirecat/cli-base/codegen", async (original) => { - const real = await original() +vi.mock("@wirecat/cli-base/codegen/runtime", async (original) => { + const real = await original() return { ...real, signInPlace: (scheme: Parameters[0]) => diff --git a/src/cli/service-api-call.ts b/src/cli/service-api-call.ts index 2610a70a1..f3cdf66cd 100644 --- a/src/cli/service-api-call.ts +++ b/src/cli/service-api-call.ts @@ -1,5 +1,5 @@ import { CliError } from "@wirecat/cli-base" -import type { ManifestOperation } from "@wirecat/cli-base/codegen" +import type { ManifestOperation } from "@wirecat/cli-base/codegen/runtime" import { type FetchLike, hostFetch } from "@wirecat/cli-base/http" import { Command } from "commander" import type { ApiCommandInput } from "./bot/api.js" diff --git a/src/cli/service-api-manifest.ts b/src/cli/service-api-manifest.ts index e507595d3..ccadb9e13 100644 --- a/src/cli/service-api-manifest.ts +++ b/src/cli/service-api-manifest.ts @@ -8,7 +8,7 @@ import { type SignInPlace, signInPlace, signInRequirements, -} from "@wirecat/cli-base/codegen" +} from "@wirecat/cli-base/codegen/runtime" import type { ApiCommandInput } from "./bot/api.js" import { apiJson, parseApiJson } from "./bot/api-input.js" @@ -58,6 +58,7 @@ export const manifestBaseUrl = ( /** * The site an owner types, as a server's free variable takes it: a host with a port or a path if any, from * `blog.example.com` or `https://blog.example.com/`. Only https: an `http://` address is refused, not rewritten. + * @experimental */ export const siteValue = (raw: string): string => { const text = raw @@ -152,6 +153,7 @@ const authOf = (manifest: ServiceApiManifest, operation: ManifestOperation): Sig * standard sign-in header, or a key in the query, never follows a redirect, even to the same host: another host would * get the key. The URL then holds the key, so a fetch wrapper must not log it. Without `token`, for a CLI that never * signs in, nothing is added. + * @experimental */ export const signRequest = async ( manifest: ServiceApiManifest, @@ -171,6 +173,7 @@ export const signRequest = async ( /** * A URL on the server's origin and under its path: a site at `host/blog` shares its host with `host/other`, which * must never get its sign-in. + * @experimental */ export const underBase = (url: URL, baseUrl: string): boolean => { const base = new URL(baseUrl) @@ -214,7 +217,10 @@ export const withValue = ( return { ...input, fields, body: apiJson({ ...(body as Record), [parameter.name]: value }) } } -/** One page's items, and how to ask for the next: new flags, the next page's whole URL, or `undefined` at the end. */ +/** + * One page's items, and how to ask for the next: new flags, the next page's whole URL, or `undefined` at the end. + * @experimental + */ export interface PageStep { items: readonly unknown[] next?: { input: ApiCommandInput } | { url: string } @@ -224,6 +230,7 @@ export interface PageStep { * Reads one answer by the manifest's pagination: where its items are and what the next request is. `headers` are the * response's, where a page style's `pagesHeader` gives the number of pages: the page that reaches it is the last, as * WordPress refuses a page past the end. + * @experimental */ export const nextPage = ( pagination: Pagination, diff --git a/src/cli/service-api.ts b/src/cli/service-api.ts index acdd072e2..454364f52 100644 --- a/src/cli/service-api.ts +++ b/src/cli/service-api.ts @@ -1,5 +1,5 @@ import { CliError, isCliError } from "@wirecat/cli-base" -import type { ManifestOperation, OperationPermission, SchemaNode } from "@wirecat/cli-base/codegen" +import type { ManifestOperation, OperationPermission, SchemaNode } from "@wirecat/cli-base/codegen/runtime" import { annotate } from "@wirecat/cli-base/commands" import type { FetchLike } from "@wirecat/cli-base/http" import { Command } from "commander" @@ -198,7 +198,10 @@ const applies = (permission: OperationPermission, body: unknown, input: ApiComma ) } -/** The keys one call checks beside `api.`: the manifest's that apply, and the CLI's from the body. */ +/** + * The keys one call checks beside `api.`: the manifest's that apply, and the CLI's from the body. + * @experimental + */ export const serviceApiKeys = ( input: ServiceApiPermissionsInput, operation: ManifestOperation, diff --git a/src/cli/settings.ts b/src/cli/settings.ts index d6fbfdd2b..e8c4145df 100644 --- a/src/cli/settings.ts +++ b/src/cli/settings.ts @@ -65,9 +65,11 @@ export const plain = (issue: v.BaseIssue): string => `${rule}, not ${issue.received}` const wholeNumber = plain("has to be a whole number, 1 or more") +/** @experimental */ export const count = v.pipe(v.number(wholeNumber), v.integer(wholeNumber), v.minValue(1, wholeNumber)) const zeroOrMore = plain("has to be a whole number, 0 or more") const countOrZero = v.pipe(v.number(zeroOrMore), v.integer(zeroOrMore), v.minValue(0, zeroOrMore)) +/** @experimental */ export const flag = v.boolean(plain("has to be true or false")) const historyDaysMessage = plain(`has to be a whole number of days, 1 to ${HISTORY_MAX_DAYS}`) const historyDays = v.pipe( @@ -308,6 +310,7 @@ interface KindSection { profiles?: Record } +/** @experimental */ export interface Config { defaults?: Scope profiles: Record @@ -333,7 +336,7 @@ export interface GlobalFlags { timeout?: string } -/** `first word`, `flag`, `TG_PROFILE`, `config file`, `config defaults`, `default`… */ +/** `first word`, `flag`, `TG_PROFILE`, `config file`, `config defaults`, `default`… @experimental */ export type Source = string export interface Settings extends AISettings { @@ -461,7 +464,10 @@ export const NONE_NAMED = "none named" /** A name for a command that speaks for no account; never chosen for one that does. */ const NO_PROFILE = "default" -/** The profile a run is for: none when nothing named one, even though `Settings.profile` holds a placeholder. */ +/** + * The profile a run is for: none when nothing named one, even though `Settings.profile` holds a placeholder. + * @experimental + */ export const namedProfile = (settings: Pick & Partial>) => settings.sources?.profile === NONE_NAMED ? undefined : settings.profile @@ -491,7 +497,7 @@ export class NoProfileHere extends CliError { } } -/** The first candidate that is set, and which layer it came from. */ +/** The first candidate that is set, and which layer it came from. @experimental */ export const first = (candidates: [Source, T | undefined][], fallback: T): { value: T; from: Source } => { for (const [from, value] of candidates) if (value !== undefined) return { value, from } return { value: fallback, from: "default" } diff --git a/src/cli/setup-answers.ts b/src/cli/setup-answers.ts index 1415cc809..89978e9e6 100644 --- a/src/cli/setup-answers.ts +++ b/src/cli/setup-answers.ts @@ -5,11 +5,13 @@ import { readSharedSection, sharedConfigPath, writeSharedSection } from "../stor /** One switch for every tool, the same on the command line and over MCP; "allow" leaves each profile as configured. */ export const PERMISSION_ANSWERS = ["readonly", "allow"] as const +/** @experimental */ export type PermissionAnswer = (typeof PERMISSION_ANSWERS)[number] /** * The first-run answers every WireCat CLI shares. Languages live in the store (`search_stemmers`), so only the * fact that they were asked is kept here. + * @experimental */ export interface SetupAnswers { languages?: true @@ -21,6 +23,7 @@ export type Question = (typeof QUESTIONS)[number] const SECTION = "setup" +/** @experimental */ export const readSetupAnswers = (path: string): SetupAnswers => { const section = readSharedSection(path, SECTION) if (section === undefined) return {} diff --git a/src/cli/shadowed-options.ts b/src/cli/shadowed-options.ts index d220e30d2..16f6a9050 100644 --- a/src/cli/shadowed-options.ts +++ b/src/cli/shadowed-options.ts @@ -5,7 +5,7 @@ const GIVEN = new Set(["cli", "env", "config"]) /** * commander gives a flag that the root and the command both declare (`--yes`, `--timeout`, `--dry-run`) to the root, - * so the command's own option stays empty (BUG-760). The value goes to the command's option too, through its own + * so the command's own option stays empty. The value goes to the command's option too, through its own * parser, so `--timeout 2m` on an option that takes seconds still arrives as seconds. */ export const shareShadowedOptions = (action: Command): void => { diff --git a/src/cli/shared-command-exports.ts b/src/cli/shared-command-exports.ts index d67a92426..a3872c599 100644 --- a/src/cli/shared-command-exports.ts +++ b/src/cli/shared-command-exports.ts @@ -84,30 +84,40 @@ import { upgradeCommand as upgradeCommandDefinition } from "./upgrade-command.js const sharedCommand: typeof protectedCommand = (factory) => honoursDryRun(protectedCommand(factory)) +/** @experimental */ export const addStoreMaintenanceCommands = sharedCommand(addStoreMaintenanceCommandsDefinition) export const appDoctorCommand = sharedCommand(appDoctorCommandDefinition) export const appCompleteCommand = sharedCommand(appCompleteCommandDefinition) export const appMcpCommand = sharedCommand(appMcpCommandDefinition) +/** @experimental */ export const botAdminsCommand = sharedCommand(botAdminsCommandDefinition) +/** @experimental */ export const botMembersCommand = sharedCommand(botMembersCommandDefinition) export const generatedApiCommand = sharedCommand(generatedApiCommandDefinition) export const serviceApiCommand = sharedCommand(serviceApiCommandDefinition) export const botCommand = sharedCommand(botCommandDefinition) +/** @experimental */ export const botMcpCommand = sharedCommand(botMcpCommandDefinition) +/** @experimental */ export const botMessagesCommand = sharedCommand(botMessagesCommandDefinition) export const commandsCommand = sharedCommand(commandsCommandDefinition) export const configCommand = sharedCommand(configCommandDefinition) export const setupCommand = sharedCommand(setupCommandDefinition) export const guideCommand = sharedCommand(guideCommandDefinition) +/** @experimental */ export const addMeetingBatchCommand = sharedCommand(addMeetingBatchCommandDefinition) export const addMeetingPreparationCommand = sharedCommand(addMeetingPreparationCommandDefinition) +/** @experimental */ export const addMeetingProjectCandidatesCommand = sharedCommand(addMeetingProjectCandidatesCommandDefinition) +/** @experimental */ export const addMeetingSeriesInventoryCommand = sharedCommand(addMeetingSeriesInventoryCommandDefinition) export const accountCommand = sharedCommand(accountCommandDefinition) +/** @experimental */ export const messengerSessionCommands = sharedCommand(messengerSessionCommandsDefinition) export const storeCommand = sharedCommand(storeCommandDefinition) export const attachmentsCommand = sharedCommand(attachmentsCommandDefinition) export const chatsCommand = sharedCommand(chatsCommandDefinition) +/** @experimental */ export const markReadCommand = sharedCommand(markReadCommandDefinition) export const completeCommand = sharedCommand(completeCommandDefinition) export const contactsCommand = sharedCommand(contactsCommandDefinition) @@ -121,18 +131,27 @@ export const inboxCommand = sharedCommand(inboxCommandDefinition) export const mcpCommand = sharedCommand(mcpCommandDefinition) export const mentionsCommand = sharedCommand(mentionsCommandDefinition) export const messagesCommand = sharedCommand(messagesCommandDefinition) +/** @experimental */ export const sendCommand = sharedCommand(sendCommandDefinition) +/** @experimental */ export const deleteCommand = sharedCommand(deleteCommandDefinition) +/** @experimental */ export const editCommand = sharedCommand(editCommandDefinition) +/** @experimental */ export const forwardCommand = sharedCommand(forwardCommandDefinition) +/** @experimental */ export const pinCommand = sharedCommand(pinCommandDefinition) +/** @experimental */ export const starCommands = sharedCommand(starCommandsDefinition) +/** @experimental */ export const unpinCommand = sharedCommand(unpinCommandDefinition) export const metadataCommand = sharedCommand(metadataCommandDefinition) export const modelsCommand = sharedCommand(modelsCommandDefinition) export const pollsCommand = sharedCommand(pollsCommandDefinition) export const reactionsCommand = sharedCommand(reactionsCommandDefinition) +/** @experimental */ export const callsCommand = sharedCommand(callsCommandDefinition) +/** @experimental */ export const stickersCommand = sharedCommand(stickersCommandDefinition) export const repliesCommand = sharedCommand(repliesCommandDefinition) export const reviewCommand = sharedCommand(reviewCommandDefinition) @@ -145,7 +164,9 @@ export const serverCommand = sharedCommand(serverCommandDefinition) export const statsCommand = sharedCommand(statsCommandDefinition) export const tagsCommand = sharedCommand(tagsCommandDefinition) export const tasksCommand = sharedCommand(tasksCommandDefinition) +/** @experimental */ export const tasksStatsCommand = sharedCommand(tasksStatsCommandDefinition) +/** @experimental */ export const topicsCommand = sharedCommand(topicsCommandDefinition) export const projectsCommand = sharedCommand(projectsCommandDefinition) export const watchCommand = sharedCommand(watchCommandDefinition) @@ -156,4 +177,5 @@ export const upgradeCommand = sharedCommand(upgradeCommandDefinition) import { modelCatalogueCommand as modelCatalogueDefinition } from "./model-catalogue-command.js" import { templatesCommand as templatesDefinition } from "./templates-command.js" export const modelCatalogueCommand = sharedCommand(modelCatalogueDefinition) +/** @experimental */ export const templatesCommand = sharedCommand(templatesDefinition) diff --git a/src/cli/steps.ts b/src/cli/steps.ts index eed5569a5..2b200a264 100644 --- a/src/cli/steps.ts +++ b/src/cli/steps.ts @@ -296,6 +296,7 @@ type Targets = NonNullable * The steps this CLI can run, at most two: a step naming a command it lacks is dropped, never printed. Whether a * step may run unasked is judged here, where the command tree is known: only when its command writes nothing * remotely. + * @experimental */ export const runnable = (root: Command, steps: readonly NextStep[] | undefined): NextStep[] => withSafety( @@ -327,7 +328,10 @@ export const failureSteps = ( return runnable(root, [...(error.next ?? []), ...own]) } -/** Each command step judged by its command's effects: safe to run unasked only when it writes nothing remotely. */ +/** + * Each command step judged by its command's effects: safe to run unasked only when it writes nothing remotely. + * @experimental + */ export const withSafety = (steps: readonly NextStep[], targets: Targets): NextStep[] => steps.map((step) => { if (step.kind === "user_action") return step diff --git a/src/cli/store-info.ts b/src/cli/store-info.ts index 0e3d26f07..d6d456a67 100644 --- a/src/cli/store-info.ts +++ b/src/cli/store-info.ts @@ -21,6 +21,7 @@ import { LOCAL_READ } from "./effects.js" import { itemOf, renderAnswer, snakeKeys } from "./envelope.js" import { storeRecoverCommand } from "./store-recover.js" +/** @experimental */ export type StoreInfo = v.InferOutput /** Before version 6 the column does not exist, and a file behind this build is not migrated here. */ @@ -79,6 +80,7 @@ export const storeInfo = async (env: NodeJS.ProcessEnv): Promise => { } } +/** @experimental */ export const storeInfoCommand = (): Command => annotate(new Command("info"), { output: { entity: "store_info" }, effects: LOCAL_READ }) .summary("the shared store's format, size and contents, and whether this tool can read it") diff --git a/src/cli/store-recover.ts b/src/cli/store-recover.ts index 7e36e5286..6f0809549 100644 --- a/src/cli/store-recover.ts +++ b/src/cli/store-recover.ts @@ -36,6 +36,7 @@ const COUNTED = [ "mentions", ] +/** @experimental */ export interface RecoveryCheck { path: string exists: boolean @@ -63,6 +64,7 @@ const stopTimers = (timers: string[]) => `systemctl --user stop ${timers.join(" /** * `store recover`: what is wrong with the store and what to run, reading every page. Changes nothing in the store; it * records the check beside it, and one that passes lifts the damage mark. + * @experimental */ export const storeRecoveryCheck = async ( env: NodeJS.ProcessEnv, @@ -123,6 +125,7 @@ export const storeRecoveryCheck = async ( } } +/** @experimental */ export type RecoveryRun = Omit & { /** `sqlite3` reported these while copying; most are rows that broke a constraint and were skipped. */ copyErrors: number @@ -131,7 +134,10 @@ export type RecoveryRun = Omit & { next: string[] } -/** `store recover run`: refuses while a WireCat timer is scheduled, so none writes to the file being replaced. */ +/** + * `store recover run`: refuses while a WireCat timer is scheduled, so none writes to the file being replaced. + * @experimental + */ export const storeRecoveryRun = async ( env: NodeJS.ProcessEnv, { @@ -196,7 +202,7 @@ const refetchNotes = ({ since, chats, mail }: RecoveryRun["refetch"]): string[] ] } -/** The lines a person reads under the answer; the JSON carries the same in its fields. */ +/** The lines a person reads under the answer; the JSON carries the same in its fields. @experimental */ export const recoveryNotes = (answer: RecoveryCheck | RecoveryRun): string[] => { if ("keptAt" in answer) { const lost = answer.lost.map( @@ -240,7 +246,7 @@ export const recoveryNotes = (answer: RecoveryCheck | RecoveryRun): string[] => ] } -/** `store recover` and `store recover run`, for a CLI whose commands run on cli-core's context. */ +/** `store recover` and `store recover run`, for a CLI whose commands run on cli-core's context. @experimental */ export const storeRecoverCommand = ({ command, version }: { command: string; version?: string }): Command => { const recover = annotate(new Command("recover"), { effects: LOCAL_READ, examples: [`${command} store recover`] }) .summary("what is damaged in the store and how to recover it") diff --git a/src/cli/store-settings.ts b/src/cli/store-settings.ts index 5400998a1..f9cf6c81f 100644 --- a/src/cli/store-settings.ts +++ b/src/cli/store-settings.ts @@ -59,7 +59,7 @@ const AGENT_CLOSE = "task_agent_close" const AGENT_CLOSE_MIN = "task_agent_close_min" const FIRST_PASS = "task_first_pass_per_chat" -/** Settings of the store file, not of a profile: the store is one file for every profile, tg and MAX. */ +/** Settings of the store file, not of a profile: the store is one file for every profile, tg and MAX. @experimental */ export const STORE_SETTINGS = [ ...Object.keys(SCRIPTS), OWNER_LANGUAGES, @@ -116,6 +116,7 @@ export const isOwnerOnlyStoreSetting = (setting: string): boolean => { ) } +/** @experimental */ export const isStoreSetting = (setting: string): boolean => setting in SCRIPTS || setting === OWNER_LANGUAGES || @@ -128,6 +129,7 @@ export const isStoreSetting = (setting: string): boolean => setting.startsWith(GROUP_PREFIX) || parseCrmSetting(setting) !== undefined +/** @experimental */ export const changeStoreSetting = async ( app: AppIdentity, env: NodeJS.ProcessEnv, @@ -423,7 +425,10 @@ const categoryRows = (saved: readonly TaskCategory[] | undefined, file: string) })) } -/** For `config show`: reads the file as it is — never creates, migrates or unseals it to say the defaults apply. */ +/** + * For `config show`: reads the file as it is — never creates, migrates or unseals it to say the defaults apply. + * @experimental + */ export const storeSettings = async (env: NodeJS.ProcessEnv) => { const path = storePath(env) let saved: Stemmers | null | undefined diff --git a/src/cli/templates-command.ts b/src/cli/templates-command.ts index 088934cf0..86a5b9fd8 100644 --- a/src/cli/templates-command.ts +++ b/src/cli/templates-command.ts @@ -34,6 +34,7 @@ import { type Body, itemOf, listOf } from "./envelope.js" import { type QueryWords, queryTerms, withQuery } from "./list-query.js" import { ownerLanguageOf, scheduleState } from "./schedule/schedule-command.js" +/** @experimental */ export interface TemplatesOptions { env: () => NodeJS.ProcessEnv output: (answer: Body, command: Command) => void diff --git a/src/cli/unknown-profile.ts b/src/cli/unknown-profile.ts index a58e6f322..23eaaf0db 100644 --- a/src/cli/unknown-profile.ts +++ b/src/cli/unknown-profile.ts @@ -14,7 +14,7 @@ const typo = (source: string | undefined, here: readonly string[]) => /** * A "not signed in" failure for a first word this computer has never seen as a profile is most likely a typo: it - * answers `not_found` with the profiles here (FIND-2583), and keeps the sign-in hint for a profile that is new on + * answers `not_found` with the profiles here, and keeps the sign-in hint for a profile that is new on * purpose. Only after a command failed, and never for `setup` or `session start`, which make a new one. The first word and `_PROFILE` are checked, since a typo in either is as likely; a bot gets * its token with `bot auth set` under any new name. */ diff --git a/src/content/cli/index.ts b/src/content/cli/index.ts index e356da7c0..762feb23a 100644 --- a/src/content/cli/index.ts +++ b/src/content/cli/index.ts @@ -8,7 +8,7 @@ import * as v from "valibot" import { answerEntity } from "../../cli/answer-entity.js" import { environmentOf, inCommandRun, outputFor, runBudgetOf } from "../../cli/context.js" import { honoursDryRun } from "../../cli/dry-run-guard.js" -import { FETCH, LOCAL_READ, NO_EFFECTS, REMOTE_WRITE } from "../../cli/effects.js" +import { allowDeletionsOption, FETCH, LOCAL_READ, NO_EFFECTS, REMOTE_WRITE } from "../../cli/effects.js" import { type Body, itemOf, listOf, renderAnswer } from "../../cli/envelope.js" import { listQuery, @@ -180,8 +180,9 @@ const addContentCommandsDefinition = (program: Command, options: ContentCommandO "sync --rescan", ) .option("--rescan", "list everything again, every id too, dropping a round in progress") + .addOption(allowDeletionsOption()) .option("--max-pages ", "at most this many requests to the source in this run", integer(100_000)) - .action(async (opts: { maxPages?: number; rescan?: boolean }, command: Command) => { + .action(async (opts: { maxPages?: number; rescan?: boolean; allowDeletions?: number }, command: Command) => { const { signal } = environmentOf(command) await within(command, false, async (run) => { const report = await syncContent(run.source(), run.store, run.account, { @@ -189,6 +190,7 @@ const addContentCommandsDefinition = (program: Command, options: ContentCommandO budget: runBudgetOf(command, opts.maxPages), ...(signal ? { signal } : {}), ...(opts.rescan ? { rescan: true } : {}), + ...(opts.allowDeletions ? { allowDeletions: opts.allowDeletions } : {}), }) const failed = report.synced.filter((one) => one.error !== undefined) const next: NextStep[] | undefined = diff --git a/src/content/manifest/source.ts b/src/content/manifest/source.ts index e448875f2..277151b4d 100644 --- a/src/content/manifest/source.ts +++ b/src/content/manifest/source.ts @@ -1,5 +1,5 @@ import { CliError, isCliError } from "@wirecat/cli-base" -import type { Pagination } from "@wirecat/cli-base/codegen" +import type { Pagination } from "@wirecat/cli-base/codegen/runtime" import type { ApiCommandInput } from "../../cli/bot/api.js" import type { ServiceApiCall } from "../../cli/service-api-call.js" import { nextPage, parameterValue, type ServiceApiManifest, withValue } from "../../cli/service-api-manifest.js" diff --git a/src/content/sync.ts b/src/content/sync.ts index 40e15624e..42658fcbd 100644 --- a/src/content/sync.ts +++ b/src/content/sync.ts @@ -15,6 +15,8 @@ const MOST_DUE = 50 interface Mode { drop: boolean full: boolean + /** `--allow-deletions `: how many an id pass the guard holds may still mark deleted. */ + allowed: number } interface ContentCursor { @@ -70,6 +72,8 @@ export interface ContentSyncOptions { now?: number /** List everything again and every id, dropping a round in progress: `sync --rescan`. */ rescan?: boolean + /** Let a pass the guard holds mark up to this many deleted: `sync --allow-deletions `. */ + allowDeletions?: number budget?: RunBudget signal?: AbortSignal /** How long a complete id pass holds before the next one; a day when absent. */ @@ -237,7 +241,7 @@ const passIds = async (run: Run, kind: ContentKind, result: ContentSyncResult, m const moved = (run.report.moved?.length ?? 0) > 0 const emptied = pass.ids.length === 0 && unlisted > 0 const many = emptied || (stored >= GUARDED_FROM && unlisted > stored * MOST_UNLISTED) - if (unlisted > 0 && (unread || (moved && !mode.full) || (many && !mode.full))) { + if (unlisted > 0 && (unread || (moved && !mode.full) || (many && unlisted > mode.allowed))) { result.pass = "held" result.held = unread ? `${source.provider} could not read all ${kind}s, so the ${unlisted} it did not list stay; nothing was ` + @@ -246,7 +250,8 @@ const passIds = async (run: Run, kind: ContentKind, result: ContentSyncResult, m ? `the site's address changed since the last sync, so the ${unlisted} ${kind}s it did not list stay; ` + "nothing was marked deleted. If the site moved, run sync --rescan" : `${source.provider} listed ${pass.ids.length} ${kind} ids, so ${unlisted} of the ${stored} stored ` + - "would be marked deleted; nothing was. Check the sign-in's rights, then run sync --rescan to let it through" + "would be marked deleted; nothing was. Check the sign-in's rights, then run sync --allow-deletions " + + `${unlisted} to let them through` } else { const why = await confirmGone(run, kind, missing, result) if (why) { @@ -440,7 +445,11 @@ export const syncContent = async ( ? null : parsed<{ v: 1; done: ContentKind[]; rescan?: true }>((await store.sync.syncState(account, RESUME))?.value) const done = new Set(resumed?.done ?? []) - const mode: Mode = { drop: options.rescan === true, full: options.rescan === true || resumed?.rescan === true } + const mode: Mode = { + drop: options.rescan === true, + full: options.rescan === true || resumed?.rescan === true, + allowed: options.allowDeletions ?? 0, + } await readChannels(run, mode.full) if (resumed) for (const gap of await contentGapsOf(store, account)) diff --git a/src/content/testing/manifest-fake.ts b/src/content/testing/manifest-fake.ts index d45cff184..25524205f 100644 --- a/src/content/testing/manifest-fake.ts +++ b/src/content/testing/manifest-fake.ts @@ -1,5 +1,5 @@ import { CliError } from "@wirecat/cli-base" -import type { ManifestOperation, PageParameter } from "@wirecat/cli-base/codegen" +import type { ManifestOperation, PageParameter } from "@wirecat/cli-base/codegen/runtime" import type { ApiCommandInput } from "../../cli/bot/api.js" import type { ServiceApiManifest } from "../../cli/service-api-manifest.js" import type { CrmOperationCall, CrmRule } from "../../crm/manifest/manifest.js" diff --git a/src/content/testing/sync-contract.ts b/src/content/testing/sync-contract.ts index f00799c09..34a36ee4c 100644 --- a/src/content/testing/sync-contract.ts +++ b/src/content/testing/sync-contract.ts @@ -123,7 +123,7 @@ export const contentSyncContract = (make: () => ContentSyncFixture | Promise { + test("a list of no ids marks nothing deleted, past --rescan; --allow-deletions lets it through", async (c) => { await c.sync() for (const id of ["10", "11", "12"]) c.source.remove("post", id) later() @@ -131,7 +131,11 @@ export const contentSyncContract = (make: () => ContentSyncFixture | Promise one.kind === "post")?.pass, "held") assert.deepEqual(await c.posts(), ["10", "11", "12"]) const rescan = await c.sync({ rescan: true }) - assert.equal(rescan.synced.find((one) => one.kind === "post")?.pass, "complete") + assert.equal(rescan.synced.find((one) => one.kind === "post")?.pass, "held") + assert.deepEqual(await c.posts(), ["10", "11", "12"]) + later() + const accepted = await c.sync({ allowDeletions: 3 }) + assert.equal(accepted.synced.find((one) => one.kind === "post")?.pass, "complete") assert.deepEqual(await c.posts(), []) }), test("a site whose address changed holds its deletions until a rescan", async (c) => { diff --git a/src/content/writer.ts b/src/content/writer.ts index 073a23c06..bf2ef25f7 100644 --- a/src/content/writer.ts +++ b/src/content/writer.ts @@ -63,7 +63,7 @@ export const CONTENT_WRITE_KEYS: readonly PermissionKey[] = [POSTS_PUBLISH_KEY, /** * Built in, and only ever tightening (WC-PERM-7). Every write asks: a draft is not public, but publishing is, and the - * owner chose `ask` for it too (NEED-2720 B). A deletion for good asks as well. + * owner chose `ask` for it too. A deletion for good asks as well. */ export const CONTENT_WRITE_DEFAULTS: Readonly> = { "posts.create": "ask", diff --git a/src/context/evidence.ts b/src/context/evidence.ts index 227ef021a..c9024e917 100644 --- a/src/context/evidence.ts +++ b/src/context/evidence.ts @@ -9,6 +9,7 @@ export interface ContextSource { provider: string account: string } +/** @experimental */ export interface ContextEvidenceRequest { source: ContextSource /** Required unless `chat` is given; a chat read takes no query. */ @@ -24,6 +25,7 @@ export interface ContextEvidenceRequest { cursor?: { at: number; id: number; scope: string } signal?: AbortSignal } +/** @experimental */ export interface ContextEvidenceItem { ref: string provider: string @@ -49,6 +51,7 @@ export interface ContextEvidenceSender { /** The identity is the owner's: linked to the owner person, or the account's own. */ owner: boolean } +/** @experimental */ export interface ContextEvidencePage { source: ContextSource items: ContextEvidenceItem[] @@ -66,6 +69,7 @@ export interface ContextEvidencePage { consistency: "snapshot-per-page" } } +/** @experimental */ export interface ContextEvidenceReader { read(request: ContextEvidenceRequest): Promise } diff --git a/src/crm/cli/files.ts b/src/crm/cli/files.ts index a718bab2e..b2502432c 100644 --- a/src/crm/cli/files.ts +++ b/src/crm/cli/files.ts @@ -23,6 +23,7 @@ import { answerEntity } from "../../cli/answer-entity.js" import { environmentOf, outputFor, runBudgetOf } from "../../cli/context.js" import { FETCH, REMOTE_READ } from "../../cli/effects.js" import { itemOf, listOf } from "../../cli/envelope.js" +import { notLocalPaths } from "../../cli/path-options.js" import { commandLevel } from "../../cli/search-left-out.js" import { lineOf } from "../../cli/steps.js" import { normalCrmUserId } from "../../domain/crm.js" @@ -453,7 +454,7 @@ export interface CrmFileCommandOptions { now: () => number } -/** `files list`, `files download` and `files sync` (NEED-2701 C, NEED-2708 B). */ +/** `files list`, `files download` and `files sync`. */ export const addCrmFileCommands = (program: Command, options: CrmFileCommandOptions): void => { const { within, example, app, now } = options const kinds = OWNER_FLAGS.filter(([kind]) => kind !== "lead" || options.leads !== false) @@ -461,7 +462,7 @@ export const addCrmFileCommands = (program: Command, options: CrmFileCommandOpti const { signal } = environmentOf(command) return { app, run, now, ...(signal ? { signal } : {}) } } - const group = annotate(program.command("files"), { effects: REMOTE_READ }).description( + const group = notLocalPaths(annotate(program.command("files"), { effects: REMOTE_READ }), "file").description( "the files of the CRM's deals, leads, contacts and companies: listed live, downloaded on demand, their text " + "found by search all", ) diff --git a/src/crm/cli/index.ts b/src/crm/cli/index.ts index 50b069c7a..6325e5f18 100644 --- a/src/crm/cli/index.ts +++ b/src/crm/cli/index.ts @@ -7,7 +7,7 @@ import * as v from "valibot" import { answerEntity } from "../../cli/answer-entity.js" import { environmentOf, inCommandRun, outputFor, runBudgetOf } from "../../cli/context.js" import { honoursDryRun } from "../../cli/dry-run-guard.js" -import { FETCH, LOCAL_READ, LOCAL_WRITE, NO_EFFECTS, REMOTE_WRITE } from "../../cli/effects.js" +import { allowDeletionsOption, FETCH, LOCAL_READ, LOCAL_WRITE, NO_EFFECTS, REMOTE_WRITE } from "../../cli/effects.js" import { type Body, itemOf, listOf, renderAnswer, snakeKeys, snakeKeysKeeping } from "../../cli/envelope.js" import { listQuery, @@ -100,7 +100,7 @@ export interface CrmRun { /** * The sign-in's own user id in the CRM, as the sign-in entry keeps it, read without the network. The copy's deals * and leads read offline are only this user's unless a sync found it the CRM's administrator; `null`, a CRM that - * limits its users shows none of them (SEC-197). A CRM that limits nobody passes `null`. + * limits its users shows none of them. A CRM that limits nobody passes `null`. */ user: string | null /** A profile lock pins the process (WC-ACCT-5): `search all` then reads only this account's deals. */ @@ -330,6 +330,8 @@ export type CrmWithin = ( view?: (body: Body) => string, ) => Promise +type SyncFlags = { maxPages?: number; rescan?: boolean; embed?: boolean; allowDeletions?: number } + const addCrmCommandsDefinition = (program: Command, options: CrmCommandOptions): void => { const now = () => options.now?.() ?? Date.now() const within: CrmWithin = (command, work, view) => @@ -377,18 +379,19 @@ const addCrmCommandsDefinition = (program: Command, options: CrmCommandOptions): "sync --embed", ) .option("--rescan", "list everything again, every id too, dropping a round in progress") + .addOption(allowDeletionsOption()) .option("--max-pages ", "at most this many requests to the CRM in this run", integer(100_000)) .option("--embed", "also index new activities and tasks for search all by meaning, with a model already downloaded") - .action(async (opts: { maxPages?: number; rescan?: boolean; embed?: boolean }, command: Command) => { - const { signal } = environmentOf(command) + .action(async (opts: SyncFlags, command: Command) => { await within(command, async (run) => { const source = run.source() const started = now() const report = await syncRecorded(source, run.store, run.account, { now: started, budget: runBudgetOf(command, opts.maxPages), - ...(signal ? { signal } : {}), - ...(opts.rescan ? { rescan: true } : {}), + signal: environmentOf(command).signal, + rescan: opts.rescan, + allowDeletions: opts.allowDeletions, }) const stageTasks = await openStageTasks(run.store, run.account, started, { history: source.stageHistory !== undefined, diff --git a/src/crm/cli/records.ts b/src/crm/cli/records.ts index c2a484b3c..69e57974e 100644 --- a/src/crm/cli/records.ts +++ b/src/crm/cli/records.ts @@ -265,7 +265,7 @@ export interface CrmRecordCommandOptions { now: () => number } -/** `people`, `organizations` and `users`: read live from the CRM, so `--offline` is refused (NEED-2661). */ +/** `people`, `organizations` and `users`: read live from the CRM, so `--offline` is refused. */ export const addCrmRecordCommands = (program: Command, options: CrmRecordCommandOptions): void => { const { within, example } = options const quotaOf = (run: CrmRun) => diff --git a/src/crm/digest.ts b/src/crm/digest.ts index b4f09a1ff..8493cda75 100644 --- a/src/crm/digest.ts +++ b/src/crm/digest.ts @@ -52,7 +52,7 @@ export interface CrmDigestOptions { language: string /** The profile's name, for the sync's age. */ profile: string - /** A profile that may read only part of the copy (SEC-197). */ + /** A profile that may read only part of the copy. */ viewer?: CopyViewer /** The viewer's rule hid rows it should not have: the summary says so. */ hidden?: boolean diff --git a/src/crm/foreign-contacts.ts b/src/crm/foreign-contacts.ts index fd7e52bda..3459196c8 100644 --- a/src/crm/foreign-contacts.ts +++ b/src/crm/foreign-contacts.ts @@ -9,7 +9,7 @@ import type { CrmLiveKind, CrmSource } from "./source.js" import { CRM_SHARED_FOLDERS } from "./state-folders.js" /** - * The owner's rule (NEED-2487, NEED-2703 B): a user sees at most this many other people's records a UTC day: a + * The owner's rule: a user sees at most this many other people's records a UTC day: a * contact's or company's details, or a deal's, lead's, contact's or company's files. */ export const DAILY_FOREIGN_CONTACTS = 100 @@ -146,7 +146,7 @@ export const foreignContacts = ( /** * `api call` of a method that returns contacts or companies or their contact data: only the CRM's administrator - * makes it (NEED-2488), since one raw list would hand over the whole client base past the day's limit. The CLI knows + * makes it, since one raw list would hand over the whole client base past the day's limit. The CLI knows * its methods and says which read clients; a source without `isAdmin` is not limited. */ export const refuseForeignClientReads = async (source: CrmSource, readsClients: boolean, method: string) => { diff --git a/src/crm/manifest/paths.ts b/src/crm/manifest/paths.ts index d5404737a..c0293dc03 100644 --- a/src/crm/manifest/paths.ts +++ b/src/crm/manifest/paths.ts @@ -1,4 +1,4 @@ -import type { ManifestOperation, SchemaNode } from "@wirecat/cli-base/codegen" +import type { ManifestOperation, SchemaNode } from "@wirecat/cli-base/codegen/runtime" import type { ServiceApiManifest } from "../../cli/service-api-manifest.js" import { editDistance } from "../../search/correct.js" import type { CrmManifest, CrmOperationCall, CrmRule } from "./manifest.js" diff --git a/src/crm/manifest/source.ts b/src/crm/manifest/source.ts index d577a6b01..f2dd8ab82 100644 --- a/src/crm/manifest/source.ts +++ b/src/crm/manifest/source.ts @@ -1,5 +1,5 @@ import { CliError, isCliError } from "@wirecat/cli-base" -import type { Pagination } from "@wirecat/cli-base/codegen" +import type { Pagination } from "@wirecat/cli-base/codegen/runtime" import type { ApiCommandInput } from "../../cli/bot/api.js" import type { ServiceApiCall } from "../../cli/service-api-call.js" import { nextPage, parameterValue, type ServiceApiManifest, withValue } from "../../cli/service-api-manifest.js" diff --git a/src/crm/source.ts b/src/crm/source.ts index 7f6323e37..2178e5fd5 100644 --- a/src/crm/source.ts +++ b/src/crm/source.ts @@ -174,7 +174,7 @@ export interface CrmSource { /** Every user of the account, active or not; a CRM that cannot list them leaves it out, and its users stay. */ users?(context?: CrmCallContext): Promise /** - * Contacts or companies read live from the CRM, newest first: the copy holds only the owner's own (NEED-2661), so + * Contacts or companies read live from the CRM, newest first: the copy holds only the owner's own, so * `people list` finds another client here. Each record carries its custom values in `metadata` (`crmValuesOf`). */ list?(kind: K, query: CrmLiveQuery, context?: CrmCallContext): Promise> @@ -182,7 +182,7 @@ export interface CrmSource { get?(kind: K, id: string, context?: CrmCallContext): Promise /** * Whether the sign-in is the CRM's administrator. With it, anyone else sees the phones and e-mails only of their own - * clients and at most `DAILY_FOREIGN_CONTACTS` other contacts or companies a day (NEED-2487, `foreignContacts`); + * clients and at most `DAILY_FOREIGN_CONTACTS` other contacts or companies a day (`foreignContacts`); * left out, the rule does not apply. */ isAdmin?(): Promise diff --git a/src/crm/sync.test.ts b/src/crm/sync.test.ts index 8fceb9ff3..b3ac615ed 100644 --- a/src/crm/sync.test.ts +++ b/src/crm/sync.test.ts @@ -565,3 +565,34 @@ it("while a narrowing is held, the id pass still marks deleted a deal in the sco expect(held).toMatchObject({ held: true, outOfScope: 0, unlisted: 1, pass: "complete" }) expect(await deals()).toEqual(["d1", "d3", "d4", "d5", "d6"]) }) + +// INT-3: the same rule as the tracker's id pass, so what a sign-in cannot read never reads as deleted. +it("holds an id pass after the adapter said it could not read the whole kind, whatever the flags", async () => { + const store = await openStore({ path: join(mkdtempSync(join(tmpdir(), "crm-gap-")), "store.db") }) + stores.push(store) + const source = fakeCrmSource() + for (let at = 1; at <= 12; at += 1) source.put("deal", exampleDeal(`d${at}`)) + const day = 86_400_000 + const start = Date.now() + await syncCrm(source, store, PORTAL, { now: start }) + source.delete("deal", "d3") + source.delete("deal", "d4") + const gapped = { + ...source, + ids: (async (kind, page, context) => { + if (kind === "deal") context?.gap({ kind, message: "the sign-in cannot read one pipeline" }) + return source.ids?.(kind, page, context) + }) as typeof source.ids, + } + const live = async () => (await store.deals.list({ account: PORTAL, kind: "deal" })).items.length + + const held = await syncCrm(gapped, store, PORTAL, { now: start + 2 * day }) + expect(held.synced.find(({ kind }) => kind === "deal")).toMatchObject({ pass: "held", unlisted: 0 }) + expect(held.issues.find(({ kind }) => kind === "deal")?.message).toMatch(/could not read all deals/) + const forced = await syncCrm(gapped, store, PORTAL, { now: start + 4 * day, rescan: true, allowDeletions: 100 }) + expect(forced.synced.find(({ kind }) => kind === "deal")?.pass).toBe("held") + expect(await live()).toBe(12) + + const whole = await syncCrm(source, store, PORTAL, { now: start + 6 * day }) + expect(whole.synced.find(({ kind }) => kind === "deal")).toMatchObject({ pass: "complete", unlisted: 2 }) +}) diff --git a/src/crm/sync.ts b/src/crm/sync.ts index 9a8c5810e..e29d32459 100644 --- a/src/crm/sync.ts +++ b/src/crm/sync.ts @@ -41,6 +41,8 @@ interface PendingPass { page: string | null startedAt: number seen: string[] + /** The adapter said, on a page of this pass, that it could not read the whole kind. */ + unread?: true } /** What the engine keeps per kind in `store.sync` under `crm:`. */ @@ -76,7 +78,8 @@ export const parseCrmCursor = (value: string | null | undefined): CrmCursor | nu (!isToken(pass.page) || typeof pass.startedAt !== "number" || !Array.isArray(pass.seen) || - pass.seen.some((id) => typeof id !== "string")) + pass.seen.some((id) => typeof id !== "string") || + (pass.unread !== undefined && pass.unread !== true)) ) return null return { @@ -101,6 +104,8 @@ export interface CrmSyncOptions { now?: number /** List everything again and every id, dropping a round in progress: `sync --rescan`. */ rescan?: boolean + /** Let a pass the guard holds mark up to this many deleted: `sync --allow-deletions `. */ + allowDeletions?: number /** Asked before every request to the CRM; without one the run goes until every kind is done. */ budget?: RunBudget /** Checked after every request: a cancelled run stops and keeps what it saved. */ @@ -648,6 +653,7 @@ const syncKind = async (run: Run, kind: CrmKind, options: CrmSyncOptions, result if (page.hasMore && page.nextCursor === undefined) throw new CliError("invalid_response", `${source.provider} said there are more ids but gave no cursor`) pass = { ...pass, seen: [...pass.seen, ...page.items], page: page.hasMore ? (page.nextCursor ?? null) : null } + if (run.gaps.some((gap) => gap.kind === kind)) pass = { ...pass, unread: true } run.moved() if (!page.hasMore) break await save({ pass }) @@ -656,14 +662,20 @@ const syncKind = async (run: Run, kind: CrmKind, options: CrmSyncOptions, result const stored = await store.crm.count(account, kind) const unlisted = await store.crm.removeUnlisted(account, kind, pass.seen, before, { ...listedOf, dryRun: true }) const emptied = pass.seen.length === 0 && unlisted > 0 - if (!options.rescan && (emptied || (stored >= GUARDED_FROM && unlisted > stored * MOST_UNLISTED))) { + const many = emptied || (stored >= GUARDED_FROM && unlisted > stored * MOST_UNLISTED) + // What the sign-in could not read is not gone: no flag lets that through. + const unread = pass.unread === true || run.gaps.some((gap) => gap.kind === kind) + if (unlisted > 0 && (unread || (many && unlisted > (options.allowDeletions ?? 0)))) { result.pass = "held" run.report.issues.push({ kind, reason: "crm.unlisted-held", - message: - `${source.provider} listed ${pass.seen.length} ${kind} ids, so ${unlisted} of the ${stored} stored would be ` + - "marked deleted; nothing was — check the sign-in's rights, then run sync --rescan to let it through", + message: unread + ? `${source.provider} could not read all ${kind}s, so the ${unlisted} it did not list stay; nothing was ` + + "marked deleted — check the sign-in's rights, then run sync again" + : `${source.provider} listed ${pass.seen.length} ${kind} ids, so ${unlisted} of the ${stored} stored would ` + + "be marked deleted; nothing was — check the sign-in's rights, then run sync --allow-deletions " + + `${unlisted} to let them through`, }) } else { result.unlisted = await store.crm.removeUnlisted(account, kind, pass.seen, before, listedOf) @@ -680,8 +692,8 @@ const syncKind = async (run: Run, kind: CrmKind, options: CrmSyncOptions, result * the account's users and departments, deals and leads, each from its cursor or listed in full, a page at a time, * each page saved with the round's place in the cursor, so a run the budget stops, or one that fails, goes on from * there. Relationships held back for an end not stored yet are written at the end of the run. Deletions come from `changes()`, or - * from a list of every id that marks only after its last page arrived, and never more than half of a kind without - * `--rescan`. + * from a list of every id that marks only after its last page arrived, never what the adapter said it could not read, + * and never more than half of a kind without `--allow-deletions`. */ export const syncCrm = async ( source: CrmSource, diff --git a/src/crm/testing/manifest-fake.ts b/src/crm/testing/manifest-fake.ts index 6d4876306..2384d0e5a 100644 --- a/src/crm/testing/manifest-fake.ts +++ b/src/crm/testing/manifest-fake.ts @@ -1,12 +1,5 @@ -import { - type FakeAnswer, - type FakeApi, - type FakeCall, - fakeApi, - type Pagination, - type SchemaNode, - sampleOf, -} from "@wirecat/cli-base/codegen" +import { type FakeAnswer, type FakeApi, type FakeCall, fakeApi, sampleOf } from "@wirecat/cli-base/codegen" +import type { Pagination, SchemaNode } from "@wirecat/cli-base/codegen/runtime" import { serviceApiCall, serviceApiSend } from "../../cli/service-api-call.js" import { manifestBaseUrl, type ServiceApiManifest } from "../../cli/service-api-manifest.js" import type { CrmKind } from "../../domain/crm.js" diff --git a/src/crm/testing/sync-contract.ts b/src/crm/testing/sync-contract.ts index f4afd42b6..805fd5350 100644 --- a/src/crm/testing/sync-contract.ts +++ b/src/crm/testing/sync-contract.ts @@ -132,7 +132,7 @@ export const crmSyncContract = (make: () => CrmSyncFixture | Promise CrmSyncFixture | Promise kind === "deal")?.pass, "held") assert.ok(held.issues.some(({ reason }) => reason === "crm.unlisted-held")) assert.equal((await deals()).length, 12) - await sync({ rescan: true }) + now += DAY + const rescan = await sync({ rescan: true }) + assert.equal(rescan.synced.find(({ kind }) => kind === "deal")?.pass, "held") + assert.equal((await deals()).length, 12) + now += DAY + await sync({ allowDeletions: 12 }) assert.deepEqual(await deals(), []) }), test("stores each kind's own fields, and marks deleted one the CRM no longer lists", async ({ diff --git a/src/crm/viewer.ts b/src/crm/viewer.ts index 29b75d197..fa11fe6c4 100644 --- a/src/crm/viewer.ts +++ b/src/crm/viewer.ts @@ -9,7 +9,7 @@ import type { CrmSource } from "./source.js" const VIEWERS = "crm:viewers" interface Viewers { - /** The CRM limits what its users see (NEED-2660): it names the sign-in's user or answers `isAdmin`. */ + /** The CRM limits what its users see: it names the sign-in's user or answers `isAdmin`. */ limited: boolean /** Each user a sync signed in as, and whether the CRM said it is the administrator then. */ admins: Record @@ -50,7 +50,7 @@ export interface CrmViewing { } /** - * Whose deals and leads of the copy a profile reads offline (SEC-197): every one when the CRM limits nobody or a sync + * Whose deals and leads of the copy a profile reads offline: every one when the CRM limits nobody or a sync * found `user` its administrator; otherwise, a copy no sync recorded the rule of too, only those assigned to `user`, * and none when `user` is unknown. The network is never asked. */ @@ -92,7 +92,7 @@ export const viewerOf = async (run: { store: MessageStore; account: AccountKey; } /** - * The row with `deal`, the deal a lead became, left out when a viewer may not read that deal (SEC-197): a lead the + * The row with `deal`, the deal a lead became, left out when a viewer may not read that deal: a lead the * profile reads must not name a colleague's deal. */ export const withReadableDeal = async ( diff --git a/src/crm/writes.ts b/src/crm/writes.ts index 92989637a..a9560736c 100644 --- a/src/crm/writes.ts +++ b/src/crm/writes.ts @@ -587,9 +587,9 @@ export interface CrmRecordInput { export interface CrmRecordWritten { operationId: string - /** The CRM's answer; one that is not the sign-in's client comes without its phones and e-mails (NEED-2487). */ + /** The CRM's answer; one that is not the sign-in's client comes without its phones and e-mails. */ record: K extends "person" ? CrmPerson : CrmOrganization - /** Whether the copy keeps it: only the sign-in's own clients are stored (NEED-2661). */ + /** Whether the copy keeps it: only the sign-in's own clients are stored. */ stored: boolean /** * After an update that gave it to someone else, whether the copy let it go: `false` when it stays, because the @@ -669,7 +669,7 @@ const keptRecord = async (context: CrmWriteContext, kind: CrmRecordKind, record: } /** - * A contact or company the update gave to someone else leaves the copy (NEED-2661), as `removeCrmItem` removes a deal: + * A contact or company the update gave to someone else leaves the copy, as `removeCrmItem` removes a deal: * a contact with its identity, which held the phones and e-mails it was saved with. */ const forgotten = async (context: CrmWriteContext, kind: CrmRecordKind, record: CrmPerson | CrmOrganization) => diff --git a/src/domain/addresses.ts b/src/domain/addresses.ts index 682befe3f..162301a6a 100644 --- a/src/domain/addresses.ts +++ b/src/domain/addresses.ts @@ -4,7 +4,7 @@ export const EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u /** Whether a lower-cased, trimmed value is an email address. */ export const isEmailAddress = (value: string): boolean => EMAIL_ADDRESS.test(value) -/** Local parts that name a mailbox, not a person; the no-reply family names no one at all. */ +/** Local parts that name a mailbox, not a person; the no-reply family names no one at all. @experimental */ export const ROLE_ADDRESS_WORDS = { noReply: ["noreply", "no-reply", "donotreply", "do-not-reply", "mailer-daemon", "bounce", "bounces"], shared: [ @@ -72,7 +72,10 @@ const SEPARATORS = /[.\-_]/u const partsOf = (address: string): string[] => localPart(address).split(SEPARATORS) const NO_REPLY_PARTS = ROLE_ADDRESS_WORDS.noReply.map((word) => `.${word.split(SEPARATORS).join(".")}.`) -/** Whether the address is a no-reply one, which belongs to no person: `noreply-12345@`, `service.no-reply@`. */ +/** + * Whether the address is a no-reply one, which belongs to no person: `noreply-12345@`, `service.no-reply@`. + * @experimental + */ export const isNoReplyAddress = (address: string): boolean => { const word = localWord(address) const parts = `.${partsOf(address).join(".")}.` @@ -83,6 +86,7 @@ export const isNoReplyAddress = (address: string): boolean => { /** * Whether the whole local part, `+tag` and `.`/`-`/`_` aside, is a role word (`info@`, `Hello+news@`, `no_reply@`), * or the address is a no-reply one. + * @experimental */ export const isRoleAddress = (address: string): boolean => ROLE.has(localWord(address)) || isNoReplyAddress(address) @@ -95,5 +99,5 @@ const PERSON_LIKE = new Set(["hr"]) /** Whether the address is a role address that one person often reads alone, such as `hr@`. */ export const isPersonLikeRoleAddress = (address: string): boolean => PERSON_LIKE.has(localWord(address)) -/** Whether a program sends from the address: `notify@`, `alerts@`, `bank-notifications@`. */ +/** Whether a program sends from the address: `notify@`, `alerts@`, `bank-notifications@`. @experimental */ export const isNotificationAddress = (address: string): boolean => partsOf(address).some((part) => NOTIFY.has(part)) diff --git a/src/domain/business.ts b/src/domain/business.ts index 230f4b15e..c8c223c71 100644 --- a/src/domain/business.ts +++ b/src/domain/business.ts @@ -2,35 +2,51 @@ import { CliError } from "@wirecat/cli-base" import { dayMonth, type FinanceReview, type MoneyDirection, notes } from "./finance.js" import { moneyLabel } from "./money.js" +/** @experimental */ export const CATALOG_KINDS = ["product", "service"] as const -/** What the `business` lane of `search all` reads; transactions are too many to fold per query. */ +/** What the `business` lane of `search all` reads; transactions are too many to fold per query. @experimental */ export const BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"] as const +/** @experimental */ export type BusinessKind = (typeof BUSINESS_KINDS)[number] +/** @experimental */ export const CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"] as const +/** @experimental */ export const CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"] as const +/** @experimental */ export const PERIOD_UNITS = ["day", "week", "month", "year"] as const +/** @experimental */ export const SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"] as const +/** @experimental */ export const WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"] as const -/** Only a booked transaction counts in a balance; a pending one is shown beside it. */ +/** Only a booked transaction counts in a balance; a pending one is shown beside it. @experimental */ export const TRANSACTION_STATUSES = ["pending", "booked"] as const -/** `purchase`: the owner buys, as every order before store version 57; `sale`: the owner sells. */ +/** `purchase`: the owner buys, as every order before store version 57; `sale`: the owner sells. @experimental */ export const ORDER_DIRECTIONS = ["purchase", "sale"] as const +/** @experimental */ export type CatalogKind = (typeof CATALOG_KINDS)[number] +/** @experimental */ export type ContractKind = (typeof CONTRACT_KINDS)[number] +/** @experimental */ export type ContractStatus = (typeof CONTRACT_STATUSES)[number] +/** @experimental */ export type PeriodUnit = (typeof PERIOD_UNITS)[number] +/** @experimental */ export type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number] +/** @experimental */ export type WalletKind = (typeof WALLET_KINDS)[number] +/** @experimental */ export type TransactionStatus = (typeof TRANSACTION_STATUSES)[number] +/** @experimental */ export type OrderDirection = (typeof ORDER_DIRECTIONS)[number] +/** @experimental */ export interface Interval { count: number unit: PeriodUnit } -/** `1-month`, `2-week` or a bare `year`, as `--every` takes it. */ +/** `1-month`, `2-week` or a bare `year`, as `--every` takes it. @experimental */ export const intervalOf = (text: unknown, reason = "subscription.interval"): Interval => { const match = typeof text === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text.trim()) : null if (!match) @@ -38,6 +54,7 @@ export const intervalOf = (text: unknown, reason = "subscription.interval"): Int return { count: match[1] === undefined ? 1 : Number(match[1]), unit: match[2] as PeriodUnit } } +/** @experimental */ export const intervalText = ({ count, unit }: Interval): string => `${count}-${unit}` const priced = (units: number | null, currency: string | null) => diff --git a/src/domain/categories.ts b/src/domain/categories.ts index 539af49e8..a75ab9250 100644 --- a/src/domain/categories.ts +++ b/src/domain/categories.ts @@ -1,3 +1,3 @@ -/** What an organization is to the owner, derived from relationships at read time and never stored (NEED-2377). */ +/** What an organization is to the owner, derived from relationships at read time and never stored. */ export const CATEGORIES = ["client", "supplier", "partner", "employer"] as const export type Category = (typeof CATEGORIES)[number] diff --git a/src/domain/config-repair.ts b/src/domain/config-repair.ts index e09af07d1..63d646bc6 100644 --- a/src/domain/config-repair.ts +++ b/src/domain/config-repair.ts @@ -1,5 +1,5 @@ /** - * Repairs a settings file whose JSON is broken only in its syntax, without AI and without guessing (NEED-2178): a + * Repairs a settings file whose JSON is broken only in its syntax, without AI and without guessing: a * file can hold keys and tokens, so it never leaves the machine. A damage with one reading is fixed; anything else * is refused, and the caller changes nothing. */ diff --git a/src/domain/counters.ts b/src/domain/counters.ts index 50b156e5e..4f7065899 100644 --- a/src/domain/counters.ts +++ b/src/domain/counters.ts @@ -1,7 +1,9 @@ import { CliError } from "@wirecat/cli-base" import type { Message, Reactions } from "./models.js" +/** @experimental */ export const COUNTER_FIELDS = ["views", "reactions", "comments"] as const +/** @experimental */ export type CounterField = (typeof COUNTER_FIELDS)[number] export interface CounterObservation { value: number @@ -9,6 +11,7 @@ export interface CounterObservation { source: "remote_fetch" | "remote_update" reactions?: Reactions } +/** @experimental */ export type CounterObservations = Partial> export interface CounterState { counter: CounterField @@ -20,6 +23,7 @@ export interface CounterState { } export const validCounter = (value: unknown): value is number => typeof value === "number" && Number.isFinite(value) && value >= 0 +/** @experimental */ export const counterValue = ( message: Pick, field: CounterField, diff --git a/src/domain/crm.ts b/src/domain/crm.ts index 8c590eecc..ba5262948 100644 --- a/src/domain/crm.ts +++ b/src/domain/crm.ts @@ -1,6 +1,9 @@ import type { DealKind, DealRole, DealStatus, StageOutcome } from "./deals.js" -/** What a CRM holds that the store copies: its deals and leads, and the contacts and companies on them. */ +/** + * What a CRM holds that the store copies: its deals and leads, and the contacts and companies on them. + * @experimental + */ export const CRM_KINDS = ["organization", "person", "deal", "lead"] as const export type CrmKind = (typeof CRM_KINDS)[number] @@ -154,7 +157,7 @@ export interface CrmUser { active?: boolean } -/** A department of the own company: a user reports to its head, a head to the head of the parent. */ +/** A department of the own company: a user reports to its head, a head to the head of the parent. @experimental */ export interface CrmDepartment { externalId: string name: string @@ -176,7 +179,7 @@ export interface CrmField { /** A list field's options in the CRM's order; absent on any other field. */ options?: { id: string; label: string }[] /** - * The field holds phones or e-mails: a foreign record's value is stripped (NEED-2487). amoCRM sets it for a + * The field holds phones or e-mails: a foreign record's value is stripped. amoCRM sets it for a * `multitext` field whose `field_code` is `PHONE` or `EMAIL`, Bitrix24 for its phone and e-mail field types. */ holds?: "phone" | "email" @@ -189,7 +192,10 @@ export interface CrmRecords { organization: CrmOrganization } -/** What a CRM activity is: a call, an e-mail, a meeting, a to-do, a task of the CRM's task tracker, or a comment. */ +/** + * What a CRM activity is: a call, an e-mail, a meeting, a to-do, a task of the CRM's task tracker, or a comment. + * @experimental + */ export const CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"] as const export type CrmActivityKind = (typeof CRM_ACTIVITY_KINDS)[number] @@ -215,7 +221,10 @@ export interface CrmActivity { on: { kind: CrmKind; externalId: string }[] } -/** The account's scope settings: `also` are the users whose deals `mine` copies, in place of the sign-in's own. */ +/** + * The account's scope settings: `also` are the users whose deals `mine` copies, in place of the sign-in's own. + * @experimental + */ export type CrmScopeSetting = { mode: "all" } | { mode: "mine"; also: readonly string[]; explicit: boolean } /** @@ -224,18 +233,20 @@ export type CrmScopeSetting = { mode: "all" } | { mode: "mine"; also: readonly s * contacts are what the source lists; under `mine`, a contact no kept deal, lead or company names, and not assigned * to a user in scope, is removed after a sync that narrowed the copy or listed it again. Ids are normalised * (`normalCrmUserId`). + * @experimental */ export type CrmScope = { mode: "all" } | { mode: "mine"; self: string; also: readonly string[] } -/** A CRM's user id as `unassigned` takes it: digits, as every CRM core syncs numbers its users. */ +/** A CRM's user id as `unassigned` takes it: digits, as every CRM core syncs numbers its users. @experimental */ export const isCrmUserId = (id: string): boolean => /^\d{1,20}$/.test(id) -/** One spelling per user id, so `015`, ` 15` and `15` are one user wherever they come from. */ +/** One spelling per user id, so `015`, ` 15` and `15` are one user wherever they come from. @experimental */ export const normalCrmUserId = (id: string): string => { const text = id.trim() return /^\d+$/.test(text) ? text.replace(/^0+(?=\d)/, "") : text } +/** @experimental */ export const isItemKind = (kind: CrmKind): kind is DealKind => kind === "deal" || kind === "lead" /** diff --git a/src/domain/deals.ts b/src/domain/deals.ts index 69d72862f..5ddfd89fa 100644 --- a/src/domain/deals.ts +++ b/src/domain/deals.ts @@ -1,20 +1,23 @@ import { moneyLabel } from "./money.js" -/** A pipeline holds deals or leads, never both; a deal and a lead are rows of their own tables. */ +/** A pipeline holds deals or leads, never both; a deal and a lead are rows of their own tables. @experimental */ export const DEAL_KINDS = ["deal", "lead"] as const -/** Whether a deal or a lead ended, kept apart from the stage it stands in. */ +/** Whether a deal or a lead ended, kept apart from the stage it stands in. @experimental */ export const DEAL_STATUSES = ["open", "won", "lost"] as const -/** What reaching a stage means, as a CRM marks it: still open, or won or lost. */ +/** What reaching a stage means, as a CRM marks it: still open, or won or lost. @experimental */ export const STAGE_OUTCOMES = DEAL_STATUSES /** * The part a person plays on a deal: the owner's side runs it (`owner`, the CRM's "responsible"), the client's side * talks, decides or sways the decision. + * @experimental */ export const DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"] as const export type DealKind = (typeof DEAL_KINDS)[number] +/** @experimental */ export type DealStatus = (typeof DEAL_STATUSES)[number] export type StageOutcome = DealStatus +/** @experimental */ export type DealRole = (typeof DEAL_ROLES)[number] export interface DealTitleFields { diff --git a/src/domain/display-names.ts b/src/domain/display-names.ts index d23fbc9d5..bce03aee7 100644 --- a/src/domain/display-names.ts +++ b/src/domain/display-names.ts @@ -1,6 +1,6 @@ import { foldName } from "../resolve.js" -/** What a person can be shown as when their name has nothing to read. */ +/** What a person can be shown as when their name has nothing to read. @experimental */ export interface NameFallbacks { /** A name one of the person's accounts carries: a real name beats a handle. */ name?: string | null @@ -42,6 +42,7 @@ const given = (value: string | null | undefined): string | undefined => { * A name as it is shown: no wrapping quotes, no repeated or edge spaces. One with no letter or digit (`!`, `!$`), or a * placeholder such as `null` or «Без имени», gives way to an account's name, then the username, the phone, the email; * the stored name stays as it came. + * @experimental */ export const displayName = (name: string | null | undefined, fallbacks: NameFallbacks = {}): string | null => { const unwrapped = typeof name === "string" ? unquoted(name) : "" @@ -90,6 +91,7 @@ export const noFallbacks = (): Required => ({ name: null, usernam /** * The name two people share when case, quotes, punctuation and word order are ignored: `"Ivanov Ivan"` and * `ivan IVANOV` give one key. `null` for a name with no letter or digit, which matches nobody. + * @experimental */ export const nameKey = (name: string | null | undefined): string | null => { if (typeof name !== "string") return null diff --git a/src/domain/finance.ts b/src/domain/finance.ts index 2956bec5a..e27c01fce 100644 --- a/src/domain/finance.ts +++ b/src/domain/finance.ts @@ -1,15 +1,21 @@ import { moneyLabel } from "./money.js" +/** @experimental */ export const INVOICE_DIRECTIONS = ["receivable", "payable"] as const +/** @experimental */ export const INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"] as const -/** `in` is money to the owner, `out` money from the owner. */ +/** `in` is money to the owner, `out` money from the owner. @experimental */ export const MONEY_DIRECTIONS = ["in", "out"] as const -/** The owner's entry is confirmed at once; an agent's or an import's waits as proposed. */ +/** The owner's entry is confirmed at once; an agent's or an import's waits as proposed. @experimental */ export const FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"] as const +/** @experimental */ export type InvoiceDirection = (typeof INVOICE_DIRECTIONS)[number] +/** @experimental */ export type InvoiceStatus = (typeof INVOICE_STATUSES)[number] +/** @experimental */ export type MoneyDirection = (typeof MONEY_DIRECTIONS)[number] +/** @experimental */ export type FinanceReview = (typeof FINANCE_REVIEWS)[number] /** An invoice's status from what confirmed payments settle; `draft` and `void` are the owner's and stay. */ diff --git a/src/domain/formatting.ts b/src/domain/formatting.ts index cf2438dab..f1e0f9179 100644 --- a/src/domain/formatting.ts +++ b/src/domain/formatting.ts @@ -28,6 +28,7 @@ export interface MarkdownFormatting { formatMarkdown(text: string): Promise } +/** @experimental */ export interface HtmlFormatting { formatHtml(text: string): Promise } diff --git a/src/domain/knowledge.ts b/src/domain/knowledge.ts index 448eb134c..8d5cdc41c 100644 --- a/src/domain/knowledge.ts +++ b/src/domain/knowledge.ts @@ -1,12 +1,17 @@ import { TASK_KINDS } from "../tasks/index.js" export { FACT_TYPES } from "../meetings/index.js" +/** @experimental */ export const FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"] as const +/** @experimental */ export const MEMORY_KINDS = ["summary", "digest", "preference"] as const +/** @experimental */ export const MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"] as const +/** @experimental */ export const MEMORY_SCOPES = ["personal", "work"] as const -/** What the store writes itself; the task package finds only `TASK_KINDS`, in messages. */ +/** What the store writes itself; the task package finds only `TASK_KINDS`, in messages. @experimental */ export const WORK_TASK_TYPES = ["bug", "feature", "chore"] as const +/** @experimental */ export const TASK_TYPES = [...WORK_TASK_TYPES, ...TASK_KINDS] as const diff --git a/src/domain/links.ts b/src/domain/links.ts index 4d5c93a9b..0a8fa13c1 100644 --- a/src/domain/links.ts +++ b/src/domain/links.ts @@ -3,6 +3,7 @@ import { parseReference } from "./references.js" /** * What a WireCat link opens. A link only opens a screen in WireCat Desktop: no kind performs an action, a proposal * link shows the proposal and the owner presses Confirm or Reject there. + * @experimental */ export type DeepLinkTarget = | { type: "message"; provider: string; account: string; chat: string; message: string } @@ -24,15 +25,19 @@ export type DeepLinkTarget = */ | { type: "meeting"; provider: string; account: string; meeting: string } +/** @experimental */ export type LinkForm = "web" | "app" +/** @experimental */ export interface LinkConfig { /** The bounce page: the path goes after its `#`, so the host never sees it. */ base: string enabled: boolean } +/** @experimental */ export const LINK_VERSION = "v1" +/** @experimental */ export const DEFAULT_LINK_CONFIG: LinkConfig = { base: "https://wirecat.dev/o", enabled: true } const APP_PREFIX = "wirecat://open" const MAX_PATH = 512 @@ -113,12 +118,13 @@ const targetOfPath = (path: string): DeepLinkTarget | null => { } } -/** `/v1/msg/max/1001/-2002/3003`, the part both forms share. */ +/** `/v1/msg/max/1001/-2002/3003`, the part both forms share. @experimental */ export const formatLink = (target: DeepLinkTarget): string => `/${LINK_VERSION}/${pathOf(target)}` /** * The target of a link in either form (`https://…#/v1/…`, `wirecat://open/v1/…`) or of its bare path (`/v1/…`), or * `null` for anything else: another version, an unknown kind, a part too many or empty, a path over 512 characters. + * @experimental */ export const parseLink = (text: string): DeepLinkTarget | null => { const link = text.trim() @@ -141,6 +147,7 @@ const ENTITY_KINDS = new Set(["person", "project"]) /** * The refs in the order an item's one link is chosen from: a person or a project names who or what an item is about, * not where it happened, so it opens only when nothing else does. + * @experimental */ export const refsForLink = (refs: readonly string[]): string[] => [ ...refs.filter((ref) => !ENTITY_KINDS.has(ref.slice(0, ref.indexOf(":")))), @@ -152,6 +159,7 @@ export const refsForLink = (refs: readonly string[]): string[] => [ * `person:`, `project:`) is read by its own grammar; the kinds that are no reference are written as their path with a * colon after the kind: `proposal:fact%3A512`, `tasks:overdue`, `tasks:new/2026-11-07T08%3A00%3A00Z`, * `digest:2026-11-08`, `sync:telegram/1001`. + * @experimental */ export const linkTargetOf = (ref: string): DeepLinkTarget | null => { const text = ref.trim() @@ -167,7 +175,10 @@ export const linkTargetOf = (ref: string): DeepLinkTarget | null => { } } -/** The `links` section of the shared config, with the default for what is missing or not a usable value. */ +/** + * The `links` section of the shared config, with the default for what is missing or not a usable value. + * @experimental + */ export const linkConfigOf = (section: unknown): LinkConfig => { const value = section && typeof section === "object" ? (section as Record) : {} const base = @@ -181,6 +192,7 @@ export const linkConfigOf = (section: unknown): LinkConfig => { * The one way to build a WireCat link: the web form for messages and mail (an https page that hands it to the app), * the app form for a desktop terminal. `null` when links are off (`links.enabled: false`, or `WIRECAT_LINKS=off` for * one run) or the ref names nothing a link opens; the caller then leaves the link out. + * @experimental */ export const linkFor = ( ref: DeepLinkTarget | string, diff --git a/src/domain/locator.ts b/src/domain/locator.ts index 0d5471f94..be5f24490 100644 --- a/src/domain/locator.ts +++ b/src/domain/locator.ts @@ -5,6 +5,7 @@ import type { Id, Provider } from "./models.js" * Where one message lives, whichever messenger it came from. A message id alone means nothing: * Telegram numbers messages per chat in channels and per account in private chats, so only all four * parts name exactly one message across every provider and account in a shared store. + * @experimental */ export interface MessageLocator { provider: Provider @@ -15,12 +16,14 @@ export interface MessageLocator { const SCHEME = "msg:" -/** `msg:telegram/12345/-1001234567890/42` — each part percent-encoded, so no id can add a part. */ +/** `msg:telegram/12345/-1001234567890/42` — each part percent-encoded, so no id can add a part. @experimental */ export const formatLocator = ({ provider, account, chat, message }: MessageLocator): string => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/") +/** @experimental */ export const isLocator = (reference: string): boolean => reference.trim().startsWith(SCHEME) +/** @experimental */ export const parseLocator = (reference: string): MessageLocator => { const trimmed = reference.trim() const parts = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [] diff --git a/src/domain/markdown.ts b/src/domain/markdown.ts index f1686bf48..fca6b9718 100644 --- a/src/domain/markdown.ts +++ b/src/domain/markdown.ts @@ -22,6 +22,7 @@ const WORD = /[\p{L}\p{N}]/u * ⚠ `_` and `*` open and close only at a word's edge, so `file_name_here` and `2*3*4` stay as they * are — the case where turning Markdown on would otherwise change a message nobody meant to format. * A backslash keeps the next character literal. + * @experimental */ export const parseMarkdown = (input: string): { text: string; markup: Markup[] } => { let text = "" diff --git a/src/domain/models.ts b/src/domain/models.ts index 431df58fb..e435ed4ac 100644 --- a/src/domain/models.ts +++ b/src/domain/models.ts @@ -13,7 +13,7 @@ import type { CounterObservation, CounterObservations } from "./counters.js" /** Every id is a string, never a number: provider ids are 64-bit, and an id is not arithmetic. */ export type Id = string -/** `telegram`, `max`… Open, because a new adapter must not need a change here. */ +/** `telegram`, `max`… Open, because a new adapter must not need a change here. @experimental */ export type Provider = string /** Whatever one provider knows that the shared model has no field for. */ @@ -22,7 +22,10 @@ export type ProviderMetadata = Record /** `saved` is the account's notes-to-self chat. */ export type ChatKind = "dialog" | "group" | "channel" | "saved" | "unknown" -/** Where the owner stands in a chat. Kept apart from whether its messages are searchable: a chat left keeps them. */ +/** + * Where the owner stands in a chat. Kept apart from whether its messages are searchable: a chat left keeps them. + * @experimental + */ export type MembershipState = "joined" | "left" | "public" | "imported" | "archived" | "external" export interface Chat { @@ -115,6 +118,7 @@ export interface GroupChange { removePhoto?: true } +/** @experimental */ export const GROUP_SETTINGS = [ "allCanPin", "onlyAdminsAdd", @@ -144,9 +148,13 @@ export interface Folder { pinnedChatIds?: Id[] } +/** @experimental */ export const FOLDER_KINDS = ["contacts", "non-contacts", "groups", "channels", "bots"] as const +/** @experimental */ export type FolderKind = (typeof FOLDER_KINDS)[number] +/** @experimental */ export const FOLDER_SKIPS = ["muted", "read", "archived"] as const +/** @experimental */ export type FolderSkip = (typeof FOLDER_SKIPS)[number] /** A folder's rules beside its chats; `include` and `skip` replace what it had, the chat lists add to it. */ @@ -165,7 +173,7 @@ export interface FolderChange extends FolderRules { remove?: Id[] } -/** What an admin may do, in max-cli's words; a messenger maps them onto its own. */ +/** What an admin may do, in max-cli's words; a messenger maps them onto its own. @experimental */ export const ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"] as const export type AdminRight = (typeof ADMIN_RIGHTS)[number] @@ -266,7 +274,7 @@ export interface Button { data?: string } -/** Where one attachment's bytes can be fetched. */ +/** Where one attachment's bytes can be fetched. @experimental */ export interface AttachmentLink { kind: string url: string @@ -275,7 +283,7 @@ export interface AttachmentLink { unsafe?: boolean } -/** What a chat has pinned after `messages pin` or `unpin`; `null` is nothing. */ +/** What a chat has pinned after `messages pin` or `unpin`; `null` is nothing. @experimental */ export interface Pin { chatId: Id pinned: Id | null @@ -325,7 +333,10 @@ export interface PollVote { votedAt: string } -/** A chat marked read up to `messageId`, inclusive. `unread` is what the provider says is left, or `null`. */ +/** + * A chat marked read up to `messageId`, inclusive. `unread` is what the provider says is left, or `null`. + * @experimental + */ export interface ReadMark { chatId: Id messageId: Id @@ -427,7 +438,7 @@ export interface Message { delivery?: Delivery } -/** MAX reports the owner's own messages with no sender id, so `outgoing` counts as well as the id. */ +/** MAX reports the owner's own messages with no sender id, so `outgoing` counts as well as the id. @experimental */ export const senderIsMe = (message: Pick, account: string): boolean => message.outgoing === true || (message.senderId !== null && String(message.senderId) === account) @@ -644,7 +655,10 @@ export interface Contact { /** Somebody in a chat, as much of them as a chat card shows. */ export type Member = Pick -/** A contact of the messenger's address book: the phone is there when the messenger shows it to the owner. */ +/** + * A contact of the messenger's address book: the phone is there when the messenger shows it to the owner. + * @experimental + */ export type AddressBookEntry = Member & { phone?: string | null } /** A topic of a forum group; its messages carry this id as `threadId`. */ @@ -661,7 +675,7 @@ export interface Topic { createdAt: string | null } -/** Who the account may post as in one chat. `self` is the account itself, always offered. */ +/** Who the account may post as in one chat. `self` is the account itself, always offered. @experimental */ export interface SenderIdentity { id: Id title: string @@ -714,7 +728,7 @@ export interface LinkTarget { } /** Somewhere this account is logged in — a device, a browser, this tool. */ -/** One call in the account's call history. */ +/** One call in the account's call history. @experimental */ export interface CallRecord { id: Id /** The dialog or group the call belongs to. */ @@ -737,6 +751,7 @@ export type Audience = "everyone" | "contacts" | "nobody" /** * An audience as `account privacy show` may report it: also the owner's contacts but some of them, which `set` * cannot choose. Kept apart from `Audience` so that a table keyed on it does not have to name it. + * @experimental */ export type ShownAudience = Audience | "contacts_except" @@ -762,10 +777,10 @@ export interface PrivacySettings { lastSeen?: ShownAudience } -/** Every setting `account privacy set` knows. */ +/** Every setting `account privacy set` knows. @experimental */ export type PrivacyKey = keyof PrivacySettings -/** A set of stickers the account has added. */ +/** A set of stickers the account has added. @experimental */ export interface StickerSet { id: Id title: string @@ -774,6 +789,7 @@ export interface StickerSet { link: string | null } +/** @experimental */ export interface Sticker { id: Id setId: Id | null @@ -783,8 +799,9 @@ export interface Sticker { url: string | null } -/** Kinds of attachment `chats media` filters by. */ +/** Kinds of attachment `chats media` filters by. @experimental */ export const MEDIA_KINDS = ["photo", "video", "file", "audio", "link"] as const +/** @experimental */ export type MediaKind = (typeof MEDIA_KINDS)[number] export interface AccountSession { @@ -834,6 +851,7 @@ export interface PersonCard extends Contact { /** * When they were last seen: a time, or the bucket their privacy leaves — `hidden` only when the * messenger says nothing at all. Telegram answers `recently`, `week` or `month` instead of a time. + * @experimental */ export type Seen = "online" | "recently" | "week" | "month" | "hidden" | (string & {}) @@ -934,6 +952,7 @@ export interface Account { phone?: string | null } +/** @experimental */ export interface Profile { id: Id name: string | null @@ -944,7 +963,7 @@ export interface Profile { /** One message of a window around another, which carries `anchor: true`. */ export type WindowedMessage = Message & { anchor?: true } -/** A number the messenger reports for its period, beside the same number for the period before. */ +/** A number the messenger reports for its period, beside the same number for the period before. @experimental */ export interface OfficialValue { current: number previous: number @@ -953,6 +972,7 @@ export interface OfficialValue { /** * One of the messenger's own graphs, colours and zoom dropped. `x.type` is read from the points: * `date` for UTC day starts (`YYYY-MM-DD`), `time` for other moments (ISO 8601), `number` as given. + * @experimental */ export interface OfficialGraph { kind: string @@ -962,11 +982,12 @@ export interface OfficialGraph { percentage?: boolean } -/** A graph the messenger could not give; the other graphs still answer. */ +/** A graph the messenger could not give; the other graphs still answer. @experimental */ export interface OfficialGraphError { error: string } +/** @experimental */ export interface OfficialPerson { person: Id name: string | null @@ -979,6 +1000,7 @@ interface OfficialStatsBase { period: { since: string; until: string } } +/** @experimental */ export interface OfficialGroupStats extends OfficialStatsBase { kind: "group" totals: Record<"members" | "messages" | "viewers" | "posters", OfficialValue> @@ -990,6 +1012,7 @@ export interface OfficialGroupStats extends OfficialStatsBase { graphs: Record } +/** @experimental */ export interface OfficialChannelStats extends OfficialStatsBase { kind: "channel" totals: Record< diff --git a/src/domain/money.ts b/src/domain/money.ts index 1bc03112d..2bbc07f6e 100644 --- a/src/domain/money.ts +++ b/src/domain/money.ts @@ -3,6 +3,7 @@ import { CliError } from "@wirecat/cli-base" /** * Minor-unit digits per ISO 4217 for the currencies the store keeps money in. A currency outside the list is refused * rather than guessed: a wrong scale would store every amount 100 times off. + * @experimental */ export const CURRENCY_SCALES: Readonly> = { AED: 2, @@ -41,7 +42,10 @@ export const CURRENCY_SCALES: Readonly> = { VND: 0, } -/** An exact amount as callers read and write it: a decimal string with the currency's scale, never a float. */ +/** + * An exact amount as callers read and write it: a decimal string with the currency's scale, never a float. + * @experimental + */ export interface Money { amount: string currency: string @@ -60,6 +64,7 @@ export const parseDecimal = (text: string, scale: number): bigint | undefined => return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`) } +/** @experimental */ export const formatDecimal = (units: bigint | number, scale: number): string => { const value = BigInt(units) if (value < 0n) return `-${formatDecimal(-value, scale)}` @@ -74,6 +79,7 @@ export const groupDigits = (decimal: string): string => { return fraction === undefined ? grouped : `${grouped}.${fraction}` } +/** @experimental */ export const currencyOf = (text: unknown): string => { const code = typeof text === "string" ? text.trim().toUpperCase() : "" if (CURRENCY_SCALES[code] === undefined) @@ -87,7 +93,10 @@ export const currencyOf = (text: unknown): string => { export const scaleOf = (currency: string): number => CURRENCY_SCALES[currencyOf(currency)] as number -/** Minor units of `currency` for a decimal string such as "50000.00"; refuses more decimals than the currency has. */ +/** + * Minor units of `currency` for a decimal string such as "50000.00"; refuses more decimals than the currency has. + * @experimental + */ export const minorUnits = (amount: unknown, currency: string, what = "an amount"): number => { const scale = scaleOf(currency) const units = typeof amount === "string" ? parseDecimal(amount, scale) : undefined @@ -100,19 +109,20 @@ export const minorUnits = (amount: unknown, currency: string, what = "an amount" return Number(units) } -/** Minor units for a decimal that may be negative, such as an opening balance of "-1200.50". */ +/** Minor units for a decimal that may be negative, such as an opening balance of "-1200.50". @experimental */ export const signedMinorUnits = (amount: unknown, currency: string, what = "an amount"): number => { if (typeof amount !== "string" || !amount.trim().startsWith("-")) return minorUnits(amount, currency, what) const units = minorUnits(amount.trim().slice(1), currency, what) return units === 0 ? 0 : -units } +/** @experimental */ export const moneyOf = (units: number, currency: string): Money => ({ amount: formatDecimal(units, scaleOf(currency)), currency, }) -/** "50 000.00 RUB". */ +/** "50 000.00 RUB". @experimental */ export const moneyLabel = (units: number, currency: string): string => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}` diff --git a/src/domain/orders.ts b/src/domain/orders.ts index 2c452ff3c..5b1466a04 100644 --- a/src/domain/orders.ts +++ b/src/domain/orders.ts @@ -2,11 +2,14 @@ import type { OrderDirection } from "./business.js" import type { FinanceReview } from "./finance.js" import { moneyLabel } from "./money.js" +/** @experimental */ export const ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"] as const -/** Why it was ordered: for the owner himself, for his business, for a client, or anything else. */ +/** Why it was ordered: for the owner himself, for his business, for a client, or anything else. @experimental */ export const ORDER_PURPOSES = ["personal", "business", "client", "other"] as const +/** @experimental */ export type OrderStatus = (typeof ORDER_STATUSES)[number] +/** @experimental */ export type OrderPurpose = (typeof ORDER_PURPOSES)[number] export interface OrderTitleFields { diff --git a/src/domain/person-kinds.ts b/src/domain/person-kinds.ts index 8d863a0ac..659990ae3 100644 --- a/src/domain/person-kinds.ts +++ b/src/domain/person-kinds.ts @@ -1,11 +1,13 @@ /** * What a person in the store is, for a list that shows the useful ones and keeps the noise apart. `test` is what a * test run left, which `all` leaves out too. + * @experimental */ export const PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"] as const +/** @experimental */ export type PersonKind = (typeof PERSON_KINDS)[number] -/** What decided a kind, besides the ties that make someone a `person`. */ +/** What decided a kind, besides the ties that make someone a `person`. @experimental */ export type KindSignal = | "test-data" | "bot" diff --git a/src/domain/phones.ts b/src/domain/phones.ts index 0fbd3dbfc..fc4c4b2d4 100644 --- a/src/domain/phones.ts +++ b/src/domain/phones.ts @@ -1,8 +1,10 @@ import { CliError } from "@wirecat/cli-base" import { PHONE_PLANS } from "./phone-plans.generated.js" +/** @experimental */ export type PhoneCountry = (typeof PHONE_PLANS)[number]["country"] +/** @experimental */ export const PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country) /** Without the setting a number with no `+` is read as Russian, as before the setting existed. */ diff --git a/src/domain/polls.ts b/src/domain/polls.ts index 427130e5f..599e00114 100644 --- a/src/domain/polls.ts +++ b/src/domain/polls.ts @@ -3,6 +3,7 @@ import type { Id, Poll, PollVote } from "./models.js" /** * A poll with its counts taken from each voter's newest vote, for a messenger that sends votes one by one and counts * nothing (WhatsApp). `self`'s vote, when there is one, also sets `chosen`. A vote taken back counts toward nothing. + * @experimental */ export const countedPoll = (poll: Poll, votes: readonly PollVote[], self: Id | null): Poll => { const cast = votes.filter((vote) => vote.answers.length > 0) diff --git a/src/domain/providers.ts b/src/domain/providers.ts index 6b0edb4a3..6fc922abb 100644 --- a/src/domain/providers.ts +++ b/src/domain/providers.ts @@ -33,10 +33,10 @@ export interface ProviderEntry { } const MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" } as const -/** What a CRM CLI's entry gives as `opens`: the read commands `addCrmCommands` mounts. */ +/** What a CRM CLI's entry gives as `opens`: the read commands `addCrmCommands` mounts. @experimental */ export const CRM_OPENS = { deal: "deals show", lead: "leads show", pipeline: "pipelines show" } as const -/** The seed: what cli-core knows before any CLI has written its entry into the store. */ +/** The seed: what cli-core knows before any CLI has written its entry into the store. @experimental */ export const PROVIDERS: readonly ProviderEntry[] = [ { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS }, { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] }, @@ -93,6 +93,7 @@ export const providerLabel = (provider: Provider): string => LABELS[provider] ?? * A notes folder is an `accounts` row of one of these providers; people call every one `notes`. `obsidian` is a vault, * `local` a plain folder (store version 32). `folder` is what they were before, and what Drive's stand-in folders and * profile keys saved before that still say. + * @experimental */ export const FOLDER_PROVIDERS = ["local", "obsidian", "folder"] as const export const isFolderProvider = (provider: string): boolean => @@ -122,8 +123,10 @@ export const documentAccountProvidersSql = (): string => /** * What the owner adds by hand (`saveAddedSource`): one account, `owner`. Neither a folder nor a documents account, so no * folder can be bound to it and no sync deletes a source whose file is gone. + * @experimental */ export const ADDED_PROVIDER = "added" +/** @experimental */ export const ADDED_ACCOUNT = "owner" /** Documents `d` outside the added sources: a folder file joined to one would delete it when the file goes. */ export const notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')` @@ -133,7 +136,7 @@ export const filesAccountSql = (column = "provider"): string => /** Notes written in memo have no account row; this is their account. */ export const INTERNAL_NOTES = "internal" -/** The reason a search gives for an account whose provider no entry names. */ +/** The reason a search gives for an account whose provider no entry names. @experimental */ export const UNKNOWN_PROVIDER = "unknown provider — run its CLI once" const WORD = /^[a-z0-9][a-z0-9_-]*$/ @@ -232,12 +235,16 @@ const joined = (known: readonly ProviderEntry[], entry: ProviderEntry): Provider let registry: readonly ProviderEntry[] = PROVIDERS -/** The built-ins and the entries the store or the CLI running gave; what `kindOf` and `providerNamed` read. */ +/** + * The built-ins and the entries the store or the CLI running gave; what `kindOf` and `providerNamed` read. + * @experimental + */ export const providers = (): readonly ProviderEntry[] => registry /** * Replaces the entries beyond the built-ins. Opening the store calls it with the stored entries; a test or a CLI * with no store may call it too. Two entries that disagree on a kind, or one word naming two providers, throw. + * @experimental */ export const useProviders = (entries: readonly ProviderEntry[]): void => { registry = entries.map(providerEntryOf).reduce(joined, PROVIDERS) @@ -266,6 +273,7 @@ export const addProvider = (entry: ProviderEntry): void => { registry = joined(registry, providerEntryOf(entry)) } +/** @experimental */ export const isKind = (word: string): word is Kind => (KINDS as readonly string[]).includes(word.toLowerCase()) /** The registry's provider a name or alias stands for. */ @@ -274,13 +282,17 @@ export const providerNamed = (word: string): ProviderEntry | undefined => { return registry.find((entry) => wordsOf(entry).includes(wanted)) } -/** The kind of a provider the registry knows; `undefined` for one no entry names, which a search skips. */ +/** + * The kind of a provider the registry knows; `undefined` for one no entry names, which a search skips. + * @experimental + */ export const kindIn = (provider: Provider): Kind | undefined => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind /** * Every kind a provider's accounts hold, its `kind` first; empty for one no entry names. An import-only provider's * accounts hold documents too: a records import writes them beside its calls and SMS. + * @experimental */ export const kindsIn = (provider: Provider): readonly Kind[] => { if (isFolderProvider(provider)) return ["notes"] @@ -321,12 +333,15 @@ export const isImportedProvider = (provider: Provider): boolean => export const alsoListedByKey = (provider: Provider): boolean => isDocumentAccountProvider(provider) && kindsIn(provider).some((kind) => kind !== "documents") -/** Whether a provider's accounts hold `kind`: what a search lane picks its accounts by. */ +/** Whether a provider's accounts hold `kind`: what a search lane picks its accounts by. @experimental */ export const holdsKind = (provider: Provider, kind: Kind): boolean => kindsIn(provider).includes(kind) /** `holdsKind`, with a provider no entry names counted as a messenger, as `kindOf` counts it. */ export const holdsKindOf = (provider: Provider, kind: Kind): boolean => kindIn(provider) === undefined ? kind === "messages" : holdsKind(provider, kind) -/** A provider the registry does not list counts as a messenger here; a search asks `kindIn` and skips it. */ +/** + * A provider the registry does not list counts as a messenger here; a search asks `kindIn` and skips it. + * @experimental + */ export const kindOf = (provider: Provider): Kind => kindIn(provider) ?? "messages" diff --git a/src/domain/rankings-graph.ts b/src/domain/rankings-graph.ts index 9128a8e82..2fdaef45f 100644 --- a/src/domain/rankings-graph.ts +++ b/src/domain/rankings-graph.ts @@ -1,10 +1,12 @@ import { CliError } from "@wirecat/cli-base" import { rankingQuestion } from "./rankings-options.js" +/** @experimental */ export interface RankingGraphLink { chatId: string messageId: string } +/** @experimental */ export interface RankingGraphEvidence { version: 1 reply?: RankingGraphLink | null diff --git a/src/domain/rankings-options.ts b/src/domain/rankings-options.ts index 66545960f..1b4cbb865 100644 --- a/src/domain/rankings-options.ts +++ b/src/domain/rankings-options.ts @@ -13,13 +13,16 @@ export const AUTHOR_MEASURES = [ ] as const export type RankingTarget = "messages" | "contacts" export type MessageKind = "all" | "posts" | "comments" +/** @experimental */ export type RankingMeasure = (typeof MESSAGE_MEASURES)[number] | (typeof AUTHOR_MEASURES)[number] export type RankingComponent = | Exclude | "replies-from-others" | "reactions-per-message" | "replies-from-others-per-message" +/** @experimental */ export type ScorePreset = "helpful" | "active" | "engaging" +/** @experimental */ export type RankingWeights = Partial> export interface RankingInput { measure?: string @@ -28,6 +31,7 @@ export interface RankingInput { minMessages?: number messageKind?: string } +/** @experimental */ export interface RankingOptions { target: RankingTarget measure: RankingMeasure | "score" @@ -59,6 +63,7 @@ function invalid(message: string): never { throw new CliError("validation_error", message, { reason: "ranking.invalid" }) } +/** @experimental */ export const rankingOptions = (target: RankingTarget, input: RankingInput): RankingOptions => { const measures: readonly string[] = target === "messages" ? MESSAGE_MEASURES : AUTHOR_MEASURES const { measure, score, weights: given, minMessages } = input diff --git a/src/domain/record-types.ts b/src/domain/record-types.ts index faec37507..4e3048bc5 100644 --- a/src/domain/record-types.ts +++ b/src/domain/record-types.ts @@ -532,7 +532,10 @@ export const RECORD_TYPES = { export type RecordType = keyof typeof RECORD_TYPES -/** Every registered type is an envelope type: `custom:` covers whatever a source has beyond them. */ +/** + * Every registered type is an envelope type: `custom:` covers whatever a source has beyond them. + * @experimental + */ export type RecordEntityType = RecordType export const isRecordType = (type: string): type is RecordType => Object.hasOwn(RECORD_TYPES, type) @@ -548,6 +551,7 @@ export const isBusinessType = (type: string): type is BusinessType => export const isIdentityType = (type: unknown): type is IdentityType => typeof type === "string" && isRecordType(type) && RECORD_TYPES[type].review === "identity" +/** @experimental */ export const RECORD_ENTITY_TYPES = Object.keys(RECORD_TYPES) as RecordType[] type Tables = { [K in keyof T]: T[K] extends { table: infer N } ? N : never } diff --git a/src/domain/records-table.ts b/src/domain/records-table.ts index 142dde8f7..b01647b02 100644 --- a/src/domain/records-table.ts +++ b/src/domain/records-table.ts @@ -11,13 +11,18 @@ import { type RecordsEnvelope, } from "./records.js" -/** The types a table can carry: an SMS and a call come from a phone's own export, never from a hand-made sheet. */ +/** + * The types a table can carry: an SMS and a call come from a phone's own export, never from a hand-made sheet. + * @experimental + */ export const TABLE_RECORD_TYPES = Object.keys(RECORD_TYPES).filter( (type) => (RECORD_TYPES[type as keyof typeof RECORD_TYPES] as RecordTypeSpec).sheet !== false, ) as readonly string[] +/** @experimental */ export type ColumnShape = "text" | "decimal" | "day" | "instant" | "currency" | "integer" | "boolean" | "list" +/** @experimental */ export interface TableColumn { /** `external_id`, a field (`total`), a role (`counterparty`) or an item of a list (`lines.amount`). */ name: string @@ -32,18 +37,23 @@ export interface TableColumn { many?: boolean } -/** Where a pointer into the envelope came from in the sheet: its line from 1 (the header is 1), and the column. */ +/** + * Where a pointer into the envelope came from in the sheet: its line from 1 (the header is 1), and the column. + * @experimental + */ export interface TablePlace { line: number column?: string } +/** @experimental */ export interface TableEnvelope { envelope: RecordsEnvelope /** The sheet's place of a receipt's or an error's pointer, by its longest known prefix. */ placeOf(pointer: string): TablePlace | undefined } +/** @experimental */ export class TableError extends Error { constructor(readonly errors: (IngestError & { place?: TablePlace })[]) { super(errors.map((e) => e.message).join("; ")) @@ -104,7 +114,10 @@ const roleColumn = (name: string, role: RecordRoleSpec): TableColumn => ({ ...(role.many ? { many: true } : {}), }) -/** A type's columns: the external id, its flat fields, one per role, then one per key of each list of items. */ +/** + * A type's columns: the external id, its flat fields, one per role, then one per key of each list of items. + * @experimental + */ export const recordColumns = (type: string): TableColumn[] => { const spec = specOf(type) if (!spec || spec.sheet === false) return [] @@ -163,6 +176,7 @@ const exampleRef = (column: TableColumn) => ({ /** * A file to fill for a type. CSV is the header row alone, with a byte-order mark so Excel reads it as UTF-8; JSON is * an envelope of one example record that names every field and role. + * @experimental */ export const recordTemplate = ( type: string, @@ -315,6 +329,7 @@ const relationsOf = (column: TableColumn, raw: string): RecordRelation[] | Inges /** * Reads a sheet of one type as an envelope. A row whose `external_id` an earlier row had continues that record: its * item columns (`lines.amount`) add one item to the list, as an invoice exported a line a row does. + * @experimental */ export const envelopeOfCsv = ( text: string, diff --git a/src/domain/records.ts b/src/domain/records.ts index e1f237e45..60714ea8e 100644 --- a/src/domain/records.ts +++ b/src/domain/records.ts @@ -21,10 +21,14 @@ import { export { RECORD_ENTITY_TYPES, type RecordEntityType } from "./record-types.js" +/** @experimental */ export const RECORDS_SCHEMA_VERSION = 1 +/** @experimental */ export const RECORD_OPERATIONS = ["upsert", "delete"] as const +/** @experimental */ export type RecordOperation = (typeof RECORD_OPERATIONS)[number] +/** @experimental */ export interface RecordRelation { /** What the target is to this record: `counterparty`, `payer`, `settles`, or a source's own word. */ role: string @@ -41,6 +45,7 @@ export interface RecordRelation { /** How an envelope's lines read `product`: `text` keeps an invoice line's product as data, as v1 did. */ export const LINE_OPTIONS = ["text", "products"] as const +/** @experimental */ export interface EnvelopeOptions { lines?: (typeof LINE_OPTIONS)[number] /** @@ -50,6 +55,7 @@ export interface EnvelopeOptions { phone_region?: string } +/** @experimental */ export interface EnvelopeRecord { /** The caller's name for this line, unique in the envelope; the receipt cites it. */ key: string @@ -62,12 +68,14 @@ export interface EnvelopeRecord { relations?: RecordRelation[] } +/** @experimental */ export interface EnvelopeSource { provider: string account: string batch_id: string } +/** @experimental */ export interface RecordsEnvelope { schema_version: 1 source: EnvelopeSource @@ -75,7 +83,10 @@ export interface RecordsEnvelope { records: EnvelopeRecord[] } -/** A refusal: `pointer` is an RFC 6901 JSON pointer into the envelope, `code` a stable word callers may branch on. */ +/** + * A refusal: `pointer` is an RFC 6901 JSON pointer into the envelope, `code` a stable word callers may branch on. + * @experimental + */ export interface IngestError { pointer: string code: string @@ -94,7 +105,10 @@ const REF = "^[a-z]+:[^\\s]{1,500}$" const fieldsDef = (type: RecordType) => `fields-${type}` -/** The v1 envelope as JSON Schema (Draft 2020-12); `schemas/records-envelope.v1.schema.json` is this, written out. */ +/** + * The v1 envelope as JSON Schema (Draft 2020-12); `schemas/records-envelope.v1.schema.json` is this, written out. + * @experimental + */ export const RECORDS_ENVELOPE_SCHEMA = { $schema: "https://json-schema.org/draft/2020-12/schema", title: "WireCat records envelope, version 1", @@ -449,6 +463,7 @@ export const jsonLine = (line: string): unknown => { /** * A JSONL import as the envelope it stands for: the first line holds `schema_version`, `source` and `options`, each * further non-empty line one record. + * @experimental */ export const envelopeOfJsonl = (text: string): unknown => { const lines = withoutBom(text).split(/\r?\n/) @@ -466,6 +481,7 @@ export const envelopeOfJsonl = (text: string): unknown => { /** * A file's text as the envelope it stands for: one JSON envelope, or JSONL, told apart by the first non-empty line; * a JSON object holding `records` is a whole envelope. + * @experimental */ export const envelopeOfText = (text: string): unknown => { const clean = withoutBom(text) diff --git a/src/domain/ref-summaries.ts b/src/domain/ref-summaries.ts index 08088febb..ce0c1e981 100644 --- a/src/domain/ref-summaries.ts +++ b/src/domain/ref-summaries.ts @@ -4,11 +4,15 @@ import type { AccountKey } from "../store/types.js" import { providerNamed } from "./providers.js" import type { RefKindName } from "./references.js" +/** @experimental */ export type RefState = "available" | "deleted" | "unavailable" -/** A message or chat of the `email` provider is mail, so it reads as `email` and `email_thread`. */ +/** A message or chat of the `email` provider is mail, so it reads as `email` and `email_thread`. @experimental */ export type RefSummaryKind = RefKindName | "email" | "email_thread" | "unknown" -/** What a reference names, read from the store in one batch so a page of refs costs one query per kind. */ +/** + * What a reference names, read from the store in one batch so a page of refs costs one query per kind. + * @experimental + */ export interface RefSummary { /** Canonical spelling; the map key is the text the caller passed. */ ref: string @@ -29,6 +33,7 @@ export interface RefSummary { excerpt?: string | null } +/** @experimental */ export interface RefsStore { /** One query per kind present. Never throws for a bad ref: it comes back `unknown`, `unavailable`. */ summaries(refs: readonly string[], options?: { excerpt?: boolean }): Promise> @@ -44,12 +49,16 @@ export interface RefsStore { ends(ref: string): Promise<{ provider: string; account: string }[][] | undefined> } -/** The caller's answer to "which profile opens this": one signed in, or the choices and why there is not one. */ +/** + * The caller's answer to "which profile opens this": one signed in, or the choices and why there is not one. + * @experimental + */ export type ProfilesFor = ( provider: string, account: string | null, ) => { profile: string } | { why: string; profiles: string[] } +/** @experimental */ export interface RefOpen { /** Ready to run; contains `` when `profiles` is not exactly one. `null` when no CLI opens it. */ argv: string[] | null @@ -57,16 +66,21 @@ export interface RefOpen { why: string | null } +/** @experimental */ export const PROFILE_PLACEHOLDER = "" const unregistered = (provider: string) => `no CLI has registered ${provider} in this store yet; run its CLI once` +/** @experimental */ export const profilesOn = (profiles: Profiles, app: string, key: AccountKey): string[] => Object.entries(profiles[app] ?? {}) .filter(([, saved]) => saved.provider === key.provider && saved.account === key.account) .map(([name]) => name) -/** From the store's record, so it answers for any CLI that registered its provider, not only the messengers. */ +/** + * From the store's record, so it answers for any CLI that registered its provider, not only the messengers. + * @experimental + */ export const storedProfilesFor = (profiles: Profiles): ProfilesFor => (provider, account) => { @@ -87,6 +101,7 @@ export const storedProfilesFor = /** * Which CLI changes a CRM copy on its server, and as which profile; `profile` is `null` unless exactly one fits. * `account` is the row's: the write refuses a row of any other account than its profile's live one. + * @experimental */ export interface WritesWith { tool: string | null @@ -101,6 +116,7 @@ const keyText = (key: AccountKey) => `${key.provider}:${key.account}` /** * `null` for the owner's own row: memo itself writes it. `allowed` is the caller's profile or group lock: a profile it * forbids is never named, and the one profile it leaves is the answer. + * @experimental */ export const writesWithOf = ( account: AccountKey | null, @@ -140,6 +156,7 @@ const openKind = (kind: RefSummaryKind): RefKindName | undefined => /** * The command that opens a ref. A registered provider opens its own kinds; anything else opens with the caller's * `local` words (memo's `notes show`). The profile is never picked: with none or several, `argv` keeps ``. + * @experimental */ export const openOf = ( summary: RefSummary, @@ -197,7 +214,7 @@ const WORDS: Record = { unknown: "Unknown", } -/** `Chat «Сайт + автоматизация» (MAX)`: the one label every review row, status line and `show` prints. */ +/** `Chat «Сайт + автоматизация» (MAX)`: the one label every review row, status line and `show` prints. @experimental */ export const refLabel = (summary: RefSummary): string => { const named = summary.title === null ? summary.ref : `«${oneLine(summary.title)}»` const notes = [summary.in === null ? null : oneLine(summary.in), summary.state === "available" ? null : summary.state] diff --git a/src/domain/references.ts b/src/domain/references.ts index 427ab27f0..620fd8219 100644 --- a/src/domain/references.ts +++ b/src/domain/references.ts @@ -48,6 +48,7 @@ export type SimpleReference = (typeof SIMPLE_REFERENCES)[number] export type RefKindName = Exclude +/** @experimental */ export interface RefKindSpec { /** The word before the first colon: `chat`, `msg`, `document`. */ prefix: string @@ -107,7 +108,7 @@ const simple = (prefix: SimpleReference) => format: (reference) => `${reference.type}:${reference.id}`, }) -/** Every kind of reference. A new kind is one row here; nothing else switches on the prefix. */ +/** Every kind of reference. A new kind is one row here; nothing else switches on the prefix. @experimental */ export const REF_KINDS: readonly RefKindSpec[] = [ kind>({ prefix: "msg", @@ -222,12 +223,13 @@ export const parseReference = (text: string): Reference => { return spec.parse(rest, reference) } -/** The stored spelling of a reference, so two spellings of one thing compare equal. */ +/** The stored spelling of a reference, so two spellings of one thing compare equal. @experimental */ export const canonicalReference = (text: string): string => formatReference(parseReference(text)) /** * Strict: the whole text is one reference of a known kind, with no space. A title such as "Note: plan" is not, so an * argument that takes either a reference or a title can tell them apart. The shape is checked only by parsing it. + * @experimental */ export const looksLikeReference = (text: string): boolean => { const match = /^([a-z]+):\S+$/.exec(text.trim()) diff --git a/src/domain/relation-role-labels.ts b/src/domain/relation-role-labels.ts index 16f99835f..fdddd2964 100644 --- a/src/domain/relation-role-labels.ts +++ b/src/domain/relation-role-labels.ts @@ -1,5 +1,6 @@ import type { ROLE_LISTS, RoleList } from "./relations.js" +/** @experimental */ export interface RoleLabels { en: string ru: string @@ -8,7 +9,10 @@ export interface RoleLabels { const label = (en: string, ru: string, es: string): RoleLabels => ({ en, ru, es }) -/** Keyed by list: a deal's `owner` is the one responsible for it, an organization's is the one who owns it. */ +/** + * Keyed by list: a deal's `owner` is the one responsible for it, an organization's is the one who owns it. + * @experimental + */ export const ROLE_LABELS: { [L in RoleList]: Record<(typeof ROLE_LISTS)[L][number], RoleLabels> } = { organization: { employee: label("Employee", "Сотрудник", "Empleado"), diff --git a/src/domain/relations.ts b/src/domain/relations.ts index 7a24df2e9..566f163d4 100644 --- a/src/domain/relations.ts +++ b/src/domain/relations.ts @@ -1,7 +1,10 @@ import { CliError } from "@wirecat/cli-base" import { DEAL_ROLES } from "./deals.js" -/** What a person is to an organization; who reports to whom is `reports-to`, and a job title is never a role. */ +/** + * What a person is to an organization; who reports to whom is `reports-to`, and a job title is never a role. + * @experimental + */ export const ORGANIZATION_ROLES = [ "employee", "contractor", @@ -11,18 +14,24 @@ export const ORGANIZATION_ROLES = [ "adviser", "contact", ] as const +/** @experimental */ export const PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"] as const -/** A contract party's part; a party the list cannot name has none, never a catch-all `other`. */ +/** A contract party's part; a party the list cannot name has none, never a catch-all `other`. @experimental */ export const CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"] as const /** * What a person or an organization is to another on `related-to`, offered so the same tie reads the same way. Unlike * the other lists it is not enforced: roles written before it, and words a source reports, stay. Buying and partnering * are the kinds `customer-of` and `partner-of`, so they are not roles here. + * @experimental */ export const RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"] as const -/** How much the owner deals with a person on a project himself, not how active the person is; absent is unknown. */ +/** + * How much the owner deals with a person on a project himself, not how active the person is; absent is unknown. + * @experimental + */ export const ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"] as const +/** @experimental */ export type Engagement = (typeof ENGAGEMENT_LEVELS)[number] export const isEngagement = (value: unknown): value is Engagement => @@ -44,9 +53,10 @@ export const checkEngagement = (kind: string, from: string, to: string, level: s /** Who the owner deals with most comes first: high, medium, unknown, low, none. */ const ENGAGEMENT_ORDER: Record = { high: 0, medium: 1, unknown: 2, low: 3, none: 4 } +/** @experimental */ export const engagementRank = (level: Engagement | null | undefined): number => ENGAGEMENT_ORDER[level ?? "unknown"] -/** A stable sort by `engagementRank`; links without a level keep their order among themselves. */ +/** A stable sort by `engagementRank`; links without a level keep their order among themselves. @experimental */ export const byEngagement = (items: readonly T[]): T[] => items .map((item, index) => ({ item, index })) @@ -69,6 +79,7 @@ interface RelationSpec { /** * Every relationship `knowledge.relate` makes, its ends, its roles and how it reads backwards. An organization may * still be a member: owner data from before this list holds such links. + * @experimental */ export const RELATIONS = { "member-of": { @@ -86,7 +97,9 @@ export const RELATIONS = { }, } as const satisfies Record +/** @experimental */ export type RelationKind = keyof typeof RELATIONS +/** @experimental */ export const RELATION_KINDS = Object.keys(RELATIONS) as RelationKind[] const specOf = (kind: string): RelationSpec | undefined => @@ -123,6 +136,7 @@ const isParty = (type: string) => type === "person" || type === "organization" /** * The roles a relationship takes, or `undefined` for free text. A member's list is the organization's or the * project's only when the member is a person: a chat's or a sub-project's role was never one of them. + * @experimental */ export const rolesOf = (kind: string, from: string, to: string): readonly string[] | undefined => { const spec = specOf(kind) @@ -130,7 +144,7 @@ export const rolesOf = (kind: string, from: string, to: string): readonly string return spec?.roles?.from?.[from as End] ?? spec?.roles?.to?.[to as End] } -/** The role lists the owner may add to; each is a list the registry gives some relationship's ends. */ +/** The role lists the owner may add to; each is a list the registry gives some relationship's ends. @experimental */ export const ROLE_LISTS = { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES, @@ -138,6 +152,7 @@ export const ROLE_LISTS = { contract: CONTRACT_ROLES, related: RELATED_ROLES, } as const +/** @experimental */ export type RoleList = keyof typeof ROLE_LISTS /** Which list a relationship's role comes from, or `undefined` where a role is free text. */ @@ -168,15 +183,20 @@ export const checkRole = ( export const isSymmetric = (kind: string): boolean => specOf(kind)?.symmetric === true -/** The label of a relationship read from its `to` end: `manages` for `reports-to`; the kind itself when symmetric. */ +/** + * The label of a relationship read from its `to` end: `manages` for `reports-to`; the kind itself when symmetric. + * @experimental + */ export const inverseOf = (kind: string): string | null => specOf(kind)?.symmetric ? kind : ((specOf(kind)?.inverse as string | undefined) ?? null) /** * What an answer says about a relationship, derived, never stored: the owner's, a source's that nobody confirmed, an * agent's suggestion waiting for review, or one that no longer holds. + * @experimental */ export const STANDINGS = ["confirmed", "reported", "proposed", "ended"] as const +/** @experimental */ export type Standing = (typeof STANDINGS)[number] /** A link's columns `standing` reads; a column an older store lacks is `null`. */ @@ -213,7 +233,10 @@ export interface RelationshipColumns { derived?: string } -/** The owner's confirmation outlives a source that stopped reporting it; only its own end date ends it. */ +/** + * The owner's confirmation outlives a source that stopped reporting it; only its own end date ends it. + * @experimental + */ export const standingOf = (link: StandingFields, now: number): Standing => { if (link.endsAt != null && link.endsAt <= now) return "ended" if (link.confirmed) return "confirmed" @@ -221,9 +244,10 @@ export const standingOf = (link: StandingFields, now: number): Standing => { return link.accountId != null ? "reported" : "proposed" } -/** A relationship a context or a traversal counts: the owner's, or a source's that still holds. */ +/** A relationship a context or a traversal counts: the owner's, or a source's that still holds. @experimental */ export const isUsable = (standing: Standing): boolean => standing === "confirmed" || standing === "reported" +/** @experimental */ export const usableLink = (link: StandingFields, now: number): boolean => isUsable(standingOf(link, now)) // links_relationship_key's WHERE, word for word: without it SQLite cannot use that partial index, picks diff --git a/src/domain/send-time.ts b/src/domain/send-time.ts index 0e1e18279..bba718a7c 100644 --- a/src/domain/send-time.ts +++ b/src/domain/send-time.ts @@ -2,8 +2,7 @@ import { aheadOf, MINUTE, YEAR } from "./moment.js" /** * `--at-time`, a mute's `--until`, a link's `--expire-time`: `aheadOf` within the messenger's limits of a minute to a - * year, and never a date alone. Rounded down to the minute, because messengers send at the start of it (MAX measured, - * max-cli `FIND-141`), so the time printed is the time it goes. + * year, and never a date alone. Rounded down to the minute, because messengers send at the start of it (MAX measured), so the time printed is the time it goes. */ export const sendTime = (value: string, now = Date.now(), flag = "--at-time", zone?: string): string => { const at = aheadOf(value, flag, now, { diff --git a/src/domain/tag-consolidation.ts b/src/domain/tag-consolidation.ts index f6a9eb882..d2c105771 100644 --- a/src/domain/tag-consolidation.ts +++ b/src/domain/tag-consolidation.ts @@ -1,3 +1,4 @@ +/** @experimental */ export interface TagConsolidationOptions { sourceId: string survivorId: string @@ -8,6 +9,7 @@ export interface TagConsolidationOptions { signal?: AbortSignal } +/** @experimental */ export interface TagConsolidationPreview { source: { id: string; name: string } survivor: { id: string; name: string } @@ -54,17 +56,20 @@ export interface TagConsolidationPreview { } } +/** @experimental */ export interface TagConsolidationStore { previewTagConsolidation(options: TagConsolidationOptions): Promise applyTagConsolidation(options: TagConsolidationApplyOptions): Promise } +/** @experimental */ export interface TagConsolidationApplyOptions extends Omit { by: "owner" expectedPreviewFingerprint: string idempotencyKey: string } +/** @experimental */ export interface TagConsolidationReceipt { id: string sourceId: string diff --git a/src/domain/tag-redirects.ts b/src/domain/tag-redirects.ts index d55b3221d..1e226e4eb 100644 --- a/src/domain/tag-redirects.ts +++ b/src/domain/tag-redirects.ts @@ -1,11 +1,13 @@ import { CliError } from "@wirecat/cli-base" +/** @experimental */ export interface TagRedirectSnapshot { complete: true tags: readonly { id: string; kind: "tag" }[] redirects: readonly { sourceId: string; survivorId: string }[] } +/** @experimental */ export interface TagRedirectResolution { requestedId: string canonicalId: string @@ -15,6 +17,7 @@ export interface TagRedirectResolution { memberIds: string[] } +/** @experimental */ export interface TagRedirectIndex { resolve(id: string): TagRedirectResolution } @@ -38,7 +41,7 @@ const tagId = (value: unknown, field: string): string => { return value } -/** Validates the whole captured graph before exposing any resolution; it enables no store writes. */ +/** Validates the whole captured graph before exposing any resolution; it enables no store writes. @experimental */ export const createTagRedirectIndex = (snapshot: TagRedirectSnapshot): TagRedirectIndex => { const input = record(snapshot, ["complete", "tags", "redirects"], "snapshot") if (input.complete !== true) invalid("snapshot.complete must be true; partial tag graphs cannot resolve labels") diff --git a/src/domain/tags.ts b/src/domain/tags.ts index 0f0cdd694..d3929658c 100644 --- a/src/domain/tags.ts +++ b/src/domain/tags.ts @@ -1,6 +1,8 @@ import { CliError, singleLine } from "@wirecat/cli-base" +/** @experimental */ export const TAG_TYPES = ["chat", "contact", "message", "task"] as const +/** @experimental */ export type TagType = (typeof TAG_TYPES)[number] const TAG = /^[a-z0-9-]{1,32}$/ diff --git a/src/domain/vcard.ts b/src/domain/vcard.ts index 70b251aeb..d7faf94b7 100644 --- a/src/domain/vcard.ts +++ b/src/domain/vcard.ts @@ -3,6 +3,7 @@ import { e164Of, type PhoneCountry } from "./phones.js" import { WORD_BODY } from "./record-types.js" import type { EnvelopeRecord, RecordRelation, RecordsEnvelope } from "./records.js" +/** @experimental */ export interface VcardOptions { provider: string account: string @@ -11,6 +12,7 @@ export interface VcardOptions { region?: PhoneCountry } +/** @experimental */ export interface VcardIssue { /** The card's place in the file, from 0. */ card: number @@ -26,7 +28,7 @@ interface Property { const MAX_ID = 512 const AS_WORD = new RegExp(`^${WORD_BODY}$`) -/** Whether a file is a vCard address book rather than a JSON or JSONL envelope. */ +/** Whether a file is a vCard address book rather than a JSON or JSONL envelope. @experimental */ export const isVcard = (text: string): boolean => /^?\s*BEGIN:VCARD\b/i.test(text) const isQuotedPrintable = (line: string) => { @@ -195,6 +197,7 @@ const cardsOf = (text: string): { cards: Property[][]; issues: VcardIssue[] } => * A vCard file (2.1, 3.0 or 4.0) as a records envelope: one person per card, matched later by its numbers and * addresses, and one organization per `ORG` name the person is a member of. Nothing is guessed: a national number * is read only in `region`, and a card says nothing about a person it does not hold. + * @experimental */ export const envelopeOfVcard = ( text: string, diff --git a/src/entities/business-context.ts b/src/entities/business-context.ts index 686e38a0c..2bd128332 100644 --- a/src/entities/business-context.ts +++ b/src/entities/business-context.ts @@ -137,7 +137,7 @@ export const personBusiness = v.strictObject({ categories, }) -/** Any canonical person's context: every account in scope read, their business, and what was not read. */ +/** Any canonical person's context: every account in scope read, their business, and what was not read. @experimental */ export const personContext: v.GenericSchema = v.strictObject({ ...crossAccountContext.entries, person: linkedPerson, @@ -146,7 +146,10 @@ export const personContext: v.GenericSchema = v.strictObject({ coverage, }) -/** One organization: people, customers, suppliers, partners, projects, open deals, money and how much is said. */ +/** + * One organization: people, customers, suppliers, partners, projects, open deals, money and how much is said. + * @experimental + */ export const organizationContext: v.GenericSchema = v.strictObject({ organization: v.strictObject({ ...organization.entries, own: v.boolean() }), categories, @@ -181,7 +184,10 @@ export const organizationContext: v.GenericSchema = v.strictObject({ const { untrusted: _, ...dealRow } = deal.entries -/** One deal or lead: the row, its stages, client, people, project, money and what its people said in its time. */ +/** + * One deal or lead: the row, its stages, client, people, project, money and what its people said in its time. + * @experimental + */ export const dealContext: v.GenericSchema = v.strictObject({ deal: v.strictObject(dealRow), stages: section(v.strictObject({ from: nullableText, to: text, pipeline: reference, at: time, exact: v.boolean() })), @@ -200,7 +206,7 @@ export const dealContext: v.GenericSchema = v.strictObject({ coverage, }) -/** A deal context's compact form, for a model's context. */ +/** A deal context's compact form, for a model's context. @experimental */ export const dealBrief: v.GenericSchema = v.strictObject({ ref: reference, kind: v.picklist(DEAL_KINDS), diff --git a/src/entities/knowledge-lists.ts b/src/entities/knowledge-lists.ts index 9e691e3ee..06c67e984 100644 --- a/src/entities/knowledge-lists.ts +++ b/src/entities/knowledge-lists.ts @@ -1,6 +1,7 @@ import * as v from "valibot" import { id, reference, text, time } from "./fields.js" +/** @experimental */ export const organization = v.strictObject({ id, ref: reference, @@ -9,6 +10,7 @@ export const organization = v.strictObject({ scope: v.picklist(["personal", "work"]), created_at: time, }) +/** @experimental */ export const project = v.strictObject({ id, ref: reference, @@ -20,6 +22,7 @@ export const project = v.strictObject({ scope: v.picklist(["personal", "work"]), created_at: time, }) +/** @experimental */ export const reminder = v.strictObject({ id, task: text, diff --git a/src/entities/list-results.ts b/src/entities/list-results.ts index 42f04c8c7..195b5fe64 100644 --- a/src/entities/list-results.ts +++ b/src/entities/list-results.ts @@ -115,6 +115,7 @@ export const scheduleHarness = v.strictObject({ path: v.nullable(text), }) +/** @experimental */ export const botTemplate = v.strictObject({ name: v.nullable(text), status: v.nullable(text), diff --git a/src/entities/listings.ts b/src/entities/listings.ts index 4e46270e9..8282992f6 100644 --- a/src/entities/listings.ts +++ b/src/entities/listings.ts @@ -15,7 +15,10 @@ const source = v.strictObject({ const person = v.strictObject({ ref: reference, name: v.nullable(text), kind: text }) -/** One document of any account: a Drive file, a notes folder's file, an added source, an import's document. */ +/** + * One document of any account: a Drive file, a notes folder's file, an added source, an import's document. + * @experimental + */ export const documentEntry = v.strictObject({ ref: reference, id, @@ -42,7 +45,7 @@ export const documentEntry = v.strictObject({ const linked = v.strictObject({ ref: reference, title: v.nullable(text), at: v.nullable(time), role: v.nullable(text) }) -/** One document with a part of its text, its tags, the people it names and the meetings it belongs to. */ +/** One document with a part of its text, its tags, the people it names and the meetings it belongs to. @experimental */ export const documentEntryDetails = v.strictObject({ ...documentEntry.entries, text: v.nullable(text), @@ -61,7 +64,7 @@ export const documentEntryDetails = v.strictObject({ events: v.array(linked), }) -/** One account holding documents, with its folders and how many documents each holds. */ +/** One account holding documents, with its folders and how many documents each holds. @experimental */ export const documentSource = v.strictObject({ ...source.entries, name: v.nullable(text), @@ -84,7 +87,10 @@ const participant = v.strictObject({ response: v.nullable(v.picklist(PARTICIPANT_RESPONSES)), }) -/** One real meeting, call or calendar event: a calendar's event and its Zoom or Meet record are one row. */ +/** + * One real meeting, call or calendar event: a calendar's event and its Zoom or Meet record are one row. + * @experimental + */ export const meetingEntry = v.strictObject({ /** `event:` when a calendar or a meeting service's record made an event of it, else `meeting:/`. */ ref: reference, @@ -132,7 +138,7 @@ export const meetingEntry = v.strictObject({ untrusted, }) -/** One meeting row with its transcript lines, summaries, findings batches and the calendar's text. */ +/** One meeting row with its transcript lines, summaries, findings batches and the calendar's text. @experimental */ export const meetingEntryDetails = v.strictObject({ ...meetingEntry.entries, description: v.nullable(text), @@ -180,6 +186,7 @@ export const meetingEntryDetails = v.strictObject({ /** * The listings' answers by entity name. Not in `ENTITIES`: that registry's inferred type is at the compiler's size * limit, so a CLI registers these as its own (memo's `entityFields`). + * @experimental */ export const LISTING_ENTITIES = { document_entry: documentEntry, diff --git a/src/entities/note.ts b/src/entities/note.ts index 806e8ec2e..ab3d22e8b 100644 --- a/src/entities/note.ts +++ b/src/entities/note.ts @@ -7,6 +7,7 @@ const link = { anchor: v.nullable(text), } +/** @experimental */ export const note = v.strictObject({ ref: reference, kind: v.optional(v.picklist(["note", "document"])), diff --git a/src/entities/store-records.ts b/src/entities/store-records.ts index e3e1d233f..01ee648c3 100644 --- a/src/entities/store-records.ts +++ b/src/entities/store-records.ts @@ -83,6 +83,7 @@ const problem = v.objectWithRest( { code: text, message: text, retryable: v.optional(v.boolean()), retry_after_ms: v.optional(v.number()) }, v.unknown(), ) +/** @experimental */ const progress = v.strictObject({ job: id, profile: text, diff --git a/src/errors/failures.ts b/src/errors/failures.ts index 2615cac90..bebfae22c 100644 --- a/src/errors/failures.ts +++ b/src/errors/failures.ts @@ -6,13 +6,14 @@ import { CliError, errorCodes } from "@wirecat/cli-base" * measured 2026-09-27: an ambiguous chat name from `pickChat` reached tg-cli's `run` as an unknown * failure, exit 1, and lost its list of candidates. A name and a code from the closed list * identify one in every install layout. + * @experimental */ export const isCliFailure = (value: unknown): value is CliError => value instanceof Error && value.name === "CliError" && (errorCodes as readonly string[]).includes((value as { code?: unknown }).code as string) -/** Commander's own errors, by the same rule: its `code` always starts with `commander.`. */ +/** Commander's own errors, by the same rule: its `code` always starts with `commander.`. @experimental */ export const isCommanderFailure = (value: unknown): value is Error & { code: string; exitCode: number } => { const { code, exitCode } = (value ?? {}) as { code?: unknown; exitCode?: unknown } return ( @@ -72,6 +73,7 @@ const wrapping = (error: CliError, original: unknown): CliError => { * `next` is the command line that says what to do, such as `tg store recover`, only where that command exists. * Only for the CLI's own store: a file the owner named goes through `damagedFile`. Any other failure is returned as * it came. + * @experimental */ export const storeDamaged = (error: unknown, next?: string): unknown => damageIn(error) diff --git a/src/errors/reasons.ts b/src/errors/reasons.ts index e7f6f5965..50803ea61 100644 --- a/src/errors/reasons.ts +++ b/src/errors/reasons.ts @@ -5,6 +5,7 @@ import { defineReasons } from "@wirecat/cli-base/standards" import { CHAT_SENDING_ASK_DETAILS } from "../models/chat-sending.js" import { type Entry, SFTP, validation } from "./sftp-reasons.js" +import { STORE, STORE_MIGRATION } from "./store-reasons.js" /** The query reasons only message search raises; the shared ones are cli-base's `QUERY_REASONS`. */ const QUERY: Entry[] = [ @@ -431,46 +432,11 @@ const OTHERS: Entry[] = [ "outcome_unknown", "a message the server found was stored without its attachments; the next sync reads it whole", ], - validation("store.refused", "the local store refused the document text"), - ["store.not-writable", "permission_error", "the message store cannot be written from this process"], - [ - "store.damaged", - "configuration_error", - "the store file is damaged; store recover says what is lost and recovers it", - ], - [ - "store.journal-replaced", - "conflict", - "another program deleted or replaced the store's journal file while it was open; store recover says what to do", - ], - validation("store.file-damaged", "the named store file is damaged or not a database"), - ["store.unopenable", "configuration_error", "the store file cannot be opened at its path; details.path names it"], - [ - "store.unreadable", - "configuration_error", - "the store file's header or schema is damaged, so it cannot be recovered", - ], - validation("store.in-use", "a process or a scheduled timer has the store open; stop it, then recover the store"), - [ - "store.sqlite3-missing", - "configuration_error", - "recovering the store needs the sqlite3 program, 3.43 or newer, with its .recover command", - ], - validation("store.recovery-failed", "the recovered store did not pass its check, so the store was left as it was"), [ "serve.outdated", "configuration_error", "the store or the installed version is newer than this serve; it stopped so its unit starts the installed one", ], - validation("store.recovering", "another recovery of the store is running; wait for it to finish"), - validation("store.changed-during-recovery", "the store was written to during the recovery, so it was left as it was"), - [ - "store.vector-extension-missing", - "configuration_error", - "the install has no sqlite-vec extension for this platform; reinstall the CLI", - ], - ["store.vector-extension-failed", "configuration_error", "the sqlite-vec extension did not load; reinstall the CLI"], - validation("store.vector-invalid", "a vector to store had a non-finite value"), validation("evidence.quote-length", "a quote from the evidence is empty or over 500 characters"), validation("evidence.quote-not-found", "the cited source does not say the quoted words"), validation("evidence.row-too-large", "one evidence row is over its size limit"), @@ -609,10 +575,13 @@ const OTHERS: Entry[] = [ validation("crm.activity-field", "a comment's or task's field is not valid, or the kind does not take it"), validation("crm.owner-unknown", "owner: names no CRM user: me without a known sign-in user, or not a user id"), validation("crm.write-unsupported", "the CRM does not take this write, or does not recognise a repeated one"), - validation("crm.unlisted-held", "a list of every id would mark most of a kind deleted; nothing was, until --rescan"), + validation( + "crm.unlisted-held", + "a list of every id would mark most of a kind deleted, or the sign-in read only part; nothing was", + ), validation( "tracker.unlisted-held", - "a tracker's id list would mark too much deleted, or the sign-in read only part; nothing was, until --rescan", + "a tracker's id list would mark too much deleted, or the sign-in read only part; nothing was", ), validation("tracker.write-unsupported", "the tracker does not take this write, or does not recognise a repeated one"), validation("tracker.field", "a field of an issue or a comment the tracker's write does not take as given"), @@ -889,17 +858,20 @@ const DETAILED: Record = { export const REASONS: ErrorReason[] = defineReasons([ ...QUERY_REASONS, ...INPUT_FIELD_REASONS, - ...[...QUERY, ...SIGN_IN, ...PROVIDER_API, ...SFTP, ...SQL, ...OFFICE, ...OTHERS].map(([reason, code, message]) => ({ - reason, - code, - message, - details: DETAILED[reason] ?? [], - })), + ...[...QUERY, ...SIGN_IN, ...PROVIDER_API, ...SFTP, ...STORE, ...STORE_MIGRATION, ...SQL, ...OFFICE, ...OTHERS].map( + ([reason, code, message]) => ({ + reason, + code, + message, + details: DETAILED[reason] ?? [], + }), + ), ]) /** * Detail keys an error from this package may carry, until each is registered on its own reason. Not `cause`: * that can hold a provider's or SQLite's raw text. + * @experimental */ export const DETAILS = [ "account", diff --git a/src/errors/store-reasons.ts b/src/errors/store-reasons.ts new file mode 100644 index 000000000..a54c3c367 --- /dev/null +++ b/src/errors/store-reasons.ts @@ -0,0 +1,64 @@ +import { type Entry, validation } from "./sftp-reasons.js" + +/** The store file: opening, writing and recovering it. */ +export const STORE: Entry[] = [ + validation("store.refused", "the local store refused the document text"), + ["store.not-writable", "permission_error", "the message store cannot be written from this process"], + [ + "store.damaged", + "configuration_error", + "the store file is damaged; store recover says what is lost and recovers it", + ], + [ + "store.journal-replaced", + "conflict", + "another program deleted or replaced the store's journal file while it was open; store recover says what to do", + ], + validation("store.file-damaged", "the named store file is damaged or not a database"), + ["store.unopenable", "configuration_error", "the store file cannot be opened at its path; details.path names it"], + [ + "store.unreadable", + "configuration_error", + "the store file's header or schema is damaged, so it cannot be recovered", + ], + validation("store.in-use", "a process or a scheduled timer has the store open; stop it, then recover the store"), + [ + "store.sqlite3-missing", + "configuration_error", + "recovering the store needs the sqlite3 program, 3.43 or newer, with its .recover command", + ], + validation("store.recovery-failed", "the recovered store did not pass its check, so the store was left as it was"), + validation("store.recovering", "another recovery of the store is running; wait for it to finish"), + validation("store.changed-during-recovery", "the store was written to during the recovery, so it was left as it was"), + [ + "store.vector-extension-missing", + "configuration_error", + "the install has no sqlite-vec extension for this platform; reinstall the CLI", + ], + ["store.vector-extension-failed", "configuration_error", "the sqlite-vec extension did not load; reinstall the CLI"], + validation("store.vector-invalid", "a vector to store had a non-finite value"), +] + +/** A schema migration that rebuilds tables (`rebuildTables`) and refuses before it changes anything. */ +export const STORE_MIGRATION: Entry[] = [ + [ + "store.unknown-columns", + "configuration_error", + "a migration would drop columns this store has and this build does not know; nothing was changed", + ], + [ + "store.rows-break-checks", + "configuration_error", + "the store holds rows the new schema refuses, so it was not migrated; the rows are named", + ], + [ + "store.rows-lost", + "configuration_error", + "a migration would change how many rows a table holds, so it was not run; the tables and counts are named", + ], + [ + "store.foreign-keys", + "configuration_error", + "a migration would break references between rows, so it was not run; the store is whole", + ], +] diff --git a/src/http/link-fetch.ts b/src/http/link-fetch.ts index 15de1b52c..b8753d7f8 100644 --- a/src/http/link-fetch.ts +++ b/src/http/link-fetch.ts @@ -8,6 +8,7 @@ const CREDENTIALS = ["authorization", "cookie", "proxy-authorization"] * another host (Yandex Disk's `downloader.disk.yandex.ru`, Notion's file store) and carries its own grant, so it goes * only to the hosts listed, over https, and never with the sign-in: a request carrying one is refused before it leaves. * `signIn` names a service's own sign-in headers (an API key's `X-Api-Key`) to refuse beside the standard ones. + * @experimental */ export const linkFetch = (options: HostFetchOptions & { signIn?: readonly string[] }): FetchLike => { const { signIn = [], ...rest } = options diff --git a/src/http/public-url.ts b/src/http/public-url.ts index 847e0fc33..ce1db81d7 100644 --- a/src/http/public-url.ts +++ b/src/http/public-url.ts @@ -5,6 +5,7 @@ const EXAMPLE = "--public-url https://.ts.net" /** * The tunnel's address a public listener is reached at, checked one way for every command that opens * one. `missing` says what needs it; `reaches` who calls through it, for the https refusal. + * @experimental */ export const publicUrlOf = ( given: string | undefined, @@ -44,7 +45,7 @@ export const publicUrlOf = ( return url } -/** A local port from `--port`, or the command's own default. */ +/** A local port from `--port`, or the command's own default. @experimental */ export const portOf = (given: string | undefined, fallback: number): number => { if (given === undefined) return fallback const port = Number(given) @@ -53,6 +54,9 @@ export const portOf = (given: string | undefined, fallback: number): number => { return port } -/** The connector address under a public address: `https://.ts.net/mcp`, or `…/tg/mcp` under a path. */ +/** + * The connector address under a public address: `https://.ts.net/mcp`, or `…/tg/mcp` under a path. + * @experimental + */ export const mcpUrlOf = (publicUrl: URL): URL => new URL(`${publicUrl.pathname.replace(/\/+$/, "")}/mcp`, publicUrl.origin) diff --git a/src/kit/contract.ts b/src/kit/contract.ts index b699c7389..b3a406faf 100644 --- a/src/kit/contract.ts +++ b/src/kit/contract.ts @@ -36,7 +36,7 @@ const serverReads = (adapter: MessengerAdapter): Reading | undefined => const NO_SERVER_READS = { skipped: "the adapter has no server reads (chats, history, around, contact)" } -/** Every method of the optional groups, which `capability` hands over or refuses. */ +/** Every method of the optional groups, which `capability` hands over or refuses. @experimental */ export const OPTIONAL_METHODS = [ "fetchCounters", ...SERVER_READS, diff --git a/src/kit/fake.ts b/src/kit/fake.ts index d0404df99..0c5a60f80 100644 --- a/src/kit/fake.ts +++ b/src/kit/fake.ts @@ -46,7 +46,7 @@ import { isId, pickChat, pickPerson } from "../resolve.js" import { uploadSize } from "../sends/upload.js" import { contractSeed, type Seed } from "./seed.js" -/** Every group of the port, over memory. */ +/** Every group of the port, over memory. @experimental */ export type FakeAdapter = MessengerCore & ServerReads & ChatReading & @@ -114,6 +114,7 @@ const withRules = (folder: Folder, { emoji, include, skip, exclude, pin }: Folde if (pin?.length) folder.pinnedChatIds = [...new Set([...(folder.pinnedChatIds ?? []), ...pin])] } +/** @experimental */ export const fakeAdapter = ( seed: Seed = contractSeed(), options: { feed?: boolean; listen?: boolean; listenHistory?: boolean; storedChats?: boolean } = {}, diff --git a/src/kit/run-scope.ts b/src/kit/run-scope.ts index 3a9b27c54..20857f030 100644 --- a/src/kit/run-scope.ts +++ b/src/kit/run-scope.ts @@ -4,6 +4,7 @@ import { tmpdir } from "node:os" import { join } from "node:path" import { metaOf } from "@wirecat/cli-base/commands" import type { Command } from "commander" +import { hasOwnAction } from "../cli/commander-internals.js" import { createProgram, type ProgramDefinition, type RunOptions, run } from "../cli/program.js" import { findRun, runsDirFor } from "../runs/run.js" @@ -47,7 +48,7 @@ interface Remote { } /** Commander keeps it private; a group with an action of its own, as `doctor` beside `doctor reports`, runs too. */ -const acts = (command: Command): boolean => (command as unknown as { _actionHandler?: unknown })._actionHandler != null +const acts = (command: Command): boolean => hasOwnAction(command) const remoteCommands = (program: Command, path: string[] = []): Remote[] => program.commands.flatMap((command) => { diff --git a/src/kit/search-recipes.ts b/src/kit/search-recipes.ts index 37e78ee30..61c244e6a 100644 --- a/src/kit/search-recipes.ts +++ b/src/kit/search-recipes.ts @@ -2,6 +2,7 @@ import { readFileSync } from "node:fs" import type { Chat, Message } from "../domain/models.js" import type { AccountKey, MessageStore } from "../store/store.js" +/** @experimental */ export interface SearchRecipes { chats: Pick[] messages: Pick[] @@ -15,6 +16,7 @@ export interface SearchRecipes { recipes: { title: string; query: string; ids: string[] }[] negative: { query: string; code: string; reason: string }[] } +/** @experimental */ export const searchRecipes: SearchRecipes = JSON.parse( readFileSync(new URL("../../docs/search/recipes.json", import.meta.url), "utf8"), ) diff --git a/src/kit/seed.ts b/src/kit/seed.ts index 472187453..3cadf3292 100644 --- a/src/kit/seed.ts +++ b/src/kit/seed.ts @@ -26,13 +26,14 @@ export type IdKind = "chat" | "message" | "person" /** An id for the `n`th thing of a kind; `time` is when a message was sent, for a messenger whose ids carry it. */ export type IdMaker = (kind: IdKind, n: number, time: Date) => Id +/** @experimental */ export const BUSY_PAGE = 3 const BUSY_MESSAGES = 10 -/** Ids that are not numbers, so no code may take them for one. */ +/** Ids that are not numbers, so no code may take them for one. @experimental */ export const wordIds: IdMaker = (kind, n) => `${kind}-${n}` -/** Whole numbers within 2^53, for a messenger whose store pages by id. */ +/** Whole numbers within 2^53, for a messenger whose store pages by id. @experimental */ export const digitIds: IdMaker = (kind, n) => String({ person: 100, chat: 200, message: 1000 }[kind] + n) const START = Date.parse("2026-09-01T09:00:00.000Z") diff --git a/src/mail/findings.ts b/src/mail/findings.ts index 77b050bdf..2d631c266 100644 --- a/src/mail/findings.ts +++ b/src/mail/findings.ts @@ -266,7 +266,7 @@ const VALUES: Partial> order_update: { status: ORDER_STATUSES }, } -/** One line per kind, `kind: needed fields; optional ones`, for `mail findings add --help`. */ +/** One line per kind, `kind: needed fields; optional ones`, for `mail findings add --help`. @experimental */ export const mailFindingFieldsHelp = (): string => MAIL_FINDING_KINDS.map((kind) => { const { needs, may } = MAIL_FINDING_FIELDS[kind] diff --git a/src/mail/sync.test.ts b/src/mail/sync.test.ts index d922a2f73..58c39fcab 100644 --- a/src/mail/sync.test.ts +++ b/src/mail/sync.test.ts @@ -312,6 +312,22 @@ describe("syncMail", () => { expect((await emails(env)).map(({ externalId }) => externalId)).not.toContain("9006") }) + // INT-1: the search proved the mail is there; a listing that leaves it out says nothing about a deletion. + it("marks nothing deleted when the listing leaves out mail the search found", async () => { + const { env, write } = setup([mail(1), mail(2), mail(3), mail(4), mail(5), mail(6)]) + await importInto(env) + write([mail(1), mail(2), mail(3), mail(4), mail(5), mail(6)], { failOnce: ["103"] }) + + const second = await importInto(env) + + expect(second.deleted).toBe(0) + expect(second.deletionsSkipped).toMatch(/left out of its listing/) + expect((await emails(env)).find(({ externalId }) => externalId === "9003")).toMatchObject({ + deletedAt: null, + bodyText: "Synthetic body 3", + }) + }) + it("saves a mail marked deleted again when the source lists it again", async () => { const all = [1, 2, 3, 4, 5, 6].map((n) => mail(n)) const { env, write } = setup(all) diff --git a/src/mail/sync.ts b/src/mail/sync.ts index 43ba23de2..cac6bb5f8 100644 --- a/src/mail/sync.ts +++ b/src/mail/sync.ts @@ -314,6 +314,8 @@ const syncRound = async ( const refreshed = new Map() /** Folders whose server refused SEARCH: nothing of them is known, so nothing of them is proved or moved. */ const refused = new Set() + // A UID the search found and the listing left out is not seen this run, which proves nothing about it. + const listedShort = new Set() const holdsMail = async (folder: string) => (await store.mail.emails({ accountId, mailbox: folder, limit: 1 })).length > 0 for (const folder of folders) { @@ -456,16 +458,18 @@ const syncRound = async ( headers: rules.length > 0, ...(wanted === undefined ? {} : { searched: wanted }), }) - if (plan !== undefined && wanted !== undefined) { + if (wanted !== undefined) { const got = new Set(found.map(({ uid }) => uid)) - for (const uid of wanted.uids) { - const key = keyOf(folder, uid) - if (got.has(uid)) plan.unlisted.delete(key) - else { - plan.failed.add(key) - plan.unlisted.add(key) + if (wanted.uids.some((uid) => !got.has(uid))) listedShort.add(folder) + if (plan !== undefined) + for (const uid of wanted.uids) { + const key = keyOf(folder, uid) + if (got.has(uid)) plan.unlisted.delete(key) + else { + plan.failed.add(key) + plan.unlisted.add(key) + } } - } } // Spreading a whole mailbox into push() overflows the stack past ~120,000 emails. for (const item of found) collected.push(item) @@ -521,6 +525,10 @@ const syncRound = async ( if (snapshot) skipped = "an mbox file is a snapshot; mail missing from it is not proven deleted" else if (refused.size > 0) skipped = `the server refused to search ${[...refused].join(", ")}; no deletion is checked until it answers` + else if (listedShort.size > 0) + skipped = + `the server left out of its listing mail its search found in ${[...listedShort].join(", ")}; no deletion is ` + + "checked until a listing returns all of it" else if (plan !== undefined && (capped || plan.tried.size > plan.asked || plan.only !== undefined)) skipped = "this run read the window in parts; a run that lists all of it at once checks deletions" else if (quickRan.size > 0) { diff --git a/src/mcp/agent.ts b/src/mcp/agent.ts index 70974eea9..a4ed8954a 100644 --- a/src/mcp/agent.ts +++ b/src/mcp/agent.ts @@ -34,6 +34,7 @@ export interface AgentProgram { commands: readonly CommandInfo[] } +/** @experimental */ export interface AgentContext { profile: string readOnly?: boolean @@ -58,6 +59,7 @@ export interface AgentContext { caller?: RunCaller } +/** @experimental */ export type AgentAnswer = { result: unknown } | { error: ErrorObject } export interface AgentTool { @@ -336,10 +338,11 @@ const argvOf = ( /** * Runs one command for an agent through the CLI itself, in this process: the same parsing, guard, answer and * error as on the command line. The answer comes back as the object the command rendered, and a failure as the - * error object the CLI would print. A write at level `ask` goes ahead (NEED-773); the server's stricter levels + * error object the CLI would print. A write at level `ask` goes ahead; the server's stricter levels * apply, to the check before the run and to the command's own guard. With `connection`, the command borrows the * server's open connection and never opens one of its own. Which commands are offered is the catalogue's * decision (`toolsFromCommands`); this runs what it is handed, except a command that never returns. + * @experimental */ export const runCommandForAgent = async ( program: AgentProgram, diff --git a/src/mcp/all-profiles.ts b/src/mcp/all-profiles.ts index a7a5aad9d..1726441a2 100644 --- a/src/mcp/all-profiles.ts +++ b/src/mcp/all-profiles.ts @@ -12,13 +12,14 @@ const PROTOCOL = "2025-06-18" const START_MS = 30_000 export const CHILD_IDLE_MS = 10 * 60 * 1000 -/** How to start the one-profile server for a profile: `