firecrawl-cli 1.17.0 → 1.18.0
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 +13 -35
- package/dist/__tests__/commands/init.test.js +4 -2
- package/dist/__tests__/commands/init.test.js.map +1 -1
- package/dist/__tests__/commands/setup.test.js +6 -2
- package/dist/__tests__/commands/setup.test.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +27 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/monitor.d.ts +23 -0
- package/dist/commands/monitor.d.ts.map +1 -0
- package/dist/commands/monitor.js +395 -0
- package/dist/commands/monitor.js.map +1 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +9 -5
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skills-install.d.ts +9 -1
- package/dist/commands/skills-install.d.ts.map +1 -1
- package/dist/commands/skills-install.js +13 -2
- package/dist/commands/skills-install.js.map +1 -1
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/experimental/backends.d.ts +0 -19
- package/dist/commands/experimental/backends.d.ts.map +0 -1
- package/dist/commands/experimental/backends.js +0 -74
- package/dist/commands/experimental/backends.js.map +0 -1
- package/dist/commands/experimental/index.d.ts +0 -13
- package/dist/commands/experimental/index.d.ts.map +0 -1
- package/dist/commands/experimental/index.js +0 -200
- package/dist/commands/experimental/index.js.map +0 -1
- package/dist/commands/experimental/shared.d.ts +0 -17
- package/dist/commands/experimental/shared.d.ts.map +0 -1
- package/dist/commands/experimental/shared.js +0 -152
- package/dist/commands/experimental/shared.js.map +0 -1
- package/dist/commands/experimental/workflows/company-directories.d.ts +0 -11
- package/dist/commands/experimental/workflows/company-directories.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/company-directories.js +0 -245
- package/dist/commands/experimental/workflows/company-directories.js.map +0 -1
- package/dist/commands/experimental/workflows/competitive-intel.d.ts +0 -11
- package/dist/commands/experimental/workflows/competitive-intel.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/competitive-intel.js +0 -226
- package/dist/commands/experimental/workflows/competitive-intel.js.map +0 -1
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts +0 -10
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/competitor-analysis.js +0 -196
- package/dist/commands/experimental/workflows/competitor-analysis.js.map +0 -1
- package/dist/commands/experimental/workflows/dashboard-reporting.d.ts +0 -11
- package/dist/commands/experimental/workflows/dashboard-reporting.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/dashboard-reporting.js +0 -254
- package/dist/commands/experimental/workflows/dashboard-reporting.js.map +0 -1
- package/dist/commands/experimental/workflows/deep-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/deep-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/deep-research.js +0 -159
- package/dist/commands/experimental/workflows/deep-research.js.map +0 -1
- package/dist/commands/experimental/workflows/demo.d.ts +0 -11
- package/dist/commands/experimental/workflows/demo.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/demo.js +0 -190
- package/dist/commands/experimental/workflows/demo.js.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-base.d.ts +0 -11
- package/dist/commands/experimental/workflows/knowledge-base.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-base.js +0 -319
- package/dist/commands/experimental/workflows/knowledge-base.js.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-ingest.d.ts +0 -12
- package/dist/commands/experimental/workflows/knowledge-ingest.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-ingest.js +0 -251
- package/dist/commands/experimental/workflows/knowledge-ingest.js.map +0 -1
- package/dist/commands/experimental/workflows/lead-gen.d.ts +0 -11
- package/dist/commands/experimental/workflows/lead-gen.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/lead-gen.js +0 -257
- package/dist/commands/experimental/workflows/lead-gen.js.map +0 -1
- package/dist/commands/experimental/workflows/lead-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/lead-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/lead-research.js +0 -146
- package/dist/commands/experimental/workflows/lead-research.js.map +0 -1
- package/dist/commands/experimental/workflows/market-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/market-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/market-research.js +0 -260
- package/dist/commands/experimental/workflows/market-research.js.map +0 -1
- package/dist/commands/experimental/workflows/qa.d.ts +0 -11
- package/dist/commands/experimental/workflows/qa.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/qa.js +0 -184
- package/dist/commands/experimental/workflows/qa.js.map +0 -1
- package/dist/commands/experimental/workflows/research-papers.d.ts +0 -11
- package/dist/commands/experimental/workflows/research-papers.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/research-papers.js +0 -151
- package/dist/commands/experimental/workflows/research-papers.js.map +0 -1
- package/dist/commands/experimental/workflows/seo-audit.d.ts +0 -11
- package/dist/commands/experimental/workflows/seo-audit.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/seo-audit.js +0 -155
- package/dist/commands/experimental/workflows/seo-audit.js.map +0 -1
- package/dist/commands/experimental/workflows/shop.d.ts +0 -11
- package/dist/commands/experimental/workflows/shop.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/shop.js +0 -155
- package/dist/commands/experimental/workflows/shop.js.map +0 -1
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Workflow: Market Research
|
|
4
|
-
*
|
|
5
|
-
* Browses financial portals, earnings pages, and market data sites using a
|
|
6
|
-
* cloud browser. Interacts with charts, filters, and dropdowns to extract
|
|
7
|
-
* earnings data, market metrics, and financial comparisons across companies.
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.register = register;
|
|
44
|
-
const backends_1 = require("../backends");
|
|
45
|
-
const shared_1 = require("../shared");
|
|
46
|
-
// ─── Input gathering ────────────────────────────────────────────────────────
|
|
47
|
-
async function gatherInputs(prefill) {
|
|
48
|
-
if (prefill?.query) {
|
|
49
|
-
return {
|
|
50
|
-
query: prefill.query,
|
|
51
|
-
companies: '',
|
|
52
|
-
dataPoints: 'all',
|
|
53
|
-
output: 'json',
|
|
54
|
-
context: '',
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
58
|
-
const query = await input({
|
|
59
|
-
message: 'What market or industry to research? (e.g., "cloud infrastructure", "AI SaaS")',
|
|
60
|
-
validate: (0, shared_1.validateRequired)('Market or industry'),
|
|
61
|
-
});
|
|
62
|
-
const companies = await input({
|
|
63
|
-
message: 'Specific companies to include? (comma-separated, leave blank to discover)',
|
|
64
|
-
default: '',
|
|
65
|
-
});
|
|
66
|
-
const dataPoints = await select({
|
|
67
|
-
message: 'What data are you looking for?',
|
|
68
|
-
choices: [
|
|
69
|
-
{ name: 'Everything (revenue, earnings, metrics, news)', value: 'all' },
|
|
70
|
-
{
|
|
71
|
-
name: 'Financial data (revenue, earnings, margins)',
|
|
72
|
-
value: 'financial',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'Market metrics (market cap, P/E, growth rates)',
|
|
76
|
-
value: 'metrics',
|
|
77
|
-
},
|
|
78
|
-
{ name: 'Industry trends and news', value: 'trends' },
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
const output = await select({
|
|
82
|
-
message: 'Output format?',
|
|
83
|
-
choices: [
|
|
84
|
-
{ name: 'JSON (structured data)', value: 'json' },
|
|
85
|
-
{ name: 'Markdown report', value: 'markdown' },
|
|
86
|
-
{ name: 'Print to terminal', value: 'terminal' },
|
|
87
|
-
],
|
|
88
|
-
});
|
|
89
|
-
const context = await input({
|
|
90
|
-
message: 'Any specific angle? (e.g., "focus on Q4 2024 earnings", "compare gross margins")',
|
|
91
|
-
default: '',
|
|
92
|
-
});
|
|
93
|
-
return { query, companies, dataPoints, output, context };
|
|
94
|
-
}
|
|
95
|
-
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
96
|
-
function buildSystemPrompt(opts) {
|
|
97
|
-
const focusInstructions = {
|
|
98
|
-
all: 'Extract comprehensive data: revenue, earnings, margins, market cap, P/E ratio, growth rates, recent news, and analyst estimates.',
|
|
99
|
-
financial: 'Focus on financial statements: quarterly/annual revenue, net income, gross margin, operating margin, EPS, and YoY growth.',
|
|
100
|
-
metrics: 'Focus on market metrics: market cap, P/E ratio, P/S ratio, EV/EBITDA, 52-week range, average volume, and beta.',
|
|
101
|
-
trends: 'Focus on industry trends: market size estimates, growth forecasts, major deals/acquisitions, regulatory changes, and emerging players.',
|
|
102
|
-
};
|
|
103
|
-
const outputInstructions = {
|
|
104
|
-
terminal: 'Print the full market research report to the terminal in well-formatted markdown with data tables.',
|
|
105
|
-
json: `Save the report to \`market-research.json\` in the current directory. Tell the user the file path when done.
|
|
106
|
-
|
|
107
|
-
Use this schema:
|
|
108
|
-
\`\`\`json
|
|
109
|
-
{
|
|
110
|
-
"market": "string",
|
|
111
|
-
"researchedAt": "ISO-8601",
|
|
112
|
-
"companies": [
|
|
113
|
-
{
|
|
114
|
-
"name": "string",
|
|
115
|
-
"ticker": "string",
|
|
116
|
-
"sector": "string",
|
|
117
|
-
"financials": {
|
|
118
|
-
"revenue": { "value": "string", "period": "string", "yoyGrowth": "string" },
|
|
119
|
-
"netIncome": { "value": "string", "period": "string" },
|
|
120
|
-
"grossMargin": "string",
|
|
121
|
-
"operatingMargin": "string",
|
|
122
|
-
"eps": "string"
|
|
123
|
-
},
|
|
124
|
-
"marketMetrics": {
|
|
125
|
-
"marketCap": "string",
|
|
126
|
-
"peRatio": "string",
|
|
127
|
-
"psRatio": "string",
|
|
128
|
-
"52weekHigh": "string",
|
|
129
|
-
"52weekLow": "string"
|
|
130
|
-
},
|
|
131
|
-
"recentNews": [{ "date": "string", "headline": "string", "source": "string", "url": "string" }],
|
|
132
|
-
"sources": ["url"]
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"industryTrends": [{ "trend": "string", "details": "string", "source": "url" }],
|
|
136
|
-
"sources": [{ "url": "string", "type": "string", "dataExtracted": "string" }]
|
|
137
|
-
}
|
|
138
|
-
\`\`\``,
|
|
139
|
-
markdown: 'Save the report to `market-research.md` in the current directory. Tell the user the file path when done.',
|
|
140
|
-
};
|
|
141
|
-
return `You are a market research agent powered by Firecrawl. You use a real cloud browser to navigate financial portals, interact with data visualizations, and extract structured market data.
|
|
142
|
-
|
|
143
|
-
## STEP 1: Launch Browser and Open Live View
|
|
144
|
-
|
|
145
|
-
Before anything else, launch a browser session so the user can watch:
|
|
146
|
-
|
|
147
|
-
\`\`\`bash
|
|
148
|
-
firecrawl browser launch-session --json
|
|
149
|
-
\`\`\`
|
|
150
|
-
|
|
151
|
-
Extract the \`interactiveLiveViewUrl\` from the JSON output and open it (NOT the regular \`liveViewUrl\` -- the interactive one lets the user click and interact):
|
|
152
|
-
|
|
153
|
-
\`\`\`bash
|
|
154
|
-
open "<interactiveLiveViewUrl>" # macOS
|
|
155
|
-
xdg-open "<interactiveLiveViewUrl>" # Linux
|
|
156
|
-
\`\`\`
|
|
157
|
-
|
|
158
|
-
If the \`open\` command fails, print the URL clearly.
|
|
159
|
-
|
|
160
|
-
## STEP 2: Identify Target Companies
|
|
161
|
-
|
|
162
|
-
If the user didn't specify companies, search for key players in the market:
|
|
163
|
-
|
|
164
|
-
\`\`\`bash
|
|
165
|
-
firecrawl search "<market> top public companies"
|
|
166
|
-
firecrawl search "<market> industry leaders revenue"
|
|
167
|
-
\`\`\`
|
|
168
|
-
|
|
169
|
-
## STEP 3: Extract Data from Financial Portals
|
|
170
|
-
|
|
171
|
-
For each company, visit financial data sources and interact with their UIs:
|
|
172
|
-
|
|
173
|
-
### Primary sources to visit:
|
|
174
|
-
- **Yahoo Finance** (finance.yahoo.com) -- Company profile, financials, statistics
|
|
175
|
-
- **Macrotrends** (macrotrends.net) -- Historical financials, charts
|
|
176
|
-
- **SEC filings** (sec.gov/cgi-bin/browse-edgar) -- For US public companies
|
|
177
|
-
- **Company investor relations pages** -- Direct earnings reports
|
|
178
|
-
|
|
179
|
-
### How to extract data:
|
|
180
|
-
1. Navigate to the company's financial page
|
|
181
|
-
2. Snapshot to see available data sections
|
|
182
|
-
3. Click tabs like "Financials", "Statistics", "Historical Data"
|
|
183
|
-
4. Interact with period selectors (quarterly/annual toggles)
|
|
184
|
-
5. Scroll through data tables and extract values
|
|
185
|
-
6. Click into earnings reports or press releases for details
|
|
186
|
-
|
|
187
|
-
### Browser commands:
|
|
188
|
-
\`\`\`bash
|
|
189
|
-
firecrawl browser "open <url>"
|
|
190
|
-
firecrawl browser "snapshot"
|
|
191
|
-
firecrawl browser "click @<ref>"
|
|
192
|
-
firecrawl browser "type @<ref> <text>"
|
|
193
|
-
firecrawl browser "scroll down"
|
|
194
|
-
firecrawl browser "scrape"
|
|
195
|
-
\`\`\`
|
|
196
|
-
|
|
197
|
-
Also use \`firecrawl scrape <url>\` for quick page grabs when browser interaction isn't needed.
|
|
198
|
-
|
|
199
|
-
## Data Focus
|
|
200
|
-
|
|
201
|
-
${focusInstructions[opts.dataPoints]}
|
|
202
|
-
|
|
203
|
-
## Output Format
|
|
204
|
-
|
|
205
|
-
${outputInstructions[opts.output]}
|
|
206
|
-
|
|
207
|
-
Structure your report with:
|
|
208
|
-
|
|
209
|
-
### Market Overview
|
|
210
|
-
- Industry description, size, and growth trajectory
|
|
211
|
-
- Key players and market share (if available)
|
|
212
|
-
|
|
213
|
-
### Company Profiles
|
|
214
|
-
For each company:
|
|
215
|
-
- Financial summary (revenue, margins, growth)
|
|
216
|
-
- Market metrics (cap, ratios)
|
|
217
|
-
- Recent developments
|
|
218
|
-
|
|
219
|
-
### Comparison Tables
|
|
220
|
-
- Revenue comparison across companies
|
|
221
|
-
- Margin comparison
|
|
222
|
-
- Valuation multiples side-by-side
|
|
223
|
-
|
|
224
|
-
### Trends & Outlook
|
|
225
|
-
- Industry trends and forecasts
|
|
226
|
-
- Analyst consensus if available
|
|
227
|
-
|
|
228
|
-
### Sources
|
|
229
|
-
- Every URL visited with what data was extracted
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
Do everything sequentially. Cross-reference data across sources when possible. Note any conflicting numbers. Start immediately.`;
|
|
234
|
-
}
|
|
235
|
-
// ─── Command registration ───────────────────────────────────────────────────
|
|
236
|
-
function register(parentCmd, backend) {
|
|
237
|
-
const config = backends_1.BACKENDS[backend];
|
|
238
|
-
parentCmd
|
|
239
|
-
.command('market-research')
|
|
240
|
-
.description('Extract financial data, earnings, and market metrics via browser')
|
|
241
|
-
.argument('[query...]', 'Market, industry, or company to research')
|
|
242
|
-
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
243
|
-
.action(async (queryParts, options) => {
|
|
244
|
-
const prefillQuery = queryParts.length > 0 ? queryParts.join(' ') : undefined;
|
|
245
|
-
const inputs = await gatherInputs(prefillQuery ? { query: prefillQuery } : undefined);
|
|
246
|
-
const parts = [`Research market: ${inputs.query}`];
|
|
247
|
-
if (inputs.companies)
|
|
248
|
-
parts.push(`Include these companies: ${inputs.companies}`);
|
|
249
|
-
if (inputs.context)
|
|
250
|
-
parts.push(inputs.context);
|
|
251
|
-
const userMessage = parts.join('. ') + '.';
|
|
252
|
-
const skipPermissions = true;
|
|
253
|
-
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
254
|
-
(0, backends_1.launchAgent)(backend, buildSystemPrompt({
|
|
255
|
-
dataPoints: inputs.dataPoints,
|
|
256
|
-
output: inputs.output,
|
|
257
|
-
}), userMessage, skipPermissions);
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
//# sourceMappingURL=market-research.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"market-research.js","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/market-research.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuOH,4BAoCC;AAxQD,0CAAkE;AAClE,sCAA6C;AAY7C,+EAA+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AI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,MAAM,MAAM,GAAG,MAAM,YAAY,CAC/B,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CACnD,CAAC;QAEF,MAAM,KAAK,GAAG,CAAC,oBAAoB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACnD,IAAI,MAAM,CAAC,SAAS;YAClB,KAAK,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QAE3C,MAAM,eAAe,GAAG,IAAI,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;QAEtD,IAAA,sBAAW,EACT,OAAO,EACP,iBAAiB,CAAC;YAChB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,EACF,WAAW,EACX,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow: QA / Dogfood
|
|
3
|
-
*
|
|
4
|
-
* Acts as a QA team lead: maps the site, then spawns 3-4 parallel subagents
|
|
5
|
-
* that use Firecrawl's cloud browser to click around, fill forms, test
|
|
6
|
-
* interactions, and find bugs simultaneously.
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from 'commander';
|
|
9
|
-
import { type Backend } from '../backends';
|
|
10
|
-
export declare function register(parentCmd: Command, backend: Backend): void;
|
|
11
|
-
//# sourceMappingURL=qa.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"qa.d.ts","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/qa.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AA8JlE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAqBnE"}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Workflow: QA / Dogfood
|
|
4
|
-
*
|
|
5
|
-
* Acts as a QA team lead: maps the site, then spawns 3-4 parallel subagents
|
|
6
|
-
* that use Firecrawl's cloud browser to click around, fill forms, test
|
|
7
|
-
* interactions, and find bugs simultaneously.
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.register = register;
|
|
44
|
-
const backends_1 = require("../backends");
|
|
45
|
-
const shared_1 = require("../shared");
|
|
46
|
-
// ─── Input gathering ────────────────────────────────────────────────────────
|
|
47
|
-
async function gatherInputs(prefill) {
|
|
48
|
-
const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
49
|
-
const rawUrl = prefill?.url ||
|
|
50
|
-
(await input({
|
|
51
|
-
message: "What's the URL of the site to test?",
|
|
52
|
-
validate: shared_1.validateUrl,
|
|
53
|
-
}));
|
|
54
|
-
const focus = await select({
|
|
55
|
-
message: 'What should the QA focus on?',
|
|
56
|
-
choices: [
|
|
57
|
-
{ name: 'Full exploratory test (everything)', value: 'full' },
|
|
58
|
-
{ name: 'Forms and user flows', value: 'forms' },
|
|
59
|
-
{ name: 'Navigation and links', value: 'navigation' },
|
|
60
|
-
{ name: 'Responsive / mobile issues', value: 'responsive' },
|
|
61
|
-
{ name: 'Performance and load times', value: 'performance' },
|
|
62
|
-
],
|
|
63
|
-
});
|
|
64
|
-
const context = await input({
|
|
65
|
-
message: 'Any specific areas or known issues to check? (leave blank to skip)',
|
|
66
|
-
default: '',
|
|
67
|
-
});
|
|
68
|
-
const output = await select({
|
|
69
|
-
message: 'How should the report be delivered?',
|
|
70
|
-
choices: [
|
|
71
|
-
{ name: 'Print to terminal', value: 'terminal' },
|
|
72
|
-
{ name: 'Save as Markdown file', value: 'markdown' },
|
|
73
|
-
],
|
|
74
|
-
});
|
|
75
|
-
return { url: (0, shared_1.normalizeUrl)(rawUrl), focus, context, output };
|
|
76
|
-
}
|
|
77
|
-
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
78
|
-
function buildSystemPrompt(opts) {
|
|
79
|
-
const outputInstructions = opts.output === 'markdown'
|
|
80
|
-
? 'Save the QA report to a file called `qa-report.md` in the current directory. Tell the user the file path when done.'
|
|
81
|
-
: 'Print the final unified QA report to the terminal in well-formatted markdown.';
|
|
82
|
-
const focusInstructions = {
|
|
83
|
-
full: `Spawn ALL of these parallel agents:
|
|
84
|
-
1. **Navigation & Links Agent** -- Map the site, visit every nav item, check footer links, breadcrumbs, 404s, broken links.
|
|
85
|
-
2. **Forms & Interactions Agent** -- Find every form, test valid/invalid submissions, check validation messages, test edge cases (empty, too long, special chars).
|
|
86
|
-
3. **Content & Visual Agent** -- Check content quality, heading hierarchy, image alt tags, visual consistency, scroll through all pages.
|
|
87
|
-
4. **Error States Agent** -- Hit invalid URLs, test error pages, try unauthorized access, check API error responses visible in the UI.`,
|
|
88
|
-
forms: `Spawn these parallel agents:
|
|
89
|
-
1. **Form Discovery Agent** -- Map the site and find every form, input, and interactive element.
|
|
90
|
-
2. **Happy Path Agent** -- Test every form with valid data, verify success states.
|
|
91
|
-
3. **Edge Case Agent** -- Test with empty fields, max-length inputs, special characters, SQL injection strings, XSS payloads.
|
|
92
|
-
4. **Validation Agent** -- Test field-level validation, required fields, format validation (email, phone, etc).`,
|
|
93
|
-
navigation: `Spawn these parallel agents:
|
|
94
|
-
1. **Sitemap Agent** -- Map the full site, check sitemap.xml, compare discovered vs listed URLs.
|
|
95
|
-
2. **Nav Testing Agent** -- Click every nav item, dropdown, mega menu. Test mobile nav if responsive.
|
|
96
|
-
3. **Link Checker Agent** -- Scrape every page for links, verify each one returns 200.
|
|
97
|
-
4. **Routing Agent** -- Test back/forward, deep linking, query params, hash routing.`,
|
|
98
|
-
responsive: `Spawn these parallel agents:
|
|
99
|
-
1. **Desktop Agent** -- Test at 1920px, 1440px, 1024px widths.
|
|
100
|
-
2. **Tablet Agent** -- Test at 768px and 1024px portrait/landscape.
|
|
101
|
-
3. **Mobile Agent** -- Test at 375px and 390px widths.
|
|
102
|
-
4. **Interaction Agent** -- Test touch targets, overflow, horizontal scroll, zoom behavior.`,
|
|
103
|
-
performance: `Spawn these parallel agents:
|
|
104
|
-
1. **Page Load Agent** -- Measure load times for key pages (homepage, product, blog, pricing).
|
|
105
|
-
2. **Asset Audit Agent** -- Check image sizes, unoptimized assets, render-blocking scripts.
|
|
106
|
-
3. **Content Efficiency Agent** -- Check for lazy loading, pagination, infinite scroll behavior.
|
|
107
|
-
4. **Comparison Agent** -- Load competitor sites, compare performance characteristics.`,
|
|
108
|
-
};
|
|
109
|
-
return `You are a QA team lead powered by Firecrawl. You orchestrate parallel testing agents to thoroughly test live websites.
|
|
110
|
-
|
|
111
|
-
${shared_1.QA_TOOLS_BLOCK}
|
|
112
|
-
|
|
113
|
-
## Your Strategy
|
|
114
|
-
|
|
115
|
-
You are a **team lead**, not a solo tester. Your job is to:
|
|
116
|
-
|
|
117
|
-
1. **Map the site first** -- Run \`firecrawl map\` yourself to discover all pages.
|
|
118
|
-
2. **Spawn parallel subagents** -- Use the Agent tool to launch multiple testing agents simultaneously. Each agent gets a specific testing mandate and a subset of pages.
|
|
119
|
-
3. **Collect results** -- Each agent reports back its findings.
|
|
120
|
-
4. **Synthesize** -- Merge all agent findings into one unified report, deduplicate issues, and assign severity.
|
|
121
|
-
|
|
122
|
-
## Agent Assignments
|
|
123
|
-
|
|
124
|
-
${focusInstructions[opts.focus]}
|
|
125
|
-
|
|
126
|
-
${shared_1.SUBAGENT_INSTRUCTIONS}
|
|
127
|
-
|
|
128
|
-
- Tell each agent which pages to test (divide the sitemap between them)
|
|
129
|
-
- Tell each agent to use \`firecrawl browser\` and \`firecrawl scrape\` commands
|
|
130
|
-
- Each agent should report findings as: severity (critical/major/minor), URL, description, steps to reproduce
|
|
131
|
-
|
|
132
|
-
## Output Format
|
|
133
|
-
|
|
134
|
-
${outputInstructions}
|
|
135
|
-
|
|
136
|
-
Structure the unified QA report as:
|
|
137
|
-
|
|
138
|
-
### Summary
|
|
139
|
-
- Overall health score (out of 10)
|
|
140
|
-
- Pages tested: X
|
|
141
|
-
- Issues found: X critical, X major, X minor
|
|
142
|
-
- Agents deployed: X
|
|
143
|
-
|
|
144
|
-
### Critical Issues
|
|
145
|
-
Bugs that break functionality or block users:
|
|
146
|
-
- **[C-1]** URL | Description | Steps to reproduce | Expected vs actual
|
|
147
|
-
|
|
148
|
-
### Major Issues
|
|
149
|
-
Significant UX problems or broken features:
|
|
150
|
-
- **[M-1]** URL | Description | Steps to reproduce
|
|
151
|
-
|
|
152
|
-
### Minor Issues
|
|
153
|
-
Visual glitches, inconsistencies, polish items:
|
|
154
|
-
- **[m-1]** URL | Description
|
|
155
|
-
|
|
156
|
-
### Positive Observations
|
|
157
|
-
Things that work particularly well.
|
|
158
|
-
|
|
159
|
-
### Pages Tested
|
|
160
|
-
Full list of every URL visited across all agents.
|
|
161
|
-
|
|
162
|
-
### Agent Summary
|
|
163
|
-
Which agent found what -- brief summary of each agent's work.
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
Start by mapping the site, then immediately fan out your testing agents in parallel.`;
|
|
168
|
-
}
|
|
169
|
-
// ─── Command registration ───────────────────────────────────────────────────
|
|
170
|
-
function register(parentCmd, backend) {
|
|
171
|
-
const config = backends_1.BACKENDS[backend];
|
|
172
|
-
parentCmd
|
|
173
|
-
.command('qa')
|
|
174
|
-
.description('QA test a live website using Firecrawl cloud browser')
|
|
175
|
-
.argument('[url]', 'URL to test')
|
|
176
|
-
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
177
|
-
.action(async (url, options) => {
|
|
178
|
-
const inputs = await gatherInputs(url ? { url } : undefined);
|
|
179
|
-
const skipPermissions = options.yes || (await (0, shared_1.askPermissionMode)(backend));
|
|
180
|
-
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
181
|
-
(0, backends_1.launchAgent)(backend, buildSystemPrompt({ focus: inputs.focus, output: inputs.output }), (0, shared_1.buildMessage)([`Test ${inputs.url}`, inputs.context]), skipPermissions);
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=qa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"qa.js","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/qa.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKH,4BAqBC;AAnLD,0CAAkE;AAClE,sCAOmB;AAWnB,+EAA+E;AAE/E,KAAK,UAAU,YAAY,CAAC,OAA0B;IACpD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;IAE5D,MAAM,MAAM,GACV,OAAO,EAAE,GAAG;QACZ,CAAC,MAAM,KAAK,CAAC;YACX,OAAO,EAAE,qCAAqC;YAC9C,QAAQ,EAAE,oBAAW;SACtB,CAAC,CAAC,CAAC;IAEN,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC;QACzB,OAAO,EAAE,8BAA8B;QACvC,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,oCAAoC,EAAE,KAAK,EAAE,MAAM,EAAE;YAC7D,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE;YAChD,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,YAAY,EAAE;YACrD,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,YAAY,EAAE;YAC3D,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,aAAa,EAAE;SAC7D;KACF,CAAC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AC,OAAO,EAAE,aAAa,CAAC;SAChC,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAE7D,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;QAEtD,IAAA,sBAAW,EACT,OAAO,EACP,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EACjE,IAAA,qBAAY,EAAC,CAAC,QAAQ,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,EACpD,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow: Research Papers
|
|
3
|
-
*
|
|
4
|
-
* Spawns parallel agents by source type (academic, industry, technical) to find,
|
|
5
|
-
* scrape, and synthesize research papers, whitepapers, and PDFs into a
|
|
6
|
-
* structured literature review.
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from 'commander';
|
|
9
|
-
import { type Backend } from '../backends';
|
|
10
|
-
export declare function register(parentCmd: Command, backend: Backend): void;
|
|
11
|
-
//# sourceMappingURL=research-papers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"research-papers.d.ts","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/research-papers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AAsHlE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAyBnE"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Workflow: Research Papers
|
|
4
|
-
*
|
|
5
|
-
* Spawns parallel agents by source type (academic, industry, technical) to find,
|
|
6
|
-
* scrape, and synthesize research papers, whitepapers, and PDFs into a
|
|
7
|
-
* structured literature review.
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.register = register;
|
|
44
|
-
const backends_1 = require("../backends");
|
|
45
|
-
const shared_1 = require("../shared");
|
|
46
|
-
// ─── Input gathering ────────────────────────────────────────────────────────
|
|
47
|
-
async function gatherInputs(prefill) {
|
|
48
|
-
const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
49
|
-
const topic = prefill?.topic ||
|
|
50
|
-
(await input({
|
|
51
|
-
message: 'What topic do you want to find papers on?',
|
|
52
|
-
validate: (0, shared_1.validateRequired)('Topic'),
|
|
53
|
-
}));
|
|
54
|
-
const count = await input({
|
|
55
|
-
message: 'How many papers/sources to target? (default: 10)',
|
|
56
|
-
default: '10',
|
|
57
|
-
});
|
|
58
|
-
const context = await input({
|
|
59
|
-
message: 'Any specific angles or questions? (leave blank to skip)',
|
|
60
|
-
default: '',
|
|
61
|
-
});
|
|
62
|
-
const output = await select({
|
|
63
|
-
message: 'How should the literature review be delivered?',
|
|
64
|
-
choices: [
|
|
65
|
-
{ name: 'Print to terminal', value: 'terminal' },
|
|
66
|
-
{ name: 'Save as Markdown file', value: 'markdown' },
|
|
67
|
-
],
|
|
68
|
-
});
|
|
69
|
-
return { topic, count, context, output };
|
|
70
|
-
}
|
|
71
|
-
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
72
|
-
function buildSystemPrompt(opts) {
|
|
73
|
-
const outputInstructions = opts.output === 'markdown'
|
|
74
|
-
? 'Save the literature review to `literature-review.md` in the current directory. Tell the user the file path when done.'
|
|
75
|
-
: 'Print the full literature review to the terminal in well-formatted markdown.';
|
|
76
|
-
return `You are a research papers team lead powered by Firecrawl. You find, scrape, and synthesize research papers, whitepapers, and PDFs into a structured literature review.
|
|
77
|
-
|
|
78
|
-
${shared_1.FIRECRAWL_TOOLS_BLOCK}
|
|
79
|
-
|
|
80
|
-
## Your Strategy
|
|
81
|
-
|
|
82
|
-
You are a **team lead**. Your job is to:
|
|
83
|
-
|
|
84
|
-
1. **Find papers and PDFs** -- Search for research papers, whitepapers, technical reports, and PDFs on the topic. Target sources like arXiv, Google Scholar, IEEE, ACM, company research blogs, and PDF links.
|
|
85
|
-
2. **Spawn parallel subagents** -- Each agent scrapes and analyzes a subset of papers.
|
|
86
|
-
3. **Synthesize** -- Build a structured literature review from all agent findings.
|
|
87
|
-
|
|
88
|
-
## Agent Assignments
|
|
89
|
-
|
|
90
|
-
Spawn agents by source type:
|
|
91
|
-
1. **Academic Papers Agent** -- Search for and scrape research papers from arXiv, Google Scholar links, university sites. Use \`firecrawl scrape\` on PDF URLs directly -- Firecrawl handles PDFs natively.
|
|
92
|
-
2. **Industry Reports Agent** -- Search for whitepapers, technical reports, and industry publications. Scrape company research blogs and report PDFs.
|
|
93
|
-
3. **Technical Articles Agent** -- Search for in-depth technical articles, blog posts from researchers, and conference talk summaries.
|
|
94
|
-
|
|
95
|
-
${shared_1.SUBAGENT_INSTRUCTIONS}
|
|
96
|
-
|
|
97
|
-
## Output Format
|
|
98
|
-
|
|
99
|
-
${outputInstructions}
|
|
100
|
-
|
|
101
|
-
Structure the literature review as:
|
|
102
|
-
|
|
103
|
-
### Abstract
|
|
104
|
-
2-3 paragraph summary of the research landscape.
|
|
105
|
-
|
|
106
|
-
### Key Papers
|
|
107
|
-
For each paper/source:
|
|
108
|
-
- **Title** and authors (if available)
|
|
109
|
-
- **Source URL**
|
|
110
|
-
- **Key findings** (2-3 bullet points)
|
|
111
|
-
- **Methodology** (if applicable)
|
|
112
|
-
- **Relevance** to the topic
|
|
113
|
-
|
|
114
|
-
### Themes & Consensus
|
|
115
|
-
What do the papers agree on? What are the established findings?
|
|
116
|
-
|
|
117
|
-
### Open Questions & Debates
|
|
118
|
-
Where do papers disagree? What's unresolved?
|
|
119
|
-
|
|
120
|
-
### Emerging Trends
|
|
121
|
-
Recent developments and where the field is heading.
|
|
122
|
-
|
|
123
|
-
### Sources
|
|
124
|
-
Every URL scraped, organized by type (paper, report, article).
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
Be thorough with citations. Every claim should trace back to a specific source. If a PDF fails to scrape, note it and try an alternative.
|
|
129
|
-
|
|
130
|
-
Start by searching for papers on the topic.`;
|
|
131
|
-
}
|
|
132
|
-
// ─── Command registration ───────────────────────────────────────────────────
|
|
133
|
-
function register(parentCmd, backend) {
|
|
134
|
-
const config = backends_1.BACKENDS[backend];
|
|
135
|
-
parentCmd
|
|
136
|
-
.command('research-papers')
|
|
137
|
-
.description('Find and synthesize research papers, whitepapers, and PDFs')
|
|
138
|
-
.argument('[topic]', 'Research topic')
|
|
139
|
-
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
140
|
-
.action(async (topic, options) => {
|
|
141
|
-
const inputs = await gatherInputs(topic ? { topic } : undefined);
|
|
142
|
-
const skipPermissions = options.yes || (await (0, shared_1.askPermissionMode)(backend));
|
|
143
|
-
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
144
|
-
(0, backends_1.launchAgent)(backend, buildSystemPrompt({ output: inputs.output }), (0, shared_1.buildMessage)([
|
|
145
|
-
`Research papers on: ${inputs.topic}`,
|
|
146
|
-
`Target ~${inputs.count} papers`,
|
|
147
|
-
inputs.context,
|
|
148
|
-
]), skipPermissions);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
//# sourceMappingURL=research-papers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"research-papers.js","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/research-papers.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;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AAC;AAED,+EAA+E;AAE/E,SAAgB,QAAQ,CAAC,SAAkB,EAAE,OAAgB;IAC3D,MAAM,MAAM,GAAG,mBAAQ,CAAC,OAAO,CAAC,CAAC;IAEjC,SAAS;SACN,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,4DAA4D,CAAC;SACzE,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;SACrC,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEjE,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;QAEtD,IAAA,sBAAW,EACT,OAAO,EACP,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAC5C,IAAA,qBAAY,EAAC;YACX,uBAAuB,MAAM,CAAC,KAAK,EAAE;YACrC,WAAW,MAAM,CAAC,KAAK,SAAS;YAChC,MAAM,CAAC,OAAO;SACf,CAAC,EACF,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow: SEO Audit
|
|
3
|
-
*
|
|
4
|
-
* Maps the site, then spawns parallel agents for site structure, on-page SEO,
|
|
5
|
-
* and keyword/competitor analysis. Produces a prioritized audit with specific
|
|
6
|
-
* (not generic) recommendations.
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from 'commander';
|
|
9
|
-
import { type Backend } from '../backends';
|
|
10
|
-
export declare function register(parentCmd: Command, backend: Backend): void;
|
|
11
|
-
//# sourceMappingURL=seo-audit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seo-audit.d.ts","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/seo-audit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AA0HlE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAwBnE"}
|