gooseworks 0.2.2 → 0.2.5
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/.claude-plugin/plugin.json +4 -2
- package/README.md +31 -4
- package/dist/agents/claude.d.ts.map +1 -1
- package/dist/agents/claude.js +4 -3
- package/dist/agents/claude.js.map +1 -1
- package/dist/agents/codex.d.ts.map +1 -1
- package/dist/agents/codex.js +4 -3
- package/dist/agents/codex.js.map +1 -1
- package/dist/auth/oauth-server.d.ts.map +1 -1
- package/dist/auth/oauth-server.js +27 -19
- package/dist/auth/oauth-server.js.map +1 -1
- package/dist/commands/formats.d.ts +3 -0
- package/dist/commands/formats.d.ts.map +1 -0
- package/dist/commands/formats.js +155 -0
- package/dist/commands/formats.js.map +1 -0
- package/dist/commands/graphics/get-flow.d.ts +30 -0
- package/dist/commands/graphics/get-flow.d.ts.map +1 -0
- package/dist/commands/graphics/get-flow.js +212 -0
- package/dist/commands/graphics/get-flow.js.map +1 -0
- package/dist/commands/graphics/publish-flow.d.ts +28 -0
- package/dist/commands/graphics/publish-flow.d.ts.map +1 -0
- package/dist/commands/graphics/publish-flow.js +178 -0
- package/dist/commands/graphics/publish-flow.js.map +1 -0
- package/dist/commands/graphics/shared.d.ts +48 -0
- package/dist/commands/graphics/shared.d.ts.map +1 -0
- package/dist/commands/graphics/shared.js +181 -0
- package/dist/commands/graphics/shared.js.map +1 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +29 -1
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/styles.d.ts +3 -0
- package/dist/commands/styles.d.ts.map +1 -0
- package/dist/commands/styles.js +157 -0
- package/dist/commands/styles.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/graphics-api.d.ts +106 -0
- package/dist/lib/graphics-api.d.ts.map +1 -0
- package/dist/lib/graphics-api.js +289 -0
- package/dist/lib/graphics-api.js.map +1 -0
- package/dist/lib/graphics-cache.d.ts +31 -0
- package/dist/lib/graphics-cache.d.ts.map +1 -0
- package/dist/lib/graphics-cache.js +126 -0
- package/dist/lib/graphics-cache.js.map +1 -0
- package/dist/lib/graphics-manifest.d.ts +96 -0
- package/dist/lib/graphics-manifest.d.ts.map +1 -0
- package/dist/lib/graphics-manifest.js +289 -0
- package/dist/lib/graphics-manifest.js.map +1 -0
- package/dist/skills/installer.d.ts +7 -0
- package/dist/skills/installer.d.ts.map +1 -1
- package/dist/skills/installer.js +114 -2
- package/dist/skills/installer.js.map +1 -1
- package/dist/skills/names.d.ts +2 -0
- package/dist/skills/names.d.ts.map +1 -0
- package/dist/skills/names.js +7 -0
- package/dist/skills/names.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
"description": "100+ data tools for scraping, research, lead generation, and enrichment. Search Twitter/X, Reddit, LinkedIn, find emails, enrich companies, and more — all from your coding agent.",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "GooseWorks",
|
|
6
|
-
"email": "
|
|
7
|
-
}
|
|
6
|
+
"email": "goose@gooseworks.ai"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://gooseworks.ai",
|
|
9
|
+
"keywords": ["data", "scraping", "leads", "research", "gtm", "enrichment", "linkedin", "twitter", "reddit", "email"]
|
|
8
10
|
}
|
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Pick your agent:
|
|
|
9
9
|
```bash
|
|
10
10
|
# Claude Code
|
|
11
11
|
npx gooseworks install --claude
|
|
12
|
+
npx gooseworks install --claude --with goose-graphics
|
|
12
13
|
|
|
13
14
|
# Cursor
|
|
14
15
|
npx gooseworks install --cursor
|
|
@@ -25,6 +26,8 @@ This does three things:
|
|
|
25
26
|
2. Installs the GooseWorks skill into your coding agent
|
|
26
27
|
3. You're ready — ask your agent to "scrape reddit", "find leads", "research competitors"
|
|
27
28
|
|
|
29
|
+
Use `--with <skill-slug>` to install standalone GooseWorks skills alongside the main GooseWorks skill. For example, `--with goose-graphics` installs `/goose-graphics` locally so your agent can run it directly without doing a catalog lookup through `/gooseworks`.
|
|
30
|
+
|
|
28
31
|
### Other install methods
|
|
29
32
|
|
|
30
33
|
```bash
|
|
@@ -33,6 +36,12 @@ npx skills add gooseworks-ai/gooseworks
|
|
|
33
36
|
|
|
34
37
|
# Via Claude Code plugins
|
|
35
38
|
/plugin install gooseworks
|
|
39
|
+
|
|
40
|
+
# Via OpenClaw ClawHub
|
|
41
|
+
clawhub skill install gooseworks
|
|
42
|
+
|
|
43
|
+
# Via Codex (OpenAI) — available once merged into openai/skills
|
|
44
|
+
codex skills install gooseworks
|
|
36
45
|
```
|
|
37
46
|
|
|
38
47
|
## Commands
|
|
@@ -46,12 +55,17 @@ npx gooseworks install --claude # Configure for Claude Code
|
|
|
46
55
|
npx gooseworks install --cursor # Configure for Cursor
|
|
47
56
|
npx gooseworks install --codex # Configure for Codex
|
|
48
57
|
npx gooseworks install --all # Configure all detected agents
|
|
58
|
+
npx gooseworks install --claude --with goose-graphics
|
|
59
|
+
npx gooseworks install --claude --with goose-graphics --with aeo
|
|
49
60
|
```
|
|
50
61
|
|
|
51
62
|
**What it does:**
|
|
52
63
|
- Runs `login` if you don't have credentials yet
|
|
53
64
|
- Writes the GooseWorks skill to `~/.agents/skills/gooseworks/SKILL.md`
|
|
54
|
-
-
|
|
65
|
+
- Downloads any `--with` standalone skills from `gooseworks-ai/goose-skills` into `~/.agents/skills/<slug>/`
|
|
66
|
+
- Creates symlinks in `~/.claude/skills/` (Claude) or `~/.codex/skills/` (Codex), or writes MCP config (Cursor)
|
|
67
|
+
|
|
68
|
+
`--with` is repeatable. Unknown slugs are reported clearly and do not block the main GooseWorks skill install.
|
|
55
69
|
|
|
56
70
|
### `login`
|
|
57
71
|
|
|
@@ -118,6 +132,8 @@ npx gooseworks update
|
|
|
118
132
|
4. **Runs it** — downloads and executes the skill's Python scripts, which call GooseWorks APIs
|
|
119
133
|
5. **You get results** — structured data returned directly in your coding agent
|
|
120
134
|
|
|
135
|
+
Standalone skills installed with `--with` skip the catalog search step. After `npx gooseworks install --claude --with goose-graphics`, you can invoke `/goose-graphics ...` directly from Claude Code.
|
|
136
|
+
|
|
121
137
|
## What's Included
|
|
122
138
|
|
|
123
139
|
100+ skills across these categories:
|
|
@@ -146,15 +162,26 @@ npx gooseworks update
|
|
|
146
162
|
|
|
147
163
|
```
|
|
148
164
|
~/.agents/skills/
|
|
149
|
-
|
|
150
|
-
|
|
165
|
+
├── gooseworks/
|
|
166
|
+
│ └── SKILL.md # GooseWorks skill — teaches your agent to use 100+ data tools
|
|
167
|
+
└── goose-graphics/
|
|
168
|
+
└── SKILL.md # Optional standalone skill installed with --with
|
|
151
169
|
```
|
|
152
170
|
|
|
153
171
|
### Claude Code Symlinks
|
|
154
172
|
|
|
155
173
|
```
|
|
156
174
|
~/.claude/skills/
|
|
157
|
-
|
|
175
|
+
├── gooseworks → ~/.agents/skills/gooseworks
|
|
176
|
+
└── goose-graphics → ~/.agents/skills/goose-graphics
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Codex Symlinks
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
~/.codex/skills/
|
|
183
|
+
├── gooseworks → ~/.agents/skills/gooseworks
|
|
184
|
+
└── goose-graphics → ~/.agents/skills/goose-graphics
|
|
158
185
|
```
|
|
159
186
|
|
|
160
187
|
## Pricing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/agents/claude.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/agents/claude.ts"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,eAAe,IAAI,MAAM,CA+CxC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAgBnC"}
|
package/dist/agents/claude.js
CHANGED
|
@@ -40,6 +40,7 @@ const fs = __importStar(require("fs"));
|
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const os = __importStar(require("os"));
|
|
42
42
|
const installer_1 = require("../skills/installer");
|
|
43
|
+
const names_1 = require("../skills/names");
|
|
43
44
|
const CLAUDE_SKILLS_DIR = path.join(os.homedir(), '.claude', 'skills');
|
|
44
45
|
function getClaudeSkillsDir() {
|
|
45
46
|
return CLAUDE_SKILLS_DIR;
|
|
@@ -54,7 +55,7 @@ function configureClaude() {
|
|
|
54
55
|
try {
|
|
55
56
|
const existing = fs.readdirSync(CLAUDE_SKILLS_DIR);
|
|
56
57
|
for (const entry of existing) {
|
|
57
|
-
if (
|
|
58
|
+
if (!(0, names_1.isManagedGooseworksSkill)(entry))
|
|
58
59
|
continue;
|
|
59
60
|
const target = path.join(CLAUDE_SKILLS_DIR, entry);
|
|
60
61
|
try {
|
|
@@ -73,7 +74,7 @@ function configureClaude() {
|
|
|
73
74
|
}
|
|
74
75
|
// Symlink only what's currently in ~/.agents/skills/
|
|
75
76
|
const skillDirs = fs.readdirSync(skillsBase)
|
|
76
|
-
.filter(
|
|
77
|
+
.filter(names_1.isManagedGooseworksSkill);
|
|
77
78
|
let linked = 0;
|
|
78
79
|
for (const skillDir of skillDirs) {
|
|
79
80
|
const source = path.join(skillsBase, skillDir);
|
|
@@ -95,7 +96,7 @@ function removeClaude() {
|
|
|
95
96
|
return;
|
|
96
97
|
const entries = fs.readdirSync(CLAUDE_SKILLS_DIR);
|
|
97
98
|
for (const entry of entries) {
|
|
98
|
-
if (
|
|
99
|
+
if (!(0, names_1.isManagedGooseworksSkill)(entry))
|
|
99
100
|
continue;
|
|
100
101
|
const target = path.join(CLAUDE_SKILLS_DIR, entry);
|
|
101
102
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/agents/claude.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"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AAE,CAAC;gBAC1B,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/agents/codex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/agents/codex.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,cAAc,IAAI,MAAM,CA+CvC;AAED,wBAAgB,WAAW,IAAI,IAAI,CAgBlC"}
|
package/dist/agents/codex.js
CHANGED
|
@@ -40,6 +40,7 @@ const fs = __importStar(require("fs"));
|
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const os = __importStar(require("os"));
|
|
42
42
|
const installer_1 = require("../skills/installer");
|
|
43
|
+
const names_1 = require("../skills/names");
|
|
43
44
|
const CODEX_SKILLS_DIR = path.join(os.homedir(), '.codex', 'skills');
|
|
44
45
|
function getCodexSkillsDir() {
|
|
45
46
|
return CODEX_SKILLS_DIR;
|
|
@@ -54,7 +55,7 @@ function configureCodex() {
|
|
|
54
55
|
try {
|
|
55
56
|
const existing = fs.readdirSync(CODEX_SKILLS_DIR);
|
|
56
57
|
for (const entry of existing) {
|
|
57
|
-
if (
|
|
58
|
+
if (!(0, names_1.isManagedGooseworksSkill)(entry))
|
|
58
59
|
continue;
|
|
59
60
|
const target = path.join(CODEX_SKILLS_DIR, entry);
|
|
60
61
|
try {
|
|
@@ -73,7 +74,7 @@ function configureCodex() {
|
|
|
73
74
|
}
|
|
74
75
|
// Symlink only what's currently in ~/.agents/skills/
|
|
75
76
|
const skillDirs = fs.readdirSync(skillsBase)
|
|
76
|
-
.filter(
|
|
77
|
+
.filter(names_1.isManagedGooseworksSkill);
|
|
77
78
|
let linked = 0;
|
|
78
79
|
for (const skillDir of skillDirs) {
|
|
79
80
|
const source = path.join(skillsBase, skillDir);
|
|
@@ -95,7 +96,7 @@ function removeCodex() {
|
|
|
95
96
|
return;
|
|
96
97
|
const entries = fs.readdirSync(CODEX_SKILLS_DIR);
|
|
97
98
|
for (const entry of entries) {
|
|
98
|
-
if (
|
|
99
|
+
if (!(0, names_1.isManagedGooseworksSkill)(entry))
|
|
99
100
|
continue;
|
|
100
101
|
const target = path.join(CODEX_SKILLS_DIR, entry);
|
|
101
102
|
try {
|
package/dist/agents/codex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/agents/codex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/agents/codex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,8CAEC;AAED,wCA+CC;AAED,kCAgBC;AA7ED,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,mDAAwD;AACxD,2CAA2D;AAE3D,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAErE,SAAgB,iBAAiB;IAC/B,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAgB,cAAc;IAC5B,MAAM,UAAU,GAAG,IAAA,6BAAiB,GAAE,CAAC;IACvC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpD,+CAA+C;IAC/C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,EAAE,CAAC,WA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AAM,EAAE,CAAC;IACX,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,WAAW;IACzB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO;IAE7C,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAA,gCAAwB,EAAC,KAAK,CAAC;YAAE,SAAS;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAClC,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC1B,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-server.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":"AAUA,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"oauth-server.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":"AAUA,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CA6HxE"}
|
|
@@ -70,12 +70,6 @@ async function runOAuthFlow(apiBase) {
|
|
|
70
70
|
res.end('<html><body><h2>Authentication failed: missing parameters</h2><p>You can close this window.</p></body></html>');
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
// Send response with Connection: close so browser doesn't keep-alive
|
|
74
|
-
res.writeHead(200, {
|
|
75
|
-
'Content-Type': 'text/html',
|
|
76
|
-
'Connection': 'close',
|
|
77
|
-
});
|
|
78
|
-
res.end('<html><body><h2>GooseWorks CLI authenticated!</h2><p>You can close this window and return to your terminal.</p></body></html>');
|
|
79
73
|
const creds = {
|
|
80
74
|
api_key: token,
|
|
81
75
|
email,
|
|
@@ -89,20 +83,34 @@ async function runOAuthFlow(apiBase) {
|
|
|
89
83
|
clearTimeout(timeout);
|
|
90
84
|
process.removeListener('SIGINT', cleanup);
|
|
91
85
|
process.removeListener('SIGTERM', cleanup);
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
// Plain 200 + HTML — no Connection: close, no synchronous socket
|
|
87
|
+
// teardown. The previous code closed the server and destroyed
|
|
88
|
+
// sockets in the same tick as `res.end()`, racing the response
|
|
89
|
+
// flush; the browser ended up rendering ERR_CONNECTION_REFUSED
|
|
90
|
+
// instead of the success page.
|
|
91
|
+
//
|
|
92
|
+
// Now we resolve the OAuth promise immediately so the CLI can
|
|
93
|
+
// continue with the rest of `install`, and schedule a delayed
|
|
94
|
+
// teardown that gives the browser a few seconds to render and
|
|
95
|
+
// ignore favicon failures. The CLI process exits naturally once
|
|
96
|
+
// its remaining steps complete (server.close + socket.destroy
|
|
97
|
+
// make sure the listening port is released before that).
|
|
98
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
99
|
+
res.end('<html><body><h2>GooseWorks CLI authenticated!</h2><p>You can close this window and return to your terminal.</p></body></html>');
|
|
100
|
+
resolve({
|
|
101
|
+
api_key: token,
|
|
102
|
+
email,
|
|
103
|
+
agent_id: agentId,
|
|
104
|
+
...(scopeType ? { scope_type: scopeType } : {}),
|
|
105
|
+
...(defaultAgentId ? { default_agent_id: defaultAgentId } : {}),
|
|
106
|
+
...(mcpServerUrl ? { mcp_server_url: mcpServerUrl } : {}),
|
|
102
107
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
server.close();
|
|
110
|
+
for (const socket of sockets) {
|
|
111
|
+
socket.destroy();
|
|
112
|
+
}
|
|
113
|
+
}, 5000);
|
|
106
114
|
}
|
|
107
115
|
else {
|
|
108
116
|
res.writeHead(404);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-server.js","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,
|
|
1
|
+
{"version":3,"file":"oauth-server.js","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,oCA6HC;AAhJD,2CAA6B;AAE7B,+CAAiC;AACjC,gDAAwB;AACxB,+CAAkE;AAClE,wDAA0C;AAC1C,sCAAyC;AAEzC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAW1B,KAAK,UAAU,YAAY,CAAC,OAAe;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,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,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatsCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const config_1 = require("../config");
|
|
6
|
+
const graphics_manifest_1 = require("../lib/graphics-manifest");
|
|
7
|
+
const graphics_api_1 = require("../lib/graphics-api");
|
|
8
|
+
const shared_1 = require("./graphics/shared");
|
|
9
|
+
const publish_flow_1 = require("./graphics/publish-flow");
|
|
10
|
+
const get_flow_1 = require("./graphics/get-flow");
|
|
11
|
+
function renderListTable(rows) {
|
|
12
|
+
return (0, shared_1.renderTable)(rows, [
|
|
13
|
+
{ header: 'NAME', get: (r) => (0, shared_1.truncate)(r.name, 40) },
|
|
14
|
+
{ header: 'SLUG', get: (r) => r.slug },
|
|
15
|
+
{
|
|
16
|
+
header: 'SIZE',
|
|
17
|
+
get: (r) => r.width != null && r.height != null ? `${r.width}×${r.height}` : '',
|
|
18
|
+
},
|
|
19
|
+
{ header: 'FEATURED', get: (r) => (r.featured ? '★' : '') },
|
|
20
|
+
{ header: 'AUTHOR', get: (r) => r.authorHandle ?? '' },
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
const listCmd = new commander_1.Command('list')
|
|
24
|
+
.description('List published graphic formats')
|
|
25
|
+
.option('--featured', 'Only featured formats')
|
|
26
|
+
.option('--q <query>', 'Free-text query')
|
|
27
|
+
.option('--limit <n>', 'Max rows to return')
|
|
28
|
+
.option('--offset <n>', 'Skip the first N rows')
|
|
29
|
+
.option('--json', 'Print full JSON instead of a table')
|
|
30
|
+
.action(async (opts) => {
|
|
31
|
+
try {
|
|
32
|
+
const env = await (0, graphics_api_1.listFormats)((0, shared_1.clientOpts)(), {
|
|
33
|
+
q: opts.q,
|
|
34
|
+
featured: !!opts.featured,
|
|
35
|
+
limit: (0, shared_1.parseIntOpt)(opts.limit, 'limit'),
|
|
36
|
+
offset: (0, shared_1.parseIntOpt)(opts.offset, 'offset'),
|
|
37
|
+
});
|
|
38
|
+
if (opts.json) {
|
|
39
|
+
process.stdout.write(JSON.stringify(env.data, null, 2) + '\n');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (env.data.length === 0) {
|
|
43
|
+
process.stderr.write('No formats match.\n');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
process.stdout.write(renderListTable(env.data) + '\n');
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
(0, shared_1.reportApiErrorAndExit)(err);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const searchCmd = new commander_1.Command('search')
|
|
53
|
+
.description('Search graphic formats (alias for `list --q <query>`)')
|
|
54
|
+
.argument('<query>', 'Search query')
|
|
55
|
+
.option('--json', 'Print full JSON instead of a table')
|
|
56
|
+
.option('--limit <n>', 'Max rows to return')
|
|
57
|
+
.option('--offset <n>', 'Skip the first N rows')
|
|
58
|
+
.action(async (query, opts) => {
|
|
59
|
+
try {
|
|
60
|
+
const env = await (0, graphics_api_1.listFormats)((0, shared_1.clientOpts)(), {
|
|
61
|
+
q: query,
|
|
62
|
+
limit: (0, shared_1.parseIntOpt)(opts.limit, 'limit'),
|
|
63
|
+
offset: (0, shared_1.parseIntOpt)(opts.offset, 'offset'),
|
|
64
|
+
});
|
|
65
|
+
if (opts.json) {
|
|
66
|
+
process.stdout.write(JSON.stringify(env.data, null, 2) + '\n');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (env.data.length === 0) {
|
|
70
|
+
process.stderr.write(`No formats match "${query}".\n`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
process.stdout.write(renderListTable(env.data) + '\n');
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
(0, shared_1.reportApiErrorAndExit)(err);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const getCmd = new commander_1.Command('get')
|
|
80
|
+
.description('Print a format\'s spec.md (default) or full JSON record')
|
|
81
|
+
.argument('<slug>', 'Format slug')
|
|
82
|
+
.option('--json', 'Print full JSON record instead of spec.md')
|
|
83
|
+
.option('--include-examples', 'Also download example PNGs into ./<slug>/')
|
|
84
|
+
.option('--no-cache', 'Bypass local ETag cache')
|
|
85
|
+
.action(async (slug, opts) => {
|
|
86
|
+
const opt = (0, shared_1.clientOpts)();
|
|
87
|
+
await (0, get_flow_1.runGetFlow)({
|
|
88
|
+
resource: 'formats',
|
|
89
|
+
fetchMarkdown: (s, etag) => (0, graphics_api_1.getFormatSpecMd)(opt, s, etag),
|
|
90
|
+
fetchRecord: (s, etag) => (0, graphics_api_1.getFormatRecord)(opt, s, etag),
|
|
91
|
+
}, slug, {
|
|
92
|
+
json: opts.json,
|
|
93
|
+
includeExamples: opts.includeExamples,
|
|
94
|
+
noCache: opts.cache === false,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
const publishCmd = new commander_1.Command('publish')
|
|
98
|
+
.description('Publish a format from a directory containing gooseworks-format.json')
|
|
99
|
+
.argument('[path]', 'Directory containing the manifest', '.')
|
|
100
|
+
.option('--slug <slug>', 'Override the manifest slug')
|
|
101
|
+
.option('--yes', 'Skip the slug-collision prompt and accept the suggestion')
|
|
102
|
+
.action(async (dir, opts) => {
|
|
103
|
+
const auth = (0, shared_1.authedClientOpts)();
|
|
104
|
+
await (0, publish_flow_1.runPublishFlow)({
|
|
105
|
+
manifestFilename: graphics_manifest_1.FORMAT_MANIFEST_FILENAME,
|
|
106
|
+
validate: graphics_manifest_1.validateFormatManifest,
|
|
107
|
+
hubUrl: (slug) => `${config_1.FRONTEND_URL}/formats/${slug}`,
|
|
108
|
+
label: 'format',
|
|
109
|
+
upload: (manifest, files) => (0, graphics_api_1.publishFormat)(auth, manifest, files),
|
|
110
|
+
}, { dir, slug: opts.slug, yes: opts.yes });
|
|
111
|
+
});
|
|
112
|
+
const updateCmd = new commander_1.Command('update')
|
|
113
|
+
.description('Update a format by slug')
|
|
114
|
+
.argument('<slug>', 'Format slug to update')
|
|
115
|
+
.argument('[path]', 'Directory containing the manifest', '.')
|
|
116
|
+
.action(async (slug, dir) => {
|
|
117
|
+
const auth = (0, shared_1.authedClientOpts)();
|
|
118
|
+
await (0, publish_flow_1.runUpdateFlow)({
|
|
119
|
+
manifestFilename: graphics_manifest_1.FORMAT_MANIFEST_FILENAME,
|
|
120
|
+
validate: graphics_manifest_1.validateFormatManifest,
|
|
121
|
+
hubUrl: (s) => `${config_1.FRONTEND_URL}/formats/${s}`,
|
|
122
|
+
label: 'format',
|
|
123
|
+
upload: (manifest, files) => (0, graphics_api_1.updateFormat)(auth, slug, manifest, files),
|
|
124
|
+
}, { dir, slug, yes: true });
|
|
125
|
+
});
|
|
126
|
+
const deleteCmd = new commander_1.Command('delete')
|
|
127
|
+
.description('Delete a format by slug (owner only)')
|
|
128
|
+
.argument('<slug>', 'Format slug to delete')
|
|
129
|
+
.option('--yes', 'Skip the confirmation prompt')
|
|
130
|
+
.action(async (slug, opts) => {
|
|
131
|
+
const auth = (0, shared_1.authedClientOpts)();
|
|
132
|
+
if (!opts.yes) {
|
|
133
|
+
const ok = await (0, shared_1.promptYesNo)(`Delete format '${slug}'?`, false);
|
|
134
|
+
if (!ok) {
|
|
135
|
+
process.stderr.write('Aborted.\n');
|
|
136
|
+
process.exit(shared_1.EXIT_USER_ERROR);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
await (0, graphics_api_1.deleteFormat)(auth, slug);
|
|
141
|
+
process.stdout.write(`Deleted format '${slug}'.\n`);
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
(0, shared_1.reportApiErrorAndExit)(err);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
exports.formatsCommand = new commander_1.Command('formats')
|
|
148
|
+
.description('Browse and publish graphic formats')
|
|
149
|
+
.addCommand(listCmd)
|
|
150
|
+
.addCommand(searchCmd)
|
|
151
|
+
.addCommand(getCmd)
|
|
152
|
+
.addCommand(publishCmd)
|
|
153
|
+
.addCommand(updateCmd)
|
|
154
|
+
.addCommand(deleteCmd);
|
|
155
|
+
//# sourceMappingURL=formats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/commands/formats.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,sCAAyC;AACzC,gEAGkC;AAClC,sDAS6B;AAC7B,8CAS2B;AAC3B,0DAAwE;AACxE,kDAAiD;AAUjD,SAAS,eAAe,CAAC,IAAgD;IACvE,OAAO,IAAA,oBAAW,EAAC,IAAI,EAAE;QACvB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,iBAAQ,EAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;QACpD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QACtC;YACE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CACT,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;SACtE;QACD,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAC3D,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,EAAE;KACvD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO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
* the body to stdout, with ETag-keyed disk cache and offline fallback.
|
|
6
|
+
*
|
|
7
|
+
* --json: hits the JSON record endpoint and prints it to stdout.
|
|
8
|
+
*
|
|
9
|
+
* --include-examples: also downloads example PNGs from the JSON record into
|
|
10
|
+
* ./<slug>/<format>.png (current working directory).
|
|
11
|
+
*/
|
|
12
|
+
import { type MarkdownResponse, type RecordResponse } from '../../lib/graphics-api';
|
|
13
|
+
import { type Resource } from '../../lib/graphics-cache';
|
|
14
|
+
export interface GetConfig<T> {
|
|
15
|
+
resource: Resource;
|
|
16
|
+
/** Hits `:slug/design.md` or `:slug/spec.md`. */
|
|
17
|
+
fetchMarkdown: (slug: string, etag: string | null) => Promise<MarkdownResponse>;
|
|
18
|
+
/** Hits `:slug` for the full JSON record, with ETag round-trip. */
|
|
19
|
+
fetchRecord: (slug: string, etag: string | null) => Promise<RecordResponse<T>>;
|
|
20
|
+
}
|
|
21
|
+
export interface GetOptions {
|
|
22
|
+
json?: boolean;
|
|
23
|
+
includeExamples?: boolean;
|
|
24
|
+
noCache?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function runGetFlow<T extends {
|
|
27
|
+
examples?: unknown[];
|
|
28
|
+
slug?: string;
|
|
29
|
+
}>(cfg: GetConfig<T>, slug: string, opts: GetOptions): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=get-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-flow.d.ts","sourceRoot":"","sources":["../../../src/commands/graphics/get-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAIlC,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,iDAAiD;IACjD,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChF,mEAAmE;IACnE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CAChF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAChF,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,IAAI,CAAC,CASf"}
|