MCP: instructions для Claude (что у нас на сегодня -> очередь бухгалтерии) и промпт today; текст в p-mcp-instructions.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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)");
|
||||
|
||||
Reference in New Issue
Block a user