ask-slack 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 +34 -8
- data/lib/ask/slack/context.rb +3 -2
- data/lib/ask/slack/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: fa494a5831a8a5e57491f43b8c7d6677db0e8acfc4c47b9fe208ab36a2f8183e
|
|
4
|
+
data.tar.gz: 5bff6d53dfd1efed345fc260162d0ca1f93ace445a090a058e8271b8434ecc09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 219ed3857e6e18d585cceccda1a7511a5fa0d49c16f9ebcd3af3058679f562c41f02987111c8b8074c7d2e1acf9550419ca5a144f75393d0aa9715b99a6b53ec
|
|
7
|
+
data.tar.gz: 73897b358c923fa37d892104196fe00d37297073507be9f13afe67b445b4e613a8e22d02d57a7fc0cf77aae2f13bfa79adcaff28f24d71a05435de288eded5b2
|
data/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# ask-slack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/ask-slack)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Slack service context for AI agents in the ask-rb ecosystem. It provides an
|
|
6
|
+
authenticated Slack Web API client built on slack-ruby-client, metadata
|
|
7
|
+
constants for system prompts, and a structured error guide for common Slack
|
|
8
|
+
API issues.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ Provides:
|
|
|
13
13
|
gem "ask-slack"
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Quick Start
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
19
|
require "ask-slack"
|
|
@@ -26,7 +26,8 @@ client.users_list
|
|
|
26
26
|
|
|
27
27
|
## Authentication
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
`Ask::Slack.client` resolves a token via `Ask::Auth.resolve(:slack_token)`.
|
|
30
|
+
Set your Slack Bot User OAuth Token in the environment:
|
|
30
31
|
|
|
31
32
|
```bash
|
|
32
33
|
export SLACK_TOKEN=xoxb-your-bot-token-here
|
|
@@ -38,9 +39,34 @@ Or add it to `~/.ask/credentials.yml`:
|
|
|
38
39
|
slack_token: xoxb-your-bot-token-here
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
Credentials can also come from Rails credentials, a database, or an OAuth
|
|
43
|
+
provider, depending on your `ask-auth` configuration. Create a Slack app at
|
|
44
|
+
[api.slack.com/apps](https://api.slack.com/apps) to get a bot token.
|
|
45
|
+
|
|
46
|
+
## Key entry points
|
|
47
|
+
|
|
48
|
+
- `Ask::Slack.client` - an authenticated `Slack::Web::Client`. It is wrapped
|
|
49
|
+
in a proxy that converts auth errors (`NotAuthed`, `InvalidAuth`, and
|
|
50
|
+
related) into `Ask::Auth::InvalidCredential` and retries transient network
|
|
51
|
+
failures with exponential backoff.
|
|
52
|
+
- `Ask::Slack::Errors` - structured error knowledge for agents: guidance by
|
|
53
|
+
error string, HTTP status code descriptions, and exception class mapping.
|
|
54
|
+
- `Ask::Slack::DESCRIPTION`, `DOCS_URL`, `AUTH_NAME`, `GEM_NAME`,
|
|
55
|
+
`GEM_VERSION`, and `QUICK_START` - metadata constants for system prompts.
|
|
56
|
+
|
|
57
|
+
Use `conversations_list`, not `channels_list`. `channels_list` was removed in
|
|
58
|
+
modern versions of slack-ruby-client.
|
|
59
|
+
|
|
60
|
+
## Full documentation
|
|
61
|
+
|
|
62
|
+
The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
|
|
63
|
+
[Services: Slack](https://ask-rb.github.io/ask-docs/services/slack) covers
|
|
64
|
+
ask-slack in depth, including the client, error guide, and constants.
|
|
65
|
+
API reference: https://ask-rb.github.io/ask-docs/reference/api.
|
|
66
|
+
|
|
41
67
|
## Development
|
|
42
68
|
|
|
43
|
-
```
|
|
69
|
+
```
|
|
44
70
|
bundle install
|
|
45
71
|
bundle exec rake test
|
|
46
72
|
```
|
data/lib/ask/slack/context.rb
CHANGED
|
@@ -8,8 +8,9 @@ module Ask
|
|
|
8
8
|
# Base URL for Slack Web API methods.
|
|
9
9
|
DOCS_URL = "https://api.slack.com/methods"
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
|
|
11
|
+
# Slack no longer serves an OpenAPI spec at a stable URL.
|
|
12
|
+
# The API methods reference is at DOCS_URL instead.
|
|
13
|
+
# OPENAPI_URL was removed because the spec redirects to a 404 page.
|
|
13
14
|
|
|
14
15
|
# Credential name used with Ask::Auth.resolve.
|
|
15
16
|
AUTH_NAME = :slack_token
|
data/lib/ask/slack/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-slack
|
|
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: slack-ruby-client
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
174
174
|
- !ruby/object:Gem::Version
|
|
175
175
|
version: '0'
|
|
176
176
|
requirements: []
|
|
177
|
-
rubygems_version: 4.0.
|
|
177
|
+
rubygems_version: 4.0.18
|
|
178
178
|
specification_version: 4
|
|
179
179
|
summary: Slack service context for the ask-rb ecosystem
|
|
180
180
|
test_files: []
|