atris 2.2.1 → 2.2.2

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.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: drive
3
3
  description: Google Drive integration via AtrisOS API. Browse, search, read, upload files and work with Google Sheets. Use when user asks about Drive, files, docs, sheets, or spreadsheets.
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  tags:
6
6
  - drive
7
7
  - backend
@@ -108,6 +108,14 @@ All requests require: `-H "Authorization: Bearer $TOKEN"`
108
108
  TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
109
109
  ```
110
110
 
111
+ ### List Shared Drives
112
+ ```bash
113
+ curl -s "https://api.atris.ai/api/integrations/google-drive/shared-drives" \
114
+ -H "Authorization: Bearer $TOKEN"
115
+ ```
116
+
117
+ Returns all shared/team drives the user has access to with `id` and `name`.
118
+
111
119
  ### List Files
112
120
  ```bash
113
121
  curl -s "https://api.atris.ai/api/integrations/google-drive/files?page_size=20" \
@@ -120,6 +128,14 @@ curl -s "https://api.atris.ai/api/integrations/google-drive/files?folder_id=FOLD
120
128
  -H "Authorization: Bearer $TOKEN"
121
129
  ```
122
130
 
131
+ **List files in a shared drive:**
132
+ ```bash
133
+ curl -s "https://api.atris.ai/api/integrations/google-drive/files?shared_drive_id=DRIVE_ID&page_size=20" \
134
+ -H "Authorization: Bearer $TOKEN"
135
+ ```
136
+
137
+ **NOTE:** All file operations (list, search, get, download, export) automatically include shared drive files. Use `shared_drive_id` only to scope results to a specific shared drive.
138
+
123
139
  ### Search Files
124
140
  ```bash
125
141
  curl -s "https://api.atris.ai/api/integrations/google-drive/search?q=quarterly+report&page_size=20" \
@@ -266,6 +282,17 @@ curl -s -X POST "https://api.atris.ai/api/integrations/google-drive/sheets/{spre
266
282
  4. **Show user what will be appended, get approval**
267
283
  5. Append: `POST /google-drive/sheets/{id}/append`
268
284
 
285
+ ### "Browse a shared drive"
286
+ 1. Run bootstrap
287
+ 2. List shared drives: `GET /google-drive/shared-drives`
288
+ 3. Display drive names and IDs
289
+ 4. List files in chosen drive: `GET /google-drive/files?shared_drive_id=DRIVE_ID`
290
+
291
+ ### "Find a file across all drives"
292
+ 1. Run bootstrap
293
+ 2. Search: `GET /google-drive/search?q=QUERY` (automatically searches My Drive + all shared drives)
294
+ 3. Display results
295
+
269
296
  ### "Upload a file to Drive"
270
297
  1. Run bootstrap
271
298
  2. Read the local file content
@@ -309,7 +336,10 @@ TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
309
336
  # Check connection
310
337
  curl -s "https://api.atris.ai/api/integrations/google-drive/status" -H "Authorization: Bearer $TOKEN"
311
338
 
312
- # List files
339
+ # List shared drives
340
+ curl -s "https://api.atris.ai/api/integrations/google-drive/shared-drives" -H "Authorization: Bearer $TOKEN"
341
+
342
+ # List files (includes shared drive files)
313
343
  curl -s "https://api.atris.ai/api/integrations/google-drive/files" -H "Authorization: Bearer $TOKEN"
314
344
 
315
345
  # Search files
@@ -0,0 +1,320 @@
1
+ ---
2
+ name: slack
3
+ description: Slack integration via AtrisOS API. Read messages, send as yourself, search conversations, manage DMs. Use when user asks about Slack, messages, channels, or team communication.
4
+ version: 1.0.0
5
+ tags:
6
+ - slack
7
+ - backend
8
+ - messaging
9
+ ---
10
+
11
+ # Slack Agent
12
+
13
+ > Drop this in `~/.claude/skills/slack/SKILL.md` and Claude Code becomes your Slack assistant.
14
+
15
+ ## Bootstrap (ALWAYS Run First)
16
+
17
+ Before any Slack operation, run this bootstrap to ensure everything is set up:
18
+
19
+ ```bash
20
+ #!/bin/bash
21
+ set -e
22
+
23
+ # 1. Check if atris CLI is installed
24
+ if ! command -v atris &> /dev/null; then
25
+ echo "Installing atris CLI..."
26
+ npm install -g atris
27
+ fi
28
+
29
+ # 2. Check if logged in to AtrisOS
30
+ if [ ! -f ~/.atris/credentials.json ]; then
31
+ echo "Not logged in to AtrisOS."
32
+ echo ""
33
+ echo "Option 1 (interactive): Run 'atris login' and follow prompts"
34
+ echo "Option 2 (non-interactive): Get token from https://atris.ai/auth/cli"
35
+ echo " Then run: atris login --token YOUR_TOKEN"
36
+ echo ""
37
+ exit 1
38
+ fi
39
+
40
+ # 3. Extract token
41
+ if command -v node &> /dev/null; then
42
+ TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
43
+ elif command -v python3 &> /dev/null; then
44
+ TOKEN=$(python3 -c "import json,os; print(json.load(open(os.path.expanduser('~/.atris/credentials.json')))['token'])")
45
+ elif command -v jq &> /dev/null; then
46
+ TOKEN=$(jq -r '.token' ~/.atris/credentials.json)
47
+ else
48
+ echo "Error: Need node, python3, or jq to read credentials"
49
+ exit 1
50
+ fi
51
+
52
+ # 4. Check Slack connection status
53
+ STATUS=$(curl -s "https://api.atris.ai/api/integrations/slack/status" \
54
+ -H "Authorization: Bearer $TOKEN")
55
+
56
+ if echo "$STATUS" | grep -q "Token expired\|Not authenticated"; then
57
+ echo "Token expired. Please re-authenticate:"
58
+ echo " Run: atris login --force"
59
+ exit 1
60
+ fi
61
+
62
+ if command -v node &> /dev/null; then
63
+ CONNECTED=$(node -e "try{console.log(JSON.parse('$STATUS').connected||false)}catch(e){console.log(false)}")
64
+ elif command -v python3 &> /dev/null; then
65
+ CONNECTED=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin).get('connected', False))")
66
+ else
67
+ CONNECTED=$(echo "$STATUS" | jq -r '.connected // false')
68
+ fi
69
+
70
+ if [ "$CONNECTED" != "true" ] && [ "$CONNECTED" != "True" ]; then
71
+ echo "Slack not connected. Getting authorization URL..."
72
+ AUTH=$(curl -s -X POST "https://api.atris.ai/api/integrations/slack/start" \
73
+ -H "Authorization: Bearer $TOKEN" \
74
+ -H "Content-Type: application/json" \
75
+ -d '{"mode":"personal"}')
76
+
77
+ if command -v node &> /dev/null; then
78
+ URL=$(node -e "try{console.log(JSON.parse('$AUTH').auth_url||'')}catch(e){console.log('')}")
79
+ elif command -v python3 &> /dev/null; then
80
+ URL=$(echo "$AUTH" | python3 -c "import sys,json; print(json.load(sys.stdin).get('auth_url', ''))")
81
+ else
82
+ URL=$(echo "$AUTH" | jq -r '.auth_url // empty')
83
+ fi
84
+
85
+ echo ""
86
+ echo "Open this URL to connect your Slack:"
87
+ echo "$URL"
88
+ echo ""
89
+ echo "After authorizing, run your command again."
90
+ exit 0
91
+ fi
92
+
93
+ echo "Ready. Slack is connected."
94
+ export ATRIS_TOKEN="$TOKEN"
95
+ ```
96
+
97
+ ---
98
+
99
+ ## API Reference
100
+
101
+ Base: `https://api.atris.ai/api/integrations`
102
+
103
+ All requests require: `-H "Authorization: Bearer $TOKEN"`
104
+
105
+ ### Get Token (after bootstrap)
106
+ ```bash
107
+ TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Personal Endpoints (send/read as yourself)
113
+
114
+ These use your personal Slack token. Messages appear as YOU, not a bot.
115
+
116
+ ### List Your Channels & DMs
117
+ ```bash
118
+ curl -s "https://api.atris.ai/api/integrations/slack/me/channels" \
119
+ -H "Authorization: Bearer $TOKEN"
120
+ ```
121
+
122
+ ### List Your DMs
123
+ ```bash
124
+ curl -s "https://api.atris.ai/api/integrations/slack/me/dms" \
125
+ -H "Authorization: Bearer $TOKEN"
126
+ ```
127
+
128
+ ### Read Messages from a Channel or DM
129
+ ```bash
130
+ curl -s "https://api.atris.ai/api/integrations/slack/me/messages/{channel_id}?limit=20" \
131
+ -H "Authorization: Bearer $TOKEN"
132
+ ```
133
+
134
+ ### Send Message as Yourself
135
+ ```bash
136
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/me/send" \
137
+ -H "Authorization: Bearer $TOKEN" \
138
+ -H "Content-Type: application/json" \
139
+ -d '{
140
+ "channel": "C0123CHANNEL",
141
+ "text": "Hey team, here is the update..."
142
+ }'
143
+ ```
144
+
145
+ **Reply in a thread:**
146
+ ```bash
147
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/me/send" \
148
+ -H "Authorization: Bearer $TOKEN" \
149
+ -H "Content-Type: application/json" \
150
+ -d '{
151
+ "channel": "C0123CHANNEL",
152
+ "text": "Following up on this...",
153
+ "thread_ts": "1234567890.123456"
154
+ }'
155
+ ```
156
+
157
+ ### DM Someone as Yourself
158
+ ```bash
159
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/me/dm" \
160
+ -H "Authorization: Bearer $TOKEN" \
161
+ -H "Content-Type: application/json" \
162
+ -d '{
163
+ "slack_user_id": "U0123USER",
164
+ "text": "Hey, quick question about the project..."
165
+ }'
166
+ ```
167
+
168
+ ### Search Messages
169
+ ```bash
170
+ curl -s "https://api.atris.ai/api/integrations/slack/me/search?q=quarterly+report&count=20" \
171
+ -H "Authorization: Bearer $TOKEN"
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Workspace Endpoints
177
+
178
+ ### List Channels (bot view)
179
+ ```bash
180
+ curl -s "https://api.atris.ai/api/integrations/slack/channels" \
181
+ -H "Authorization: Bearer $TOKEN"
182
+ ```
183
+
184
+ ### List Users
185
+ ```bash
186
+ curl -s "https://api.atris.ai/api/integrations/slack/users" \
187
+ -H "Authorization: Bearer $TOKEN"
188
+ ```
189
+
190
+ ### Send as Bot
191
+ ```bash
192
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/test-send" \
193
+ -H "Authorization: Bearer $TOKEN" \
194
+ -H "Content-Type: application/json" \
195
+ -d '{
196
+ "channel": "C0123CHANNEL",
197
+ "message": "Hello from Atris!"
198
+ }'
199
+ ```
200
+
201
+ ### Check Connection Status
202
+ ```bash
203
+ curl -s "https://api.atris.ai/api/integrations/slack/status" \
204
+ -H "Authorization: Bearer $TOKEN"
205
+ ```
206
+
207
+ ### Disconnect Slack
208
+ ```bash
209
+ curl -s -X DELETE "https://api.atris.ai/api/integrations/slack" \
210
+ -H "Authorization: Bearer $TOKEN"
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Workflows
216
+
217
+ ### "Check my Slack messages"
218
+ 1. Run bootstrap
219
+ 2. List DMs: `GET /slack/me/dms`
220
+ 3. For each open DM, read recent messages: `GET /slack/me/messages/{channel_id}?limit=5`
221
+ 4. Resolve user names: `GET /slack/users`
222
+ 5. Display: who messaged, what they said, when
223
+
224
+ ### "Send a message to someone"
225
+ 1. Run bootstrap
226
+ 2. Find the user: `GET /slack/users` (search by name/email)
227
+ 3. **Show user the draft for approval**
228
+ 4. Send DM: `POST /slack/me/dm` with `{user_id, text}`
229
+ 5. Confirm: "Message sent!"
230
+
231
+ ### "Reply in a channel"
232
+ 1. Run bootstrap
233
+ 2. List channels: `GET /slack/me/channels`
234
+ 3. Find the right channel
235
+ 4. Read recent messages: `GET /slack/me/messages/{channel_id}`
236
+ 5. **Show user the draft for approval**
237
+ 6. Send: `POST /slack/me/send` with `{channel, text}`
238
+
239
+ ### "Find a conversation about X"
240
+ 1. Run bootstrap
241
+ 2. Search: `GET /slack/me/search?q=X`
242
+ 3. Display matching messages with channel, sender, permalink
243
+
244
+ ### "What did [person] say to me?"
245
+ 1. Run bootstrap
246
+ 2. List users: `GET /slack/users` (find user ID)
247
+ 3. List DMs: `GET /slack/me/dms` (find DM channel with that user)
248
+ 4. Read messages: `GET /slack/me/messages/{channel_id}`
249
+ 5. Display conversation
250
+
251
+ ---
252
+
253
+ ## Important Notes
254
+
255
+ - **Personal endpoints** (`/slack/me/*`) send messages as YOU, not a bot
256
+ - **Bot endpoints** (`/slack/channels`, `/slack/test-send`) use the bot token
257
+ - **Always get approval** before sending messages on behalf of the user
258
+ - **Thread replies**: include `thread_ts` to reply in a thread instead of creating a new message
259
+ - **User IDs**: Slack uses IDs like `U0123ABC`. Get them from `/slack/users` endpoint
260
+ - **Channel IDs**: Use IDs like `C0123ABC`. Get them from `/slack/me/channels`
261
+
262
+ ---
263
+
264
+ ## Error Handling
265
+
266
+ | Error | Meaning | Solution |
267
+ |-------|---------|----------|
268
+ | `Token expired` | AtrisOS session expired | Run `atris login` |
269
+ | `Slack not connected` | OAuth not completed | Re-run bootstrap |
270
+ | `Personal Slack not connected` | No user token | Re-connect Slack (needs re-auth for personal access) |
271
+ | `401 Unauthorized` | Invalid/expired token | Run `atris login` |
272
+ | `channel_not_found` | Invalid channel ID | Use `/slack/me/channels` to find correct ID |
273
+ | `not_in_channel` | User not in channel | Join the channel first |
274
+
275
+ ---
276
+
277
+ ## Security Model
278
+
279
+ 1. **Local token** (`~/.atris/credentials.json`): Your AtrisOS auth token, stored locally.
280
+ 2. **Slack credentials**: Bot token and user token stored **server-side** in AtrisOS encrypted vault.
281
+ 3. **Two token types**: Bot token (xoxb-) for workspace operations, User token (xoxp-) for personal operations.
282
+ 4. **Access control**: AtrisOS API enforces that you can only access your own Slack.
283
+ 5. **HTTPS only**: All API communication encrypted in transit.
284
+
285
+ ---
286
+
287
+ ## Quick Reference
288
+
289
+ ```bash
290
+ # Setup (one time)
291
+ npm install -g atris && atris login
292
+
293
+ # Get token
294
+ TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
295
+
296
+ # Check connection
297
+ curl -s "https://api.atris.ai/api/integrations/slack/status" -H "Authorization: Bearer $TOKEN"
298
+
299
+ # List your DMs
300
+ curl -s "https://api.atris.ai/api/integrations/slack/me/dms" -H "Authorization: Bearer $TOKEN"
301
+
302
+ # Read messages
303
+ curl -s "https://api.atris.ai/api/integrations/slack/me/messages/CHANNEL_ID" -H "Authorization: Bearer $TOKEN"
304
+
305
+ # Send as yourself
306
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/me/send" \
307
+ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
308
+ -d '{"channel":"C0123","text":"Hello!"}'
309
+
310
+ # DM someone as yourself
311
+ curl -s -X POST "https://api.atris.ai/api/integrations/slack/me/dm" \
312
+ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
313
+ -d '{"user_id":"U0123","text":"Hey!"}'
314
+
315
+ # Search messages
316
+ curl -s "https://api.atris.ai/api/integrations/slack/me/search?q=project+update" -H "Authorization: Bearer $TOKEN"
317
+
318
+ # List workspace users
319
+ curl -s "https://api.atris.ai/api/integrations/slack/users" -H "Authorization: Bearer $TOKEN"
320
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atris",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "atrisDev (atris dev) - CLI for AI coding agents. Works with Claude Code, Cursor, Windsurf. Make any codebase AI-navigable.",
5
5
  "main": "bin/atris.js",
6
6
  "bin": {