@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 +1 -1
- package/package.json +1 -1
- package/src/commands.mjs +2 -2
- package/src/runtime.mjs +25 -25
package/README.md
CHANGED
package/package.json
CHANGED
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 [--
|
|
159
|
-
skills install [--
|
|
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 {
|
|
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.
|
|
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", "
|
|
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
|
|
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
|
|
179
|
-
|
|
180
|
-
|
|
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 (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
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) {
|