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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95f6517b92978600f204143403d9026a8f978373ee1f0babd775bd7195411fab
4
- data.tar.gz: 6ea3486cb67fc6472e76a5f03fbad55188d1c02d184d83fdfb259c4ec2c42ad6
3
+ metadata.gz: fa494a5831a8a5e57491f43b8c7d6677db0e8acfc4c47b9fe208ab36a2f8183e
4
+ data.tar.gz: 5bff6d53dfd1efed345fc260162d0ca1f93ace445a090a058e8271b8434ecc09
5
5
  SHA512:
6
- metadata.gz: e98e6690a85dca3381c12e283aebc07fe4f34113d8061a4d2feee31ca89a5c583154fd90a925ed13ed7240bd11a230194ff77fbb52c5e01f74b4601935cd866b
7
- data.tar.gz: f0486bf299dc409d0cdf42fd30329d8969b6c380e51592b7687630b1e1e6820afc6fd37eab178f041a38031c95eb954069871a64bbd60654997b4e8361d2bbd0
6
+ metadata.gz: 219ed3857e6e18d585cceccda1a7511a5fa0d49c16f9ebcd3af3058679f562c41f02987111c8b8074c7d2e1acf9550419ca5a144f75393d0aa9715b99a6b53ec
7
+ data.tar.gz: 73897b358c923fa37d892104196fe00d37297073507be9f13afe67b445b4e613a8e22d02d57a7fc0cf77aae2f13bfa79adcaff28f24d71a05435de288eded5b2
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # ask-slack
2
2
 
3
- Slack service context for the ask-rb ecosystem.
3
+ [![Gem Version](https://badge.fury.io/rb/ask-slack.svg)](https://badge.fury.io/rb/ask-slack)
4
4
 
5
- Provides:
6
- - `Ask::Slack.client` — authenticated Slack Web API client
7
- - `Ask::Slack::DESCRIPTION` context metadata for the system prompt
8
- - `Ask::Slack::Errors` — structured error knowledge for agents
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
- ## Usage
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
- Set your Slack Bot User OAuth Token:
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
- ```bash
69
+ ```
44
70
  bundle install
45
71
  bundle exec rake test
46
72
  ```
@@ -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
- # URL for the Slack OpenAPI specification.
12
- OPENAPI_URL = "https://api.slack.com/specs/openapi"
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Slack
5
- VERSION = '0.1.3'
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-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
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: '0.1'
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: '0.1'
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.3
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: []