@hypersocial/decks-cli 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -61,7 +61,7 @@ share rm <token>
61
61
  share url <token>
62
62
 
63
63
  recipient archive|unarchive <name>
64
- skills install [--path <dir>] [--force]
64
+ skills install [--agent codex,claude-code] [--project]
65
65
  activity [--deck <slug>] [--limit <n>] [--json]
66
66
  ```
67
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypersocial/decks-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Command-line client for Hypersocial Decks live analytics and share management.",
5
5
  "type": "module",
6
6
  "main": "./src/commands.mjs",
package/src/commands.mjs CHANGED
@@ -155,8 +155,8 @@ commands:
155
155
  deck list|stats|open
156
156
  share new|list|on|off|rm|url
157
157
  recipient archive|unarchive
158
- skill install [--path <dir>] [--force]
159
- skills install [--path <dir>] [--force]
158
+ skill install [--agent codex,claude-code] [--project]
159
+ skills install [--agent codex,claude-code] [--project]
160
160
  activity [--deck <slug>] [--limit <n>] [--json]
161
161
 
162
162
  global:
package/src/runtime.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { execFile } from "node:child_process";
1
+ import { execFile, spawnSync } from "node:child_process";
2
2
  import { createHash, randomBytes } from "node:crypto";
3
3
  import { createServer } from "node:http";
4
- import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
4
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { homedir } from "node:os";
6
6
  import { dirname, join } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { ConvexHttpClient } from "convex/browser";
9
9
  import { makeFunctionReference } from "convex/server";
10
10
 
11
- export const VERSION = "0.1.3";
11
+ export const VERSION = "0.1.4";
12
12
 
13
13
  export const PROD = {
14
14
  name: "prod",
@@ -38,12 +38,12 @@ export const api = {
38
38
  },
39
39
  };
40
40
 
41
- const BOOL = new Set(["prod", "dev", "json", "require-email", "help", "version", "force"]);
41
+ const BOOL = new Set(["prod", "dev", "json", "require-email", "help", "version", "all-agents", "global", "project"]);
42
42
 
43
43
  export const CRED_DIR = join(homedir(), ".config", "hypersocial-decks");
44
44
  export const CRED_FILE = join(CRED_DIR, "credentials.json");
45
45
  const SRC_DIR = dirname(fileURLToPath(import.meta.url));
46
- const PACKAGED_SKILL_DIR = join(SRC_DIR, "..", "skills", "hyperdecks");
46
+ const PACKAGED_SKILLS_DIR = join(SRC_DIR, "..", "skills");
47
47
 
48
48
  export function parse(args) {
49
49
  const opts = {};
@@ -170,29 +170,29 @@ export function openBrowser(url) {
170
170
  execFile(cmd, args, () => {});
171
171
  }
172
172
 
173
- export function defaultSkillRoot() {
174
- return process.env.CODEX_HOME ? join(process.env.CODEX_HOME, "skills") : join(homedir(), ".codex", "skills");
175
- }
176
-
177
173
  export function installHyperdecksSkill(opts = {}) {
178
- const root = opts.path || opts.dir || defaultSkillRoot();
179
- const dest = join(root, "hyperdecks");
180
- if (!existsSync(PACKAGED_SKILL_DIR)) {
181
- throw new Error(`packaged hyperdecks skill not found at ${PACKAGED_SKILL_DIR}`);
174
+ const skillDir = join(PACKAGED_SKILLS_DIR, "hyperdecks");
175
+ if (!existsSync(skillDir)) {
176
+ throw new Error(`packaged hyperdecks skill not found at ${skillDir}`);
182
177
  }
183
- if (existsSync(dest)) {
184
- if (!opts.force) {
185
- console.log(`hyperdecks skill already installed at ${dest}`);
186
- console.log("Run `hyperdecks skills install --force` to refresh it.");
187
- return { installed: false, path: dest };
188
- }
189
- rmSync(dest, { recursive: true, force: true });
178
+ if (opts.path || opts.dir) {
179
+ throw new Error("skills install now uses `npx skills add`; use --agent/--project instead of --path");
180
+ }
181
+
182
+ const agents = opts["all-agents"]
183
+ ? ["*"]
184
+ : String(opts.agent || "codex,claude-code").split(/[,\s]+/).filter(Boolean);
185
+ const args = ["-y", "skills@latest", "add", PACKAGED_SKILLS_DIR];
186
+ if (!opts.project) args.push("-g");
187
+ args.push("-a", ...agents, "-s", "hyperdecks", "--copy", "-y", "--full-depth");
188
+
189
+ const command = process.platform === "win32" ? "npx.cmd" : "npx";
190
+ const result = spawnSync(command, args, { stdio: "inherit" });
191
+ if (result.error) throw result.error;
192
+ if (result.status !== 0) {
193
+ throw new Error(`skills add failed with exit code ${result.status}`);
190
194
  }
191
- mkdirSync(root, { recursive: true });
192
- cpSync(PACKAGED_SKILL_DIR, dest, { recursive: true });
193
- console.log(`OK installed hyperdecks skill to ${dest}`);
194
- console.log("Restart Codex or start a new session if the skill list is already loaded.");
195
- return { installed: true, path: dest };
195
+ return { installed: true };
196
196
  }
197
197
 
198
198
  async function verifyAndStampEmail(t, opts) {