ask-sentry 0.1.2 → 0.1.4

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: c459eb70d05be7c610124e9f19253867d23cb9e729b3bd091d710d95e6483a19
4
- data.tar.gz: abcc7d0d55dcdda71dbb36217236e3f9f0055466d57be5d8b35f564db2f22c71
3
+ metadata.gz: 652d533cd09abc7578f38914e793fbdb8c093cb5d3a2caca7295b836a169dc99
4
+ data.tar.gz: b3e4c7574c0a01b67d8011a619aa16e378399959fe9b2d2eba1c0c44ddd851e9
5
5
  SHA512:
6
- metadata.gz: 9dfde1d5ea4914ac95c0cf839c3a1d97a6be838d9df6977f3c811d12b4a38abb8fff42f7b47af9677afd25f6d6f9725144d066e0f673429c8e607720939e764d
7
- data.tar.gz: 54d3a356e91e1f3ffb19fdf05b7d0840edd60ce86007cc5b2036adff7c7cdcd092b1a56e9e2c386d8ec5f5c43e6e54ff542a5087f019d4de11c7df7d77b40357
6
+ metadata.gz: 489b6081c56145a76f0dac437abee66655d268ce0fe5d169a0322025042fed782e32c3837d152f5ff3909c66d5da55fc72b22c03ac5eaa8ed9e77366a54bf401
7
+ data.tar.gz: 1ac0aa367772b509bfc7af8f55c59c622877f3a9160a90f8290f271e33a98135be312f660e24d854a52e3ff628af95f973c50bb92100999635312c7215868ef5
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # ask-sentry
2
2
 
3
- Sentry — error tracking via the Sentry API
3
+ [![Gem Version](https://badge.fury.io/rb/ask-sentry.svg)](https://badge.fury.io/rb/ask-sentry)
4
+
5
+ Sentry service context for AI agents in the ask-rb ecosystem. It provides an
6
+ authenticated HTTP client for the Sentry REST API, metadata constants for
7
+ system prompts, and a structured error guide for common Sentry API issues.
4
8
 
5
9
  ## Installation
6
10
 
@@ -8,16 +12,66 @@ Sentry — error tracking via the Sentry API
8
12
  gem "ask-sentry"
9
13
  ```
10
14
 
11
- ## Usage
15
+ ## Quick Start
12
16
 
13
17
  ```ruby
18
+ require "ask-sentry"
19
+
20
+ # Recent issues for an organization and project
21
+ issues = Ask::Sentry.recent_errors(organization: "myorg", project: "myapp", limit: 10)
22
+
23
+ # Events for a specific issue
24
+ events = Ask::Sentry.issue_events(12345, limit: 10)
25
+
26
+ # Or use the raw client (base URL: https://sentry.io/api/0/)
14
27
  client = Ask::Sentry.client
15
- # ... use the client according to its API
28
+ client.get("projects/myorg/myapp/issues/")
16
29
  ```
17
30
 
18
- ## Development
31
+ ## Authentication
32
+
33
+ `Ask::Sentry.client` resolves a token via `Ask::Auth.resolve(:sentry_token)`.
34
+ Set it in your environment:
19
35
 
20
36
  ```bash
37
+ export SENTRY_TOKEN=your_token_here
38
+ ```
39
+
40
+ Or add it to `~/.ask/credentials.yml`:
41
+
42
+ ```yaml
43
+ sentry_token: your_token_here
44
+ ```
45
+
46
+ Credentials can also come from Rails credentials, a database, or an OAuth
47
+ provider, depending on your `ask-auth` configuration. The token is sent as a
48
+ Bearer token. Create one at
49
+ [sentry.io/settings/account/api/auth-tokens](https://sentry.io/settings/account/api/auth-tokens/).
50
+
51
+ ## Key entry points
52
+
53
+ - `Ask::Sentry.client` - an authenticated Faraday client with base URL
54
+ `https://sentry.io/api/0/`. It is wrapped in a proxy that converts HTTP 401
55
+ responses into `Ask::Auth::InvalidCredential`.
56
+ - `Ask::Sentry.recent_errors(organization:, project:, limit: 10)` - fetch
57
+ recent issues for a project.
58
+ - `Ask::Sentry.issue_events(issue_id, limit: 10)` - fetch events for an issue.
59
+ - `Ask::Sentry::Errors` - structured error knowledge for agents: guidance by
60
+ exception class, HTTP status descriptions, and rate limit info.
61
+ - `Ask::Sentry::DESCRIPTION`, `DOCS_URL`, `AUTH_NAME`, `GEM_NAME`, and
62
+ `QUICK_START` - metadata constants for system prompts.
63
+
64
+ ## Full documentation
65
+
66
+ The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
67
+ [Services: Sentry](https://ask-rb.github.io/ask-docs/services/sentry) covers
68
+ ask-sentry in depth, including the client, error guide, and constants.
69
+ API reference: https://ask-rb.github.io/ask-docs/reference/api.
70
+
71
+ ## Development
72
+
73
+ ```
74
+ bundle install
21
75
  bundle exec rake test
22
76
  ```
23
77
 
@@ -14,7 +14,7 @@ module Ask
14
14
  # - When rate-limited, the API returns 429 Too Many Requests.
15
15
  # - The agent should wait for the Retry-After header and retry.
16
16
  RATE_LIMIT = {
17
- description: "Sentry rate limits vary by plan. See https://docs.sentry.io/api/rate-limiting/",
17
+ description: "Sentry rate limits vary by plan. See https://docs.sentry.io/api/ratelimits/",
18
18
  error_status: 429,
19
19
  action: "Wait for the Retry-After header duration, then retry the request."
20
20
  }.freeze
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Sentry
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-sentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.1'
18
+ version: 0.11.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0.1'
25
+ version: 0.11.3
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ask-auth
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '0.1'
32
+ version: 0.3.2
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '0.1'
39
+ version: 0.3.2
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: faraday
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 4.0.3
176
+ rubygems_version: 4.0.18
177
177
  specification_version: 4
178
178
  summary: Sentry — error tracking via the Sentry API
179
179
  test_files: []