@stainlu/faam-cli 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.cjs +27 -17
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -14743,6 +14743,23 @@ var RlpApiClient = class {
14743
14743
  throw new Error(error.error || `API error: ${response.status}`);
14744
14744
  }
14745
14745
  }
14746
+ /**
14747
+ * Get personalized skills for the account
14748
+ */
14749
+ async getPersonalizedSkills() {
14750
+ const url = `${this.apiUrl}/api/skills/me`;
14751
+ const response = await fetch(url, {
14752
+ headers: this.authHeaders
14753
+ });
14754
+ if (!response.ok) {
14755
+ if (response.status === 404) {
14756
+ return { skills: [] };
14757
+ }
14758
+ const error = await response.json().catch(() => ({ error: "Unknown error" }));
14759
+ throw new Error(error.error || `API error: ${response.status}`);
14760
+ }
14761
+ return response.json();
14762
+ }
14746
14763
  /**
14747
14764
  * Validate account key by fetching profile
14748
14765
  * Returns account_id if valid
@@ -22039,15 +22056,8 @@ async function installSkillsCommand(options2) {
22039
22056
  }
22040
22057
  const fetchSpinner = ora("Fetching personalized skills...").start();
22041
22058
  try {
22042
- const url = `${config.api_url}/api/skills/me?account_key=${encodeURIComponent(config.account_key)}`;
22043
- const response = await fetch(url);
22044
- if (!response.ok) {
22045
- const error = await response.json().catch(() => ({ error: "Unknown error" }));
22046
- fetchSpinner.fail("Failed to fetch skills");
22047
- console.error(source_default.red(error.error || `API error: ${response.status}`));
22048
- process.exit(1);
22049
- }
22050
- const data = await response.json();
22059
+ const client = new RlpApiClient(config);
22060
+ const data = await client.getPersonalizedSkills();
22051
22061
  if (data.error) {
22052
22062
  fetchSpinner.fail("Failed to fetch skills");
22053
22063
  console.error(source_default.red(data.error));
@@ -22374,7 +22384,7 @@ function configShowCommand() {
22374
22384
  if (!agentCardConfigExists()) {
22375
22385
  console.log(source_default.yellow("No agent-card.json found."));
22376
22386
  console.log();
22377
- console.log("Run", source_default.cyan("rlp init"), "to create one, or use", source_default.cyan("rlp config set <key> <value>"));
22387
+ console.log("Run", source_default.cyan("faam init"), "to create one, or use", source_default.cyan("faam config set <key> <value>"));
22378
22388
  console.log();
22379
22389
  console.log("Config path:", source_default.gray(configPath));
22380
22390
  return;
@@ -22388,7 +22398,7 @@ function configShowCommand() {
22388
22398
  function configGetCommand(key) {
22389
22399
  if (!agentCardConfigExists()) {
22390
22400
  console.log(source_default.yellow("No agent-card.json found."));
22391
- console.log("Run", source_default.cyan("rlp init"), "to create one.");
22401
+ console.log("Run", source_default.cyan("faam init"), "to create one.");
22392
22402
  return;
22393
22403
  }
22394
22404
  const config = readAgentCardConfig();
@@ -22430,7 +22440,7 @@ async function autoSync(config) {
22430
22440
  if (!isLoggedIn()) {
22431
22441
  console.log();
22432
22442
  console.log(source_default.gray("Not logged in - changes saved locally only."));
22433
- console.log("Run", source_default.cyan("rlp login --key <key>"), "then", source_default.cyan("rlp sync-skills"), "to sync.");
22443
+ console.log("Run", source_default.cyan("faam login --key <key>"), "then", source_default.cyan("faam sync-skills"), "to sync.");
22434
22444
  return;
22435
22445
  }
22436
22446
  console.log();
@@ -22444,7 +22454,7 @@ async function autoSync(config) {
22444
22454
  } catch (err) {
22445
22455
  spinner.fail("Sync failed");
22446
22456
  console.error(source_default.red(err instanceof Error ? err.message : "Unknown error"));
22447
- console.log("You can retry with:", source_default.cyan("rlp sync-skills"));
22457
+ console.log("You can retry with:", source_default.cyan("faam sync-skills"));
22448
22458
  }
22449
22459
  }
22450
22460
  function configListKeysCommand() {
@@ -22470,14 +22480,14 @@ function configListKeysCommand() {
22470
22480
  }
22471
22481
  console.log();
22472
22482
  console.log("Example usage:");
22473
- console.log(` ${source_default.gray('rlp config set name "My AI Agent"')}`);
22474
- console.log(` ${source_default.gray('rlp config set provider.organization "My Company"')}`);
22475
- console.log(` ${source_default.gray("rlp config set capabilities.streaming true")}`);
22483
+ console.log(` ${source_default.gray('faam config set name "My AI Agent"')}`);
22484
+ console.log(` ${source_default.gray('faam config set provider.organization "My Company"')}`);
22485
+ console.log(` ${source_default.gray("faam config set capabilities.streaming true")}`);
22476
22486
  }
22477
22487
 
22478
22488
  // src/index.ts
22479
22489
  var program2 = new Command();
22480
- program2.name("faam").description("CLI tool to sync local skills to your FAAM Agent Card").version("0.2.0");
22490
+ program2.name("faam").description("CLI tool to sync local skills to your FAAM Agent Card").version("0.2.2");
22481
22491
  program2.command("login").description("Store your FAAM account key").requiredOption("-k, --key <account_key>", "Your FAAM account key").option("--api-url <url>", "API URL (default: https://api.faam.io)").action(async (options2) => {
22482
22492
  await loginCommand({
22483
22493
  key: options2.key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainlu/faam-cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI tool to sync local skills to your FAAM Agent Card",
5
5
  "type": "module",
6
6
  "bin": {