Commit Graph

14 Commits

Author SHA1 Message Date
renovate[bot] 4e6dbdbac1 Update Development Dependencies 2026-05-07 22:07:13 +00:00
gnuxie 3bbca89bf0 v3.1.0 2026-05-07 14:01:00 +01:00
Catalan Lover 4f41f0000c Relicense all AFL-3.0 to Apache-2.0 (#1117) 2026-05-05 12:31:43 +02:00
Catalan Lover f3e29fb3be Add Avatar Customisation Commands (#1108)
Tests / Build & Lint (push) Failing after 2m30s
Tests / Unit tests (push) Successful in 2m58s
Tests / Integration tests (push) Failing after 14s
Tests / Application Service Integration tests (push) Failing after 16s
GHCR - Development Branches / ghcr-publish (push) Failing after 13m10s
Docker Hub - Develop / docker-latest (push) Failing after 14m5s
* Add Avatar Command to bot mode and AS mode

* Add changesets

* Move MXC URI validation to matrix basic types

* Fix MediaID being mixed case when its exempt from usual case rules.

* Update changeset

* Integrate Gnuxie Review Feedback

* Fix linting errors

* Fix having forgotten to run prettier.

* Integrate Gnuxie review feedback.

* Fix version.txt.tmp files
2026-05-01 16:40:10 +01:00
Gnuxie 60eeb86415 Tighten ActionException wrapping to only accept Error. (#1111)
Docker Hub - Develop / docker-latest (push) Failing after 31s
Tests / Build & Lint (push) Failing after 2m39s
Tests / Unit tests (push) Successful in 2m52s
Tests / Integration tests (push) Failing after 16s
Tests / Application Service Integration tests (push) Failing after 16s
GHCR - Development Branches / ghcr-publish (push) Failing after 12m26s
* Tighten ActionException wrapping to only accept Error.

For months we had a bug where the "exception kind" enum was being
provided as the error instead of the wrapped error in bot sdk wrapper
code. This exception kind enum was optional in the factory method
being used for the MatrixException type and so this resulted in
draupnir reporting simply `undefined` when there were errors.  Which
was a major issue because not only did it make it difficult to track
problems down, but it made the software look like shit. Remarkably we
were still able to remotely diagnose problems essentially blind here.
But it was caused by the ActionException accepting `unknown` for Error
in order to tolerate a number of causes. We figure that this is
unacceptable because it allows for these kinds of bugs and also that
it delays finding out where we are calling broken apis.

Closes https://github.com/the-draupnir-project/Draupnir/issues/759.
Closes https://github.com/the-draupnir-project/planning/issues/137.

* Flakey test idk.
2026-04-30 19:14:15 +01:00
Gnuxie 56c904880f Split semantic type into two steps, describe and verify. (#1106)
Docker Hub - Develop / docker-latest (push) Failing after 26s
GHCR - Development Branches / ghcr-publish (push) Failing after 23s
Tests / Build & Lint (push) Failing after 2m26s
Tests / Unit tests (push) Successful in 3m2s
Tests / Integration tests (push) Failing after 13s
Tests / Application Service Integration tests (push) Failing after 11s
It is a pain in the ass to write the checks but the information itself
is still valuable when refactoring. So I'd rather we still encourage
people to write this shit down even if they don't write the checks.

Closes https://github.com/the-draupnir-project/planning/issues/132
2026-04-27 12:19:26 +01:00
Gnuxie a4c4158443 Make ProjectionNode reduction single-step (#1100)
GHCR - Development Branches / ghcr-publish (push) Failing after 32s
Docker Hub - Develop / docker-latest (push) Failing after 33s
Tests / Build & Lint (push) Failing after 4m29s
Tests / Integration tests (push) Failing after 26s
Tests / Application Service Integration tests (push) Failing after 20s
Tests / Unit tests (push) Successful in 5m47s
We figured out while working on https://github.com/the-draupnir-project/Draupnir/pull/1099 that actually in both cases if delta reducers are incorrect and get fixed, then downstream nodes have to use `reduceRebuild`.

The single-step projection nodes are much simpler though and don't leak internal state into the diff.

Closes https://github.com/the-draupnir-project/planning/issues/123

* Allow projections to pass node state in the delta.

https://github.com/the-draupnir-project/planning/issues/123.

The existing projections have been changed to the new API, but they
probably could be optimised now that we have this feature.

* Make the node state delta authoritative in existing projections.

https://github.com/the-draupnir-project/planning/issues/123

* Make projections single step

https://github.com/the-draupnir-project/planning/issues/120

* Make Projection responsible for producing the diff.

https://github.com/the-draupnir-project/planning/issues/123

* Changeset.
2026-04-20 16:50:44 +01:00
Gnuxie ecfcc1c2c3 Split PowerLevelsMirror into PowerLevelsEventMirror (#1098)
Docker Hub - Develop / docker-latest (push) Failing after 33s
GHCR - Development Branches / ghcr-publish (push) Failing after 38s
Tests / Build & Lint (push) Failing after 6m54s
Tests / Integration tests (push) Failing after 23s
Tests / Application Service Integration tests (push) Failing after 15s
Tests / Unit tests (push) Successful in 7m44s
This is to accept the createEvent in the PowerLevelsMirror and makes it harder to forget privileged creators.
Closes https://github.com/the-draupnir-project/planning/issues/122.
2026-04-17 18:09:14 +01:00
Gnuxie a8d2ea3d6d Bootstrap packages onto npm now we're monorepo. (#1069)
Preperation for 3.0.0

Part of https://github.com/the-draupnir-project/planning/issues/102.

For some dumb reason the CHANGELOG from mps was never added but ok.
2026-04-02 18:44:00 +01:00
Gnuxie e761a198aa Fix eslint patterns. (#1067)
Docker Hub - Develop / docker-latest (push) Failing after 35s
GHCR - Development Branches / ghcr-publish (push) Failing after 35s
Tests / Build & Lint (push) Failing after 5m57s
Tests / Integration tests (push) Failing after 24s
Tests / Application Service Integration tests (push) Failing after 13s
Tests / Unit tests (push) Successful in 7m9s
Closes https://github.com/the-draupnir-project/planning/issues/110
2026-04-02 13:16:20 +01:00
Gnuxie 7bb9d51980 Crash if Draupnir doesn't have the power level for state_default in the management room. (#1063)
Looks like this:

```
TypeError: Could not create Draupnir
caused by: @mjolnir:localhost:9999 doesn't have the power level required to send state events in the management room. Please make the Draupnir user an administrator
    at ResultError.toExpectError (/home/user/experiments/Draupnir/node_modules/@gnuxie/typescript-result/src/Result.ts:200:12)
    at ExpectError (/home/user/experiments/Draupnir/node_modules/@gnuxie/typescript-result/src/Result.ts:128:24)
    at Object.expect (/home/user/experiments/Draupnir/node_modules/@gnuxie/typescript-result/src/Result.ts:137:10)
    at makeBotModeToggle (/home/user/experiments/Draupnir/apps/draupnir/test/integration/mjolnirSetupUtils.ts:194:5)
    at processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async /home/user/experiments/Draupnir/apps/draupnir/test/integration/manualLaunchScript.ts:23:18
```


Fixes https://github.com/the-draupnir-project/Draupnir/issues/1025
Closes https://github.com/the-draupnir-project/planning/issues/108

* Fix test:manual deleting the prior management room

The old behaviour of leaving any stale management
room active was intentional, to be able to inspect
failed tests and restart the bot quickly to check
changes.

* Check Draupnir can send state to the management room at startup.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/1025
Part of https://github.com/the-draupnir-project/planning/issues/108

* Fix small bug in PowerLevelsMirror.

It was checking the wrong entries for regular events.
Discovered as part of https://github.com/the-draupnir-project/planning/issues/108

* Fix typos in privileged creator APIs

Fixed during https://github.com/the-draupnir-project/planning/issues/108

* Notify management room of lack of state_default permission.
2026-03-30 14:25:39 +01:00
Gnuxie 5870c02933 Stop MemberBanSynchronisation banning for all recommendations. (#1062)
Tests / Unit tests (push) Successful in 7m9s
Tests / Build & Lint (push) Failing after 7m21s
Tests / Application Service Integration tests (push) Failing after 22s
GHCR - Development Branches / ghcr-publish (push) Failing after 33s
Tests / Integration tests (push) Failing after 11m48s
Docker Hub - Develop / docker-latest (push) Failing after 31s
Originally contributed in https://github.com/Gnuxie/matrix-protection-suite/pull/102.

Co-authored-by: nexy7574 <git@nexy7574.co.uk>
2026-03-29 16:30:55 +01:00
Gnuxie 82fe093ef3 Upgrade matrix-apservice-bridge base stack to node24. (#1052)
https://github.com/the-draupnir-project/planning/issues/104

I don't know what the fuck they are doing with the typings in the
vector bot-sdk repository but whatever.

https://github.com/the-draupnir-project/Draupnir/issues/1053
2026-03-20 15:54:21 +00:00
Gnuxie 879e822332 Monoreponir (#1046)
* Move src to apps/draupnir/src

https://github.com/the-draupnir-project/planning/issues/100

* Move package.json

https://github.com/the-draupnir-project/planning/issues/100

* Add matrix-basic-types to monorepo.

Get everything working including linting and prettier :3

https://github.com/the-draupnir-project/planning/issues/100

* Add interface-manager to monorepo.

This was a bitch because apparently we forgot to delete node_modules
before creating the workspace package.json. So it had linked a bunch
of local stuff like was in node_modules for Draupnir...

Anyways i think we're still on track.

https://github.com/the-draupnir-project/planning/issues/100

* idk why there are prettier changes in apps but there are.

* Add matrix-protection-suite to monorepo.

https://github.com/the-draupnir-project/planning/issues/100

* Add matrix-protection-suite-for-matrix-bot-sdk

https://github.com/the-draupnir-project/planning/issues/100

We will need to add the real upstreams and versions and remove the
file links as we publish the packages.

* Move mps-interface-adaptor into monorepo

https://github.com/the-draupnir-project/planning/issues/100

Wohoo, i think only draupnir is left now?

* Move Draupnir test files to draupnir directory smh smh smh.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript config for tests and eslint.

Now we get proper linting and type checking of tests.

https://github.com/the-draupnir-project/planning/issues/100

* WIP Integrating draupnir into monorepo tooling...

https://github.com/the-draupnir-project/planning/issues/100

We need to stop aliasing bot-sdk but we should first check that
upstream is using a consistent name too.

* Remove matrix-bot-sdk alias for vector fork.

https://github.com/the-draupnir-project/planning/issues/100

* Add top command description type and weave through API.

A more recent version of typescript meant that the exectutor's
contravariance got checked which destroyed the API so we had to make a
top type for command descriptions and parametrise some of the API.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript errors related to class property initialisation changes.

https://www.typescriptlang.org/tsconfig/#useDefineForClassFields

Seems like they were using defineProperty before which meant
properites were initialised after the constructor ran.

Honestly i like that more but we're going to stick with what they
intend to be the default.

https://github.com/the-draupnir-project/planning/issues/100

* Fix tests lacking fixtures context.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript errors related to error destructuring in tests.

https://github.com/the-draupnir-project/planning/issues/100

* Pin postgres package to workaround upstream issue

https://github.com/porsager/postgres/issues/1150
Documented in DEPENDENCIES.md

https://github.com/the-draupnir-project/planning/issues/100

* Fix contravariance issue in hash store helper.

Part of the TS 5.9 upgrade fallout.
https://github.com/the-draupnir-project/planning/issues/100

* Fix minor typescript 5.9 migration issuess

All typescript errors finished, yay.

* Fix REUSE missing headers.

* Fix assets script in draupnir app.

* Add Draupnir to eslint scope

* Remove the appservice web API.

There are too many eslint errors here to do with unsafe parsing of
properties from the body etc. And there's actually no consumers to
this API. It's also a widget API, and all it does is provision the bot
and nothing more.

* Fix eslint config for DeadDocumentJSX.

It wasn't working well with the jsx templates.
We should probably delete the tsconfig.eslint.json shite now.

* Update src/utils.ts for eslint.

This shit is legacy i hate it.

* Fix eslint errors in config.

Really this is paint over rot since the config doesn't have a schema,
and we can't really make one either.

* Fix eslint issues in ReportManager.

This code is diabolical. It hasn't really been fixed that will take
refactoring and making sure people don't write this sorts of bad code
ever again. Which thankfully we have process in place for.

* Fix clientHelper eslint issues.

* Fix eslint for ImportCommand.

* Grinding eslint fml.

* Fix miscellaneous eslint issues.

* allow no-deprecate for logMessage.

shit's being annoying.

* Fix remaining eslint issues...

We also deleted one of the scripts used to evaluate the performance of
various endpoints, which we were not using.

* Give bot toggle asyncDispose for code consistency.

* Fix package.json access issues.

* Adjust Docker and CI for new app location in monorepo.

* Fix broken integration tests.

* Remove prepare script from matrix-protection-suite package.

Isn't needed anymore


* Fix build:all script missing base files.

* Remove test script from matrix-protection-suite-for-matrix-bot-sdk

It doesn't have any tests :/

* Order of setup is wrong in integration test workflows.

* Fix mps interface adaptor doesn't have any tests.

* Fix appservice registration for test harness.

* Fix matrix-basic-types jest configuration

* Fix no build step in mjolnir.yaml

* Transfer common dev dependencies to the workspace root.


They were just wrong.
2026-03-19 16:13:14 +00:00