@canonry/canonry 7.51.4 → 7.51.6

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.
Files changed (172) hide show
  1. package/assets/assets/AccessControls-B5TqDgeq.js +1 -0
  2. package/assets/assets/AuditHistoryPanel-DgxiizOW.js +1 -0
  3. package/assets/assets/BacklinksPage-Ay6pdphx.js +1 -0
  4. package/assets/assets/ChartPrimitives-DIEeZdrs.js +1 -0
  5. package/assets/assets/Hint-Cn4lh0Do.js +1 -0
  6. package/assets/assets/HistoryPage-B11eFH21.js +1 -0
  7. package/assets/assets/InfoTooltip-TIx9qM5h.js +1 -0
  8. package/assets/assets/MeasurementPropertyPage-1UYI7mzP.js +4 -0
  9. package/assets/assets/ProjectPage-DoY0hftd.js +8 -0
  10. package/assets/assets/RunsPage-BPBmuQAS.js +1 -0
  11. package/assets/assets/SettingsPage-ClKnP8xy.js +1 -0
  12. package/assets/assets/SiteHealthSection-PWjKMmEn.js +2 -0
  13. package/assets/assets/TrafficPage-DkfGiJXR.js +40 -0
  14. package/assets/assets/TrafficSourceDetailPage-DQu0YNt2.js +1 -0
  15. package/assets/assets/async-handler-Bj3TnIRw.js +1 -0
  16. package/assets/assets/card-DYMyvhB9.js +60 -0
  17. package/assets/assets/extract-error-message-BRM1I_3L.js +1 -0
  18. package/assets/assets/format-helpers-DrkFERj3.js +3 -0
  19. package/assets/assets/index-CG1Jox52.js +39 -0
  20. package/assets/assets/index-CsPsaUr7.css +1 -0
  21. package/assets/assets/query-client-gRFnU4VF.js +1 -0
  22. package/assets/assets/react-query-lH82FULK.js +1 -0
  23. package/assets/assets/react-sigma_core.esm.min-D09H4byP.js +3225 -0
  24. package/assets/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  25. package/assets/assets/service-Cx0HSnE9.js +1 -0
  26. package/assets/assets/vendor-lucide-BjvO55Hk.js +1 -0
  27. package/assets/assets/vendor-markdown-DWjffpgb.js +29 -0
  28. package/assets/assets/vendor-radix-BU76HM0G.js +41 -0
  29. package/assets/assets/vendor-recharts-CsHBXoK8.js +59 -0
  30. package/assets/assets/vendor-tanstack-QhOrDhIL.js +2 -0
  31. package/assets/assets/vendor-yaml-Y43rmNgW.js +105 -0
  32. package/assets/index.html +16 -8
  33. package/dist/ads-ABAT3K4K.js +544 -0
  34. package/dist/agent-5G4DRLYX.js +70 -0
  35. package/dist/agent-ask-UDVCZRO7.js +139 -0
  36. package/dist/agent-conversations-5E4JP2QZ.js +52 -0
  37. package/dist/agent-memory-7IIJ4HGZ.js +92 -0
  38. package/dist/agent-providers-BOXPUXZ4.js +55 -0
  39. package/dist/agent-transcript-4O56G6PQ.js +77 -0
  40. package/dist/analytics-PKMWX5XL.js +240 -0
  41. package/dist/apply-OK4XEBDA.js +175 -0
  42. package/dist/backfill-2OT56CX2.js +41 -0
  43. package/dist/backlinks-547WCHND.js +303 -0
  44. package/dist/bing-ZVBV4ZD5.js +418 -0
  45. package/dist/bootstrap-HUB7XQ73.js +326 -0
  46. package/dist/cdp-KQKQ4PWJ.js +162 -0
  47. package/dist/chunk-2G6IP3MO.js +517 -0
  48. package/dist/chunk-42D2LE2B.js +1273 -0
  49. package/dist/chunk-4MJYGB56.js +124 -0
  50. package/dist/chunk-63ISSSGX.js +9150 -0
  51. package/dist/{chunk-HHRM3H3L.js → chunk-6G6FTDWC.js} +8082 -13941
  52. package/dist/chunk-6GO5VVAC.js +15 -0
  53. package/dist/{chunk-6GNV6VF4.js → chunk-73P65KPW.js} +2 -2
  54. package/dist/chunk-7B2Q4NJE.js +133 -0
  55. package/dist/{chunk-KU4TPVZV.js → chunk-7WZ2FPB4.js} +2 -13
  56. package/dist/chunk-AOJU5LKX.js +8 -0
  57. package/dist/chunk-B2FR2ZQ4.js +420 -0
  58. package/dist/chunk-B5J675KK.js +6557 -0
  59. package/dist/{chunk-YOGHHIGE.js → chunk-D6COIM3U.js} +17155 -17164
  60. package/dist/{chunk-KUS7M65J.js → chunk-DGVUTH7W.js} +6809 -32243
  61. package/dist/chunk-ELCLGWUT.js +83 -0
  62. package/dist/chunk-GO2J7SYT.js +1034 -0
  63. package/dist/chunk-HACZUMGM.js +145 -0
  64. package/dist/chunk-HM4NNKLG.js +94 -0
  65. package/dist/chunk-I3A56PFP.js +58 -0
  66. package/dist/chunk-I77PLCWG.js +961 -0
  67. package/dist/chunk-ISOQPVPY.js +232 -0
  68. package/dist/chunk-KFT5LOP2.js +610 -0
  69. package/dist/chunk-MLKGABMK.js +9 -0
  70. package/dist/chunk-MMEO22MF.js +38 -0
  71. package/dist/chunk-NHQ2U5I4.js +78 -0
  72. package/dist/chunk-PCXRFT3N.js +530 -0
  73. package/dist/chunk-PITHTCAX.js +15376 -0
  74. package/dist/chunk-QWKPSFGL.js +30 -0
  75. package/dist/chunk-RKIXES2B.js +609 -0
  76. package/dist/chunk-TSENU4GG.js +18 -0
  77. package/dist/{chunk-P6D6P337.js → chunk-TUTKNUMV.js} +7 -5
  78. package/dist/chunk-U3AHE2RT.js +1160 -0
  79. package/dist/chunk-UQ3MOZGC.js +644 -0
  80. package/dist/{chunk-35QQMVO6.js → chunk-VBCE4CLX.js} +6 -4
  81. package/dist/chunk-VJWDBFSL.js +69 -0
  82. package/dist/chunk-VYMZ3QXG.js +8264 -0
  83. package/dist/chunk-WAULJDKO.js +2686 -0
  84. package/dist/chunk-WDFI5YMD.js +204 -0
  85. package/dist/chunk-XEBKF4N5.js +8 -0
  86. package/dist/chunk-Z7IUAJOF.js +13 -0
  87. package/dist/{chunk-RUWELF3K.js → chunk-ZWJRY5UI.js} +358 -581
  88. package/dist/chunk-ZXUAWVWM.js +15 -0
  89. package/dist/citations-UYB2RU5U.js +106 -0
  90. package/dist/{cli-catalog-KTQ6BHEU.js → cli-catalog-F6FI7NB2.js} +5 -3
  91. package/dist/cli-commands-ZG5ILKDA.js +19 -0
  92. package/dist/cli.js +35 -29
  93. package/dist/competitor-EKP4R7YY.js +561 -0
  94. package/dist/content-DREE6JF3.js +257 -0
  95. package/dist/dashboard-ZALEOLLU.js +71 -0
  96. package/dist/demo-JG4Y22O4.js +75 -0
  97. package/dist/{demo-server-26UUDUM7.js → demo-server-3A4J2C65.js} +22 -9
  98. package/dist/discover-W6GMD2HS.js +372 -0
  99. package/dist/discover-eval-CKFZHRBW.js +282 -0
  100. package/dist/doctor-TNGBSUMA.js +152 -0
  101. package/dist/evidence-3H2GFQBZ.js +57 -0
  102. package/dist/export-cmd-WUIKU5GK.js +49 -0
  103. package/dist/ga-JI6REFO4.js +911 -0
  104. package/dist/gbp-4ENDM5NS.js +370 -0
  105. package/dist/google-HKQSCLOC.js +946 -0
  106. package/dist/google-marketing-KQR5J2S4.js +403 -0
  107. package/dist/health-cmd-TS7EMMCS.js +64 -0
  108. package/dist/history-MSD5DK6K.js +90 -0
  109. package/dist/index.d.ts +194 -60
  110. package/dist/index.js +29 -6
  111. package/dist/init-L6WAEOWX.js +432 -0
  112. package/dist/insights-RTZ3IZTD.js +63 -0
  113. package/dist/intelligence-service-TH52PCNJ.js +15 -0
  114. package/dist/keys-625DZBRM.js +116 -0
  115. package/dist/keyword-CW46RNRR.js +164 -0
  116. package/dist/logs-V33SHBIW.js +30 -0
  117. package/dist/mcp-DFEDPSEG.js +14 -0
  118. package/dist/mcp.js +14 -5
  119. package/dist/measurement-plan-6W37RUOP.js +42 -0
  120. package/dist/notify-DSUOT7WO.js +125 -0
  121. package/dist/organic-evidence-BMN6L4OB.js +53 -0
  122. package/dist/overview-WRRMBZ6S.js +213 -0
  123. package/dist/project-2GJIU3FE.js +460 -0
  124. package/dist/query-3XPMGJUA.js +211 -0
  125. package/dist/research-V433CKJ4.js +200 -0
  126. package/dist/results-export-RGBU7QQQ.js +27 -0
  127. package/dist/run-NIAC6OJN.js +31 -0
  128. package/dist/schedule-KDWXRIE7.js +177 -0
  129. package/dist/search-626MPUJN.js +42 -0
  130. package/dist/serve-73SMMASI.js +557 -0
  131. package/dist/session-7WWOETZB.js +47 -0
  132. package/dist/settings-VKFQO6F2.js +107 -0
  133. package/dist/skills-5HC5H7TE.js +33 -0
  134. package/dist/snapshot-BSJUHFBC.js +538 -0
  135. package/dist/src-F6HM73TN.js +316 -0
  136. package/dist/status-V4OWP7LZ.js +126 -0
  137. package/dist/support-ARF4HER7.js +24 -0
  138. package/dist/technical-aeo-TG7CGU3F.js +625 -0
  139. package/dist/telemetry-O2IUNUBW.js +118 -0
  140. package/dist/tools-2GJIDKND.js +41 -0
  141. package/dist/traffic-XV4I3UPH.js +1295 -0
  142. package/dist/users-VGBLDL5K.js +170 -0
  143. package/dist/visibility-stats-UKJYJ6PP.js +241 -0
  144. package/dist/wordpress-JZA7CGC6.js +600 -0
  145. package/package.json +30 -30
  146. package/assets/assets/AuditHistoryPanel-CtWNkC6F.js +0 -1
  147. package/assets/assets/BacklinksPage-Cs3_j55C.js +0 -1
  148. package/assets/assets/ChartPrimitives-B6ryduMN.js +0 -1
  149. package/assets/assets/Hint-DICI5Jq9.js +0 -1
  150. package/assets/assets/HistoryPage-_5Vwj01m.js +0 -1
  151. package/assets/assets/MeasurementPropertyPage-B2yBTUZd.js +0 -4
  152. package/assets/assets/ProjectPage-hs-9PcoS.js +0 -8
  153. package/assets/assets/RunsPage-B_mhz9vj.js +0 -1
  154. package/assets/assets/SettingsPage-D1Lzcw03.js +0 -1
  155. package/assets/assets/SiteHealthSection-CGlrPdrk.js +0 -4
  156. package/assets/assets/TrafficPage-C27a0rQp.js +0 -40
  157. package/assets/assets/TrafficSourceDetailPage-DOSoQySv.js +0 -1
  158. package/assets/assets/extract-error-message-itBoiivg.js +0 -1
  159. package/assets/assets/index-Br2WtEIO.css +0 -1
  160. package/assets/assets/index-CdAuyP-X.js +0 -86
  161. package/assets/assets/react-sigma_core.esm.min-CPYhSQFc.js +0 -312
  162. package/assets/assets/v2-overview-adapter-DQXWmK0B.js +0 -1
  163. package/assets/assets/vendor-lucide-Y6jANGfG.js +0 -1
  164. package/assets/assets/vendor-markdown-B4giJcws.js +0 -29
  165. package/assets/assets/vendor-radix-twS1M3FF.js +0 -45
  166. package/assets/assets/vendor-recharts-D_R6YxjS.js +0 -36
  167. package/assets/assets/vendor-tanstack-ZXXkndVj.js +0 -1
  168. package/assets/assets/vendor-yaml-GWJz5H2G.js +0 -131
  169. package/dist/chunk-EQTVQIM2.js +0 -23082
  170. package/dist/chunk-GZPJ7TSE.js +0 -10872
  171. package/dist/cli-commands-5ZODWR4I.js +0 -15
  172. package/dist/intelligence-service-ZGDBVFDE.js +0 -9
@@ -0,0 +1,139 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import "./chunk-AOJU5LKX.js";
6
+ import {
7
+ CliError,
8
+ EXIT_SYSTEM_ERROR,
9
+ isMachineFormat,
10
+ printCliError
11
+ } from "./chunk-HGMYEDAQ.js";
12
+ import "./chunk-D6COIM3U.js";
13
+ import "./chunk-MLKGABMK.js";
14
+
15
+ // src/commands/agent-ask.ts
16
+ function toFormat(raw) {
17
+ if (raw === "json") return "json";
18
+ if (raw === "jsonl") return "jsonl";
19
+ return "text";
20
+ }
21
+ async function agentAsk(opts) {
22
+ const format = toFormat(opts.format);
23
+ const isJson = isMachineFormat(format);
24
+ const controller = new AbortController();
25
+ const onSigint = () => controller.abort();
26
+ process.on("SIGINT", onSigint);
27
+ let sawStreamError = false;
28
+ let streamClosed = false;
29
+ try {
30
+ const client = createApiClient();
31
+ const res = await client.streamPost(
32
+ `/projects/${encodeURIComponent(opts.project)}/agent/prompt`,
33
+ {
34
+ prompt: opts.prompt,
35
+ ...opts.conversationId ? { conversationId: opts.conversationId } : {},
36
+ provider: opts.provider,
37
+ modelId: opts.modelId,
38
+ scope: opts.scope ?? "all",
39
+ ...opts.context ? { context: opts.context } : {},
40
+ ...opts.limits ? { limits: opts.limits } : {},
41
+ ...opts.profile ? { profile: opts.profile } : {}
42
+ },
43
+ controller.signal
44
+ );
45
+ if (!res.body) {
46
+ throw new CliError({
47
+ code: "API_ERROR",
48
+ message: "Server returned no response body",
49
+ exitCode: EXIT_SYSTEM_ERROR
50
+ });
51
+ }
52
+ for await (const event of parseSse(res.body)) {
53
+ if (event.type === "stream_close") streamClosed = true;
54
+ renderEvent(event, isJson);
55
+ if (event.type === "message_end" && event.message.role === "assistant") {
56
+ const msg = event.message;
57
+ if (msg.stopReason === "error" || msg.errorMessage) sawStreamError = true;
58
+ } else if (event.type === "aero_turn_status" && event.status?.reason !== "completed") {
59
+ sawStreamError = true;
60
+ } else if (event.type === "error") {
61
+ sawStreamError = true;
62
+ }
63
+ }
64
+ if (!streamClosed) throw new CliError({ code: "API_ERROR", message: "Connection ended before Aero finished. Inspect the transcript before retrying.", exitCode: EXIT_SYSTEM_ERROR });
65
+ if (sawStreamError) process.exitCode = EXIT_SYSTEM_ERROR;
66
+ } catch (err) {
67
+ printCliError(err, format);
68
+ process.exitCode = err instanceof CliError ? err.exitCode : EXIT_SYSTEM_ERROR;
69
+ } finally {
70
+ process.off("SIGINT", onSigint);
71
+ }
72
+ }
73
+ async function* parseSse(stream) {
74
+ const reader = stream.getReader();
75
+ const decoder = new TextDecoder();
76
+ let buffer = "";
77
+ try {
78
+ while (true) {
79
+ const { value, done } = await reader.read();
80
+ if (done) break;
81
+ buffer += decoder.decode(value, { stream: true });
82
+ let boundary = buffer.indexOf("\n\n");
83
+ while (boundary !== -1) {
84
+ const frame = buffer.slice(0, boundary);
85
+ buffer = buffer.slice(boundary + 2);
86
+ for (const line of frame.split("\n")) {
87
+ if (!line.startsWith("data:")) continue;
88
+ const payload = line.slice(5).trim();
89
+ if (!payload) continue;
90
+ try {
91
+ yield JSON.parse(payload);
92
+ } catch {
93
+ }
94
+ }
95
+ boundary = buffer.indexOf("\n\n");
96
+ }
97
+ }
98
+ } finally {
99
+ try {
100
+ reader.releaseLock();
101
+ } catch {
102
+ }
103
+ }
104
+ }
105
+ function renderEvent(event, isJson) {
106
+ if (isJson) {
107
+ console.log(JSON.stringify(event));
108
+ return;
109
+ }
110
+ switch (event.type) {
111
+ case "tool_execution_start":
112
+ console.log(`
113
+ \u27D0 ${event.toolName} ${JSON.stringify(event.args)}`);
114
+ break;
115
+ case "tool_execution_end":
116
+ console.log(` ${event.isError ? "\u2717" : "\u2713"} ${event.toolName}`);
117
+ break;
118
+ case "message_end": {
119
+ const message = event.message;
120
+ if (message.role === "assistant") {
121
+ for (const block of message.content) {
122
+ if (block.type === "text" && block.text.trim().length > 0) {
123
+ console.log("\n" + block.text);
124
+ }
125
+ }
126
+ }
127
+ break;
128
+ }
129
+ case "aero_turn_status":
130
+ if (event.status && event.status.reason !== "completed") console.error(`Aero stopped: ${event.status.reason} (${event.status.toolCalls} tool calls).`);
131
+ break;
132
+ case "error":
133
+ console.error(`Agent stream error: ${event.message}`);
134
+ break;
135
+ }
136
+ }
137
+ export {
138
+ agentAsk
139
+ };
@@ -0,0 +1,52 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import "./chunk-AOJU5LKX.js";
6
+ import {
7
+ CliError,
8
+ isMachineFormat,
9
+ printCliError
10
+ } from "./chunk-HGMYEDAQ.js";
11
+ import "./chunk-D6COIM3U.js";
12
+ import "./chunk-MLKGABMK.js";
13
+
14
+ // src/commands/agent-conversations.ts
15
+ import { randomUUID } from "crypto";
16
+ async function agentConversations(opts) {
17
+ try {
18
+ const client = createApiClient();
19
+ const result = await (() => {
20
+ switch (opts.action) {
21
+ case "list":
22
+ return client.listAgentConversations(opts.project, { offset: opts.offset, limit: opts.limit });
23
+ case "new":
24
+ return client.createAgentConversation(opts.project, opts.id ?? randomUUID());
25
+ case "show":
26
+ return client.getAgentConversation(opts.project, opts.id);
27
+ case "resume":
28
+ return client.resumeAgentConversation(opts.project, opts.id);
29
+ case "delete":
30
+ return client.deleteAgentConversation(opts.project, opts.id);
31
+ }
32
+ })();
33
+ if (isMachineFormat(opts.format)) {
34
+ console.log(JSON.stringify(result, null, 2));
35
+ return;
36
+ }
37
+ if ("conversations" in result) {
38
+ if (!result.conversations.length) console.log("No Aero conversations yet.");
39
+ for (const conversation of result.conversations) console.log(`${conversation.active ? "* " : " "}${conversation.id} ${conversation.title} ${conversation.updatedAt}`);
40
+ if (result.nextOffset !== null) console.log(`More conversations: --offset ${result.nextOffset}`);
41
+ } else if ("messages" in result) {
42
+ console.log(`${result.title} \u2014 ${result.id}${result.active ? " (current)" : ""}`);
43
+ for (const message of result.messages) console.log(`[${message.role}] ${typeof message.content === "string" ? message.content : JSON.stringify(message.content)}`);
44
+ } else console.log(`Conversation deleted: ${result.id}. Shared project notes kept.`);
45
+ } catch (error) {
46
+ printCliError(error, opts.format);
47
+ process.exitCode = error instanceof CliError ? error.exitCode : 2;
48
+ }
49
+ }
50
+ export {
51
+ agentConversations
52
+ };
@@ -0,0 +1,92 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import {
6
+ emitJsonl
7
+ } from "./chunk-Z7IUAJOF.js";
8
+ import "./chunk-AOJU5LKX.js";
9
+ import {
10
+ CliError,
11
+ isMachineFormat,
12
+ printCliError
13
+ } from "./chunk-HGMYEDAQ.js";
14
+ import "./chunk-D6COIM3U.js";
15
+ import "./chunk-MLKGABMK.js";
16
+
17
+ // src/commands/agent-memory.ts
18
+ function toFormat(raw) {
19
+ if (raw === "json") return "json";
20
+ if (raw === "jsonl") return "jsonl";
21
+ return "text";
22
+ }
23
+ async function agentMemoryList(opts) {
24
+ const format = toFormat(opts.format);
25
+ try {
26
+ const client = createApiClient();
27
+ const result = await client.listAgentMemory(opts.project);
28
+ if (format === "json") {
29
+ console.log(JSON.stringify(result, null, 2));
30
+ return;
31
+ } else if (format === "jsonl") {
32
+ emitJsonl(result.entries.map((entry) => ({ project: opts.project, ...entry })));
33
+ return;
34
+ }
35
+ if (result.entries.length === 0) {
36
+ console.log(`No Aero memory notes for "${opts.project}".`);
37
+ return;
38
+ }
39
+ console.log(`Aero memory for ${opts.project} \u2014 ${result.entries.length} note(s)
40
+ `);
41
+ for (const entry of result.entries) {
42
+ console.log(`[${entry.source}] ${entry.key} (updated ${entry.updatedAt})`);
43
+ console.log(` ${entry.value.replace(/\n/g, "\n ")}`);
44
+ console.log();
45
+ }
46
+ } catch (err) {
47
+ printCliError(err, format);
48
+ process.exitCode = err instanceof CliError ? err.exitCode : 2;
49
+ }
50
+ }
51
+ async function agentMemorySet(opts) {
52
+ const format = toFormat(opts.format);
53
+ try {
54
+ const client = createApiClient();
55
+ const result = await client.setAgentMemory(opts.project, {
56
+ key: opts.key,
57
+ value: opts.value
58
+ });
59
+ if (isMachineFormat(format)) {
60
+ console.log(JSON.stringify(result, null, 2));
61
+ return;
62
+ }
63
+ console.log(`Stored note "${result.entry.key}" for "${opts.project}" (source=${result.entry.source}).`);
64
+ } catch (err) {
65
+ printCliError(err, format);
66
+ process.exitCode = err instanceof CliError ? err.exitCode : 2;
67
+ }
68
+ }
69
+ async function agentMemoryForget(opts) {
70
+ const format = toFormat(opts.format);
71
+ try {
72
+ const client = createApiClient();
73
+ const result = await client.forgetAgentMemory(opts.project, opts.key);
74
+ if (isMachineFormat(format)) {
75
+ console.log(JSON.stringify(result, null, 2));
76
+ return;
77
+ }
78
+ if (result.status === "forgotten") {
79
+ console.log(`Forgot note "${opts.key}" for "${opts.project}".`);
80
+ } else {
81
+ console.log(`No note with key "${opts.key}" for "${opts.project}".`);
82
+ }
83
+ } catch (err) {
84
+ printCliError(err, format);
85
+ process.exitCode = err instanceof CliError ? err.exitCode : 2;
86
+ }
87
+ }
88
+ export {
89
+ agentMemoryForget,
90
+ agentMemoryList,
91
+ agentMemorySet
92
+ };
@@ -0,0 +1,55 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import {
6
+ emitJsonl
7
+ } from "./chunk-Z7IUAJOF.js";
8
+ import "./chunk-AOJU5LKX.js";
9
+ import {
10
+ CliError,
11
+ printCliError
12
+ } from "./chunk-HGMYEDAQ.js";
13
+ import "./chunk-D6COIM3U.js";
14
+ import "./chunk-MLKGABMK.js";
15
+
16
+ // src/commands/agent-providers.ts
17
+ async function agentProviders(opts) {
18
+ const format = opts.format === "json" ? "json" : opts.format === "jsonl" ? "jsonl" : "text";
19
+ try {
20
+ const client = createApiClient();
21
+ const res = await client.listAgentProviders(opts.project);
22
+ if (format === "json") {
23
+ console.log(JSON.stringify(res, null, 2));
24
+ return;
25
+ } else if (format === "jsonl") {
26
+ emitJsonl(
27
+ res.providers.map((provider) => ({
28
+ project: opts.project,
29
+ defaultProvider: res.defaultProvider,
30
+ ...provider
31
+ }))
32
+ );
33
+ return;
34
+ }
35
+ console.log(
36
+ `Aero providers for ${opts.project} (default: ${res.defaultProvider ?? "none configured"})
37
+ `
38
+ );
39
+ const idWidth = Math.max(...res.providers.map((p) => p.id.length), 8);
40
+ for (const p of res.providers) {
41
+ const status = p.configured ? "\u2713" : "\u2717";
42
+ const source = p.keySource ? `(${p.keySource})` : "";
43
+ console.log(
44
+ ` ${status} ${p.id.padEnd(idWidth)} ${p.label} \u2014 model ${p.defaultModel} ${source}`.trimEnd()
45
+ );
46
+ }
47
+ } catch (err) {
48
+ printCliError(err, format);
49
+ if (err instanceof CliError) process.exitCode = err.exitCode;
50
+ else process.exitCode = 2;
51
+ }
52
+ }
53
+ export {
54
+ agentProviders
55
+ };
@@ -0,0 +1,77 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import "./chunk-AOJU5LKX.js";
6
+ import {
7
+ CliError,
8
+ isMachineFormat,
9
+ printCliError
10
+ } from "./chunk-HGMYEDAQ.js";
11
+ import "./chunk-D6COIM3U.js";
12
+ import "./chunk-MLKGABMK.js";
13
+
14
+ // src/commands/agent-transcript.ts
15
+ function toFormat(raw) {
16
+ if (raw === "json") return "json";
17
+ if (raw === "jsonl") return "jsonl";
18
+ return "text";
19
+ }
20
+ async function agentTranscript(opts) {
21
+ const format = toFormat(opts.format);
22
+ try {
23
+ const client = createApiClient();
24
+ const transcript = await client.getAgentTranscript(opts.project);
25
+ if (isMachineFormat(format)) {
26
+ console.log(JSON.stringify(transcript, null, 2));
27
+ return;
28
+ }
29
+ if (transcript.messages.length === 0) {
30
+ console.log(`No Aero conversation yet for "${opts.project}".`);
31
+ return;
32
+ }
33
+ console.log(
34
+ `Aero session for ${opts.project} \u2014 ${transcript.modelProvider ?? "unknown"}/${transcript.modelId ?? "unknown"} \u2014 updated ${transcript.updatedAt ?? "never"}`
35
+ );
36
+ console.log(`${transcript.messages.length} message${transcript.messages.length === 1 ? "" : "s"}
37
+ `);
38
+ for (const msg of transcript.messages) {
39
+ console.log(`[${msg.role}]`);
40
+ if (typeof msg.content === "string") {
41
+ console.log(msg.content);
42
+ } else if (Array.isArray(msg.content)) {
43
+ for (const block of msg.content) {
44
+ const t = block.type;
45
+ if (t === "text") console.log(block.text);
46
+ else if (t === "toolCall") console.log(`\u27D0 ${block.name} ${JSON.stringify(block.arguments)}`);
47
+ else if (t === "toolResult") console.log(` ${block.isError ? "\u2717" : "\u2713"} tool-result`);
48
+ }
49
+ }
50
+ console.log();
51
+ }
52
+ } catch (err) {
53
+ printCliError(err, format);
54
+ if (err instanceof CliError) process.exitCode = err.exitCode;
55
+ else process.exitCode = 2;
56
+ }
57
+ }
58
+ async function agentTranscriptReset(opts) {
59
+ const format = toFormat(opts.format);
60
+ try {
61
+ const client = createApiClient();
62
+ await client.resetAgentTranscript(opts.project);
63
+ if (isMachineFormat(format)) {
64
+ console.log(JSON.stringify({ status: "reset", project: opts.project }));
65
+ } else {
66
+ console.log(`Aero conversation reset for "${opts.project}".`);
67
+ }
68
+ } catch (err) {
69
+ printCliError(err, format);
70
+ if (err instanceof CliError) process.exitCode = err.exitCode;
71
+ else process.exitCode = 2;
72
+ }
73
+ }
74
+ export {
75
+ agentTranscript,
76
+ agentTranscriptReset
77
+ };
@@ -0,0 +1,240 @@
1
+ import {
2
+ createApiClient
3
+ } from "./chunk-B5J675KK.js";
4
+ import "./chunk-UQ3MOZGC.js";
5
+ import "./chunk-AOJU5LKX.js";
6
+ import {
7
+ CliError,
8
+ isMachineFormat
9
+ } from "./chunk-HGMYEDAQ.js";
10
+ import {
11
+ buildModelChangeNotice,
12
+ formatPercent,
13
+ formatSignedPointDelta
14
+ } from "./chunk-D6COIM3U.js";
15
+ import "./chunk-MLKGABMK.js";
16
+
17
+ // src/commands/analytics.ts
18
+ function getClient() {
19
+ return createApiClient();
20
+ }
21
+ async function showAnalytics(project, options) {
22
+ const client = getClient();
23
+ const features = options.feature ? [options.feature] : ["metrics", "gaps", "sources"];
24
+ const results = {};
25
+ for (const feature of features) {
26
+ switch (feature) {
27
+ case "metrics": {
28
+ const data = await client.getAnalyticsMetrics(project, options.window);
29
+ results.metrics = data;
30
+ if (!isMachineFormat(options.format)) printMetrics(data);
31
+ break;
32
+ }
33
+ case "gaps": {
34
+ const data = await client.getAnalyticsGaps(project, options.window);
35
+ results.gaps = data;
36
+ if (!isMachineFormat(options.format)) printGaps(data);
37
+ break;
38
+ }
39
+ case "sources": {
40
+ const data = await client.getAnalyticsSources(project, { window: options.window });
41
+ results.sources = data;
42
+ if (!isMachineFormat(options.format)) printSources(data);
43
+ break;
44
+ }
45
+ default:
46
+ throw new CliError({
47
+ code: "INVALID_ANALYTICS_FEATURE",
48
+ message: `Unknown analytics feature "${feature}"`,
49
+ displayMessage: `Unknown feature: ${feature}. Use: metrics, gaps, sources`,
50
+ details: {
51
+ feature,
52
+ validFeatures: ["metrics", "gaps", "sources"]
53
+ }
54
+ });
55
+ }
56
+ }
57
+ if (isMachineFormat(options.format)) {
58
+ console.log(JSON.stringify(results, null, 2));
59
+ }
60
+ }
61
+ var BUCKET_DATE_WIDTH = 35;
62
+ function bucketDates(bucket) {
63
+ const legacyCompatible = bucket;
64
+ const start = legacyCompatible.dataStartDate?.slice(0, 10);
65
+ const end = legacyCompatible.dataEndDate?.slice(0, 10);
66
+ if (!start || !end) return "date unavailable";
67
+ const sweeps = legacyCompatible.sweepCount ?? 1;
68
+ const pooled = sweeps > 1 ? ` (${sweeps} sweeps)` : "";
69
+ if (start === end) return `${start}${pooled}`;
70
+ return `${start} \u2192 ${end}${pooled}`;
71
+ }
72
+ function printMetrics(data) {
73
+ console.log(`
74
+ Citation Rate Trends (${data.window})`);
75
+ console.log("\u2500".repeat(50));
76
+ const modelChangeNotice = buildModelChangeNotice(readModelPointerChanges(data));
77
+ if (modelChangeNotice?.kind === "change") {
78
+ console.log(`
79
+ Model Updates Behind These Numbers:`);
80
+ console.log(` ${modelChangeNotice.text}`);
81
+ console.log("");
82
+ }
83
+ console.log(` Overall: ${formatPercent(data.overall.citationRate)} (${data.overall.cited}/${data.overall.total})`);
84
+ console.log(` Trend: ${data.trend}`);
85
+ printWindowChange(data);
86
+ if (Object.keys(data.byProvider).length > 0) {
87
+ console.log(`
88
+ By Provider:`);
89
+ for (const [provider, metric] of Object.entries(data.byProvider)) {
90
+ console.log(` ${provider.padEnd(10)} ${formatPercent(metric.citationRate).padStart(6)} (${metric.cited}/${metric.total})`);
91
+ }
92
+ }
93
+ if (data.buckets.length > 0) {
94
+ console.log(`
95
+ Timeline (dates in UTC):`);
96
+ for (const bucket of data.buckets) {
97
+ const bar = bucket.total > 0 ? "\u2588".repeat(Math.round(bucket.citationRate * 20)) : "";
98
+ console.log(` ${bucketDates(bucket).padEnd(BUCKET_DATE_WIDTH)} ${formatPercent(bucket.citationRate).padStart(6)} ${bar}`);
99
+ }
100
+ }
101
+ const providersInBuckets = [...new Set(data.buckets.flatMap((b) => Object.keys(b.byProvider ?? {})))].sort();
102
+ if (data.buckets.length > 0 && providersInBuckets.length > 0) {
103
+ console.log(`
104
+ By Provider Timeline (dates in UTC):`);
105
+ for (const provider of providersInBuckets) {
106
+ console.log(` ${provider}:`);
107
+ for (const bucket of data.buckets) {
108
+ const metric = bucket.byProvider?.[provider];
109
+ if (!metric) continue;
110
+ const bar = metric.total > 0 ? "\u2588".repeat(Math.round(metric.citationRate * 20)) : "";
111
+ console.log(` ${bucketDates(bucket).padEnd(BUCKET_DATE_WIDTH)} ${formatPercent(metric.citationRate).padStart(6)} ${bar}`);
112
+ }
113
+ }
114
+ }
115
+ if (modelChangeNotice?.kind === "no-known-change") {
116
+ console.log(`
117
+ Model Updates Behind These Numbers:`);
118
+ console.log(` ${modelChangeNotice.text}`);
119
+ console.log(` ${modelChangeNotice.detail}`);
120
+ }
121
+ const attributionEntries = Object.entries(readModelAttribution(data)).sort(([a], [b]) => a.localeCompare(b));
122
+ if (attributionEntries.length > 0) {
123
+ console.log(`
124
+ Model Evidence:`);
125
+ for (const [provider, attribution] of attributionEntries) {
126
+ const latest = attribution.latestObservation;
127
+ console.log(` ${provider}: latest ${formatModelEvidence(latest.state)} at ${latest.observedAt}`);
128
+ for (const event of attribution.events) {
129
+ const dating = event.fromPreWindowAnchor ? " (on or before)" : "";
130
+ const priorSweep = event.fromPreWindowAnchor && event.anchorObservedAt ? ` [last seen ${formatModelEvidence(event.from)} on ${event.anchorObservedAt}]` : "";
131
+ console.log(` ${event.observedAt}${dating} ${formatModelEvidence(event.from)} \u2192 ${formatModelEvidence(event.to)}${priorSweep}`);
132
+ }
133
+ const eventTotal = attribution.eventTotal ?? attribution.events.length;
134
+ if (eventTotal > attribution.events.length) {
135
+ console.log(` Showing the latest ${attribution.events.length} of ${eventTotal} model changes.`);
136
+ }
137
+ if (attribution.anchorUnavailable) {
138
+ console.log(` We did not look far enough back to be sure this is every change.`);
139
+ }
140
+ }
141
+ }
142
+ const servedEntries = Object.entries(readServedModelAttribution(data)).sort(([a], [b]) => a.localeCompare(b));
143
+ if (servedEntries.length > 0) {
144
+ const mismatch = readModelServiceMismatch(data);
145
+ console.log(`
146
+ What the Engines Answered With:`);
147
+ for (const [provider, served] of servedEntries) {
148
+ const rawIds = served.latestServedModelIds.length > 0 ? served.latestServedModelIds.join(", ") : formatModelEvidence(served.latestObservation.state);
149
+ const substituted = mismatch[provider];
150
+ const note = substituted ? ` (not the ${formatModelEvidence(substituted.configured)} you selected)` : "";
151
+ console.log(` ${provider}: ${rawIds} at ${served.latestObservation.observedAt}${note}`);
152
+ for (const event of served.events) {
153
+ const dating = event.fromPreWindowAnchor ? " (on or before)" : "";
154
+ console.log(` ${event.observedAt}${dating} ${formatModelEvidence(event.from)} \u2192 ${formatModelEvidence(event.to)}`);
155
+ }
156
+ }
157
+ }
158
+ }
159
+ function printWindowChange(data) {
160
+ const windowChange = data.windowChange;
161
+ if (!windowChange) return;
162
+ const shareScope = data.mentionShareScope === "non-brand" ? "non-brand queries" : "pooled queries \xB7 classification unavailable";
163
+ const series = [
164
+ ["Mentioned", windowChange.mentionRate],
165
+ ["Cited", windowChange.citationRate],
166
+ [`Mention share \xB7 ${shareScope}`, windowChange.mentionShare]
167
+ ];
168
+ console.log(`
169
+ Change Across the Window (first \u2192 latest bucket):`);
170
+ for (const [label, change] of series) {
171
+ const text = change ? `${formatPercent(change.first)} \u2192 ${formatPercent(change.latest)} (${formatSignedPointDelta(change.delta)})` : "fewer than two buckets to compare";
172
+ console.log(` ${label}: ${text}`);
173
+ }
174
+ }
175
+ function readServedModelAttribution(data) {
176
+ const legacyCompatible = data;
177
+ return legacyCompatible.servedModelAttribution ?? {};
178
+ }
179
+ function readModelServiceMismatch(data) {
180
+ const legacyCompatible = data;
181
+ return legacyCompatible.modelServiceMismatch ?? {};
182
+ }
183
+ function readModelPointerChanges(data) {
184
+ const legacyCompatible = data;
185
+ return legacyCompatible.modelPointerChanges ?? {};
186
+ }
187
+ function readModelAttribution(data) {
188
+ const legacyCompatible = data;
189
+ return legacyCompatible.modelAttribution ?? {};
190
+ }
191
+ function formatModelEvidence(state) {
192
+ switch (state.status) {
193
+ case "known":
194
+ return `known ${state.model}`;
195
+ case "unknown":
196
+ return "unknown";
197
+ case "mixed":
198
+ return `mixed ${state.models.join(", ")}${state.includesUnknown ? " + unknown" : ""}`;
199
+ }
200
+ }
201
+ function printGaps(data) {
202
+ console.log(`
203
+ Brand Gap Analysis`);
204
+ console.log("\u2500".repeat(50));
205
+ console.log(` Cited: ${data.cited.length} | Gap: ${data.gap.length} | Uncited: ${data.uncited.length}`);
206
+ if (data.gap.length > 0) {
207
+ console.log(`
208
+ Opportunity Gaps (competitors cited, you're not):`);
209
+ for (const q of data.gap) {
210
+ const competitors = q.competitorsCiting.join(", ");
211
+ const cons = q.consistency.totalRuns > 0 ? ` [cited ${q.consistency.citedRuns}/${q.consistency.totalRuns} runs]` : "";
212
+ console.log(` \u2022 ${q.query}${cons}`);
213
+ console.log(` Competitors: ${competitors}`);
214
+ }
215
+ }
216
+ if (data.cited.length > 0) {
217
+ console.log(`
218
+ Cited Queries:`);
219
+ for (const q of data.cited) {
220
+ const cons = q.consistency.totalRuns > 0 ? ` [${q.consistency.citedRuns}/${q.consistency.totalRuns} runs]` : "";
221
+ console.log(` \u2713 ${q.query} (${q.providers.join(", ")})${cons}`);
222
+ }
223
+ }
224
+ }
225
+ function printSources(data) {
226
+ console.log(`
227
+ Source Origin Breakdown`);
228
+ console.log("\u2500".repeat(50));
229
+ if (data.overall.length === 0) {
230
+ console.log(" No source data available");
231
+ return;
232
+ }
233
+ for (const cat of data.overall) {
234
+ const domains = cat.topDomains.slice(0, 3).map((d) => d.domain).join(", ");
235
+ console.log(` ${cat.label.padEnd(20)} ${formatPercent(cat.percentage).padStart(6)} (${cat.count}) ${domains}`);
236
+ }
237
+ }
238
+ export {
239
+ showAnalytics
240
+ };