@compose-market/sdk 0.6.98-receipts → 0.6.99
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 +2 -2
- package/.speakeasy/memory.arazzo.yaml +1 -1
- package/.speakeasy/tests.arazzo.yaml +1 -1
- package/CHANGELOG.md +5 -5
- package/README.md +1 -1
- package/dist/events.d.ts +4 -4
- package/dist/events.js +2 -2
- package/dist/http.d.ts +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +2 -2
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/resources/inference.d.ts +3 -3
- package/dist/resources/instrumentation.js +1 -1
- package/dist/resources/instrumentation.js.map +1 -1
- package/dist/resources/webhooks.d.ts +1 -1
- package/dist/resources/webhooks.js +1 -1
- package/dist/resources/x402.d.ts +4 -4
- package/dist/resources/x402.d.ts.map +1 -1
- package/dist/resources/x402.js +6 -2
- package/dist/resources/x402.js.map +1 -1
- package/dist/streaming/budget.d.ts +1 -1
- package/dist/streaming/budget.js +2 -2
- package/dist/streaming/budget.js.map +1 -1
- package/dist/streaming/receipt.d.ts +5 -5
- package/dist/streaming/receipt.d.ts.map +1 -1
- package/dist/streaming/receipt.js +62 -81
- package/dist/streaming/receipt.js.map +1 -1
- package/dist/types/index.d.ts +26 -31
- 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.js +2 -2
- package/generated/inference/esm/models/audio-transcription-response.js.map +1 -1
- package/generated/inference/esm/models/chat-completion.js +2 -2
- package/generated/inference/esm/models/chat-completion.js.map +1 -1
- package/generated/inference/esm/models/embeddings-response.js +2 -2
- package/generated/inference/esm/models/embeddings-response.js.map +1 -1
- package/generated/inference/esm/models/images-response.js +2 -2
- package/generated/inference/esm/models/images-response.js.map +1 -1
- package/generated/inference/esm/models/response-object.js +2 -2
- package/generated/inference/esm/models/response-object.js.map +1 -1
- package/generated/inference/esm/models/video-generate-response.js +2 -2
- 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 +2 -2
- package/generated/inference/src/models/chat-completion.ts +2 -2
- package/generated/inference/src/models/embeddings-response.ts +2 -2
- package/generated/inference/src/models/images-response.ts +2 -2
- package/generated/inference/src/models/response-object.ts +2 -2
- package/generated/inference/src/models/video-generate-response.ts +2 -2
- package/generated/manowar/esm/funcs/mesh-mesh-actions-execute.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-actions-execute.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-conclave-run.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-conclave-run.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-filecoin-pin.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-filecoin-pin.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-hai-register.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-hai-register.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-memory-execute.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-memory-execute.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-reputation-summary-get.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-reputation-summary-get.js.map +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-synapse-anchor.js +1 -1
- package/generated/manowar/esm/funcs/mesh-mesh-synapse-anchor.js.map +1 -1
- 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/esm/models/operations/mesh-actions-execute.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-actions-execute.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-actions-execute.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-actions-execute.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-conclave-run.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-conclave-run.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-conclave-run.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-conclave-run.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-filecoin-pin.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-filecoin-pin.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-filecoin-pin.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-filecoin-pin.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-hai-register.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-hai-register.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-hai-register.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-hai-register.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-memory-execute.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-memory-execute.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-memory-execute.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-memory-execute.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-reputation-summary-get.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-reputation-summary-get.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-reputation-summary-get.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-reputation-summary-get.js.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-synapse-anchor.d.ts +1 -1
- package/generated/manowar/esm/models/operations/mesh-synapse-anchor.d.ts.map +1 -1
- package/generated/manowar/esm/models/operations/mesh-synapse-anchor.js +1 -1
- package/generated/manowar/esm/models/operations/mesh-synapse-anchor.js.map +1 -1
- package/generated/manowar/package.json +1 -1
- package/generated/manowar/src/funcs/mesh-mesh-actions-execute.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-conclave-run.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-filecoin-pin.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-hai-register.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-memory-execute.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-reputation-summary-get.ts +3 -3
- package/generated/manowar/src/funcs/mesh-mesh-synapse-anchor.ts +3 -3
- package/generated/manowar/src/lib/config.ts +3 -3
- package/generated/manowar/src/models/operations/mesh-actions-execute.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-conclave-run.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-filecoin-pin.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-hai-register.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-memory-execute.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-reputation-summary-get.ts +2 -2
- package/generated/manowar/src/models/operations/mesh-synapse-anchor.ts +2 -2
- 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 +4 -4
- package/specs/inference.openapi.yaml +16 -16
- package/specs/manowar.openapi.yaml +5 -5
- package/specs/memory.openapi.yaml +1 -1
- package/specs/x402.openapi.yaml +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Receipt helpers.
|
|
3
3
|
*
|
|
4
|
-
* `X-
|
|
4
|
+
* `X-Receipt` is a url-safe base64 blob carrying an authoritative
|
|
5
5
|
* settlement breakdown. The same shape is also emitted in streams as an SSE
|
|
6
|
-
* `event: compose.receipt` frame and echoed as `
|
|
6
|
+
* `event: compose.receipt` frame and echoed as `receipt` in JSON
|
|
7
7
|
* response bodies.
|
|
8
8
|
*/
|
|
9
9
|
import type { Receipt } from "../types/index.js";
|
|
10
|
-
export declare const RECEIPT_HEADER_NAMES: readonly ["x-
|
|
10
|
+
export declare const RECEIPT_HEADER_NAMES: readonly ["x-receipt", "X-Receipt"];
|
|
11
11
|
export declare function decodeReceiptHeader(value: string): Receipt;
|
|
12
12
|
/**
|
|
13
13
|
* Extract a receipt from a Fetch `Response`. Preference order:
|
|
14
|
-
* 1. `X-
|
|
15
|
-
* 2. `
|
|
14
|
+
* 1. `X-Receipt` header (binary truth)
|
|
15
|
+
* 2. `receipt` field on the JSON body (fallback mirror)
|
|
16
16
|
*/
|
|
17
17
|
export declare function extractReceiptFromResponse(response: {
|
|
18
18
|
headers: Headers;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qCAAsC,CAAC;AAmBxE,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;AAoED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQvD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Receipt helpers.
|
|
3
3
|
*
|
|
4
|
-
* `X-
|
|
4
|
+
* `X-Receipt` is a url-safe base64 blob carrying an authoritative
|
|
5
5
|
* settlement breakdown. The same shape is also emitted in streams as an SSE
|
|
6
|
-
* `event: compose.receipt` frame and echoed as `
|
|
6
|
+
* `event: compose.receipt` frame and echoed as `receipt` in JSON
|
|
7
7
|
* response bodies.
|
|
8
8
|
*/
|
|
9
|
-
export const RECEIPT_HEADER_NAMES = ["x-
|
|
9
|
+
export const RECEIPT_HEADER_NAMES = ["x-receipt", "X-Receipt"];
|
|
10
10
|
function base64UrlDecode(value) {
|
|
11
11
|
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
12
12
|
const padding = normalized.length % 4 === 0 ? "" : "=".repeat(4 - (normalized.length % 4));
|
|
@@ -26,11 +26,11 @@ export function decodeReceiptHeader(value) {
|
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Extract a receipt from a Fetch `Response`. Preference order:
|
|
29
|
-
* 1. `X-
|
|
30
|
-
* 2. `
|
|
29
|
+
* 1. `X-Receipt` header (binary truth)
|
|
30
|
+
* 2. `receipt` field on the JSON body (fallback mirror)
|
|
31
31
|
*/
|
|
32
32
|
export function extractReceiptFromResponse(response, body) {
|
|
33
|
-
const headerValue = response.headers.get("x-
|
|
33
|
+
const headerValue = response.headers.get("x-receipt") ?? response.headers.get("X-Receipt");
|
|
34
34
|
if (typeof headerValue === "string" && headerValue.length > 0) {
|
|
35
35
|
try {
|
|
36
36
|
return decodeReceiptHeader(headerValue);
|
|
@@ -39,81 +39,73 @@ export function extractReceiptFromResponse(response, body) {
|
|
|
39
39
|
// fall through to body inspection
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
if (body && typeof body === "object" && body.
|
|
43
|
-
return normalizeBodyReceipt(body.
|
|
42
|
+
if (body && typeof body === "object" && body.receipt && typeof body.receipt === "object") {
|
|
43
|
+
return normalizeBodyReceipt(body.receipt);
|
|
44
44
|
}
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
function text(value) {
|
|
48
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
49
|
+
}
|
|
50
|
+
function numberMap(value) {
|
|
51
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
52
|
+
return {};
|
|
53
|
+
const out = {};
|
|
54
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
55
|
+
const num = Number(raw);
|
|
56
|
+
if (Number.isFinite(num))
|
|
57
|
+
out[key] = num;
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
function stringMap(value) {
|
|
62
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
63
|
+
return {};
|
|
64
|
+
const out = {};
|
|
65
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
66
|
+
if (typeof raw === "string")
|
|
67
|
+
out[key] = raw;
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
function fees(value) {
|
|
72
|
+
const raw = value && typeof value === "object" && !Array.isArray(value)
|
|
73
|
+
? value
|
|
74
|
+
: {};
|
|
75
|
+
const total = raw.total && typeof raw.total === "object" && !Array.isArray(raw.total)
|
|
76
|
+
? raw.total
|
|
77
|
+
: {};
|
|
78
|
+
return {
|
|
79
|
+
total: {
|
|
80
|
+
percent: String(total.percent ?? "0%"),
|
|
81
|
+
amount: String(total.amount ?? "0.000000 USDC"),
|
|
82
|
+
},
|
|
83
|
+
distribution: stringMap(raw.distribution),
|
|
84
|
+
};
|
|
57
85
|
}
|
|
58
86
|
function bills(value) {
|
|
59
87
|
return Array.isArray(value)
|
|
60
88
|
? value.map((bill) => ({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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,
|
|
89
|
+
agent: String(bill.agent ?? ""),
|
|
90
|
+
agentWallet: text(bill.agentWallet ?? bill.agent_wallet),
|
|
91
|
+
depth: Number(bill.depth ?? 0),
|
|
92
|
+
model: text(bill.model),
|
|
93
|
+
tokens: numberMap(bill.tokens),
|
|
94
|
+
tools: Array.isArray(bill.tools) ? bill.tools.map(String) : [],
|
|
95
|
+
total: String(bill.total ?? "0.000000 USDC"),
|
|
96
|
+
duration: String(bill.duration ?? "0s"),
|
|
97
|
+
txId: text(bill.txId ?? bill.tx_id),
|
|
98
|
+
fees: fees(bill.fees),
|
|
74
99
|
children: bills(bill.children),
|
|
75
|
-
lineItems: lineItems(bill.lineItems ?? bill.line_items) ?? [],
|
|
76
100
|
}))
|
|
77
101
|
: undefined;
|
|
78
102
|
}
|
|
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
|
-
}
|
|
94
103
|
function normalizeBodyReceipt(raw) {
|
|
95
104
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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,
|
|
103
|
-
subject: typeof raw.subject === "string" ? raw.subject : undefined,
|
|
104
|
-
lineItems: lineItems(raw.lineItems ?? raw.line_items),
|
|
105
|
+
user: text(raw.user ?? raw.userAddress ?? raw.user_address),
|
|
106
|
+
runId: text(raw.runId ?? raw.run_id),
|
|
107
|
+
duration: text(raw.duration),
|
|
105
108
|
bills: bills(raw.bills),
|
|
106
|
-
providerAmountWei: raw.providerAmountWei ?? raw.provider_amount_wei
|
|
107
|
-
? String(raw.providerAmountWei ?? raw.provider_amount_wei)
|
|
108
|
-
: undefined,
|
|
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,
|
|
114
|
-
network: raw.network ?? "eip155:0",
|
|
115
|
-
settledAt: Number(raw.settledAt ?? raw.settled_at ?? 0),
|
|
116
|
-
cumulative: cumulative(raw.cumulative),
|
|
117
109
|
};
|
|
118
110
|
}
|
|
119
111
|
/**
|
|
@@ -123,21 +115,10 @@ function normalizeBodyReceipt(raw) {
|
|
|
123
115
|
export function parseReceiptEvent(data) {
|
|
124
116
|
const raw = JSON.parse(data);
|
|
125
117
|
return {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
resource: typeof raw.resource === "string" ? raw.resource : undefined,
|
|
130
|
-
userAddress: typeof raw.userAddress === "string" ? raw.userAddress : undefined,
|
|
131
|
-
subject: typeof raw.meterSubject === "string" ? raw.meterSubject : (typeof raw.subject === "string" ? raw.subject : undefined),
|
|
132
|
-
lineItems: lineItems(raw.lineItems),
|
|
118
|
+
user: text(raw.user ?? raw.userAddress ?? raw.user_address),
|
|
119
|
+
runId: text(raw.runId ?? raw.run_id),
|
|
120
|
+
duration: text(raw.duration),
|
|
133
121
|
bills: bills(raw.bills),
|
|
134
|
-
providerAmountWei: raw.providerAmountWei ? String(raw.providerAmountWei) : undefined,
|
|
135
|
-
platformFeeWei: raw.platformFeeWei ? String(raw.platformFeeWei) : undefined,
|
|
136
|
-
finalAmountWei: String(raw.finalAmountWei ?? "0"),
|
|
137
|
-
txHash: raw.txHash ? String(raw.txHash) : undefined,
|
|
138
|
-
network: raw.network ?? "eip155:0",
|
|
139
|
-
settledAt: Number(raw.settledAt ?? 0),
|
|
140
|
-
cumulative: cumulative(raw.cumulative),
|
|
141
122
|
};
|
|
142
123
|
}
|
|
143
124
|
//# 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,
|
|
1
|
+
{"version":3,"file":"receipt.js","sourceRoot":"","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QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;KAC1B,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;IACxD,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,YAAY,CAAC;QAC3D,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC;QACpC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;KAC1B,CAAC;AACN,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -376,20 +376,25 @@ export interface ReceiptLineItem {
|
|
|
376
376
|
unitPriceUsd: number;
|
|
377
377
|
amountWei: string;
|
|
378
378
|
}
|
|
379
|
+
export interface ReceiptFees {
|
|
380
|
+
total: {
|
|
381
|
+
percent: string;
|
|
382
|
+
amount: string;
|
|
383
|
+
};
|
|
384
|
+
distribution: Record<string, string>;
|
|
385
|
+
}
|
|
379
386
|
export interface ReceiptBill {
|
|
380
|
-
|
|
381
|
-
source?: string;
|
|
382
|
-
name?: string;
|
|
383
|
-
action?: string;
|
|
384
|
-
subject?: string;
|
|
387
|
+
agent: string;
|
|
385
388
|
agentWallet?: string;
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
depth: number;
|
|
390
|
+
model?: string;
|
|
391
|
+
tokens: Record<string, number>;
|
|
392
|
+
tools: string[];
|
|
393
|
+
total: string;
|
|
394
|
+
duration: string;
|
|
395
|
+
txId?: string;
|
|
396
|
+
fees: ReceiptFees;
|
|
391
397
|
children?: ReceiptBill[];
|
|
392
|
-
lineItems: ReceiptLineItem[];
|
|
393
398
|
}
|
|
394
399
|
export interface ReceiptCumulative {
|
|
395
400
|
totalAmountWei: string;
|
|
@@ -398,21 +403,10 @@ export interface ReceiptCumulative {
|
|
|
398
403
|
receiptCount: number;
|
|
399
404
|
}
|
|
400
405
|
export interface Receipt {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
resource?: string;
|
|
405
|
-
userAddress?: string;
|
|
406
|
-
subject?: string;
|
|
407
|
-
lineItems?: ReceiptLineItem[];
|
|
406
|
+
user?: string;
|
|
407
|
+
runId?: string;
|
|
408
|
+
duration?: string;
|
|
408
409
|
bills?: ReceiptBill[];
|
|
409
|
-
providerAmountWei?: string;
|
|
410
|
-
platformFeeWei?: string;
|
|
411
|
-
finalAmountWei: string;
|
|
412
|
-
txHash?: string;
|
|
413
|
-
network: `eip155:${number}`;
|
|
414
|
-
settledAt: number;
|
|
415
|
-
cumulative?: ReceiptCumulative;
|
|
416
410
|
}
|
|
417
411
|
export interface ReceiptListResponse {
|
|
418
412
|
userAddress: string;
|
|
@@ -732,7 +726,7 @@ export interface ChatCompletion {
|
|
|
732
726
|
finish_reason: string;
|
|
733
727
|
}>;
|
|
734
728
|
usage: ChatUsage;
|
|
735
|
-
|
|
729
|
+
receipt?: Record<string, unknown>;
|
|
736
730
|
}
|
|
737
731
|
export interface ChatCompletionChunk {
|
|
738
732
|
id: string;
|
|
@@ -803,7 +797,7 @@ export interface ResponseObject {
|
|
|
803
797
|
};
|
|
804
798
|
previous_response_id?: string;
|
|
805
799
|
job_id?: string;
|
|
806
|
-
|
|
800
|
+
receipt?: Record<string, unknown>;
|
|
807
801
|
}
|
|
808
802
|
export interface ResponseOutputItem {
|
|
809
803
|
type: string;
|
|
@@ -917,7 +911,7 @@ export interface EmbeddingsResponse {
|
|
|
917
911
|
prompt_tokens: number;
|
|
918
912
|
total_tokens: number;
|
|
919
913
|
};
|
|
920
|
-
|
|
914
|
+
receipt?: Record<string, unknown>;
|
|
921
915
|
}
|
|
922
916
|
export interface ImagesGenerateParams {
|
|
923
917
|
model: string;
|
|
@@ -943,7 +937,7 @@ export interface ImagesResponse {
|
|
|
943
937
|
b64_json?: string;
|
|
944
938
|
revised_prompt?: string;
|
|
945
939
|
}>;
|
|
946
|
-
|
|
940
|
+
receipt?: Record<string, unknown>;
|
|
947
941
|
}
|
|
948
942
|
export interface AudioSpeechCreateParams {
|
|
949
943
|
model: string;
|
|
@@ -980,7 +974,7 @@ export interface AudioTranscriptionResponse {
|
|
|
980
974
|
end: number;
|
|
981
975
|
}>;
|
|
982
976
|
segments?: Array<Record<string, unknown>>;
|
|
983
|
-
|
|
977
|
+
receipt?: Record<string, unknown>;
|
|
984
978
|
}
|
|
985
979
|
export interface VideoGenerateParams {
|
|
986
980
|
model: string;
|
|
@@ -1011,7 +1005,7 @@ export interface VideoGenerateResponse {
|
|
|
1011
1005
|
duration?: number;
|
|
1012
1006
|
[key: string]: unknown;
|
|
1013
1007
|
}>;
|
|
1014
|
-
|
|
1008
|
+
receipt?: Record<string, unknown>;
|
|
1015
1009
|
[key: string]: unknown;
|
|
1016
1010
|
}
|
|
1017
1011
|
export interface VideoJobStatus {
|
|
@@ -1598,6 +1592,7 @@ export interface DirectoryAgent {
|
|
|
1598
1592
|
model: string;
|
|
1599
1593
|
framework?: "manowar" | string;
|
|
1600
1594
|
licensePrice: string;
|
|
1595
|
+
creatorFee?: number;
|
|
1601
1596
|
licenses: number;
|
|
1602
1597
|
licensesAvailable?: number;
|
|
1603
1598
|
cloneable: boolean;
|