@ekwo-ai/mcp
Version:
MCP server for Ekwo OS: let an AI agent work on the books, under the user's own row level security.
100 lines • 4.73 kB
TypeScript
/**
* The MCP tool `import_books`, and the sources it names.
*
* The readers are named after the file they read; a user looks for the
* software the file came from. So besides the formats, the tool accepts the
* name of the software whose export a reader was written against, and says
* which export that is. A name is listed here only once its reader exists and
* is tested, and the text says what is read — nothing else about the software.
* `docs/compatibility.md` is the same list, for a person.
*/
import { type BookSource } from '@ekwo-ai/core';
import { z } from 'zod';
import type { Backend } from '../backend.js';
/** The software whose export a reader reads, by the name a user types. */
export declare const NAMED_SOURCES: {
readonly odoo: {
readonly reader: "journal-items";
readonly export: "the export of the Journal Items of Odoo (Accounting), as CSV, with its chart of accounts and its partners";
};
readonly xero: {
readonly reader: "journal-report";
readonly export: "the Journal Report or the General Ledger Detail of Xero, saved as CSV, with its chart of accounts and its contacts";
};
readonly 'quickbooks-online': {
readonly reader: "transaction-journal";
readonly export: "the Journal report of QuickBooks Online, exported to Excel and saved as CSV, with its Account # column, and its Account List exported the same way";
};
readonly pennylane: {
readonly reader: "fec";
readonly export: "the FEC (fichier des écritures comptables) of Pennylane, exported under Comptabilité > Saisie > Exports: the tab-separated text file inside the ZIP it downloads";
};
readonly 'sage-50': {
readonly reader: "fec";
readonly export: "the FEC (fichier des écritures comptables) of Sage 50, exported under Échanges > Exporter des écritures, format FEC";
};
readonly 'exact-online': {
readonly reader: "xaf";
readonly export: "the XML Audit File (XAF, version 3.2 or 4.0) of Exact Online, exported under Import/Export > Export > Audit file";
};
};
export declare const NAMED_SOURCE_KEYS: (keyof typeof NAMED_SOURCES)[];
/** The reader a source names: itself, or the one the software's export is read by. */
export declare function sourceOf(source: BookSource | keyof typeof NAMED_SOURCES): BookSource;
/**
* The most text the tool takes, all files together, in KiB. The files travel
* inside the conversation, and a model that has to repeat three megabytes of
* CSV in a tool call truncates them or runs out of room long before the
* database sees a line. The command line reads the same export from the disk,
* through the same function, without a limit.
*/
export declare const MAX_TEXT_KIB = 256;
export declare const IMPORT_BOOKS_DESCRIPTION: string;
export declare const ImportBooksInput: z.ZodObject<{
company_id: z.ZodString;
source: z.ZodEnum<{
"trial-balance": "trial-balance";
fec: "fec";
"journal-items": "journal-items";
"journal-report": "journal-report";
"transaction-journal": "transaction-journal";
xaf: "xaf";
odoo: "odoo";
xero: "xero";
"quickbooks-online": "quickbooks-online";
pennylane: "pennylane";
"sage-50": "sage-50";
"exact-online": "exact-online";
}>;
files: z.ZodArray<z.ZodObject<{
name: z.ZodString;
content: z.ZodString;
}, z.core.$strip>>;
mapping: z.ZodOptional<z.ZodObject<{
accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
journals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
}, z.core.$strip>>;
dry_run: z.ZodOptional<z.ZodBoolean>;
open_years: z.ZodOptional<z.ZodBoolean>;
opening_date: z.ZodOptional<z.ZodString>;
open_items: z.ZodOptional<z.ZodObject<{
name: z.ZodString;
content: z.ZodString;
}, z.core.$strip>>;
allow_result_accounts: z.ZodOptional<z.ZodBoolean>;
keep_numbers: z.ZodOptional<z.ZodBoolean>;
date_order: z.ZodOptional<z.ZodEnum<{
dmy: "dmy";
mdy: "mdy";
ymd: "ymd";
}>>;
accept_suggestions: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
/**
* Books from another system, all of them or none, through `importBooks()` of
* the core — the function `ekwo import` calls.
*/
export declare function importBooksTool(backend: Backend, args: z.infer<typeof ImportBooksInput>): Promise<unknown>;
/** The `ekwo import` command that does what this call asked, from files on the disk. */
export declare function cliEquivalent(args: z.infer<typeof ImportBooksInput>): string;
//# sourceMappingURL=import-books.d.ts.map