API Reference

City HTTP

由 City 持有的 Agent 与 Workspace HTTP transport

City HTTP

HTTP 属于 City,不属于单个 Agent。使用 city.http() 在一个监听器中暴露当前 City 中的全部 Agent。

const http = await city.http({ host: "127.0.0.1", port: 5314 });
console.log(http.binding()?.url);
await city.close();

请求路径前缀为 /agents/<agent_id>/workspaces/<workspace_id>。完整示例参见 City transport

目录