spyglasses 1.1.1 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3043466d02dc043b433ab0338acff68428e9081a7aa594738e8b94b70af0cf55
4
- data.tar.gz: cc4ee63632a3e008e79571a4d5d51d83c712afd07e1c831c55abdb4ff8166885
3
+ metadata.gz: 6552b09f0d7a6cd216481c941bfe12b15cd2651659655c8e52e7188db27c5746
4
+ data.tar.gz: 83d50c1a9cfc7e82ad16225859469b82c167aaeaf5c854f06182023291193ad6
5
5
  SHA512:
6
- metadata.gz: 68372ce5cf59f20997858695ed7961eb39bb99919eadc7786656c10d200cca485f63bdf7910c8d5dde5b4d4731568bd8a524faa91eb5e8909ca8ee7a5863bf64
7
- data.tar.gz: dd2c7c97230f37934cf7f8e998c7dd6f19799898ad10e487222a0a11f456e586ce8ec7e5cea02b547964a60d6d3eb91ba80db374d490b7e013939501070f70ca
6
+ metadata.gz: 1ca75554f8d9bcab4d48bfa3260ad97e04cd4f49968fd639d19417a8e1b2767287075e2e6bbb2d4085e6ebb92c3e19d1c9e891cdb84a42e09c8939be540cca0b
7
+ data.tar.gz: 3a316a2d6794c98a5176f095a56ab6e9401d9fcdba6757cf4b0bab330913b3349b955abb5e38209a02ed246d7166729ef23f2171f493b95b127e85cb386be57f
data/CHANGELOG.md CHANGED
@@ -5,7 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.1.0] - 2024-12-29
8
+ ## [1.1.3] - 2025-06-26
9
+
10
+ ### Fixed
11
+ - Broken links to the github repo
12
+ - Standardized README
13
+
14
+ ## [1.1.2] - 2025-06-25
15
+
16
+ ### Fixed
17
+ - Fixed optional field handling in JSON payload to prevent validation errors
18
+ - Optional fields (`request_body`, `referrer`) are now omitted when nil instead of sending null
19
+ - Resolves TypeScript API validation issues with null vs undefined distinction
20
+ - Enhanced collector API compatibility for both bot and AI referrer events
21
+
22
+ ## [1.1.0] - 2025-06-25
9
23
 
10
24
  ### Fixed
11
25
  - **BREAKING**: Fixed API payload format to match TypeScript collector endpoint
@@ -20,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
34
  - Enhanced middleware IP extraction with better fallback handling
21
35
  - Improved request query string handling to ensure non-nil values
22
36
 
23
- ## [1.0.1] - 2024-12-28
37
+ ## [1.0.1] - 2025-06-24
24
38
 
25
39
  ### Added
26
40
  - Comprehensive Ruby documentation in main docs site
@@ -32,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
32
46
  - Documentation formatting and code examples
33
47
  - Installation instructions for various Ruby frameworks
34
48
 
35
- ## [1.0.0] - 2024-12-28
49
+ ## [1.0.0] - 2025-06-24
36
50
 
37
51
  ### Added
38
52
  - Initial release of Spyglasses Ruby gem
@@ -55,6 +69,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
69
  - **Performance**: Pattern caching, background logging, minimal overhead
56
70
  - **Framework Support**: Universal Rack middleware design
57
71
 
58
- [Unreleased]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.0.1...HEAD
59
- [1.0.1]: https://github.com/spyglasses/spyglasses-ruby/compare/v1.0.0...v1.0.1
60
- [1.0.0]: https://github.com/spyglasses/spyglasses-ruby/releases/tag/v1.0.0
72
+ [Unreleased]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.2...HEAD
73
+ [1.1.3]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.0...v1.1.3
74
+ [1.1.2]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.1.0...v1.1.2
75
+ [1.1.0]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.0.1...v1.1.0
76
+ [1.0.1]: https://github.com/orchestra-code/spyglasses-ruby/compare/v1.0.0...v1.0.1
77
+ [1.0.0]: https://github.com/orchestra-code/spyglasses-ruby/releases/tag/v1.0.0
data/DEVELOPMENT.md CHANGED
@@ -24,7 +24,7 @@ The gem is structured into several key components:
24
24
  ## Development Setup
25
25
 
26
26
  ```bash
27
- git clone https://github.com/spyglasses/spyglasses-ruby.git
27
+ git clone https://github.com/orchestra-code/spyglasses-ruby.git
28
28
  cd spyglasses-ruby
29
29
  bin/setup
30
30
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spyglasses (1.1.1)
4
+ spyglasses (1.1.3)
5
5
  json (>= 2.0)
6
6
  rack (>= 2.0)
7
7
 
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Spyglasses Ruby Gem
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/spyglasses.svg)](https://badge.fury.io/rb/spyglasses)
4
- [![Ruby](https://github.com/spyglasses/spyglasses-ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/spyglasses/spyglasses-ruby/actions/workflows/ruby.yml)
4
+ [![Ruby](https://github.com/orchestra-code/spyglasses-ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/orchestra-code/spyglasses-ruby/actions/workflows/ruby.yml)
5
5
 
6
- AI Agent Detection and Management for Ruby web applications. Spyglasses provides comprehensive AI agent detection and management capabilities for Ruby web applications, including Rails, Sinatra, and other Rack-based frameworks.
6
+ [AI SEO](https://www.spyglasses.io), AI Agent detection, AI model trainer blocking, and analytics for Ruby web applications. Spyglasses provides comprehensive AI agent detection and management capabilities for Ruby web applications, including Rails, Sinatra, and other Rack-based frameworks.
7
7
 
8
8
  ## Features
9
9
 
@@ -322,7 +322,7 @@ The Spyglasses middleware is designed for high-performance applications:
322
322
 
323
323
  ## Contributing
324
324
 
325
- Bug reports and pull requests are welcome on GitHub at https://github.com/spyglasses/spyglasses-ruby.
325
+ Bug reports and pull requests are welcome on GitHub at https://github.com/orchestra-code/spyglasses-ruby.
326
326
 
327
327
  ## License
328
328
 
@@ -332,4 +332,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
332
332
 
333
333
  - 📧 Email: support@spyglasses.io
334
334
  - 📖 Documentation: https://www.spyglasses.io/docs/platforms/ruby
335
- - 🐛 Issues: https://github.com/spyglasses/spyglasses-ruby/issues
335
+ - 🐛 Issues: https://github.com/orchestra-code/spyglasses-ruby/issues
@@ -184,22 +184,30 @@ module Spyglasses
184
184
  end
185
185
 
186
186
  def to_h
187
- {
187
+ payload = {
188
188
  url: @url,
189
189
  user_agent: @user_agent,
190
+ # Ensure required string fields are never nil - use empty string as default
190
191
  ip_address: @ip_address || '',
191
192
  request_method: @request_method,
192
193
  request_path: @request_path,
194
+ # request_query is required as string in API schema
193
195
  request_query: @request_query || '',
194
- request_body: @request_body,
195
- referrer: @referrer,
196
196
  response_status: @response_status,
197
197
  response_time_ms: @response_time_ms,
198
198
  headers: @headers,
199
199
  timestamp: @timestamp,
200
+ # Convert snake_case to camelCase to match TypeScript API
200
201
  platformType: @platform_type,
201
202
  metadata: @metadata
202
203
  }
204
+
205
+ # Only include optional fields if they have values (not nil)
206
+ # This prevents sending null which fails TypeScript validation
207
+ payload[:request_body] = @request_body if @request_body
208
+ payload[:referrer] = @referrer if @referrer
209
+
210
+ payload
203
211
  end
204
212
 
205
213
  def to_json(*args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spyglasses
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.3'
5
5
  end
data/spyglasses.gemspec CHANGED
@@ -13,9 +13,9 @@ Gem::Specification.new do |spec|
13
13
  spec.required_ruby_version = '>= 2.7.0'
14
14
 
15
15
  spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = 'https://github.com/spyglasses/spyglasses-ruby'
16
+ spec.metadata['source_code_uri'] = 'https://github.com/orchestra-code/spyglasses-ruby'
17
17
  spec.metadata['documentation_uri'] = 'https://www.spyglasses.io/docs/platforms/ruby'
18
- spec.metadata['changelog_uri'] = 'https://github.com/spyglasses/spyglasses-ruby/blob/main/CHANGELOG.md'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/orchestra-code/spyglasses-ruby/blob/main/CHANGELOG.md'
19
19
 
20
20
  # Specify which files should be added to the gem when it is released.
21
21
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyglasses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orchestra AI, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-25 00:00:00.000000000 Z
11
+ date: 2025-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -179,9 +179,9 @@ licenses:
179
179
  - MIT
180
180
  metadata:
181
181
  homepage_uri: https://www.spyglasses.io
182
- source_code_uri: https://github.com/spyglasses/spyglasses-ruby
182
+ source_code_uri: https://github.com/orchestra-code/spyglasses-ruby
183
183
  documentation_uri: https://www.spyglasses.io/docs/platforms/ruby
184
- changelog_uri: https://github.com/spyglasses/spyglasses-ruby/blob/main/CHANGELOG.md
184
+ changelog_uri: https://github.com/orchestra-code/spyglasses-ruby/blob/main/CHANGELOG.md
185
185
  post_install_message:
186
186
  rdoc_options: []
187
187
  require_paths: