@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.
329 lines • 14.1 kB
TypeScript
/**
* The reading half.
*
* Every one of these is a query the signed-in user could have run themselves;
* nothing here widens what they may see. The reports come from the schema's
* own functions — `trial_balance`, `general_ledger`, `aged_balance`,
* `subledger`, `vat_return`, `fec_lines` — rather than from sums computed here, because a
* second implementation of a balance is a second answer to the same question.
*/
import { z } from 'zod';
import { type Backend, type Row, type SessionPosting } from '../backend.js';
import { money, type DocumentPdf, type LogoFetch } from '@ekwo-ai/core';
export { agedBalance, analyticReport, contactStatement, ecSalesList, financialStatement, generalLedger, getDocument, journalBook, listAnalyticAxes, listDocuments, listStatements, searchContacts, subledger, suggestDuplicateContacts, trialBalance, vatReturn, } from '@ekwo-ai/core';
export declare const uuid: z.ZodString;
export declare const isoDate: z.ZodString;
export declare const companyId: z.ZodString;
export declare const ListCompaniesInput: z.ZodObject<{}, z.core.$strip>;
export declare function listCompanies(backend: Backend): Promise<unknown>;
export declare const GetCompanyInput: z.ZodObject<{
company_id: z.ZodString;
}, z.core.$strip>;
export { getCompany } from '@ekwo-ai/core';
export declare const ListAccountsInput: z.ZodObject<{
company_id: z.ZodString;
code_prefix: z.ZodOptional<z.ZodString>;
account_type: z.ZodOptional<z.ZodString>;
search: z.ZodOptional<z.ZodString>;
in_use_from: z.ZodOptional<z.ZodString>;
in_use_to: z.ZodOptional<z.ZodString>;
include_all: z.ZodOptional<z.ZodBoolean>;
include_deprecated: z.ZodOptional<z.ZodBoolean>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare function listAccounts(backend: Backend, args: z.infer<typeof ListAccountsInput>): Promise<unknown>;
export declare const SearchContactsInput: z.ZodObject<{
company_id: z.ZodString;
query: z.ZodOptional<z.ZodString>;
contact_type: z.ZodOptional<z.ZodEnum<{
customer: "customer";
supplier: "supplier";
both: "both";
employee: "employee";
other: "other";
}>>;
vat_number: z.ZodOptional<z.ZodString>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare const SuggestDuplicateContactsInput: z.ZodObject<{
company_id: z.ZodString;
contact_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
customer: "customer";
supplier: "supplier";
both: "both";
employee: "employee";
other: "other";
}>>>;
}, z.core.$strip>;
export declare const ContactStatementInput: z.ZodObject<{
company_id: z.ZodString;
contact_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare const ListDocumentsInput: z.ZodObject<{
company_id: z.ZodString;
doc_type: z.ZodOptional<z.ZodEnum<{
sale_invoice: "sale_invoice";
sale_credit_note: "sale_credit_note";
sale_quote: "sale_quote";
purchase_invoice: "purchase_invoice";
purchase_credit_note: "purchase_credit_note";
purchase_order: "purchase_order";
}>>;
state: z.ZodOptional<z.ZodEnum<{
draft: "draft";
posted: "posted";
cancelled: "cancelled";
}>>;
payment_state: z.ZodOptional<z.ZodEnum<{
not_paid: "not_paid";
partially_paid: "partially_paid";
paid: "paid";
overpaid: "overpaid";
reversed: "reversed";
}>>;
contact_id: z.ZodOptional<z.ZodString>;
from: z.ZodOptional<z.ZodString>;
to: z.ZodOptional<z.ZodString>;
unpaid: z.ZodOptional<z.ZodBoolean>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare const GetDocumentInput: z.ZodObject<{
document_id: z.ZodString;
}, z.core.$strip>;
export declare const RenderInvoicePdfInput: z.ZodObject<{
document_id: z.ZodString;
factur_x: z.ZodOptional<z.ZodBoolean>;
page_size: z.ZodOptional<z.ZodEnum<{
A4: "A4";
Letter: "Letter";
}>>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
}, z.core.$strip>;
/** Base64 without Buffer, which a server running outside Node does not have. */
export declare function base64Of(bytes: Uint8Array): string;
/**
* The PDF of a sale invoice or credit note, through `renderDocumentPdf()` of
* the core — the call `ekwo doc pdf` makes. The logo the company names by URL
* is fetched by this server, with `logoFetch`.
*/
export declare function renderInvoicePdf(backend: Backend, args: z.infer<typeof RenderInvoicePdfInput>, logoFetch: LogoFetch | undefined): Promise<DocumentPdf>;
export declare const ListBankTransactionsInput: z.ZodObject<{
company_id: z.ZodString;
bank_account_id: z.ZodOptional<z.ZodString>;
state: z.ZodOptional<z.ZodEnum<{
all: "all";
pending: "pending";
reconciled: "reconciled";
ignored: "ignored";
}>>;
from: z.ZodOptional<z.ZodString>;
to: z.ZodOptional<z.ZodString>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare function listBankTransactions(backend: Backend, args: z.infer<typeof ListBankTransactionsInput>): Promise<unknown>;
export declare const SearchProductsInput: z.ZodObject<{
company_id: z.ZodString;
query: z.ZodOptional<z.ZodString>;
kind: z.ZodOptional<z.ZodEnum<{
service: "service";
goods: "goods";
}>>;
include_inactive: z.ZodOptional<z.ZodBoolean>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare function searchProducts(backend: Backend, args: z.infer<typeof SearchProductsInput>): Promise<unknown>;
export declare const ListBankAccountsInput: z.ZodObject<{
company_id: z.ZodString;
include_inactive: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare function listBankAccounts(backend: Backend, args: z.infer<typeof ListBankAccountsInput>): Promise<unknown>;
export declare const ListApiKeysInput: z.ZodObject<{
company_id: z.ZodString;
include_withdrawn: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare function listApiKeys(backend: Backend, args: z.infer<typeof ListApiKeysInput>): Promise<unknown>;
export declare const GetPreferencesInput: z.ZodObject<{
company_id: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare function getPreferences(backend: Backend, args: z.infer<typeof GetPreferencesInput>): Promise<unknown>;
export declare const ListInvitationsInput: z.ZodObject<{
company_id: z.ZodString;
include_settled: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare function listInvitations(backend: Backend, args: z.infer<typeof ListInvitationsInput>): Promise<unknown>;
export declare const ListSharesInput: z.ZodObject<{
company_id: z.ZodString;
document_id: z.ZodOptional<z.ZodString>;
include_withdrawn: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare function listShares(backend: Backend, args: z.infer<typeof ListSharesInput>): Promise<unknown>;
export declare const TrialBalanceInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare const GeneralLedgerInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
account_code: z.ZodOptional<z.ZodString>;
account_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
contact_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
export declare const JournalBookInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
journal_code: z.ZodOptional<z.ZodString>;
journal_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
export declare const AgedBalanceInput: z.ZodObject<{
company_id: z.ZodString;
at: z.ZodOptional<z.ZodString>;
group: z.ZodOptional<z.ZodEnum<{
receivable: "receivable";
payable: "payable";
}>>;
}, z.core.$strip>;
export declare const SubledgerInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
account_code: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export { matchingDifferenceOptions, suggestItemCombinations } from '@ekwo-ai/core';
export declare const SuggestItemCombinationsInput: z.ZodObject<{
company_id: z.ZodString;
contact_id: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const MatchingDifferenceOptionsInput: z.ZodObject<{
company_id: z.ZodString;
}, z.core.$strip>;
export { suggestLineContacts } from '@ekwo-ai/core';
export declare const SuggestLineContactsInput: z.ZodObject<{
company_id: z.ZodString;
line_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
export declare const VatReturnInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
report_code: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const InstalmentPlanInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare function instalmentPlan(backend: Backend, args: z.infer<typeof InstalmentPlanInput>): Promise<unknown>;
export declare const EcSalesListInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
report_code: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const PortfolioUpcomingFilingsInput: z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare function portfolioUpcomingFilings(backend: Backend, args: z.infer<typeof PortfolioUpcomingFilingsInput>): Promise<unknown>;
export declare const PortfolioOverviewInput: z.ZodObject<{
on: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare function portfolioOverview(backend: Backend, args: z.infer<typeof PortfolioOverviewInput>): Promise<unknown>;
export declare const PortfolioFilingsTouchedSinceInput: z.ZodObject<{
from: z.ZodOptional<z.ZodString>;
to: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare function portfolioFilingsTouchedSince(backend: Backend, args: z.infer<typeof PortfolioFilingsTouchedSinceInput>): Promise<unknown>;
export declare const ListStatementsInput: z.ZodObject<{
company_id: z.ZodString;
at: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const FinancialStatementInput: z.ZodObject<{
company_id: z.ZodString;
statement_code: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare const FinancialAnalysisInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare function financialAnalysis(backend: Backend, args: z.infer<typeof FinancialAnalysisInput>): Promise<unknown>;
export declare const ListAnalyticAxesInput: z.ZodObject<{
company_id: z.ZodString;
}, z.core.$strip>;
export declare const AnalyticReportInput: z.ZodObject<{
company_id: z.ZodString;
axis: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare const GenerateFecInput: z.ZodObject<{
company_id: z.ZodString;
from: z.ZodString;
to: z.ZodString;
}, z.core.$strip>;
export declare function generateFec(backend: Backend, args: z.infer<typeof GenerateFecInput>): Promise<unknown>;
export declare const DescribePackInput: z.ZodObject<{
country: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
/**
* Where a country's rules come from, and how much anyone has read them.
*
* The pack is the transcription of a régime — a chart of accounts, the taxes
* and the boxes of the return — and a transcription is only worth what its
* sources are worth. `certification_status` says whether a named professional
* has read it, or whether it reproduced a real company's accepted filing, and
* `sources` is the register the pack declares: the texts it was built from, each with the publisher that serves it, an absolute link and
* the day somebody opened it.
*
* It answers a question that used to have no answer here: shown a rate or a
* grid, where is the text it comes from. The article itself is on the tax and
* on the box — `legal_reference` — and `source_key` there names which of these
* entries it is in.
*/
export declare function describePack(backend: Backend, args: z.infer<typeof DescribePackInput>): Promise<unknown>;
export declare const StatusInput: z.ZodObject<{}, z.core.$strip>;
export declare function status(backend: Backend, options?: {
inviteToRegister?: boolean;
}): Promise<unknown>;
/** What a session chose, in words a model and a person read the same way. */
export declare const SESSION_POSTING_NOTE: Record<SessionPosting | 'company', string>;
/**
* How this session posts, and how that comes out in each company: the
* session's choice, and `agent_posting_mode()` of every company — `review`,
* `autopilot`, or `autopilot_forbidden` where the session asked for autopilot
* in a company that forbids it.
*/
export declare function postingOf(backend: Backend, companies: Row[]): Promise<{
session: {
mode: SessionPosting | null;
session_id: string | null;
note: string;
};
companies: Row[];
}>;
/** Re-exported so the write tools can format the same way. */
export { money };
export declare const ReadAuditLogInput: z.ZodObject<{
company_id: z.ZodString;
table: z.ZodOptional<z.ZodString>;
record_key: z.ZodOptional<z.ZodString>;
actor_id: z.ZodOptional<z.ZodString>;
action: z.ZodOptional<z.ZodString>;
operation: z.ZodOptional<z.ZodEnum<{
insert: "insert";
update: "update";
delete: "delete";
}>>;
from: z.ZodOptional<z.ZodString>;
to: z.ZodOptional<z.ZodString>;
limit: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export declare function readAuditLog(backend: Backend, args: z.infer<typeof ReadAuditLogInput>): Promise<unknown>;
//# sourceMappingURL=read.d.ts.map