apps/gateway/src/services/agentfield-client.ts
Metadata
- Purpose: Gateway service module implementing business logic or integrations.
- Domain:
applications - Language:
ts - Bytes: 2703
- Lines: 89
- Content hash (short):
1e0f0f5e - Source (start): apps/gateway/src/services/agentfield-client.ts:1
- Source (end): apps/gateway/src/services/agentfield-client.ts:89
Indexed Symbols
buildExecuteUrl(line 20, function) - Implements build execute url for service-layer operations.normalizeStatus(line 37, function) - Implements normalize status for service-layer operations.parseExecutionResponse(line 44, function) - Implements parse execution response for service-layer operations.enqueueAgentExecution(line 57, function) - Implements enqueue agent execution for service-layer operations.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import type { ExecuteAgentRequest } from "@anchor/contracts";
import { env } from "../config/env.js";
import { resolveSecretValue } from "./runtime-config.js";
export type ExecutionHandle = {
executionId: string;
status: "queued" | "running";
acceptedAt: string;
};
type AgentFieldExecutionResponse = {
executionId?: string;
id?: string;
runId?: string;
status?: string;
acceptedAt?: string;
createdAt?: string;
};
function buildExecuteUrl(agent: string, reasoner: string): string {
if (!env.agentFieldUrl) {
throw new Error("AGENTFIELD_URL is required for execution dispatch");
}
const relativePath = env.agentFieldExecutePathTemplate