@t2000/cli 0.18.0 → 0.18.2
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/README.md +8 -2
- package/dist/{chunk-G2C4JKWH.js → chunk-5QCOX5AE.js} +2 -3
- package/dist/{chunk-G2C4JKWH.js.map → chunk-5QCOX5AE.js.map} +1 -1
- package/dist/{chunk-MKTCPK75.js → chunk-PLDDJCW6.js} +1 -2
- package/dist/{chunk-FILMHRDQ.js → chunk-QJ5CPQJK.js} +1 -3
- package/dist/{chunk-FILMHRDQ.js.map → chunk-QJ5CPQJK.js.map} +1 -1
- package/dist/{dist-IHO4UPEB.js → dist-DOHDQ4GX.js} +6 -7
- package/dist/{dist-IHO4UPEB.js.map → dist-DOHDQ4GX.js.map} +1 -1
- package/dist/{dist-6ADOH23K.js → dist-YUEEJ6TK.js} +4 -5
- package/dist/{dist-6ADOH23K.js.map → dist-YUEEJ6TK.js.map} +1 -1
- package/dist/{fileFromPath-WHCJFE2P.js → fileFromPath-H3SAQMJK.js} +3 -4
- package/dist/{fileFromPath-WHCJFE2P.js.map → fileFromPath-H3SAQMJK.js.map} +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- /package/dist/{chunk-MKTCPK75.js.map → chunk-PLDDJCW6.js.map} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import {
|
|
3
2
|
File,
|
|
4
3
|
isFile
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QJ5CPQJK.js";
|
|
6
5
|
import {
|
|
7
6
|
__commonJS,
|
|
8
7
|
__require,
|
|
9
8
|
__toESM
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PLDDJCW6.js";
|
|
11
10
|
|
|
12
11
|
// ../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js
|
|
13
12
|
var require_node_domexception = __commonJS({
|
|
@@ -128,4 +127,4 @@ export {
|
|
|
128
127
|
node-domexception/index.js:
|
|
129
128
|
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
130
129
|
*/
|
|
131
|
-
//# sourceMappingURL=fileFromPath-
|
|
130
|
+
//# sourceMappingURL=fileFromPath-H3SAQMJK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js","../../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js","../../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isPlainObject.js"],"sourcesContent":["/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require('worker_threads'),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === 'DOMException' && (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _FileFromPath_path, _FileFromPath_start;\nimport { statSync, createReadStream, promises as fs } from \"fs\";\nimport { basename } from \"path\";\nimport DOMException from \"node-domexception\";\nimport { File } from \"./File.js\";\nimport isPlainObject from \"./isPlainObject.js\";\nexport * from \"./isFile.js\";\nconst MESSAGE = \"The requested file could not be read, \"\n + \"typically due to permission problems that have occurred after a reference \"\n + \"to a file was acquired.\";\nclass FileFromPath {\n constructor(input) {\n _FileFromPath_path.set(this, void 0);\n _FileFromPath_start.set(this, void 0);\n __classPrivateFieldSet(this, _FileFromPath_path, input.path, \"f\");\n __classPrivateFieldSet(this, _FileFromPath_start, input.start || 0, \"f\");\n this.name = basename(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"));\n this.size = input.size;\n this.lastModified = input.lastModified;\n }\n slice(start, end) {\n return new FileFromPath({\n path: __classPrivateFieldGet(this, _FileFromPath_path, \"f\"),\n lastModified: this.lastModified,\n size: end - start,\n start\n });\n }\n async *stream() {\n const { mtimeMs } = await fs.stat(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"));\n if (mtimeMs > this.lastModified) {\n throw new DOMException(MESSAGE, \"NotReadableError\");\n }\n if (this.size) {\n yield* createReadStream(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"), {\n start: __classPrivateFieldGet(this, _FileFromPath_start, \"f\"),\n end: __classPrivateFieldGet(this, _FileFromPath_start, \"f\") + this.size - 1\n });\n }\n }\n get [(_FileFromPath_path = new WeakMap(), _FileFromPath_start = new WeakMap(), Symbol.toStringTag)]() {\n return \"File\";\n }\n}\nfunction createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {\n let filename;\n if (isPlainObject(filenameOrOptions)) {\n [options, filename] = [filenameOrOptions, undefined];\n }\n else {\n filename = filenameOrOptions;\n }\n const file = new FileFromPath({ path, size, lastModified: mtimeMs });\n if (!filename) {\n filename = file.name;\n }\n return new File([file], filename, {\n ...options, lastModified: file.lastModified\n });\n}\nexport function fileFromPathSync(path, filenameOrOptions, options = {}) {\n const stats = statSync(path);\n return createFileFromPath(path, stats, filenameOrOptions, options);\n}\nexport async function fileFromPath(path, filenameOrOptions, options) {\n const stats = await fs.stat(path);\n return createFileFromPath(path, stats, filenameOrOptions, options);\n}\n","const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());\nfunction isPlainObject(value) {\n if (getType(value) !== \"object\") {\n return false;\n }\n const pp = Object.getPrototypeOf(value);\n if (pp === null || pp === undefined) {\n return true;\n }\n const Ctor = pp.constructor && pp.constructor.toString();\n return Ctor === Object.toString();\n}\nexport default isPlainObject;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js","../../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js","../../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isPlainObject.js"],"sourcesContent":["/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */\n\nif (!globalThis.DOMException) {\n try {\n const { MessageChannel } = require('worker_threads'),\n port = new MessageChannel().port1,\n ab = new ArrayBuffer()\n port.postMessage(ab, [ab, ab])\n } catch (err) {\n err.constructor.name === 'DOMException' && (\n globalThis.DOMException = err.constructor\n )\n }\n}\n\nmodule.exports = globalThis.DOMException\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _FileFromPath_path, _FileFromPath_start;\nimport { statSync, createReadStream, promises as fs } from \"fs\";\nimport { basename } from \"path\";\nimport DOMException from \"node-domexception\";\nimport { File } from \"./File.js\";\nimport isPlainObject from \"./isPlainObject.js\";\nexport * from \"./isFile.js\";\nconst MESSAGE = \"The requested file could not be read, \"\n + \"typically due to permission problems that have occurred after a reference \"\n + \"to a file was acquired.\";\nclass FileFromPath {\n constructor(input) {\n _FileFromPath_path.set(this, void 0);\n _FileFromPath_start.set(this, void 0);\n __classPrivateFieldSet(this, _FileFromPath_path, input.path, \"f\");\n __classPrivateFieldSet(this, _FileFromPath_start, input.start || 0, \"f\");\n this.name = basename(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"));\n this.size = input.size;\n this.lastModified = input.lastModified;\n }\n slice(start, end) {\n return new FileFromPath({\n path: __classPrivateFieldGet(this, _FileFromPath_path, \"f\"),\n lastModified: this.lastModified,\n size: end - start,\n start\n });\n }\n async *stream() {\n const { mtimeMs } = await fs.stat(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"));\n if (mtimeMs > this.lastModified) {\n throw new DOMException(MESSAGE, \"NotReadableError\");\n }\n if (this.size) {\n yield* createReadStream(__classPrivateFieldGet(this, _FileFromPath_path, \"f\"), {\n start: __classPrivateFieldGet(this, _FileFromPath_start, \"f\"),\n end: __classPrivateFieldGet(this, _FileFromPath_start, \"f\") + this.size - 1\n });\n }\n }\n get [(_FileFromPath_path = new WeakMap(), _FileFromPath_start = new WeakMap(), Symbol.toStringTag)]() {\n return \"File\";\n }\n}\nfunction createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {\n let filename;\n if (isPlainObject(filenameOrOptions)) {\n [options, filename] = [filenameOrOptions, undefined];\n }\n else {\n filename = filenameOrOptions;\n }\n const file = new FileFromPath({ path, size, lastModified: mtimeMs });\n if (!filename) {\n filename = file.name;\n }\n return new File([file], filename, {\n ...options, lastModified: file.lastModified\n });\n}\nexport function fileFromPathSync(path, filenameOrOptions, options = {}) {\n const stats = statSync(path);\n return createFileFromPath(path, stats, filenameOrOptions, options);\n}\nexport async function fileFromPath(path, filenameOrOptions, options) {\n const stats = await fs.stat(path);\n return createFileFromPath(path, stats, filenameOrOptions, options);\n}\n","const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());\nfunction isPlainObject(value) {\n if (getType(value) !== \"object\") {\n return false;\n }\n const pp = Object.getPrototypeOf(value);\n if (pp === null || pp === undefined) {\n return true;\n }\n const Ctor = pp.constructor && pp.constructor.toString();\n return Ctor === Object.toString();\n}\nexport default isPlainObject;\n"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAI,CAAC,WAAW,cAAc;AAC5B,UAAI;AACF,cAAM,EAAE,eAAe,IAAI,UAAQ,gBAAgB,GACnD,OAAO,IAAI,eAAe,EAAE,OAC5B,KAAK,IAAI,YAAY;AACrB,aAAK,YAAY,IAAI,CAAC,IAAI,EAAE,CAAC;AAAA,MAC/B,SAAS,KAAK;AACZ,YAAI,YAAY,SAAS,mBACvB,WAAW,eAAe,IAAI;AAAA,MAElC;AAAA,IACF;AAEA,WAAO,UAAU,WAAW;AAAA;AAAA;;;ACD5B,+BAAyB;AAFzB,SAAS,UAAU,kBAAkB,YAAY,UAAU;AAC3D,SAAS,gBAAgB;;;ACbzB,IAAM,UAAU,CAAC,UAAW,OAAO,UAAU,SAAS,KAAK,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,YAAY;AAC3F,SAAS,cAAc,OAAO;AAC1B,MAAI,QAAQ,KAAK,MAAM,UAAU;AAC7B,WAAO;AAAA,EACX;AACA,QAAM,KAAK,OAAO,eAAe,KAAK;AACtC,MAAI,OAAO,QAAQ,OAAO,QAAW;AACjC,WAAO;AAAA,EACX;A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ACpE,QAAM,QAAQ,SAAS,IAAI;AAC3B,SAAO,mBAAmB,MAAM,OAAO,mBAAmB,OAAO;AACrE;AACA,eAAsB,aAAa,MAAM,mBAAmB,SAAS;AACjE,QAAM,QAAQ,MAAM,GAAG,KAAK,IAAI;AAChC,SAAO,mBAAmB,MAAM,OAAO,mBAAmB,OAAO;AACrE;","names":["DOMException"]}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import "./chunk-MKTCPK75.js";
|
|
2
|
+
import "./chunk-PLDDJCW6.js";
|
|
4
3
|
|
|
5
4
|
// src/program.ts
|
|
6
5
|
import { Command } from "commander";
|
|
@@ -195,12 +194,22 @@ function registerInit(program2) {
|
|
|
195
194
|
if (!pin || pin.length < 4) throw new Error("PIN must be at least 4 characters");
|
|
196
195
|
const pinConfirm = await password3({ message: "Confirm PIN:" });
|
|
197
196
|
if (pin !== pinConfirm) throw new Error("PINs do not match");
|
|
198
|
-
|
|
197
|
+
printBlank();
|
|
198
|
+
printInfo("Creating agent wallet...");
|
|
199
|
+
const { agent, address: addr, sponsored } = await T2000.init({ pin, keyPath: opts.key, sponsored: opts.sponsor });
|
|
199
200
|
address = addr;
|
|
200
201
|
await saveSession(pin);
|
|
201
202
|
printSuccess("Keypair generated");
|
|
202
|
-
printSuccess("Sui mainnet");
|
|
203
|
-
printSuccess(
|
|
203
|
+
printSuccess(`Network ${pc2.dim("Sui mainnet")}`);
|
|
204
|
+
printSuccess(`Gas sponsorship ${pc2.dim(sponsored ? "enabled" : "disabled")}`);
|
|
205
|
+
printBlank();
|
|
206
|
+
printInfo("Setting up accounts...");
|
|
207
|
+
printLine(
|
|
208
|
+
` ${pc2.green("\u2713")} Checking ${pc2.green("\u2713")} Savings ${pc2.green("\u2713")} Credit ${pc2.green("\u2713")} Exchange ${pc2.green("\u2713")} Investment`
|
|
209
|
+
);
|
|
210
|
+
printBlank();
|
|
211
|
+
printLine(` \u{1F389} ${pc2.green("Bank account created")}`);
|
|
212
|
+
printLine(` Address: ${pc2.yellow(address.slice(0, 6) + "..." + address.slice(-4))}`);
|
|
204
213
|
printBlank();
|
|
205
214
|
}
|
|
206
215
|
const stepNum = skipWallet ? 1 : 3;
|
|
@@ -2059,7 +2068,7 @@ function registerMcp(program2) {
|
|
|
2059
2068
|
mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
|
|
2060
2069
|
let mod;
|
|
2061
2070
|
try {
|
|
2062
|
-
mod = await import("./dist-
|
|
2071
|
+
mod = await import("./dist-YUEEJ6TK.js");
|
|
2063
2072
|
} catch {
|
|
2064
2073
|
console.error(
|
|
2065
2074
|
"MCP server not installed. Run:\n npm install -g @t2000/mcp"
|
|
@@ -2923,7 +2932,7 @@ function registerGateway(program2) {
|
|
|
2923
2932
|
console.log("");
|
|
2924
2933
|
console.log(` ${pc16.bold("t2000 gateway")}`);
|
|
2925
2934
|
console.log("");
|
|
2926
|
-
const { Gateway } = await import("./dist-
|
|
2935
|
+
const { Gateway } = await import("./dist-DOHDQ4GX.js");
|
|
2927
2936
|
const gateway = await Gateway.create({
|
|
2928
2937
|
agent,
|
|
2929
2938
|
port: parseInt(opts.port, 10),
|