@t2000/cli 10.21.2 → 10.23.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/README.md +2 -2
- package/dist/{chunk-SKQLFHJJ.js → chunk-PRKQVMED.js} +2 -2
- package/dist/{chunk-ZXXZGTWS.js → chunk-Y4F22BB6.js} +2 -2
- package/dist/{chunk-BLLELIG6.js → chunk-YPWSCLE3.js} +1 -3
- package/dist/{dist-MQVAPHMQ.js → dist-GMDKEKC4.js} +3 -3
- package/dist/{dist-36BJD54E.js → dist-VUHPQJYY.js} +2 -2
- package/dist/{esm-4JYJHL2T.js → esm-ZKAIHFAJ.js} +2 -2
- package/dist/{grpc-SHHHADW4.js → grpc-G3RQE2L5.js} +2 -2
- package/dist/index.js +22 -461
- package/dist/index.js.map +1 -1
- package/dist/{src-4VRJNQ2G.js → src-FIYSHJR4.js} +3 -3
- package/package.json +3 -4
- package/dist/move-bytecode-template-5LZXC42G.js +0 -491
- package/dist/move-bytecode-template-5LZXC42G.js.map +0 -1
- package/dist/move_bytecode_template_bg.wasm +0 -0
- /package/dist/{chunk-SKQLFHJJ.js.map → chunk-PRKQVMED.js.map} +0 -0
- /package/dist/{chunk-ZXXZGTWS.js.map → chunk-Y4F22BB6.js.map} +0 -0
- /package/dist/{chunk-BLLELIG6.js.map → chunk-YPWSCLE3.js.map} +0 -0
- /package/dist/{dist-MQVAPHMQ.js.map → dist-GMDKEKC4.js.map} +0 -0
- /package/dist/{dist-36BJD54E.js.map → dist-VUHPQJYY.js.map} +0 -0
- /package/dist/{esm-4JYJHL2T.js.map → esm-ZKAIHFAJ.js.map} +0 -0
- /package/dist/{grpc-SHHHADW4.js.map → grpc-G3RQE2L5.js.map} +0 -0
- /package/dist/{src-4VRJNQ2G.js.map → src-FIYSHJR4.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'module'; import { fileURLToPat
|
|
|
3
3
|
import {
|
|
4
4
|
AggregatorClient,
|
|
5
5
|
Env
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PRKQVMED.js";
|
|
7
7
|
import {
|
|
8
8
|
BalanceChange,
|
|
9
9
|
BaseClient,
|
|
@@ -83,12 +83,12 @@ import {
|
|
|
83
83
|
import {
|
|
84
84
|
require_bn,
|
|
85
85
|
require_safer
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-Y4F22BB6.js";
|
|
87
87
|
import {
|
|
88
88
|
__commonJS,
|
|
89
89
|
__require,
|
|
90
90
|
__toESM
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-YPWSCLE3.js";
|
|
92
92
|
|
|
93
93
|
// ../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/error.js
|
|
94
94
|
var require_error = __commonJS({
|
|
@@ -28618,7 +28618,7 @@ function preflightPay(input) {
|
|
|
28618
28618
|
}
|
|
28619
28619
|
return PREFLIGHT_OK;
|
|
28620
28620
|
}
|
|
28621
|
-
async function
|
|
28621
|
+
async function payWithX402(args) {
|
|
28622
28622
|
const { signer, client } = args;
|
|
28623
28623
|
let options = args.options;
|
|
28624
28624
|
const pf = preflightPay({ url: options.url, maxPrice: options.maxPrice });
|
|
@@ -28643,7 +28643,7 @@ async function payWithMpp(args) {
|
|
|
28643
28643
|
const pick = await pickSuiExactRequirements(probe, client.network);
|
|
28644
28644
|
if (pick.kind === "payable") {
|
|
28645
28645
|
const requirements = pick.requirements;
|
|
28646
|
-
const { isX402EscrowRequirements } = await import("./dist-
|
|
28646
|
+
const { isX402EscrowRequirements } = await import("./dist-VUHPQJYY.js");
|
|
28647
28647
|
if (isX402EscrowRequirements(requirements)) {
|
|
28648
28648
|
const escrow = requirements.extra.escrow;
|
|
28649
28649
|
const price = atomicToHuman(
|
|
@@ -28689,7 +28689,7 @@ async function pickSuiExactRequirements(response, network) {
|
|
|
28689
28689
|
const want = `sui:${network === "testnet" ? "testnet" : "mainnet"}`;
|
|
28690
28690
|
const entry = body2.accepts?.find((a) => a.scheme === "exact" && a.network === want);
|
|
28691
28691
|
if (!entry) return { kind: "none" };
|
|
28692
|
-
const { isX402EscrowRequirements } = await import("./dist-
|
|
28692
|
+
const { isX402EscrowRequirements } = await import("./dist-VUHPQJYY.js");
|
|
28693
28693
|
if (hasCompleteSuimppChallenge(entry) || isX402EscrowRequirements(entry)) {
|
|
28694
28694
|
return { kind: "payable", requirements: entry };
|
|
28695
28695
|
}
|
|
@@ -28707,7 +28707,7 @@ async function payViaX402(args) {
|
|
|
28707
28707
|
{ reason: "incomplete-x402-accepts" }
|
|
28708
28708
|
);
|
|
28709
28709
|
}
|
|
28710
|
-
const { buildX402SignedPayment, X402_PAYMENT_HEADER, X402_PAYMENT_RESPONSE_HEADER } = await import("./dist-
|
|
28710
|
+
const { buildX402SignedPayment, X402_PAYMENT_HEADER, X402_PAYMENT_RESPONSE_HEADER } = await import("./dist-VUHPQJYY.js");
|
|
28711
28711
|
const amountRaw = BigInt(requirements.maxAmountRequired);
|
|
28712
28712
|
assertWithinMaxPrice(atomicToHuman(amountRaw, await assetDecimals(requirements.asset)), options.maxPrice);
|
|
28713
28713
|
const migrationGasSui = await ensureAddressBalanceCovers({
|
|
@@ -28838,7 +28838,7 @@ async function finalize(response, opts) {
|
|
|
28838
28838
|
return { status: response.status, body: body2, paid: opts.paid };
|
|
28839
28839
|
}
|
|
28840
28840
|
async function makeGrpcBuildClient(client) {
|
|
28841
|
-
const { SuiGrpcClient: SuiGrpcClient3 } = await import("./grpc-
|
|
28841
|
+
const { SuiGrpcClient: SuiGrpcClient3 } = await import("./grpc-G3RQE2L5.js");
|
|
28842
28842
|
const network = client.network === "testnet" ? "testnet" : "mainnet";
|
|
28843
28843
|
const baseUrl = network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
|
|
28844
28844
|
return new SuiGrpcClient3({ baseUrl, network });
|
|
@@ -28867,7 +28867,7 @@ var ZkLoginSigner = class {
|
|
|
28867
28867
|
return this.userAddress;
|
|
28868
28868
|
}
|
|
28869
28869
|
async signTransaction(txBytes) {
|
|
28870
|
-
const { getZkLoginSignature } = await import("./esm-
|
|
28870
|
+
const { getZkLoginSignature } = await import("./esm-ZKAIHFAJ.js");
|
|
28871
28871
|
const ephSig = await this.ephemeralKeypair.signTransaction(txBytes);
|
|
28872
28872
|
return {
|
|
28873
28873
|
signature: getZkLoginSignature({
|
|
@@ -28878,7 +28878,7 @@ var ZkLoginSigner = class {
|
|
|
28878
28878
|
};
|
|
28879
28879
|
}
|
|
28880
28880
|
async signPersonalMessage(messageBytes) {
|
|
28881
|
-
const { getZkLoginSignature } = await import("./esm-
|
|
28881
|
+
const { getZkLoginSignature } = await import("./esm-ZKAIHFAJ.js");
|
|
28882
28882
|
const { signature: ephSig, bytes } = await this.ephemeralKeypair.signPersonalMessage(messageBytes);
|
|
28883
28883
|
return {
|
|
28884
28884
|
signature: getZkLoginSignature({
|
|
@@ -29626,7 +29626,7 @@ async function verifyTdxQuote(base, model, receiptWorkloadId) {
|
|
|
29626
29626
|
};
|
|
29627
29627
|
}
|
|
29628
29628
|
try {
|
|
29629
|
-
const dcap = await import("./src-
|
|
29629
|
+
const dcap = await import("./src-FIYSHJR4.js");
|
|
29630
29630
|
const getCollateralAndVerify = dcap.getCollateralAndVerify ?? dcap.default?.getCollateralAndVerify;
|
|
29631
29631
|
if (typeof getCollateralAndVerify !== "function") {
|
|
29632
29632
|
return {
|
|
@@ -30115,7 +30115,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
30115
30115
|
// -- MPP Payments --
|
|
30116
30116
|
async pay(options) {
|
|
30117
30117
|
this.limits.assert({ operation: "pay", amountUsd: options.maxPrice ?? 0, force: options.force });
|
|
30118
|
-
const result = await
|
|
30118
|
+
const result = await payWithX402({ signer: this._signer, client: this.client, options });
|
|
30119
30119
|
if (result.paid) {
|
|
30120
30120
|
this.limits.record(result.cost ?? options.maxPrice ?? 0);
|
|
30121
30121
|
}
|
|
@@ -30788,39 +30788,7 @@ init_errors();
|
|
|
30788
30788
|
init_swap_quote();
|
|
30789
30789
|
init_cetus_swap();
|
|
30790
30790
|
init_token_registry();
|
|
30791
|
-
var AGENT_ID_PARENT_NFT_ID = process.env.AGENT_ID_PARENT_NFT_ID ?? "0xc8c13f5b5a6d4c47c04877014794f65e67e2745d3bfa089b736eb54b0ebd5d1f";
|
|
30792
30791
|
init_preflight();
|
|
30793
|
-
init_errors();
|
|
30794
|
-
init_token_registry();
|
|
30795
|
-
init_coinSelection();
|
|
30796
|
-
var CETUS_CLMM_PACKAGE_ID = process.env.CETUS_CLMM_PACKAGE_ID ?? "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb";
|
|
30797
|
-
var CETUS_CLMM_PUBLISHED_AT = process.env.CETUS_CLMM_PUBLISHED_AT ?? "0x25ebb9a7c50eb17b3fa9c5a30fb8b5ad8f97caaf4928943acbcff7153dfee5e3";
|
|
30798
|
-
var CETUS_GLOBAL_CONFIG_ID = process.env.CETUS_GLOBAL_CONFIG_ID ?? "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
|
|
30799
|
-
var CETUS_POOLS_ID = process.env.CETUS_POOLS_ID ?? "0xf699e7f2276f5c9a75944b37a0c5b5d9ddfd2471bf6242483b03ab2887d198d0";
|
|
30800
|
-
var CETUS_POSITION_TYPE = `${CETUS_CLMM_PACKAGE_ID}::position::Position`;
|
|
30801
|
-
init_errors();
|
|
30802
|
-
var TEMPLATE = {
|
|
30803
|
-
module: "template",
|
|
30804
|
-
otw: "TEMPLATE",
|
|
30805
|
-
symbol: "TMPL",
|
|
30806
|
-
name: "Template Coin",
|
|
30807
|
-
description: "bytecode template placeholder",
|
|
30808
|
-
iconUrl: "https://example.com/icon.svg",
|
|
30809
|
-
totalSupply: 1000000000000000n,
|
|
30810
|
-
recipient: normalizeSuiAddress("0xCAFE")
|
|
30811
|
-
};
|
|
30812
|
-
var AGENT_TOKEN_TOTAL_SUPPLY = 1000000000000000n;
|
|
30813
|
-
var AGENT_TOKEN_LP_ALLOCATION = AGENT_TOKEN_TOTAL_SUPPLY / 2n;
|
|
30814
|
-
var AGENT_TOKEN_TREASURY_ALLOCATION = AGENT_TOKEN_TOTAL_SUPPLY - AGENT_TOKEN_LP_ALLOCATION;
|
|
30815
|
-
var AGENT_CAPITAL_PACKAGE_ID = process.env.AGENT_CAPITAL_PACKAGE_ID ?? "0xa83ecc4e530594f8e184faf6a4c3da6791267f6791a653644d59e2e603c055b8";
|
|
30816
|
-
var AGENT_CAPITAL_PUBLISHED_AT = process.env.AGENT_CAPITAL_PUBLISHED_AT ?? "0x2974c16bda8f148ef5f8c3177d3d63eec060b1048648ae3b6c1fb495c2a602dd";
|
|
30817
|
-
var CAPITAL_REGISTRY_ID = process.env.CAPITAL_REGISTRY_ID ?? "0xef4057baac856d65b47f14a1ba14211299637955ea5bc15d7708f6eef27ee0df";
|
|
30818
|
-
var CAPITAL_REGISTRY_VERSION = Number(
|
|
30819
|
-
process.env.CAPITAL_REGISTRY_VERSION ?? 931861908
|
|
30820
|
-
);
|
|
30821
|
-
init_errors();
|
|
30822
|
-
init_token_registry();
|
|
30823
|
-
var CETUS_INTEGRATE_PUBLISHED_AT = process.env.CETUS_INTEGRATE_PUBLISHED_AT ?? "0xfbb32ac0fa89a3cb0c56c745b688c6d2a53ac8e43447119ad822763997ffb9c3";
|
|
30824
30792
|
|
|
30825
30793
|
// ../../node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@20.19.37/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
30826
30794
|
var isUpKey = (key, keybindings = []) => (
|
|
@@ -34942,368 +34910,6 @@ function registerMcp(program3) {
|
|
|
34942
34910
|
registerMcpUninstall(group);
|
|
34943
34911
|
}
|
|
34944
34912
|
|
|
34945
|
-
// src/commands/skills/check.ts
|
|
34946
|
-
import { readdir, readFile as readFile3 } from "fs/promises";
|
|
34947
|
-
import { join as join7 } from "path";
|
|
34948
|
-
|
|
34949
|
-
// src/commands/skills/lib.ts
|
|
34950
|
-
import { stat } from "fs/promises";
|
|
34951
|
-
import { join as join6 } from "path";
|
|
34952
|
-
import { homedir as homedir5 } from "os";
|
|
34953
|
-
var MANIFEST_URL = "https://t2000.ai/.well-known/agent-skills/index.json";
|
|
34954
|
-
var SKILL_PREFIXES = ["t2000-", "mpp-"];
|
|
34955
|
-
function isManagedSkillName(name) {
|
|
34956
|
-
return SKILL_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
34957
|
-
}
|
|
34958
|
-
var SKILL_TARGETS = ["agents", "cursor", "claude-code"];
|
|
34959
|
-
function resolveTargetDir(target, useGlobal, cwd = process.cwd()) {
|
|
34960
|
-
const root = useGlobal ? homedir5() : cwd;
|
|
34961
|
-
switch (target) {
|
|
34962
|
-
case "agents":
|
|
34963
|
-
return join6(root, ".agents", "skills");
|
|
34964
|
-
case "cursor":
|
|
34965
|
-
return join6(root, ".cursor", "rules");
|
|
34966
|
-
case "claude-code":
|
|
34967
|
-
return join6(root, ".claude", "skills");
|
|
34968
|
-
}
|
|
34969
|
-
}
|
|
34970
|
-
function filenameForTarget(slug, target) {
|
|
34971
|
-
switch (target) {
|
|
34972
|
-
case "agents":
|
|
34973
|
-
case "claude-code":
|
|
34974
|
-
return join6(slug, "SKILL.md");
|
|
34975
|
-
case "cursor":
|
|
34976
|
-
return `${slug}.mdc`;
|
|
34977
|
-
}
|
|
34978
|
-
}
|
|
34979
|
-
function transformForTarget(content, target, description) {
|
|
34980
|
-
if (target !== "cursor") return content;
|
|
34981
|
-
const stripped = content.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/, "");
|
|
34982
|
-
const safeDescription = JSON.stringify(description);
|
|
34983
|
-
return `---
|
|
34984
|
-
description: ${safeDescription}
|
|
34985
|
-
alwaysApply: false
|
|
34986
|
-
---
|
|
34987
|
-
${stripped}`;
|
|
34988
|
-
}
|
|
34989
|
-
function resolveSkillTarget(input) {
|
|
34990
|
-
const value = input ?? "agents";
|
|
34991
|
-
const match = SKILL_TARGETS.find((t) => t === value);
|
|
34992
|
-
if (!match) {
|
|
34993
|
-
throw new Error(`--target must be one of: ${SKILL_TARGETS.join(", ")}. Got: "${value}"`);
|
|
34994
|
-
}
|
|
34995
|
-
return match;
|
|
34996
|
-
}
|
|
34997
|
-
async function fetchManifest() {
|
|
34998
|
-
const res = await fetch(MANIFEST_URL);
|
|
34999
|
-
if (!res.ok) {
|
|
35000
|
-
throw new Error(
|
|
35001
|
-
`Failed to fetch skills manifest from ${MANIFEST_URL} (${res.status} ${res.statusText}). Check your network or fall back to \`git clone https://github.com/mission69b/t2000\` for offline install.`
|
|
35002
|
-
);
|
|
35003
|
-
}
|
|
35004
|
-
return await res.json();
|
|
35005
|
-
}
|
|
35006
|
-
async function fetchSkill(url) {
|
|
35007
|
-
const res = await fetch(url);
|
|
35008
|
-
if (!res.ok) {
|
|
35009
|
-
throw new Error(`Failed to fetch skill ${url} (${res.status} ${res.statusText})`);
|
|
35010
|
-
}
|
|
35011
|
-
return await res.text();
|
|
35012
|
-
}
|
|
35013
|
-
async function dirExists(path2) {
|
|
35014
|
-
try {
|
|
35015
|
-
const s = await stat(path2);
|
|
35016
|
-
return s.isDirectory();
|
|
35017
|
-
} catch {
|
|
35018
|
-
return false;
|
|
35019
|
-
}
|
|
35020
|
-
}
|
|
35021
|
-
|
|
35022
|
-
// src/commands/skills/check.ts
|
|
35023
|
-
function slugFromEntry(entry, target) {
|
|
35024
|
-
return target === "cursor" ? entry.replace(/\.mdc$/, "") : entry;
|
|
35025
|
-
}
|
|
35026
|
-
async function installedSlugs(dir, target) {
|
|
35027
|
-
try {
|
|
35028
|
-
const entries = await readdir(dir);
|
|
35029
|
-
return entries.map((e) => slugFromEntry(e, target)).filter((slug) => isManagedSkillName(slug));
|
|
35030
|
-
} catch {
|
|
35031
|
-
return [];
|
|
35032
|
-
}
|
|
35033
|
-
}
|
|
35034
|
-
function classifyContent(installed, served) {
|
|
35035
|
-
if (served === null) {
|
|
35036
|
-
return "retired";
|
|
35037
|
-
}
|
|
35038
|
-
return installed.trim() === served.trim() ? "up-to-date" : "drifted";
|
|
35039
|
-
}
|
|
35040
|
-
async function checkTargetScope(manifest, servedCache, target, scope) {
|
|
35041
|
-
const dir = resolveTargetDir(target, scope === "global");
|
|
35042
|
-
if (!await dirExists(dir)) {
|
|
35043
|
-
return [];
|
|
35044
|
-
}
|
|
35045
|
-
const slugs = await installedSlugs(dir, target);
|
|
35046
|
-
const rows = [];
|
|
35047
|
-
for (const slug of slugs) {
|
|
35048
|
-
const path2 = join7(dir, filenameForTarget(slug, target));
|
|
35049
|
-
let installed;
|
|
35050
|
-
try {
|
|
35051
|
-
installed = await readFile3(path2, "utf-8");
|
|
35052
|
-
} catch {
|
|
35053
|
-
continue;
|
|
35054
|
-
}
|
|
35055
|
-
const entry = manifest.skills.find((s) => s.name === slug);
|
|
35056
|
-
let served = null;
|
|
35057
|
-
if (entry) {
|
|
35058
|
-
const cacheKey = `${target}:${slug}`;
|
|
35059
|
-
const cached = servedCache.get(cacheKey);
|
|
35060
|
-
if (cached !== void 0) {
|
|
35061
|
-
served = cached;
|
|
35062
|
-
} else {
|
|
35063
|
-
const raw = await fetchSkill(entry.url);
|
|
35064
|
-
served = transformForTarget(raw, target, entry.description);
|
|
35065
|
-
servedCache.set(cacheKey, served);
|
|
35066
|
-
}
|
|
35067
|
-
}
|
|
35068
|
-
rows.push({
|
|
35069
|
-
name: slug,
|
|
35070
|
-
target,
|
|
35071
|
-
scope,
|
|
35072
|
-
path: path2,
|
|
35073
|
-
status: classifyContent(installed, served)
|
|
35074
|
-
});
|
|
35075
|
-
}
|
|
35076
|
-
return rows;
|
|
35077
|
-
}
|
|
35078
|
-
function registerSkillsCheck(parent) {
|
|
35079
|
-
parent.command("check").description(
|
|
35080
|
-
"Compare installed skills against what t2000.ai serves \u2014 { upToDate, action } for agents"
|
|
35081
|
-
).option(
|
|
35082
|
-
"--target <name>",
|
|
35083
|
-
"Only check one target layout: agents, cursor, claude-code (default: all)"
|
|
35084
|
-
).action(async (opts) => {
|
|
35085
|
-
try {
|
|
35086
|
-
const targets = opts.target ? [
|
|
35087
|
-
(() => {
|
|
35088
|
-
const match = SKILL_TARGETS.find((t) => t === opts.target);
|
|
35089
|
-
if (!match) {
|
|
35090
|
-
throw new Error(
|
|
35091
|
-
`--target must be one of: ${SKILL_TARGETS.join(", ")}. Got: "${opts.target}"`
|
|
35092
|
-
);
|
|
35093
|
-
}
|
|
35094
|
-
return match;
|
|
35095
|
-
})()
|
|
35096
|
-
] : SKILL_TARGETS;
|
|
35097
|
-
const manifest = await fetchManifest();
|
|
35098
|
-
const servedCache = /* @__PURE__ */ new Map();
|
|
35099
|
-
const rows = [];
|
|
35100
|
-
for (const target of targets) {
|
|
35101
|
-
rows.push(
|
|
35102
|
-
...await checkTargetScope(manifest, servedCache, target, "local"),
|
|
35103
|
-
...await checkTargetScope(manifest, servedCache, target, "global")
|
|
35104
|
-
);
|
|
35105
|
-
}
|
|
35106
|
-
const stale = rows.filter((r) => r.status !== "up-to-date");
|
|
35107
|
-
const upToDate = rows.length > 0 && stale.length === 0;
|
|
35108
|
-
if (isJsonMode()) {
|
|
35109
|
-
printJson({
|
|
35110
|
-
upToDate: rows.length === 0 ? true : upToDate,
|
|
35111
|
-
installed: rows.length,
|
|
35112
|
-
manifestVersion: manifest.version,
|
|
35113
|
-
skills: rows,
|
|
35114
|
-
action: stale.length > 0 ? "t2 skills install" : void 0
|
|
35115
|
-
});
|
|
35116
|
-
return;
|
|
35117
|
-
}
|
|
35118
|
-
printBlank();
|
|
35119
|
-
if (rows.length === 0) {
|
|
35120
|
-
printInfo(
|
|
35121
|
-
"No installed skills found (checked ./ and ~/ for .agents/skills, .cursor/rules, .claude/skills)."
|
|
35122
|
-
);
|
|
35123
|
-
printInfo("Install: t2 skills install \xB7 MCP clients get skills via mcp.t2000.ai (no files, always fresh)");
|
|
35124
|
-
printBlank();
|
|
35125
|
-
return;
|
|
35126
|
-
}
|
|
35127
|
-
for (const r of rows) {
|
|
35128
|
-
const mark = r.status === "up-to-date" ? "\u2713" : r.status === "drifted" ? "\u21BB" : "\u2717";
|
|
35129
|
-
console.log(` ${mark} ${r.name} [${r.target} \xB7 ${r.scope}] ${r.status}`);
|
|
35130
|
-
}
|
|
35131
|
-
printBlank();
|
|
35132
|
-
if (upToDate) {
|
|
35133
|
-
printSuccess(`All ${rows.length} installed skills match what t2000.ai serves.`);
|
|
35134
|
-
} else {
|
|
35135
|
-
printInfo(
|
|
35136
|
-
`${stale.length} of ${rows.length} installed skills are stale \u2014 refresh with: t2 skills install`
|
|
35137
|
-
);
|
|
35138
|
-
if (stale.some((r) => r.status === "retired")) {
|
|
35139
|
-
printInfo("(\u2717 retired = no longer in the manifest \u2014 remove with: t2 skills uninstall)");
|
|
35140
|
-
}
|
|
35141
|
-
}
|
|
35142
|
-
printBlank();
|
|
35143
|
-
} catch (err) {
|
|
35144
|
-
handleError(err);
|
|
35145
|
-
}
|
|
35146
|
-
});
|
|
35147
|
-
}
|
|
35148
|
-
|
|
35149
|
-
// src/commands/skills/list.ts
|
|
35150
|
-
function registerSkillsList(parent) {
|
|
35151
|
-
parent.command("list").description("List skills available from t2000.ai (core t2000 + MPP recipes)").action(async () => {
|
|
35152
|
-
try {
|
|
35153
|
-
const manifest = await fetchManifest();
|
|
35154
|
-
if (isJsonMode()) {
|
|
35155
|
-
printJson({ skills: manifest.skills });
|
|
35156
|
-
return;
|
|
35157
|
-
}
|
|
35158
|
-
printBlank();
|
|
35159
|
-
printInfo(`${manifest.skills.length} skills available:`);
|
|
35160
|
-
printBlank();
|
|
35161
|
-
for (const s of manifest.skills) {
|
|
35162
|
-
console.log(` ${s.name.padEnd(28)} v${s.version}`);
|
|
35163
|
-
}
|
|
35164
|
-
printBlank();
|
|
35165
|
-
printInfo("Install all: t2 skills install");
|
|
35166
|
-
printInfo("Install one: t2 skills install <name>");
|
|
35167
|
-
printBlank();
|
|
35168
|
-
} catch (err) {
|
|
35169
|
-
handleError(err);
|
|
35170
|
-
}
|
|
35171
|
-
});
|
|
35172
|
-
}
|
|
35173
|
-
|
|
35174
|
-
// src/commands/skills/install.ts
|
|
35175
|
-
import { writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
35176
|
-
import { join as join8 } from "path";
|
|
35177
|
-
function registerSkillsInstall(parent) {
|
|
35178
|
-
parent.command("install [slug]").description("Install all skills (or one named slug) into a local directory").option("--target <name>", "Target client layout: agents (default), cursor, claude-code", "agents").option("--global", "Install to ~/.<target>/ instead of <cwd>/.<target>/").action(async (slug, opts) => {
|
|
35179
|
-
try {
|
|
35180
|
-
const target = resolveSkillTarget(opts.target);
|
|
35181
|
-
const useGlobal = opts.global === true;
|
|
35182
|
-
const manifest = await fetchManifest();
|
|
35183
|
-
const toInstall = slug ? manifest.skills.filter((s) => s.name === slug) : manifest.skills;
|
|
35184
|
-
if (toInstall.length === 0) {
|
|
35185
|
-
const available = manifest.skills.map((s) => s.name).join(", ");
|
|
35186
|
-
throw new Error(
|
|
35187
|
-
slug ? `Unknown skill: "${slug}". Available: ${available}` : "No skills found in manifest"
|
|
35188
|
-
);
|
|
35189
|
-
}
|
|
35190
|
-
const targetDir = resolveTargetDir(target, useGlobal);
|
|
35191
|
-
await mkdir3(targetDir, { recursive: true });
|
|
35192
|
-
const installed = [];
|
|
35193
|
-
for (const s of toInstall) {
|
|
35194
|
-
const raw = await fetchSkill(s.url);
|
|
35195
|
-
const transformed = transformForTarget(raw, target, s.description);
|
|
35196
|
-
const relPath = filenameForTarget(s.name, target);
|
|
35197
|
-
const fullPath = join8(targetDir, relPath);
|
|
35198
|
-
await mkdir3(join8(fullPath, ".."), { recursive: true });
|
|
35199
|
-
await writeFile3(fullPath, transformed, "utf-8");
|
|
35200
|
-
installed.push({ name: s.name, path: fullPath });
|
|
35201
|
-
}
|
|
35202
|
-
if (isJsonMode()) {
|
|
35203
|
-
printJson({ target, global: useGlobal, targetDir, installed });
|
|
35204
|
-
return;
|
|
35205
|
-
}
|
|
35206
|
-
printBlank();
|
|
35207
|
-
printSuccess(
|
|
35208
|
-
`Installed ${installed.length} skill${installed.length === 1 ? "" : "s"} into ${targetDir}`
|
|
35209
|
-
);
|
|
35210
|
-
for (const r of installed) {
|
|
35211
|
-
console.log(` ${r.name}`);
|
|
35212
|
-
}
|
|
35213
|
-
printBlank();
|
|
35214
|
-
printInfo("Reload your AI client to pick up the new skill files.");
|
|
35215
|
-
if (target !== "cursor") {
|
|
35216
|
-
printInfo("(Clients connected to mcp.t2000.ai already have these as /skill-<name> prompts.)");
|
|
35217
|
-
}
|
|
35218
|
-
printBlank();
|
|
35219
|
-
} catch (err) {
|
|
35220
|
-
handleError(err);
|
|
35221
|
-
}
|
|
35222
|
-
});
|
|
35223
|
-
}
|
|
35224
|
-
|
|
35225
|
-
// src/commands/skills/uninstall.ts
|
|
35226
|
-
import { readdir as readdir2, unlink, rmdir } from "fs/promises";
|
|
35227
|
-
import { join as join9 } from "path";
|
|
35228
|
-
function registerSkillsUninstall(parent) {
|
|
35229
|
-
parent.command("uninstall").description("Remove installed t2000 + MPP skills from the target directory").option("--target <name>", "Target client layout: agents (default), cursor, claude-code", "agents").option("--global", "Uninstall from ~/.<target>/ instead of <cwd>/.<target>/").action(async (opts) => {
|
|
35230
|
-
try {
|
|
35231
|
-
const target = resolveSkillTarget(opts.target);
|
|
35232
|
-
const useGlobal = opts.global === true;
|
|
35233
|
-
const targetDir = resolveTargetDir(target, useGlobal);
|
|
35234
|
-
if (!await dirExists(targetDir)) {
|
|
35235
|
-
if (isJsonMode()) {
|
|
35236
|
-
printJson({ target, targetDir, removed: [] });
|
|
35237
|
-
return;
|
|
35238
|
-
}
|
|
35239
|
-
printInfo(`No skills installed at ${targetDir}`);
|
|
35240
|
-
return;
|
|
35241
|
-
}
|
|
35242
|
-
const entries = await readdir2(targetDir);
|
|
35243
|
-
const removed = [];
|
|
35244
|
-
for (const entry of entries) {
|
|
35245
|
-
const full = join9(targetDir, entry);
|
|
35246
|
-
if (target === "cursor") {
|
|
35247
|
-
const slug = entry.endsWith(".mdc") ? entry.slice(0, -".mdc".length) : entry;
|
|
35248
|
-
if (entry.endsWith(".mdc") && isManagedSkillName(slug)) {
|
|
35249
|
-
await unlink(full);
|
|
35250
|
-
removed.push(entry);
|
|
35251
|
-
}
|
|
35252
|
-
} else {
|
|
35253
|
-
if (isManagedSkillName(entry)) {
|
|
35254
|
-
const skillFile = join9(full, "SKILL.md");
|
|
35255
|
-
try {
|
|
35256
|
-
await unlink(skillFile);
|
|
35257
|
-
} catch {
|
|
35258
|
-
}
|
|
35259
|
-
try {
|
|
35260
|
-
await rmdir(full);
|
|
35261
|
-
} catch {
|
|
35262
|
-
}
|
|
35263
|
-
removed.push(entry);
|
|
35264
|
-
}
|
|
35265
|
-
}
|
|
35266
|
-
}
|
|
35267
|
-
if (isJsonMode()) {
|
|
35268
|
-
printJson({ target, targetDir, removed });
|
|
35269
|
-
return;
|
|
35270
|
-
}
|
|
35271
|
-
printBlank();
|
|
35272
|
-
if (removed.length === 0) {
|
|
35273
|
-
printInfo(`No managed skills found in ${targetDir}`);
|
|
35274
|
-
} else {
|
|
35275
|
-
printSuccess(`Removed ${removed.length} skill${removed.length === 1 ? "" : "s"} from ${targetDir}`);
|
|
35276
|
-
}
|
|
35277
|
-
printBlank();
|
|
35278
|
-
} catch (err) {
|
|
35279
|
-
handleError(err);
|
|
35280
|
-
}
|
|
35281
|
-
});
|
|
35282
|
-
}
|
|
35283
|
-
|
|
35284
|
-
// src/commands/skills/index.ts
|
|
35285
|
-
function registerSkills(program3) {
|
|
35286
|
-
const group = program3.command("skills").description("Install agent SKILL.md playbooks locally").addHelpText(
|
|
35287
|
-
"after",
|
|
35288
|
-
`
|
|
35289
|
-
Subcommands:
|
|
35290
|
-
$ t2 skills list List available skills
|
|
35291
|
-
$ t2 skills install Install all skills (default target: agents)
|
|
35292
|
-
$ t2 skills install <slug> Install one skill by name
|
|
35293
|
-
$ t2 skills install --target cursor Install as Cursor .mdc rules
|
|
35294
|
-
$ t2 skills check Are installed skills current? (agents: run at session start)
|
|
35295
|
-
$ t2 skills uninstall Remove installed skills
|
|
35296
|
-
|
|
35297
|
-
MCP clients connected to https://mcp.t2000.ai/mcp get every skill as a
|
|
35298
|
-
\`/skill-<name>\` prompt automatically \u2014 no local files needed.
|
|
35299
|
-
`
|
|
35300
|
-
);
|
|
35301
|
-
registerSkillsList(group);
|
|
35302
|
-
registerSkillsInstall(group);
|
|
35303
|
-
registerSkillsCheck(group);
|
|
35304
|
-
registerSkillsUninstall(group);
|
|
35305
|
-
}
|
|
35306
|
-
|
|
35307
34913
|
// src/lib/agent-category.ts
|
|
35308
34914
|
var AGENT_CATEGORIES = [
|
|
35309
34915
|
"ai-models",
|
|
@@ -35507,7 +35113,7 @@ function registerAgentCreate(group) {
|
|
|
35507
35113
|
printBlank();
|
|
35508
35114
|
printLine("Next:");
|
|
35509
35115
|
printLine(" t2 fund # add USDC (QR / card link)");
|
|
35510
|
-
printLine("
|
|
35116
|
+
printLine(" npx skills add mission69b/t2000-skills # optional playbooks");
|
|
35511
35117
|
printBlank();
|
|
35512
35118
|
} catch (error) {
|
|
35513
35119
|
handleError(error);
|
|
@@ -35532,13 +35138,12 @@ async function fetchJson3(url, init) {
|
|
|
35532
35138
|
return json;
|
|
35533
35139
|
}
|
|
35534
35140
|
function registerAgent(program3) {
|
|
35535
|
-
const group = program3.command("agent").description("Agent ID \u2014 on-chain identity for this wallet (register \xB7
|
|
35141
|
+
const group = program3.command("agent").description("Agent ID \u2014 on-chain identity for this wallet (register \xB7 profile \xB7 ownership)").addHelpText(
|
|
35536
35142
|
"after",
|
|
35537
35143
|
`
|
|
35538
35144
|
Subcommands:
|
|
35539
35145
|
$ t2 agent create --name "Atlas Research" Wallet + Agent ID + profile in one pass
|
|
35540
35146
|
$ t2 agent register Existing wallet \u2192 on-chain Agent ID (gasless)
|
|
35541
|
-
$ t2 agent handle alice Claim @alice
|
|
35542
35147
|
$ t2 agent sell https://api.me.com/v1/x Sell it as an x402 Service (live-probed, gasless)
|
|
35543
35148
|
`
|
|
35544
35149
|
);
|
|
@@ -35832,49 +35437,6 @@ ${detail}` : msg);
|
|
|
35832
35437
|
}
|
|
35833
35438
|
}
|
|
35834
35439
|
);
|
|
35835
|
-
group.command("handle").argument("<label>", "Handle label (3\u201320 chars: lowercase a\u2013z, 0\u20139, hyphens)").description(
|
|
35836
|
-
"Claim <label>.agent-id.sui \u2192 this wallet (custody-minted, gasless). Use --release to give it up."
|
|
35837
|
-
).option("--release", "Release (revoke) this handle instead of claiming it").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE4})`).action(
|
|
35838
|
-
async (label, opts) => {
|
|
35839
|
-
try {
|
|
35840
|
-
const base = opts.api ?? DEFAULT_API_BASE4;
|
|
35841
|
-
const agent = await withAgent({ keyPath: opts.key });
|
|
35842
|
-
const address = agent.address();
|
|
35843
|
-
const challenge = await fetchJson3(`${base}/agent/challenge`, {
|
|
35844
|
-
method: "POST",
|
|
35845
|
-
body: { address }
|
|
35846
|
-
});
|
|
35847
|
-
const nonce = challenge.nonce;
|
|
35848
|
-
if (!nonce) {
|
|
35849
|
-
throw new Error("Failed to get a challenge nonce.");
|
|
35850
|
-
}
|
|
35851
|
-
const action = opts.release ? "t2000-agent-handle-release" : "t2000-agent-handle";
|
|
35852
|
-
const message = new TextEncoder().encode(`${action}:${nonce}:${label}`);
|
|
35853
|
-
const { signature } = await agent.keypair.signPersonalMessage(message);
|
|
35854
|
-
const path2 = opts.release ? "/agent/handle/release" : "/agent/handle";
|
|
35855
|
-
const res = await fetchJson3(`${base}${path2}`, {
|
|
35856
|
-
method: "POST",
|
|
35857
|
-
body: { address, label, nonce, signature }
|
|
35858
|
-
});
|
|
35859
|
-
if (isJsonMode()) {
|
|
35860
|
-
printJson({ address, ...res });
|
|
35861
|
-
return;
|
|
35862
|
-
}
|
|
35863
|
-
printBlank();
|
|
35864
|
-
if (opts.release) {
|
|
35865
|
-
printSuccess(`Handle released: ${String(res.handle)}`);
|
|
35866
|
-
} else {
|
|
35867
|
-
printSuccess(`Handle claimed: ${String(res.display)}`);
|
|
35868
|
-
printKeyValue("Handle", String(res.handle));
|
|
35869
|
-
}
|
|
35870
|
-
printKeyValue("Address", truncateAddress(address));
|
|
35871
|
-
printKeyValue("Tx", String(res.digest));
|
|
35872
|
-
printBlank();
|
|
35873
|
-
} catch (error) {
|
|
35874
|
-
handleError(error);
|
|
35875
|
-
}
|
|
35876
|
-
}
|
|
35877
|
-
);
|
|
35878
35440
|
}
|
|
35879
35441
|
|
|
35880
35442
|
// src/commands/agents.ts
|
|
@@ -35957,17 +35519,17 @@ function registerAgents(program3) {
|
|
|
35957
35519
|
// src/commands/job.ts
|
|
35958
35520
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
35959
35521
|
import { createHash } from "crypto";
|
|
35960
|
-
import { readFile as
|
|
35522
|
+
import { readFile as readFile4 } from "fs/promises";
|
|
35961
35523
|
|
|
35962
35524
|
// src/commands/open.ts
|
|
35963
35525
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
35964
|
-
import { readFile as
|
|
35526
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
35965
35527
|
var DEFAULT_API_BASE6 = process.env.T2000_API_URL ?? "https://api.t2000.ai/v1";
|
|
35966
35528
|
var MAX_BRIEF_BYTES = 16 * 1024;
|
|
35967
35529
|
async function resolveBrief(input) {
|
|
35968
35530
|
let bytes;
|
|
35969
35531
|
try {
|
|
35970
|
-
bytes = await
|
|
35532
|
+
bytes = await readFile3(input);
|
|
35971
35533
|
} catch {
|
|
35972
35534
|
bytes = Buffer.from(input, "utf8");
|
|
35973
35535
|
}
|
|
@@ -36176,7 +35738,7 @@ async function resolveSpecUpload(base, input) {
|
|
|
36176
35738
|
}
|
|
36177
35739
|
let bytes;
|
|
36178
35740
|
try {
|
|
36179
|
-
bytes = await
|
|
35741
|
+
bytes = await readFile4(input);
|
|
36180
35742
|
} catch {
|
|
36181
35743
|
bytes = Buffer.from(input, "utf8");
|
|
36182
35744
|
}
|
|
@@ -36313,7 +35875,7 @@ no fund step; unclaimed openings refund fee-free):
|
|
|
36313
35875
|
if (opts.requirements) {
|
|
36314
35876
|
let text = opts.requirements;
|
|
36315
35877
|
try {
|
|
36316
|
-
text = await
|
|
35878
|
+
text = await readFile4(opts.requirements, "utf8");
|
|
36317
35879
|
} catch {
|
|
36318
35880
|
}
|
|
36319
35881
|
try {
|
|
@@ -36693,7 +36255,7 @@ no fund step; unclaimed openings refund fee-free):
|
|
|
36693
36255
|
// src/commands/service.ts
|
|
36694
36256
|
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
36695
36257
|
import { createHash as createHash2 } from "crypto";
|
|
36696
|
-
import { readFile as
|
|
36258
|
+
import { readFile as readFile5 } from "fs/promises";
|
|
36697
36259
|
var DEFAULT_API_BASE8 = process.env.T2000_API_URL ?? "https://api.t2000.ai/v1";
|
|
36698
36260
|
async function signedServiceAction(opts) {
|
|
36699
36261
|
const agent = await withAgent({ keyPath: opts.keyPath });
|
|
@@ -36726,7 +36288,7 @@ async function signedServiceAction(opts) {
|
|
|
36726
36288
|
async function resolveRequirements(input) {
|
|
36727
36289
|
let text = input;
|
|
36728
36290
|
try {
|
|
36729
|
-
text = await
|
|
36291
|
+
text = await readFile5(input, "utf8");
|
|
36730
36292
|
} catch {
|
|
36731
36293
|
}
|
|
36732
36294
|
try {
|
|
@@ -36973,7 +36535,7 @@ Connect an AI client:
|
|
|
36973
36535
|
Claude, Cursor, or any MCP client, then approve
|
|
36974
36536
|
with Google \u2014 no install, no key in the client,
|
|
36975
36537
|
spend limits you set.
|
|
36976
|
-
$
|
|
36538
|
+
$ npx skills add mission69b/t2000-skills Optional agent playbooks (GitHub)
|
|
36977
36539
|
|
|
36978
36540
|
Models (Audric \u2014 a separate product, billed in credit):
|
|
36979
36541
|
$ t2 models List the Audric Private Inference model catalog
|
|
@@ -36992,7 +36554,6 @@ Models (Audric \u2014 a separate product, billed in credit):
|
|
|
36992
36554
|
registerServices(program3);
|
|
36993
36555
|
registerLimit(program3);
|
|
36994
36556
|
registerMcp(program3);
|
|
36995
|
-
registerSkills(program3);
|
|
36996
36557
|
registerAgent(program3);
|
|
36997
36558
|
registerAgents(program3);
|
|
36998
36559
|
registerJob(program3);
|