@knownagents/sdk 2.2.0 → 2.3.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/README.md CHANGED
@@ -138,28 +138,40 @@ Call `identifyAgents` to identify multiple requests at once:
138
138
  const identifications = await knownAgents.identifyAgents([
139
139
  {
140
140
  id: "request-1",
141
- request_headers: request1.headers
141
+ request_headers: request1.headers,
142
+ request_path: request1.url
142
143
  },
143
144
  {
144
145
  id: "request-2",
145
- request_headers: request2.headers
146
+ request_headers: request2.headers,
147
+ request_path: request2.url
146
148
  }
147
149
  ])
148
150
  ```
149
151
 
150
152
  These methods return an object (or array of objects) with the following fields:
151
153
 
152
- - `id`: The identifier from the request (if provided)
154
+ - `id`: The identifier from the request (if provided).
153
155
  - `result`: The identification result:
154
- - `"verified"`: The agent was identified and verified
155
- - `"verification_failed"`: The agent was identified but failed verification (it was spoofed)
156
- - `"not_verifiable"`: The agent was identified but could not be verified (no method available)
157
- - `"unknown_agent"`: Not an agent, or the agent is not in the database
158
- - `agent_id`: The unique ID of the agent (if identified)
159
- - `agent_token`: The name of the agent (e.g. `"Claude-User"`) (if identified)
160
- - `agent_url`: The documentation URL of the agent (if identified)
161
- - `agent_type_name`: The type of agent (e.g. `"AI Assistant"`) (if identified)
162
- - `operator_name`: The company operating the agent (e.g. `"Anthropic"`) (if identified)
156
+ - `"verified"`: A known agent was identified and verified
157
+ - `"verification_failed"`: A known agent was identified, but failed verification
158
+ - `"not_verifiable"`: A known agent was identified, but no verification method was available
159
+ - `"not_identified"`: No known agent was identified
160
+ - `agent_id`: The unique ID of the identified agent.
161
+ - `agent_token`: The name of the agent (e.g. `"Claude-User"`) (if identified).
162
+ - `agent_url`: The documentation URL of the agent (if identified).
163
+ - `agent_type_name`: The type of agent (e.g. `"AI Assistant"`) (if identified).
164
+ - `operator_name`: The company operating the agent (e.g. `"Anthropic"`) (if identified).
165
+ - `is_disallowed_by_robots_txt`: Whether the identified agent is disallowed by robots.txt from accessing the `request_path`.
166
+ - `asn`: The autonomous system number associated with the request's IPv4 address.
167
+ - `asn_operator`: The operator of the recognized autonomous system associated with the request's IPv4 address.
168
+ - `asn_type`: The type of the recognized autonomous system associated with the request's IPv4 address:
169
+ - `"isp"`
170
+ - `"hosting"`
171
+ - `"business"`
172
+ - `"education"`
173
+ - `"government"`
174
+ - `automation_score`: An integer from `0` to `99` indicating the strength of heuristic evidence that the request was made by an automated client. Higher scores indicate stronger detected automation signals. A score of `0` means that no automation signals were detected, not that the client is certainly human.
163
175
 
164
176
  ## Requirements
165
177
 
@@ -1 +1 @@
1
- {"version":3,"file":"KnownAgents.d.ts","sourceRoot":"","sources":["../src/KnownAgents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAC3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAGvG,OAAO,KAAK,EACR,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,8BAA8B,EAC9B,YAAY,EACf,MAAM,SAAS,CAAA;AAKhB;;GAEG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAQ;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAChD,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,mBAAmB,CAAmC;IAE9D;;;;;OAKG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB;IAMjE;;;;;;;;OAQG;IACH,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,8BAA8B,GAAG,IAAI;IAoC3H;;;;;;;;;OASG;IACH,YAAY,CAAC,OAAO,EAAE,eAA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AAuB;IAMjE;;;;;;;;OAQG;IACH,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,8BAA8B,GAAG,IAAI;IAoC3H;;;;;;;;;OASG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,6BAA6B,GAAG,IAAI;IAoEhH;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI;IA2B3C;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtB;;;;;;;;;OASG;IACG,iBAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,QAAQ,GAAE,MAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBzF;;;;;;;OAOG;IACG,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAoB5E;;;;;;;OAOG;IACG,cAAc,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAsBxF,OAAO,CAAC,aAAa;YAaP,UAAU;CAmB3B"}
@@ -221,7 +221,8 @@ class KnownAgents {
221
221
  "Content-Type": "application/json"
222
222
  },
223
223
  body: JSON.stringify({
224
- request_headers: (0, headers_1.getFilteredHeaders)(request.headers)
224
+ request_headers: (0, headers_1.getFilteredHeaders)(request.headers),
225
+ request_path: request.url
225
226
  })
226
227
  });
227
228
  if (response.ok) {
@@ -246,7 +247,7 @@ class KnownAgents {
246
247
  "Authorization": `Bearer ${this.accessToken}`,
247
248
  "Content-Type": "application/json"
248
249
  },
249
- body: JSON.stringify(requests.map(request => {
250
+ body: JSON.stringify(requests.map((request) => {
250
251
  return {
251
252
  ...request,
252
253
  request_headers: (0, headers_1.getFilteredHeaders)(request.request_headers),
package/dist/types.d.ts CHANGED
@@ -64,31 +64,50 @@ export interface IdentificationRequest {
64
64
  id?: string;
65
65
  /** The HTTP request headers. Sensitive headers are removed before sending. */
66
66
  request_headers: IncomingHttpHeaders;
67
+ /** The path of the incoming request (e.g. `"/products/123"`). */
68
+ request_path?: string;
67
69
  }
68
70
  /**
69
71
  * The result of an agent identification request.
70
72
  */
71
73
  export interface IdentificationResult {
72
- /** The identifier from the request (if provided) */
74
+ /** The identifier from the request (if provided). */
73
75
  id?: string;
74
76
  /**
75
77
  * The identification result:
76
- * - "verified": The agent was identified and verified
77
- * - "verification_failed": The agent was identified but failed verification (spoofed)
78
- * - "unknown_agent": The request is from an unrecognized agent or human
79
- * - "not_verifiable": The agent was identified but cannot be verified
78
+ * - "verified": A known agent was identified and verified
79
+ * - "verification_failed": A known agent was identified, but failed verification
80
+ * - "not_verifiable": A known agent was identified, but no verification method was available
81
+ * - "not_identified": No known agent was identified
80
82
  */
81
- result: "verified" | "verification_failed" | "unknown_agent" | "not_verifiable";
82
- /** The unique ID of the identified agent */
83
+ result: "verified" | "verification_failed" | "not_verifiable" | "not_identified";
84
+ /** The unique ID of the identified agent. */
83
85
  agent_id?: string;
84
- /** The name of the identified agent (e.g. "Googlebot") */
86
+ /** The name of the agent (e.g. `"Claude-User"`) (if identified). */
85
87
  agent_token?: string;
86
- /** The documentation URL for the identified agent */
88
+ /** The documentation URL of the agent (if identified). */
87
89
  agent_url?: string;
88
- /** The type of the identified agent (e.g. "AI Agent", "Search Engine Crawler") */
90
+ /** The type of agent (e.g. `"AI Assistant"`) (if identified). */
89
91
  agent_type_name?: string;
90
- /** The company behind the identified agent (e.g. "Google") */
92
+ /** The company operating the agent (e.g. `"Anthropic"`) (if identified). */
91
93
  operator_name?: string;
94
+ /** Whether the identified agent is disallowed by robots.txt from accessing the `request_path`. */
95
+ is_disallowed_by_robots_txt?: boolean;
96
+ /** The autonomous system number associated with the request's IPv4 address. */
97
+ asn?: number;
98
+ /** The operator of the recognized autonomous system associated with the request's IPv4 address. */
99
+ asn_operator?: string;
100
+ /**
101
+ * The type of the recognized autonomous system associated with the request's IPv4 address:
102
+ * - "isp"
103
+ * - "hosting"
104
+ * - "business"
105
+ * - "education"
106
+ * - "government"
107
+ */
108
+ asn_type?: "isp" | "hosting" | "business" | "education" | "government";
109
+ /** An integer from `0` to `99` indicating the strength of heuristic evidence that the request was made by an automated client. Higher scores indicate stronger detected automation signals. A score of `0` means that no automation signals were detected, not that the client is certainly human. */
110
+ automation_score?: number;
92
111
  }
93
112
  /**
94
113
  * Agent types that can be controlled with robots.txt rules.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAEpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,yGAAyG;IACzG,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,6BAA6B;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,6BAA6B;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAA;IACtB,8EAA8E;IAC9E,eAAe,EAAE,mBAAmB,CAAA;IACpC,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;IACtC,4CAA4C;IAC5C,iCAAiC,CAAC,EAAE,MAAM,CAAA;IAC1C,sCAAsC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gCAAgC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,MAAM,CAAA;IACrB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAA;IACtE,sSAAsS;IACtS,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;GAEG;AACH,oBAAY,SAAS;IACjB,OAAO,aAAa;IACpB,WAAW,iBAAiB;IAC5B,aAAa,oBAAoB;IACjC,cAAc,qBAAqB;IACnC,aAAa,oBAAoB;IACjC,eAAe,sBAAsB;IACrC,QAAQ,aAAa;IACrB,cAAc,oBAAoB;IAClC,eAAe,qBAAqB;IACpC,OAAO,YAAY;IACnB,oBAAoB,0BAA0B;IAC9C,OAAO,YAAY;IACnB,UAAU,gBAAgB;IAC1B,mBAAmB,0BAA0B;IAC7C,eAAe,qBAAqB;IACpC,mBAAmB,0BAA0B;CAChD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knownagents/sdk",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "The official Node.js SDK for Known Agents: AI agent analytics (bot traffic), LLM referral tracking, automatic robots.txt, agent identification",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -265,7 +265,8 @@ export class KnownAgents {
265
265
  "Content-Type": "application/json"
266
266
  },
267
267
  body: JSON.stringify({
268
- request_headers: getFilteredHeaders(request.headers)
268
+ request_headers: getFilteredHeaders(request.headers),
269
+ request_path: request.url
269
270
  })
270
271
  })
271
272
 
@@ -291,7 +292,7 @@ export class KnownAgents {
291
292
  "Authorization": `Bearer ${this.accessToken}`,
292
293
  "Content-Type": "application/json"
293
294
  },
294
- body: JSON.stringify(requests.map(request => {
295
+ body: JSON.stringify(requests.map((request) => {
295
296
  return {
296
297
  ...request,
297
298
  request_headers: getFilteredHeaders(request.request_headers),
package/src/types.ts CHANGED
@@ -68,32 +68,51 @@ export interface IdentificationRequest {
68
68
  id?: string
69
69
  /** The HTTP request headers. Sensitive headers are removed before sending. */
70
70
  request_headers: IncomingHttpHeaders
71
+ /** The path of the incoming request (e.g. `"/products/123"`). */
72
+ request_path?: string
71
73
  }
72
74
 
73
75
  /**
74
76
  * The result of an agent identification request.
75
77
  */
76
78
  export interface IdentificationResult {
77
- /** The identifier from the request (if provided) */
79
+ /** The identifier from the request (if provided). */
78
80
  id?: string
79
81
  /**
80
82
  * The identification result:
81
- * - "verified": The agent was identified and verified
82
- * - "verification_failed": The agent was identified but failed verification (spoofed)
83
- * - "unknown_agent": The request is from an unrecognized agent or human
84
- * - "not_verifiable": The agent was identified but cannot be verified
83
+ * - "verified": A known agent was identified and verified
84
+ * - "verification_failed": A known agent was identified, but failed verification
85
+ * - "not_verifiable": A known agent was identified, but no verification method was available
86
+ * - "not_identified": No known agent was identified
85
87
  */
86
- result: "verified" | "verification_failed" | "unknown_agent" | "not_verifiable"
87
- /** The unique ID of the identified agent */
88
+ result: "verified" | "verification_failed" | "not_verifiable" | "not_identified"
89
+ /** The unique ID of the identified agent. */
88
90
  agent_id?: string
89
- /** The name of the identified agent (e.g. "Googlebot") */
91
+ /** The name of the agent (e.g. `"Claude-User"`) (if identified). */
90
92
  agent_token?: string
91
- /** The documentation URL for the identified agent */
93
+ /** The documentation URL of the agent (if identified). */
92
94
  agent_url?: string
93
- /** The type of the identified agent (e.g. "AI Agent", "Search Engine Crawler") */
95
+ /** The type of agent (e.g. `"AI Assistant"`) (if identified). */
94
96
  agent_type_name?: string
95
- /** The company behind the identified agent (e.g. "Google") */
97
+ /** The company operating the agent (e.g. `"Anthropic"`) (if identified). */
96
98
  operator_name?: string
99
+ /** Whether the identified agent is disallowed by robots.txt from accessing the `request_path`. */
100
+ is_disallowed_by_robots_txt?: boolean
101
+ /** The autonomous system number associated with the request's IPv4 address. */
102
+ asn?: number
103
+ /** The operator of the recognized autonomous system associated with the request's IPv4 address. */
104
+ asn_operator?: string
105
+ /**
106
+ * The type of the recognized autonomous system associated with the request's IPv4 address:
107
+ * - "isp"
108
+ * - "hosting"
109
+ * - "business"
110
+ * - "education"
111
+ * - "government"
112
+ */
113
+ asn_type?: "isp" | "hosting" | "business" | "education" | "government"
114
+ /** An integer from `0` to `99` indicating the strength of heuristic evidence that the request was made by an automated client. Higher scores indicate stronger detected automation signals. A score of `0` means that no automation signals were detected, not that the client is certainly human. */
115
+ automation_score?: number
97
116
  }
98
117
 
99
118
  /**