@pinet/slack-bridge 0.1.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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +570 -0
  3. package/dist/activity-log.d.ts +62 -0
  4. package/dist/activity-log.js +293 -0
  5. package/dist/agent-completion-runtime.d.ts +17 -0
  6. package/dist/agent-completion-runtime.js +26 -0
  7. package/dist/agent-event-runtime.d.ts +13 -0
  8. package/dist/agent-event-runtime.js +27 -0
  9. package/dist/agent-prompt-guidance.d.ts +22 -0
  10. package/dist/agent-prompt-guidance.js +46 -0
  11. package/dist/broker/adapters/slack.d.ts +74 -0
  12. package/dist/broker/adapters/slack.js +563 -0
  13. package/dist/broker/adapters/types.d.ts +1 -0
  14. package/dist/broker/adapters/types.js +1 -0
  15. package/dist/broker/agent-messaging.d.ts +1 -0
  16. package/dist/broker/agent-messaging.js +1 -0
  17. package/dist/broker/auth.d.ts +1 -0
  18. package/dist/broker/auth.js +1 -0
  19. package/dist/broker/client.d.ts +167 -0
  20. package/dist/broker/client.js +624 -0
  21. package/dist/broker/control-plane-dashboard.d.ts +98 -0
  22. package/dist/broker/control-plane-dashboard.js +213 -0
  23. package/dist/broker/ghost-reaper.d.ts +49 -0
  24. package/dist/broker/ghost-reaper.js +209 -0
  25. package/dist/broker/index.d.ts +36 -0
  26. package/dist/broker/index.js +90 -0
  27. package/dist/broker/leader.d.ts +1 -0
  28. package/dist/broker/leader.js +1 -0
  29. package/dist/broker/maintenance.d.ts +1 -0
  30. package/dist/broker/maintenance.js +1 -0
  31. package/dist/broker/message-send.d.ts +1 -0
  32. package/dist/broker/message-send.js +1 -0
  33. package/dist/broker/paths.d.ts +1 -0
  34. package/dist/broker/paths.js +1 -0
  35. package/dist/broker/raw-tcp-loopback.d.ts +1 -0
  36. package/dist/broker/raw-tcp-loopback.js +1 -0
  37. package/dist/broker/router.d.ts +1 -0
  38. package/dist/broker/router.js +1 -0
  39. package/dist/broker/schema.d.ts +9 -0
  40. package/dist/broker/schema.js +63 -0
  41. package/dist/broker/socket-server.d.ts +120 -0
  42. package/dist/broker/socket-server.js +1087 -0
  43. package/dist/broker/types.d.ts +1 -0
  44. package/dist/broker/types.js +1 -0
  45. package/dist/broker-delivery.d.ts +10 -0
  46. package/dist/broker-delivery.js +26 -0
  47. package/dist/broker-inbound-persistence.d.ts +11 -0
  48. package/dist/broker-inbound-persistence.js +22 -0
  49. package/dist/broker-prompt-loader.d.ts +34 -0
  50. package/dist/broker-prompt-loader.js +185 -0
  51. package/dist/broker-runtime-access.d.ts +14 -0
  52. package/dist/broker-runtime-access.js +20 -0
  53. package/dist/broker-runtime.d.ts +100 -0
  54. package/dist/broker-runtime.js +533 -0
  55. package/dist/broker-thread-owner-hints.d.ts +10 -0
  56. package/dist/broker-thread-owner-hints.js +14 -0
  57. package/dist/canvases.d.ts +80 -0
  58. package/dist/canvases.js +221 -0
  59. package/dist/command-registration-runtime.d.ts +9 -0
  60. package/dist/command-registration-runtime.js +9 -0
  61. package/dist/core-tool-guardrails.d.ts +24 -0
  62. package/dist/core-tool-guardrails.js +66 -0
  63. package/dist/deploy-manifest.d.ts +27 -0
  64. package/dist/deploy-manifest.js +197 -0
  65. package/dist/follower-delivery.d.ts +16 -0
  66. package/dist/follower-delivery.js +70 -0
  67. package/dist/follower-runtime.d.ts +61 -0
  68. package/dist/follower-runtime.js +350 -0
  69. package/dist/git-metadata.d.ts +35 -0
  70. package/dist/git-metadata.js +88 -0
  71. package/dist/guardrails.d.ts +69 -0
  72. package/dist/guardrails.js +283 -0
  73. package/dist/helpers.d.ts +550 -0
  74. package/dist/helpers.js +2711 -0
  75. package/dist/home-tab.d.ts +27 -0
  76. package/dist/home-tab.js +242 -0
  77. package/dist/imessage-tools.d.ts +33 -0
  78. package/dist/imessage-tools.js +96 -0
  79. package/dist/inbox-drain-runtime.d.ts +30 -0
  80. package/dist/inbox-drain-runtime.js +71 -0
  81. package/dist/index.d.ts +2 -0
  82. package/dist/index.js +1330 -0
  83. package/dist/persisted-runtime-state.d.ts +52 -0
  84. package/dist/persisted-runtime-state.js +98 -0
  85. package/dist/pinet-activity-formatting.d.ts +20 -0
  86. package/dist/pinet-activity-formatting.js +43 -0
  87. package/dist/pinet-agent-status.d.ts +36 -0
  88. package/dist/pinet-agent-status.js +48 -0
  89. package/dist/pinet-commands.d.ts +70 -0
  90. package/dist/pinet-commands.js +402 -0
  91. package/dist/pinet-confirmation-replies.d.ts +7 -0
  92. package/dist/pinet-confirmation-replies.js +30 -0
  93. package/dist/pinet-control-plane-dashboard.d.ts +34 -0
  94. package/dist/pinet-control-plane-dashboard.js +86 -0
  95. package/dist/pinet-home-tabs.d.ts +36 -0
  96. package/dist/pinet-home-tabs.js +101 -0
  97. package/dist/pinet-maintenance-delivery.d.ts +22 -0
  98. package/dist/pinet-maintenance-delivery.js +45 -0
  99. package/dist/pinet-mesh-ops.d.ts +97 -0
  100. package/dist/pinet-mesh-ops.js +266 -0
  101. package/dist/pinet-registration-gate.d.ts +14 -0
  102. package/dist/pinet-registration-gate.js +42 -0
  103. package/dist/pinet-remote-control-acks.d.ts +16 -0
  104. package/dist/pinet-remote-control-acks.js +46 -0
  105. package/dist/pinet-remote-control.d.ts +17 -0
  106. package/dist/pinet-remote-control.js +74 -0
  107. package/dist/pinet-runtime-composition.d.ts +27 -0
  108. package/dist/pinet-runtime-composition.js +20 -0
  109. package/dist/pinet-tools.d.ts +67 -0
  110. package/dist/pinet-tools.js +1211 -0
  111. package/dist/prompts/broker/default.md +41 -0
  112. package/dist/prompts/broker/tmux.md +49 -0
  113. package/dist/ralph-loop.d.ts +76 -0
  114. package/dist/ralph-loop.js +524 -0
  115. package/dist/reaction-triggers.d.ts +25 -0
  116. package/dist/reaction-triggers.js +171 -0
  117. package/dist/repo-tool-guardrails.d.ts +20 -0
  118. package/dist/repo-tool-guardrails.js +81 -0
  119. package/dist/runtime-agent-context.d.ts +93 -0
  120. package/dist/runtime-agent-context.js +302 -0
  121. package/dist/runtime-mode.d.ts +10 -0
  122. package/dist/runtime-mode.js +39 -0
  123. package/dist/scheduled-wakeups.d.ts +1 -0
  124. package/dist/scheduled-wakeups.js +1 -0
  125. package/dist/session-ui-runtime.d.ts +20 -0
  126. package/dist/session-ui-runtime.js +163 -0
  127. package/dist/single-player-runtime.d.ts +71 -0
  128. package/dist/single-player-runtime.js +436 -0
  129. package/dist/skins/cosmere.json +1571 -0
  130. package/dist/skins/foundation.json +1304 -0
  131. package/dist/slack-access.d.ts +186 -0
  132. package/dist/slack-access.js +462 -0
  133. package/dist/slack-api.d.ts +2 -0
  134. package/dist/slack-api.js +1 -0
  135. package/dist/slack-block-kit.d.ts +36 -0
  136. package/dist/slack-block-kit.js +242 -0
  137. package/dist/slack-export.d.ts +31 -0
  138. package/dist/slack-export.js +206 -0
  139. package/dist/slack-message-context.d.ts +15 -0
  140. package/dist/slack-message-context.js +207 -0
  141. package/dist/slack-modals.d.ts +13 -0
  142. package/dist/slack-modals.js +79 -0
  143. package/dist/slack-pinet-runtime-adapter.d.ts +16 -0
  144. package/dist/slack-pinet-runtime-adapter.js +72 -0
  145. package/dist/slack-presence.d.ts +36 -0
  146. package/dist/slack-presence.js +89 -0
  147. package/dist/slack-request-runtime.d.ts +8 -0
  148. package/dist/slack-request-runtime.js +19 -0
  149. package/dist/slack-runtime-access.d.ts +28 -0
  150. package/dist/slack-runtime-access.js +107 -0
  151. package/dist/slack-scope-diagnostics.d.ts +31 -0
  152. package/dist/slack-scope-diagnostics.js +235 -0
  153. package/dist/slack-socket-dedup.d.ts +7 -0
  154. package/dist/slack-socket-dedup.js +135 -0
  155. package/dist/slack-thread-status.d.ts +41 -0
  156. package/dist/slack-thread-status.js +156 -0
  157. package/dist/slack-tool-policy-runtime.d.ts +36 -0
  158. package/dist/slack-tool-policy-runtime.js +96 -0
  159. package/dist/slack-tools.d.ts +52 -0
  160. package/dist/slack-tools.js +2688 -0
  161. package/dist/slack-turn-guardrails.d.ts +19 -0
  162. package/dist/slack-turn-guardrails.js +36 -0
  163. package/dist/slack-upload.d.ts +49 -0
  164. package/dist/slack-upload.js +224 -0
  165. package/dist/task-assignments.d.ts +45 -0
  166. package/dist/task-assignments.js +527 -0
  167. package/dist/thread-confirmations.d.ts +22 -0
  168. package/dist/thread-confirmations.js +139 -0
  169. package/dist/tool-registration-runtime.d.ts +13 -0
  170. package/dist/tool-registration-runtime.js +13 -0
  171. package/dist/ttl-cache.d.ts +47 -0
  172. package/dist/ttl-cache.js +105 -0
  173. package/manifest.yaml +57 -0
  174. package/package.json +60 -0
  175. package/skills/pinet-skin-creator/SKILL.md +109 -0
  176. package/skills/pinet-skin-creator/references/descriptor-format.md +99 -0
  177. package/skills/pinet-skin-creator/references/safety-checklist.md +56 -0
  178. package/skills/pinet-skin-creator/templates/pinet-skin-descriptor.json +77 -0
  179. package/skills/slack-bridge/SKILL.md +360 -0
@@ -0,0 +1,360 @@
1
+ ---
2
+ name: slack-bridge
3
+ description: Warm reference for the @pinet/slack-bridge Slack dispatcher. Use when building Slack Block Kit messages, modals, canvases, uploads, schedules, pins/bookmarks, or when you need per-action usage patterns beyond slack action=help schemas.
4
+ ---
5
+
6
+ # Slack Bridge Warm Reference
7
+
8
+ Use this skill when the compact `slack` dispatcher schema is not enough. The
9
+ hot path stays small: `slack_inbox` receives work, `slack_send` replies in the
10
+ current assistant thread, and `slack` handles the cold action surface.
11
+
12
+ ## Dispatcher contract
13
+
14
+ Call the dispatcher with an action and action-specific args:
15
+
16
+ ```json
17
+ {
18
+ "action": "help",
19
+ "args": { "topic": "canvas_update" }
20
+ }
21
+ ```
22
+
23
+ Every dispatcher response has this envelope in tool `details`, while the default
24
+ visible `content` is compact CLI-style text:
25
+
26
+ ```json
27
+ {
28
+ "status": "succeeded",
29
+ "data": {},
30
+ "errors": [],
31
+ "warnings": []
32
+ }
33
+ ```
34
+
35
+ Pass `args.format="json"` when you need the envelope in visible content, and
36
+ `args.full=true` when you need full structured details instead of compact
37
+ defaults. If an action already owns a `format` argument, such as `export`, use
38
+ `args.response_format="json"` for response presentation.
39
+
40
+ On failure, inspect `errors[0].class`, `retryable`, and `hint`. Prefer
41
+ `slack({"action":"help","args":{"topic":"..."}})` before guessing an action
42
+ schema.
43
+
44
+ Guardrails match cold actions as `slack:<action>` (for example
45
+ `slack:upload`, `slack:delete`, `slack:canvas_update`). Legacy
46
+ `slack_<action>` patterns may be accepted during migration, but new configs
47
+ should use the colon form.
48
+
49
+ ## Action quick map
50
+
51
+ - Thread/channel messaging: `post_channel`, `read`, `read_channel`, `export`
52
+ - Lightweight acknowledgement: `react`
53
+ - Files/snippets: `upload`
54
+ - Time-based follow-up: `schedule`
55
+ - People/timing: `presence`
56
+ - Durable channel affordances: `pin`, `bookmark`
57
+ - Channel/project setup: `create_channel`, `project_create`
58
+ - Canvases: `canvas_comments_read`, `canvas_create`, `canvas_update`
59
+ - Modals: `modal_open`, `modal_push`, `modal_update`
60
+ - Guardrail approvals: `confirm_action`
61
+ - Destructive cleanup: `delete`
62
+
63
+ ## Block Kit patterns
64
+
65
+ No Block Kit builder tool is registered. Build the JSON inline and pass it to
66
+ `slack_send` or `slack` action `post_channel` as `blocks`.
67
+
68
+ ### Status report
69
+
70
+ ```json
71
+ [
72
+ {
73
+ "type": "header",
74
+ "text": { "type": "plain_text", "text": "Deploy complete" }
75
+ },
76
+ {
77
+ "type": "section",
78
+ "fields": [
79
+ { "type": "mrkdwn", "text": "*Branch*\n`main`" },
80
+ { "type": "mrkdwn", "text": "*Checks*\n✅ lint/typecheck/test" }
81
+ ]
82
+ },
83
+ {
84
+ "type": "context",
85
+ "elements": [{ "type": "mrkdwn", "text": "PR #123 is ready for review." }]
86
+ }
87
+ ]
88
+ ```
89
+
90
+ Use with:
91
+
92
+ ```json
93
+ {
94
+ "text": "Deploy complete — branch main, checks passed.",
95
+ "thread_ts": "1712345678.000100",
96
+ "blocks": []
97
+ }
98
+ ```
99
+
100
+ ### Action buttons
101
+
102
+ Stable `action_id` values make incoming `slack_block_action` metadata easy to
103
+ route. Put machine-readable context in `value` as plain text or JSON.
104
+
105
+ ```json
106
+ [
107
+ {
108
+ "type": "section",
109
+ "text": { "type": "mrkdwn", "text": "Approve the production deploy?" }
110
+ },
111
+ {
112
+ "type": "actions",
113
+ "elements": [
114
+ {
115
+ "type": "button",
116
+ "text": { "type": "plain_text", "text": "Approve" },
117
+ "style": "primary",
118
+ "action_id": "deploy.approve",
119
+ "value": "{\"deployId\":\"2026-04-24-main\",\"decision\":\"approve\"}"
120
+ },
121
+ {
122
+ "type": "button",
123
+ "text": { "type": "plain_text", "text": "Reject" },
124
+ "style": "danger",
125
+ "action_id": "deploy.reject",
126
+ "value": "{\"deployId\":\"2026-04-24-main\",\"decision\":\"reject\"}"
127
+ }
128
+ ]
129
+ }
130
+ ]
131
+ ```
132
+
133
+ ### Diff/code snippet
134
+
135
+ For long diffs or logs, prefer `upload` over huge inline blocks. For short
136
+ snippets:
137
+
138
+ ````json
139
+ [
140
+ {
141
+ "type": "section",
142
+ "text": { "type": "mrkdwn", "text": "```ts\nconst ok = true;\n```" }
143
+ }
144
+ ]
145
+ ````
146
+
147
+ ## Modal patterns
148
+
149
+ Modal actions require a fresh Slack `trigger_id` from a recent interaction. The
150
+ window is short (about three seconds), so do not spend an extra human turn after
151
+ receiving a trigger; call `modal_open` or `modal_push` immediately.
152
+
153
+ ### Confirmation modal
154
+
155
+ ```json
156
+ {
157
+ "type": "modal",
158
+ "callback_id": "deploy.confirm",
159
+ "title": { "type": "plain_text", "text": "Deploy approval" },
160
+ "submit": { "type": "plain_text", "text": "Approve" },
161
+ "close": { "type": "plain_text", "text": "Cancel" },
162
+ "private_metadata": "{\"workflow\":\"deploy\"}",
163
+ "blocks": [
164
+ {
165
+ "type": "section",
166
+ "text": { "type": "mrkdwn", "text": "Ready to deploy `main` to production." }
167
+ },
168
+ {
169
+ "type": "input",
170
+ "block_id": "confirm_phrase",
171
+ "element": {
172
+ "type": "plain_text_input",
173
+ "action_id": "confirm_phrase",
174
+ "placeholder": { "type": "plain_text", "text": "Type CONFIRM" }
175
+ },
176
+ "label": { "type": "plain_text", "text": "Confirmation" }
177
+ }
178
+ ]
179
+ }
180
+ ```
181
+
182
+ Open it:
183
+
184
+ ```json
185
+ {
186
+ "action": "modal_open",
187
+ "args": {
188
+ "trigger_id": "fresh-trigger-id",
189
+ "thread_ts": "1712345678.000100",
190
+ "view": { "type": "modal", "blocks": [] }
191
+ }
192
+ }
193
+ ```
194
+
195
+ When `thread_ts` is provided, slack-bridge embeds routing metadata in
196
+ `private_metadata` so modal submissions return to the original thread.
197
+
198
+ ### Simple form input
199
+
200
+ ```json
201
+ {
202
+ "type": "modal",
203
+ "callback_id": "incident.update",
204
+ "title": { "type": "plain_text", "text": "Incident update" },
205
+ "submit": { "type": "plain_text", "text": "Submit" },
206
+ "close": { "type": "plain_text", "text": "Cancel" },
207
+ "blocks": [
208
+ {
209
+ "type": "input",
210
+ "block_id": "summary",
211
+ "element": {
212
+ "type": "plain_text_input",
213
+ "action_id": "summary",
214
+ "multiline": true
215
+ },
216
+ "label": { "type": "plain_text", "text": "Summary" }
217
+ }
218
+ ]
219
+ }
220
+ ```
221
+
222
+ ## Canvas patterns
223
+
224
+ Create a standalone canvas:
225
+
226
+ ```json
227
+ {
228
+ "action": "canvas_create",
229
+ "args": { "title": "Launch plan", "markdown": "# Launch plan\n\n## Goals" }
230
+ }
231
+ ```
232
+
233
+ Create/update a channel canvas:
234
+
235
+ ```json
236
+ {
237
+ "action": "canvas_create",
238
+ "args": { "kind": "channel", "channel": "#proj-alpha", "title": "Alpha RFC" }
239
+ }
240
+ ```
241
+
242
+ If Slack returns `canvas_tab_creation_failed`, `canvas_create` creates a
243
+ standalone fallback attached to the channel, attempts to add a channel bookmark,
244
+ and returns the fallback `canvas_id`. Use that `canvas_id` for later
245
+ `canvas_update` calls if Slack still does not expose a channel canvas ID.
246
+
247
+ Append to a canvas:
248
+
249
+ ```json
250
+ {
251
+ "action": "canvas_update",
252
+ "args": { "canvas_id": "F0123", "mode": "append", "markdown": "\n## Update\nDone." }
253
+ }
254
+ ```
255
+
256
+ Replace a section by lookup text:
257
+
258
+ ```json
259
+ {
260
+ "action": "canvas_update",
261
+ "args": {
262
+ "canvas_id": "F0123",
263
+ "mode": "replace",
264
+ "section_contains_text": "## Rollout",
265
+ "section_type": "h2",
266
+ "markdown": "## Rollout\nPhase 1 complete."
267
+ }
268
+ }
269
+ ```
270
+
271
+ Read comments only for verified canvases:
272
+
273
+ ```json
274
+ {
275
+ "action": "canvas_comments_read",
276
+ "args": { "canvas_id": "F0123", "limit": 20 }
277
+ }
278
+ ```
279
+
280
+ ## Upload, schedule, pin, bookmark examples
281
+
282
+ Upload inline content:
283
+
284
+ ```json
285
+ {
286
+ "action": "upload",
287
+ "args": {
288
+ "content": "test log contents",
289
+ "filename": "test.log",
290
+ "filetype": "text",
291
+ "thread_ts": "1712345678.000100"
292
+ }
293
+ }
294
+ ```
295
+
296
+ Upload local paths only when the file is inside the current working directory
297
+ or the system temp directory. Otherwise read the file content explicitly and use
298
+ `content`.
299
+
300
+ Schedule a follow-up:
301
+
302
+ ```json
303
+ {
304
+ "action": "schedule",
305
+ "args": { "text": "Checking back in.", "thread_ts": "1712345678.000100", "delay": "1h" }
306
+ }
307
+ ```
308
+
309
+ Pin a decision:
310
+
311
+ ```json
312
+ {
313
+ "action": "pin",
314
+ "args": { "action": "pin", "message_ts": "1712345678.000200", "thread_ts": "1712345678.000100" }
315
+ }
316
+ ```
317
+
318
+ Add a bookmark:
319
+
320
+ ```json
321
+ {
322
+ "action": "bookmark",
323
+ "args": {
324
+ "action": "add",
325
+ "channel": "#proj-alpha",
326
+ "title": "Runbook",
327
+ "url": "https://example.com/runbook"
328
+ }
329
+ }
330
+ ```
331
+
332
+ ## Confirmation and destructive actions
333
+
334
+ If guardrails require confirmation, request it in the same Slack thread. The
335
+ `action` value must be the exact action string required by the guarded tool;
336
+ the safest flow is to copy it from the `requires confirmation for action ...`
337
+ error and retry the guarded call unchanged after approval:
338
+
339
+ ```json
340
+ {
341
+ "action": "confirm_action",
342
+ "args": {
343
+ "thread_ts": "1712345678.000100",
344
+ "tool": "slack:delete",
345
+ "action": "channel=#proj-alpha | thread_ts=1712345678.000100 | ts=1712345678.000200 | thread=false"
346
+ }
347
+ }
348
+ ```
349
+
350
+ Wait for `slack_inbox` to deliver the approval before retrying the guarded
351
+ action. Every destructive delete also needs `confirm: true` after verifying the
352
+ target; whole-thread deletion additionally needs `thread: true` and only works
353
+ when every message in the target thread was posted by the current bot:
354
+
355
+ ```json
356
+ {
357
+ "action": "delete",
358
+ "args": { "ts": "1712345678.000200", "thread_ts": "1712345678.000100", "confirm": true }
359
+ }
360
+ ```