@t2000/cli 10.22.0 → 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/index.js +10 -418
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ t2 agent sell https://api.you.com/v1 # or list your own x402 endpoint (per-call,
|
|
|
38
38
|
**One-prompt install** — paste into any LLM client:
|
|
39
39
|
|
|
40
40
|
```
|
|
41
|
-
Run `
|
|
42
|
-
|
|
41
|
+
Run `npx skills add mission69b/t2000-skills -s t2000-setup` and follow the
|
|
42
|
+
installed skill to set up my Agent Wallet.
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Every command supports `--json` (machine-parseable) and `--key <path>` (custom wallet file).
|
package/dist/index.js
CHANGED
|
@@ -30788,7 +30788,6 @@ 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
30792
|
|
|
30794
30793
|
// ../../node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@20.19.37/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
@@ -34911,368 +34910,6 @@ function registerMcp(program3) {
|
|
|
34911
34910
|
registerMcpUninstall(group);
|
|
34912
34911
|
}
|
|
34913
34912
|
|
|
34914
|
-
// src/commands/skills/check.ts
|
|
34915
|
-
import { readdir, readFile as readFile3 } from "fs/promises";
|
|
34916
|
-
import { join as join7 } from "path";
|
|
34917
|
-
|
|
34918
|
-
// src/commands/skills/lib.ts
|
|
34919
|
-
import { stat } from "fs/promises";
|
|
34920
|
-
import { join as join6 } from "path";
|
|
34921
|
-
import { homedir as homedir5 } from "os";
|
|
34922
|
-
var MANIFEST_URL = "https://t2000.ai/.well-known/agent-skills/index.json";
|
|
34923
|
-
var SKILL_PREFIXES = ["t2000-", "mpp-"];
|
|
34924
|
-
function isManagedSkillName(name) {
|
|
34925
|
-
return SKILL_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
34926
|
-
}
|
|
34927
|
-
var SKILL_TARGETS = ["agents", "cursor", "claude-code"];
|
|
34928
|
-
function resolveTargetDir(target, useGlobal, cwd = process.cwd()) {
|
|
34929
|
-
const root = useGlobal ? homedir5() : cwd;
|
|
34930
|
-
switch (target) {
|
|
34931
|
-
case "agents":
|
|
34932
|
-
return join6(root, ".agents", "skills");
|
|
34933
|
-
case "cursor":
|
|
34934
|
-
return join6(root, ".cursor", "rules");
|
|
34935
|
-
case "claude-code":
|
|
34936
|
-
return join6(root, ".claude", "skills");
|
|
34937
|
-
}
|
|
34938
|
-
}
|
|
34939
|
-
function filenameForTarget(slug, target) {
|
|
34940
|
-
switch (target) {
|
|
34941
|
-
case "agents":
|
|
34942
|
-
case "claude-code":
|
|
34943
|
-
return join6(slug, "SKILL.md");
|
|
34944
|
-
case "cursor":
|
|
34945
|
-
return `${slug}.mdc`;
|
|
34946
|
-
}
|
|
34947
|
-
}
|
|
34948
|
-
function transformForTarget(content, target, description) {
|
|
34949
|
-
if (target !== "cursor") return content;
|
|
34950
|
-
const stripped = content.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/, "");
|
|
34951
|
-
const safeDescription = JSON.stringify(description);
|
|
34952
|
-
return `---
|
|
34953
|
-
description: ${safeDescription}
|
|
34954
|
-
alwaysApply: false
|
|
34955
|
-
---
|
|
34956
|
-
${stripped}`;
|
|
34957
|
-
}
|
|
34958
|
-
function resolveSkillTarget(input) {
|
|
34959
|
-
const value = input ?? "agents";
|
|
34960
|
-
const match = SKILL_TARGETS.find((t) => t === value);
|
|
34961
|
-
if (!match) {
|
|
34962
|
-
throw new Error(`--target must be one of: ${SKILL_TARGETS.join(", ")}. Got: "${value}"`);
|
|
34963
|
-
}
|
|
34964
|
-
return match;
|
|
34965
|
-
}
|
|
34966
|
-
async function fetchManifest() {
|
|
34967
|
-
const res = await fetch(MANIFEST_URL);
|
|
34968
|
-
if (!res.ok) {
|
|
34969
|
-
throw new Error(
|
|
34970
|
-
`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.`
|
|
34971
|
-
);
|
|
34972
|
-
}
|
|
34973
|
-
return await res.json();
|
|
34974
|
-
}
|
|
34975
|
-
async function fetchSkill(url) {
|
|
34976
|
-
const res = await fetch(url);
|
|
34977
|
-
if (!res.ok) {
|
|
34978
|
-
throw new Error(`Failed to fetch skill ${url} (${res.status} ${res.statusText})`);
|
|
34979
|
-
}
|
|
34980
|
-
return await res.text();
|
|
34981
|
-
}
|
|
34982
|
-
async function dirExists(path2) {
|
|
34983
|
-
try {
|
|
34984
|
-
const s = await stat(path2);
|
|
34985
|
-
return s.isDirectory();
|
|
34986
|
-
} catch {
|
|
34987
|
-
return false;
|
|
34988
|
-
}
|
|
34989
|
-
}
|
|
34990
|
-
|
|
34991
|
-
// src/commands/skills/check.ts
|
|
34992
|
-
function slugFromEntry(entry, target) {
|
|
34993
|
-
return target === "cursor" ? entry.replace(/\.mdc$/, "") : entry;
|
|
34994
|
-
}
|
|
34995
|
-
async function installedSlugs(dir, target) {
|
|
34996
|
-
try {
|
|
34997
|
-
const entries = await readdir(dir);
|
|
34998
|
-
return entries.map((e) => slugFromEntry(e, target)).filter((slug) => isManagedSkillName(slug));
|
|
34999
|
-
} catch {
|
|
35000
|
-
return [];
|
|
35001
|
-
}
|
|
35002
|
-
}
|
|
35003
|
-
function classifyContent(installed, served) {
|
|
35004
|
-
if (served === null) {
|
|
35005
|
-
return "retired";
|
|
35006
|
-
}
|
|
35007
|
-
return installed.trim() === served.trim() ? "up-to-date" : "drifted";
|
|
35008
|
-
}
|
|
35009
|
-
async function checkTargetScope(manifest, servedCache, target, scope) {
|
|
35010
|
-
const dir = resolveTargetDir(target, scope === "global");
|
|
35011
|
-
if (!await dirExists(dir)) {
|
|
35012
|
-
return [];
|
|
35013
|
-
}
|
|
35014
|
-
const slugs = await installedSlugs(dir, target);
|
|
35015
|
-
const rows = [];
|
|
35016
|
-
for (const slug of slugs) {
|
|
35017
|
-
const path2 = join7(dir, filenameForTarget(slug, target));
|
|
35018
|
-
let installed;
|
|
35019
|
-
try {
|
|
35020
|
-
installed = await readFile3(path2, "utf-8");
|
|
35021
|
-
} catch {
|
|
35022
|
-
continue;
|
|
35023
|
-
}
|
|
35024
|
-
const entry = manifest.skills.find((s) => s.name === slug);
|
|
35025
|
-
let served = null;
|
|
35026
|
-
if (entry) {
|
|
35027
|
-
const cacheKey = `${target}:${slug}`;
|
|
35028
|
-
const cached = servedCache.get(cacheKey);
|
|
35029
|
-
if (cached !== void 0) {
|
|
35030
|
-
served = cached;
|
|
35031
|
-
} else {
|
|
35032
|
-
const raw = await fetchSkill(entry.url);
|
|
35033
|
-
served = transformForTarget(raw, target, entry.description);
|
|
35034
|
-
servedCache.set(cacheKey, served);
|
|
35035
|
-
}
|
|
35036
|
-
}
|
|
35037
|
-
rows.push({
|
|
35038
|
-
name: slug,
|
|
35039
|
-
target,
|
|
35040
|
-
scope,
|
|
35041
|
-
path: path2,
|
|
35042
|
-
status: classifyContent(installed, served)
|
|
35043
|
-
});
|
|
35044
|
-
}
|
|
35045
|
-
return rows;
|
|
35046
|
-
}
|
|
35047
|
-
function registerSkillsCheck(parent) {
|
|
35048
|
-
parent.command("check").description(
|
|
35049
|
-
"Compare installed skills against what t2000.ai serves \u2014 { upToDate, action } for agents"
|
|
35050
|
-
).option(
|
|
35051
|
-
"--target <name>",
|
|
35052
|
-
"Only check one target layout: agents, cursor, claude-code (default: all)"
|
|
35053
|
-
).action(async (opts) => {
|
|
35054
|
-
try {
|
|
35055
|
-
const targets = opts.target ? [
|
|
35056
|
-
(() => {
|
|
35057
|
-
const match = SKILL_TARGETS.find((t) => t === opts.target);
|
|
35058
|
-
if (!match) {
|
|
35059
|
-
throw new Error(
|
|
35060
|
-
`--target must be one of: ${SKILL_TARGETS.join(", ")}. Got: "${opts.target}"`
|
|
35061
|
-
);
|
|
35062
|
-
}
|
|
35063
|
-
return match;
|
|
35064
|
-
})()
|
|
35065
|
-
] : SKILL_TARGETS;
|
|
35066
|
-
const manifest = await fetchManifest();
|
|
35067
|
-
const servedCache = /* @__PURE__ */ new Map();
|
|
35068
|
-
const rows = [];
|
|
35069
|
-
for (const target of targets) {
|
|
35070
|
-
rows.push(
|
|
35071
|
-
...await checkTargetScope(manifest, servedCache, target, "local"),
|
|
35072
|
-
...await checkTargetScope(manifest, servedCache, target, "global")
|
|
35073
|
-
);
|
|
35074
|
-
}
|
|
35075
|
-
const stale = rows.filter((r) => r.status !== "up-to-date");
|
|
35076
|
-
const upToDate = rows.length > 0 && stale.length === 0;
|
|
35077
|
-
if (isJsonMode()) {
|
|
35078
|
-
printJson({
|
|
35079
|
-
upToDate: rows.length === 0 ? true : upToDate,
|
|
35080
|
-
installed: rows.length,
|
|
35081
|
-
manifestVersion: manifest.version,
|
|
35082
|
-
skills: rows,
|
|
35083
|
-
action: stale.length > 0 ? "t2 skills install" : void 0
|
|
35084
|
-
});
|
|
35085
|
-
return;
|
|
35086
|
-
}
|
|
35087
|
-
printBlank();
|
|
35088
|
-
if (rows.length === 0) {
|
|
35089
|
-
printInfo(
|
|
35090
|
-
"No installed skills found (checked ./ and ~/ for .agents/skills, .cursor/rules, .claude/skills)."
|
|
35091
|
-
);
|
|
35092
|
-
printInfo("Install: t2 skills install \xB7 MCP clients get skills via mcp.t2000.ai (no files, always fresh)");
|
|
35093
|
-
printBlank();
|
|
35094
|
-
return;
|
|
35095
|
-
}
|
|
35096
|
-
for (const r of rows) {
|
|
35097
|
-
const mark = r.status === "up-to-date" ? "\u2713" : r.status === "drifted" ? "\u21BB" : "\u2717";
|
|
35098
|
-
console.log(` ${mark} ${r.name} [${r.target} \xB7 ${r.scope}] ${r.status}`);
|
|
35099
|
-
}
|
|
35100
|
-
printBlank();
|
|
35101
|
-
if (upToDate) {
|
|
35102
|
-
printSuccess(`All ${rows.length} installed skills match what t2000.ai serves.`);
|
|
35103
|
-
} else {
|
|
35104
|
-
printInfo(
|
|
35105
|
-
`${stale.length} of ${rows.length} installed skills are stale \u2014 refresh with: t2 skills install`
|
|
35106
|
-
);
|
|
35107
|
-
if (stale.some((r) => r.status === "retired")) {
|
|
35108
|
-
printInfo("(\u2717 retired = no longer in the manifest \u2014 remove with: t2 skills uninstall)");
|
|
35109
|
-
}
|
|
35110
|
-
}
|
|
35111
|
-
printBlank();
|
|
35112
|
-
} catch (err) {
|
|
35113
|
-
handleError(err);
|
|
35114
|
-
}
|
|
35115
|
-
});
|
|
35116
|
-
}
|
|
35117
|
-
|
|
35118
|
-
// src/commands/skills/list.ts
|
|
35119
|
-
function registerSkillsList(parent) {
|
|
35120
|
-
parent.command("list").description("List skills available from t2000.ai (core t2000 + MPP recipes)").action(async () => {
|
|
35121
|
-
try {
|
|
35122
|
-
const manifest = await fetchManifest();
|
|
35123
|
-
if (isJsonMode()) {
|
|
35124
|
-
printJson({ skills: manifest.skills });
|
|
35125
|
-
return;
|
|
35126
|
-
}
|
|
35127
|
-
printBlank();
|
|
35128
|
-
printInfo(`${manifest.skills.length} skills available:`);
|
|
35129
|
-
printBlank();
|
|
35130
|
-
for (const s of manifest.skills) {
|
|
35131
|
-
console.log(` ${s.name.padEnd(28)} v${s.version}`);
|
|
35132
|
-
}
|
|
35133
|
-
printBlank();
|
|
35134
|
-
printInfo("Install all: t2 skills install");
|
|
35135
|
-
printInfo("Install one: t2 skills install <name>");
|
|
35136
|
-
printBlank();
|
|
35137
|
-
} catch (err) {
|
|
35138
|
-
handleError(err);
|
|
35139
|
-
}
|
|
35140
|
-
});
|
|
35141
|
-
}
|
|
35142
|
-
|
|
35143
|
-
// src/commands/skills/install.ts
|
|
35144
|
-
import { writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
35145
|
-
import { join as join8 } from "path";
|
|
35146
|
-
function registerSkillsInstall(parent) {
|
|
35147
|
-
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) => {
|
|
35148
|
-
try {
|
|
35149
|
-
const target = resolveSkillTarget(opts.target);
|
|
35150
|
-
const useGlobal = opts.global === true;
|
|
35151
|
-
const manifest = await fetchManifest();
|
|
35152
|
-
const toInstall = slug ? manifest.skills.filter((s) => s.name === slug) : manifest.skills;
|
|
35153
|
-
if (toInstall.length === 0) {
|
|
35154
|
-
const available = manifest.skills.map((s) => s.name).join(", ");
|
|
35155
|
-
throw new Error(
|
|
35156
|
-
slug ? `Unknown skill: "${slug}". Available: ${available}` : "No skills found in manifest"
|
|
35157
|
-
);
|
|
35158
|
-
}
|
|
35159
|
-
const targetDir = resolveTargetDir(target, useGlobal);
|
|
35160
|
-
await mkdir3(targetDir, { recursive: true });
|
|
35161
|
-
const installed = [];
|
|
35162
|
-
for (const s of toInstall) {
|
|
35163
|
-
const raw = await fetchSkill(s.url);
|
|
35164
|
-
const transformed = transformForTarget(raw, target, s.description);
|
|
35165
|
-
const relPath = filenameForTarget(s.name, target);
|
|
35166
|
-
const fullPath = join8(targetDir, relPath);
|
|
35167
|
-
await mkdir3(join8(fullPath, ".."), { recursive: true });
|
|
35168
|
-
await writeFile3(fullPath, transformed, "utf-8");
|
|
35169
|
-
installed.push({ name: s.name, path: fullPath });
|
|
35170
|
-
}
|
|
35171
|
-
if (isJsonMode()) {
|
|
35172
|
-
printJson({ target, global: useGlobal, targetDir, installed });
|
|
35173
|
-
return;
|
|
35174
|
-
}
|
|
35175
|
-
printBlank();
|
|
35176
|
-
printSuccess(
|
|
35177
|
-
`Installed ${installed.length} skill${installed.length === 1 ? "" : "s"} into ${targetDir}`
|
|
35178
|
-
);
|
|
35179
|
-
for (const r of installed) {
|
|
35180
|
-
console.log(` ${r.name}`);
|
|
35181
|
-
}
|
|
35182
|
-
printBlank();
|
|
35183
|
-
printInfo("Reload your AI client to pick up the new skill files.");
|
|
35184
|
-
if (target !== "cursor") {
|
|
35185
|
-
printInfo("(Clients connected to mcp.t2000.ai already have these as /skill-<name> prompts.)");
|
|
35186
|
-
}
|
|
35187
|
-
printBlank();
|
|
35188
|
-
} catch (err) {
|
|
35189
|
-
handleError(err);
|
|
35190
|
-
}
|
|
35191
|
-
});
|
|
35192
|
-
}
|
|
35193
|
-
|
|
35194
|
-
// src/commands/skills/uninstall.ts
|
|
35195
|
-
import { readdir as readdir2, unlink, rmdir } from "fs/promises";
|
|
35196
|
-
import { join as join9 } from "path";
|
|
35197
|
-
function registerSkillsUninstall(parent) {
|
|
35198
|
-
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) => {
|
|
35199
|
-
try {
|
|
35200
|
-
const target = resolveSkillTarget(opts.target);
|
|
35201
|
-
const useGlobal = opts.global === true;
|
|
35202
|
-
const targetDir = resolveTargetDir(target, useGlobal);
|
|
35203
|
-
if (!await dirExists(targetDir)) {
|
|
35204
|
-
if (isJsonMode()) {
|
|
35205
|
-
printJson({ target, targetDir, removed: [] });
|
|
35206
|
-
return;
|
|
35207
|
-
}
|
|
35208
|
-
printInfo(`No skills installed at ${targetDir}`);
|
|
35209
|
-
return;
|
|
35210
|
-
}
|
|
35211
|
-
const entries = await readdir2(targetDir);
|
|
35212
|
-
const removed = [];
|
|
35213
|
-
for (const entry of entries) {
|
|
35214
|
-
const full = join9(targetDir, entry);
|
|
35215
|
-
if (target === "cursor") {
|
|
35216
|
-
const slug = entry.endsWith(".mdc") ? entry.slice(0, -".mdc".length) : entry;
|
|
35217
|
-
if (entry.endsWith(".mdc") && isManagedSkillName(slug)) {
|
|
35218
|
-
await unlink(full);
|
|
35219
|
-
removed.push(entry);
|
|
35220
|
-
}
|
|
35221
|
-
} else {
|
|
35222
|
-
if (isManagedSkillName(entry)) {
|
|
35223
|
-
const skillFile = join9(full, "SKILL.md");
|
|
35224
|
-
try {
|
|
35225
|
-
await unlink(skillFile);
|
|
35226
|
-
} catch {
|
|
35227
|
-
}
|
|
35228
|
-
try {
|
|
35229
|
-
await rmdir(full);
|
|
35230
|
-
} catch {
|
|
35231
|
-
}
|
|
35232
|
-
removed.push(entry);
|
|
35233
|
-
}
|
|
35234
|
-
}
|
|
35235
|
-
}
|
|
35236
|
-
if (isJsonMode()) {
|
|
35237
|
-
printJson({ target, targetDir, removed });
|
|
35238
|
-
return;
|
|
35239
|
-
}
|
|
35240
|
-
printBlank();
|
|
35241
|
-
if (removed.length === 0) {
|
|
35242
|
-
printInfo(`No managed skills found in ${targetDir}`);
|
|
35243
|
-
} else {
|
|
35244
|
-
printSuccess(`Removed ${removed.length} skill${removed.length === 1 ? "" : "s"} from ${targetDir}`);
|
|
35245
|
-
}
|
|
35246
|
-
printBlank();
|
|
35247
|
-
} catch (err) {
|
|
35248
|
-
handleError(err);
|
|
35249
|
-
}
|
|
35250
|
-
});
|
|
35251
|
-
}
|
|
35252
|
-
|
|
35253
|
-
// src/commands/skills/index.ts
|
|
35254
|
-
function registerSkills(program3) {
|
|
35255
|
-
const group = program3.command("skills").description("Install agent SKILL.md playbooks locally").addHelpText(
|
|
35256
|
-
"after",
|
|
35257
|
-
`
|
|
35258
|
-
Subcommands:
|
|
35259
|
-
$ t2 skills list List available skills
|
|
35260
|
-
$ t2 skills install Install all skills (default target: agents)
|
|
35261
|
-
$ t2 skills install <slug> Install one skill by name
|
|
35262
|
-
$ t2 skills install --target cursor Install as Cursor .mdc rules
|
|
35263
|
-
$ t2 skills check Are installed skills current? (agents: run at session start)
|
|
35264
|
-
$ t2 skills uninstall Remove installed skills
|
|
35265
|
-
|
|
35266
|
-
MCP clients connected to https://mcp.t2000.ai/mcp get every skill as a
|
|
35267
|
-
\`/skill-<name>\` prompt automatically \u2014 no local files needed.
|
|
35268
|
-
`
|
|
35269
|
-
);
|
|
35270
|
-
registerSkillsList(group);
|
|
35271
|
-
registerSkillsInstall(group);
|
|
35272
|
-
registerSkillsCheck(group);
|
|
35273
|
-
registerSkillsUninstall(group);
|
|
35274
|
-
}
|
|
35275
|
-
|
|
35276
34913
|
// src/lib/agent-category.ts
|
|
35277
34914
|
var AGENT_CATEGORIES = [
|
|
35278
34915
|
"ai-models",
|
|
@@ -35476,7 +35113,7 @@ function registerAgentCreate(group) {
|
|
|
35476
35113
|
printBlank();
|
|
35477
35114
|
printLine("Next:");
|
|
35478
35115
|
printLine(" t2 fund # add USDC (QR / card link)");
|
|
35479
|
-
printLine("
|
|
35116
|
+
printLine(" npx skills add mission69b/t2000-skills # optional playbooks");
|
|
35480
35117
|
printBlank();
|
|
35481
35118
|
} catch (error) {
|
|
35482
35119
|
handleError(error);
|
|
@@ -35501,13 +35138,12 @@ async function fetchJson3(url, init) {
|
|
|
35501
35138
|
return json;
|
|
35502
35139
|
}
|
|
35503
35140
|
function registerAgent(program3) {
|
|
35504
|
-
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(
|
|
35505
35142
|
"after",
|
|
35506
35143
|
`
|
|
35507
35144
|
Subcommands:
|
|
35508
35145
|
$ t2 agent create --name "Atlas Research" Wallet + Agent ID + profile in one pass
|
|
35509
35146
|
$ t2 agent register Existing wallet \u2192 on-chain Agent ID (gasless)
|
|
35510
|
-
$ t2 agent handle alice Claim @alice
|
|
35511
35147
|
$ t2 agent sell https://api.me.com/v1/x Sell it as an x402 Service (live-probed, gasless)
|
|
35512
35148
|
`
|
|
35513
35149
|
);
|
|
@@ -35801,49 +35437,6 @@ ${detail}` : msg);
|
|
|
35801
35437
|
}
|
|
35802
35438
|
}
|
|
35803
35439
|
);
|
|
35804
|
-
group.command("handle").argument("<label>", "Handle label (3\u201320 chars: lowercase a\u2013z, 0\u20139, hyphens)").description(
|
|
35805
|
-
"Claim <label>.agent-id.sui \u2192 this wallet (custody-minted, gasless). Use --release to give it up."
|
|
35806
|
-
).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(
|
|
35807
|
-
async (label, opts) => {
|
|
35808
|
-
try {
|
|
35809
|
-
const base = opts.api ?? DEFAULT_API_BASE4;
|
|
35810
|
-
const agent = await withAgent({ keyPath: opts.key });
|
|
35811
|
-
const address = agent.address();
|
|
35812
|
-
const challenge = await fetchJson3(`${base}/agent/challenge`, {
|
|
35813
|
-
method: "POST",
|
|
35814
|
-
body: { address }
|
|
35815
|
-
});
|
|
35816
|
-
const nonce = challenge.nonce;
|
|
35817
|
-
if (!nonce) {
|
|
35818
|
-
throw new Error("Failed to get a challenge nonce.");
|
|
35819
|
-
}
|
|
35820
|
-
const action = opts.release ? "t2000-agent-handle-release" : "t2000-agent-handle";
|
|
35821
|
-
const message = new TextEncoder().encode(`${action}:${nonce}:${label}`);
|
|
35822
|
-
const { signature } = await agent.keypair.signPersonalMessage(message);
|
|
35823
|
-
const path2 = opts.release ? "/agent/handle/release" : "/agent/handle";
|
|
35824
|
-
const res = await fetchJson3(`${base}${path2}`, {
|
|
35825
|
-
method: "POST",
|
|
35826
|
-
body: { address, label, nonce, signature }
|
|
35827
|
-
});
|
|
35828
|
-
if (isJsonMode()) {
|
|
35829
|
-
printJson({ address, ...res });
|
|
35830
|
-
return;
|
|
35831
|
-
}
|
|
35832
|
-
printBlank();
|
|
35833
|
-
if (opts.release) {
|
|
35834
|
-
printSuccess(`Handle released: ${String(res.handle)}`);
|
|
35835
|
-
} else {
|
|
35836
|
-
printSuccess(`Handle claimed: ${String(res.display)}`);
|
|
35837
|
-
printKeyValue("Handle", String(res.handle));
|
|
35838
|
-
}
|
|
35839
|
-
printKeyValue("Address", truncateAddress(address));
|
|
35840
|
-
printKeyValue("Tx", String(res.digest));
|
|
35841
|
-
printBlank();
|
|
35842
|
-
} catch (error) {
|
|
35843
|
-
handleError(error);
|
|
35844
|
-
}
|
|
35845
|
-
}
|
|
35846
|
-
);
|
|
35847
35440
|
}
|
|
35848
35441
|
|
|
35849
35442
|
// src/commands/agents.ts
|
|
@@ -35926,17 +35519,17 @@ function registerAgents(program3) {
|
|
|
35926
35519
|
// src/commands/job.ts
|
|
35927
35520
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
35928
35521
|
import { createHash } from "crypto";
|
|
35929
|
-
import { readFile as
|
|
35522
|
+
import { readFile as readFile4 } from "fs/promises";
|
|
35930
35523
|
|
|
35931
35524
|
// src/commands/open.ts
|
|
35932
35525
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
35933
|
-
import { readFile as
|
|
35526
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
35934
35527
|
var DEFAULT_API_BASE6 = process.env.T2000_API_URL ?? "https://api.t2000.ai/v1";
|
|
35935
35528
|
var MAX_BRIEF_BYTES = 16 * 1024;
|
|
35936
35529
|
async function resolveBrief(input) {
|
|
35937
35530
|
let bytes;
|
|
35938
35531
|
try {
|
|
35939
|
-
bytes = await
|
|
35532
|
+
bytes = await readFile3(input);
|
|
35940
35533
|
} catch {
|
|
35941
35534
|
bytes = Buffer.from(input, "utf8");
|
|
35942
35535
|
}
|
|
@@ -36145,7 +35738,7 @@ async function resolveSpecUpload(base, input) {
|
|
|
36145
35738
|
}
|
|
36146
35739
|
let bytes;
|
|
36147
35740
|
try {
|
|
36148
|
-
bytes = await
|
|
35741
|
+
bytes = await readFile4(input);
|
|
36149
35742
|
} catch {
|
|
36150
35743
|
bytes = Buffer.from(input, "utf8");
|
|
36151
35744
|
}
|
|
@@ -36282,7 +35875,7 @@ no fund step; unclaimed openings refund fee-free):
|
|
|
36282
35875
|
if (opts.requirements) {
|
|
36283
35876
|
let text = opts.requirements;
|
|
36284
35877
|
try {
|
|
36285
|
-
text = await
|
|
35878
|
+
text = await readFile4(opts.requirements, "utf8");
|
|
36286
35879
|
} catch {
|
|
36287
35880
|
}
|
|
36288
35881
|
try {
|
|
@@ -36662,7 +36255,7 @@ no fund step; unclaimed openings refund fee-free):
|
|
|
36662
36255
|
// src/commands/service.ts
|
|
36663
36256
|
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
36664
36257
|
import { createHash as createHash2 } from "crypto";
|
|
36665
|
-
import { readFile as
|
|
36258
|
+
import { readFile as readFile5 } from "fs/promises";
|
|
36666
36259
|
var DEFAULT_API_BASE8 = process.env.T2000_API_URL ?? "https://api.t2000.ai/v1";
|
|
36667
36260
|
async function signedServiceAction(opts) {
|
|
36668
36261
|
const agent = await withAgent({ keyPath: opts.keyPath });
|
|
@@ -36695,7 +36288,7 @@ async function signedServiceAction(opts) {
|
|
|
36695
36288
|
async function resolveRequirements(input) {
|
|
36696
36289
|
let text = input;
|
|
36697
36290
|
try {
|
|
36698
|
-
text = await
|
|
36291
|
+
text = await readFile5(input, "utf8");
|
|
36699
36292
|
} catch {
|
|
36700
36293
|
}
|
|
36701
36294
|
try {
|
|
@@ -36942,7 +36535,7 @@ Connect an AI client:
|
|
|
36942
36535
|
Claude, Cursor, or any MCP client, then approve
|
|
36943
36536
|
with Google \u2014 no install, no key in the client,
|
|
36944
36537
|
spend limits you set.
|
|
36945
|
-
$
|
|
36538
|
+
$ npx skills add mission69b/t2000-skills Optional agent playbooks (GitHub)
|
|
36946
36539
|
|
|
36947
36540
|
Models (Audric \u2014 a separate product, billed in credit):
|
|
36948
36541
|
$ t2 models List the Audric Private Inference model catalog
|
|
@@ -36961,7 +36554,6 @@ Models (Audric \u2014 a separate product, billed in credit):
|
|
|
36961
36554
|
registerServices(program3);
|
|
36962
36555
|
registerLimit(program3);
|
|
36963
36556
|
registerMcp(program3);
|
|
36964
|
-
registerSkills(program3);
|
|
36965
36557
|
registerAgent(program3);
|
|
36966
36558
|
registerAgents(program3);
|
|
36967
36559
|
registerJob(program3);
|