@t2000/cli 5.14.3 → 5.15.1

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.
@@ -5132,10 +5132,10 @@ var require_codegen = __commonJS({
5132
5132
  return this._leafNode(new Throw(error2));
5133
5133
  }
5134
5134
  // start self-balancing block
5135
- block(body, nodeCount) {
5135
+ block(body2, nodeCount) {
5136
5136
  this._blockStarts.push(this._nodes.length);
5137
- if (body)
5138
- this.code(body).endBlock(nodeCount);
5137
+ if (body2)
5138
+ this.code(body2).endBlock(nodeCount);
5139
5139
  return this;
5140
5140
  }
5141
5141
  // end the current self-balancing block
@@ -6515,15 +6515,15 @@ var require_validate = __commonJS({
6515
6515
  validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
6516
6516
  }
6517
6517
  exports$1.validateFunctionCode = validateFunctionCode;
6518
- function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
6518
+ function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body2) {
6519
6519
  if (opts.code.es5) {
6520
6520
  gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
6521
6521
  gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`);
6522
6522
  destructureValCxtES5(gen, opts);
6523
- gen.code(body);
6523
+ gen.code(body2);
6524
6524
  });
6525
6525
  } else {
6526
- gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
6526
+ gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body2));
6527
6527
  }
6528
6528
  }
6529
6529
  function destructureValCxt(opts) {
@@ -17012,7 +17012,7 @@ var init_mvr = __esm({
17012
17012
  }));
17013
17013
  return results;
17014
17014
  }
17015
- async #fetch(url2, body) {
17015
+ async #fetch(url2, body2) {
17016
17016
  if (!this.#url) throw new Error("MVR Api URL is not set for the current client");
17017
17017
  const response = await fetch(`${this.#url}${url2}`, {
17018
17018
  method: "POST",
@@ -17020,7 +17020,7 @@ var init_mvr = __esm({
17020
17020
  "Content-Type": "application/json",
17021
17021
  ...MVR_API_HEADER
17022
17022
  },
17023
- body: JSON.stringify(body)
17023
+ body: JSON.stringify(body2)
17024
17024
  });
17025
17025
  if (!response.ok) {
17026
17026
  const errorBody = await response.json().catch(() => ({}));
@@ -31880,14 +31880,14 @@ function createGrpcWebRequestHeader(headers, format, timeout, meta, userAgent) {
31880
31880
  return headers;
31881
31881
  }
31882
31882
  function createGrpcWebRequestBody(message, format) {
31883
- let body = new Uint8Array(5 + message.length);
31884
- body[0] = GrpcWebFrame.DATA;
31883
+ let body2 = new Uint8Array(5 + message.length);
31884
+ body2[0] = GrpcWebFrame.DATA;
31885
31885
  for (let msgLen = message.length, i = 4; i > 0; i--) {
31886
- body[i] = msgLen % 256;
31886
+ body2[i] = msgLen % 256;
31887
31887
  msgLen >>>= 8;
31888
31888
  }
31889
- body.set(message, 5);
31890
- return format === "binary" ? body : base64encode(body);
31889
+ body2.set(message, 5);
31890
+ return format === "binary" ? body2 : base64encode(body2);
31891
31891
  }
31892
31892
  function readGrpcWebResponseHeader(headersOrFetchResponse, httpStatus, httpStatusText) {
31893
31893
  if (arguments.length === 1) {
@@ -32975,7 +32975,7 @@ var init_dist6 = __esm({
32975
32975
  super(), __privateAdd(this, _EventSource_instances), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, __privateAdd(this, _readyState), __privateAdd(this, _url2), __privateAdd(this, _redirectUrl), __privateAdd(this, _withCredentials), __privateAdd(this, _fetch), __privateAdd(this, _reconnectInterval), __privateAdd(this, _reconnectTimer), __privateAdd(this, _lastEventId, null), __privateAdd(this, _controller), __privateAdd(this, _parser), __privateAdd(this, _onError, null), __privateAdd(this, _onMessage, null), __privateAdd(this, _onOpen, null), __privateAdd(this, _onFetchResponse, async (response) => {
32976
32976
  var _a2;
32977
32977
  __privateGet(this, _parser).reset();
32978
- const { body, redirected, status, headers } = response;
32978
+ const { body: body2, redirected, status, headers } = response;
32979
32979
  if (status === 204) {
32980
32980
  __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
32981
32981
  return;
@@ -32992,11 +32992,11 @@ var init_dist6 = __esm({
32992
32992
  return;
32993
32993
  __privateSet(this, _readyState, this.OPEN);
32994
32994
  const openEvent = new Event("open");
32995
- if ((_a2 = __privateGet(this, _onOpen)) == null || _a2.call(this, openEvent), this.dispatchEvent(openEvent), typeof body != "object" || !body || !("getReader" in body)) {
32995
+ if ((_a2 = __privateGet(this, _onOpen)) == null || _a2.call(this, openEvent), this.dispatchEvent(openEvent), typeof body2 != "object" || !body2 || !("getReader" in body2)) {
32996
32996
  __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, "Invalid response body, expected a web ReadableStream", status), this.close();
32997
32997
  return;
32998
32998
  }
32999
- const decoder = new TextDecoder(), reader = body.getReader();
32999
+ const decoder = new TextDecoder(), reader = body2.getReader();
33000
33000
  let open = true;
33001
33001
  do {
33002
33002
  const { done, value } = await reader.read();
@@ -46249,8 +46249,8 @@ function fromDataURI(uri, asBlob, options) {
46249
46249
  }
46250
46250
  const mime = match[1];
46251
46251
  const isBase64 = match[2];
46252
- const body = match[3];
46253
- const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
46252
+ const body2 = match[3];
46253
+ const buffer = Buffer.from(decodeURIComponent(body2), isBase64 ? "base64" : "utf8");
46254
46254
  if (asBlob) {
46255
46255
  if (!_Blob) {
46256
46256
  throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
@@ -46807,15 +46807,15 @@ function estimateDataURLDecodedBytes(url2) {
46807
46807
  const comma = url2.indexOf(",");
46808
46808
  if (comma < 0) return 0;
46809
46809
  const meta = url2.slice(5, comma);
46810
- const body = url2.slice(comma + 1);
46810
+ const body2 = url2.slice(comma + 1);
46811
46811
  const isBase64 = /;base64/i.test(meta);
46812
46812
  if (isBase64) {
46813
- let effectiveLen = body.length;
46814
- const len = body.length;
46813
+ let effectiveLen = body2.length;
46814
+ const len = body2.length;
46815
46815
  for (let i = 0; i < len; i++) {
46816
- if (body.charCodeAt(i) === 37 && i + 2 < len) {
46817
- const a = body.charCodeAt(i + 1);
46818
- const b = body.charCodeAt(i + 2);
46816
+ if (body2.charCodeAt(i) === 37 && i + 2 < len) {
46817
+ const a = body2.charCodeAt(i + 1);
46818
+ const b = body2.charCodeAt(i + 2);
46819
46819
  const isHex3 = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
46820
46820
  if (isHex3) {
46821
46821
  effectiveLen -= 2;
@@ -46825,11 +46825,11 @@ function estimateDataURLDecodedBytes(url2) {
46825
46825
  }
46826
46826
  let pad = 0;
46827
46827
  let idx = len - 1;
46828
- const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
46829
- body.charCodeAt(j - 1) === 51 && // '3'
46830
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
46828
+ const tailIsPct3D = (j) => j >= 2 && body2.charCodeAt(j - 2) === 37 && // '%'
46829
+ body2.charCodeAt(j - 1) === 51 && // '3'
46830
+ (body2.charCodeAt(j) === 68 || body2.charCodeAt(j) === 100);
46831
46831
  if (idx >= 0) {
46832
- if (body.charCodeAt(idx) === 61) {
46832
+ if (body2.charCodeAt(idx) === 61) {
46833
46833
  pad++;
46834
46834
  idx--;
46835
46835
  } else if (tailIsPct3D(idx)) {
@@ -46838,7 +46838,7 @@ function estimateDataURLDecodedBytes(url2) {
46838
46838
  }
46839
46839
  }
46840
46840
  if (pad === 1 && idx >= 0) {
46841
- if (body.charCodeAt(idx) === 61) {
46841
+ if (body2.charCodeAt(idx) === 61) {
46842
46842
  pad++;
46843
46843
  } else if (tailIsPct3D(idx)) {
46844
46844
  pad++;
@@ -46848,7 +46848,7 @@ function estimateDataURLDecodedBytes(url2) {
46848
46848
  const bytes = groups * 3 - (pad || 0);
46849
46849
  return bytes > 0 ? bytes : 0;
46850
46850
  }
46851
- return Buffer.byteLength(body, "utf8");
46851
+ return Buffer.byteLength(body2, "utf8");
46852
46852
  }
46853
46853
  var init_estimateDataURLDecodedBytes = __esm({
46854
46854
  "../../node_modules/.pnpm/axios@1.15.2/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js"() {
@@ -48270,33 +48270,33 @@ var init_fetch = __esm({
48270
48270
  });
48271
48271
  });
48272
48272
  })();
48273
- const getBodyLength = async (body) => {
48274
- if (body == null) {
48273
+ const getBodyLength = async (body2) => {
48274
+ if (body2 == null) {
48275
48275
  return 0;
48276
48276
  }
48277
- if (utils_default.isBlob(body)) {
48278
- return body.size;
48277
+ if (utils_default.isBlob(body2)) {
48278
+ return body2.size;
48279
48279
  }
48280
- if (utils_default.isSpecCompliantForm(body)) {
48280
+ if (utils_default.isSpecCompliantForm(body2)) {
48281
48281
  const _request = new Request(platform_default.origin, {
48282
48282
  method: "POST",
48283
- body
48283
+ body: body2
48284
48284
  });
48285
48285
  return (await _request.arrayBuffer()).byteLength;
48286
48286
  }
48287
- if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
48288
- return body.byteLength;
48287
+ if (utils_default.isArrayBufferView(body2) || utils_default.isArrayBuffer(body2)) {
48288
+ return body2.byteLength;
48289
48289
  }
48290
- if (utils_default.isURLSearchParams(body)) {
48291
- body = body + "";
48290
+ if (utils_default.isURLSearchParams(body2)) {
48291
+ body2 = body2 + "";
48292
48292
  }
48293
- if (utils_default.isString(body)) {
48294
- return (await encodeText(body)).byteLength;
48293
+ if (utils_default.isString(body2)) {
48294
+ return (await encodeText(body2)).byteLength;
48295
48295
  }
48296
48296
  };
48297
- const resolveBodyLength = async (headers, body) => {
48297
+ const resolveBodyLength = async (headers, body2) => {
48298
48298
  const length = utils_default.toFiniteNumber(headers.getContentLength());
48299
- return length == null ? getBodyLength(body) : length;
48299
+ return length == null ? getBodyLength(body2) : length;
48300
48300
  };
48301
48301
  return async (config3) => {
48302
48302
  let {
@@ -78741,9 +78741,9 @@ async function payWithMpp(args) {
78741
78741
  }
78742
78742
  async function pickSuiExactRequirements(response, network) {
78743
78743
  try {
78744
- const body = await response.clone().json();
78744
+ const body2 = await response.clone().json();
78745
78745
  const want = `sui:${network === "testnet" ? "testnet" : "mainnet"}`;
78746
- return body.accepts?.find((a) => a.scheme === "exact" && a.network === want);
78746
+ return body2.accepts?.find((a) => a.scheme === "exact" && a.network === want);
78747
78747
  } catch {
78748
78748
  return void 0;
78749
78749
  }
@@ -78822,13 +78822,13 @@ async function ensureAddressBalanceCovers(args) {
78822
78822
  }
78823
78823
  async function finalize(response, opts) {
78824
78824
  const contentType = response.headers.get("content-type") ?? "";
78825
- let body;
78825
+ let body2;
78826
78826
  try {
78827
- body = contentType.includes("application/json") ? await response.json() : await response.text();
78827
+ body2 = contentType.includes("application/json") ? await response.json() : await response.text();
78828
78828
  } catch {
78829
- body = null;
78829
+ body2 = null;
78830
78830
  }
78831
- return { status: response.status, body, paid: opts.paid };
78831
+ return { status: response.status, body: body2, paid: opts.paid };
78832
78832
  }
78833
78833
  async function makeGrpcBuildClient(client) {
78834
78834
  const { SuiGrpcClient: SuiGrpcClient2 } = await Promise.resolve().then(() => (init_grpc(), grpc_exports));
@@ -79340,6 +79340,138 @@ async function resolveSuinsViaRpc(rawName, ctx = {}) {
79340
79340
  return res.data?.address?.address ?? null;
79341
79341
  }
79342
79342
  init_errors3();
79343
+ init_errors3();
79344
+ var DEFAULT_API_BASE = "https://api.t2000.ai/v1";
79345
+ function envApiKey() {
79346
+ return typeof process !== "undefined" ? process.env?.T2000_API_KEY : void 0;
79347
+ }
79348
+ function resolveApiKey(apiKey) {
79349
+ const key = apiKey ?? envApiKey();
79350
+ if (!key) {
79351
+ throw new T2000Error(
79352
+ "INVALID_KEY",
79353
+ "No Private API key. Pass `apiKey` or set T2000_API_KEY. Generate one at platform.t2000.ai (Pro/Max)."
79354
+ );
79355
+ }
79356
+ return key;
79357
+ }
79358
+ async function failBody(res) {
79359
+ const text = await res.text().catch(() => "");
79360
+ let msg = text.slice(0, 300);
79361
+ try {
79362
+ const j = JSON.parse(text);
79363
+ msg = (typeof j.error === "object" ? j.error?.message : j.error) ?? msg;
79364
+ } catch {
79365
+ }
79366
+ throw new T2000Error(
79367
+ "INFERENCE_FAILED",
79368
+ `Inference request failed (${res.status}): ${msg}`,
79369
+ { status: res.status },
79370
+ res.status >= 500
79371
+ );
79372
+ }
79373
+ function usageOf(raw) {
79374
+ const u2 = raw?.usage;
79375
+ if (!u2) {
79376
+ return;
79377
+ }
79378
+ return {
79379
+ promptTokens: u2.prompt_tokens,
79380
+ completionTokens: u2.completion_tokens,
79381
+ totalTokens: u2.total_tokens
79382
+ };
79383
+ }
79384
+ function body(params, stream4) {
79385
+ return JSON.stringify({
79386
+ model: params.model,
79387
+ messages: params.messages,
79388
+ ...stream4 ? { stream: true } : {},
79389
+ ...params.maxTokens != null ? { max_tokens: params.maxTokens } : {},
79390
+ ...params.temperature != null ? { temperature: params.temperature } : {}
79391
+ });
79392
+ }
79393
+ async function chatCompletion(params) {
79394
+ const key = resolveApiKey(params.apiKey);
79395
+ const base = params.apiBase ?? DEFAULT_API_BASE;
79396
+ const res = await fetch(`${base}/chat/completions`, {
79397
+ method: "POST",
79398
+ headers: { "content-type": "application/json", authorization: `Bearer ${key}` },
79399
+ body: body(params, false)
79400
+ });
79401
+ if (!res.ok) {
79402
+ await failBody(res);
79403
+ }
79404
+ const raw = await res.json();
79405
+ const content = raw?.choices?.[0]?.message?.content ?? "";
79406
+ return {
79407
+ content,
79408
+ model: raw?.model ?? params.model,
79409
+ usage: usageOf(raw),
79410
+ raw
79411
+ };
79412
+ }
79413
+ async function* chatCompletionStream(params) {
79414
+ const key = resolveApiKey(params.apiKey);
79415
+ const base = params.apiBase ?? DEFAULT_API_BASE;
79416
+ const res = await fetch(`${base}/chat/completions`, {
79417
+ method: "POST",
79418
+ headers: { "content-type": "application/json", authorization: `Bearer ${key}` },
79419
+ body: body(params, true)
79420
+ });
79421
+ if (!(res.ok && res.body)) {
79422
+ await failBody(res);
79423
+ return;
79424
+ }
79425
+ const reader = res.body.getReader();
79426
+ const decoder = new TextDecoder();
79427
+ let buffer = "";
79428
+ while (true) {
79429
+ const { done, value } = await reader.read();
79430
+ if (done) {
79431
+ break;
79432
+ }
79433
+ buffer += decoder.decode(value, { stream: true });
79434
+ const lines = buffer.split("\n");
79435
+ buffer = lines.pop() ?? "";
79436
+ for (const line of lines) {
79437
+ const trimmed = line.trim();
79438
+ if (!trimmed.startsWith("data:")) {
79439
+ continue;
79440
+ }
79441
+ const data = trimmed.slice(5).trim();
79442
+ if (data === "[DONE]") {
79443
+ return;
79444
+ }
79445
+ try {
79446
+ const json = JSON.parse(data);
79447
+ const delta = json.choices?.[0]?.delta?.content;
79448
+ if (typeof delta === "string" && delta) {
79449
+ yield delta;
79450
+ }
79451
+ } catch {
79452
+ }
79453
+ }
79454
+ }
79455
+ }
79456
+ async function listModels(opts) {
79457
+ const base = opts?.apiBase ?? DEFAULT_API_BASE;
79458
+ const key = opts?.apiKey ?? envApiKey();
79459
+ const res = await fetch(`${base}/models`, {
79460
+ headers: key ? { authorization: `Bearer ${key}` } : {}
79461
+ });
79462
+ if (!res.ok) {
79463
+ await failBody(res);
79464
+ }
79465
+ const json = await res.json();
79466
+ const data = Array.isArray(json.data) ? json.data : [];
79467
+ return data.map((m) => ({
79468
+ id: m.id,
79469
+ contextWindow: m.context_window ?? m.context_length,
79470
+ inputPer1M: m.pricing?.input_per_1m ?? m.pricing?.prompt,
79471
+ outputPer1M: m.pricing?.output_per_1m ?? m.pricing?.completion,
79472
+ privacy: m.privacy ?? m.privacy_tier
79473
+ }));
79474
+ }
79343
79475
  var DEFAULT_CONFIG_DIR = join$1(homedir(), ".t2000");
79344
79476
  function resolveConfigPath(configDir) {
79345
79477
  return join$1(configDir ?? DEFAULT_CONFIG_DIR, "config.json");
@@ -79602,6 +79734,24 @@ var T2000 = class _T2000 extends import_index2.default {
79602
79734
  // but there is no longer any way to MINT or REDEEM vSUI through t2000.
79603
79735
  // History: see spec/archive/v07e/AUDIT_V07E_EARNS_ITS_KEEP_2026-05-23.md
79604
79736
  // and the S.323 build-tracker entry.
79737
+ // -- Private Inference API (SPEC_AUDRIC_API, S.575) --
79738
+ //
79739
+ // Inference as a wallet verb — the agent's brain + wallet in one package.
79740
+ // Key-based today (`apiKey` / `T2000_API_KEY`); the x402 no-key pay-per-call
79741
+ // path is a later add. The model runs on the t2000 Private API (ZDR; a
79742
+ // `phala/*` confidential tier runs in a GPU-TEE).
79743
+ /** Non-streaming chat completion against the Private API. */
79744
+ async chat(params) {
79745
+ return chatCompletion(params);
79746
+ }
79747
+ /** Streaming chat completion — async-iterate the assistant text deltas. */
79748
+ chatStream(params) {
79749
+ return chatCompletionStream(params);
79750
+ }
79751
+ /** The Private API model catalog (`GET /v1/models`). */
79752
+ async models(opts) {
79753
+ return listModels(opts);
79754
+ }
79605
79755
  // -- Swap --
79606
79756
  async swap(params) {
79607
79757
  this.limits.assert({
@@ -80207,10 +80357,10 @@ Common examples:
80207
80357
  headers: external_exports.record(external_exports.string()).optional().describe("Additional HTTP headers"),
80208
80358
  maxPrice: external_exports.number().default(1).describe("Max USD to pay (default: $1.00). Set higher for commerce services.")
80209
80359
  },
80210
- async ({ url: url2, method, body, headers, maxPrice }) => {
80360
+ async ({ url: url2, method, body: body2, headers, maxPrice }) => {
80211
80361
  try {
80212
80362
  const result = await mutex.run(
80213
- () => agent.pay({ url: url2, method, body, headers, maxPrice })
80363
+ () => agent.pay({ url: url2, method, body: body2, headers, maxPrice })
80214
80364
  );
80215
80365
  let text = JSON.stringify(result);
80216
80366
  try {
@@ -80266,6 +80416,67 @@ Use the returned values to inform the user about their own configured caps befor
80266
80416
  }
80267
80417
  );
80268
80418
  }
80419
+ init_zod();
80420
+ var DEFAULT_MODEL = "zai/glm-5.2";
80421
+ function registerChatTools(server) {
80422
+ server.tool(
80423
+ "t2000_chat",
80424
+ "Run private inference on the t2000 Private API (OpenAI-compatible; ZDR by default, a `phala/*` tier is GPU-TEE confidential), billed to the user's t2000 credit. Requires T2000_API_KEY in the server env (generate at platform.t2000.ai \u2014 Pro/Max). Pass a single `prompt`, or a full `messages` list. Discover model ids with t2000_models; defaults to GLM 5.2.",
80425
+ {
80426
+ prompt: external_exports.string().optional().describe("User prompt (shorthand for a single user message)"),
80427
+ messages: external_exports.array(
80428
+ external_exports.object({
80429
+ role: external_exports.enum(["system", "user", "assistant"]),
80430
+ content: external_exports.string()
80431
+ })
80432
+ ).optional().describe("Full message list (overrides `prompt` when present)"),
80433
+ model: external_exports.string().optional().describe(`Model id (default ${DEFAULT_MODEL}; see t2000_models)`),
80434
+ maxTokens: external_exports.number().optional().describe("Max output tokens"),
80435
+ temperature: external_exports.number().optional().describe("Sampling temperature (0\u20132)")
80436
+ },
80437
+ async ({ prompt, messages, model, maxTokens, temperature }) => {
80438
+ try {
80439
+ const msgs = messages ?? (prompt ? [{ role: "user", content: prompt }] : []);
80440
+ if (msgs.length === 0) {
80441
+ throw new Error("Provide `prompt` or `messages`.");
80442
+ }
80443
+ const res = await chatCompletion({
80444
+ model: model ?? DEFAULT_MODEL,
80445
+ messages: msgs,
80446
+ maxTokens,
80447
+ temperature
80448
+ });
80449
+ return {
80450
+ content: [
80451
+ {
80452
+ type: "text",
80453
+ text: JSON.stringify({
80454
+ model: res.model,
80455
+ content: res.content,
80456
+ usage: res.usage
80457
+ })
80458
+ }
80459
+ ]
80460
+ };
80461
+ } catch (err) {
80462
+ return errorResult(err);
80463
+ }
80464
+ }
80465
+ );
80466
+ server.tool(
80467
+ "t2000_models",
80468
+ "List the t2000 Private API model catalog (id \xB7 privacy tier \xB7 per-1M pricing). Call before t2000_chat to pick a model.",
80469
+ {},
80470
+ async () => {
80471
+ try {
80472
+ const models = await listModels();
80473
+ return { content: [{ type: "text", text: JSON.stringify({ models }) }] };
80474
+ } catch (err) {
80475
+ return errorResult(err);
80476
+ }
80477
+ }
80478
+ );
80479
+ }
80269
80480
  var cachedSkills = null;
80270
80481
  function getBakedSkills() {
80271
80482
  if (cachedSkills) return cachedSkills;
@@ -80293,10 +80504,10 @@ async function fetchLiveSkillBody(name) {
80293
80504
  const res = await fetch(`${SKILLS_BASE_URL}/${name}`, { signal: controller.signal });
80294
80505
  clearTimeout(timer);
80295
80506
  if (!res.ok) return null;
80296
- const body = stripFrontmatter(await res.text()).trim();
80297
- if (!body) return null;
80298
- liveBodyCache.set(name, body);
80299
- return body;
80507
+ const body2 = stripFrontmatter(await res.text()).trim();
80508
+ if (!body2) return null;
80509
+ liveBodyCache.set(name, body2);
80510
+ return body2;
80300
80511
  } catch {
80301
80512
  return null;
80302
80513
  }
@@ -80332,7 +80543,7 @@ Through this wallet you can reach essentially any major external API, billed to
80332
80543
  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).
80333
80544
 
80334
80545
  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.`;
80335
- var PKG_VERSION = "5.14.3";
80546
+ var PKG_VERSION = "5.15.1";
80336
80547
  console.log = (...args) => console.error("[log]", ...args);
80337
80548
  console.warn = (...args) => console.error("[warn]", ...args);
80338
80549
  async function startMcpServer(opts) {
@@ -80344,6 +80555,7 @@ async function startMcpServer(opts) {
80344
80555
  registerReadTools(server, agent);
80345
80556
  registerWriteTools(server, agent);
80346
80557
  registerLimitTool(server);
80558
+ registerChatTools(server);
80347
80559
  registerSkillPrompts(server);
80348
80560
  const transport = new StdioServerTransport();
80349
80561
  await server.connect(transport);
@@ -80398,4 +80610,4 @@ mime-types/index.js:
80398
80610
  @scure/bip39/index.js:
80399
80611
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
80400
80612
  */
80401
- //# sourceMappingURL=dist-PMYELDIE.js.map
80613
+ //# sourceMappingURL=dist-JDPHHZMS.js.map