@desplega.ai/slack-mock 0.3.0 → 0.4.1
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.
- package/README.md +22 -3
- package/dist/cli.js +2 -2
- package/dist/{index-fhjq5qns.js → index-86bw4z6k.js} +2278 -2056
- package/dist/index-xs37gskt.js +156 -0
- package/dist/index.js +2 -2
- package/dist/screenshot.js +1 -1
- package/dist/server.d.ts +11 -4
- package/dist/store.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/render/index.ts +269 -44
- package/src/screenshot.ts +116 -1
- package/src/server.ts +29 -6
- package/src/store.ts +2 -0
- package/src/types.ts +1 -0
- package/src/web-api.ts +17 -2
- package/dist/index-v2hesj4s.js +0 -52
package/README.md
CHANGED
|
@@ -42,6 +42,23 @@ open http://127.0.0.1:4040/c/general # live view: new messages arrive
|
|
|
42
42
|
bun src/cli.ts screenshot http://127.0.0.1:4040/c/general --out general.png
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## UI
|
|
46
|
+
|
|
47
|
+
Use the avatar and name chip to choose who posts from every composer.
|
|
48
|
+
The browser remembers your choice across channels and threads.
|
|
49
|
+
Open `/c/support?as=taras` to select Taras. The page removes `as` from the URL after selection.
|
|
50
|
+
Public workspaces show the chip after presenter sign-in.
|
|
51
|
+
Optional user status text appears beside names in the users table and the chip's user list.
|
|
52
|
+
Each message offers reaction and thread icons, including messages without replies.
|
|
53
|
+
The thread icon opens the thread without focusing the composer.
|
|
54
|
+
Icons stay visible on phones and touch screens. Desktop shows them on hover or keyboard focus.
|
|
55
|
+
Choose an emoji from the picker beside the message, or select an existing reaction to add or remove your own.
|
|
56
|
+
Reactions use the identity in the chip and require presenter sign-in in public workspaces.
|
|
57
|
+
Below 700px, the sidebar becomes a top bar with a channel switcher.
|
|
58
|
+
Threads fill the phone width. The composer follows the visible viewport and includes padding for the iOS home bar.
|
|
59
|
+
Capture the phone layout with `bun test test/phone-ui.test.ts` (requires Chrome).
|
|
60
|
+
The PNG is saved to `test/artifacts/phone-support-thread.png` at 390 x 844.
|
|
61
|
+
|
|
45
62
|
## In tests
|
|
46
63
|
|
|
47
64
|
```ts
|
|
@@ -64,7 +81,7 @@ const reply = await slack.waitForMessage({ channel: "general", thread_ts: ask.ts
|
|
|
64
81
|
|
|
65
82
|
What tests can do:
|
|
66
83
|
|
|
67
|
-
| humans do | `postMessage` (text, thread, files), `editMessage`, `deleteMessage`, `addReaction`, `slashCommand`, `clickButton`, `submitView`, `startAssistantThread`, `changeAssistantContext`, `addUser`, `addChannel`, `openDm`, `invite` |
|
|
84
|
+
| humans do | `postMessage` (text, thread, files), `editMessage`, `deleteMessage`, `addReaction`, `removeReaction`, `slashCommand`, `clickButton`, `submitView`, `startAssistantThread`, `changeAssistantContext`, `addUser`, `addChannel`, `openDm`, `invite` |
|
|
68
85
|
|---|---|
|
|
69
86
|
| observe | `messages`, `thread`, `ephemeralMessages`, `findMessages`, `waitForMessage`, `apiCalls`, `waitForApiCall`, `deliveries` (every envelope and its ack), `assistantThread` |
|
|
70
87
|
| break things | `injectFault({ method, error, httpStatus, retryAfterSec, extra })`, `disconnectSockets("refresh_requested")`, options `ackTimeoutMs`, `maxRetries`, `triggerIdTtlMs`, `echoBotMessages`, `subscribedEvents` |
|
|
@@ -116,7 +133,9 @@ Stitch the PNGs into a GIF with ffmpeg if you want motion; the mock only produce
|
|
|
116
133
|
`member_joined_channel`, `assistant_thread_started`,
|
|
117
134
|
`assistant_thread_context_changed`. The bot's own messages are echoed back
|
|
118
135
|
like Slack does (Bolt's `ignoreSelf` drops them).
|
|
119
|
-
- Web API: auth, chat (post, update, delete, ephemeral, permalink, streams
|
|
136
|
+
- Web API: auth, chat (post, update, delete, ephemeral, permalink, streams,
|
|
137
|
+
`markdown_text` kept as the message text, `markdown_text_conflict` next to
|
|
138
|
+
`text` or `blocks`),
|
|
120
139
|
conversations (list, info, create, join, invite, archive, history, replies,
|
|
121
140
|
members, open), users (info, list, lookupByEmail), reactions, files
|
|
122
141
|
(info, upload v2 flow, download with bearer token), views (open, update,
|
|
@@ -163,7 +182,7 @@ that possible, all read by `scripts/demo-server.ts`:
|
|
|
163
182
|
| `APP_NAME` | Bot display name (`appName`). |
|
|
164
183
|
| `SEED_FILE` | JSON with `users`, `channels`, `messages` and `driver.prompts` (`scripts/seed.ts`); replaces the built-in `#general` and is applied whenever the journal has no channels, so the workspace comes back after every reset. `seeds/agent-swarm-demo.json` is the shipped example. |
|
|
165
184
|
| `UI_PUBLIC=true` | Keep `/` and `/c/...` readable without credentials while `ADMIN_AUTH` still gates `/mock/*` (`publicUi` option). The composer then shows a sign-in instead of the browser's basic-auth prompt. |
|
|
166
|
-
| `PRESENTER_AUTH` | `user:password` that
|
|
185
|
+
| `PRESENTER_AUTH` | `user:password` that permits `POST /mock/messages`, `POST /mock/reactions`, and `GET /mock/presenter` (`presenterAuth` option). A presenter can post messages and manage reactions without the admin credential. Opening `/c/<channel>#presenter=user:password` signs that browser in. |
|
|
167
186
|
| `DRIVER_INTERVAL_MINUTES` | Every N minutes post the next `driver.prompts` entry as that user, mentioning the bot, while an app is connected (`scripts/driver.ts`). `0` disables it. |
|
|
168
187
|
|
|
169
188
|
## Docs
|
package/dist/cli.js
CHANGED