Skip to main content

apps/gateway/src/routes/agent-runtime.ts

Metadata

Indexed Symbols

  • asRecord (line 49, function) - Implements as record for HTTP request handling.
  • controlPlaneProbe (line 53, function) - Implements control plane probe for HTTP request handling.
  • resolveWorkers (line 83, function) - Implements resolve workers for HTTP request handling.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

import { randomUUID } from "node:crypto";
import type { FastifyPluginAsync } from "fastify";
import { env } from "../config/env.js";
import {
listFailedOutboxEvents,
retryOutboxEvent
} from "../services/event-pipeline.js";
import { query } from "../services/postgres.js";
import { enqueueAgentExecution } from "../services/agentfield-client.js";
import { buildAuditCredential } from "../services/audit.js";
import {
persistAuditCredential,
persistWorkflowExecution
} from "../services/workflow-repository.js";
import {
listFailedBackgroundJobs,
retryBackgroundJob
} from "../services/job-repository.js";
import { listWorkerRuntimeStatus } from "../services/worker-runtime-repository.js";
import { ensureRoles } from "../utils/authorization.js";
import { getWorkspaceIdFromHeaders } from "../utils/workspace.js";

const launchAgentReasoners = {
"triage-agent": "incident-triage",
"runbook-agent": "service-restoration-plan",