5efb380da5
* feat: automate yiacad pr review lane * fix: stabilize yiacad review and spec gates * fix: scope kicad exports to repo hardware * fix: ignore kicad block library sources in exports * feat: Add infra VPS monitoring runbook and healthcheck scripts - Created INFRA_VPS_RUNBOOK_2026.md detailing operational procedures for monitoring VPS services. - Added infra_vps_healthcheck.sh script for automated health checks on DNS, TLS, TCP, and HTTP for VPS services. - Introduced infra_vps_security_audit.sh for non-intrusive security checks on external VPS services. - Established JSON schema for infra VPS inventory in infra_vps.schema.json. - Developed integration for runtime status reporting in the Next.js API route. - Implemented Playwright tests for smoke testing the application and ensuring core functionalities. - Updated Makefile for development dependencies and testing commands. - Created various test files for unit and end-to-end testing across different components. * feat(agentics): update mesh agents, gates, prompts, and workflows
59 lines
1.3 KiB
TypeScript
59 lines
1.3 KiB
TypeScript
import { Queue } from "bullmq";
|
|
|
|
export type EdaPipeline =
|
|
| "kicad-headless"
|
|
| "kibot"
|
|
| "kiauto-checks"
|
|
| "step-export";
|
|
|
|
export type EdaJobPayload = {
|
|
runId: string;
|
|
pipeline: EdaPipeline;
|
|
projectRoot: string;
|
|
boardPath: string | null;
|
|
schematicPath: string | null;
|
|
freecadDocumentPath: string | null;
|
|
};
|
|
|
|
const QUEUE_NAME = process.env.EDA_QUEUE_NAME ?? "yiacad-eda";
|
|
|
|
let queue: Queue<EdaJobPayload> | null = null;
|
|
|
|
function redisConnection() {
|
|
const rawUrl = process.env.REDIS_URL;
|
|
if (!rawUrl) {
|
|
throw new Error("REDIS_URL is not configured.");
|
|
}
|
|
const url = new URL(rawUrl);
|
|
const db = url.pathname && url.pathname !== "/" ? Number(url.pathname.slice(1)) : 0;
|
|
|
|
return {
|
|
host: url.hostname,
|
|
port: Number(url.port || 6379),
|
|
username: url.username || undefined,
|
|
password: url.password || undefined,
|
|
db,
|
|
tls: url.protocol === "rediss:" ? {} : undefined
|
|
};
|
|
}
|
|
|
|
export function getEdaQueue() {
|
|
if (!queue) {
|
|
queue = new Queue<EdaJobPayload>(QUEUE_NAME, {
|
|
connection: redisConnection()
|
|
});
|
|
}
|
|
|
|
return queue;
|
|
}
|
|
|
|
export async function enqueueEdaJob(payload: EdaJobPayload) {
|
|
const job = await getEdaQueue().add(payload.pipeline, payload, {
|
|
jobId: payload.runId,
|
|
removeOnComplete: 100,
|
|
removeOnFail: 500
|
|
});
|
|
|
|
return `${job.id}`;
|
|
}
|