@twin3-ai/agent-id 0.3.47 → 0.3.48

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/bin/agent-id.js CHANGED
@@ -3375,7 +3375,7 @@ function runMcp() {
3375
3375
 
3376
3376
  async function handleMcpLine(line) {
3377
3377
  const msg = JSON.parse(line);
3378
- if (msg.method === "initialize") return send(msg.id, { protocolVersion: "2024-11-05", serverInfo: { name: "agent-id", version: "0.3.0" } });
3378
+ if (msg.method === "initialize") return send(msg.id, { protocolVersion: "2024-11-05", serverInfo: { name: "agent-id", version: require("../package.json").version } });
3379
3379
  if (msg.method === "tools/list") {
3380
3380
  const tools = [
3381
3381
  { name: "audit_url", description: "Audit a website for SEO/AEO/GEO/Agent readiness.", inputSchema: { type: "object", properties: { url: { type: "string" } }, required: ["url"] } },
package/browser-sdk.js CHANGED
@@ -11,6 +11,12 @@
11
11
  }
12
12
  return;
13
13
  }
14
+ // Kept equal to packages/agent-id/package.json by
15
+ // tests/test_sdk_v02_package.py. This sensor is served as a plain
16
+ // browser script and shipped in the package byte-for-byte, so it can
17
+ // neither read the package at runtime nor go through a build step:
18
+ // the version is written once here and CI refuses a mismatch.
19
+ var SDK_VERSION = "0.3.48";
14
20
  var w = window;
15
21
  var d = document;
16
22
  var s = d.currentScript || {};
@@ -123,7 +129,7 @@
123
129
  function payload(event, data) {
124
130
  var out = {
125
131
  sdk: "aeo-site-sdk",
126
- sdk_version: "0.2.3",
132
+ sdk_version: SDK_VERSION,
127
133
  event: event || eventName,
128
134
  timestamp: new Date().toISOString(),
129
135
  agent_id: agentId,
@@ -165,7 +171,7 @@
165
171
  agentId: agentId,
166
172
  siteToken: siteToken,
167
173
  endpoint: endpoint,
168
- version: "0.2.3",
174
+ version: SDK_VERSION,
169
175
  track: send,
170
176
  signal: signal,
171
177
  conversion: conversion,
package/installer.js CHANGED
@@ -5,7 +5,7 @@ const fsSync = require("node:fs");
5
5
  const path = require("node:path");
6
6
  const os = require("node:os");
7
7
  const crypto = require("node:crypto");
8
- const { DEFAULT_ENDPOINT } = require("./runtime-config.js");
8
+ const { DEFAULT_ENDPOINT, SDK_VERSION } = require("./runtime-config.js");
9
9
 
10
10
  const INSTALL_SCHEMA = "agentx-install-plan-v1";
11
11
  const STATE_SCHEMA = "agentx-site-agent-install-state-v1";
@@ -243,7 +243,7 @@ async function main() {
243
243
  ? { skipped: true, reason: "measurement_module_not_granted" }
244
244
  : SYNC_MODE === "monthly" ? { skipped: true, reason: "monthly_insights_run" } : await call("site_agent_events", {
245
245
  source: "customer_owned_github_actions_runner",
246
- events: [{ event: "heartbeat", url: SITE_URL, ts: Math.floor(Date.now() / 1000), data: { runtime: "github_actions", sdk_version: "0.3.0" } }]
246
+ events: [{ event: "heartbeat", url: SITE_URL, ts: Math.floor(Date.now() / 1000), data: { runtime: "github_actions", sdk_version: "${SDK_VERSION}" } }]
247
247
  });
248
248
  const insights = !ENABLED_MODULES.has("optimization")
249
249
  ? { skipped: true, reason: "optimization_module_not_granted" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin3-ai/agent-id",
3
- "version": "0.3.47",
3
+ "version": "0.3.48",
4
4
  "description": "Domain-bound AgentX portable alias, AEO evidence, and website-Agent integration SDK.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
package/runtime-config.js CHANGED
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  const DEFAULT_ENDPOINT = "https://xagent.id";
4
+ // The version the SDK reports about itself comes from the package it was
5
+ // installed from. Writing it as a literal meant heartbeats kept announcing
6
+ // 0.3.0 long after the published package moved on, so the fleet view of
7
+ // "what is installed out there" was wrong by dozens of releases.
8
+ const SDK_VERSION = require("./package.json").version;
4
9
  const TRUSTED_ISSUER_KEY_SHA256 = "sha256:f1dd1844319a02a8ec3c32552ed730fdda286e733cf6b5d54029ec7bd59fda1a";
5
10
 
6
11
  function configuredEndpoint(env = process.env) {
7
12
  return String(env.AGENT_ID_ENDPOINT || env.AEO_AGENT_ENDPOINT || DEFAULT_ENDPOINT).replace(/\/+$/, "");
8
13
  }
9
14
 
10
- module.exports = { DEFAULT_ENDPOINT, TRUSTED_ISSUER_KEY_SHA256, configuredEndpoint };
15
+ module.exports = { DEFAULT_ENDPOINT, SDK_VERSION, TRUSTED_ISSUER_KEY_SHA256, configuredEndpoint };
package/site-agent.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const { DEFAULT_ENDPOINT } = require("./runtime-config.js");
3
+ const { DEFAULT_ENDPOINT, SDK_VERSION } = require("./runtime-config.js");
4
4
 
5
5
  const SITE_AGENT_KEY_POLICY = Object.freeze({
6
6
  serverSideOnly: true,
@@ -404,7 +404,7 @@ function createSiteAgentClient(options = {}) {
404
404
  ts: payload.ts == null ? Math.floor(Date.now() / 1000) : payload.ts,
405
405
  data: {
406
406
  runtime: payload.runtime || "server_side_site_agent",
407
- sdk_version: payload.sdk_version || payload.sdkVersion || "0.3.0"
407
+ sdk_version: payload.sdk_version || payload.sdkVersion || SDK_VERSION
408
408
  }
409
409
  }]
410
410
  });
@@ -421,7 +421,7 @@ function createSiteAgentClient(options = {}) {
421
421
  ts: payload.ts == null ? Math.floor(Date.now() / 1000) : payload.ts,
422
422
  data: {
423
423
  runtime: payload.runtime || "server_side_site_agent",
424
- sdk_version: payload.sdk_version || payload.sdkVersion || "0.3.0"
424
+ sdk_version: payload.sdk_version || payload.sdkVersion || SDK_VERSION
425
425
  }
426
426
  }]
427
427
  });
package/sync-service.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ const { SDK_VERSION } = require("./runtime-config.js");
4
+
3
5
  const fs = require("node:fs/promises");
4
6
  const path = require("node:path");
5
7
  const crypto = require("node:crypto");
@@ -125,7 +127,7 @@ function createSiteAgentSyncService(options = {}) {
125
127
  const intervalMs = Math.max(1000, Number(options.intervalMs || process.env.AGENT_ID_SYNC_INTERVAL_MS || 900000));
126
128
  const heartbeatIntervalMs = Math.max(300000, Number(options.heartbeatIntervalMs || process.env.AGENT_ID_HEARTBEAT_INTERVAL_MS || options.intervalMs || 900000));
127
129
  const collector = options.collector || null;
128
- const runtimeVersion = String(options.runtimeVersion || process.env.AGENT_ID_RUNTIME_VERSION || "0.3.0");
130
+ const runtimeVersion = String(options.runtimeVersion || process.env.AGENT_ID_RUNTIME_VERSION || SDK_VERSION);
129
131
  const capabilities = Array.from(new Set((Array.isArray(options.capabilities) ? options.capabilities : ["heartbeat", "insights_feed"]).map((item) => String(item).trim()).filter(Boolean))).sort();
130
132
  const now = options.now || Date.now;
131
133
  const sleep = options.sleep || ((ms, signal) => new Promise((resolve) => {