@t2000/cli 5.27.0 → 5.28.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.
@@ -99462,7 +99462,7 @@ The wallet can also HIRE OTHER AGENTS: the agent store (agents.t2000.ai) lists a
99462
99462
  The wallet can EARN too: t2000_tasks lists live reward tasks + the community task board, t2000_task_claim collects auto-verified rewards, t2000_task_submit submits proof on board jobs, and t2000_agent_earnings reports the wallet's seller sales. None of these spend \u2014 claims RECEIVE USDC through the rail (see the skill-earn prompt or the t2000-earn skill).
99463
99463
 
99464
99464
  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.`;
99465
- var PKG_VERSION = "5.27.0";
99465
+ var PKG_VERSION = "5.28.0";
99466
99466
  console.log = (...args) => console.error("[log]", ...args);
99467
99467
  console.warn = (...args) => console.error("[warn]", ...args);
99468
99468
  async function startMcpServer(opts) {
@@ -99537,4 +99537,4 @@ mime-types/index.js:
99537
99537
  @scure/bip39/index.js:
99538
99538
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
99539
99539
  */
99540
- //# sourceMappingURL=dist-JCY6PNWP.js.map
99540
+ //# sourceMappingURL=dist-7BWQQOS6.js.map
package/dist/index.js CHANGED
@@ -33115,7 +33115,7 @@ function registerMcpStart(parent) {
33115
33115
  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) => {
33116
33116
  let mod3;
33117
33117
  try {
33118
- mod3 = await import("./dist-JCY6PNWP.js");
33118
+ mod3 = await import("./dist-7BWQQOS6.js");
33119
33119
  } catch {
33120
33120
  console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
33121
33121
  process.exit(1);
@@ -33225,6 +33225,10 @@ Subcommands:
33225
33225
  registerMcpUninstall(group);
33226
33226
  }
33227
33227
 
33228
+ // src/commands/skills/check.ts
33229
+ import { readdir, readFile as readFile3 } from "fs/promises";
33230
+ import { join as join5 } from "path";
33231
+
33228
33232
  // src/commands/skills/lib.ts
33229
33233
  import { stat } from "fs/promises";
33230
33234
  import { join as join4 } from "path";
@@ -33298,6 +33302,133 @@ async function dirExists(path2) {
33298
33302
  }
33299
33303
  }
33300
33304
 
33305
+ // src/commands/skills/check.ts
33306
+ function slugFromEntry(entry, target) {
33307
+ return target === "cursor" ? entry.replace(/\.mdc$/, "") : entry;
33308
+ }
33309
+ async function installedSlugs(dir, target) {
33310
+ try {
33311
+ const entries = await readdir(dir);
33312
+ return entries.map((e) => slugFromEntry(e, target)).filter((slug) => isManagedSkillName(slug));
33313
+ } catch {
33314
+ return [];
33315
+ }
33316
+ }
33317
+ function classifyContent(installed, served) {
33318
+ if (served === null) {
33319
+ return "retired";
33320
+ }
33321
+ return installed.trim() === served.trim() ? "up-to-date" : "drifted";
33322
+ }
33323
+ async function checkTargetScope(manifest, servedCache, target, scope) {
33324
+ const dir = resolveTargetDir(target, scope === "global");
33325
+ if (!await dirExists(dir)) {
33326
+ return [];
33327
+ }
33328
+ const slugs = await installedSlugs(dir, target);
33329
+ const rows = [];
33330
+ for (const slug of slugs) {
33331
+ const path2 = join5(dir, filenameForTarget(slug, target));
33332
+ let installed;
33333
+ try {
33334
+ installed = await readFile3(path2, "utf-8");
33335
+ } catch {
33336
+ continue;
33337
+ }
33338
+ const entry = manifest.skills.find((s) => s.name === slug);
33339
+ let served = null;
33340
+ if (entry) {
33341
+ const cacheKey = `${target}:${slug}`;
33342
+ const cached = servedCache.get(cacheKey);
33343
+ if (cached !== void 0) {
33344
+ served = cached;
33345
+ } else {
33346
+ const raw = await fetchSkill(entry.url);
33347
+ served = transformForTarget(raw, target, entry.description);
33348
+ servedCache.set(cacheKey, served);
33349
+ }
33350
+ }
33351
+ rows.push({
33352
+ name: slug,
33353
+ target,
33354
+ scope,
33355
+ path: path2,
33356
+ status: classifyContent(installed, served)
33357
+ });
33358
+ }
33359
+ return rows;
33360
+ }
33361
+ function registerSkillsCheck(parent) {
33362
+ parent.command("check").description(
33363
+ "Compare installed skills against what t2000.ai serves \u2014 { upToDate, action } for agents"
33364
+ ).option(
33365
+ "--target <name>",
33366
+ "Only check one target layout: agents, cursor, claude-code (default: all)"
33367
+ ).action(async (opts) => {
33368
+ try {
33369
+ const targets = opts.target ? [
33370
+ (() => {
33371
+ const match = SKILL_TARGETS.find((t) => t === opts.target);
33372
+ if (!match) {
33373
+ throw new Error(
33374
+ `--target must be one of: ${SKILL_TARGETS.join(", ")}. Got: "${opts.target}"`
33375
+ );
33376
+ }
33377
+ return match;
33378
+ })()
33379
+ ] : SKILL_TARGETS;
33380
+ const manifest = await fetchManifest();
33381
+ const servedCache = /* @__PURE__ */ new Map();
33382
+ const rows = [];
33383
+ for (const target of targets) {
33384
+ rows.push(
33385
+ ...await checkTargetScope(manifest, servedCache, target, "local"),
33386
+ ...await checkTargetScope(manifest, servedCache, target, "global")
33387
+ );
33388
+ }
33389
+ const stale = rows.filter((r) => r.status !== "up-to-date");
33390
+ const upToDate = rows.length > 0 && stale.length === 0;
33391
+ if (isJsonMode()) {
33392
+ printJson({
33393
+ upToDate: rows.length === 0 ? true : upToDate,
33394
+ installed: rows.length,
33395
+ manifestVersion: manifest.version,
33396
+ skills: rows,
33397
+ action: stale.length > 0 ? "t2 skills install" : void 0
33398
+ });
33399
+ return;
33400
+ }
33401
+ printBlank();
33402
+ if (rows.length === 0) {
33403
+ printInfo(
33404
+ "No installed skills found (checked ./ and ~/ for .agents/skills, .cursor/rules, .claude/skills)."
33405
+ );
33406
+ printInfo("Install: t2 skills install \xB7 MCP clients: t2 mcp install (no files, always fresh)");
33407
+ printBlank();
33408
+ return;
33409
+ }
33410
+ for (const r of rows) {
33411
+ const mark2 = r.status === "up-to-date" ? "\u2713" : r.status === "drifted" ? "\u21BB" : "\u2717";
33412
+ console.log(` ${mark2} ${r.name} [${r.target} \xB7 ${r.scope}] ${r.status}`);
33413
+ }
33414
+ printBlank();
33415
+ if (upToDate) {
33416
+ printSuccess(`All ${rows.length} installed skills match what t2000.ai serves.`);
33417
+ } else {
33418
+ printInfo(
33419
+ `${stale.length} of ${rows.length} installed skills are stale \u2014 refresh with: t2 skills install`
33420
+ );
33421
+ if (stale.some((r) => r.status === "retired")) {
33422
+ printInfo("(\u2717 retired = no longer in the manifest \u2014 remove with: t2 skills uninstall)");
33423
+ }
33424
+ }
33425
+ printBlank();
33426
+ } catch (err) {
33427
+ handleError(err);
33428
+ }
33429
+ });
33430
+ }
33431
+
33301
33432
  // src/commands/skills/list.ts
33302
33433
  function registerSkillsList(parent) {
33303
33434
  parent.command("list").description("List skills available from t2000.ai (core t2000 + MPP recipes)").action(async () => {
@@ -33325,7 +33456,7 @@ function registerSkillsList(parent) {
33325
33456
 
33326
33457
  // src/commands/skills/install.ts
33327
33458
  import { writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
33328
- import { join as join5 } from "path";
33459
+ import { join as join6 } from "path";
33329
33460
  function registerSkillsInstall(parent) {
33330
33461
  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) => {
33331
33462
  try {
@@ -33346,8 +33477,8 @@ function registerSkillsInstall(parent) {
33346
33477
  const raw = await fetchSkill(s.url);
33347
33478
  const transformed = transformForTarget(raw, target, s.description);
33348
33479
  const relPath = filenameForTarget(s.name, target);
33349
- const fullPath = join5(targetDir, relPath);
33350
- await mkdir3(join5(fullPath, ".."), { recursive: true });
33480
+ const fullPath = join6(targetDir, relPath);
33481
+ await mkdir3(join6(fullPath, ".."), { recursive: true });
33351
33482
  await writeFile3(fullPath, transformed, "utf-8");
33352
33483
  installed.push({ name: s.name, path: fullPath });
33353
33484
  }
@@ -33375,8 +33506,8 @@ function registerSkillsInstall(parent) {
33375
33506
  }
33376
33507
 
33377
33508
  // src/commands/skills/uninstall.ts
33378
- import { readdir, unlink, rmdir } from "fs/promises";
33379
- import { join as join6 } from "path";
33509
+ import { readdir as readdir2, unlink, rmdir } from "fs/promises";
33510
+ import { join as join7 } from "path";
33380
33511
  function registerSkillsUninstall(parent) {
33381
33512
  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) => {
33382
33513
  try {
@@ -33391,10 +33522,10 @@ function registerSkillsUninstall(parent) {
33391
33522
  printInfo(`No skills installed at ${targetDir}`);
33392
33523
  return;
33393
33524
  }
33394
- const entries = await readdir(targetDir);
33525
+ const entries = await readdir2(targetDir);
33395
33526
  const removed = [];
33396
33527
  for (const entry of entries) {
33397
- const full = join6(targetDir, entry);
33528
+ const full = join7(targetDir, entry);
33398
33529
  if (target === "cursor") {
33399
33530
  const slug = entry.endsWith(".mdc") ? entry.slice(0, -".mdc".length) : entry;
33400
33531
  if (entry.endsWith(".mdc") && isManagedSkillName(slug)) {
@@ -33403,7 +33534,7 @@ function registerSkillsUninstall(parent) {
33403
33534
  }
33404
33535
  } else {
33405
33536
  if (isManagedSkillName(entry)) {
33406
- const skillFile = join6(full, "SKILL.md");
33537
+ const skillFile = join7(full, "SKILL.md");
33407
33538
  try {
33408
33539
  await unlink(skillFile);
33409
33540
  } catch {
@@ -33443,6 +33574,7 @@ Subcommands:
33443
33574
  $ t2 skills install Install all skills (default target: agents)
33444
33575
  $ t2 skills install <slug> Install one skill by name
33445
33576
  $ t2 skills install --target cursor Install as Cursor .mdc rules
33577
+ $ t2 skills check Are installed skills current? (agents: run at session start)
33446
33578
  $ t2 skills uninstall Remove installed skills
33447
33579
 
33448
33580
  For MCP-aware clients (Claude Desktop, Cursor, Windsurf), prefer
@@ -33451,6 +33583,7 @@ For MCP-aware clients (Claude Desktop, Cursor, Windsurf), prefer
33451
33583
  );
33452
33584
  registerSkillsList(group);
33453
33585
  registerSkillsInstall(group);
33586
+ registerSkillsCheck(group);
33454
33587
  registerSkillsUninstall(group);
33455
33588
  }
33456
33589