MCP: instructions для Claude (что у нас на сегодня -> очередь бухгалтерии) и промпт today; текст в p-mcp-instructions.md
All checks were successful
ci / test (push) Successful in 37s
ci / deploy (push) Successful in 2m40s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 09:28:12 +03:00
parent aae7472010
commit ac2436e0f0
5 changed files with 69 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import { readFileSync } from "node:fs";
import { createLogger, createPool, itNotify, loadServiceSettings } from "khb_common";
import { runCategorization } from "./categorize.js";
import { makeClaudeRunner } from "./claude-runner.js";
@@ -6,6 +7,7 @@ import { runFinalize } from "./finalize.js";
import { GmailClient } from "./gmail.js";
import { GoogleAuth } from "./google.js";
import { buildApi } from "./http-api.js";
import { instructionsFromFile } from "./mcp.js";
import { runInvoiceIngest } from "./invoices-mail.js";
import { makePromptLoader } from "./prompt-loader.js";
import { accountingSchema } from "./settings.js";
@@ -44,9 +46,17 @@ async function nonWorkdays(): Promise<ReadonlySet<string>> {
return new Set(rows.map((r) => r.d as string));
}
let mcpInstructions: string | undefined;
try {
mcpInstructions = instructionsFromFile(readFileSync(`${process.env.KHB_REPO_ROOT ?? process.cwd()}/docs/proposed/modules/quickbooks_bookkeeper/p-mcp-instructions.md`, "utf8"));
} catch (e) {
log.warn({ err: String(e) }, "p-mcp-instructions.md недоступен, используются встроенные инструкции MCP");
}
const app = buildApi({
pool,
settings: s,
mcpInstructions,
jobs: {
"invoices-mail": async () => {
if (!auth || !drive || !s.google) throw new Error("не настроены google (ключ сервисного аккаунта, rootFolderId)");