Claude при чтении недоверенных документов запускается без MCP-коннекторов и только с Read и Bash
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { extname, join } from "node:path";
|
||||
import { promisify } from "node:util";
|
||||
import type { Logger, Pool } from "khb_common";
|
||||
import type { ClaudeRunner } from "./claude-runner.js";
|
||||
import { UNTRUSTED_DOC_ARGS } from "./claude-runner.js";
|
||||
import type { DriveStore } from "./drive.js";
|
||||
import { ingestCertificate } from "./certificates-ingest.js";
|
||||
import { normalizeVendorName } from "./vendor-name.js";
|
||||
@@ -274,7 +275,7 @@ async function recognize(deps: InvoiceIngestDeps, msg: MailMessage, att: MailAtt
|
||||
const ext = extOf(att.filename);
|
||||
const path = join(dir, `invoice${DOC_EXT.has(ext) ? ext : ".bin"}`);
|
||||
await writeFile(path, bytes);
|
||||
const res = await deps.claude({ prompt: buildRecognitionPrompt(path, msg), cwd: dir });
|
||||
const res = await deps.claude({ prompt: buildRecognitionPrompt(path, msg), cwd: dir, extraArgs: UNTRUSTED_DOC_ARGS });
|
||||
if (!res.ok) throw new Error(`Claude не отработал (код ${res.exitCode}${res.timedOut ? ", таймаут" : ""}): ${res.stderr.slice(0, 200)}`);
|
||||
return parseRecognition(res.stdout);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user