@outputai/http into @outputai/core. The package is no longer published: its API now lives at @outputai/core/http, with the same exports and behavior.
Two smaller breaks come with it: ky and undici are now peer dependencies of @outputai/core, and sendHttpRequest() parses some response bodies differently.
What changed
@outputai/httpis replaced by the@outputai/core/httpsubpath.outputFetch,createKyClient,addRequestCost, and thekyandundicire-exports are unchanged.@outputai/outputno longer depends on@outputai/http.ky(>=2 <3) andundici(>=8 <9) are peer dependencies of@outputai/core.Tracing.Attribute.HTTPRequestCountandTracing.Attribute.HTTPRequestCostmoved from@outputai/core/sdk/runtimeto@outputai/core/httpasHTTPRequestCountandHTTPRequestCost. Thehttp:request:countandhttp:request:costtrace attributes are unchanged.sendHttpRequest()returns XML, form-urlencoded, and JavaScript response bodies as text instead of base64, and returns empty or invalid JSON bodies as raw text instead of throwing.- With
OUTPUT_TRACE_HTTP_VERBOSEon, HTTP request and response bodies in trace files are parsed the same way assendHttpRequest(). Multipart bodies are stored as base64.
Migration steps
Update imports
Replace every import of@outputai/http with @outputai/core/http, including module mocks in tests:
Remove the dependency
Delete@outputai/http from dependencies, devDependencies, and peerDependencies in package.json. If your project depends on @outputai/core directly rather than through @outputai/output, bump it to 0.16.0.
Install the peer dependencies
npm 7+ and pnpm install peer dependencies automatically. With other package managers, or if your install reports missing peers, add them yourself:ky or undici, make sure the versions fall in the supported ranges.
Update trace attribute imports
Code that referencedTracing.Attribute.HTTPRequestCount or Tracing.Attribute.HTTPRequestCost should import them from @outputai/core/http:
addRequestCost() from @outputai/core/http.
Re-check sendHttpRequest() response bodies
This only affects calls with responseOptions.includeBody: true:
Remove any base64 decoding of those content types. If you relied on the error to detect a bad JSON response, check whether
body is a string instead.
Re-check trace file readers
If you parse trace files recorded withOUTPUT_TRACE_HTTP_VERBOSE on, request and response bodies now follow the table above, and multipart request bodies are base64 strings.