@ainyc/canonry 2.14.2 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/aero/references/memory-patterns.md +9 -9
- package/assets/assets/{index-D1v6Q-fS.js → index-B18l8ugs.js} +97 -97
- package/assets/assets/{index-U2SLimrz.css → index-DMx3Oy9W.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-CILBPOHB.js → chunk-CKABU6PE.js} +230 -578
- package/dist/{chunk-7VWSR5F6.js → chunk-HNVRN5QL.js} +927 -8
- package/dist/cli.js +36 -10
- package/dist/index.js +2 -2
- package/dist/mcp.js +9 -796
- package/package.json +9 -9
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
setGoogleAuthConfig,
|
|
18
18
|
showFirstRunNotice,
|
|
19
19
|
trackEvent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CKABU6PE.js";
|
|
21
21
|
import {
|
|
22
22
|
CcReleaseSyncStatuses,
|
|
23
23
|
CheckScopes,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
saveConfig,
|
|
46
46
|
saveConfigPatch,
|
|
47
47
|
usageError
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-HNVRN5QL.js";
|
|
49
49
|
import {
|
|
50
50
|
apiKeys,
|
|
51
51
|
competitors,
|
|
@@ -162,7 +162,7 @@ Usage: ${spec.usage}`, {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// src/commands/backfill.ts
|
|
165
|
-
import { and, eq, inArray
|
|
165
|
+
import { and, eq, inArray } from "drizzle-orm";
|
|
166
166
|
var SNAPSHOT_BATCH_SIZE = 500;
|
|
167
167
|
async function backfillAnswerVisibilityCommand(opts) {
|
|
168
168
|
const config = loadConfig();
|
|
@@ -304,14 +304,15 @@ async function backfillAnswerVisibilityCommand(opts) {
|
|
|
304
304
|
console.log(` Errors: ${providerErrors}`);
|
|
305
305
|
}
|
|
306
306
|
function backfillNormalizedPaths(db, opts) {
|
|
307
|
-
const baseConditions = [
|
|
307
|
+
const baseConditions = [];
|
|
308
308
|
if (opts?.projectId) {
|
|
309
309
|
baseConditions.push(eq(gaTrafficSnapshots.projectId, opts.projectId));
|
|
310
310
|
}
|
|
311
311
|
const rows = db.select({
|
|
312
312
|
id: gaTrafficSnapshots.id,
|
|
313
|
-
landingPage: gaTrafficSnapshots.landingPage
|
|
314
|
-
|
|
313
|
+
landingPage: gaTrafficSnapshots.landingPage,
|
|
314
|
+
landingPageNormalized: gaTrafficSnapshots.landingPageNormalized
|
|
315
|
+
}).from(gaTrafficSnapshots).where(baseConditions.length > 0 ? and(...baseConditions) : void 0).all();
|
|
315
316
|
let updated = 0;
|
|
316
317
|
let unchanged = 0;
|
|
317
318
|
if (rows.length > 0) {
|
|
@@ -322,6 +323,10 @@ function backfillNormalizedPaths(db, opts) {
|
|
|
322
323
|
unchanged++;
|
|
323
324
|
continue;
|
|
324
325
|
}
|
|
326
|
+
if (row.landingPageNormalized === next) {
|
|
327
|
+
unchanged++;
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
325
330
|
tx.update(gaTrafficSnapshots).set({ landingPageNormalized: next }).where(eq(gaTrafficSnapshots.id, row.id)).run();
|
|
326
331
|
updated++;
|
|
327
332
|
}
|
|
@@ -2105,11 +2110,16 @@ async function gaAttribution(project, opts) {
|
|
|
2105
2110
|
organicSessions: traffic.totalOrganicSessions,
|
|
2106
2111
|
aiSessions: traffic.aiSessionsDeduped,
|
|
2107
2112
|
aiUsers: traffic.aiUsersDeduped,
|
|
2113
|
+
aiSessionsBySession: traffic.aiSessionsBySession,
|
|
2114
|
+
aiUsersBySession: traffic.aiUsersBySession,
|
|
2108
2115
|
socialSessions: traffic.socialSessions,
|
|
2109
2116
|
socialUsers: traffic.socialUsers,
|
|
2117
|
+
directSessions: traffic.totalDirectSessions,
|
|
2110
2118
|
aiSharePct: traffic.aiSharePct,
|
|
2119
|
+
aiSharePctBySession: traffic.aiSharePctBySession,
|
|
2111
2120
|
socialSharePct: traffic.socialSharePct,
|
|
2112
2121
|
organicSharePct: traffic.organicSharePct,
|
|
2122
|
+
directSharePct: traffic.directSharePct,
|
|
2113
2123
|
aiReferrals: traffic.aiReferrals,
|
|
2114
2124
|
socialReferrals: traffic.socialReferrals,
|
|
2115
2125
|
trend
|
|
@@ -2127,9 +2137,10 @@ async function gaAttribution(project, opts) {
|
|
|
2127
2137
|
console.log();
|
|
2128
2138
|
console.log(" CHANNEL BREAKDOWN 7d trend 30d trend");
|
|
2129
2139
|
console.log(` Organic Search: ${String(traffic.totalOrganicSessions).padEnd(6)} (${String(traffic.organicSharePct).padStart(2)}%) ${fmtTrend(trend.organic.trend7dPct).padEnd(12)} ${fmtTrend(trend.organic.trend30dPct)}`);
|
|
2130
|
-
console.log(` AI Referrals: ${String(traffic.aiSessionsDeduped).padEnd(6)} (${String(traffic.aiSharePct).padStart(2)}%) ${fmtTrend(trend.ai.trend7dPct).padEnd(12)} ${fmtTrend(trend.ai.trend30dPct)}`);
|
|
2131
2140
|
console.log(` Social: ${String(traffic.socialSessions).padEnd(6)} (${String(traffic.socialSharePct).padStart(2)}%) ${fmtTrend(trend.social.trend7dPct).padEnd(12)} ${fmtTrend(trend.social.trend30dPct)}`);
|
|
2132
|
-
|
|
2141
|
+
console.log(` Direct: ${String(traffic.totalDirectSessions).padEnd(6)} (${String(traffic.directSharePct).padStart(2)}%) ${fmtTrend(trend.direct.trend7dPct).padEnd(12)} ${fmtTrend(trend.direct.trend30dPct)}`);
|
|
2142
|
+
console.log(` AI Referrals: ${String(traffic.aiSessionsBySession).padEnd(6)} (${String(traffic.aiSharePctBySession).padStart(2)}%) ${fmtTrend(trend.ai.trend7dPct).padEnd(12)} ${fmtTrend(trend.ai.trend30dPct)} (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
|
|
2143
|
+
const otherSessions2 = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
|
|
2133
2144
|
if (otherSessions2 > 0) {
|
|
2134
2145
|
const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions2 / traffic.totalSessions * 100) : 0;
|
|
2135
2146
|
console.log(` Other: ${String(otherSessions2).padEnd(6)} (${String(otherPct).padStart(2)}%)`);
|
|
@@ -2161,11 +2172,16 @@ async function gaAttribution(project, opts) {
|
|
|
2161
2172
|
organicSessions: traffic.totalOrganicSessions,
|
|
2162
2173
|
aiSessions: traffic.aiSessionsDeduped,
|
|
2163
2174
|
aiUsers: traffic.aiUsersDeduped,
|
|
2175
|
+
aiSessionsBySession: traffic.aiSessionsBySession,
|
|
2176
|
+
aiUsersBySession: traffic.aiUsersBySession,
|
|
2164
2177
|
socialSessions: traffic.socialSessions,
|
|
2165
2178
|
socialUsers: traffic.socialUsers,
|
|
2179
|
+
directSessions: traffic.totalDirectSessions,
|
|
2166
2180
|
aiSharePct: traffic.aiSharePct,
|
|
2181
|
+
aiSharePctBySession: traffic.aiSharePctBySession,
|
|
2167
2182
|
socialSharePct: traffic.socialSharePct,
|
|
2168
2183
|
organicSharePct: traffic.organicSharePct,
|
|
2184
|
+
directSharePct: traffic.directSharePct,
|
|
2169
2185
|
aiReferrals: traffic.aiReferrals,
|
|
2170
2186
|
socialReferrals: traffic.socialReferrals,
|
|
2171
2187
|
periodStart: traffic.periodStart,
|
|
@@ -2184,9 +2200,10 @@ async function gaAttribution(project, opts) {
|
|
|
2184
2200
|
console.log();
|
|
2185
2201
|
console.log(" CHANNEL BREAKDOWN");
|
|
2186
2202
|
console.log(` Organic Search: ${traffic.totalOrganicSessions} sessions (${traffic.organicSharePct}%)`);
|
|
2187
|
-
console.log(` AI Referrals: ${traffic.aiSessionsDeduped} sessions (${traffic.aiSharePct}%)`);
|
|
2188
2203
|
console.log(` Social: ${traffic.socialSessions} sessions (${traffic.socialSharePct}%)`);
|
|
2189
|
-
|
|
2204
|
+
console.log(` Direct: ${traffic.totalDirectSessions} sessions (${traffic.directSharePct}%)`);
|
|
2205
|
+
console.log(` AI Referrals: ${traffic.aiSessionsBySession} sessions (${traffic.aiSharePctBySession}%) (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
|
|
2206
|
+
const otherSessions = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
|
|
2190
2207
|
if (otherSessions > 0) {
|
|
2191
2208
|
const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions / traffic.totalSessions * 100) : 0;
|
|
2192
2209
|
console.log(` Other: ${otherSessions} sessions (${otherPct}%)`);
|
|
@@ -8940,6 +8957,15 @@ Usage: ${usage}`, {
|
|
|
8940
8957
|
await agentTranscriptReset({ project, format: input.format });
|
|
8941
8958
|
}
|
|
8942
8959
|
},
|
|
8960
|
+
{
|
|
8961
|
+
path: ["agent", "clear"],
|
|
8962
|
+
usage: "canonry agent clear <project> [--format json]",
|
|
8963
|
+
options: {},
|
|
8964
|
+
run: async (input) => {
|
|
8965
|
+
const project = requireProject(input, "agent.clear", "canonry agent clear <project> [--format json]");
|
|
8966
|
+
await agentTranscriptReset({ project, format: input.format });
|
|
8967
|
+
}
|
|
8968
|
+
},
|
|
8943
8969
|
{
|
|
8944
8970
|
path: ["agent", "memory", "list"],
|
|
8945
8971
|
usage: "canonry agent memory list <project> [--format json]",
|
package/dist/index.js
CHANGED