@koda-sl/baker-cli 0.890.0-dev.759c113cf → 0.890.0-dev.fb74d0c04
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 -2
- package/dist/{ads-55VKXBMM.js → ads-FTIZ2QLC.js} +2 -2
- package/dist/{advertisers-X3PJG6Z6.js → advertisers-AKFTZJAL.js} +2 -2
- package/dist/{autocomplete-PWMUL7QJ.js → autocomplete-EBTBGCVM.js} +2 -2
- package/dist/{brief-4GIXLWHD.js → brief-3IJH6ADD.js} +4 -4
- package/dist/{chunk-DUJCU5NO.js → chunk-D6LOQ7X2.js} +2 -2
- package/dist/{chunk-52GWXYQ6.js → chunk-RNOWWEA7.js} +3 -3
- package/dist/chunk-RNOWWEA7.js.map +1 -0
- package/dist/{chunk-ZJBKANBI.js → chunk-S2WLJBUA.js} +9 -8
- package/dist/chunk-S2WLJBUA.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/{company-WBA5NN2V.js → company-JFASPEKT.js} +2 -2
- package/dist/{creatives-TRNKZBE5.js → creatives-VSSKFV65.js} +2 -2
- package/dist/{customers-MKBX6KJ5.js → customers-MGO6LEK7.js} +4 -4
- package/dist/{fetch-JVI3AO3Q.js → fetch-YVKQOGKD.js} +2 -2
- package/dist/{google-ads-FAAP6HCR.js → google-ads-4QI33CPF.js} +2 -2
- package/dist/{insights-PBJODKMY.js → insights-YXWOM5FX.js} +10 -13
- package/dist/insights-YXWOM5FX.js.map +1 -0
- package/dist/{keyword-metrics-AIOK6XG2.js → keyword-metrics-3CCOTXLY.js} +2 -2
- package/dist/{keywords-for-site-WKUQFYDA.js → keywords-for-site-DM4UZBIE.js} +2 -2
- package/dist/{linkedin-person-UPJBQUXL.js → linkedin-person-2UWQAMFI.js} +2 -2
- package/dist/{meta-OTEBUJM5.js → meta-57E652I4.js} +2 -2
- package/dist/{people-QFZI2E7P.js → people-TIUKYSZ4.js} +2 -2
- package/dist/{reddit-6A6426JJ.js → reddit-QH2T2OSH.js} +3 -3
- package/dist/{research-PUNEJ4WW.js → research-MR7Q47RX.js} +14 -14
- package/dist/{transcript-LQD4BQBX.js → transcript-5GXGPNS3.js} +2 -2
- package/dist/{web-Q6HMBNRS.js → web-RNU2PMMK.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-52GWXYQ6.js.map +0 -1
- package/dist/chunk-ZJBKANBI.js.map +0 -1
- package/dist/insights-PBJODKMY.js.map +0 -1
- /package/dist/{ads-55VKXBMM.js.map → ads-FTIZ2QLC.js.map} +0 -0
- /package/dist/{advertisers-X3PJG6Z6.js.map → advertisers-AKFTZJAL.js.map} +0 -0
- /package/dist/{autocomplete-PWMUL7QJ.js.map → autocomplete-EBTBGCVM.js.map} +0 -0
- /package/dist/{brief-4GIXLWHD.js.map → brief-3IJH6ADD.js.map} +0 -0
- /package/dist/{chunk-DUJCU5NO.js.map → chunk-D6LOQ7X2.js.map} +0 -0
- /package/dist/{company-WBA5NN2V.js.map → company-JFASPEKT.js.map} +0 -0
- /package/dist/{creatives-TRNKZBE5.js.map → creatives-VSSKFV65.js.map} +0 -0
- /package/dist/{customers-MKBX6KJ5.js.map → customers-MGO6LEK7.js.map} +0 -0
- /package/dist/{fetch-JVI3AO3Q.js.map → fetch-YVKQOGKD.js.map} +0 -0
- /package/dist/{google-ads-FAAP6HCR.js.map → google-ads-4QI33CPF.js.map} +0 -0
- /package/dist/{keyword-metrics-AIOK6XG2.js.map → keyword-metrics-3CCOTXLY.js.map} +0 -0
- /package/dist/{keywords-for-site-WKUQFYDA.js.map → keywords-for-site-DM4UZBIE.js.map} +0 -0
- /package/dist/{linkedin-person-UPJBQUXL.js.map → linkedin-person-2UWQAMFI.js.map} +0 -0
- /package/dist/{meta-OTEBUJM5.js.map → meta-57E652I4.js.map} +0 -0
- /package/dist/{people-QFZI2E7P.js.map → people-TIUKYSZ4.js.map} +0 -0
- /package/dist/{reddit-6A6426JJ.js.map → reddit-QH2T2OSH.js.map} +0 -0
- /package/dist/{research-PUNEJ4WW.js.map → research-MR7Q47RX.js.map} +0 -0
- /package/dist/{transcript-LQD4BQBX.js.map → transcript-5GXGPNS3.js.map} +0 -0
- /package/dist/{web-Q6HMBNRS.js.map → web-RNU2PMMK.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1749,7 +1749,7 @@ Status changes are `pause|resume|archive|delete` subcommands on `campaigns`/`ads
|
|
|
1749
1749
|
- Rows printed: the top 25 of the whole read at `--level ad|adset`, every row at `account|campaign`, with a hint saying how many were left out. `--limit <n>` prints `n` rows, `--limit 0` every row (breaking: `--limit` used to cap the rows read from Meta; at least 1000 are always read now).
|
|
1750
1750
|
- `--action-types` works with any intent (it asks for `actions` when the intent has none) and takes plain names, raw Meta names, custom event names or a custom conversion's id. When Meta's counters for one conversion disagree (`lead` 48, `offsite_conversion.fb_pixel_lead` 30), the output prints one and a hint names every counter's value. A raw name printed under its plain name (`offsite_conversion.fb_pixel_purchase` → `purchase`) is named in a hint, every one, `--compare` windows included; `--action-types <raw name>` keeps Meta's own name in `actions`, `conversions` and their values and costs. Every compact action entry has a `value`: when Meta sends only window figures, it is the widest click window plus the widest view window (a cost, ROAS or rate: `null`), else `0`.
|
|
1751
1751
|
- Attribution windows: `7d_click, 1d_view` (only `1d_view, 1d_click, 7d_click, 28d_click` work post Jan 2026).
|
|
1752
|
-
- Identity columns (`campaign_name`, `ad_name`, etc.) appended automatically per `--level` so rows are self-describing.
|
|
1752
|
+
- Identity columns (`campaign_name`, `ad_name`, etc.) appended automatically per `--level`, with `--fields` too, so rows are self-describing.
|
|
1753
1753
|
- Auto-async when the query is heavy (level=ad with breakdowns over an account, >2 breakdowns, >90-day range). Pass `--async` to force it or `--no-async` to refuse fallback.
|
|
1754
1754
|
|
|
1755
1755
|
**Listings (`campaigns`/`adsets`/`ads`)** default to `effective_status=ACTIVE` — pass `--all-statuses` to widen, or `--effective-status ACTIVE,PAUSED` for a custom set. An empty filtered list carries a `hints` entry naming the filter and `--all-statuses` (on **stderr** for `--output csv|jsonl|md`), so "nothing active" is never read as "nothing there".
|
|
@@ -3065,7 +3065,7 @@ baker research reddit thread "https://www.reddit.com/r/running/s/3TzXiyxaMD" --c
|
|
|
3065
3065
|
|
|
3066
3066
|
| Flag | Description |
|
|
3067
3067
|
|------|-------------|
|
|
3068
|
-
| `--subreddit` | Subreddits (up to 10), comma-separated or the flag repeated. Required for `--kind comments
|
|
3068
|
+
| `--subreddit` | Subreddits (up to 10), comma-separated or the flag repeated. Required for `--kind comments`, and for any search when the Reddit API is not configured |
|
|
3069
3069
|
| `--kind` | `posts` (default) or `comments` |
|
|
3070
3070
|
| `--since` | Only things written on or after `YYYY-MM-DD`; results then come newest first instead of best match first |
|
|
3071
3071
|
| `--limit` | Search results, 1-50 (default 25) |
|
|
@@ -34,7 +34,7 @@ Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedi
|
|
|
34
34
|
},
|
|
35
35
|
subCommands: {
|
|
36
36
|
google: () => import("./google-QKCCBY3U.js").then((m) => m.googleCommand),
|
|
37
|
-
meta: () => import("./meta-
|
|
37
|
+
meta: () => import("./meta-57E652I4.js").then((m) => m.metaCommand),
|
|
38
38
|
linkedin: () => import("./linkedin-UEDF45LH.js").then((m) => m.linkedinCommand),
|
|
39
39
|
x: () => import("./x-2FX42TQK.js").then((m) => m.xCommand),
|
|
40
40
|
chatgpt: () => import("./chatgpt-GEBWPTMO.js").then((m) => m.chatgptCommand),
|
|
@@ -45,4 +45,4 @@ Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedi
|
|
|
45
45
|
export {
|
|
46
46
|
adsCommand
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=ads-
|
|
48
|
+
//# sourceMappingURL=ads-FTIZ2QLC.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-QRKQZYX4.js";
|
|
9
9
|
import {
|
|
10
10
|
advertisersHints
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RNOWWEA7.js";
|
|
12
12
|
import {
|
|
13
13
|
RESEARCH_DATA_NOTE,
|
|
14
14
|
handleResearchError,
|
|
@@ -152,4 +152,4 @@ Examples:
|
|
|
152
152
|
export {
|
|
153
153
|
advertisersCommand
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=advertisers-
|
|
155
|
+
//# sourceMappingURL=advertisers-AKFTZJAL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
noSerpRowsHints
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RNOWWEA7.js";
|
|
4
4
|
import {
|
|
5
5
|
RESEARCH_DATA_NOTE,
|
|
6
6
|
handleResearchError,
|
|
@@ -115,4 +115,4 @@ Examples:
|
|
|
115
115
|
export {
|
|
116
116
|
autocompleteCommand
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=autocomplete-
|
|
118
|
+
//# sourceMappingURL=autocomplete-EBTBGCVM.js.map
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
} from "./chunk-KK6JTXF7.js";
|
|
33
33
|
import {
|
|
34
34
|
researchCustomers
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-D6LOQ7X2.js";
|
|
36
|
+
import "./chunk-S2WLJBUA.js";
|
|
37
|
+
import "./chunk-RNOWWEA7.js";
|
|
38
38
|
import "./chunk-HU6BAHX5.js";
|
|
39
39
|
import "./chunk-6R2LJ6BJ.js";
|
|
40
40
|
import "./chunk-4DURENF2.js";
|
|
@@ -509,4 +509,4 @@ export {
|
|
|
509
509
|
briefHints,
|
|
510
510
|
whatWorks
|
|
511
511
|
};
|
|
512
|
-
//# sourceMappingURL=brief-
|
|
512
|
+
//# sourceMappingURL=brief-3IJH6ADD.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findSubreddits,
|
|
3
3
|
searchReddit
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S2WLJBUA.js";
|
|
5
5
|
import {
|
|
6
6
|
holdUnbilledSpend
|
|
7
7
|
} from "./chunk-3JLS56VK.js";
|
|
@@ -682,4 +682,4 @@ export {
|
|
|
682
682
|
researchCustomers,
|
|
683
683
|
customersCommand
|
|
684
684
|
};
|
|
685
|
-
//# sourceMappingURL=chunk-
|
|
685
|
+
//# sourceMappingURL=chunk-D6LOQ7X2.js.map
|
|
@@ -161,11 +161,11 @@ function redditSearchHints({
|
|
|
161
161
|
const hints = [];
|
|
162
162
|
if (resultCount === 0) {
|
|
163
163
|
hints.push(
|
|
164
|
-
'Nothing matched. Reddit search matches words, not meaning: try the audience\'s own phrasing (one distinctive word, or a seed from `baker research autocomplete`), a longer --since window, or other subreddits \u2014 `baker research reddit subreddits "<topic>"` finds where the audience actually talks' + (kind === "posts" ? ", and try --kind comments
|
|
164
|
+
'Nothing matched. Reddit search matches words, not meaning: try the audience\'s own phrasing (one distinctive word, or a seed from `baker research autocomplete`), a longer --since window, or other subreddits \u2014 `baker research reddit subreddits "<topic>"` finds where the audience actually talks' + (kind === "posts" ? ", and try --kind comments \u2014 most of the voice is in the replies." : ".")
|
|
165
165
|
);
|
|
166
166
|
} else if (kind === "posts") {
|
|
167
167
|
hints.push(
|
|
168
|
-
"Titles rarely carry the voice. Read the promising threads with `baker research reddit thread <permalink>` for the replies, or search the replies directly with --kind comments
|
|
168
|
+
"Titles rarely carry the voice. Read the promising threads with `baker research reddit thread <permalink>` for the replies, or search the replies directly with --kind comments."
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
171
|
if (source === "archive" && resultCount > 0) hints.push(ARCHIVE_NOTE);
|
|
@@ -402,4 +402,4 @@ export {
|
|
|
402
402
|
companySearchHints,
|
|
403
403
|
unknownIndustriesFix
|
|
404
404
|
};
|
|
405
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-RNOWWEA7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/research/hints.ts"],"sourcesContent":["/**\n * The `research` family shipped with no `hints[]` on any command. Everything\n * here is one nudge for one dead end that an audited run actually hit — not a\n * running commentary on healthy results.\n */\n\nimport {\n RESEARCH_GOOGLE_ADS_MAX_COPY,\n type ResearchCompanyHiring,\n type ResearchCompanyIndustry,\n type ResearchRedditSource,\n} from \"@baker/api\";\nimport type { QueryContext } from \"../../geo-context.ts\";\nimport type { ResearchFix } from \"./output.ts\";\n\ntype Depth = \"medium\" | \"high\" | \"xhigh\";\n\n/**\n * `advertisers` is named after advertisers and returns none of their advertising.\n * A run read the name as \"SERP ad creative\", got domain economics, and wrote \"no\n * live paid ad copy captured\" into the client's vault without ever trying the\n * command that does return copy. So this fires on every call, not just empty ones.\n */\nexport const AD_COPY_ROUTE =\n \"This returns competing domains and their SERP economics — no ad copy, no headlines, no creative. \" +\n \"For a competitor's Google ads and their copy: `baker research google-ads <competitor.com> --copy` \" +\n \"(Google's Ads Transparency Center: every ad, how long it has run, and the text ads' headline and description). \" +\n 'For Meta and LinkedIn: `baker winning-ads advertisers \"<brand>\"` → ' +\n '`baker winning-ads search \"<brief>\" --advertiser-id <id>` → `baker winning-ads content <adId>` ' +\n \"(`primary_text` / `headline` / `cta`, plus the spoken transcript and on-screen text for video). \" +\n \"Do not keep querying this command for copy.\";\n\n/**\n * Empty SERP data has two causes and only one is worth a second call: the wrong\n * market. Once the market was explicit, a re-query is waste — say so, because\n * \"no rows\" otherwise reads as \"reword the keyword\".\n */\nexport function noSerpRowsHints(rowCount: number, queryContext: QueryContext): string[] {\n if (rowCount > 0) {\n return [];\n }\n const defaulted = queryContext.location_is_default || queryContext.language_is_default;\n if (defaulted) {\n return [\n `No rows for ${queryContext.location} / ${queryContext.language} — the market you did not set. ` +\n \"Set --location and --language for the client's actual market and re-run once \" +\n \"(`baker research countries` / `baker research languages` for the accepted codes) \" +\n \"before you touch the keyword.\",\n ];\n }\n return [\n `No rows for ${queryContext.location} / ${queryContext.language}, which you set explicitly. ` +\n \"This term has no third-party SERP coverage in that market — move on rather than re-querying it. \" +\n \"For demand signal try `baker research autocomplete`; for a competitor's actual terms, \" +\n \"`baker research keywords-for-site <domain>`.\",\n ];\n}\n\nexport function advertisersHints(rowCount: number, queryContext: QueryContext): string[] {\n return [...noSerpRowsHints(rowCount, queryContext), AD_COPY_ROUTE];\n}\n\n/**\n * \"This competitor buys no paid search\" is a real competitive answer, but it\n * arrives as an empty array that looks like a broken call — so say which it is\n * before the agent re-runs the same query with a different sort.\n */\nexport function keywordsForSiteHints(\n rowCount: number,\n queryContext: QueryContext,\n typeFilter: string | undefined,\n): string[] {\n if (rowCount > 0) {\n return [];\n }\n if (typeFilter === \"paid\" || typeFilter === \"organic\") {\n return [\n `No rows with --type ${typeFilter} in ${queryContext.location} / ${queryContext.language}. ` +\n `A domain with zero ${typeFilter} keywords in a market is itself the finding — record it and move on. ` +\n \"Confirm once with --type all (nothing at all there means the domain has no SERP coverage, \" +\n \"not that it has no ads) instead of re-running with a different --sort or --limit.\",\n ];\n }\n return noSerpRowsHints(rowCount, queryContext);\n}\n\nconst THIN_ANSWER_CHARS = 600;\nconst THIN_SOURCE_COUNT = 2;\n\n// Only `medium` and `high` have somewhere to escalate to; `xhigh` is the ceiling,\n// so a thin answer there is a fact about the web, not a flag the agent forgot.\nconst ESCALATION: Partial<Record<Depth, string>> = {\n medium:\n \"`medium` is a quick lookup, not a search. Re-ask the SAME question once with `--depth high` before \" +\n \"concluding the web has nothing on it.\",\n high:\n \"`high` already thought hard about this. `--depth xhigh` is the only step left and it can run 15 minutes — \" +\n \"take it only if this answer blocks a deliverable; otherwise record the gap and move on.\",\n};\n\n/**\n * Google grounding used to come back as opaque redirect links labelled by domain,\n * and the agent guessed the real paths, 404'd, and invented links. The backend\n * now follows them; this says what to do with the ones it could not, and with\n * an answer that rests on nothing.\n */\nexport function webSourceHints(sources: Array<{ resolved?: boolean }>): string[] {\n if (sources.length === 0) {\n return [\n \"This answer came back with no sources. Treat every claim in it as Synthesis: — no source to cite. \" +\n \"Do not attach a URL to it; to cite a fact, find the page that states it and read it with `baker research fetch`.\",\n ];\n }\n // An older backend sends no `resolved`; only an explicit false is a link we know is opaque.\n const unresolved = sources.filter((s) => s.resolved === false).length;\n if (unresolved > 0) {\n return [\n `${unresolved} of ${sources.length} sources are Google links that could not be followed (resolved: false). ` +\n \"Do not cite them or guess a path from the site name — cite only a resolved URL, or open the claim's page yourself.\",\n ];\n }\n return [];\n}\n\n/**\n * The model writes article addresses into its prose from memory; one run spent\n * eight fetches on such links before learning they did not exist (BAKER-1502).\n * The backend lists every address the answer names that is none of its sources.\n */\nexport function webUnverifiedUrlHints(unverifiedUrls: string[]): string[] {\n if (unverifiedUrls.length === 0) {\n return [];\n }\n return [\n `${unverifiedUrls.length} address(es) in the answer are none of its sources (unverifiedUrls): the model wrote them, nothing read them, and they are often invented. ` +\n \"Do not cite or fetch them — cite the sources, or find the page with another `baker research web` question.\",\n ];\n}\n\n/**\n * The one thing worth saying about a page that came back fine is that you are\n * not looking at all of it — which the content itself cannot tell you.\n */\nexport function fetchHints({\n truncated,\n contentChars,\n shownChars,\n maxChars,\n}: {\n truncated: boolean;\n contentChars: number;\n shownChars: number;\n /** The `--max-chars` bound, when one was passed: it wins over `--full`. */\n maxChars?: number;\n}): string[] {\n const hints: string[] = [];\n\n if (shownChars < contentChars) {\n const more =\n maxChars === undefined\n ? \"Re-run the same command with `--full` for the whole page\"\n : \"Re-run with a larger `--max-chars` for more, or without `--max-chars` and with `--full` for the whole page\";\n hints.push(\n `Showing the first ${shownChars.toLocaleString(\"en-US\")} of ${contentChars.toLocaleString(\"en-US\")} characters. ` +\n `${more}, or \\`--find '<words>'\\` for only the lines you need — the read is cached for 24h, so it costs no extra time and no extra credit.`,\n );\n }\n\n if (truncated) hints.push(TRUNCATED_READ);\n\n return hints;\n}\n\nconst TRUNCATED_READ =\n \"This page is longer than one read returns, so the end of it is missing. \" +\n \"Don't present this as the complete page; if the part you need is further down, fetch the deeper URL directly.\";\n\n/** Where to look next when the page itself did not have it: the chrome left out of a main-content read. */\nconst wholePageNudge = (wholePage: boolean) =>\n wholePage ? \"\" : \" The read is the main content only: add `--whole-page` to include the header, nav and footer.\";\n\n/**\n * `--find` answers from the whole read, so \"no match\" is a finding about the\n * page, not a reason to dump it and grep by hand.\n */\nexport function findHints({\n find,\n matches,\n shownMatches,\n maxChars,\n wholePage,\n truncated,\n}: {\n find: string;\n matches: number;\n /** Matching lines the answer shows: fewer when the passage limit or the character budget cut it short. */\n shownMatches: number;\n /** The `--max-chars` bound, when one was passed. */\n maxChars?: number;\n wholePage: boolean;\n truncated: boolean;\n}): string[] {\n const hints: string[] = [];\n if (matches === 0) {\n hints.push(\n `No line of the page matches \\`${find}\\` (case-insensitive). Try another word the page would use — its language, a currency sign, a digit pattern like '[0-9]+,[0-9]{2}'.${wholePageNudge(wholePage)}`,\n );\n }\n if (shownMatches < matches) {\n const more = maxChars === undefined ? \"\" : \", or raise `--max-chars`\";\n hints.push(\n `${matches - shownMatches} more matching lines are not shown. Narrow \\`--find\\` to the words around what you need${more}.`,\n );\n }\n if (truncated) hints.push(TRUNCATED_READ);\n return hints;\n}\n\ninterface RefCount {\n kept: number;\n total: number;\n}\n\nexport function refsHints({\n links,\n images,\n find,\n wholePage,\n truncated,\n}: {\n links?: RefCount;\n images?: RefCount;\n find?: string;\n wholePage: boolean;\n truncated: boolean;\n}): string[] {\n const hints: string[] = [];\n const empty = (name: string, count: RefCount) => {\n if (count.kept > 0) return;\n hints.push(\n count.total > 0 && find !== undefined\n ? `None of the page's ${count.total} ${name} matches \\`${find}\\`.${wholePageNudge(wholePage)}`\n : `The page references no ${name}.${wholePageNudge(wholePage)}`,\n );\n };\n if (links) empty(\"links\", links);\n if (images) empty(\"images\", images);\n if (truncated) hints.push(TRUNCATED_READ);\n return hints;\n}\n\nexport function webDepthHints({\n answer,\n sourceCount,\n depth,\n}: {\n answer: string;\n sourceCount: number;\n depth: Depth;\n}): string[] {\n const thin = answer.length < THIN_ANSWER_CHARS || sourceCount <= THIN_SOURCE_COUNT;\n const escalation = ESCALATION[depth];\n if (!thin || !escalation) {\n return [];\n }\n return [`Thin answer (${answer.length} chars, ${sourceCount} source(s)). ${escalation}`];\n}\n\n/**\n * The volume DataForSEO returns is Google's own Keyword Planner figure resold,\n * so putting the two side by side validates nothing — a run did exactly that,\n * found all seven rows agreeing to the digit, and reported the agreement as\n * corroboration. This fires on every call rather than on a suspicious one,\n * because by the time the numbers are in a table the provenance is already gone.\n */\nexport function keywordMetricsHints({\n rows,\n asked,\n clickstream,\n queryContext,\n}: {\n rows: Array<{ keyword: string; location?: string; search_volume: number | null }>;\n asked: string[];\n clickstream: boolean;\n queryContext: QueryContext;\n}): string[] {\n if (rows.length === 0) {\n return noSerpRowsHints(0, queryContext);\n }\n\n const provenance =\n \"DataForSEO resells Google's Keyword Planner volume — planner_search_volume here is the SAME number \" +\n \"`baker ads google keywords metrics` returns, not an independent reading of it. Quoting the two as agreeing \" +\n \"sources is not corroboration.\" +\n (clickstream\n ? \" clickstream_search_volume IS independent (DataForSEO's own panels); when the two disagree, say which one you are quoting.\"\n : \" For a genuinely independent estimate of demand, re-run with --clickstream (costs 2x), or use first-party data: \" +\n \"`baker gsc query` for what already reaches the site, or the account's own search terms.\");\n\n const hints = [provenance];\n\n const compared = rows.some((row) => row.location !== undefined);\n const empty = rows\n .filter((row) => row.search_volume === null)\n .map((row) => (row.location === undefined ? row.keyword : `${row.keyword} (${row.location})`));\n if (empty.length > 0) {\n hints.push(\n `${empty.length} of ${compared ? `${rows.length} keyword/market rows` : `${asked.length} keywords`} came back with no data in ${queryContext.location} / ${queryContext.language}: ` +\n `${empty.join(\", \")}. That is missing coverage, NOT zero demand — do not report them as unsearched, and do not ` +\n \"re-query them reworded. `baker research autocomplete` on the head term is the way to find the phrasing that market uses.\",\n );\n }\n\n return hints;\n}\n\n/**\n * The archive keeps a post's words the moment it is written and its points\n * only once it has settled, so a number on something young is not the number\n * Reddit shows. Said once, when it applies, so a count is never quoted as live.\n */\nconst ARCHIVE_NOTE =\n \"Read from the Reddit archive: the words are as posted, but points and comment counts on anything under ~36h old are as first captured — don't quote those numbers as current.\";\n\n/**\n * An empty Reddit search is almost always a phrasing miss, not a silent\n * audience: Reddit matches words, and people write in their own. A run that\n * came back empty on a posts search also never looked at the replies, which is\n * where most of the verbatim voice is.\n */\nexport function redditSearchHints({\n resultCount,\n kind,\n source,\n}: {\n resultCount: number;\n kind: \"posts\" | \"comments\";\n source: ResearchRedditSource;\n}): string[] {\n const hints: string[] = [];\n if (resultCount === 0) {\n hints.push(\n \"Nothing matched. Reddit search matches words, not meaning: try the audience's own phrasing (one distinctive word, \" +\n \"or a seed from `baker research autocomplete`), a longer --since window, or other subreddits — \" +\n '`baker research reddit subreddits \"<topic>\"` finds where the audience actually talks' +\n (kind === \"posts\" ? \", and try --kind comments — most of the voice is in the replies.\" : \".\"),\n );\n } else if (kind === \"posts\") {\n hints.push(\n \"Titles rarely carry the voice. Read the promising threads with `baker research reddit thread <permalink>` \" +\n \"for the replies, or search the replies directly with --kind comments.\",\n );\n }\n if (source === \"archive\" && resultCount > 0) hints.push(ARCHIVE_NOTE);\n return hints;\n}\n\n/** A thread whose replies no source would serve is still the post — but it must not read as a thread nobody answered. */\nexport function redditThreadHints({\n commentsShown,\n commentsAsked,\n commentCount,\n source,\n}: {\n commentsShown: number;\n commentsAsked: number;\n commentCount: number | null;\n source: ResearchRedditSource;\n}): string[] {\n const hints: string[] = [];\n if (commentsAsked > 0 && commentsShown === 0 && (commentCount ?? 0) > 0) {\n hints.push(\n `This thread has ${commentCount} comments but none could be read just now. Quote the post only, and don't describe the replies.`,\n );\n }\n if (source === \"archive\") hints.push(ARCHIVE_NOTE);\n return hints;\n}\n\nconst REDDIT_HOST = /(^|\\.)reddit\\.com$|^redd\\.it$/i;\n\n/**\n * A subreddit's member count is its size, not its pulse. The run that prompted\n * this command mined r/CouriersUK — a real subreddit, with one post in its whole\n * history — and found nothing. One dated search tells a living subreddit from a\n * dead one before it is relied on.\n */\nexport function redditSubredditsHints({ resultCount }: { resultCount: number }): string[] {\n if (resultCount === 0) {\n return [\n 'No subreddits matched. Try the audience\\'s role or the platform they work on (\"amazon flex\", \"deliveroo\", \"nurses\"), one word at a time, or a web search for `site:reddit.com <topic>`.',\n ];\n }\n return [\n 'Members say how big a subreddit is, not how active it is. Before mining one, run `baker research reddit search \"<word>\" --subreddit <name> --since <a recent date>`: nothing back means it is quiet, so pick another. `restricted` can still be read; `private` cannot.',\n ];\n}\n\n/** A Reddit link that does not lead to the words attributed to it. Shared by `reddit thread` and `fetch`. */\nexport const REDDIT_LINK_REJECTED: ResearchFix = {\n action: \"reject\",\n explanation:\n \"Do not quote anything attributed to this link — it does not lead to those words. Find the real thread with `baker research reddit search`, and if you already wrote a quote from it, remove it.\",\n};\n\n/**\n * `research fetch` hands a Reddit URL to the Reddit reader, but its generic\n * remediation was written for ordinary pages: FORBIDDEN reads \"this will not\n * open, carry on without it\" and NOT_FOUND \"carry on\". For Reddit both are the\n * wrong advice. A page the reader will not turn into a thread is one `reddit`\n * command away, and a link that leads nowhere real must not be quoted at all.\n */\nexport function redditPageFix(url: string, code: string): ResearchFix | null {\n let host: string;\n try {\n host = new URL(url).hostname;\n } catch {\n return null;\n }\n if (!REDDIT_HOST.test(host)) return null;\n if (code === \"NOT_FOUND\") return REDDIT_LINK_REJECTED;\n if (code !== \"FORBIDDEN\") return null;\n return {\n action: \"retry_with_changes\",\n explanation:\n 'Read Reddit with its own commands: `baker research reddit search \"<words>\" --subreddit <name>` to find what people said, `baker research reddit thread <url>` for one thread.',\n };\n}\n\n/**\n * `google-ads` replaces a browser trip through Google's Ads Transparency\n * Center, so its hints keep the agent out of one: no ads is an answer, and an\n * ad whose copy Google does not give is shown by its link, never opened.\n */\nexport function googleAdsHints({\n target,\n adCount,\n located,\n textWithoutCopy,\n copyAsked,\n copyUnread,\n visual,\n}: {\n target: string;\n adCount: number;\n located: boolean;\n textWithoutCopy: number;\n copyAsked: boolean;\n copyUnread: number;\n visual: number;\n}): string[] {\n if (adCount === 0) {\n return [\n `No Google ads point to ${target}${located ? \" in that region\" : \"\"} — that is the answer, not a failed call: ` +\n \"this competitor is not advertising on Google there, or its ads point to another domain. \" +\n (located ? \"Re-run once without --location to see every region; then move on. \" : \"Move on. \") +\n `Its paid search terms, if any: \\`baker research keywords-for-site ${target} --type paid\\`.`,\n ];\n }\n const hints: string[] = [];\n if (!copyAsked && textWithoutCopy > 0) {\n hints.push(\n `${textWithoutCopy} text ads came back without their words. Re-run with --copy to read the headline and description of up to ${RESEARCH_GOOGLE_ADS_MAX_COPY} (cached, so only the reading is new).`,\n );\n }\n const pastCap = copyAsked ? textWithoutCopy - copyUnread : 0;\n if (pastCap > 0) {\n hints.push(\n `${pastCap} text ads past the first ${RESEARCH_GOOGLE_ADS_MAX_COPY} were not read — one request reads at most ${RESEARCH_GOOGLE_ADS_MAX_COPY}. ` +\n \"Narrow with --since, --location or --platform google_search and re-run for their words.\",\n );\n }\n if (visual > 0 || copyUnread > 0) {\n const without = [\n visual > 0 ? `${visual} image or video ads (Google gives no text for those)` : \"\",\n copyUnread > 0 ? `${copyUnread} text ads whose image could not be read` : \"\",\n ].filter(Boolean);\n hints.push(\n `No copy for ${without.join(\" and \")}: show those by their \\`transparency_url\\`. ` +\n \"Do not open the Transparency Center in agent-browser to read them — it is the browser load this command exists to avoid.\",\n );\n }\n return hints;\n}\n\n/**\n * A person's profile is read to write one account's ads and pages, and that is\n * all it is for. Said on every read, because the next natural step — saving\n * them to Knowledge, or reading them again next week — is the one we don't take.\n */\nexport const LINKEDIN_PERSON_USE =\n \"For ad and page messaging only; nothing is stored — quote their stated priorities into the creative brief \" +\n \"for this account, and don't save the person to Knowledge or read them again to keep track of them.\";\n\n/**\n * The people a search found are public profiles a decision model checked, not\n * contacts: said on every read, with the one next step that deepens a lead.\n */\nexport function peopleHints({\n found,\n dropped,\n verified,\n}: {\n found: number;\n dropped: number;\n verified: boolean;\n}): string[] {\n if (found === 0) {\n return [\n `Nobody in public LinkedIn results holds this role here${dropped > 0 ? ` (${dropped} profiles were elsewhere now or in another role)` : \"\"}. ` +\n \"Try the name people write on LinkedIn with --name, a broader --seniority, or the client's CRM: `baker hubspot companies contacts <domain>`.\",\n ];\n }\n const hints = [\n verified\n ? \"These are public search results a decision model checked — likely holders of the role, to confirm before anyone reaches out. Brief sales with them; never contact anyone or save them to Knowledge.\"\n : \"The check could not run, so these profiles are unchecked: Google matched the words, not the person. Read each headline before naming anyone.\",\n \"To write to one of them in their own words, read their profile once: `baker research linkedin-person <profile_url>`.\",\n ];\n return hints;\n}\n\nexport function linkedinPersonHints({ isPrivate, postCount }: { isPrivate: boolean; postCount: number }): string[] {\n if (isPrivate) {\n return [\n \"LinkedIn doesn't show this profile publicly, and reading it again won't change that. \" +\n \"Find their own words elsewhere — a keynote, podcast or earnings call through \" +\n \"`baker research transcript <url>`, or an interview through `baker research fetch <url>` — \" +\n \"or write the brief from the account's company-level priorities.\",\n ];\n }\n if (postCount === 0) {\n return [\n LINKEDIN_PERSON_USE,\n \"They have no recent posts, so their `about` is the only first-person line here. \" +\n \"Their priorities are more often said aloud: a keynote, podcast or earnings call through `baker research transcript <url>`.\",\n ];\n }\n return [LINKEDIN_PERSON_USE];\n}\n\n/**\n * A keynote runs to tens of thousands of words, which is why the default is an\n * excerpt; the transcript is cached for a week, so asking again for the rest\n * costs nothing.\n */\nexport function transcriptHints({ excerpted, truncated }: { excerpted: boolean; truncated: boolean }): string[] {\n const hints: string[] = [];\n if (excerpted) {\n hints.push(\n \"This is the opening excerpt. Re-run with `--out <file>` to write the whole text to a file and read the parts you need, \" +\n \"or `--full` to have it all here — the transcript is cached for 7 days, so either costs nothing more.\",\n );\n }\n if (truncated) {\n hints.push(\n \"The recording is longer than one transcript carries, so the end of the recording is missing. \" +\n \"Don't quote this as the whole talk.\",\n );\n }\n return hints;\n}\n\n/** The facts whose absence marks a profile as possibly another company's. */\nexport interface CompanyProfileFacts {\n linkedinUrl: string | null;\n hqCountry: string | null;\n employees: string | null;\n}\n\n/**\n * A profile missing two of its anchor facts, or sized 1-10, is often a namesake\n * on the domain asked for while the company itself runs on another one.\n */\nfunction thinProfileHint(domain: string, profile: CompanyProfileFacts): string | null {\n const missing = [\n profile.linkedinUrl ? null : \"no LinkedIn page\",\n profile.hqCountry ? null : \"no HQ country\",\n profile.employees ? null : \"no employee band\",\n ].filter((gap) => gap !== null);\n const tiny = profile.employees === \"1-10\";\n if (missing.length < 2 && !tiny) return null;\n const why = [...missing, ...(tiny ? [\"1-10 employees\"] : [])].join(\", \");\n return (\n `This profile is thin (${why}). Check ${domain} is the company's main website — companies often run on another ` +\n \"domain (e.g. factorial.es vs factorialhr.com) — before using these facts for tiering.\"\n );\n}\n\n/**\n * Hiring is a signal on top of the profile, so a lookup without it still\n * answers — and says which half is missing, so the agent neither loops on it\n * nor reads \"no openings\" into a gap. A hiring read left out on purpose\n * (`--no-hiring`) says nothing.\n */\nexport function companyHints({\n domain,\n profile,\n hiring,\n}: {\n domain: string;\n profile: CompanyProfileFacts | null;\n hiring: ResearchCompanyHiring;\n}): string[] {\n const hints: string[] = [];\n if (!profile) {\n hints.push(\n \"There's no company profile for this domain, only its hiring. Check it is the company's main website; \" +\n \"otherwise take size, industry and location from its LinkedIn page or its own site.\",\n );\n } else {\n const thin = thinProfileHint(domain, profile);\n if (thin) hints.push(thin);\n }\n if (hiring.status === \"unavailable\" && hiring.reason === \"not_configured\") {\n hints.push(\n \"Hiring signals aren't switched on for this workspace yet, so these are the firmographics alone. \" +\n \"Score the account on them and leave hiring out of the reason.\",\n );\n }\n if (hiring.status === \"unavailable\" && hiring.reason === \"failed\") {\n hints.push(\n \"Hiring signals couldn't be read this time; don't retry in a loop. Use the firmographics and say hiring is unknown for this account.\",\n );\n }\n if (hiring.status === \"not_tracked\") {\n hints.push(\n \"No hiring data is kept for this company — that means unknown, not that it isn't hiring. Don't score it down for it.\",\n );\n }\n return hints;\n}\n\nfunction industryList(industries: readonly ResearchCompanyIndustry[]): string {\n return industries.map(({ slug, companies }) => `${slug} (${companies.toLocaleString(\"en-US\")})`).join(\", \");\n}\n\n/**\n * Neighbouring industries the search left out, so a thin market is widened on\n * purpose rather than guessed at. Each count is the companies it would add.\n */\nfunction relatedIndustriesHint(related: readonly ResearchCompanyIndustry[]): string | null {\n if (related.length === 0) return null;\n return (\n `Related industries not included (companies each adds with your other filters): ${industryList(related)}` +\n \" — add them with --industry a,b to widen.\"\n );\n}\n\nexport function companySearchHints({\n total,\n returned,\n page,\n lastPage,\n related,\n}: {\n total: number;\n returned: number;\n page: number;\n lastPage: number;\n related: readonly ResearchCompanyIndustry[];\n}): string[] {\n const hints: string[] = [];\n if (total === 0) {\n hints.push(\n \"No company matches every filter. Widen one at a time — a neighbouring size band, a related industry, one more country.\",\n );\n } else if (page < lastPage && returned > 0) {\n hints.push(\n `${total} companies match and ${returned} came back (each one returned is billed). ` +\n `Use \\`total\\` to size the market; ask for \\`--page ${page + 1}\\` only if you need the next rows for the list.`,\n );\n }\n const widen = relatedIndustriesHint(related);\n if (widen) hints.push(widen);\n return hints;\n}\n\n/** An industry that is no slug refuses the search before anything is billed; the fix offers the real ones. */\nexport function unknownIndustriesFix(industries: readonly { input: string; closest: ResearchCompanyIndustry[] }[]): {\n action: \"retry_with_changes\";\n explanation: string;\n} {\n const misses = industries.map(({ input, closest }) =>\n closest.length > 0\n ? `\"${input}\" is not an industry. Closest (companies each matches with your other filters): ${industryList(closest)}.`\n : `\"${input}\" is not an industry, and none is named like it — try a broader word (software, logistics, retail).`,\n );\n return {\n action: \"retry_with_changes\",\n explanation: `${misses.join(\" \")} Pass one or several of these slugs with --industry a,b — several widen the search, any of them matching. Nothing was charged.`,\n };\n}\n"],"mappings":";;;;;AAuBO,IAAM,gBACX;AAaK,SAAS,gBAAgB,UAAkB,cAAsC;AACtF,MAAI,WAAW,GAAG;AAChB,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AAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMa;AACX,QAAM,QAAkB,CAAC;AACzB,MAAI,UAAU,GAAG;AACf,UAAM;AAAA,MACJ;AAAA,IACF;AAAA,EACF,WAAW,OAAO,YAAY,WAAW,GAAG;AAC1C,UAAM;AAAA,MACJ,GAAG,KAAK,wBAAwB,QAAQ,gGACgB,OAAO,CAAC;AAAA,IAClE;AAAA,EACF;AACA,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,MAAI,MAAO,OAAM,KAAK,KAAK;AAC3B,SAAO;AACT;AAGO,SAAS,qBAAqB,YAGnC;AACA,QAAM,SAAS,WAAW;AAAA,IAAI,CAAC,EAAE,OAAO,QAAQ,MAC9C,QAAQ,SAAS,IACb,IAAI,KAAK,mFAAmF,aAAa,OAAO,CAAC,MACjH,IAAI,KAAK;AAAA,EACf;AACA,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,aAAa,GAAG,OAAO,KAAK,GAAG,CAAC;AAAA,EAClC;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
redditSearchHints,
|
|
4
4
|
redditSubredditsHints,
|
|
5
5
|
redditThreadHints
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RNOWWEA7.js";
|
|
7
7
|
import {
|
|
8
8
|
handleResearchError,
|
|
9
9
|
writeResearchJson
|
|
@@ -52,7 +52,7 @@ registerSchema({
|
|
|
52
52
|
},
|
|
53
53
|
subreddit: {
|
|
54
54
|
type: "string",
|
|
55
|
-
description: "Subreddits to search (up to 10): comma-separated (couriersofreddit,AmazonFlexUK) or the flag repeated.
|
|
55
|
+
description: "Subreddits to search (up to 10): comma-separated (couriersofreddit,AmazonFlexUK) or the flag repeated. Needed for --kind comments",
|
|
56
56
|
required: false
|
|
57
57
|
},
|
|
58
58
|
kind: {
|
|
@@ -137,7 +137,6 @@ function failValidation(message) {
|
|
|
137
137
|
writeResearchJson({ ok: false, error: { code: "VALIDATION_ERROR", message, fix: redditFix("VALIDATION_ERROR") } });
|
|
138
138
|
process.exit(1);
|
|
139
139
|
}
|
|
140
|
-
var COMMENTS_NEED_SUBREDDITS = '--kind comments searches inside the subreddits you name, never all of Reddit \u2014 add --subreddit (up to 10). Find where the audience talks with `baker research reddit subreddits "<audience or topic>"`, or use the `subreddit` of the posts a search without --kind comments returned.';
|
|
141
140
|
function subredditsFromArgs(rawArgs, parsed) {
|
|
142
141
|
return repeatedValues(rawArgs, "subreddit", parsed).flatMap((value) => value.split(",")).map((name) => name.trim()).filter(Boolean);
|
|
143
142
|
}
|
|
@@ -158,7 +157,7 @@ Examples:
|
|
|
158
157
|
query: { type: "positional", description: "Words to match", required: false },
|
|
159
158
|
subreddit: {
|
|
160
159
|
type: "string",
|
|
161
|
-
description: "Subreddits (up to 10): comma-separated, or repeat the flag
|
|
160
|
+
description: "Subreddits (up to 10): comma-separated, or repeat the flag",
|
|
162
161
|
required: false
|
|
163
162
|
},
|
|
164
163
|
kind: { type: "string", description: "posts (default) or comments", required: false },
|
|
@@ -171,9 +170,11 @@ Examples:
|
|
|
171
170
|
if (!query) failValidation('Say what to search for: baker research reddit search "<words>"');
|
|
172
171
|
const kind = args.kind ?? "posts";
|
|
173
172
|
if (kind !== "posts" && kind !== "comments") failValidation("--kind must be posts or comments");
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
const body = {
|
|
174
|
+
query,
|
|
175
|
+
kind,
|
|
176
|
+
subreddits: subredditsFromArgs(rawArgs, args.subreddit)
|
|
177
|
+
};
|
|
177
178
|
if (args.since) body.since = args.since;
|
|
178
179
|
if (args.limit) body.limit = Number(args.limit);
|
|
179
180
|
try {
|
|
@@ -299,4 +300,4 @@ export {
|
|
|
299
300
|
subredditsFromArgs,
|
|
300
301
|
redditCommand
|
|
301
302
|
};
|
|
302
|
-
//# sourceMappingURL=chunk-
|
|
303
|
+
//# sourceMappingURL=chunk-S2WLJBUA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/research/reddit.ts"],"sourcesContent":["import {\n RESEARCH_REDDIT_THREAD_DEFAULT_COMMENTS,\n type ResearchRedditItem,\n type ResearchRedditSearchRequest,\n type ResearchRedditSearchResponse,\n type ResearchRedditSubredditsRequest,\n type ResearchRedditSubredditsResponse,\n type ResearchRedditThreadRequest,\n type ResearchRedditThreadResponse,\n} from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { repeatedValues } from \"../../lib/repeatedFlags.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { REDDIT_LINK_REJECTED, redditSearchHints, redditSubredditsHints, redditThreadHints } from \"./hints.ts\";\nimport { handleResearchError, type ResearchFix, writeResearchJson } from \"./output.ts\";\n\n/**\n * Up to three sources may be asked in turn, and the archive waits out its own\n * rate limit before giving up — so a read can legitimately take a minute.\n */\nconst TIMEOUT_MS = 180_000;\n\n/** Long enough for almost every comment; a longer one says it was cut, so a partial quote is never mistaken for a whole one. */\nconst TEXT_PREVIEW_CHARS = 1_500;\n\nconst ITEM_FIELDS: Record<string, string> = {\n kind: \"post or comment\",\n subreddit: \"Where it was said\",\n title: \"The post's title (on a comment: the post it answers)\",\n text: \"Verbatim — quote this, exactly\",\n text_truncated: \"The text was cut; re-run with --full before quoting the end of it\",\n author: \"Reddit username, or null once the account is deleted\",\n score: \"Points\",\n comment_count: \"Posts only\",\n created: \"Date written (UTC)\",\n permalink: \"Cite THIS link — it is built from where the words actually are\",\n depth: \"Thread comments: 0 answers the post, 1 answers a comment\",\n source: \"reddit_api / reddit_web = live Reddit; archive = the Arctic Shift archive of Reddit\",\n};\n\nregisterSchema({\n command: \"research.reddit.search\",\n routes: [\"POST /api/research/reddit/search\"],\n effect: \"read_live\",\n description:\n \"Search Reddit posts or comments for the audience's own words. Returns verbatim text with a real permalink for each hit. Start here for voice-of-customer work on Reddit.\",\n args: {\n query: {\n type: \"string\",\n description: \"Words to match — the audience's phrasing, not a description of it\",\n required: true,\n },\n subreddit: {\n type: \"string\",\n description:\n \"Subreddits to search (up to 10): comma-separated (couriersofreddit,AmazonFlexUK) or the flag repeated. Needed for --kind comments\",\n required: false,\n },\n kind: {\n type: \"string\",\n description: \"posts (default) or comments — the replies are where most of the voice is\",\n required: false,\n enum: [\"posts\", \"comments\"],\n },\n since: { type: \"string\", description: \"Only things written on or after this day, YYYY-MM-DD\", required: false },\n limit: { type: \"number\", description: \"Results to return (1-50, default 25)\", required: false },\n full: {\n type: \"boolean\",\n description: \"Return every text whole instead of a preview\",\n required: false,\n default: false,\n },\n },\n});\n\nregisterSchema({\n command: \"research.reddit.thread\",\n routes: [\"POST /api/research/reddit/thread\"],\n effect: \"read_live\",\n description:\n \"Read one Reddit thread verbatim: the post and its best comments, each with its own permalink. Use it on any Reddit link before quoting it — it also exposes links that point somewhere other than they claim.\",\n args: {\n target: {\n type: \"string\",\n description: \"The thread's link (any Reddit form, including share links) or post id\",\n required: true,\n },\n comments: { type: \"number\", description: \"Comments to return, best first (0-200, default 40)\", required: false },\n full: {\n type: \"boolean\",\n description: \"Return every text whole instead of a preview\",\n required: false,\n default: false,\n },\n },\n});\n\nregisterSchema({\n command: \"research.reddit.subreddits\",\n routes: [\"POST /api/research/reddit/subreddits\"],\n effect: \"read_live\",\n description:\n \"Find the subreddits where an audience talks about a topic, with member counts and whether they can be read. Run it before searching, instead of guessing subreddit names.\",\n args: {\n query: { type: \"string\", description: 'The audience or topic, e.g. \"amazon flex uk\", \"deliveroo\"', required: true },\n limit: { type: \"number\", description: \"Subreddits to return (1-25, default 10)\", required: false },\n },\n});\n\n/** One Reddit search, as `reddit search` and `research customers` both ask it. */\nexport function searchReddit(body: ResearchRedditSearchRequest): Promise<ResearchRedditSearchResponse> {\n return apiPost<ResearchRedditSearchResponse>(\"/api/research/reddit/search\", body, { timeoutMs: TIMEOUT_MS });\n}\n\n/** Where an audience talks, as `reddit subreddits` and `research customers` both ask it. */\nexport function findSubreddits(body: ResearchRedditSubredditsRequest): Promise<ResearchRedditSubredditsResponse> {\n return apiPost<ResearchRedditSubredditsResponse>(\"/api/research/reddit/subreddits\", body, { timeoutMs: TIMEOUT_MS });\n}\n\nfunction row(item: ResearchRedditItem, full: boolean) {\n const cut = !full && item.text.length > TEXT_PREVIEW_CHARS;\n return {\n kind: item.kind,\n subreddit: item.subreddit,\n title: item.title,\n text: cut ? `${item.text.slice(0, TEXT_PREVIEW_CHARS)}…` : item.text,\n ...(cut ? { text_truncated: true } : {}),\n author: item.author,\n score: item.score,\n ...(item.kind === \"post\" ? { comment_count: item.commentCount } : {}),\n created: item.createdAt.slice(0, 10),\n permalink: item.permalink,\n ...(item.depth !== null ? { depth: item.depth } : {}),\n };\n}\n\n/**\n * The failures split three ways, and the split is the whole point: a link that\n * leads nowhere real must never be quoted, a question asked the wrong way should\n * be asked again, and a Reddit nobody will serve today is a named gap, not a\n * reason to stop the job.\n */\nfunction redditFix(code: string): ResearchFix {\n if (code === \"NOT_FOUND\") return REDDIT_LINK_REJECTED;\n if (code === \"BAD_REQUEST\" || code === \"VALIDATION_ERROR\") {\n return { action: \"retry_with_changes\", explanation: \"Follow the message above and run the command again.\" };\n }\n return {\n action: \"continue_without\",\n explanation:\n \"Don't loop on it. Finish the job with the other sources, say plainly that Reddit is a gap in this research, and never stand in a summary's paraphrase for a Reddit quote.\",\n };\n}\n\nfunction failValidation(message: string): never {\n writeResearchJson({ ok: false, error: { code: \"VALIDATION_ERROR\", message, fix: redditFix(\"VALIDATION_ERROR\") } });\n process.exit(1);\n}\n\n/** `--subreddit a,b` and `--subreddit a --subreddit b` both name every subreddit given. */\nexport function subredditsFromArgs(rawArgs: readonly string[] | undefined, parsed: unknown): string[] {\n return repeatedValues(rawArgs, \"subreddit\", parsed)\n .flatMap((value) => value.split(\",\"))\n .map((name) => name.trim())\n .filter(Boolean);\n}\n\nconst searchCommand = defineCommand({\n meta: {\n name: \"search\",\n description: `Search Reddit for the audience's own words, verbatim, each with a permalink you can cite.\n\nStart here for Reddit voice-of-customer. Matches words, not meaning — search the way the audience writes, and quote a phrase to keep it together ('\"right to work\"').\n\nExamples:\n baker research reddit search \"agency never paid\" --subreddit couriersofreddit,AmazonFlexUK\n baker research reddit search '\"right to work\"' --subreddit UKJobs,AmazonFlexUK\n baker research reddit search \"visa\" --subreddit UberEATS --kind comments --since 2025-01-01\n baker research reddit search \"side hustle student deliveries\"`,\n },\n args: {\n query: { type: \"positional\", description: \"Words to match\", required: false },\n subreddit: {\n type: \"string\",\n description: \"Subreddits (up to 10): comma-separated, or repeat the flag\",\n required: false,\n },\n kind: { type: \"string\", description: \"posts (default) or comments\", required: false },\n since: { type: \"string\", description: \"YYYY-MM-DD\", required: false },\n limit: { type: \"string\", description: \"1-50, default 25\", required: false },\n full: { type: \"boolean\", description: \"Whole texts, not previews\", required: false },\n },\n run: async ({ args, rawArgs }) => {\n const query = (args.query as string | undefined)?.trim();\n if (!query) failValidation('Say what to search for: baker research reddit search \"<words>\"');\n const kind = (args.kind as string | undefined) ?? \"posts\";\n if (kind !== \"posts\" && kind !== \"comments\") failValidation(\"--kind must be posts or comments\");\n\n const body: ResearchRedditSearchRequest = {\n query,\n kind,\n subreddits: subredditsFromArgs(rawArgs, args.subreddit),\n };\n if (args.since) body.since = args.since as string;\n if (args.limit) body.limit = Number(args.limit);\n\n try {\n const data = await searchReddit(body);\n writeResearchJson({\n ok: true,\n data: data.results.map((item) => row(item, Boolean(args.full))),\n source: data.source,\n fields: ITEM_FIELDS,\n hints: redditSearchHints({ resultCount: data.results.length, kind, source: data.source }),\n });\n } catch (err) {\n handleResearchError(err, redditFix);\n }\n },\n});\n\nconst threadCommand = defineCommand({\n meta: {\n name: \"thread\",\n description: `Read one Reddit thread verbatim — the post and its best comments, each with its own permalink.\n\nRun it on every Reddit link before you quote from it, including links a research summary gave you: it refuses a link whose post is somewhere other than the link claims.\n\nExamples:\n baker research reddit thread \"https://www.reddit.com/r/AmazonFlexUK/comments/1abc2de/agency_still_hasnt_paid_me/\"\n baker research reddit thread \"https://www.reddit.com/r/UberEATS/s/3TzXiyxaMD\" --comments 100\n baker research reddit thread 1abc2de --full`,\n },\n args: {\n target: { type: \"positional\", description: \"Thread link or post id\", required: false },\n comments: { type: \"string\", description: \"0-200, default 40\", required: false },\n full: { type: \"boolean\", description: \"Whole texts, not previews\", required: false },\n },\n run: async ({ args }) => {\n const target = (args.target as string | undefined)?.trim();\n if (!target) failValidation(\"Pass the thread's link or post id: baker research reddit thread <url>\");\n\n const commentsAsked = args.comments ? Number(args.comments) : RESEARCH_REDDIT_THREAD_DEFAULT_COMMENTS;\n const body: ResearchRedditThreadRequest = { target, comments: commentsAsked };\n\n try {\n const data = await apiPost<ResearchRedditThreadResponse>(\"/api/research/reddit/thread\", body, {\n timeoutMs: TIMEOUT_MS,\n });\n const full = Boolean(args.full);\n writeResearchJson({\n ok: true,\n data: { post: row(data.post, full), comments: data.comments.map((item) => row(item, full)) },\n source: data.source,\n fields: ITEM_FIELDS,\n hints: redditThreadHints({\n commentsShown: data.comments.length,\n commentsAsked,\n commentCount: data.post.commentCount,\n source: data.source,\n }),\n });\n } catch (err) {\n handleResearchError(err, redditFix);\n }\n },\n});\n\nconst subredditsCommand = defineCommand({\n meta: {\n name: \"subreddits\",\n description: `Find the subreddits where an audience talks — name, members, and whether it can be read.\n\nRun it before \\`reddit search\\` instead of guessing names: a plausible-sounding subreddit can be dead (r/CouriersUK has one post), while the conversation sits in r/AmazonFlexUK or r/deliveroos.\n\nExamples:\n baker research reddit subreddits \"amazon flex uk\"\n baker research reddit subreddits \"deliveroo\" --limit 5`,\n },\n args: {\n query: { type: \"positional\", description: \"Audience or topic\", required: false },\n limit: { type: \"string\", description: \"1-25, default 10\", required: false },\n },\n run: async ({ args }) => {\n const query = (args.query as string | undefined)?.trim();\n if (!query) failValidation('Say what to look for: baker research reddit subreddits \"<audience or topic>\"');\n const body: ResearchRedditSubredditsRequest = { query };\n if (args.limit) body.limit = Number(args.limit);\n\n try {\n const data = await findSubreddits(body);\n writeResearchJson({\n ok: true,\n data: data.results,\n source: data.source,\n fields: {\n name: \"Pass this to --subreddit\",\n subscribers: \"Members — size, not activity\",\n access:\n \"public / restricted (readable, members post) / private (unreadable) / null when the source doesn't say\",\n description: \"The subreddit's own summary\",\n url: \"The subreddit\",\n },\n hints: redditSubredditsHints({ resultCount: data.results.length }),\n });\n } catch (err) {\n handleResearchError(err, redditFix);\n }\n },\n});\n\nexport const redditCommand = defineCommand({\n meta: {\n name: \"reddit\",\n description: `Read Reddit verbatim — the one site no page reader will open for us.\n\nCommands:\n subreddits — Find where the audience talks (start here)\n search — Find posts or comments in the audience's own words\n thread — Read one thread: the post and its best comments\n\nExamples:\n baker research reddit subreddits \"amazon flex uk\"\n baker research reddit search \"agency never paid\" --subreddit couriersofreddit,AmazonFlexUK --kind comments\n baker research reddit thread \"https://www.reddit.com/r/AmazonFlexUK/comments/1abc2de/\"\nFull guide: __tooling__/docs/tools/baker/research.md`,\n },\n subCommands: { subreddits: subredditsCommand, search: searchCommand, thread: threadCommand },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,qBAAqB;AAW9B,IAAM,aAAa;AAGnB,IAAM,qBAAqB;AAE3B,IAAM,cAAsC;AAAA,EAC1C,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,eAAe;AAAA,EACb,SAAS;AAAA,EACT,QAAQ,CAAC,kCAAkC;AAAA,EAC3C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,MAAM;AAAA,IACJ,OAAO;AAAA,MACL,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,a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M;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf;AAAA,EACA,MAAM;AAAA,IACJ,OAAO,EAAE,MAAM,cAAc,aAAa,qBAAqB,UAAU,MAAM;AAAA,IAC/E,OAAO,EAAE,MAAM,UAAU,aAAa,oBAAoB,UAAU,MAAM;AAAA,EAC5E;AAAA,EACA,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,QAAS,KAAK,OAA8B,KAAK;AACvD,QAAI,CAAC,MAAO,gBAAe,8EAA8E;AACzG,UAAM,OAAwC,EAAE,MAAM;AACtD,QAAI,KAAK,MAAO,MAAK,QAAQ,OAAO,KAAK,KAAK;AAE9C,QAAI;AACF,YAAM,OAAO,MAAM,eAAe,IAAI;AACtC,wBAAkB;AAAA,QAChB,IAAI;AAAA,QACJ,MAAM,KAAK;AAAA,QACX,QAAQ,KAAK;AAAA,QACb,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,UACb,QACE;AAAA,UACF,aAAa;AAAA,UACb,KAAK;AAAA,QACP;AAAA,QACA,OAAO,sBAAsB,EAAE,aAAa,KAAK,QAAQ,OAAO,CAAC;AAAA,MACnE,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,0BAAoB,KAAK,SAAS;AAAA,IACpC;AAAA,EACF;AACF,CAAC;AAEM,IAAM,gBAAgB,cAAc;AAAA,EACzC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYf;AAAA,EACA,aAAa,EAAE,YAAY,mBAAmB,QAAQ,eAAe,QAAQ,cAAc;AAC7F,CAAC;","names":[]}
|
package/dist/cli.js
CHANGED
|
@@ -625,17 +625,17 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
625
625
|
capabilities: () => import("./capabilities-L5GGYWBL.js").then((m) => m.capabilitiesCommand),
|
|
626
626
|
actions: () => import("./actions-DYM47UFS.js").then((m) => m.actionsCommand),
|
|
627
627
|
"scheduled-agents": () => import("./scheduled-agents-7RMFVLN3.js").then((m) => m.scheduledAgentsCommand),
|
|
628
|
-
ads: () => import("./ads-
|
|
628
|
+
ads: () => import("./ads-FTIZ2QLC.js").then((m) => m.adsCommand),
|
|
629
629
|
brand: () => import("./brand-CMKT6D25.js").then((m) => m.brandCommand),
|
|
630
630
|
analytics: () => import("./analytics-LYGTOOOH.js").then((m) => m.analyticsCommand),
|
|
631
631
|
experiment: () => import("./experiment-FMMX57VR.js").then((m) => m.experimentCommand),
|
|
632
632
|
ga4: () => import("./ga4-6J3IMDSU.js").then((m) => m.ga4Command),
|
|
633
633
|
gsc: () => import("./gsc-3S5RCIKP.js").then((m) => m.gscCommand),
|
|
634
|
-
research: () => import("./research-
|
|
634
|
+
research: () => import("./research-MR7Q47RX.js").then((m) => m.researchCommand),
|
|
635
635
|
decide: () => import("./decide-QM5SCNMP.js").then((m) => m.decideCommand),
|
|
636
636
|
data: () => import("./data-JRLTQ2ZL.js").then((m) => m.dataCommand),
|
|
637
637
|
knowledge: () => import("./knowledge-S6QL4LX5.js").then((m) => m.knowledgeCommand),
|
|
638
|
-
creatives: () => import("./creatives-
|
|
638
|
+
creatives: () => import("./creatives-VSSKFV65.js").then((m) => m.creativesCommand),
|
|
639
639
|
rules: () => import("./rules-IHIQQF5C.js").then((m) => m.rulesCommand),
|
|
640
640
|
files: () => import("./files-SPBLE3DV.js").then((m) => m.filesCommand),
|
|
641
641
|
flows: () => import("./flows-2VSLY57O.js").then((m) => m.flowsCommand),
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
companyHints,
|
|
3
3
|
companySearchHints,
|
|
4
4
|
unknownIndustriesFix
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RNOWWEA7.js";
|
|
6
6
|
import {
|
|
7
7
|
handleResearchError,
|
|
8
8
|
writeResearchJson
|
|
@@ -309,4 +309,4 @@ Examples:
|
|
|
309
309
|
export {
|
|
310
310
|
companyCommand
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=company-
|
|
312
|
+
//# sourceMappingURL=company-JFASPEKT.js.map
|
|
@@ -32,7 +32,7 @@ How published creatives are doing in live Meta ads (results, fatigue, angle; hoo
|
|
|
32
32
|
Full guide: __tooling__/docs/tools/baker/creatives.md`
|
|
33
33
|
},
|
|
34
34
|
subCommands: {
|
|
35
|
-
brief: () => import("./brief-
|
|
35
|
+
brief: () => import("./brief-3IJH6ADD.js").then((m) => m.briefCommand),
|
|
36
36
|
ideas: () => import("./ideas-5V4TFQA4.js").then((m) => m.ideasCommand),
|
|
37
37
|
make: () => import("./make-6FZSKF4C.js").then((m) => m.makeCommand),
|
|
38
38
|
translate: () => import("./translate-NDEGN7IQ.js").then((m) => m.translateCommand),
|
|
@@ -45,4 +45,4 @@ Full guide: __tooling__/docs/tools/baker/creatives.md`
|
|
|
45
45
|
export {
|
|
46
46
|
creativesCommand
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=creatives-
|
|
48
|
+
//# sourceMappingURL=creatives-VSSKFV65.js.map
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
sourcesFromReddit,
|
|
18
18
|
sourcesFromTestimonials,
|
|
19
19
|
webPageUrls
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-D6LOQ7X2.js";
|
|
21
|
+
import "./chunk-S2WLJBUA.js";
|
|
22
|
+
import "./chunk-RNOWWEA7.js";
|
|
23
23
|
import "./chunk-HU6BAHX5.js";
|
|
24
24
|
import "./chunk-ERSX3MKH.js";
|
|
25
25
|
import "./chunk-3JLS56VK.js";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
sourcesFromTestimonials,
|
|
68
68
|
webPageUrls
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=customers-
|
|
70
|
+
//# sourceMappingURL=customers-MGO6LEK7.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
findHints,
|
|
4
4
|
redditPageFix,
|
|
5
5
|
refsHints
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RNOWWEA7.js";
|
|
7
7
|
import {
|
|
8
8
|
handleResearchError,
|
|
9
9
|
writeResearchJson
|
|
@@ -485,4 +485,4 @@ Examples:
|
|
|
485
485
|
export {
|
|
486
486
|
fetchCommand
|
|
487
487
|
};
|
|
488
|
-
//# sourceMappingURL=fetch-
|
|
488
|
+
//# sourceMappingURL=fetch-YVKQOGKD.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-QRKQZYX4.js";
|
|
8
8
|
import {
|
|
9
9
|
googleAdsHints
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RNOWWEA7.js";
|
|
11
11
|
import {
|
|
12
12
|
handleResearchError,
|
|
13
13
|
writeResearchHints,
|
|
@@ -228,4 +228,4 @@ Examples:
|
|
|
228
228
|
export {
|
|
229
229
|
googleAdsCommand
|
|
230
230
|
};
|
|
231
|
-
//# sourceMappingURL=google-ads-
|
|
231
|
+
//# sourceMappingURL=google-ads-4QI33CPF.js.map
|
|
@@ -492,11 +492,6 @@ function windowPeriod(window, read, current) {
|
|
|
492
492
|
function unreadWindowHint(label) {
|
|
493
493
|
return `${label} was not read: nothing delivered in this window, so the days before it are unknown; read it by days (since and until) to compare.`;
|
|
494
494
|
}
|
|
495
|
-
function withJoinId(fields, level) {
|
|
496
|
-
if (level === "account") return fields;
|
|
497
|
-
const id = `${level}_id`;
|
|
498
|
-
return fields.includes(id) ? fields : [id, ...fields];
|
|
499
|
-
}
|
|
500
495
|
var PERIOD_FIELDS = /* @__PURE__ */ new Set(["date_start", "date_stop"]);
|
|
501
496
|
var COUNT_PREFIXES = ["actions.", "unique_actions.", "conversions."];
|
|
502
497
|
function isCount(field) {
|
|
@@ -657,8 +652,8 @@ function asIntents(intents) {
|
|
|
657
652
|
const names = intents === void 0 ? ["baseline"] : typeof intents === "string" ? [intents] : intents;
|
|
658
653
|
return names.flatMap((name) => getIntent(name) ?? []);
|
|
659
654
|
}
|
|
660
|
-
function composeFields(intents, level) {
|
|
661
|
-
const intentFields = asIntents(intents).flatMap((intent) => intent.fields);
|
|
655
|
+
function composeFields(intents, level, named) {
|
|
656
|
+
const intentFields = named ?? asIntents(intents).flatMap((intent) => intent.fields);
|
|
662
657
|
const identity = IDENTITY_FIELDS_BY_LEVEL[level];
|
|
663
658
|
const seen = /* @__PURE__ */ new Set();
|
|
664
659
|
const out = [];
|
|
@@ -949,7 +944,7 @@ function buildBody(args) {
|
|
|
949
944
|
const intents = intentsOf(args);
|
|
950
945
|
const level = pickLevel(args);
|
|
951
946
|
const explicitFields = commaSplit(args.fields);
|
|
952
|
-
const fields = withSpendField(withActionFields(
|
|
947
|
+
const fields = withSpendField(withActionFields(composeFields(intents, level, explicitFields), actionTypesOf(args)));
|
|
953
948
|
const breakdowns = commaSplit(args.breakdowns);
|
|
954
949
|
const actionBreakdowns = commaSplit(args["action-breakdowns"]) ?? intentActionBreakdowns(intents);
|
|
955
950
|
const body = {
|
|
@@ -967,7 +962,6 @@ function buildBody(args) {
|
|
|
967
962
|
skipCache: Boolean(args["no-cache"])
|
|
968
963
|
};
|
|
969
964
|
applyDateRange(body, args);
|
|
970
|
-
if (args.compare) body.fields = withJoinId(body.fields, level);
|
|
971
965
|
return body;
|
|
972
966
|
}
|
|
973
967
|
async function pollAsync(reportRunId) {
|
|
@@ -1157,8 +1151,8 @@ Smart defaults so the AI doesn't have to remember every flag:
|
|
|
1157
1151
|
--limit 25 at --level ad|adset (the top of the whole read; a hint says how many more, --limit 0 prints all)
|
|
1158
1152
|
auto-async when query is heavy (level=ad + breakdowns, big date ranges, etc.)
|
|
1159
1153
|
|
|
1160
|
-
Identity fields (campaign_name, ad_name etc.) are appended automatically based on --level
|
|
1161
|
-
are self-describing.
|
|
1154
|
+
Identity fields (campaign_name, ad_name etc.) are appended automatically based on --level, --fields
|
|
1155
|
+
too, so rows are self-describing.
|
|
1162
1156
|
|
|
1163
1157
|
Examples \u2014 common AI questions:
|
|
1164
1158
|
# "How is GreenLeaf doing this week?"
|
|
@@ -1229,7 +1223,10 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
1229
1223
|
type: "string",
|
|
1230
1224
|
description: "baseline|leads|revenue|funnel|ranking|video|identity (default: baseline); several comma-separated read together, one row per object (ranking,funnel)"
|
|
1231
1225
|
},
|
|
1232
|
-
fields: {
|
|
1226
|
+
fields: {
|
|
1227
|
+
type: "string",
|
|
1228
|
+
description: "Comma-separated field list (overrides --intent bundle; the --level's ids and names are still added)"
|
|
1229
|
+
},
|
|
1233
1230
|
"list-intents": { type: "boolean", description: "Print available intents and exit" },
|
|
1234
1231
|
"date-preset": {
|
|
1235
1232
|
type: "string",
|
|
@@ -1325,4 +1322,4 @@ export {
|
|
|
1325
1322
|
insightsCommand,
|
|
1326
1323
|
wantsAsync
|
|
1327
1324
|
};
|
|
1328
|
-
//# sourceMappingURL=insights-
|
|
1325
|
+
//# sourceMappingURL=insights-YXWOM5FX.js.map
|