@floomhq/skills 0.2.7 → 0.2.8

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/dist/index.js CHANGED
@@ -2448,7 +2448,7 @@ function isLegacyApiUrl(apiUrl) {
2448
2448
  }
2449
2449
 
2450
2450
  // src/version.ts
2451
- var VERSION = "0.2.7";
2451
+ var VERSION = "0.2.8";
2452
2452
 
2453
2453
  // src/api-client.ts
2454
2454
  var DEFAULT_TIMEOUT_MS = 2e4;
@@ -2876,7 +2876,8 @@ import { readFile as readFile6 } from "node:fs/promises";
2876
2876
  import { join as join6 } from "node:path";
2877
2877
  async function publishCommand(opts = {}) {
2878
2878
  const auth = await readAuth();
2879
- if (!auth && !opts.dryRun) {
2879
+ const envToken = process.env.FLOOM_API_TOKEN?.trim();
2880
+ if (!auth && !envToken && !opts.dryRun) {
2880
2881
  log.err("Not logged in. Run: floom login");
2881
2882
  process.exit(1);
2882
2883
  }
@@ -2896,7 +2897,9 @@ async function publishCommand(opts = {}) {
2896
2897
  const manifest = m.manifest;
2897
2898
  const skillMd = await readFile6(join6(dir, "SKILL.md"), "utf8");
2898
2899
  const { meta } = parseSkillFrontmatter(skillMd);
2899
- const refRoot = opts.workspace ?? opts.library ?? auth?.handle ?? "<your-handle>";
2900
+ const me = !opts.dryRun && !auth && envToken ? await api("/me", { authRequired: true }) : null;
2901
+ const handle = auth?.handle ?? me?.user.handle;
2902
+ const refRoot = opts.workspace ?? opts.library ?? handle ?? "<your-handle>";
2900
2903
  log.heading(`${opts.dryRun ? "Dry-running" : "Publishing"} ${refRoot}/${manifest.name}@${manifest.version}`);
2901
2904
  log.step("Packing bundle...");
2902
2905
  const bundle = await collectBundle(dir);
@@ -2909,8 +2912,7 @@ async function publishCommand(opts = {}) {
2909
2912
  log.ok("Dry run passed. No upload was requested.");
2910
2913
  return;
2911
2914
  }
2912
- const activeAuth = auth;
2913
- if (!activeAuth) {
2915
+ if (!handle) {
2914
2916
  log.err("Not logged in. Run: floom login");
2915
2917
  process.exit(1);
2916
2918
  }
@@ -2937,7 +2939,7 @@ async function publishCommand(opts = {}) {
2937
2939
  });
2938
2940
  } catch (e) {
2939
2941
  if (e instanceof FloomError && e.code === "VERSION_ALREADY_EXISTS") {
2940
- log.err(`Version ${manifest.version} already exists for @${activeAuth.handle}/${manifest.name}.`);
2942
+ log.err(`Version ${manifest.version} already exists for @${handle}/${manifest.name}.`);
2941
2943
  log.info("Bump the version in skill.json (e.g. 0.1.1) and try again.");
2942
2944
  process.exit(1);
2943
2945
  }
@@ -2955,7 +2957,7 @@ async function publishCommand(opts = {}) {
2955
2957
  log.ok(`Published ${complete.ref}`);
2956
2958
  log.blank();
2957
2959
  log.info("View:");
2958
- log.kv("", `${activeAuth.apiUrl.replace("/api/v1", "")}/@${activeAuth.handle}/${manifest.name}`);
2960
+ log.kv("", `${(auth?.apiUrl ?? process.env.FLOOM_API_URL ?? "https://skills.floom.dev/api/v1").replace("/api/v1", "")}/@${handle}/${manifest.name}`);
2959
2961
  log.info("Install:");
2960
2962
  log.kv("", complete.install_command);
2961
2963
  }
@@ -3358,7 +3360,7 @@ async function shareCommand(refStr, email, opts = {}) {
3358
3360
  body: { email, role }
3359
3361
  });
3360
3362
  log.ok(`Shared ${refStr} with ${r.grant.email} as ${r.grant.role}.`);
3361
- log.info("No email is sent in V0. They will see the skill under 'Shared with Me' on next login.");
3363
+ if (r.email_status) log.kv("email", r.email_status);
3362
3364
  }
3363
3365
  async function unshareCommand(refStr, email) {
3364
3366
  const ref = parseSkillRef(refStr);