ask-github 0.1.3 → 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 +4 -4
- data/README.md +33 -36
- data/lib/ask/github/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ae01ffdb62eea1500c1e9544915704dbcc34d18f27124a82f3a3ee59c93e92b
|
|
4
|
+
data.tar.gz: 03a155f16c3e4409ea7383b7b071f0c55d7bd729ec553c70d8e92020e9b72d8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d40f074e53dd7d58e15dce513200921f23ac344fd2f1b505efb36a9d871b407993920dcfe39cf6ee925b7b67465aba444c24a156722bc2226614cd7e241df817
|
|
7
|
+
data.tar.gz: 03210c203eff7072f09d372ec8cf536cdf06ea013eb5f479728b35d08a23f1b96bff56a884eeee8a5d244a4409db41553955732479b2026262f09bc5605915c1
|
data/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# ask-github
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/ask-github)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
GitHub service context for AI agents in the ask-rb ecosystem. It provides an
|
|
6
|
+
authenticated Octokit client for the GitHub REST API, metadata constants for
|
|
7
|
+
system prompts, and a structured error guide for common GitHub API issues.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
6
10
|
|
|
7
11
|
```ruby
|
|
8
12
|
gem "ask-github"
|
|
@@ -10,8 +14,6 @@ gem "ask-github"
|
|
|
10
14
|
|
|
11
15
|
## Quick Start
|
|
12
16
|
|
|
13
|
-
### Get an authenticated client
|
|
14
|
-
|
|
15
17
|
```ruby
|
|
16
18
|
require "ask-github"
|
|
17
19
|
|
|
@@ -23,47 +25,42 @@ client.contents("owner/repo", path: "Gemfile")
|
|
|
23
25
|
client.search_issues("query")
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Authentication
|
|
29
|
-
|
|
30
|
-
The client resolves a GitHub token via `Ask::Auth.resolve(:github_token)`. Tokens can be provided through any configured auth provider:
|
|
31
|
-
|
|
32
|
-
1. **Environment variable:** `GITHUB_TOKEN`
|
|
33
|
-
2. **Credentials file:** `~/.ask/credentials.yml`
|
|
34
|
-
3. **Rails credentials:** `Rails.application.credentials.github_token`
|
|
35
|
-
4. **OAuth / Database:** Custom providers
|
|
28
|
+
## Authentication
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
`Ask::GitHub.client` resolves a token via `Ask::Auth.resolve(:github_token)`.
|
|
31
|
+
Set it in your environment:
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
```bash
|
|
34
|
+
export GITHUB_TOKEN=your_token_here
|
|
35
|
+
```
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
Or add it to `~/.ask/credentials.yml`:
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| `Ask::GitHub::DOCS_URL` | https://docs.github.com/en/rest |
|
|
47
|
-
| `Ask::GitHub::OPENAPI_URL` | https://api.github.com/openapi.json |
|
|
48
|
-
| `Ask::GitHub::AUTH_NAME` | `:github_token` |
|
|
49
|
-
| `Ask::GitHub::GEM_NAME` | `"octokit"` |
|
|
50
|
-
| `Ask::GitHub::GEM_VERSION` | `"~> 9.0"` |
|
|
51
|
-
| `Ask::GitHub::QUICK_START` | Copy-paste Ruby code snippet |
|
|
39
|
+
```yaml
|
|
40
|
+
github_token: your_token_here
|
|
41
|
+
```
|
|
52
42
|
|
|
53
|
-
|
|
43
|
+
Credentials can also come from Rails credentials, a database, or an OAuth
|
|
44
|
+
provider, depending on your `ask-auth` configuration. Generate a token at
|
|
45
|
+
[github.com/settings/tokens](https://github.com/settings/tokens) with the
|
|
46
|
+
`repo` and `read:org` scopes.
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+
## Key entry points
|
|
56
49
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
- `Ask::GitHub.client` - an authenticated `Octokit::Client` (auto-paginating,
|
|
51
|
+
`per_page: 100`, retry middleware). It is wrapped in a proxy that converts
|
|
52
|
+
`Octokit::Unauthorized` into `Ask::Auth::InvalidCredential`.
|
|
53
|
+
- `Ask::GitHub::Errors` - structured error knowledge for agents: guidance by
|
|
54
|
+
exception class, HTTP status code descriptions, and rate limit info.
|
|
55
|
+
- `Ask::GitHub::DESCRIPTION`, `DOCS_URL`, `AUTH_NAME`, `GEM_NAME`,
|
|
56
|
+
`GEM_VERSION`, and `QUICK_START` - metadata constants for system prompts.
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
# => "Not Found — Resource does not exist or is private."
|
|
58
|
+
## Full documentation
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
|
|
61
|
+
[Services: GitHub](https://ask-rb.github.io/ask-docs/services/github) covers
|
|
62
|
+
ask-github in depth, including the client, error guide, and constants.
|
|
63
|
+
API reference: https://ask-rb.github.io/ask-docs/reference/api.
|
|
67
64
|
|
|
68
65
|
## Development
|
|
69
66
|
|
data/lib/ask/github/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-github
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 0.3.2
|
|
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:
|
|
25
|
+
version: 0.3.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: octokit
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
160
160
|
- !ruby/object:Gem::Version
|
|
161
161
|
version: '0'
|
|
162
162
|
requirements: []
|
|
163
|
-
rubygems_version: 4.0.
|
|
163
|
+
rubygems_version: 4.0.18
|
|
164
164
|
specification_version: 4
|
|
165
165
|
summary: GitHub service context for the ask-rb ecosystem
|
|
166
166
|
test_files: []
|