@hypersocial/decks-cli 0.1.2 → 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 +2 -0
- package/package.json +2 -1
- package/skills/hyperdecks/SKILL.md +55 -0
- package/skills/hyperdecks/agents/openai.yaml +4 -0
- package/src/commands.mjs +5 -1
- package/src/runtime.mjs +32 -4
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ pnpm dlx @hypersocial/decks-cli whoami
|
|
|
16
16
|
pnpm dlx @hypersocial/decks-cli deck list
|
|
17
17
|
pnpm dlx @hypersocial/decks-cli deck stats netflix
|
|
18
18
|
pnpm dlx @hypersocial/decks-cli activity --limit 20
|
|
19
|
+
pnpm dlx @hypersocial/decks-cli skills install
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
Global install:
|
|
@@ -60,6 +61,7 @@ share rm <token>
|
|
|
60
61
|
share url <token>
|
|
61
62
|
|
|
62
63
|
recipient archive|unarchive <name>
|
|
64
|
+
skills install [--agent codex,claude-code] [--project]
|
|
63
65
|
activity [--deck <slug>] [--limit <n>] [--json]
|
|
64
66
|
```
|
|
65
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypersocial/decks-cli",
|
|
3
|
-
"version": "0.1.
|
|
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",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"bin/",
|
|
23
23
|
"src/",
|
|
24
|
+
"skills/",
|
|
24
25
|
"README.md"
|
|
25
26
|
],
|
|
26
27
|
"engines": {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hyperdecks
|
|
3
|
+
description: Use when working with Hypersocial Decks, Hyperdecks CLI, production deck analytics, recipient share links, deck activity, MCP deck tools, or real-world/customer-facing deck checks. Prefer production for real activity and analytics; use development only for local implementation/testing when explicitly requested.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hyperdecks
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Hyperdecks is the CLI and MCP surface for Hypersocial Decks live analytics,
|
|
11
|
+
recipient links, and deck activity. Treat real recipient activity, live deck
|
|
12
|
+
stats, customer-facing links, and "what happened" questions as production work.
|
|
13
|
+
|
|
14
|
+
## Target Selection
|
|
15
|
+
|
|
16
|
+
- Prefer production for real-world questions and actions. The published CLI is
|
|
17
|
+
prod-first, so `hyperdecks whoami`, `hyperdecks deck list`, and
|
|
18
|
+
`hyperdecks activity` already target prod.
|
|
19
|
+
- Use development only for implementation/testing when the user explicitly asks
|
|
20
|
+
for dev/local behavior. Dev requires a Convex URL with `--dev --convex <url>`
|
|
21
|
+
or `HSDECKS_CONVEX_URL`.
|
|
22
|
+
- Do not use `decks.localhost` for production checks.
|
|
23
|
+
|
|
24
|
+
## CLI Workflow
|
|
25
|
+
|
|
26
|
+
Use the installed CLI when available:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
hyperdecks whoami
|
|
30
|
+
hyperdecks deck list
|
|
31
|
+
hyperdecks activity --limit 10
|
|
32
|
+
hyperdecks deck stats <slug>
|
|
33
|
+
hyperdecks share list <slug>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If the CLI is missing, recommend:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm dlx hyperdecks <command>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If authentication is missing, run or ask the user to run:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
hyperdecks login
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Safety
|
|
49
|
+
|
|
50
|
+
- For read-only inspection, run commands directly and summarize the important
|
|
51
|
+
output.
|
|
52
|
+
- For share creation, revocation, deletion, recipient archive/unarchive, or other
|
|
53
|
+
live changes, state the action and target clearly before executing when user
|
|
54
|
+
intent is ambiguous.
|
|
55
|
+
- Avoid printing full share tokens unless the user needs the exact URL/token.
|
package/src/commands.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { login, logout, openBrowser, parse, target, VERSION } from "./runtime.mjs";
|
|
1
|
+
import { installHyperdecksSkill, login, logout, openBrowser, parse, target, VERSION } from "./runtime.mjs";
|
|
2
2
|
import * as ops from "./ops.mjs";
|
|
3
3
|
|
|
4
4
|
const fmtMs = (ms) => (ms >= 60000 ? `${(ms / 60000).toFixed(1)}m` : `${Math.round(ms / 1000)}s`);
|
|
@@ -155,6 +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 [--agent codex,claude-code] [--project]
|
|
159
|
+
skills install [--agent codex,claude-code] [--project]
|
|
158
160
|
activity [--deck <slug>] [--limit <n>] [--json]
|
|
159
161
|
|
|
160
162
|
global:
|
|
@@ -193,6 +195,8 @@ export async function runCli(argv = process.argv.slice(2)) {
|
|
|
193
195
|
"share url": () => shareUrl(rest, opts),
|
|
194
196
|
"recipient archive": () => recipientArchive(rest, opts, true),
|
|
195
197
|
"recipient unarchive": () => recipientArchive(rest, opts, false),
|
|
198
|
+
"skill install": () => installHyperdecksSkill(opts),
|
|
199
|
+
"skills install": () => installHyperdecksSkill(opts),
|
|
196
200
|
activity: () => activity(pos.slice(1), opts),
|
|
197
201
|
};
|
|
198
202
|
|
package/src/runtime.mjs
CHANGED
|
@@ -1,13 +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
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
|
-
import { join } from "node:path";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
7
8
|
import { ConvexHttpClient } from "convex/browser";
|
|
8
9
|
import { makeFunctionReference } from "convex/server";
|
|
9
10
|
|
|
10
|
-
export const VERSION = "0.1.
|
|
11
|
+
export const VERSION = "0.1.4";
|
|
11
12
|
|
|
12
13
|
export const PROD = {
|
|
13
14
|
name: "prod",
|
|
@@ -37,10 +38,12 @@ export const api = {
|
|
|
37
38
|
},
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
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"]);
|
|
41
42
|
|
|
42
43
|
export const CRED_DIR = join(homedir(), ".config", "hypersocial-decks");
|
|
43
44
|
export const CRED_FILE = join(CRED_DIR, "credentials.json");
|
|
45
|
+
const SRC_DIR = dirname(fileURLToPath(import.meta.url));
|
|
46
|
+
const PACKAGED_SKILLS_DIR = join(SRC_DIR, "..", "skills");
|
|
44
47
|
|
|
45
48
|
export function parse(args) {
|
|
46
49
|
const opts = {};
|
|
@@ -167,6 +170,31 @@ export function openBrowser(url) {
|
|
|
167
170
|
execFile(cmd, args, () => {});
|
|
168
171
|
}
|
|
169
172
|
|
|
173
|
+
export function installHyperdecksSkill(opts = {}) {
|
|
174
|
+
const skillDir = join(PACKAGED_SKILLS_DIR, "hyperdecks");
|
|
175
|
+
if (!existsSync(skillDir)) {
|
|
176
|
+
throw new Error(`packaged hyperdecks skill not found at ${skillDir}`);
|
|
177
|
+
}
|
|
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}`);
|
|
194
|
+
}
|
|
195
|
+
return { installed: true };
|
|
196
|
+
}
|
|
197
|
+
|
|
170
198
|
async function verifyAndStampEmail(t, opts) {
|
|
171
199
|
const c = await client(opts);
|
|
172
200
|
const who = await c.query(api.decks.whoami, {});
|