@helyx/bot 1.3.0 → 1.4.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.
- package/CHANGELOG.md +92 -28
- package/README.md +65 -11
- package/dist/cloud-connector.d.ts +11 -4
- package/dist/cloud-connector.js +52 -15
- package/dist/cloud-control-dispatcher.d.ts +8 -3
- package/dist/cloud-control-dispatcher.js +62 -4
- package/dist/control-errors.d.ts +4 -0
- package/dist/control-errors.js +8 -0
- package/dist/control-server-schemas.d.ts +84 -0
- package/dist/control-server-schemas.js +101 -0
- package/dist/control-server.d.ts +21 -7
- package/dist/control-server.js +88 -132
- package/dist/core-retention.d.ts +26 -0
- package/dist/core-retention.js +49 -0
- package/dist/creator-guild-join-service.d.ts +25 -0
- package/dist/creator-guild-join-service.js +218 -0
- package/dist/creator-invite-service.d.ts +37 -0
- package/dist/creator-invite-service.js +686 -0
- package/dist/creator-onboarding-control.d.ts +12 -0
- package/dist/creator-onboarding-control.js +65 -0
- package/dist/creator-onboarding-platform.d.ts +20 -0
- package/dist/creator-onboarding-platform.js +58 -0
- package/dist/dashboard-action-control.d.ts +2 -2
- package/dist/dashboard-action-control.js +2 -3
- package/dist/database-bootstrap.d.ts +36 -0
- package/dist/database-bootstrap.js +101 -0
- package/dist/developer-operations-module.d.ts +1 -0
- package/dist/developer-operations-module.js +34 -16
- package/dist/discord-owned-message-service.d.ts +1 -0
- package/dist/discord-owned-message-service.js +3 -0
- package/dist/guild-command-read-service.d.ts +8 -3
- package/dist/guild-command-read-service.js +14 -7
- package/dist/guild-command-release.d.ts +15 -8
- package/dist/guild-command-release.js +10 -3
- package/dist/guild-command-worker.d.ts +17 -4
- package/dist/guild-command-worker.js +17 -6
- package/dist/guilds.d.ts +24 -3
- package/dist/guilds.js +185 -64
- package/dist/hosted-server-moderation.d.ts +2 -2
- package/dist/hosted-server-moderation.js +10 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +200 -81
- package/dist/interactions.js +16 -3
- package/dist/module-configuration.d.ts +1 -1
- package/dist/module-configuration.js +5 -2
- package/dist/module-logging.d.ts +8 -3
- package/dist/module-logging.js +13 -7
- package/dist/modules.d.ts +1 -0
- package/dist/modules.js +8 -1
- package/dist/mysql-runtime-persistence.d.ts +46 -0
- package/dist/mysql-runtime-persistence.js +91 -0
- package/dist/oauth-module.js +2 -2
- package/dist/oauth-service.d.ts +7 -0
- package/dist/oauth-service.js +3 -0
- package/dist/scheduled-task-runner.d.ts +9 -85
- package/dist/scheduled-task-runner.js +1 -1
- package/dist/shard-contracts.d.ts +135 -0
- package/dist/shard-contracts.js +13 -1
- package/dist/shard-router.d.ts +2 -1
- package/dist/shard-router.js +7 -0
- package/dist/shard-supervisor.js +43 -9
- package/dist/shard-worker.d.ts +5 -2
- package/dist/shard-worker.js +46 -5
- package/dist/supervisor-cloud-directory.d.ts +9 -3
- package/dist/supervisor-cloud-directory.js +8 -12
- package/dist/trivia-data-provider.d.ts +11 -0
- package/dist/trivia-data-provider.js +46 -26
- package/dist/verification-service.d.ts +2 -2
- package/dist/verification-service.js +6 -3
- package/documentation/README.md +5 -3
- package/documentation/examples/.env.example +15 -11
- package/documentation/guides/getting-started.md +29 -12
- package/documentation/guides/privacy-and-support.md +6 -5
- package/documentation/guides/self-hosting.md +16 -11
- package/documentation/modules/auto-moderation.md +7 -5
- package/documentation/modules/building-a-module.md +48 -2
- package/documentation/modules/moderation.md +5 -5
- package/documentation/modules/publishing-a-module.md +6 -4
- package/documentation/modules/testing-a-module.md +39 -4
- package/documentation/reference/environment.md +43 -9
- package/documentation/runbooks/backup-and-recovery.md +26 -7
- package/documentation/runbooks/installation-and-upgrades.md +97 -27
- package/package.json +20 -16
|
@@ -1,54 +1,124 @@
|
|
|
1
1
|
# Installation and upgrade runbook
|
|
2
2
|
|
|
3
|
-
Use this runbook
|
|
4
|
-
release-set
|
|
3
|
+
Use this runbook from the root of a generated Helyx project. It covers first
|
|
4
|
+
start, compatible release-set updates and failed validation.
|
|
5
|
+
|
|
6
|
+
## Check the release boundary first
|
|
7
|
+
|
|
8
|
+
This release uses consolidated fresh-install migration baselines. An existing
|
|
9
|
+
database with the earlier migration chain cannot use those baselines as an
|
|
10
|
+
ordinary in-place upgrade. Keep its matching packages and data and
|
|
11
|
+
[contact Helyx support](../guides/privacy-and-support.md#contact-support-safely)
|
|
12
|
+
before proceeding; no approved old-database transition is available yet.
|
|
13
|
+
Do not reset a database, remove its migration
|
|
14
|
+
history or change recorded checksums to make an update pass.
|
|
15
|
+
|
|
16
|
+
The updater changes project metadata; it does not verify or provide a
|
|
17
|
+
data-preserving migration path. A release described as fresh-install/reset-only
|
|
18
|
+
must not be applied to an existing database through the ordinary update steps
|
|
19
|
+
below.
|
|
5
20
|
|
|
6
21
|
## First installation
|
|
7
22
|
|
|
8
|
-
1.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
4.
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
1. Download a starter ZIP, or generate it from the builder's reviewed manifest.
|
|
24
|
+
2. Install its dependencies with `npm ci` unless generation used `--install`.
|
|
25
|
+
3. Run `npm run setup`, then complete `.env`. A managed host may supply the
|
|
26
|
+
required values through its protected variables panel instead. Keep the
|
|
27
|
+
generated encryption key stable.
|
|
28
|
+
4. Make the selected database reachable and run doctor through the matching
|
|
29
|
+
runtime path below. Resolve every error.
|
|
30
|
+
5. Start Helyx and confirm database, Discord and module readiness. Exercise one
|
|
31
|
+
low-risk command in a private test server before production use.
|
|
32
|
+
|
|
33
|
+
The starter uses compiled npm packages: direct Node.js operation has no local
|
|
34
|
+
`npm run build` step. Docker builds the supplied image.
|
|
35
|
+
|
|
36
|
+
## Run doctor in the right environment
|
|
37
|
+
|
|
38
|
+
- **Direct Node.js:** run `npm run doctor` after installation and configuration.
|
|
39
|
+
- **Docker Compose:** run `docker compose build bot`, start the included
|
|
40
|
+
PostgreSQL service with `docker compose up -d --wait database` if present,
|
|
41
|
+
then run
|
|
42
|
+
`docker compose run --rm bot node node_modules/@helyx/cli/dist/cli.js doctor`.
|
|
43
|
+
The MySQL Compose starter has no database service; its external database must
|
|
44
|
+
already be reachable. Use container doctor with container database addresses
|
|
45
|
+
such as `database`; that hostname normally cannot resolve from the host shell.
|
|
46
|
+
- **Managed hosting:** install the pinned dependencies, supply the production
|
|
47
|
+
variables and run `npm run doctor` through the provider's console or one-off
|
|
48
|
+
command facility before enabling its start process.
|
|
49
|
+
|
|
50
|
+
Doctor does not sign in to Discord, change the database or probe required server
|
|
51
|
+
capabilities. It inspects core migration history and validates selected packages
|
|
52
|
+
and engine compatibility. Module migration inspection runs only after no core
|
|
53
|
+
migrations remain pending. On a fresh database, pending migrations are expected;
|
|
54
|
+
normal startup applies core migrations, then module migrations, and probes
|
|
55
|
+
database capabilities. `npm run migrate` applies core migrations only and is not
|
|
56
|
+
a prerequisite before every start.
|
|
16
57
|
|
|
17
58
|
## Upgrade
|
|
18
59
|
|
|
19
|
-
1. Read the release notes
|
|
20
|
-
|
|
60
|
+
1. Read the release notes, confirm an ordinary upgrade is supported from your
|
|
61
|
+
installed database state, and check the supported Node.js and npm versions.
|
|
62
|
+
2. Create a current backup of the selected database and preserve the existing project
|
|
21
63
|
metadata and environment file.
|
|
22
|
-
3. Stop the
|
|
64
|
+
3. Stop the bot cleanly. With Compose use `docker compose stop bot`, preserving
|
|
65
|
+
the database service and volume; on a managed host stop its application process.
|
|
23
66
|
4. Preview the compatible release set:
|
|
24
67
|
|
|
25
68
|
```sh
|
|
26
|
-
|
|
69
|
+
npm run update:check
|
|
27
70
|
```
|
|
28
71
|
|
|
29
72
|
5. Apply it only after reviewing the complete change:
|
|
30
73
|
|
|
31
74
|
```sh
|
|
32
|
-
|
|
33
|
-
npm ci
|
|
34
|
-
npm run doctor
|
|
75
|
+
npm run update
|
|
35
76
|
```
|
|
36
77
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
78
|
+
The generated `update` script runs `helyx self-host update --confirm` followed
|
|
79
|
+
by `npm ci`. The CLI command alone does not install the refreshed dependency
|
|
80
|
+
set. Older starters without these scripts can use
|
|
81
|
+
`npx --yes @helyx/cli@latest self-host update --check`, then the same command
|
|
82
|
+
with `--confirm`, followed by `npm ci`.
|
|
83
|
+
|
|
84
|
+
6. Run doctor through the runtime path above. Docker users must rebuild the bot
|
|
85
|
+
image first, then recreate it with `docker compose up -d bot` after doctor
|
|
86
|
+
passes. Direct Node.js users start with `npm start`; managed hosts use their
|
|
87
|
+
configured start command.
|
|
88
|
+
7. Verify health, command availability and one representative workflow for every
|
|
89
|
+
upgraded module.
|
|
90
|
+
|
|
91
|
+
The updater backs up `.gitignore`, `package.json`, `package-lock.json`,
|
|
92
|
+
`helyx.modules.json` and `SHA256SUMS` under `.helyx/backups/<timestamp>/`. It
|
|
93
|
+
refreshes exact Helyx dependencies and the lockfile together, leaving `.env` and
|
|
94
|
+
database data unchanged. This metadata backup is not a database backup or an
|
|
95
|
+
installed-dependency snapshot.
|
|
96
|
+
|
|
97
|
+
If metadata generation or lockfile validation fails inside `--confirm`, the
|
|
98
|
+
updater restores those managed files. That restoration does not cover a later
|
|
99
|
+
`npm ci`, doctor or startup failure. Database migrations can be forward-only.
|
|
100
|
+
Never downgrade individual Helyx packages to simulate a rollback.
|
|
101
|
+
|
|
102
|
+
`DATABASE_ENGINE` defaults to `postgresql`; use `mysql` only with the matching
|
|
103
|
+
adapter, database and module support. The setting is not a data-conversion tool.
|
|
104
|
+
Keep the selected engine unchanged during an ordinary update. Missing adapters,
|
|
105
|
+
an unsupported module/engine combination or an installation engine mismatch must
|
|
106
|
+
be resolved explicitly, not bypassed by falling back to another adapter.
|
|
107
|
+
|
|
108
|
+
Applied checksum mismatches or an interrupted MySQL DDL receipt are errors to
|
|
109
|
+
investigate before restarting, not fresh-install pending notices.
|
|
44
110
|
|
|
45
111
|
## Failed validation
|
|
46
112
|
|
|
47
113
|
Leave the process stopped, retain sanitised logs, and determine whether the
|
|
48
114
|
failure is configuration, package integrity, database connectivity, or module
|
|
49
|
-
compatibility. If the updater restored managed files, rerun
|
|
50
|
-
`npm
|
|
51
|
-
|
|
115
|
+
compatibility. If the updater restored managed files before startup, rerun
|
|
116
|
+
`npm ci` and doctor against that restored set; Docker users rebuild and validate
|
|
117
|
+
the corresponding image. If startup or a manual migration already changed the
|
|
118
|
+
database, restoring project files does not reverse those changes. Check
|
|
119
|
+
package/schema compatibility and the backup recovery plan before restarting an
|
|
120
|
+
older release. Restore data only from a tested compatible backup when the
|
|
121
|
+
incident requires it.
|
|
52
122
|
|
|
53
123
|
## Troubleshooting
|
|
54
124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helyx/bot",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Production Discord runtime for the modular Helyx platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"helyx",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public",
|
|
28
|
-
"provenance":
|
|
28
|
+
"provenance": false
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
31
|
"files": [
|
|
@@ -50,27 +50,31 @@
|
|
|
50
50
|
"start": "node --env-file-if-exists=../../.env dist/index.js"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@helyx/config": ">=1.
|
|
54
|
-
"@helyx/control-protocol": ">=0.
|
|
55
|
-
"@helyx/core": ">=0.
|
|
56
|
-
"@helyx/database": ">=2.
|
|
57
|
-
"@helyx/
|
|
58
|
-
"@helyx/
|
|
59
|
-
"@helyx/
|
|
60
|
-
"@helyx/
|
|
61
|
-
"@helyx/
|
|
62
|
-
"@helyx/
|
|
53
|
+
"@helyx/config": ">=1.4.0 <2.0.0",
|
|
54
|
+
"@helyx/control-protocol": ">=0.7.0 <0.8.0",
|
|
55
|
+
"@helyx/core": ">=0.2.0 <0.3.0",
|
|
56
|
+
"@helyx/database": ">=2.4.0 <3.0.0",
|
|
57
|
+
"@helyx/database-contracts": ">=0.2.0 <0.3.0",
|
|
58
|
+
"@helyx/framework": ">=0.2.0 <0.3.0",
|
|
59
|
+
"@helyx/module-manifest": ">=0.13.0 <0.14.0",
|
|
60
|
+
"@helyx/platform": ">=1.3.0 <2.0.0",
|
|
61
|
+
"@helyx/sdk": ">=0.15.0 <0.16.0",
|
|
62
|
+
"@helyx/status-client": ">=0.3.0 <0.4.0",
|
|
63
|
+
"@helyx/verification-contracts": ">=0.4.0 <0.5.0",
|
|
63
64
|
"discord.js": "14.27.0",
|
|
64
|
-
"fastify": "5.12.
|
|
65
|
+
"fastify": "5.12.7",
|
|
65
66
|
"pino": "10.3.1",
|
|
66
67
|
"redis": "6.1.0",
|
|
67
|
-
"undici": "6.
|
|
68
|
+
"undici": "6.29.0",
|
|
68
69
|
"ws": "8.21.1",
|
|
69
70
|
"zod": "4.4.3"
|
|
70
71
|
},
|
|
72
|
+
"optionalDependencies": {
|
|
73
|
+
"@helyx/database-mysql": ">=0.2.0 <0.3.0"
|
|
74
|
+
},
|
|
71
75
|
"peerDependencies": {
|
|
72
|
-
"@helyx/module-automod": ">=1.
|
|
73
|
-
"@helyx/module-moderation": ">=1.
|
|
76
|
+
"@helyx/module-automod": ">=1.1.0 <2.0.0",
|
|
77
|
+
"@helyx/module-moderation": ">=1.1.0 <2.0.0"
|
|
74
78
|
},
|
|
75
79
|
"peerDependenciesMeta": {
|
|
76
80
|
"@helyx/module-automod": {
|