@triclaps/cli 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. package/index.js +18 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -11791,6 +11791,9 @@ function loadSkillsConfig(filePath, env = process.env) {
11791
11791
  name,
11792
11792
  runtime: typeof rec.runtime === "string" ? rec.runtime : ""
11793
11793
  };
11794
+ if (typeof rec.category === "string" && (rec.category === "system" || rec.category === "recommand")) {
11795
+ skill.category = rec.category;
11796
+ }
11794
11797
  if (typeof rec.repo === "string") skill.repo = rec.repo;
11795
11798
  if (typeof rec.repo_subpath === "string") skill.repo_subpath = rec.repo_subpath;
11796
11799
  if (typeof rec.repo_token === "string") skill.repo_token = substituteEnvVars(rec.repo_token, env);
@@ -11842,7 +11845,11 @@ async function installSystemSkills(input) {
11842
11845
  const method = config.method ?? "link";
11843
11846
  const defaultRepoUrl = input.defaultRepoUrl || env.CLAPS_SKILL_REPO_URL?.trim() || "";
11844
11847
  const defaultRepoBranch = input.defaultRepoBranch || env.CLAPS_SKILL_REPO_BRANCH?.trim() || "main";
11845
- const matchingSkills = config.skills.filter((s) => skillMatchesRuntime(s.runtime, input.runtime));
11848
+ const matchingSkills = config.skills.filter((s) => {
11849
+ if (!skillMatchesRuntime(s.runtime, input.runtime)) return false;
11850
+ if (input.category && (s.category ?? "recommand") !== input.category) return false;
11851
+ return true;
11852
+ });
11846
11853
  const summary = {
11847
11854
  total: matchingSkills.length,
11848
11855
  skipped: 0,
@@ -11952,7 +11959,7 @@ async function installSingleSkill(input) {
11952
11959
  }
11953
11960
  }
11954
11961
  }
11955
- async function maybeInstallSystemSkills(env, logger) {
11962
+ async function maybeInstallSystemSkills(env, logger, options) {
11956
11963
  const installSkills = env.CLAPS_INSTALL_SKILLS?.trim();
11957
11964
  if (installSkills === "false" || installSkills === "0") {
11958
11965
  return { total: 0, skipped: 0, installed: 0, failed: 0, results: [] };
@@ -11970,7 +11977,8 @@ async function maybeInstallSystemSkills(env, logger) {
11970
11977
  const cacheDir = env.CLAPS_SKILL_CACHE_DIR?.trim() || "";
11971
11978
  const defaultRepoUrl = env.CLAPS_SKILL_REPO_URL?.trim() || "";
11972
11979
  const defaultRepoBranch = env.CLAPS_SKILL_REPO_BRANCH?.trim() || "";
11973
- logger.info(`[claps-cli] Installing system skills from ${skillsConfigPath} for runtime ${runtime}...`);
11980
+ const categoryLabel = options?.category ? ` (category: ${options.category})` : "";
11981
+ logger.info(`[claps-cli] Installing system skills from ${skillsConfigPath} for runtime ${runtime}${categoryLabel}...`);
11974
11982
  const summary = await installSystemSkills({
11975
11983
  skillsConfigPath,
11976
11984
  runtime,
@@ -11978,6 +11986,7 @@ async function maybeInstallSystemSkills(env, logger) {
11978
11986
  agentHomePath,
11979
11987
  defaultRepoUrl,
11980
11988
  defaultRepoBranch,
11989
+ category: options?.category,
11981
11990
  env
11982
11991
  });
11983
11992
  logger.info(
@@ -22848,13 +22857,18 @@ async function runCli(argv, options = {}) {
22848
22857
  configuredAgentKey && configuredAgentKey !== requestedExternalKey ? `[claps-cli] run still identifies via CLAPS_AGENT_TOKEN from .env.local/env. The current local binding is ${configuredAgentKey}, so --external-key ${requestedExternalKey} does not switch the worker to a different agent by itself.` : `[claps-cli] run uses CLAPS_AGENT_TOKEN to select the agent. --external-key ${requestedExternalKey} does not switch identity by itself.`
22849
22858
  );
22850
22859
  }
22851
- await maybeInstallSystemSkills(runEnv, logger);
22860
+ await maybeInstallSystemSkills(runEnv, logger, { category: "system" });
22852
22861
  await startManagedRuntime(runEnv, {
22853
22862
  fetchImpl: options.fetchImpl ?? fetch,
22854
22863
  logger,
22855
22864
  ...options.getBootstrapStatusImpl ? { getBootstrapStatusImpl: options.getBootstrapStatusImpl } : {},
22856
22865
  ...options.startWorkerLoopImpl ? { startWorkerLoopImpl: options.startWorkerLoopImpl } : {}
22857
22866
  });
22867
+ maybeInstallSystemSkills(runEnv, logger, { category: "recommand" }).catch((error) => {
22868
+ logger.warn(
22869
+ `[claps-cli] background recommended skill installation failed: ${error instanceof Error ? error.message : "Unknown error"}`
22870
+ );
22871
+ });
22858
22872
  return 0;
22859
22873
  }
22860
22874
  if (parsed.command === "version") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triclaps/cli",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claps-cli": "index.js"