@t2000/cli 5.15.0 → 5.16.0
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.
|
@@ -79385,7 +79385,9 @@ function body(params, stream4) {
|
|
|
79385
79385
|
return JSON.stringify({
|
|
79386
79386
|
model: params.model,
|
|
79387
79387
|
messages: params.messages,
|
|
79388
|
-
|
|
79388
|
+
// include_usage → the final stream chunk carries usage + x_receipt_id
|
|
79389
|
+
// (the confidential attestation receipt) so we can surface it after a stream.
|
|
79390
|
+
...stream4 ? { stream: true, stream_options: { include_usage: true } } : {},
|
|
79389
79391
|
...params.maxTokens != null ? { max_tokens: params.maxTokens } : {},
|
|
79390
79392
|
...params.temperature != null ? { temperature: params.temperature } : {}
|
|
79391
79393
|
});
|
|
@@ -79401,12 +79403,14 @@ async function chatCompletion(params) {
|
|
|
79401
79403
|
if (!res.ok) {
|
|
79402
79404
|
await failBody(res);
|
|
79403
79405
|
}
|
|
79406
|
+
const receiptId = res.headers.get("x-receipt-id") ?? void 0;
|
|
79404
79407
|
const raw = await res.json();
|
|
79405
79408
|
const content = raw?.choices?.[0]?.message?.content ?? "";
|
|
79406
79409
|
return {
|
|
79407
79410
|
content,
|
|
79408
79411
|
model: raw?.model ?? params.model,
|
|
79409
79412
|
usage: usageOf(raw),
|
|
79413
|
+
receiptId,
|
|
79410
79414
|
raw
|
|
79411
79415
|
};
|
|
79412
79416
|
}
|
|
@@ -79420,11 +79424,12 @@ async function* chatCompletionStream(params) {
|
|
|
79420
79424
|
});
|
|
79421
79425
|
if (!(res.ok && res.body)) {
|
|
79422
79426
|
await failBody(res);
|
|
79423
|
-
return;
|
|
79427
|
+
return {};
|
|
79424
79428
|
}
|
|
79425
79429
|
const reader = res.body.getReader();
|
|
79426
79430
|
const decoder = new TextDecoder();
|
|
79427
79431
|
let buffer = "";
|
|
79432
|
+
let receiptId;
|
|
79428
79433
|
while (true) {
|
|
79429
79434
|
const { done, value } = await reader.read();
|
|
79430
79435
|
if (done) {
|
|
@@ -79440,10 +79445,13 @@ async function* chatCompletionStream(params) {
|
|
|
79440
79445
|
}
|
|
79441
79446
|
const data = trimmed.slice(5).trim();
|
|
79442
79447
|
if (data === "[DONE]") {
|
|
79443
|
-
return;
|
|
79448
|
+
return { receiptId };
|
|
79444
79449
|
}
|
|
79445
79450
|
try {
|
|
79446
79451
|
const json = JSON.parse(data);
|
|
79452
|
+
if (json.x_receipt_id) {
|
|
79453
|
+
receiptId = json.x_receipt_id;
|
|
79454
|
+
}
|
|
79447
79455
|
const delta = json.choices?.[0]?.delta?.content;
|
|
79448
79456
|
if (typeof delta === "string" && delta) {
|
|
79449
79457
|
yield delta;
|
|
@@ -79452,6 +79460,7 @@ async function* chatCompletionStream(params) {
|
|
|
79452
79460
|
}
|
|
79453
79461
|
}
|
|
79454
79462
|
}
|
|
79463
|
+
return { receiptId };
|
|
79455
79464
|
}
|
|
79456
79465
|
async function listModels(opts) {
|
|
79457
79466
|
const base = opts?.apiBase ?? DEFAULT_API_BASE;
|
|
@@ -79744,7 +79753,8 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
79744
79753
|
async chat(params) {
|
|
79745
79754
|
return chatCompletion(params);
|
|
79746
79755
|
}
|
|
79747
|
-
/** Streaming chat completion — async-iterate the assistant text deltas
|
|
79756
|
+
/** Streaming chat completion — async-iterate the assistant text deltas;
|
|
79757
|
+
* the generator returns `{ receiptId }` (confidential attestation) at the end. */
|
|
79748
79758
|
chatStream(params) {
|
|
79749
79759
|
return chatCompletionStream(params);
|
|
79750
79760
|
}
|
|
@@ -80453,7 +80463,10 @@ function registerChatTools(server) {
|
|
|
80453
80463
|
text: JSON.stringify({
|
|
80454
80464
|
model: res.model,
|
|
80455
80465
|
content: res.content,
|
|
80456
|
-
usage: res.usage
|
|
80466
|
+
usage: res.usage,
|
|
80467
|
+
// Confidential (phala/*) → a TEE attestation receipt id,
|
|
80468
|
+
// verifiable at /v1/aci/receipts/{id}.
|
|
80469
|
+
receiptId: res.receiptId
|
|
80457
80470
|
})
|
|
80458
80471
|
}
|
|
80459
80472
|
]
|
|
@@ -80543,7 +80556,7 @@ Through this wallet you can reach essentially any major external API, billed to
|
|
|
80543
80556
|
CRITICAL: When the user asks to use any external or paid API, names a provider (e.g. "via fal.ai", "with ElevenLabs"), or requests a capability one of the services above provides, DO NOT say you cannot reach that service, that it isn't on an allowlist, or that there's no connector \u2014 and do NOT fall back to writing a script for the user to run. You CAN do it directly through this wallet. Use t2000_services to discover the endpoint and request shape, then t2000_pay to execute, then show the user the result (display image/audio URLs returned in the response).
|
|
80544
80557
|
|
|
80545
80558
|
Spending is the user's own USDC and every t2000_pay call is bounded by maxPrice. For larger or multi-step spends, state the estimated cost first and proceed once the user is happy. Use t2000_balance to check funds. The v4 wallet is payments-only; savings / lending live on audric.ai.`;
|
|
80546
|
-
var PKG_VERSION = "5.
|
|
80559
|
+
var PKG_VERSION = "5.16.0";
|
|
80547
80560
|
console.log = (...args) => console.error("[log]", ...args);
|
|
80548
80561
|
console.warn = (...args) => console.error("[warn]", ...args);
|
|
80549
80562
|
async function startMcpServer(opts) {
|
|
@@ -80610,4 +80623,4 @@ mime-types/index.js:
|
|
|
80610
80623
|
@scure/bip39/index.js:
|
|
80611
80624
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
80612
80625
|
*/
|
|
80613
|
-
//# sourceMappingURL=dist-
|
|
80626
|
+
//# sourceMappingURL=dist-UPUBYGXT.js.map
|