@t2000/cli 8.1.0 → 9.0.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.
package/dist/index.js
CHANGED
|
@@ -33657,72 +33657,9 @@ function describeSchemaFields(schema) {
|
|
|
33657
33657
|
});
|
|
33658
33658
|
}
|
|
33659
33659
|
|
|
33660
|
-
// src/commands/
|
|
33660
|
+
// src/commands/models.ts
|
|
33661
33661
|
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
33662
|
-
function
|
|
33663
|
-
if (receiptId) {
|
|
33664
|
-
printLine(import_picocolors9.default.dim(`\u{1F512} confidential \xB7 attested \xB7 receipt ${receiptId}`));
|
|
33665
|
-
}
|
|
33666
|
-
}
|
|
33667
|
-
var DEFAULT_MODEL = "openai/gpt-oss-120b";
|
|
33668
|
-
function numOrUndef(v) {
|
|
33669
|
-
if (v === void 0) {
|
|
33670
|
-
return;
|
|
33671
|
-
}
|
|
33672
|
-
const n = Number(v);
|
|
33673
|
-
return Number.isFinite(n) ? n : void 0;
|
|
33674
|
-
}
|
|
33675
|
-
function registerChat(program3) {
|
|
33676
|
-
program3.command("chat").argument("<message...>", "Your prompt").description(
|
|
33677
|
-
"Chat with a model on t2000 Private Inference (OpenAI-compatible, ZDR; a phala/* tier is GPU-TEE confidential). Needs an API key \u2014 generate one at agents.t2000.ai/manage, then pass --api-key or set T2000_API_KEY."
|
|
33678
|
-
).option("--model <id>", `Model id (default ${DEFAULT_MODEL}; see \`t2 models\`)`, DEFAULT_MODEL).option("--system <text>", "System prompt").option("--max-tokens <n>", "Max output tokens").option("--temperature <t>", "Sampling temperature (0\u20132)").option("--no-stream", "Wait for the full response instead of streaming").option("--api-key <key>", "Private Inference key (or set T2000_API_KEY)").option("--api <url>", "API base URL (default https://api.t2000.ai/v1)").action(
|
|
33679
|
-
async (messageParts, opts) => {
|
|
33680
|
-
try {
|
|
33681
|
-
const messages = [];
|
|
33682
|
-
if (opts.system) {
|
|
33683
|
-
messages.push({ role: "system", content: opts.system });
|
|
33684
|
-
}
|
|
33685
|
-
messages.push({ role: "user", content: messageParts.join(" ") });
|
|
33686
|
-
const params = {
|
|
33687
|
-
model: opts.model,
|
|
33688
|
-
messages,
|
|
33689
|
-
apiKey: opts.apiKey,
|
|
33690
|
-
apiBase: opts.api,
|
|
33691
|
-
maxTokens: numOrUndef(opts.maxTokens),
|
|
33692
|
-
temperature: numOrUndef(opts.temperature)
|
|
33693
|
-
};
|
|
33694
|
-
if (isJsonMode() || opts.stream === false) {
|
|
33695
|
-
const res = await chatCompletion(params);
|
|
33696
|
-
if (isJsonMode()) {
|
|
33697
|
-
printJson({
|
|
33698
|
-
model: res.model,
|
|
33699
|
-
content: res.content,
|
|
33700
|
-
usage: res.usage,
|
|
33701
|
-
receiptId: res.receiptId
|
|
33702
|
-
});
|
|
33703
|
-
return;
|
|
33704
|
-
}
|
|
33705
|
-
printBlank();
|
|
33706
|
-
printLine(res.content);
|
|
33707
|
-
receiptLine(res.receiptId);
|
|
33708
|
-
printBlank();
|
|
33709
|
-
return;
|
|
33710
|
-
}
|
|
33711
|
-
const gen = chatCompletionStream(params);
|
|
33712
|
-
let any = false;
|
|
33713
|
-
let next = await gen.next();
|
|
33714
|
-
while (!next.done) {
|
|
33715
|
-
process.stdout.write(next.value);
|
|
33716
|
-
any = true;
|
|
33717
|
-
next = await gen.next();
|
|
33718
|
-
}
|
|
33719
|
-
process.stdout.write(any ? "\n" : "");
|
|
33720
|
-
receiptLine(next.value?.receiptId);
|
|
33721
|
-
} catch (error) {
|
|
33722
|
-
handleError(error);
|
|
33723
|
-
}
|
|
33724
|
-
}
|
|
33725
|
-
);
|
|
33662
|
+
function registerModels(program3) {
|
|
33726
33663
|
program3.command("models").description("List the t2000 Private Inference model catalog (id \xB7 privacy tier \xB7 per-1M pricing).").option("--api-key <key>", "Private Inference key (or set T2000_API_KEY)").option("--api <url>", "API base URL (default https://api.t2000.ai/v1)").action(async (opts) => {
|
|
33727
33664
|
try {
|
|
33728
33665
|
const models = await listModels({ apiKey: opts.apiKey, apiBase: opts.api });
|
|
@@ -33743,6 +33680,13 @@ function registerChat(program3) {
|
|
|
33743
33680
|
handleError(error);
|
|
33744
33681
|
}
|
|
33745
33682
|
});
|
|
33683
|
+
program3.command("chat", { hidden: true }).allowUnknownOption(true).argument("[message...]").action(() => {
|
|
33684
|
+
printLine("`t2 chat` moved into t2 code \u2014 the coding agent on the same rail.");
|
|
33685
|
+
printLine(" npm install -g @t2000/code");
|
|
33686
|
+
printLine(' t2code "your prompt" # interactive');
|
|
33687
|
+
printLine(' t2code exec "your task" # one-shot, headless');
|
|
33688
|
+
process.exitCode = 1;
|
|
33689
|
+
});
|
|
33746
33690
|
}
|
|
33747
33691
|
|
|
33748
33692
|
// src/commands/verify.ts
|
|
@@ -34177,7 +34121,7 @@ function registerMcpStart(parent) {
|
|
|
34177
34121
|
parent.command("start", { isDefault: true }).description("Start MCP server (stdio transport \u2014 for AI client integration)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").action(async (opts) => {
|
|
34178
34122
|
let mod3;
|
|
34179
34123
|
try {
|
|
34180
|
-
mod3 = await import("./dist-
|
|
34124
|
+
mod3 = await import("./dist-5XBLHNG7.js");
|
|
34181
34125
|
} catch {
|
|
34182
34126
|
console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
|
|
34183
34127
|
process.exit(1);
|
|
@@ -35211,8 +35155,7 @@ Examples:
|
|
|
35211
35155
|
$ t2 balance Show USDC / USDsui / SUI holdings
|
|
35212
35156
|
$ t2 send 5 USDC alice.sui Send 5 USDC (gasless; asset required)
|
|
35213
35157
|
$ t2 swap 100 USDC SUI Swap 100 USDC for SUI via Cetus
|
|
35214
|
-
$ t2
|
|
35215
|
-
$ t2 models List the Private Inference model catalog
|
|
35158
|
+
$ t2 models List the Private Inference model catalog (chat lives in \`t2 code\`)
|
|
35216
35159
|
$ t2 pay <url> --estimate Preview an x402 service's price + input schema (no payment)
|
|
35217
35160
|
$ t2 services search "image" Discover x402 services in the gateway catalog
|
|
35218
35161
|
$ t2 agents Look up the agent directory (agents.t2000.ai)
|
|
@@ -35228,7 +35171,7 @@ Examples:
|
|
|
35228
35171
|
registerSend(program3);
|
|
35229
35172
|
registerSwap(program3);
|
|
35230
35173
|
registerPay(program3);
|
|
35231
|
-
|
|
35174
|
+
registerModels(program3);
|
|
35232
35175
|
registerVerify(program3);
|
|
35233
35176
|
registerServices(program3);
|
|
35234
35177
|
registerLimit(program3);
|