@ainyc/canonry 5.1.1 → 5.1.3
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/canonry/references/canonry-cli.md +2 -0
- package/assets/assets/{AuditHistoryPanel-9F_74jKS.js → AuditHistoryPanel-Dc_pymFg.js} +1 -1
- package/assets/assets/{BacklinksPage-DmF2rbwy.js → BacklinksPage-BkSo48YX.js} +1 -1
- package/assets/assets/{HistoryPage-DKopwAjo.js → HistoryPage-BbswsdU7.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-Dpd_DYQv.js → MeasurementPropertyPage-BbgtalkM.js} +1 -1
- package/assets/assets/{ProjectPage-b1-57SzP.js → ProjectPage-CAcRQp-T.js} +1 -1
- package/assets/assets/{RunRow-BjrSRp6X.js → RunRow-2cNW8FHz.js} +1 -1
- package/assets/assets/{RunsPage-BFrymZ7D.js → RunsPage-Cz3lJ6VJ.js} +1 -1
- package/assets/assets/{SettingsPage-DdVa6pLK.js → SettingsPage-BQwB0r9k.js} +1 -1
- package/assets/assets/{SiteHealthSection-CizmiBjA.js → SiteHealthSection-C0aJ_UhN.js} +3 -3
- package/assets/assets/{TrafficPage-N7sZgb9x.js → TrafficPage-DTic3zhO.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-BNQmMJ5D.js → TrafficSourceDetailPage-BKfabnCw.js} +1 -1
- package/assets/assets/{extract-error-message-Bh9mRIz9.js → extract-error-message-BzB8j3fC.js} +1 -1
- package/assets/assets/{index-BnR1Tu9j.js → index-DQGEzxrN.js} +3 -3
- package/assets/assets/{react-sigma_core.esm.min-DGaYwjLZ.js → react-sigma_core.esm.min-rYv0aKKx.js} +1 -1
- package/assets/assets/{v2-overview-adapter-eqN-8OK5.js → v2-overview-adapter-CWWPfsm-.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-ZWVXUPLP.js → chunk-5ZOLPHTO.js} +286 -96
- package/dist/{chunk-MEQGGODM.js → chunk-AEE5DGTE.js} +92 -8
- package/dist/{chunk-LHHJVGH7.js → chunk-EBUX3C5H.js} +110 -15
- package/dist/{chunk-66KGNC4U.js → chunk-KJM4DRZN.js} +2 -2
- package/dist/{chunk-3DL3KV6C.js → chunk-MMSPU72Z.js} +113 -1
- package/dist/cli.js +25 -26
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-7XX5ZRYE.js → intelligence-service-25NQCETC.js} +2 -2
- package/dist/mcp.js +49 -7
- package/package.json +7 -7
package/dist/cli.js
CHANGED
|
@@ -11,10 +11,12 @@ import {
|
|
|
11
11
|
backfillSnapshotAttributionCommand,
|
|
12
12
|
backfillTrafficClassificationCommand,
|
|
13
13
|
checkLatestVersionForCli,
|
|
14
|
+
cliRuntimeContext,
|
|
14
15
|
coerceAgentProvider,
|
|
15
16
|
createServer,
|
|
16
17
|
detectAndTrackUpgrade,
|
|
17
18
|
formatAuditFactorScore,
|
|
19
|
+
formatUpdateNotice,
|
|
18
20
|
getCloudflareTrafficConnectionBySourceId,
|
|
19
21
|
getOrCreateAnonymousId,
|
|
20
22
|
getTelemetryStatus,
|
|
@@ -23,17 +25,19 @@ import {
|
|
|
23
25
|
isLoopbackBindHost,
|
|
24
26
|
isTelemetryEnabled,
|
|
25
27
|
listAgentProviders,
|
|
28
|
+
readCachedUpdateAvailable,
|
|
26
29
|
setGoogleAuthConfig,
|
|
30
|
+
setTelemetryPreference,
|
|
27
31
|
setTelemetrySource,
|
|
28
32
|
showFirstRunNotice,
|
|
29
33
|
trackCliCommandFinished,
|
|
30
34
|
trackEvent,
|
|
31
35
|
waitForServerRuntimeStartup
|
|
32
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5ZOLPHTO.js";
|
|
33
37
|
import {
|
|
34
38
|
autoSyncSkills,
|
|
35
39
|
formatAutoSyncNotice
|
|
36
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KJM4DRZN.js";
|
|
37
41
|
import {
|
|
38
42
|
CliError,
|
|
39
43
|
EXIT_SYSTEM_ERROR,
|
|
@@ -59,7 +63,7 @@ import {
|
|
|
59
63
|
saveConfigPatch,
|
|
60
64
|
systemError,
|
|
61
65
|
usageError
|
|
62
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-AEE5DGTE.js";
|
|
63
67
|
import {
|
|
64
68
|
CLOUDFLARE_WORKER_BINDINGS,
|
|
65
69
|
CLOUDFLARE_WORKER_GENERATED_MARKER,
|
|
@@ -73,7 +77,7 @@ import {
|
|
|
73
77
|
projects,
|
|
74
78
|
queries,
|
|
75
79
|
renderReportHtml
|
|
76
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-EBUX3C5H.js";
|
|
77
81
|
import {
|
|
78
82
|
AdsDeliverySnapshotStatuses,
|
|
79
83
|
AdsHistoricalCampaignRollupStatuses,
|
|
@@ -152,7 +156,7 @@ import {
|
|
|
152
156
|
snapshotProviderModeSchema,
|
|
153
157
|
visibilityReportRequestSchema,
|
|
154
158
|
winnabilityClassSchema
|
|
155
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-MMSPU72Z.js";
|
|
156
160
|
|
|
157
161
|
// src/cli.ts
|
|
158
162
|
import { pathToFileURL } from "url";
|
|
@@ -15372,7 +15376,8 @@ ${mcpTip}`);
|
|
|
15372
15376
|
hasGoogle: !!google,
|
|
15373
15377
|
hasAgent: !!agentLLM
|
|
15374
15378
|
}),
|
|
15375
|
-
skillsInstalled: !!skillsSummary
|
|
15379
|
+
skillsInstalled: !!skillsSummary,
|
|
15380
|
+
...cliRuntimeContext()
|
|
15376
15381
|
});
|
|
15377
15382
|
}
|
|
15378
15383
|
if (!isMachineFormat(format) && process.stdin.isTTY && process.stdout.isTTY) {
|
|
@@ -15706,7 +15711,9 @@ Canonry server running at ${url}`);
|
|
|
15706
15711
|
);
|
|
15707
15712
|
trackEvent("serve.started", {
|
|
15708
15713
|
providerCount: providerNames.length,
|
|
15709
|
-
providers: providerNames
|
|
15714
|
+
providers: providerNames,
|
|
15715
|
+
// Who launched the server: an agent-started install is its own funnel.
|
|
15716
|
+
...cliRuntimeContext()
|
|
15710
15717
|
});
|
|
15711
15718
|
} catch (err) {
|
|
15712
15719
|
const message = describeError(err);
|
|
@@ -15804,19 +15811,15 @@ function telemetryCommand(subcommand, format = "text", targetValue) {
|
|
|
15804
15811
|
}
|
|
15805
15812
|
case "enable": {
|
|
15806
15813
|
requireLocalConfig("telemetry.enable");
|
|
15807
|
-
|
|
15808
|
-
config.telemetry = true;
|
|
15809
|
-
saveConfigPatch(config);
|
|
15814
|
+
void setTelemetryPreference(true, "cli");
|
|
15810
15815
|
emitStatus(localStatus(), format, true);
|
|
15811
15816
|
break;
|
|
15812
15817
|
}
|
|
15813
15818
|
case "disable": {
|
|
15814
15819
|
requireLocalConfig("telemetry.disable");
|
|
15815
|
-
const
|
|
15816
|
-
config.telemetry = false;
|
|
15817
|
-
saveConfigPatch(config);
|
|
15820
|
+
const delivery = setTelemetryPreference(false, "cli");
|
|
15818
15821
|
emitStatus(localStatus(), format, true);
|
|
15819
|
-
|
|
15822
|
+
return delivery;
|
|
15820
15823
|
}
|
|
15821
15824
|
default:
|
|
15822
15825
|
throw usageError(`Error: unknown telemetry subcommand: ${subcommand ?? "(none)"}
|
|
@@ -19299,20 +19302,16 @@ async function runCli(args = process.argv.slice(2)) {
|
|
|
19299
19302
|
const setupState = buildSetupState();
|
|
19300
19303
|
trackEvent("cli.command", {
|
|
19301
19304
|
command: resolvedCommand,
|
|
19302
|
-
...setupState ? { setup_state: setupState } : {}
|
|
19305
|
+
...setupState ? { setup_state: setupState } : {},
|
|
19306
|
+
...cliRuntimeContext()
|
|
19303
19307
|
});
|
|
19304
19308
|
}
|
|
19305
|
-
if (!isHelpRequest && command !== "telemetry"
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
process.stderr.write(
|
|
19309
|
-
|
|
19310
|
-
|
|
19311
|
-
Upgrade: ${update.upgradeCommand}
|
|
19312
|
-
|
|
19313
|
-
`
|
|
19314
|
-
);
|
|
19315
|
-
});
|
|
19309
|
+
if (!isHelpRequest && command !== "telemetry") {
|
|
19310
|
+
const update = readCachedUpdateAvailable();
|
|
19311
|
+
if (update) {
|
|
19312
|
+
process.stderr.write(formatUpdateNotice(update, { format, interactive: Boolean(process.stderr.isTTY) }));
|
|
19313
|
+
}
|
|
19314
|
+
void checkLatestVersionForCli();
|
|
19316
19315
|
}
|
|
19317
19316
|
const commandStartedAt = Date.now();
|
|
19318
19317
|
try {
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
createGoogleMarketingCredentialStore,
|
|
4
4
|
createGoogleMarketingRuntime,
|
|
5
5
|
createServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5ZOLPHTO.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-AEE5DGTE.js";
|
|
10
|
+
import "./chunk-EBUX3C5H.js";
|
|
11
|
+
import "./chunk-MMSPU72Z.js";
|
|
12
12
|
export {
|
|
13
13
|
GoogleMarketingRuntimeError,
|
|
14
14
|
createGoogleMarketingCredentialStore,
|
package/dist/mcp.js
CHANGED
|
@@ -1,16 +1,49 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoSyncSkills
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KJM4DRZN.js";
|
|
4
4
|
import {
|
|
5
5
|
createApiClient,
|
|
6
6
|
createCanonryMcpServer
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AEE5DGTE.js";
|
|
8
8
|
import {
|
|
9
|
-
isReadOnlyKey
|
|
10
|
-
|
|
9
|
+
isReadOnlyKey,
|
|
10
|
+
updateCheckEnvOptOut
|
|
11
|
+
} from "./chunk-MMSPU72Z.js";
|
|
11
12
|
|
|
12
13
|
// src/mcp/cli.ts
|
|
14
|
+
import { randomUUID } from "crypto";
|
|
13
15
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
16
|
+
|
|
17
|
+
// src/mcp/update-notice.ts
|
|
18
|
+
function createUpdateNoticeSource(client, opts = {}) {
|
|
19
|
+
const disabled = updateCheckEnvOptOut(opts.env ?? process.env) !== null;
|
|
20
|
+
const ttlMs = opts.ttlMs ?? 60 * 60 * 1e3;
|
|
21
|
+
const now = opts.now ?? Date.now;
|
|
22
|
+
let value = null;
|
|
23
|
+
let fetchedAt = Number.NEGATIVE_INFINITY;
|
|
24
|
+
let inFlight = null;
|
|
25
|
+
const refresh = () => {
|
|
26
|
+
if (disabled) return Promise.resolve();
|
|
27
|
+
inFlight ??= client.getServerUpdateAvailable().then((next) => {
|
|
28
|
+
value = next;
|
|
29
|
+
}, () => {
|
|
30
|
+
value = null;
|
|
31
|
+
}).finally(() => {
|
|
32
|
+
fetchedAt = now();
|
|
33
|
+
inFlight = null;
|
|
34
|
+
});
|
|
35
|
+
return inFlight;
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
refresh,
|
|
39
|
+
get: () => {
|
|
40
|
+
if (!disabled && !inFlight && now() - fetchedAt >= ttlMs) void refresh();
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/mcp/cli.ts
|
|
14
47
|
var HELP_TEXT = `Usage: canonry-mcp [--read-only | --scope=<all|read-only>] [--eager]
|
|
15
48
|
|
|
16
49
|
Stdio MCP adapter over the Canonry public API. Inherits config from
|
|
@@ -45,9 +78,18 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
45
78
|
throw error;
|
|
46
79
|
}
|
|
47
80
|
void autoSyncSkills();
|
|
48
|
-
const client = createApiClient({ clientName: "canonry-mcp" });
|
|
49
|
-
const
|
|
50
|
-
const
|
|
81
|
+
const client = createApiClient({ clientName: "canonry-mcp", surface: "mcp-stdio", actorSession: randomUUID() });
|
|
82
|
+
const updateNotice = createUpdateNoticeSource(client);
|
|
83
|
+
const [authorization] = await Promise.all([
|
|
84
|
+
resolveEffectiveAuthorization(client, options.scope),
|
|
85
|
+
updateNotice.refresh()
|
|
86
|
+
]);
|
|
87
|
+
const server = createCanonryMcpServer({
|
|
88
|
+
...authorization,
|
|
89
|
+
eager: options.eager,
|
|
90
|
+
clientFactory: () => client,
|
|
91
|
+
updateAvailable: updateNotice.get
|
|
92
|
+
});
|
|
51
93
|
await server.connect(new StdioServerTransport());
|
|
52
94
|
}
|
|
53
95
|
async function resolveEffectiveScope(client, flagScope) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -87,29 +87,29 @@
|
|
|
87
87
|
"tsup": "^8.5.1",
|
|
88
88
|
"tsx": "^4.19.0",
|
|
89
89
|
"@ainyc/canonry-web": "0.0.0",
|
|
90
|
+
"@ainyc/canonry-api-routes": "0.0.0",
|
|
90
91
|
"@ainyc/canonry-api-client": "0.0.0",
|
|
91
92
|
"@ainyc/canonry-config": "0.0.0",
|
|
92
93
|
"@ainyc/canonry-contracts": "0.0.0",
|
|
93
|
-
"@ainyc/canonry-api-routes": "0.0.0",
|
|
94
94
|
"@ainyc/canonry-db": "0.0.0",
|
|
95
95
|
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
96
96
|
"@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
|
|
97
|
-
"@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
|
|
98
97
|
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
99
98
|
"@ainyc/canonry-integration-cloud-run": "0.0.0",
|
|
100
99
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
101
|
-
"@ainyc/canonry-integration-
|
|
100
|
+
"@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
|
|
102
101
|
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
103
|
-
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
104
102
|
"@ainyc/canonry-integration-google-tag-manager": "0.0.0",
|
|
105
|
-
"@ainyc/canonry-integration-
|
|
103
|
+
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
106
104
|
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
105
|
+
"@ainyc/canonry-integration-google-ads": "0.0.0",
|
|
106
|
+
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
107
107
|
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
108
108
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
109
|
+
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
109
110
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
110
111
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
111
112
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
112
|
-
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
113
113
|
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
114
114
|
"@ainyc/canonry-provider-perplexity": "0.0.0"
|
|
115
115
|
},
|