Skip to main content

createHttpClient

@forge/monorepo


@forge/monorepo / backend/src / createHttpClient

Function: createHttpClient()

createHttpClient(config?): HttpClient

Defined in: backend/src/toolkit/http.ts:193

The deterministic functions the first-party tools delegate to — REQ-039 (#188).

Why this is a layer of its own: boundary rule R7 forbids the tools layer from performing I/O, because a tool is "a thin, agent-facing envelope over a deterministic function" and an envelope that reached the network itself would be doing the work it exists to delegate. So the network, the parsing and the arithmetic live here, and tools/library/ holds envelopes that add authorisation, approval and idempotency and then call these.

Everything here is directly callable and separately testable, which is the other half of the point: the interesting behaviour of an outbound tool — what it refuses, where it stops reading — should be provable without constructing a run.

Parameters

config?

HttpClientConfig = {}

Returns

HttpClient