@compose-market/sdk 0.6.96 → 0.6.98-receipts
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.speakeasy/a2a.arazzo.yaml +1 -1
- package/.speakeasy/inference.arazzo.yaml +214 -0
- package/.speakeasy/memory.arazzo.yaml +1 -1
- package/.speakeasy/tests.arazzo.yaml +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/errors.d.ts +2 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/events.d.ts +41 -2
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +2 -0
- package/dist/events.js.map +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +13 -4
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/agent.js +233 -7
- package/dist/resources/agent.js.map +1 -1
- package/dist/resources/inference.d.ts +5 -5
- package/dist/resources/inference.d.ts.map +1 -1
- package/dist/resources/inference.js +60 -13
- package/dist/resources/inference.js.map +1 -1
- package/dist/resources/instrumentation.d.ts +2 -2
- package/dist/resources/instrumentation.d.ts.map +1 -1
- package/dist/resources/receipts.d.ts +23 -0
- package/dist/resources/receipts.d.ts.map +1 -0
- package/dist/resources/receipts.js +48 -0
- package/dist/resources/receipts.js.map +1 -0
- package/dist/resources/session-events.d.ts +11 -6
- package/dist/resources/session-events.d.ts.map +1 -1
- package/dist/resources/session-events.js +275 -70
- package/dist/resources/session-events.js.map +1 -1
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/resources/workflow.js +12 -3
- package/dist/resources/workflow.js.map +1 -1
- package/dist/resources/x402.d.ts +2 -2
- package/dist/resources/x402.d.ts.map +1 -1
- package/dist/resources/x402.js.map +1 -1
- package/dist/streaming/receipt.d.ts +4 -4
- package/dist/streaming/receipt.d.ts.map +1 -1
- package/dist/streaming/receipt.js +73 -22
- package/dist/streaming/receipt.js.map +1 -1
- package/dist/types/index.d.ts +176 -15
- package/dist/types/index.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/generated/inference/esm/lib/config.d.ts +3 -3
- package/generated/inference/esm/lib/config.js +3 -3
- package/generated/inference/esm/lib/config.js.map +1 -1
- package/generated/inference/esm/models/audio-transcription-response.d.ts +2 -2
- package/generated/inference/esm/models/audio-transcription-response.d.ts.map +1 -1
- package/generated/inference/esm/models/audio-transcription-response.js +3 -3
- package/generated/inference/esm/models/audio-transcription-response.js.map +1 -1
- package/generated/inference/esm/models/chat-completion.d.ts +2 -2
- package/generated/inference/esm/models/chat-completion.d.ts.map +1 -1
- package/generated/inference/esm/models/chat-completion.js +3 -3
- package/generated/inference/esm/models/chat-completion.js.map +1 -1
- package/generated/inference/esm/models/compose-receipt-body.d.ts +5 -5
- package/generated/inference/esm/models/compose-receipt-body.d.ts.map +1 -1
- package/generated/inference/esm/models/compose-receipt-body.js +5 -5
- package/generated/inference/esm/models/compose-receipt-body.js.map +1 -1
- package/generated/inference/esm/models/compose-receipt-line-item.d.ts +3 -3
- package/generated/inference/esm/models/compose-receipt-line-item.d.ts.map +1 -1
- package/generated/inference/esm/models/compose-receipt-line-item.js +3 -3
- package/generated/inference/esm/models/compose-receipt-line-item.js.map +1 -1
- package/generated/inference/esm/models/embeddings-response.d.ts +2 -2
- package/generated/inference/esm/models/embeddings-response.d.ts.map +1 -1
- package/generated/inference/esm/models/embeddings-response.js +3 -3
- package/generated/inference/esm/models/embeddings-response.js.map +1 -1
- package/generated/inference/esm/models/images-response.d.ts +2 -2
- package/generated/inference/esm/models/images-response.d.ts.map +1 -1
- package/generated/inference/esm/models/images-response.js +3 -3
- package/generated/inference/esm/models/images-response.js.map +1 -1
- package/generated/inference/esm/models/response-object.d.ts +2 -2
- package/generated/inference/esm/models/response-object.d.ts.map +1 -1
- package/generated/inference/esm/models/response-object.js +3 -3
- package/generated/inference/esm/models/response-object.js.map +1 -1
- package/generated/inference/esm/models/video-generate-response.d.ts +2 -2
- package/generated/inference/esm/models/video-generate-response.d.ts.map +1 -1
- package/generated/inference/esm/models/video-generate-response.js +3 -3
- package/generated/inference/esm/models/video-generate-response.js.map +1 -1
- package/generated/inference/package.json +1 -1
- package/generated/inference/src/lib/config.ts +3 -3
- package/generated/inference/src/models/audio-transcription-response.ts +5 -5
- package/generated/inference/src/models/chat-completion.ts +5 -5
- package/generated/inference/src/models/compose-receipt-body.ts +11 -11
- package/generated/inference/src/models/compose-receipt-line-item.ts +7 -7
- package/generated/inference/src/models/embeddings-response.ts +5 -5
- package/generated/inference/src/models/images-response.ts +5 -5
- package/generated/inference/src/models/response-object.ts +5 -5
- package/generated/inference/src/models/video-generate-response.ts +5 -5
- package/generated/manowar/esm/lib/config.d.ts +3 -3
- package/generated/manowar/esm/lib/config.js +3 -3
- package/generated/manowar/esm/lib/config.js.map +1 -1
- package/generated/manowar/package.json +1 -1
- package/generated/manowar/src/lib/config.ts +3 -3
- package/generated/memory/esm/lib/config.d.ts +3 -3
- package/generated/memory/esm/lib/config.js +3 -3
- package/generated/memory/esm/lib/config.js.map +1 -1
- package/generated/memory/package.json +1 -1
- package/generated/memory/src/lib/config.ts +3 -3
- package/generated/x402/esm/lib/config.d.ts +3 -3
- package/generated/x402/esm/lib/config.js +3 -3
- package/generated/x402/esm/lib/config.js.map +1 -1
- package/generated/x402/package.json +1 -1
- package/generated/x402/src/lib/config.ts +3 -3
- package/package.json +7 -5
- package/specs/inference.openapi.yaml +27 -36
- package/specs/manowar.openapi.yaml +1 -1
- package/specs/memory.openapi.yaml +1 -1
- package/specs/x402.openapi.yaml +1 -3
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* `event: compose.receipt` frame and echoed as `compose_receipt` in JSON
|
|
7
7
|
* response bodies.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { Receipt } from "../types/index.js";
|
|
10
10
|
export declare const RECEIPT_HEADER_NAMES: readonly ["x-compose-receipt", "X-Compose-Receipt"];
|
|
11
|
-
export declare function decodeReceiptHeader(value: string):
|
|
11
|
+
export declare function decodeReceiptHeader(value: string): Receipt;
|
|
12
12
|
/**
|
|
13
13
|
* Extract a receipt from a Fetch `Response`. Preference order:
|
|
14
14
|
* 1. `X-Compose-Receipt` header (binary truth)
|
|
@@ -16,10 +16,10 @@ export declare function decodeReceiptHeader(value: string): ComposeReceipt;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function extractReceiptFromResponse(response: {
|
|
18
18
|
headers: Headers;
|
|
19
|
-
}, body?: Record<string, unknown> | null):
|
|
19
|
+
}, body?: Record<string, unknown> | null): Receipt | null;
|
|
20
20
|
/**
|
|
21
21
|
* Parse the payload of an SSE `event: compose.receipt` frame. Throws on
|
|
22
22
|
* malformed JSON so callers can abort the stream consumer.
|
|
23
23
|
*/
|
|
24
|
-
export declare function parseReceiptEvent(data: string):
|
|
24
|
+
export declare function parseReceiptEvent(data: string): Receipt;
|
|
25
25
|
//# sourceMappingURL=receipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../src/streaming/receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../src/streaming/receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,oBAAoB,qDAAsD,CAAC;AAmBxF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACtC,QAAQ,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAC9B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACtC,OAAO,GAAG,IAAI,CAehB;AA6ED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAmBvD"}
|
|
@@ -44,24 +44,76 @@ export function extractReceiptFromResponse(response, body) {
|
|
|
44
44
|
}
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
+
function lineItems(value) {
|
|
48
|
+
return Array.isArray(value)
|
|
49
|
+
? value.map((item) => ({
|
|
50
|
+
key: String(item.key ?? ""),
|
|
51
|
+
unit: String(item.unit ?? ""),
|
|
52
|
+
quantity: Number(item.quantity ?? 0),
|
|
53
|
+
unitPriceUsd: Number(item.unitPriceUsd ?? item.unit_price_usd ?? 0),
|
|
54
|
+
amountWei: String(item.amountWei ?? item.amount_wei ?? "0"),
|
|
55
|
+
}))
|
|
56
|
+
: undefined;
|
|
57
|
+
}
|
|
58
|
+
function bills(value) {
|
|
59
|
+
return Array.isArray(value)
|
|
60
|
+
? value.map((bill) => ({
|
|
61
|
+
kind: bill.kind,
|
|
62
|
+
source: typeof bill.source === "string" ? bill.source : undefined,
|
|
63
|
+
name: typeof bill.name === "string" ? bill.name : undefined,
|
|
64
|
+
action: typeof bill.action === "string" ? bill.action : undefined,
|
|
65
|
+
subject: typeof bill.subject === "string" ? bill.subject : undefined,
|
|
66
|
+
agentWallet: typeof (bill.agentWallet ?? bill.agent_wallet) === "string"
|
|
67
|
+
? String(bill.agentWallet ?? bill.agent_wallet)
|
|
68
|
+
: undefined,
|
|
69
|
+
amountWei: String(bill.amountWei ?? bill.amount_wei ?? "0"),
|
|
70
|
+
subtotalWei: bill.subtotalWei ?? bill.subtotal_wei ? String(bill.subtotalWei ?? bill.subtotal_wei) : undefined,
|
|
71
|
+
composeFeeWei: bill.composeFeeWei ?? bill.compose_fee_wei ? String(bill.composeFeeWei ?? bill.compose_fee_wei) : undefined,
|
|
72
|
+
creatorFee: bill.creatorFee ?? bill.creator_fee ? Number(bill.creatorFee ?? bill.creator_fee) : undefined,
|
|
73
|
+
creatorFeeWei: bill.creatorFeeWei ?? bill.creator_fee_wei ? String(bill.creatorFeeWei ?? bill.creator_fee_wei) : undefined,
|
|
74
|
+
children: bills(bill.children),
|
|
75
|
+
lineItems: lineItems(bill.lineItems ?? bill.line_items) ?? [],
|
|
76
|
+
}))
|
|
77
|
+
: undefined;
|
|
78
|
+
}
|
|
79
|
+
function cumulative(value) {
|
|
80
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
81
|
+
return undefined;
|
|
82
|
+
const raw = value;
|
|
83
|
+
return {
|
|
84
|
+
totalAmountWei: String(raw.totalAmountWei ?? raw.total_amount_wei ?? "0"),
|
|
85
|
+
providerAmountWei: raw.providerAmountWei ?? raw.provider_amount_wei
|
|
86
|
+
? String(raw.providerAmountWei ?? raw.provider_amount_wei)
|
|
87
|
+
: undefined,
|
|
88
|
+
platformFeeWei: raw.platformFeeWei ?? raw.platform_fee_wei
|
|
89
|
+
? String(raw.platformFeeWei ?? raw.platform_fee_wei)
|
|
90
|
+
: undefined,
|
|
91
|
+
receiptCount: Number(raw.receiptCount ?? raw.receipt_count ?? 0),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
47
94
|
function normalizeBodyReceipt(raw) {
|
|
48
95
|
return {
|
|
96
|
+
id: typeof raw.id === "string" ? raw.id : undefined,
|
|
97
|
+
service: typeof raw.service === "string" ? raw.service : undefined,
|
|
98
|
+
action: typeof raw.action === "string" ? raw.action : undefined,
|
|
99
|
+
resource: typeof raw.resource === "string" ? raw.resource : undefined,
|
|
100
|
+
userAddress: typeof (raw.userAddress ?? raw.user_address) === "string"
|
|
101
|
+
? String(raw.userAddress ?? raw.user_address)
|
|
102
|
+
: undefined,
|
|
49
103
|
subject: typeof raw.subject === "string" ? raw.subject : undefined,
|
|
50
|
-
lineItems:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
quantity: Number(item.quantity ?? 0),
|
|
55
|
-
unitPriceUsd: Number(item.unit_price_usd ?? 0),
|
|
56
|
-
amountWei: String(item.amount_wei ?? "0"),
|
|
57
|
-
}))
|
|
104
|
+
lineItems: lineItems(raw.lineItems ?? raw.line_items),
|
|
105
|
+
bills: bills(raw.bills),
|
|
106
|
+
providerAmountWei: raw.providerAmountWei ?? raw.provider_amount_wei
|
|
107
|
+
? String(raw.providerAmountWei ?? raw.provider_amount_wei)
|
|
58
108
|
: undefined,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
109
|
+
platformFeeWei: raw.platformFeeWei ?? raw.platform_fee_wei
|
|
110
|
+
? String(raw.platformFeeWei ?? raw.platform_fee_wei)
|
|
111
|
+
: undefined,
|
|
112
|
+
finalAmountWei: String(raw.finalAmountWei ?? raw.final_amount_wei ?? "0"),
|
|
113
|
+
txHash: raw.txHash ?? raw.tx_hash ? String(raw.txHash ?? raw.tx_hash) : undefined,
|
|
63
114
|
network: raw.network ?? "eip155:0",
|
|
64
|
-
settledAt: Number(raw.settled_at ?? 0),
|
|
115
|
+
settledAt: Number(raw.settledAt ?? raw.settled_at ?? 0),
|
|
116
|
+
cumulative: cumulative(raw.cumulative),
|
|
65
117
|
};
|
|
66
118
|
}
|
|
67
119
|
/**
|
|
@@ -71,22 +123,21 @@ function normalizeBodyReceipt(raw) {
|
|
|
71
123
|
export function parseReceiptEvent(data) {
|
|
72
124
|
const raw = JSON.parse(data);
|
|
73
125
|
return {
|
|
126
|
+
id: typeof raw.id === "string" ? raw.id : undefined,
|
|
127
|
+
service: typeof raw.service === "string" ? raw.service : undefined,
|
|
128
|
+
action: typeof raw.action === "string" ? raw.action : undefined,
|
|
129
|
+
resource: typeof raw.resource === "string" ? raw.resource : undefined,
|
|
130
|
+
userAddress: typeof raw.userAddress === "string" ? raw.userAddress : undefined,
|
|
74
131
|
subject: typeof raw.meterSubject === "string" ? raw.meterSubject : (typeof raw.subject === "string" ? raw.subject : undefined),
|
|
75
|
-
lineItems:
|
|
76
|
-
|
|
77
|
-
key: String(item.key ?? ""),
|
|
78
|
-
unit: String(item.unit ?? ""),
|
|
79
|
-
quantity: Number(item.quantity ?? 0),
|
|
80
|
-
unitPriceUsd: Number(item.unitPriceUsd ?? 0),
|
|
81
|
-
amountWei: String(item.amountWei ?? "0"),
|
|
82
|
-
}))
|
|
83
|
-
: undefined,
|
|
132
|
+
lineItems: lineItems(raw.lineItems),
|
|
133
|
+
bills: bills(raw.bills),
|
|
84
134
|
providerAmountWei: raw.providerAmountWei ? String(raw.providerAmountWei) : undefined,
|
|
85
135
|
platformFeeWei: raw.platformFeeWei ? String(raw.platformFeeWei) : undefined,
|
|
86
136
|
finalAmountWei: String(raw.finalAmountWei ?? "0"),
|
|
87
137
|
txHash: raw.txHash ? String(raw.txHash) : undefined,
|
|
88
138
|
network: raw.network ?? "eip155:0",
|
|
89
139
|
settledAt: Number(raw.settledAt ?? 0),
|
|
140
|
+
cumulative: cumulative(raw.cumulative),
|
|
90
141
|
};
|
|
91
142
|
}
|
|
92
143
|
//# sourceMappingURL=receipt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../src/streaming/receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,CAAU,CAAC;AAExF,SAAS,eAAe,CAAC,KAAa;IAClC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CA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EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;QACvB,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS;QACpF,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC;QACjD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QACnD,OAAO,EAAG,GAAG,CAAC,OAA8B,IAAI,UAAU;QAC1D,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC;QACrC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC;KACzC,CAAC;AACN,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -169,7 +169,6 @@ export interface PaymentAbortResponse {
|
|
|
169
169
|
}
|
|
170
170
|
export interface ModelMeterInput {
|
|
171
171
|
modelId: string;
|
|
172
|
-
provider?: ModelProvider | string;
|
|
173
172
|
modality: CanonicalModality | string;
|
|
174
173
|
usage?: Record<string, unknown>;
|
|
175
174
|
media?: Record<string, unknown>;
|
|
@@ -340,23 +339,86 @@ export interface SessionExpiredEvent {
|
|
|
340
339
|
expiresAt?: number;
|
|
341
340
|
timestamp?: number;
|
|
342
341
|
}
|
|
343
|
-
export
|
|
344
|
-
|
|
342
|
+
export interface SessionLeaseEvent {
|
|
343
|
+
type: "session-lease";
|
|
344
|
+
userAddress: string;
|
|
345
|
+
chainId: number;
|
|
346
|
+
reason?: "lease-expired" | (string & {
|
|
347
|
+
readonly __brand?: "SessionLeaseReason";
|
|
348
|
+
});
|
|
349
|
+
message?: string;
|
|
350
|
+
leaseMs?: number;
|
|
351
|
+
retryAfterMs?: number;
|
|
352
|
+
timestamp?: number;
|
|
353
|
+
}
|
|
354
|
+
export type SessionEvent = SessionActiveEvent | SessionExpiredEvent | SessionLeaseEvent;
|
|
355
|
+
export interface ComposeAlert {
|
|
356
|
+
type: "compose.alert";
|
|
357
|
+
code: string;
|
|
358
|
+
severity: "info" | "warning" | "error";
|
|
359
|
+
source: string;
|
|
360
|
+
scope: "session" | "agent" | "model" | "workflow" | "api" | (string & {
|
|
361
|
+
readonly __brand?: "ComposeAlertScope";
|
|
362
|
+
});
|
|
363
|
+
title?: string;
|
|
364
|
+
message: string;
|
|
365
|
+
userAddress?: string | null;
|
|
366
|
+
chainId?: number | null;
|
|
367
|
+
timestamp?: number;
|
|
368
|
+
metadata?: Record<string, unknown>;
|
|
369
|
+
leaseMs?: number;
|
|
370
|
+
retryAfterMs?: number;
|
|
371
|
+
}
|
|
372
|
+
export interface ReceiptLineItem {
|
|
345
373
|
key: string;
|
|
346
374
|
unit: string;
|
|
347
375
|
quantity: number;
|
|
348
376
|
unitPriceUsd: number;
|
|
349
377
|
amountWei: string;
|
|
350
378
|
}
|
|
351
|
-
export interface
|
|
379
|
+
export interface ReceiptBill {
|
|
380
|
+
kind: "agent" | "workflow" | "model" | "tool" | "search" | "connector" | "memory";
|
|
381
|
+
source?: string;
|
|
382
|
+
name?: string;
|
|
383
|
+
action?: string;
|
|
352
384
|
subject?: string;
|
|
353
|
-
|
|
385
|
+
agentWallet?: string;
|
|
386
|
+
amountWei: string;
|
|
387
|
+
subtotalWei?: string;
|
|
388
|
+
composeFeeWei?: string;
|
|
389
|
+
creatorFee?: number;
|
|
390
|
+
creatorFeeWei?: string;
|
|
391
|
+
children?: ReceiptBill[];
|
|
392
|
+
lineItems: ReceiptLineItem[];
|
|
393
|
+
}
|
|
394
|
+
export interface ReceiptCumulative {
|
|
395
|
+
totalAmountWei: string;
|
|
396
|
+
providerAmountWei?: string;
|
|
397
|
+
platformFeeWei?: string;
|
|
398
|
+
receiptCount: number;
|
|
399
|
+
}
|
|
400
|
+
export interface Receipt {
|
|
401
|
+
id?: string;
|
|
402
|
+
service?: string;
|
|
403
|
+
action?: string;
|
|
404
|
+
resource?: string;
|
|
405
|
+
userAddress?: string;
|
|
406
|
+
subject?: string;
|
|
407
|
+
lineItems?: ReceiptLineItem[];
|
|
408
|
+
bills?: ReceiptBill[];
|
|
354
409
|
providerAmountWei?: string;
|
|
355
410
|
platformFeeWei?: string;
|
|
356
411
|
finalAmountWei: string;
|
|
357
412
|
txHash?: string;
|
|
358
413
|
network: `eip155:${number}`;
|
|
359
414
|
settledAt: number;
|
|
415
|
+
cumulative?: ReceiptCumulative;
|
|
416
|
+
}
|
|
417
|
+
export interface ReceiptListResponse {
|
|
418
|
+
userAddress: string;
|
|
419
|
+
chainId: number;
|
|
420
|
+
cumulative: ReceiptCumulative;
|
|
421
|
+
receipts: Receipt[];
|
|
360
422
|
}
|
|
361
423
|
export type ModelProvider = "gemini" | "openai" | "fireworks" | "asicloud" | "alibaba" | "hugging face" | "azure" | "aiml" | "vertex" | "cloudflare" | "deepgram" | "elevenlabs" | "cartesia" | "roboflow";
|
|
362
424
|
export type CanonicalModality = "text" | "image" | "audio" | "video" | "embedding";
|
|
@@ -418,6 +480,7 @@ export interface Model {
|
|
|
418
480
|
modelType?: unknown;
|
|
419
481
|
sourceMetadata?: unknown;
|
|
420
482
|
params?: unknown;
|
|
483
|
+
operations?: ModelOperationCapability[];
|
|
421
484
|
ownedBy?: string;
|
|
422
485
|
createdAt?: string | number;
|
|
423
486
|
available?: boolean;
|
|
@@ -637,7 +700,6 @@ export interface ChatCompletionsCreateParams extends OpenAIPassthroughParams {
|
|
|
637
700
|
max_completion_tokens?: number;
|
|
638
701
|
tools?: ChatToolDefinition[];
|
|
639
702
|
tool_choice?: ChatToolChoice;
|
|
640
|
-
provider?: ModelProvider;
|
|
641
703
|
[key: string]: unknown;
|
|
642
704
|
}
|
|
643
705
|
export interface ChatUsage {
|
|
@@ -720,7 +782,6 @@ export interface ResponsesCreateParams extends OpenAIPassthroughParams {
|
|
|
720
782
|
duration?: number;
|
|
721
783
|
aspect_ratio?: string;
|
|
722
784
|
resolution?: string;
|
|
723
|
-
provider?: ModelProvider;
|
|
724
785
|
[key: string]: unknown;
|
|
725
786
|
}
|
|
726
787
|
export interface ResponseObject {
|
|
@@ -744,7 +805,24 @@ export interface ResponseObject {
|
|
|
744
805
|
job_id?: string;
|
|
745
806
|
compose_receipt?: Record<string, unknown>;
|
|
746
807
|
}
|
|
808
|
+
export interface ResponseOutputItem {
|
|
809
|
+
type: string;
|
|
810
|
+
role?: "assistant";
|
|
811
|
+
text?: string;
|
|
812
|
+
image_url?: string;
|
|
813
|
+
audio_url?: string;
|
|
814
|
+
video_url?: string;
|
|
815
|
+
embedding?: number[];
|
|
816
|
+
job_id?: string;
|
|
817
|
+
status?: string;
|
|
818
|
+
progress?: number;
|
|
819
|
+
mime_type?: string;
|
|
820
|
+
[key: string]: unknown;
|
|
821
|
+
}
|
|
747
822
|
export type ResponseStreamEvent = {
|
|
823
|
+
type: "response.created";
|
|
824
|
+
response: ResponseObject;
|
|
825
|
+
} | {
|
|
748
826
|
type: "response.output_text.delta";
|
|
749
827
|
response_id: string;
|
|
750
828
|
model: string;
|
|
@@ -791,6 +869,21 @@ export type ResponseStreamEvent = {
|
|
|
791
869
|
output_tokens: number;
|
|
792
870
|
total_tokens: number;
|
|
793
871
|
};
|
|
872
|
+
} | {
|
|
873
|
+
type: "response.output_item.completed";
|
|
874
|
+
response_id: string;
|
|
875
|
+
model: string;
|
|
876
|
+
output_index: number;
|
|
877
|
+
item: ResponseOutputItem;
|
|
878
|
+
} | {
|
|
879
|
+
type: "response.output_video.status";
|
|
880
|
+
response_id: string;
|
|
881
|
+
model: string;
|
|
882
|
+
job_id: string;
|
|
883
|
+
status: "queued" | "processing" | "completed" | "failed";
|
|
884
|
+
progress?: number;
|
|
885
|
+
url?: string;
|
|
886
|
+
error?: string;
|
|
794
887
|
} | {
|
|
795
888
|
type: "response.completed";
|
|
796
889
|
response_id: string;
|
|
@@ -810,7 +903,6 @@ export interface EmbeddingsCreateParams {
|
|
|
810
903
|
dimensions?: number;
|
|
811
904
|
encoding_format?: "float" | "base64" | string;
|
|
812
905
|
user?: string;
|
|
813
|
-
provider?: ModelProvider;
|
|
814
906
|
[key: string]: unknown;
|
|
815
907
|
}
|
|
816
908
|
export interface EmbeddingsResponse {
|
|
@@ -838,7 +930,6 @@ export interface ImagesGenerateParams {
|
|
|
838
930
|
response_format?: "url" | "b64_json" | string;
|
|
839
931
|
style?: "vivid" | "natural" | string;
|
|
840
932
|
user?: string;
|
|
841
|
-
provider?: ModelProvider;
|
|
842
933
|
[key: string]: unknown;
|
|
843
934
|
}
|
|
844
935
|
export interface ImagesEditParams extends ImagesGenerateParams {
|
|
@@ -863,7 +954,6 @@ export interface AudioSpeechCreateParams {
|
|
|
863
954
|
response_format?: string;
|
|
864
955
|
speed?: number;
|
|
865
956
|
user?: string;
|
|
866
|
-
provider?: ModelProvider;
|
|
867
957
|
[key: string]: unknown;
|
|
868
958
|
}
|
|
869
959
|
export interface AudioTranscriptionCreateParams {
|
|
@@ -877,7 +967,6 @@ export interface AudioTranscriptionCreateParams {
|
|
|
877
967
|
prompt?: string;
|
|
878
968
|
temperature?: number;
|
|
879
969
|
timestamp_granularities?: Array<"word" | "segment" | string>;
|
|
880
|
-
provider?: ModelProvider;
|
|
881
970
|
[key: string]: unknown;
|
|
882
971
|
}
|
|
883
972
|
export interface AudioTranscriptionResponse {
|
|
@@ -906,7 +995,6 @@ export interface VideoGenerateParams {
|
|
|
906
995
|
image?: string;
|
|
907
996
|
image_url?: string;
|
|
908
997
|
user?: string;
|
|
909
|
-
provider?: ModelProvider;
|
|
910
998
|
[key: string]: unknown;
|
|
911
999
|
}
|
|
912
1000
|
export interface VideoGenerateResponse {
|
|
@@ -953,6 +1041,67 @@ export type VideoStatusStreamEvent = {
|
|
|
953
1041
|
* Events emitted by the Compose agent runtime on /agent/:wallet/stream.
|
|
954
1042
|
* Mirrors the runtime's native SSE vocabulary — no translation, no renaming.
|
|
955
1043
|
*/
|
|
1044
|
+
export type AgentDisplayKind = "tool" | "model" | "connector" | "agent" | "search" | "harness" | "conclave" | "route";
|
|
1045
|
+
export interface AgentEventDisplay {
|
|
1046
|
+
kind: AgentDisplayKind;
|
|
1047
|
+
id?: string;
|
|
1048
|
+
name?: string;
|
|
1049
|
+
target?: string;
|
|
1050
|
+
summary?: string;
|
|
1051
|
+
details?: Record<string, unknown>;
|
|
1052
|
+
}
|
|
1053
|
+
export interface AgentTraceRuntimeEvent {
|
|
1054
|
+
type: "trace";
|
|
1055
|
+
source: "capability" | "model" | "tool" | "agent" | "harness" | "route";
|
|
1056
|
+
stage?: string;
|
|
1057
|
+
action?: string;
|
|
1058
|
+
message?: string;
|
|
1059
|
+
display?: AgentEventDisplay;
|
|
1060
|
+
ts?: number;
|
|
1061
|
+
details?: Record<string, unknown>;
|
|
1062
|
+
}
|
|
1063
|
+
export interface AgentChildRuntimeEvent {
|
|
1064
|
+
type: "child";
|
|
1065
|
+
event: "start" | "delta" | "tool-start" | "tool-end" | "done" | "error";
|
|
1066
|
+
rootComposeRunId?: string;
|
|
1067
|
+
parentRunId?: string;
|
|
1068
|
+
subId?: string;
|
|
1069
|
+
depth?: number;
|
|
1070
|
+
agentWallet?: string;
|
|
1071
|
+
userAddress?: string;
|
|
1072
|
+
runKey?: string;
|
|
1073
|
+
runKeyChain?: string[];
|
|
1074
|
+
delta?: string;
|
|
1075
|
+
toolName?: string;
|
|
1076
|
+
input?: unknown;
|
|
1077
|
+
output?: unknown;
|
|
1078
|
+
failed?: boolean;
|
|
1079
|
+
error?: string;
|
|
1080
|
+
usage?: Record<string, unknown>;
|
|
1081
|
+
toolBatches?: number;
|
|
1082
|
+
stopReason?: string;
|
|
1083
|
+
wallMs?: number;
|
|
1084
|
+
display?: AgentEventDisplay;
|
|
1085
|
+
ts?: number;
|
|
1086
|
+
}
|
|
1087
|
+
export interface AgentConclaveRuntimeEvent {
|
|
1088
|
+
type: "conclave";
|
|
1089
|
+
action: "write" | "read" | "list" | "delete";
|
|
1090
|
+
key?: string;
|
|
1091
|
+
success: boolean;
|
|
1092
|
+
display?: AgentEventDisplay;
|
|
1093
|
+
details?: Record<string, unknown>;
|
|
1094
|
+
}
|
|
1095
|
+
export interface AgentRouteRuntimeEvent {
|
|
1096
|
+
type: "route";
|
|
1097
|
+
mode: string;
|
|
1098
|
+
confidence?: number;
|
|
1099
|
+
ambiguous?: boolean;
|
|
1100
|
+
candidates?: unknown[];
|
|
1101
|
+
hints?: Record<string, unknown>;
|
|
1102
|
+
reason?: string;
|
|
1103
|
+
display?: AgentEventDisplay;
|
|
1104
|
+
}
|
|
956
1105
|
export type AgentRuntimeEvent = {
|
|
957
1106
|
type: "text-delta";
|
|
958
1107
|
delta: string;
|
|
@@ -972,15 +1121,23 @@ export type AgentRuntimeEvent = {
|
|
|
972
1121
|
} | {
|
|
973
1122
|
type: "tool-start";
|
|
974
1123
|
toolName: string;
|
|
1124
|
+
displayName?: string;
|
|
975
1125
|
summary?: string;
|
|
976
1126
|
content?: string;
|
|
1127
|
+
targetKind?: AgentDisplayKind;
|
|
1128
|
+
target?: string;
|
|
1129
|
+
display?: AgentEventDisplay;
|
|
977
1130
|
} | {
|
|
978
1131
|
type: "tool-end";
|
|
979
1132
|
toolName: string;
|
|
1133
|
+
displayName?: string;
|
|
980
1134
|
summary?: string;
|
|
981
1135
|
failed: boolean;
|
|
982
1136
|
error?: string;
|
|
983
|
-
|
|
1137
|
+
targetKind?: AgentDisplayKind;
|
|
1138
|
+
target?: string;
|
|
1139
|
+
display?: AgentEventDisplay;
|
|
1140
|
+
} | AgentTraceRuntimeEvent | AgentChildRuntimeEvent | AgentConclaveRuntimeEvent | AgentRouteRuntimeEvent | {
|
|
984
1141
|
type: "stopped";
|
|
985
1142
|
reason: string;
|
|
986
1143
|
} | {
|
|
@@ -1005,12 +1162,16 @@ export interface AgentStreamFinalResult {
|
|
|
1005
1162
|
text: string;
|
|
1006
1163
|
toolCalls: Array<{
|
|
1007
1164
|
toolName: string;
|
|
1165
|
+
displayName?: string;
|
|
1008
1166
|
summary?: string;
|
|
1009
1167
|
failed: boolean;
|
|
1010
1168
|
error?: string;
|
|
1169
|
+
targetKind?: AgentDisplayKind;
|
|
1170
|
+
target?: string;
|
|
1171
|
+
display?: AgentEventDisplay;
|
|
1011
1172
|
}>;
|
|
1012
1173
|
requestId: string | null;
|
|
1013
|
-
receipt:
|
|
1174
|
+
receipt: Receipt | null;
|
|
1014
1175
|
budget: SessionBudgetSnapshot | null;
|
|
1015
1176
|
sessionInvalidReason: SessionInvalidReason | null;
|
|
1016
1177
|
}
|
|
@@ -1080,7 +1241,7 @@ export interface WorkflowStreamFinalResult {
|
|
|
1080
1241
|
error?: string;
|
|
1081
1242
|
}>;
|
|
1082
1243
|
requestId: string | null;
|
|
1083
|
-
receipt:
|
|
1244
|
+
receipt: Receipt | null;
|
|
1084
1245
|
budget: SessionBudgetSnapshot | null;
|
|
1085
1246
|
sessionInvalidReason: SessionInvalidReason | null;
|
|
1086
1247
|
}
|