You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chat): support Matrix and Mattermost standalone (#12)
## Added
- Matrix or Mattermost can run as the only chat platform; Slack is no
longer required to enter chat mode.
- Scheduled insight posts now go to every configured chat platform
(Slack, Matrix, Mattermost), not just Slack.
- Matrix and Mattermost notifiers retry transient failures (HTTP 429,
5xx, and common network errors), matching Slack's existing behavior.
- New `InsightSink` abstraction (`src/notify/insightSink.ts`) and
`RetryNotifier` (`src/notify/retryNotifier.ts`) with unit tests.
## Changed
- `MATRIX_DEFAULT_ROOM_ID` is required whenever any Matrix env is set.
It is used for scheduled insight posts and auto-join on startup,
matching how Slack and Mattermost handle their channel.
- Helm chart: Matrix and Mattermost non-sensitive config now sits under
`config.*` and their tokens under `secrets.*`, matching the Slack
pattern. Slack token emission is now conditional, so a Matrix-only or
Mattermost-only deploy no longer ships empty Slack env vars.
- Helm chart: removed env vars the app never read (`KAYTOO_OUTPUT`,
`POLL_INTERVAL_SECONDS`, `DEDUPE_TTL_SECONDS`, `EGRESS_*`,
`PORTSCAN_*`, `LOG_INCLUDE_DEBUG_BODIES`, `LOG_REDACT`,
`MATRIX_SDK_LOG_LEVEL`). Output mode is auto-derived from which chat
adapter envs are present.
- Helm chart: default image tag resolves to `v{Chart.AppVersion}` so it
matches the GHCR semver tag convention out of the box.
- Logger reads `NODE_ENV` directly from `process.env`; the `nodeEnv`
field on `LoggingInit` is gone.
- README: chat adapter section is platform-neutral and links to each
adapter's setup. Releases section rewritten as a numbered flow.
- Cleaned up non-ASCII punctuation in source comments, tool
descriptions, and test names. Test regex that intentionally rejects
smart punctuation keeps its semantics via Unicode escapes.
## Fixed
- Config validation no longer demands Slack env when only Matrix or
only Mattermost is configured.
Copy file name to clipboardExpand all lines: README.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
> ⚠️ **Notice**
2
-
> This repo is a small, experimental project built for fun and learning. It’s shared publicly **as-is** with no promised support, roadmap, or guarantees.
2
+
> This repo is a small, experimental project built for fun and learning. It's shared publicly **as-is** with no promised support, roadmap, or guarantees.
@@ -98,13 +98,11 @@ Kaytoo is configured via environment variables. For a minimal example, see `.env
98
98
99
99
#### Environment variables
100
100
101
-
**Slack**(required for chat mode. See [Slack setup (Socket Mode)](#slack-setup-socket-mode)below)
101
+
**Chat adapters**- configure at least one to run in chat mode. Kaytoo posts scheduled insights to every configured platform and answers chat replies on the same platform a message arrives from. See the per-platform setup and full variable tables below:
**Search backend** (Choose either OpenSearch or Elasticsearch. Do not set both)
110
108
@@ -205,7 +203,7 @@ Uses [`matrix-js-sdk`](https://github.com/matrix-org/matrix-js-sdk) with an in-m
205
203
| --- | --- | --- | --- |
206
204
|`MATRIX_HOMESERVER`| yes | - | Homeserver base URL. |
207
205
|`MATRIX_ACCESS_TOKEN`| yes | - | Access token for the bot user. |
208
-
|`MATRIX_DEFAULT_ROOM_ID`|no| - |If set, Kaytoo attempts to join on startup. |
206
+
|`MATRIX_DEFAULT_ROOM_ID`|yes| - |Room for scheduled insight posts. Kaytoo also attempts to join it on startup. |
209
207
210
208
##### Setup
211
209
@@ -224,8 +222,8 @@ Uses [`matrix-js-sdk`](https://github.com/matrix-org/matrix-js-sdk) with an in-m
224
222
- Invite the bot user into each room where Kaytoo should respond.
225
223
- Kaytoo auto-joins rooms it is invited to.
226
224
227
-
5.**(Optional) default room**:
228
-
- Set `MATRIX_DEFAULT_ROOM_ID`if you want Kaytoo to attempt to join a specific room on startup.
225
+
5.**Default room**:
226
+
- Set `MATRIX_DEFAULT_ROOM_ID`to the room that should receive scheduled insight posts. Kaytoo also attempts to join this room on startup.
229
227
230
228
6.**Run Kaytoo** with OpenSearch/Elasticsearch + LLM configured (same as Slack).
231
229
@@ -235,7 +233,7 @@ Notes:
235
233
236
234
#### Mattermost
237
235
238
-
Inbound messages use the Mattermost WebSocket API (`/api/v4/websocket`); outbound replies use REST.
236
+
Inbound messages use the Mattermost WebSocket API (`/api/v4/websocket`); outbound replies use REST.`MATTERMOST_URL`, `MATTERMOST_TOKEN`, and `MATTERMOST_CHANNEL_ID` enable chat mode.
Pushes to `main` run [`elastiflow/gha-reusable``prepare-release`](https://github.com/elastiflow/gha-reusable), which may open a pull request that bumps `helm/kaytoo/Chart.yaml`, `package.json`, and prepends `CHANGELOG.md`. **Squash-merge that PR** so the resulting commit subject is exactly `[release vX.Y.Z] (#NNN)` (GitHub’s default squash title matches the PR title). Merging with that message triggers the GitHub release, container push to `ghcr.io/<owner>/<repo>`, and a Helm chart GitHub release plus `cr index` publish to the `gh-pages` branch when GitHub Pages is enabled for that branch.
323
+
Releases are driven by [`elastiflow/gha-reusable`](https://github.com/elastiflow/gha-reusable)`prepare-release`. The flow:
324
+
325
+
1.**Push to `main`** runs `prepare-release`, which may open a PR that:
326
+
- bumps `helm/kaytoo/Chart.yaml` and `package.json`
327
+
- prepends a new entry to `CHANGELOG.md`
328
+
2.**Squash-merge that PR.** Keep GitHub's default squash title so the commit subject is exactly `[release vX.Y.Z] (#NNN)`.
329
+
3.**The release commit** then triggers:
330
+
- a GitHub release for `vX.Y.Z`
331
+
- a container push to `ghcr.io/<owner>/<repo>`
332
+
- a Helm chart GitHub release plus `cr index` publish to the `gh-pages` branch
Copy file name to clipboardExpand all lines: e2e/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Local stack: **Mermin** + OpenSearch ([`k8s/mermin-stack-values.yaml`](k8s/mermi
13
13
|`npm run e2e:logs`| Tail Kaytoo in-cluster |
14
14
|`npm run e2e:dev`| Run Kaytoo on the host against forwarded OpenSearch |
15
15
16
-
**Host Helm is not required**— the bootstrap Job runs Helm in-cluster.
16
+
**Host Helm is not required**- the bootstrap Job runs Helm in-cluster.
17
17
18
18
## Stack
19
19
@@ -46,9 +46,9 @@ Created during `e2e:up` (and by `npm run e2e:llm-overlay` for the LLM file only)
46
46
47
47
| Artifact | Role |
48
48
| --- | --- |
49
-
|`kubeconfig-kind-kaytoo-e2e`| Host / `kind` CLI — API server `https://127.0.0.1:…`|
50
-
|`kubeconfig-kind-kaytoo-e2e.docker`| Docker `kubectl port-forward` sidecars — same cluster, API host `host.docker.internal`|
51
-
|`kaytoo-values.rendered.yaml`|[`k8s/kaytoo-values.yaml`](k8s/kaytoo-values.yaml) + real `OPENSEARCH_PASSWORD`→ copied to node as `kaytoo-values.yaml` (**secrets**) |
49
+
|`kubeconfig-kind-kaytoo-e2e`| Host / `kind` CLI - API server `https://127.0.0.1:...`|
50
+
|`kubeconfig-kind-kaytoo-e2e.docker`| Docker `kubectl port-forward` sidecars - same cluster, API host `host.docker.internal`|
51
+
|`kaytoo-values.rendered.yaml`|[`k8s/kaytoo-values.yaml`](k8s/kaytoo-values.yaml) + real `OPENSEARCH_PASSWORD`-> copied to node as `kaytoo-values.yaml` (**secrets**) |
52
52
|`values-e2e.llm.local.json`| LLM Helm `-f` from `.env` via `e2e/write-e2e-llm-overlay.mjs`|
53
53
54
54
Legacy `e2e/.kubeconfig-kind-*` at the `e2e/` root is moved into `.generated/` on first use.
@@ -60,10 +60,10 @@ npm run e2e:up
60
60
```
61
61
62
62
1. kind cluster `kaytoo-e2e` (prompts if it already exists).
Copy file name to clipboardExpand all lines: helm/kaytoo/values.yaml
+14-30Lines changed: 14 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,8 @@
1
1
replicaCount: 1
2
2
3
-
# Passed to process env as KAYTOO_OUTPUT (slack | console). Console skips Slack / chat adapters.
4
-
kaytooOutput: slack
5
-
6
3
image:
7
-
repository: kaytoo
8
-
tag: "dev"
4
+
repository: ghcr.io/elastiflow/kaytoo
5
+
tag: ""
9
6
pullPolicy: IfNotPresent
10
7
11
8
serviceAccount:
@@ -33,50 +30,37 @@ resources:
33
30
config:
34
31
slack:
35
32
channelId: ""
33
+
matrix:
34
+
homeserver: ""
35
+
defaultRoomId: ""
36
+
mattermost:
37
+
url: ""
38
+
channelId: ""
39
+
botUserId: ""
36
40
opensearch:
37
41
url: ""
38
42
tlsInsecure: "false"
39
-
# Default matches ElastiFlow CODEX-style indices; use elastiflow-flow-* (or your alias) if your cluster uses a different pipeline/mapping. Must align with document fields Kaytoo resolves (see README).
43
+
# Default matches ElastiFlow CODEX-style indices.
44
+
# Use elastiflow-flow-* (or your alias) if your cluster uses a different pipeline/mapping.
45
+
# This must align with document fields that Kaytoo resolves (see README).
0 commit comments