@ainyc/canonry 4.101.0 → 4.102.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.
Files changed (23) hide show
  1. package/README.md +4 -1
  2. package/assets/assets/{BacklinksPage-aysk_iGy.js → BacklinksPage-lXt19SLR.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-CmKqxndA.js → ChartPrimitives-C-sLgrDV.js} +1 -1
  4. package/assets/assets/{ProjectPage-dduZrrBr.js → ProjectPage-wtvaWIRA.js} +1 -1
  5. package/assets/assets/{RunRow-Ba77hJ4d.js → RunRow-Db32k-uH.js} +1 -1
  6. package/assets/assets/{RunsPage-D3IAdQMB.js → RunsPage-DwW3Mely.js} +1 -1
  7. package/assets/assets/{SettingsPage-Y54JtLw-.js → SettingsPage-gXn6OGsu.js} +1 -1
  8. package/assets/assets/{TrafficPage-DawzPWdt.js → TrafficPage-I49ci4gj.js} +1 -1
  9. package/assets/assets/{TrafficSourceDetailPage-DAhQwFVb.js → TrafficSourceDetailPage-BCvLztx9.js} +1 -1
  10. package/assets/assets/{arrow-left-NsJbgqmV.js → arrow-left-BpA06YY0.js} +1 -1
  11. package/assets/assets/{extract-error-message-u00ggxeK.js → extract-error-message-BZSIQ5iV.js} +1 -1
  12. package/assets/assets/{index-4YArcfwj.js → index-DSSLug80.js} +3 -3
  13. package/assets/assets/{trash-2-BBdbbe60.js → trash-2-CLkUNdvb.js} +1 -1
  14. package/assets/index.html +1 -1
  15. package/dist/{chunk-2YPVK75M.js → chunk-2FUODJQR.js} +1 -1
  16. package/dist/{chunk-O3SFVGDF.js → chunk-3PVCILSN.js} +38 -6
  17. package/dist/{chunk-AV3DHH6B.js → chunk-B2H2RRIT.js} +786 -611
  18. package/dist/{chunk-HUL5FUBD.js → chunk-EOQXB63S.js} +24 -2
  19. package/dist/cli.js +22 -7
  20. package/dist/index.js +4 -4
  21. package/dist/{intelligence-service-R6QJ3KC2.js → intelligence-service-RC4BY5HF.js} +2 -2
  22. package/dist/mcp.js +2 -2
  23. package/package.json +9 -9
@@ -589,6 +589,11 @@ var apiKeyDtoSchema = z4.object({
589
589
  /** First 9 chars of the raw token (`cnry_` + 4 hex). Safe to display. */
590
590
  keyPrefix: z4.string(),
591
591
  scopes: z4.array(z4.string()),
592
+ /**
593
+ * The project this key is scoped to, or `null` for a full-instance key. A
594
+ * scoped key may only read/write its own project (enforced server-side).
595
+ */
596
+ projectId: z4.string().nullable(),
592
597
  /**
593
598
  * Server-derived convenience flag: `true` when this key is read-only (carries
594
599
  * the `read` scope and no write-granting scope), in which case the API rejects
@@ -610,7 +615,13 @@ var createApiKeyRequestSchema = z4.object({
610
615
  * what `canonry init` writes for the root key). When provided it must be a
611
616
  * non-empty list — an empty array would mint a key that can do nothing.
612
617
  */
613
- scopes: z4.array(z4.string()).min(1).optional()
618
+ scopes: z4.array(z4.string()).min(1).optional(),
619
+ /**
620
+ * Bind the new key to a SINGLE project (by project id). Omit for a
621
+ * full-instance key (the default). A scoped key may only read/write that
622
+ * project; the server validates the id exists at creation time.
623
+ */
624
+ projectId: z4.string().optional()
614
625
  });
615
626
  var createdApiKeyDtoSchema = apiKeyDtoSchema.extend({
616
627
  key: z4.string()
@@ -5378,6 +5389,16 @@ function buildEmbedClientConfig(resolved) {
5378
5389
  return client;
5379
5390
  }
5380
5391
 
5392
+ // ../contracts/src/telemetry.ts
5393
+ var GHOST_TELEMETRY_TEST_LOCATIONS = /* @__PURE__ */ new Set(["nyc", "lax", "chi"]);
5394
+ function isGhostTelemetryEvent(eventName, properties) {
5395
+ if (eventName !== "run.completed" && eventName !== "run.aborted") return false;
5396
+ if (!properties) return false;
5397
+ if (properties.providerCount !== 0) return false;
5398
+ const location = typeof properties.location === "string" ? properties.location.trim().toLowerCase() : "";
5399
+ return GHOST_TELEMETRY_TEST_LOCATIONS.has(location);
5400
+ }
5401
+
5381
5402
  export {
5382
5403
  __export,
5383
5404
  apiKeyDtoSchema,
@@ -5686,5 +5707,6 @@ export {
5686
5707
  splitList,
5687
5708
  parseOriginList,
5688
5709
  frameAncestorsHeaderValue,
5689
- buildEmbedClientConfig
5710
+ buildEmbedClientConfig,
5711
+ isGhostTelemetryEvent
5690
5712
  };
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  setTelemetrySource,
30
30
  showFirstRunNotice,
31
31
  trackEvent
32
- } from "./chunk-O3SFVGDF.js";
32
+ } from "./chunk-3PVCILSN.js";
33
33
  import {
34
34
  CliError,
35
35
  EXIT_SYSTEM_ERROR,
@@ -46,7 +46,7 @@ import {
46
46
  saveConfig,
47
47
  saveConfigPatch,
48
48
  usageError
49
- } from "./chunk-2YPVK75M.js";
49
+ } from "./chunk-2FUODJQR.js";
50
50
  import {
51
51
  apiKeys,
52
52
  createClient,
@@ -54,7 +54,7 @@ import {
54
54
  projects,
55
55
  queries,
56
56
  renderReportHtml
57
- } from "./chunk-AV3DHH6B.js";
57
+ } from "./chunk-B2H2RRIT.js";
58
58
  import {
59
59
  BacklinkSources,
60
60
  CcReleaseSyncStatuses,
@@ -80,7 +80,7 @@ import {
80
80
  providerQuotaPolicySchema,
81
81
  resolveProviderInput,
82
82
  winnabilityClassSchema
83
- } from "./chunk-HUL5FUBD.js";
83
+ } from "./chunk-EOQXB63S.js";
84
84
 
85
85
  // src/cli.ts
86
86
  import { pathToFileURL } from "url";
@@ -5761,6 +5761,10 @@ async function createApiKey(opts) {
5761
5761
  const body = { name: opts.name };
5762
5762
  const scopes = opts.readOnly ? [READ_ONLY_SCOPE] : explicitScopes;
5763
5763
  if (scopes) body.scopes = scopes;
5764
+ if (opts.project) {
5765
+ const proj = await client.getProject(opts.project);
5766
+ body.projectId = proj.id;
5767
+ }
5764
5768
  const created = await client.createApiKey(body);
5765
5769
  if (isMachineFormat(opts.format)) {
5766
5770
  console.log(JSON.stringify(created, null, 2));
@@ -5772,6 +5776,7 @@ async function createApiKey(opts) {
5772
5776
  console.log(` Prefix: ${created.keyPrefix}`);
5773
5777
  console.log(` Scopes: ${created.scopes.join(", ")}`);
5774
5778
  console.log(` Read-only: ${created.readOnly ? "yes" : "no"}`);
5779
+ console.log(` Project: ${opts.project ?? "(full instance)"}`);
5775
5780
  console.log("\nSave this now \u2014 it will not be shown again.");
5776
5781
  }
5777
5782
  async function showApiKeySelf(format) {
@@ -5807,16 +5812,17 @@ var KEYS_CLI_COMMANDS = [
5807
5812
  },
5808
5813
  {
5809
5814
  path: ["key", "create"],
5810
- usage: "canonry key create --name <name> [--read-only | --scope <s> ...] [--format json]",
5815
+ usage: "canonry key create --name <name> [--read-only | --scope <s> ...] [--project <name>] [--format json]",
5811
5816
  options: {
5812
5817
  name: stringOption(),
5813
5818
  scope: multiStringOption(),
5814
- "read-only": { type: "boolean" }
5819
+ "read-only": { type: "boolean" },
5820
+ project: stringOption()
5815
5821
  },
5816
5822
  run: async (input) => {
5817
5823
  const name = requireStringOption(input, "name", {
5818
5824
  command: "key.create",
5819
- usage: "canonry key create --name <name> [--read-only | --scope <s> ...] [--format json]",
5825
+ usage: "canonry key create --name <name> [--read-only | --scope <s> ...] [--project <name>] [--format json]",
5820
5826
  message: "--name is required"
5821
5827
  });
5822
5828
  const raw = getStringArray(input.values, "scope") ?? [];
@@ -5825,6 +5831,7 @@ var KEYS_CLI_COMMANDS = [
5825
5831
  name,
5826
5832
  scopes: scopes.length > 0 ? scopes : void 0,
5827
5833
  readOnly: getBoolean(input.values, "read-only"),
5834
+ project: getString(input.values, "project"),
5828
5835
  format: input.format
5829
5836
  });
5830
5837
  }
@@ -10556,6 +10563,7 @@ var DEFAULT_AGENT_MODELS = {
10556
10563
  };
10557
10564
  async function initCommand(opts) {
10558
10565
  const format = opts?.format ?? "text";
10566
+ const primaryNextStep = "canonry serve";
10559
10567
  if (!isMachineFormat(format)) {
10560
10568
  console.log("Initializing canonry...\n");
10561
10569
  }
@@ -10756,6 +10764,7 @@ async function initCommand(opts) {
10756
10764
  skillsTip,
10757
10765
  mcp: mcpSummary,
10758
10766
  mcpTip,
10767
+ primaryNextStep,
10759
10768
  nextSteps
10760
10769
  }, null, 2));
10761
10770
  } else {
@@ -10804,6 +10813,7 @@ ${mcpTip}`);
10804
10813
  }
10805
10814
  if (!isMachineFormat(format)) {
10806
10815
  showFirstRunNotice();
10816
+ console.log("\nNext: canonry serve to open the dashboard, or canonry settings provider gemini --api-key <key> to configure Gemini.");
10807
10817
  console.log("\nNext steps:");
10808
10818
  for (const line of nextSteps) {
10809
10819
  console.log(` ${line}`);
@@ -10829,6 +10839,7 @@ function buildNextSteps() {
10829
10839
  "",
10830
10840
  " The wizard walks through project \u2192 queries \u2192 competitors \u2192 first sweep",
10831
10841
  " in 5 guided steps and shows your first results inline.",
10842
+ " For remote/exposed hosts, complete dashboard password setup from loopback first.",
10832
10843
  "",
10833
10844
  "Prefer the terminal? The same flow as CLI commands:",
10834
10845
  "",
@@ -10916,6 +10927,10 @@ Received ${signal}, stopping server...`);
10916
10927
  } else {
10917
10928
  console.log(`
10918
10929
  Canonry server running at ${url}`);
10930
+ console.log(`Open ${url}/setup to finish onboarding and run your first visibility check.`);
10931
+ if (host === "0.0.0.0") {
10932
+ console.log("First-run dashboard password setup is unauthenticated only on loopback; complete setup from this machine first or use a bearer cnry_... key.");
10933
+ }
10919
10934
  console.log("Press Ctrl+C to stop.\n");
10920
10935
  const nudge = getMissingUserSkillsNudge(process.env.HOME);
10921
10936
  if (nudge) process.stderr.write(`${nudge.message}
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-O3SFVGDF.js";
3
+ } from "./chunk-3PVCILSN.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-2YPVK75M.js";
7
- import "./chunk-AV3DHH6B.js";
8
- import "./chunk-HUL5FUBD.js";
6
+ } from "./chunk-2FUODJQR.js";
7
+ import "./chunk-B2H2RRIT.js";
8
+ import "./chunk-EOQXB63S.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-AV3DHH6B.js";
4
- import "./chunk-HUL5FUBD.js";
3
+ } from "./chunk-B2H2RRIT.js";
4
+ import "./chunk-EOQXB63S.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  PACKAGE_VERSION,
4
4
  canonryMcpTools,
5
5
  createApiClient
6
- } from "./chunk-2YPVK75M.js";
6
+ } from "./chunk-2FUODJQR.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-HUL5FUBD.js";
9
+ } from "./chunk-EOQXB63S.js";
10
10
 
11
11
  // src/mcp/cli.ts
12
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.101.0",
3
+ "version": "4.102.0",
4
4
  "type": "module",
5
5
  "description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
6
6
  "license": "FSL-1.1-ALv2",
@@ -63,32 +63,32 @@
63
63
  "tsup": "^8.5.1",
64
64
  "tsx": "^4.19.0",
65
65
  "@ainyc/canonry-api-client": "0.0.0",
66
- "@ainyc/canonry-api-routes": "0.0.0",
67
- "@ainyc/canonry-config": "0.0.0",
68
66
  "@ainyc/canonry-contracts": "0.0.0",
67
+ "@ainyc/canonry-config": "0.0.0",
69
68
  "@ainyc/canonry-db": "0.0.0",
70
- "@ainyc/canonry-integration-openai-ads": "0.0.0",
71
- "@ainyc/canonry-integration-bing": "0.0.0",
72
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
73
69
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
70
+ "@ainyc/canonry-integration-bing": "0.0.0",
71
+ "@ainyc/canonry-integration-openai-ads": "0.0.0",
74
72
  "@ainyc/canonry-integration-google": "0.0.0",
75
73
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
76
74
  "@ainyc/canonry-integration-google-places": "0.0.0",
77
75
  "@ainyc/canonry-integration-traffic": "0.0.0",
76
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
78
77
  "@ainyc/canonry-integration-wordpress": "0.0.0",
78
+ "@ainyc/canonry-api-routes": "0.0.0",
79
79
  "@ainyc/canonry-intelligence": "0.0.0",
80
- "@ainyc/canonry-provider-cdp": "0.0.0",
81
80
  "@ainyc/canonry-provider-claude": "0.0.0",
82
81
  "@ainyc/canonry-provider-local": "0.0.0",
83
- "@ainyc/canonry-provider-gemini": "0.0.0",
84
82
  "@ainyc/canonry-provider-openai": "0.0.0",
83
+ "@ainyc/canonry-provider-gemini": "0.0.0",
84
+ "@ainyc/canonry-provider-cdp": "0.0.0",
85
85
  "@ainyc/canonry-provider-perplexity": "0.0.0"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
89
89
  "build:web": "tsx build-web.ts",
90
90
  "typecheck": "tsc --noEmit -p tsconfig.json",
91
- "test": "vitest run",
91
+ "test": "vitest run --config ../../vitest.package.config.ts",
92
92
  "lint": "eslint src/ test/"
93
93
  }
94
94
  }