@koda-sl/baker-cli 0.354.0-dev.85a2d7a47 → 0.354.0-dev.9b7066502
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-NA5CPMUA.js → chunk-WJ5MYLLV.js} +14 -2
- package/dist/{chunk-NA5CPMUA.js.map → chunk-WJ5MYLLV.js.map} +1 -1
- package/dist/cli.js +12 -28
- package/dist/cli.js.map +1 -1
- package/dist/{shared-RYAF7Y7H.js → shared-4FS6FXCM.js} +4 -2
- package/package.json +1 -1
- /package/dist/{shared-RYAF7Y7H.js.map → shared-4FS6FXCM.js.map} +0 -0
package/README.md
CHANGED
|
@@ -958,7 +958,7 @@ Status changes are `pause|resume|archive` subcommands on `campaigns`/`adsets`/`a
|
|
|
958
958
|
- Identity columns (`campaign_name`, `ad_name`, etc.) appended automatically per `--level` so rows are self-describing.
|
|
959
959
|
- 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.
|
|
960
960
|
|
|
961
|
-
**Listings (`campaigns`/`adsets`/`ads`)** default to `effective_status=ACTIVE` — pass `--all-statuses` to widen, or `--effective-status ACTIVE,PAUSED` for a custom set.
|
|
961
|
+
**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`, so "nothing active" is never read as "nothing there".
|
|
962
962
|
|
|
963
963
|
**Pagination** is auto-drained (no manual cursor handling).
|
|
964
964
|
|
|
@@ -97,6 +97,17 @@ function resolveEffectiveStatus(args) {
|
|
|
97
97
|
}
|
|
98
98
|
return "ACTIVE";
|
|
99
99
|
}
|
|
100
|
+
function statusFilterHints(rows, effectiveStatus, noun) {
|
|
101
|
+
if (rows.length > 0 || effectiveStatus === void 0) return [];
|
|
102
|
+
if (effectiveStatus === "ACTIVE") {
|
|
103
|
+
return [
|
|
104
|
+
`No ACTIVE ${noun}. The ACTIVE filter hides paused, archived and in-review ones (under a paused campaign or ad set that is all of them), so this does NOT mean none exist. Re-run with --all-statuses before concluding there are none.`
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
return [
|
|
108
|
+
`No ${noun} with effective_status ${effectiveStatus}. Re-run with --all-statuses to see every status before concluding there are none.`
|
|
109
|
+
];
|
|
110
|
+
}
|
|
100
111
|
|
|
101
112
|
export {
|
|
102
113
|
metaForbiddenFix,
|
|
@@ -106,6 +117,7 @@ export {
|
|
|
106
117
|
todayIso,
|
|
107
118
|
daysAgoIso,
|
|
108
119
|
csvOrJson,
|
|
109
|
-
resolveEffectiveStatus
|
|
120
|
+
resolveEffectiveStatus,
|
|
121
|
+
statusFilterHints
|
|
110
122
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-WJ5MYLLV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/ads/meta/shared.ts"],"sourcesContent":["import { ApiError } from \"../../../client.ts\";\nimport { getEnv } from \"../../../env.ts\";\nimport { handleConnectionError, needsConnectionFix } from \"../../../error-handler.ts\";\nimport { writeAdsJson } from \"../output.ts\";\nimport type { AdsErrorEnvelope, QueryFix } from \"../types.ts\";\n\nconst DAY_MS = 86_400_000;\n\n/**\n * Meta answers a permission refusal (Graph codes 200/10/294) with a bare\n * \"Permissions error\" that covers two causes needing opposite remedies: a\n * consent grant the connection never got — nothing validates Meta's granted\n * scopes after connect, unlike HubSpot's `requireCapability` — or a role the\n * user lacks on one asset, since a Pixel/Dataset, Page or catalog lives in a\n * Business and is assigned separately from the ad account. Only the blast radius\n * separates them, so hand the agent that test rather than a verdict: guessing\n * \"reconnect\" wastes the user's time on an unassigned asset, and ruling it out\n * strands a connection that really is short a scope.\n */\nexport function metaForbiddenFix(message: string): QueryFix {\n return {\n action: \"reject\",\n explanation: [\n message,\n \"This is a permission refusal, not a dead connection, and Meta returns the same code for two causes with opposite remedies. Tell them apart by how much else works before you answer.\",\n \"If other reads on this account are ALSO refused (campaigns, ad sets, insights), the connection is short a permission it was never granted. Only the user can widen it, by reconnecting Meta from the dashboard.\",\n \"If those reads work and only this object is refused, the asset (pixel/dataset, Page, or catalog) belongs to a Business the connected user holds no role in. Ad-account access does not carry asset access and reconnecting cannot grant it — the client assigns that asset to the connected user or partner in Meta Business settings, under the asset's own section (Data sources → Datasets for a pixel).\",\n \"Either way do not retry the same call, and do not abort the wider job. Continue with what you can read, and state in your answer that this specific check could not run and why — never present the task as verified when this step was skipped.\",\n ].join(\"\\n\\n\"),\n };\n}\n\nexport function handleMetaError(err: unknown): never {\n if (err instanceof ApiError) {\n if (needsConnectionFix(err.code, err.message)) {\n handleConnectionError(\"meta_ads\", err.message);\n }\n const envelope: AdsErrorEnvelope = {\n ok: false,\n error: {\n code: err.code,\n message: err.message,\n fix: err.code === \"FORBIDDEN\" ? metaForbiddenFix(err.message) : { action: \"reject\", explanation: err.message },\n retryable: err.code === \"RATE_LIMITED\" || err.code === \"INTERNAL_ERROR\",\n },\n };\n writeAdsJson(envelope);\n process.exit(1);\n }\n const message = err instanceof Error ? err.message : \"Unexpected error\";\n writeAdsJson({ ok: false, error: { code: \"NETWORK_ERROR\", message } });\n process.exit(1);\n}\n\nconst ACCOUNT_ID_RE = /^(act_)?[0-9]+$/;\n\n/** Pull the default Meta ad account ID from `--account-id` arg or `BAKER_META_AD_ACCOUNT_ID` env. */\nexport function resolveAccountIdArg(args: Record<string, unknown>): string {\n const fromArgs = args[\"account-id\"] as string | undefined;\n const id = fromArgs || getEnv().BAKER_META_AD_ACCOUNT_ID;\n if (!id) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"MISSING_ACCOUNT_ID\",\n message: \"Pass --account-id or set BAKER_META_AD_ACCOUNT_ID. Run `baker ads meta accounts` to find IDs.\",\n },\n });\n process.exit(1);\n }\n if (!ACCOUNT_ID_RE.test(id)) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_ACCOUNT_ID\",\n message: `Invalid account ID \"${id}\". Expected numeric ID, optionally prefixed with \"act_\".`,\n },\n });\n process.exit(1);\n }\n return id.startsWith(\"act_\") ? id : `act_${id}`;\n}\n\nexport function getDateRange(args: Record<string, unknown>): { datePreset?: string; since?: string; until?: string } {\n const datePreset = args[\"date-preset\"] as string | undefined;\n const since = args.since as string | undefined;\n const until = args.until as string | undefined;\n if (since && until) return { since, until };\n return { datePreset: datePreset ?? \"last_7d\" };\n}\n\nexport function todayIso(): string {\n return new Date().toISOString().slice(0, 10);\n}\n\nexport function daysAgoIso(days: number): string {\n return new Date(Date.now() - days * DAY_MS).toISOString().slice(0, 10);\n}\n\nexport function csvOrJson(args: Record<string, unknown>): string {\n return (args.output as string | undefined) ?? \"json\";\n}\n\n/**\n * Default to ACTIVE-only on listings — that's almost always what an AI agent or\n * a human glance wants. Pass `--effective-status ACTIVE,PAUSED` to override, or\n * `--all-statuses` to drop the filter entirely.\n */\nexport function resolveEffectiveStatus(args: Record<string, unknown>): string | undefined {\n if (args[\"all-statuses\"]) {\n return undefined;\n }\n const explicit = args[\"effective-status\"] as string | undefined;\n if (explicit) {\n return explicit;\n }\n return \"ACTIVE\";\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAM,SAAS;AAaR,SAAS,iBAAiB,SAA2B;AAC1D,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,MAAM;AAAA,EACf;AACF;AAEO,SAAS,gBAAgB,KAAqB;AACnD,MAAI,eAAe,UAAU;AAC3B,QAAI,mBAAmB,IAAI,MAAM,IAAI,OAAO,GAAG;AAC7C,4BAAsB,YAAY,IAAI,OAAO;AAAA,IAC/C;AACA,UAAM,WAA6B;AAAA,MACjC,IAAI;AAAA,MACJ,OAAO;AAAA,QAC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AAG,EAAE;AAC7C;AAEO,SAAS,WAAW,MAAsB;AAC/C,SAAO,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AACvE;AAEO,SAAS,UAAU,MAAuC;AAC/D,SAAQ,KAAK,UAAiC;AAChD;AAOO,SAAS,uBAAuB,MAAmD;AACxF,MAAI,KAAK,cAAc,GAAG;AACxB,WAAO;AAAA,EACT;AACA,QAAM,WAAW,KAAK,kBAAkB;AACxC,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/ads/meta/shared.ts"],"sourcesContent":["import { ApiError } from \"../../../client.ts\";\nimport { getEnv } from \"../../../env.ts\";\nimport { handleConnectionError, needsConnectionFix } from \"../../../error-handler.ts\";\nimport { writeAdsJson } from \"../output.ts\";\nimport type { AdsErrorEnvelope, QueryFix } from \"../types.ts\";\n\nconst DAY_MS = 86_400_000;\n\n/**\n * Meta answers a permission refusal (Graph codes 200/10/294) with a bare\n * \"Permissions error\" that covers two causes needing opposite remedies: a\n * consent grant the connection never got — nothing validates Meta's granted\n * scopes after connect, unlike HubSpot's `requireCapability` — or a role the\n * user lacks on one asset, since a Pixel/Dataset, Page or catalog lives in a\n * Business and is assigned separately from the ad account. Only the blast radius\n * separates them, so hand the agent that test rather than a verdict: guessing\n * \"reconnect\" wastes the user's time on an unassigned asset, and ruling it out\n * strands a connection that really is short a scope.\n */\nexport function metaForbiddenFix(message: string): QueryFix {\n return {\n action: \"reject\",\n explanation: [\n message,\n \"This is a permission refusal, not a dead connection, and Meta returns the same code for two causes with opposite remedies. Tell them apart by how much else works before you answer.\",\n \"If other reads on this account are ALSO refused (campaigns, ad sets, insights), the connection is short a permission it was never granted. Only the user can widen it, by reconnecting Meta from the dashboard.\",\n \"If those reads work and only this object is refused, the asset (pixel/dataset, Page, or catalog) belongs to a Business the connected user holds no role in. Ad-account access does not carry asset access and reconnecting cannot grant it — the client assigns that asset to the connected user or partner in Meta Business settings, under the asset's own section (Data sources → Datasets for a pixel).\",\n \"Either way do not retry the same call, and do not abort the wider job. Continue with what you can read, and state in your answer that this specific check could not run and why — never present the task as verified when this step was skipped.\",\n ].join(\"\\n\\n\"),\n };\n}\n\nexport function handleMetaError(err: unknown): never {\n if (err instanceof ApiError) {\n if (needsConnectionFix(err.code, err.message)) {\n handleConnectionError(\"meta_ads\", err.message);\n }\n const envelope: AdsErrorEnvelope = {\n ok: false,\n error: {\n code: err.code,\n message: err.message,\n fix: err.code === \"FORBIDDEN\" ? metaForbiddenFix(err.message) : { action: \"reject\", explanation: err.message },\n retryable: err.code === \"RATE_LIMITED\" || err.code === \"INTERNAL_ERROR\",\n },\n };\n writeAdsJson(envelope);\n process.exit(1);\n }\n const message = err instanceof Error ? err.message : \"Unexpected error\";\n writeAdsJson({ ok: false, error: { code: \"NETWORK_ERROR\", message } });\n process.exit(1);\n}\n\nconst ACCOUNT_ID_RE = /^(act_)?[0-9]+$/;\n\n/** Pull the default Meta ad account ID from `--account-id` arg or `BAKER_META_AD_ACCOUNT_ID` env. */\nexport function resolveAccountIdArg(args: Record<string, unknown>): string {\n const fromArgs = args[\"account-id\"] as string | undefined;\n const id = fromArgs || getEnv().BAKER_META_AD_ACCOUNT_ID;\n if (!id) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"MISSING_ACCOUNT_ID\",\n message: \"Pass --account-id or set BAKER_META_AD_ACCOUNT_ID. Run `baker ads meta accounts` to find IDs.\",\n },\n });\n process.exit(1);\n }\n if (!ACCOUNT_ID_RE.test(id)) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_ACCOUNT_ID\",\n message: `Invalid account ID \"${id}\". Expected numeric ID, optionally prefixed with \"act_\".`,\n },\n });\n process.exit(1);\n }\n return id.startsWith(\"act_\") ? id : `act_${id}`;\n}\n\nexport function getDateRange(args: Record<string, unknown>): { datePreset?: string; since?: string; until?: string } {\n const datePreset = args[\"date-preset\"] as string | undefined;\n const since = args.since as string | undefined;\n const until = args.until as string | undefined;\n if (since && until) return { since, until };\n return { datePreset: datePreset ?? \"last_7d\" };\n}\n\nexport function todayIso(): string {\n return new Date().toISOString().slice(0, 10);\n}\n\nexport function daysAgoIso(days: number): string {\n return new Date(Date.now() - days * DAY_MS).toISOString().slice(0, 10);\n}\n\nexport function csvOrJson(args: Record<string, unknown>): string {\n return (args.output as string | undefined) ?? \"json\";\n}\n\n/**\n * Default to ACTIVE-only on listings — that's almost always what an AI agent or\n * a human glance wants. Pass `--effective-status ACTIVE,PAUSED` to override, or\n * `--all-statuses` to drop the filter entirely.\n */\nexport function resolveEffectiveStatus(args: Record<string, unknown>): string | undefined {\n if (args[\"all-statuses\"]) {\n return undefined;\n }\n const explicit = args[\"effective-status\"] as string | undefined;\n if (explicit) {\n return explicit;\n }\n return \"ACTIVE\";\n}\n\n/**\n * An empty listing under a status filter reads exactly like \"nothing exists\":\n * a paused campaign's ad sets are CAMPAIGN_PAUSED, so the ACTIVE default hides\n * every one of them. Say which filter produced the empty list and how to widen it.\n */\nexport function statusFilterHints(\n rows: ReadonlyArray<unknown>,\n effectiveStatus: string | undefined,\n noun: string,\n): string[] {\n if (rows.length > 0 || effectiveStatus === undefined) return [];\n if (effectiveStatus === \"ACTIVE\") {\n return [\n `No ACTIVE ${noun}. The ACTIVE filter hides paused, archived and in-review ones (under a paused campaign or ad set that is all of them), so this does NOT mean none exist. Re-run with --all-statuses before concluding there are none.`,\n ];\n }\n return [\n `No ${noun} with effective_status ${effectiveStatus}. Re-run with --all-statuses to see every status before concluding there are none.`,\n ];\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAM,SAAS;AAaR,SAAS,iBAAiB,SAA2B;AAC1D,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,MAAM;AAAA,EACf;AACF;AAEO,SA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AM,QAAQ,KAAK;AACnB,QAAM,QAAQ,KAAK;AACnB,MAAI,SAAS,MAAO,QAAO,EAAE,OAAO,MAAM;AAC1C,SAAO,EAAE,YAAY,cAAc,UAAU;AAC/C;AAEO,SAAS,WAAmB;AACjC,UAAO,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAC7C;AAEO,SAAS,WAAW,MAAsB;AAC/C,SAAO,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AACvE;AAEO,SAAS,UAAU,MAAuC;AAC/D,SAAQ,KAAK,UAAiC;AAChD;AAOO,SAAS,uBAAuB,MAAmD;AACxF,MAAI,KAAK,cAAc,GAAG;AACxB,WAAO;AAAA,EACT;AACA,QAAM,WAAW,KAAK,kBAAkB;AACxC,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAOO,SAAS,kBACd,MACA,iBACA,MACU;AACV,MAAI,KAAK,SAAS,KAAK,oBAAoB,OAAW,QAAO,CAAC;AAC9D,MAAI,oBAAoB,UAAU;AAChC,WAAO;AAAA,MACL,aAAa,IAAI;AAAA,IACnB;AAAA,EACF;AACA,SAAO;AAAA,IACL,MAAM,IAAI,0BAA0B,eAAe;AAAA,EACrD;AACF;","names":[]}
|
package/dist/cli.js
CHANGED
|
@@ -76,8 +76,9 @@ import {
|
|
|
76
76
|
handleMetaError,
|
|
77
77
|
resolveAccountIdArg,
|
|
78
78
|
resolveEffectiveStatus,
|
|
79
|
+
statusFilterHints,
|
|
79
80
|
todayIso
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-WJ5MYLLV.js";
|
|
81
82
|
import {
|
|
82
83
|
buildQueryCacheKey,
|
|
83
84
|
cacheGet,
|
|
@@ -5668,11 +5669,7 @@ var historyEntrySchema = z17.object({
|
|
|
5668
5669
|
});
|
|
5669
5670
|
var historyListResponseSchema = z17.object({
|
|
5670
5671
|
ok: z17.literal(true),
|
|
5671
|
-
data: z17.object({
|
|
5672
|
-
entries: z17.array(historyEntrySchema),
|
|
5673
|
-
/** The search stopped at its row budget before reading the whole window. */
|
|
5674
|
-
scanLimited: z17.boolean().optional()
|
|
5675
|
-
})
|
|
5672
|
+
data: z17.object({ entries: z17.array(historyEntrySchema) })
|
|
5676
5673
|
});
|
|
5677
5674
|
|
|
5678
5675
|
// ../api/src/hubspot.ts
|
|
@@ -25470,7 +25467,7 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
|
|
|
25470
25467
|
const { apiPost: apiPost2 } = await import("./client-ODCNYCP4.js");
|
|
25471
25468
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
25472
25469
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-2XBCYF7L.js");
|
|
25473
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
25470
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-4FS6FXCM.js");
|
|
25474
25471
|
try {
|
|
25475
25472
|
const accountId = bareAccountId2(args5);
|
|
25476
25473
|
const urlTags = typeof args5["url-tags"] === "string" ? args5["url-tags"] : void 0;
|
|
@@ -25618,7 +25615,7 @@ function duplicateCommand2(entity, label) {
|
|
|
25618
25615
|
const { apiPost: apiPost2 } = await import("./client-ODCNYCP4.js");
|
|
25619
25616
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
25620
25617
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-2XBCYF7L.js");
|
|
25621
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
25618
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-4FS6FXCM.js");
|
|
25622
25619
|
try {
|
|
25623
25620
|
const accountId = bareAccountId2(args5);
|
|
25624
25621
|
const chatId = requireChatId2();
|
|
@@ -25683,7 +25680,8 @@ var listCommand4 = defineCommand58({
|
|
|
25683
25680
|
writeAdsOutput(data, fmt);
|
|
25684
25681
|
return;
|
|
25685
25682
|
}
|
|
25686
|
-
|
|
25683
|
+
const hints2 = statusFilterHints(data, effectiveStatus, "ads");
|
|
25684
|
+
writeJsonEnvelope(hints2.length > 0 ? { ok: true, data, hints: hints2 } : { ok: true, data });
|
|
25687
25685
|
} catch (err) {
|
|
25688
25686
|
handleMetaError(err);
|
|
25689
25687
|
}
|
|
@@ -25754,7 +25752,8 @@ var listCommand5 = defineCommand59({
|
|
|
25754
25752
|
writeAdsOutput(data, fmt);
|
|
25755
25753
|
return;
|
|
25756
25754
|
}
|
|
25757
|
-
|
|
25755
|
+
const hints2 = statusFilterHints(data, effectiveStatus, "ad sets");
|
|
25756
|
+
writeJsonEnvelope(hints2.length > 0 ? { ok: true, data, hints: hints2 } : { ok: true, data });
|
|
25758
25757
|
} catch (err) {
|
|
25759
25758
|
handleMetaError(err);
|
|
25760
25759
|
}
|
|
@@ -25904,7 +25903,8 @@ var listCommand7 = defineCommand62({
|
|
|
25904
25903
|
writeAdsOutput(data, fmt);
|
|
25905
25904
|
return;
|
|
25906
25905
|
}
|
|
25907
|
-
|
|
25906
|
+
const hints2 = statusFilterHints(data, effectiveStatus, "campaigns");
|
|
25907
|
+
writeJsonEnvelope(hints2.length > 0 ? { ok: true, data, hints: hints2 } : { ok: true, data });
|
|
25908
25908
|
} catch (err) {
|
|
25909
25909
|
handleMetaError(err);
|
|
25910
25910
|
}
|
|
@@ -51289,21 +51289,6 @@ Full guide: __tooling__/docs/tools/baker/gsc.md`
|
|
|
51289
51289
|
|
|
51290
51290
|
// src/commands/history/index.ts
|
|
51291
51291
|
import { defineCommand as defineCommand142 } from "citty";
|
|
51292
|
-
|
|
51293
|
-
// src/commands/history/hints.ts
|
|
51294
|
-
function buildHistoryHints2(data) {
|
|
51295
|
-
if (data.entries.length > 0) {
|
|
51296
|
-
return data.scanLimited ? ["The search stopped before reading the whole window, so older matching changes may be missing from this list."] : [];
|
|
51297
|
-
}
|
|
51298
|
-
if (data.scanLimited) {
|
|
51299
|
-
return [
|
|
51300
|
-
"None of the most recent account changes matched, and older ones were not searched: this is not proof that nothing matching happened."
|
|
51301
|
-
];
|
|
51302
|
-
}
|
|
51303
|
-
return ["No history entries matched. Widen with a larger --days or drop --category."];
|
|
51304
|
-
}
|
|
51305
|
-
|
|
51306
|
-
// src/commands/history/index.ts
|
|
51307
51292
|
registerSchema({
|
|
51308
51293
|
command: "history.list",
|
|
51309
51294
|
description: "Start here: unified account history (audit log) \u2014 everything that changed on this account, newest first: publishes, chat lifecycle, backlog actions, team changes, setup links, tags, schedules, ad-platform writes, followed advertisers, media, creatives, reports, domains, and integrations. Use it to see what happened recently before planning work. Compact by default; add --full for raw metadata per entry.",
|
|
@@ -51394,11 +51379,10 @@ var listCommand15 = defineCommand142({
|
|
|
51394
51379
|
body.full = true;
|
|
51395
51380
|
}
|
|
51396
51381
|
const response = await apiPost("/api/history/list", body);
|
|
51397
|
-
const hints2 = buildHistoryHints2(response.data);
|
|
51398
51382
|
writeJson({
|
|
51399
51383
|
...response,
|
|
51400
51384
|
meta: { count: response.data.entries.length },
|
|
51401
|
-
...
|
|
51385
|
+
...response.data.entries.length === 0 ? { hints: ["No history entries matched. Widen with a larger --days or drop --category."] } : {}
|
|
51402
51386
|
});
|
|
51403
51387
|
} catch (err) {
|
|
51404
51388
|
failApi(err);
|