Merge branch 'worktree-agent-abd30c5c166471dc0'

This commit is contained in:
2026-11-23 16:44:52 +03:00
21 changed files with 902 additions and 20 deletions

View File

@@ -4,6 +4,9 @@ import { runCategorization } from "./categorize.js";
import { makeClaudeRunner } from "./claude-runner.js";
import { DriveClient } from "./drive.js";
import { runFinalize } from "./finalize.js";
import { runFraudFlags } from "./fraud.js";
import { runInvoiceCheck } from "./invoice-check.js";
import { runInvoicePaid } from "./invoice-paid.js";
import { GmailClient } from "./gmail.js";
import { GoogleAuth } from "./google.js";
import { buildApi } from "./http-api.js";
@@ -80,6 +83,8 @@ const app = buildApi({
claude,
realmId: await realmId(),
log,
approvalThresholdUsd: s.approvalThresholdUsd,
fraud: s.fraud,
loadPrompt: makePromptLoader({
docId: s.prompt.driveDocId,
fallbackFile: s.prompt.fallbackFile,
@@ -88,6 +93,9 @@ const app = buildApi({
log: (msg, extra) => log.warn(extra ?? {}, msg),
}),
}),
"fraud-flags": async () => runFraudFlags(pool, { settings: s.fraud, realmId: await realmId() }),
"invoice-check": () => runInvoiceCheck({ pool }),
"invoice-paid": async () => runInvoicePaid({ pool, realmId: await realmId() }),
summary: async () => {
if (!slack || !s.slack) throw new Error("не настроен slack (botToken, accountingChannelId)");
const text = await postDailySummary({ pool, slack, channelId: s.slack.accountingChannelId, tz: "Asia/Nicosia", options: { nonWorkdays: await nonWorkdays() } });