The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 82a1651a33d0Commit detailsView latest

api/index.ts 14 lines · 569 B · typescript
1
import type { IncomingMessage, ServerResponse } from 'node:http';
2
import { buildApi } from '../apps/api/src/app.js';
3
import { TrustEngine } from '../packages/core/src/index.js';
4
5
const app = buildApi(new TrustEngine());
6
const ready = app.ready();
7
8
export default async function handler(request: IncomingMessage, response: ServerResponse) {
9
  await ready;
10
  const incoming = new URL(request.url ?? '/', 'https://openclasp.local');
11
  const target = incoming.searchParams.get('path');
12
  if (target) request.url = target;
13
  app.server.emit('request', request, response);
14
}