ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// Deterministic local platform fixture for the generated Convex app smoke. It runs on the host
// gateway so Convex's Node action can call it, while the smoke itself uses loopback.
import { readFile } from "node:fs/promises"
import { startFakePlatform } from "@conusai-kit/testing/fake-platform"
const port = Number(process.argv[2])
if (!Number.isInteger(port) || port < 1 || port > 65_535) throw new Error("a test platform port is required")
const fixture = JSON.parse(
await readFile(new URL("../../../modules/documents/__tests__/fixtures/ocr-document.json", import.meta.url), "utf8"),
)
const platform = await startFakePlatform(port, { host: "0.0.0.0" })
platform.ocr.setDocument(fixture)
platform.ai.respond(() => ({
content: JSON.stringify({
lines: [{ label: "Reference", value: "QR-2026-04", quote: "Reference: QR-2026-04" }],
}),
}))
console.log("local fake platform ready")
const stop = async () => {
await platform.close()
process.exit(0)
}
process.once("SIGINT", () => void stop())
process.once("SIGTERM", () => void stop())