@pinet/slack-bridge 0.1.0 → 0.2.0

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.
Files changed (47) hide show
  1. package/README.md +86 -34
  2. package/dist/broker/adapters/slack.d.ts +19 -1
  3. package/dist/broker/adapters/slack.js +111 -22
  4. package/dist/broker/client.d.ts +2 -1
  5. package/dist/broker/client.js +1 -0
  6. package/dist/broker/socket-server.js +18 -0
  7. package/dist/deploy-manifest.d.ts +5 -0
  8. package/dist/deploy-manifest.js +30 -1
  9. package/dist/follower-runtime.js +5 -1
  10. package/dist/helpers.d.ts +14 -0
  11. package/dist/helpers.js +45 -21
  12. package/dist/index.js +60 -0
  13. package/dist/pinet-commands.d.ts +6 -1
  14. package/dist/pinet-commands.js +166 -1
  15. package/dist/pinet-mesh-ops.d.ts +11 -0
  16. package/dist/pinet-mesh-ops.js +17 -0
  17. package/dist/pinet-tools.d.ts +47 -0
  18. package/dist/pinet-tools.js +496 -36
  19. package/dist/prompts/broker/tmux.md +2 -2
  20. package/dist/reaction-triggers.d.ts +1 -0
  21. package/dist/reaction-triggers.js +26 -15
  22. package/dist/runtime-agent-context.js +19 -0
  23. package/dist/runtime-mode.js +7 -1
  24. package/dist/single-player-runtime.js +22 -26
  25. package/dist/slack-access.d.ts +11 -0
  26. package/dist/slack-access.js +30 -0
  27. package/dist/slack-agents-command.d.ts +19 -0
  28. package/dist/slack-agents-command.js +90 -0
  29. package/dist/slack-export.d.ts +1 -1
  30. package/dist/slack-export.js +6 -4
  31. package/dist/slack-file-access.d.ts +34 -0
  32. package/dist/slack-file-access.js +209 -0
  33. package/dist/slack-message-context.d.ts +0 -1
  34. package/dist/slack-message-context.js +1 -6
  35. package/dist/slack-pinet-runtime-adapter.d.ts +4 -2
  36. package/dist/slack-pinet-runtime-adapter.js +12 -0
  37. package/dist/slack-tools.d.ts +6 -0
  38. package/dist/slack-tools.js +290 -36
  39. package/dist/slack-upload.d.ts +13 -1
  40. package/dist/slack-upload.js +29 -2
  41. package/dist/stale-slack-messages.d.ts +12 -0
  42. package/dist/stale-slack-messages.js +29 -0
  43. package/dist/subtree-broker-runtime.d.ts +109 -0
  44. package/dist/subtree-broker-runtime.js +558 -0
  45. package/manifest.yaml +9 -0
  46. package/package.json +16 -9
  47. package/skills/slack-bridge/SKILL.md +60 -1
@@ -50,7 +50,7 @@ should use the colon form.
50
50
 
51
51
  - Thread/channel messaging: `post_channel`, `read`, `read_channel`, `export`
52
52
  - Lightweight acknowledgement: `react`
53
- - Files/snippets: `upload`
53
+ - Files/snippets: `upload`, `file`; `slack_send.files` and `post_channel.files` for text plus attachments in one message
54
54
  - Time-based follow-up: `schedule`
55
55
  - People/timing: `presence`
56
56
  - Durable channel affordances: `pin`, `bookmark`
@@ -144,6 +144,65 @@ snippets:
144
144
  ]
145
145
  ````
146
146
 
147
+ ## File workflows
148
+
149
+ For outbound local files, attach them to the message-posting surface you are
150
+ already using. Use `slack_send.files` for owned assistant-thread replies, and
151
+ `slack` action `post_channel` with `args.files` for explicit channel/thread
152
+ posts. Both use the same file object shape and send text plus files in one Slack
153
+ message:
154
+
155
+ ```json
156
+ {
157
+ "text": "Here is the report and the raw capture.",
158
+ "thread_ts": "1712345678.000100",
159
+ "files": [
160
+ { "path": "./out/report.pdf", "title": "Report" },
161
+ { "path": "/tmp/capture.bin", "filename": "capture.bin" }
162
+ ]
163
+ }
164
+ ```
165
+
166
+ ```json
167
+ {
168
+ "action": "post_channel",
169
+ "args": {
170
+ "channel": "#deployments",
171
+ "text": "Here is the deploy evidence.",
172
+ "files": [{ "path": "/tmp/evidence.png", "filename": "evidence.png" }]
173
+ }
174
+ }
175
+ ```
176
+
177
+ Local path guardrails still apply: paths must resolve inside the current working
178
+ directory or the system temp directory. Binary files are supported.
179
+
180
+ For inbound Slack-hosted files, `slack` action `read` downloads attached files to
181
+ the local temp cache by default and returns safe descriptors alongside the
182
+ message metadata. Use `args.download_files=false` when you only need message text
183
+ and file metadata.
184
+
185
+ Use the explicit `file` action when you have a specific file ID to retry,
186
+ validate, or fetch outside a normal read flow:
187
+
188
+ ```json
189
+ {
190
+ "action": "file",
191
+ "args": {
192
+ "op": "download",
193
+ "file_id": "F0123456789",
194
+ "thread_ts": "1712345678.000100",
195
+ "message_ts": "1712345678.000200"
196
+ }
197
+ }
198
+ ```
199
+
200
+ Both read-time downloads and the explicit file action download Slack-hosted user
201
+ content into the local temp cache and return safe descriptors: file ID,
202
+ filename/type, local temp path, size, SHA-256, cache directory, expiry, and
203
+ residual risk notes. They must not print private Slack download URLs or raw file
204
+ contents.
205
+
147
206
  ## Modal patterns
148
207
 
149
208
  Modal actions require a fresh Slack `trigger_id` from a recent interaction. The