@storyclaw/talenthub 0.3.2 → 0.3.3

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/cli.js CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import dns from "node:dns";
3
+ import { readFileSync } from "node:fs";
4
+ import { dirname, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
3
6
  // IPv6 is unreachable on many networks (especially behind NAT/China);
4
7
  // try IPv4 first to avoid EHOSTUNREACH delays on every fetch.
5
8
  dns.setDefaultResultOrder("ipv4first");
@@ -13,11 +16,13 @@ import { agentUnpublish } from "./commands/agent-unpublish.js";
13
16
  import { agentUpdate } from "./commands/agent-update.js";
14
17
  import { login } from "./commands/login.js";
15
18
  import { logout } from "./commands/logout.js";
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+ const pkg = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf-8"));
16
21
  const program = new Command();
17
22
  program
18
23
  .name("talenthub")
19
24
  .description("Manage StoryClaw AI agents")
20
- .version("0.1.0");
25
+ .version(pkg.version);
21
26
  program.command("login").description("Authenticate with StoryClaw").action(login);
22
27
  program.command("logout").description("Remove stored credentials").action(logout);
23
28
  const agent = program.command("agent").description("Agent management commands");
@@ -3,7 +3,9 @@ export type SkillSpec = {
3
3
  skill: string;
4
4
  };
5
5
  /**
6
- * Parse a fully-qualified skill string ("owner/repo@skill") into its parts.
6
+ * Parse a skill URL string into repo source and skill name.
7
+ * Accepts "https://github.com/owner/repo@skill" (preferred) and
8
+ * legacy "owner/repo@skill" format.
7
9
  * Returns undefined if the string is not in the expected format.
8
10
  */
9
11
  export declare function parseSkillSpec(entry: string): SkillSpec | undefined;
@@ -22,7 +24,7 @@ export declare function isSkillInstalled(name: string): boolean;
22
24
  * Install a single skill via `skills add` into the shared directory,
23
25
  * then symlink it into the agent workspace.
24
26
  *
25
- * @param entry Fully-qualified skill string ("owner/repo@skill")
27
+ * @param entry Skill URL string ("https://github.com/owner/repo@skill")
26
28
  * @param workspaceDir Agent workspace directory
27
29
  * Returns true on success, false on failure (logged, non-fatal).
28
30
  */
@@ -32,7 +34,7 @@ export declare function installSkill(entry: string, workspaceDir: string): boole
32
34
  * missing skills grouped by repo (one clone per repo), then symlink
33
35
  * everything into the workspace.
34
36
  *
35
- * @param skills Array of fully-qualified skill strings ("owner/repo@skill")
37
+ * @param skills Array of skill URL strings ("https://github.com/owner/repo@skill")
36
38
  * Returns { installed, skipped, failed } counts.
37
39
  */
38
40
  export declare function installAllSkills(skills: string[], workspaceDir: string): {
@@ -20,7 +20,9 @@ function resolveSkillsBin() {
20
20
  }
21
21
  const SKILLS_BIN = resolveSkillsBin();
22
22
  /**
23
- * Parse a fully-qualified skill string ("owner/repo@skill") into its parts.
23
+ * Parse a skill URL string into repo source and skill name.
24
+ * Accepts "https://github.com/owner/repo@skill" (preferred) and
25
+ * legacy "owner/repo@skill" format.
24
26
  * Returns undefined if the string is not in the expected format.
25
27
  */
26
28
  export function parseSkillSpec(entry) {
@@ -80,14 +82,14 @@ function installSkillsFromRepo(repo, skillNames) {
80
82
  * Install a single skill via `skills add` into the shared directory,
81
83
  * then symlink it into the agent workspace.
82
84
  *
83
- * @param entry Fully-qualified skill string ("owner/repo@skill")
85
+ * @param entry Skill URL string ("https://github.com/owner/repo@skill")
84
86
  * @param workspaceDir Agent workspace directory
85
87
  * Returns true on success, false on failure (logged, non-fatal).
86
88
  */
87
89
  export function installSkill(entry, workspaceDir) {
88
90
  const spec = parseSkillSpec(entry);
89
91
  if (!spec) {
90
- console.error(` Warning: invalid skill spec "${entry}" — expected "owner/repo@skill"`);
92
+ console.error(` Warning: invalid skill spec "${entry}" — expected "https://github.com/owner/repo@skill"`);
91
93
  return false;
92
94
  }
93
95
  if (!isSkillInstalled(spec.skill)) {
@@ -129,7 +131,7 @@ function linkSkillToWorkspace(name, workspaceDir) {
129
131
  * missing skills grouped by repo (one clone per repo), then symlink
130
132
  * everything into the workspace.
131
133
  *
132
- * @param skills Array of fully-qualified skill strings ("owner/repo@skill")
134
+ * @param skills Array of skill URL strings ("https://github.com/owner/repo@skill")
133
135
  * Returns { installed, skipped, failed } counts.
134
136
  */
135
137
  export function installAllSkills(skills, workspaceDir) {
@@ -142,7 +144,7 @@ export function installAllSkills(skills, workspaceDir) {
142
144
  for (const entry of skills) {
143
145
  const spec = parseSkillSpec(entry);
144
146
  if (!spec) {
145
- console.error(` Warning: invalid skill spec "${entry}" — expected "owner/repo@skill"`);
147
+ console.error(` Warning: invalid skill spec "${entry}" — expected "https://github.com/owner/repo@skill"`);
146
148
  failed++;
147
149
  continue;
148
150
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyclaw/talenthub",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "CLI tool to manage StoryClaw AI agents",
5
5
  "type": "module",
6
6
  "bin": {