refactor: unify outbound result envelopes

This commit is contained in:
Peter Steinberger
2026-01-07 02:36:05 +00:00
parent 4bf5f37a44
commit aa635af6d0
7 changed files with 173 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
import type { CliDeps } from "../cli/deps.js";
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
import { success } from "../globals.js";
import { buildOutboundResultEnvelope } from "../infra/outbound/envelope.js";
import {
buildOutboundDeliveryJson,
formatGatewaySummary,
@@ -89,12 +90,14 @@ export async function pollCommand(
runtime.log(
JSON.stringify(
{
...buildOutboundDeliveryJson({
provider,
via: "gateway",
to: opts.to,
result,
mediaUrl: null,
...buildOutboundResultEnvelope({
delivery: buildOutboundDeliveryJson({
provider,
via: "gateway",
to: opts.to,
result,
mediaUrl: null,
}),
}),
question: normalized.question,
options: normalized.options,