@floomhq/skills 0.2.0 → 0.2.1

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 (82) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +3638 -87
  3. package/dist/index.js.map +7 -1
  4. package/dist/version.d.ts +1 -1
  5. package/dist/version.js +1 -2
  6. package/package.json +17 -6
  7. package/dist/api-client.d.ts +0 -9
  8. package/dist/api-client.js +0 -61
  9. package/dist/api-client.js.map +0 -1
  10. package/dist/commands/info.d.ts +0 -1
  11. package/dist/commands/info.js +0 -24
  12. package/dist/commands/info.js.map +0 -1
  13. package/dist/commands/init.d.ts +0 -1
  14. package/dist/commands/init.js +0 -108
  15. package/dist/commands/init.js.map +0 -1
  16. package/dist/commands/install.d.ts +0 -8
  17. package/dist/commands/install.js +0 -136
  18. package/dist/commands/install.js.map +0 -1
  19. package/dist/commands/installed.d.ts +0 -4
  20. package/dist/commands/installed.js +0 -22
  21. package/dist/commands/installed.js.map +0 -1
  22. package/dist/commands/library.d.ts +0 -4
  23. package/dist/commands/library.js +0 -29
  24. package/dist/commands/library.js.map +0 -1
  25. package/dist/commands/list.d.ts +0 -7
  26. package/dist/commands/list.js +0 -32
  27. package/dist/commands/list.js.map +0 -1
  28. package/dist/commands/login.d.ts +0 -1
  29. package/dist/commands/login.js +0 -57
  30. package/dist/commands/login.js.map +0 -1
  31. package/dist/commands/logout.d.ts +0 -1
  32. package/dist/commands/logout.js +0 -19
  33. package/dist/commands/logout.js.map +0 -1
  34. package/dist/commands/outdated.d.ts +0 -1
  35. package/dist/commands/outdated.js +0 -50
  36. package/dist/commands/outdated.js.map +0 -1
  37. package/dist/commands/publish.d.ts +0 -4
  38. package/dist/commands/publish.js +0 -84
  39. package/dist/commands/publish.js.map +0 -1
  40. package/dist/commands/share.d.ts +0 -5
  41. package/dist/commands/share.js +0 -34
  42. package/dist/commands/share.js.map +0 -1
  43. package/dist/commands/update.d.ts +0 -4
  44. package/dist/commands/update.js +0 -92
  45. package/dist/commands/update.js.map +0 -1
  46. package/dist/commands/validate.d.ts +0 -32
  47. package/dist/commands/validate.js +0 -108
  48. package/dist/commands/validate.js.map +0 -1
  49. package/dist/commands/whoami.d.ts +0 -1
  50. package/dist/commands/whoami.js +0 -14
  51. package/dist/commands/whoami.js.map +0 -1
  52. package/dist/config.d.ts +0 -11
  53. package/dist/config.js +0 -39
  54. package/dist/config.js.map +0 -1
  55. package/dist/lib/floom-lock.d.ts +0 -22
  56. package/dist/lib/floom-lock.js +0 -66
  57. package/dist/lib/floom-lock.js.map +0 -1
  58. package/dist/lib/output.d.ts +0 -11
  59. package/dist/lib/output.js +0 -17
  60. package/dist/lib/output.js.map +0 -1
  61. package/dist/version.js.map +0 -1
  62. package/src/api-client.ts +0 -80
  63. package/src/commands/info.ts +0 -36
  64. package/src/commands/init.ts +0 -109
  65. package/src/commands/install.ts +0 -176
  66. package/src/commands/installed.ts +0 -29
  67. package/src/commands/library.ts +0 -41
  68. package/src/commands/list.ts +0 -59
  69. package/src/commands/login.ts +0 -77
  70. package/src/commands/logout.ts +0 -18
  71. package/src/commands/outdated.ts +0 -57
  72. package/src/commands/publish.ts +0 -111
  73. package/src/commands/share.ts +0 -41
  74. package/src/commands/update.ts +0 -116
  75. package/src/commands/validate.ts +0 -132
  76. package/src/commands/whoami.ts +0 -14
  77. package/src/config.ts +0 -44
  78. package/src/index.ts +0 -109
  79. package/src/lib/floom-lock.ts +0 -81
  80. package/src/lib/output.ts +0 -17
  81. package/src/version.ts +0 -1
  82. package/tsconfig.json +0 -9
package/src/index.ts DELETED
@@ -1,109 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from "commander";
3
- import { FloomError } from "@floom/shared";
4
- import { log } from "./lib/output.js";
5
-
6
- import { loginCommand } from "./commands/login.js";
7
- import { logoutCommand } from "./commands/logout.js";
8
- import { whoamiCommand } from "./commands/whoami.js";
9
- import { initCommand } from "./commands/init.js";
10
- import { validateCommand } from "./commands/validate.js";
11
- import { publishCommand } from "./commands/publish.js";
12
- import { installCommand } from "./commands/install.js";
13
- import { installedCommand } from "./commands/installed.js";
14
- import { outdatedCommand } from "./commands/outdated.js";
15
- import { updateCommand } from "./commands/update.js";
16
- import { listCommand } from "./commands/list.js";
17
- import { infoCommand } from "./commands/info.js";
18
- import { shareCommand, unshareCommand } from "./commands/share.js";
19
- import { libraryCreateCommand, libraryInviteCommand, libraryLeaveCommand, libraryListCommand } from "./commands/library.js";
20
- import { VERSION } from "./version.js";
21
-
22
- const program = new Command();
23
- program
24
- .name("floom")
25
- .description("Floom CLI — publish, install, sync, and share AI agent skills.")
26
- .version(VERSION);
27
-
28
- program.command("login").description("Log in via browser (device code).").action(loginCommand);
29
- program.command("logout").description("Log out and revoke local token.").action(logoutCommand);
30
- program.command("whoami").description("Show the logged-in user.").action(whoamiCommand);
31
-
32
- program.command("init").description("Scaffold a new skill in the current directory.").action(initCommand);
33
- program
34
- .command("validate")
35
- .description("Validate the skill in the current directory.")
36
- .option("--json", "Emit machine-readable JSON")
37
- .action((opts) => validateCommand(opts));
38
-
39
- program
40
- .command("publish")
41
- .description("Publish the skill in the current directory.")
42
- .option("--library <slug>", "Publish into a shared library slug (default: personal)")
43
- .action((opts) => publishCommand(opts));
44
- program.command("push").description("Alias for `publish`.").option("--library <slug>").action((opts) => publishCommand(opts));
45
-
46
- program
47
- .command("install <ref>")
48
- .description("Install a skill (default: .agents/skills/<slug>/).")
49
- .option("--for <target>", "Tool preset: claude | codex | cursor | gemini | opencode | kimi | all")
50
- .option("--to <path>", "Explicit install directory")
51
- .option("--global", "Install to user-level folder instead of project-local")
52
- .option("--force", "Overwrite existing folder")
53
- .action((ref, opts) => installCommand(ref, opts));
54
-
55
- program.command("installed").description("List installed skills in this project.").option("--json").action(installedCommand);
56
- program.command("outdated").description("Show installed skills with newer versions available.").action(outdatedCommand);
57
- program
58
- .command("update [ref]")
59
- .description("Update installed skills to latest.")
60
- .option("--force", "Overwrite local edits")
61
- .action((ref, opts) => updateCommand(ref, opts));
62
-
63
- program
64
- .command("list")
65
- .description("List remote skills.")
66
- .option("--mine", "Only your own skills (default)")
67
- .option("--library <slug>", "Filter by library slug")
68
- .option("--folder <uuid>", "Filter by folder id")
69
- .option("--flat", "Print one ref per line")
70
- .option("--query <q>", "Filter by query")
71
- .action(listCommand);
72
-
73
- program.command("info <ref>").description("Show details for a remote skill.").action(infoCommand);
74
-
75
- program
76
- .command("share <ref> <email>")
77
- .description("Invite someone to a skill by email.")
78
- .option("--role <role>", "viewer (default) or editor")
79
- .action((ref, email, opts) => shareCommand(ref, email, opts));
80
-
81
- program
82
- .command("unshare <ref> <email>")
83
- .description("Revoke someone's access.")
84
- .action((ref, email) => unshareCommand(ref, email));
85
-
86
- const lib = program.command("library").description("Manage libraries");
87
- lib.command("list").action(libraryListCommand);
88
- lib.command("create <slug> <name>").action((slug, name) => libraryCreateCommand(slug, name));
89
- lib.command("invite <librarySlug> <email>").option("--role <role>", "viewer|editor|admin", "viewer").action((librarySlug, email, opts) => libraryInviteCommand(librarySlug, email, opts.role));
90
- lib.command("leave <librarySlug>").action((librarySlug) => libraryLeaveCommand(librarySlug));
91
-
92
- // Global error handler
93
- async function main(): Promise<void> {
94
- try {
95
- await program.parseAsync(process.argv);
96
- } catch (e) {
97
- if (e instanceof FloomError) {
98
- log.err(e.message);
99
- if (e.code === "AUTH_REQUIRED" || e.code === "TOKEN_EXPIRED") {
100
- log.info("Run: floom login");
101
- }
102
- process.exit(1);
103
- }
104
- log.err((e as Error).message ?? "Unknown error");
105
- if (process.env.FLOOM_DEBUG) console.error(e);
106
- process.exit(1);
107
- }
108
- }
109
- main();
@@ -1,81 +0,0 @@
1
- import { readFile, writeFile, mkdir, stat, readdir } from "node:fs/promises";
2
- import { join, relative, sep, posix } from "node:path";
3
- import { createHash } from "node:crypto";
4
-
5
- // SPEC §11.14 — floom.lock format
6
- export interface FloomLockEntry {
7
- version: string;
8
- resolved: string;
9
- bundle_sha256: string;
10
- installed_at: string;
11
- path: string; // relative path from project root where the skill folder lives
12
- preset?: string; // "claude" | "codex" | "all" | etc, recorded if --for was used
13
- }
14
-
15
- export interface FloomLock {
16
- schema_version: "0.1";
17
- skills: Record<string, FloomLockEntry>;
18
- }
19
-
20
- const EMPTY: FloomLock = { schema_version: "0.1", skills: {} };
21
-
22
- export async function readLock(projectDir: string): Promise<FloomLock> {
23
- try {
24
- const raw = await readFile(join(projectDir, "floom.lock"), "utf8");
25
- const parsed = JSON.parse(raw) as FloomLock;
26
- return parsed.schema_version === "0.1" ? parsed : { ...EMPTY };
27
- } catch (e) {
28
- if ((e as NodeJS.ErrnoException).code === "ENOENT") return { ...EMPTY };
29
- throw e;
30
- }
31
- }
32
-
33
- export async function writeLock(projectDir: string, lock: FloomLock): Promise<void> {
34
- await writeFile(join(projectDir, "floom.lock"), JSON.stringify(lock, null, 2) + "\n", "utf8");
35
- }
36
-
37
- export function setLockEntry(lock: FloomLock, ref: string, entry: FloomLockEntry): FloomLock {
38
- return { ...lock, skills: { ...lock.skills, [ref]: entry } };
39
- }
40
-
41
- export function removeLockEntry(lock: FloomLock, ref: string): FloomLock {
42
- const { [ref]: _, ...rest } = lock.skills;
43
- return { ...lock, skills: rest };
44
- }
45
-
46
- // Compute hash for each file in an installed skill folder.
47
- // Used by `install` and `update` to detect local edits before overwriting.
48
- export interface InstalledFileHash {
49
- relPath: string;
50
- sha256: string;
51
- size: number;
52
- }
53
-
54
- export async function hashInstalledFolder(folderAbs: string): Promise<InstalledFileHash[]> {
55
- const out: InstalledFileHash[] = [];
56
- async function walk(dir: string): Promise<void> {
57
- let entries;
58
- try { entries = await readdir(dir, { withFileTypes: true }); } catch { return; }
59
- for (const entry of entries) {
60
- const abs = join(dir, entry.name);
61
- if (entry.isSymbolicLink()) continue;
62
- if (entry.isDirectory()) { await walk(abs); continue; }
63
- if (!entry.isFile()) continue;
64
- const buf = await readFile(abs);
65
- const rel = relative(folderAbs, abs).split(sep).join(posix.sep);
66
- out.push({
67
- relPath: rel,
68
- sha256: createHash("sha256").update(buf).digest("hex"),
69
- size: buf.length,
70
- });
71
- }
72
- }
73
- try {
74
- await stat(folderAbs);
75
- } catch {
76
- return out;
77
- }
78
- await walk(folderAbs);
79
- out.sort((a, b) => a.relPath.localeCompare(b.relPath));
80
- return out;
81
- }
package/src/lib/output.ts DELETED
@@ -1,17 +0,0 @@
1
- import chalk from "chalk";
2
-
3
- export const log = {
4
- info: (msg: string) => console.log(msg),
5
- ok: (msg: string) => console.log(chalk.green("✓ ") + msg),
6
- warn: (msg: string) => console.log(chalk.yellow("! ") + msg),
7
- err: (msg: string) => console.error(chalk.red("✗ ") + msg),
8
- step: (msg: string) => console.log(chalk.dim("· ") + msg),
9
- heading: (msg: string) => console.log("\n" + chalk.bold(msg)),
10
- kv: (key: string, value: string) => console.log(` ${chalk.dim(key.padEnd(16))}${value}`),
11
- blank: () => console.log(""),
12
- };
13
-
14
- export function exitWith(code: number, msg?: string): never {
15
- if (msg) log.err(msg);
16
- process.exit(code);
17
- }
package/src/version.ts DELETED
@@ -1 +0,0 @@
1
- export const VERSION = "0.1.0";
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src"
6
- },
7
- "include": ["src/**/*"],
8
- "exclude": ["dist", "node_modules"]
9
- }