@checkstack/incident-frontend 0.6.1 → 0.7.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/package.json +13 -10
  3. package/tsconfig.json +33 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,293 @@
1
1
  # @checkstack/incident-frontend
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
8
+ (including private GitHub Enterprise instances), or tarball uploads at
9
+ runtime, with multi-package bundles, dependency-derived compatibility checks,
10
+ multi-instance coordination via a Postgres artifact store, and
11
+ single-coordinator destructive cleanup.
12
+
13
+ Highlights:
14
+
15
+ - New `PluginSource` discriminated union and `PluginInstaller` /
16
+ `PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
17
+ GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
18
+ GitHub Enterprise can install from `https://ghe.example.com/api/v3`
19
+ instead of `api.github.com`.
20
+ - New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
21
+ every plugin's `package.json` at install time. Required fields: `name`,
22
+ `version`, `description`, `author`, `license`, `checkstack.type`,
23
+ `checkstack.pluginId`. Optional: `checkstack.bundle`,
24
+ `checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
25
+ - New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
26
+ `list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
27
+ `events` procedures.
28
+ - New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
29
+ with per-row uninstall (typed-confirmation modal, schema/configs/cascade
30
+ toggles), install page with NPM / Tarball Upload / GitHub Release tabs
31
+ (Catalog tab disabled — coming soon), and an events page surfacing the
32
+ install/uninstall audit log.
33
+ - New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
34
+ per-package mode produces an npm-shaped tarball; `--bundle` mode produces
35
+ an outer tarball containing every sibling declared in
36
+ `package.json#checkstack.bundle`. Published to npm so external authors
37
+ can `bunx` it directly without a workspace checkout.
38
+ - Compatibility derived from `package.json#dependencies` ranges
39
+ (`semver.satisfies` against the platform's loaded `@checkstack/*`
40
+ versions) — no separate `compatibility` field.
41
+ - Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
42
+ install/uninstall; receiving instances do in-process register/unregister
43
+ only. Destructive ops (drop schema, delete plugin_configs, delete
44
+ artifacts, delete `plugins` rows) run exactly once on the originator.
45
+ - Fresh-instance bootstrap: `loadPlugins()` hydrates any
46
+ `is_uninstallable=true` plugin missing from `node_modules` from the
47
+ artifact store before normal Phase 1 register.
48
+ - New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
49
+ (audit/error log). `plugins` extended with `version`, `metadata`,
50
+ `source`, `bundle_id`, `is_primary`. Local plugin sync now writes
51
+ `version` from each plugin's `package.json` so the admin UI shows real
52
+ versions instead of `—`.
53
+ - Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
54
+ the install UI; access-gated by `pluginmanager.plugin.manage`.
55
+ - Plugin Manager menu link added to the user menu (main grid, alongside
56
+ Profile / Notification Settings / etc.).
57
+
58
+ Cross-cutting changes:
59
+
60
+ - Backend request/response logging now flows through `rootLogger` (winston)
61
+ instead of `hono/logger`. 5xx responses include the response body inline
62
+ so swallowed early-return errors are visible in the log.
63
+ - The `/api/:pluginId/*` dispatcher now logs which core service is missing
64
+ or which `pluginId` had no metadata when it 500s.
65
+ - New `registerCorePluginMetadata` on `PluginManager` for core routers
66
+ (like the plugin manager itself) that need their metadata visible to the
67
+ RPC dispatcher without going through the full plugin lifecycle.
68
+ - ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
69
+ between `null` (writes a real SQL NULL) and `undefined` (skip the column
70
+ on insert), so treating them as interchangeable produced latent bugs at
71
+ the persistence boundary. The bulk of the patch-bumped packages above
72
+ reflect lint-fix touches that landed when this rule was relaxed.
73
+ - Workspace-wide license normalization to `Elastic-2.0` (matches
74
+ `LICENSE.md`). Every `package.json` in the workspace now declares the
75
+ same SPDX identifier; the patch bumps capture this.
76
+
77
+ Plugin packages (every `plugins/*`): added a `pack` npm script
78
+ (`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
79
+ `pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
80
+ so install-time validation passes, stubbed any missing required metadata
81
+ fields (`description`, `author`, `license`), and added
82
+ `checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
83
+ jira, queue-bullmq, queue-memory, cache-memory).
84
+
85
+ Breaking changes:
86
+
87
+ - The legacy single-method `PluginInstaller` interface (`install(packageName)`)
88
+ is removed. Callers must use `coreServices.pluginInstallerRegistry`.
89
+ - The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
90
+ Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
91
+ and `createPluginManagerRouter` in `core/backend`.
92
+ - `@checkstack/test-utils-backend` no longer exports
93
+ `createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
94
+ it shimmed is gone).
95
+
96
+ Note: bumps are limited to `minor` (for packages with new public API
97
+ surface) and `patch` (for downstream consumers, license normalization,
98
+ and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
99
+ the legacy interface had no third-party consumers in the wild before this
100
+ runtime plugin system landed, and the contract surface is the same shape
101
+ modulo the rename.
102
+
103
+ - Updated dependencies [50e5f5f]
104
+ - @checkstack/catalog-common@2.0.1
105
+ - @checkstack/common@0.8.0
106
+ - @checkstack/dashboard-frontend@0.6.1
107
+ - @checkstack/notification-frontend@0.3.1
108
+ - @checkstack/signal-frontend@0.1.1
109
+ - @checkstack/ui@1.7.1
110
+ - @checkstack/auth-frontend@0.5.33
111
+ - @checkstack/frontend-api@0.4.2
112
+ - @checkstack/incident-common@1.0.1
113
+ - @checkstack/notification-common@1.0.1
114
+
115
+ ## 0.7.0
116
+
117
+ ### Minor Changes
118
+
119
+ - 32d52c6: feat: unified notification-subscription manager dialog driven by spec registry
120
+
121
+ Replaces the bell-toggle UX (which only managed a single legacy
122
+ catalog group) with a modal that lists every notification type
123
+ registered against a target — system or group — and exposes both
124
+ per-type toggles and a bulk "Subscribe to all / Unsubscribe from all"
125
+ action. Both surfaces (system detail page header bell, dashboard group
126
+ header bell) now open the same `NotificationSubscriptionsManager`
127
+ component.
128
+
129
+ **Key change vs. the prior slot-based approach**: rows are now driven
130
+ by `notificationClient.listSubscriptionSpecs` — the backend's spec
131
+ registry is the single source of truth. Previously, a row only
132
+ appeared if a frontend plugin had remembered to register a
133
+ `createNotificationSubscriptionExtension`; this caused silent drift
134
+ (healthcheck and dependency registered backend specs without frontend
135
+ extensions, so the dialog counted them but never rendered rows). Now,
136
+ every spec the platform knows about renders a row using the spec's
137
+ `display` metadata (title, description, iconName resolved via
138
+ `DynamicIcon`).
139
+
140
+ **Sub-controls registry** (`@checkstack/notification-frontend`):
141
+ plugins that want sub-granularity (anomaly's per-field mute list,
142
+ future severity / channel filters) call
143
+ `registerSubscriptionSubControls(spec, Component)` at module load —
144
+ the manager looks the component up by `specId` when expanding a row.
145
+
146
+ **Removed (no compat)**:
147
+
148
+ - `createNotificationSubscriptionExtension` (replaced by the
149
+ spec-driven manager + the SubControls registry)
150
+ - `target.slot` field on `NotificationTarget` and the
151
+ `NotificationTargetInput.slot` parameter on
152
+ `defineNotificationTarget`
153
+ - `SystemNotificationSubscriptionsSlot` and
154
+ `GroupNotificationSubscriptionsSlot` from `@checkstack/catalog-common`
155
+ - `SystemNotificationsCard` from the system detail page's main column
156
+ - `SubscribeButton` wiring on dashboard group cards and the system
157
+ detail page header
158
+
159
+ **Migrated frontends**: anomaly (now registers `AnomalyFieldMuteList`
160
+ via the SubControls registry), incident, maintenance — all dropped
161
+ their `createNotificationSubscriptionExtension` calls. healthcheck and
162
+ dependency now show up automatically via the spec registry — no
163
+ frontend changes needed for them to render.
164
+
165
+ The trigger button reflects aggregate state — filled bell when at
166
+ least one spec is subscribed for the resource, ghost bell when none.
167
+
168
+ - 32d52c6: feat: notification target pattern + per-spec subscriptions
169
+
170
+ Replaces the all-or-nothing catalog system/group notification model with a
171
+ platform-level target pattern. Each notification-emitting plugin declares
172
+ _subscription specs_ against typed _target_ objects exported from the
173
+ target's owning plugin (catalog ships `catalogSystemTarget` and
174
+ `catalogGroupTarget`). Notification-backend handles every per-resource
175
+ group lifecycle, parent-edge inheritance, and legacy-subscription seeding
176
+ — plugins never author groupId helpers, lifecycle hooks, or migration
177
+ code again.
178
+
179
+ **Plugin-author surface area is now ~12 lines per emitter:**
180
+
181
+ ```ts
182
+ // <plugin>-common
183
+ const { defineSubscription } = createSubscriptionFactory(pluginMetadata);
184
+ export const fooSystemSubscription = defineSubscription({
185
+ localId: "system",
186
+ target: catalogSystemTarget,
187
+ display: { title: "Foo Alerts", description: "...", iconName: "Bell" },
188
+ });
189
+
190
+ // <plugin>-backend register()
191
+ env.registerSubscriptionSpecs([fooSystemSubscription]);
192
+ // ^ feeds the plugin loader's dependency sorter — each spec's
193
+ // target.ownerPlugin becomes an implicit init-order dep, so this
194
+ // plugin automatically waits for catalog (the target owner) to
195
+ // finish init + afterPluginsReady before its own runs.
196
+
197
+ // <plugin>-backend afterPluginsReady
198
+ await notificationClient.registerSubscriptionSpec(
199
+ specToRegistration(fooSystemSubscription)
200
+ );
201
+ // dispatch
202
+ await notificationClient.notifyForSubscription({
203
+ specId: fooSystemSubscription.specId,
204
+ resourceKeys: [systemId],
205
+ title,
206
+ body,
207
+ importance,
208
+ action,
209
+ collapseKey,
210
+ subjects,
211
+ });
212
+
213
+ // <plugin>-frontend
214
+ createNotificationSubscriptionExtension({ spec: fooSystemSubscription });
215
+ ```
216
+
217
+ **Migrated plugins**: anomaly, incident, maintenance, healthcheck,
218
+ dependency. Each lost its bespoke `notification-groups.ts`,
219
+ `bootstrap*NotificationGroups`, `ensure*Group`, and inheritance walk —
220
+ all of that is now centralized in notification-backend's
221
+ `subscription-engine`.
222
+
223
+ **Plugin loader change** (`@checkstack/backend-api`,
224
+ `@checkstack/backend`): the register-time API gains
225
+ `env.registerSubscriptionSpecs([...specs])`. The dependency sorter
226
+ walks `spec.target.ownerPlugin` for every declared spec and adds the
227
+ target owner as an init-order dependency of the emitting plugin. This
228
+ guarantees that catalog (the owner of the platform's `system` and
229
+ `group` targets) completes init + afterPluginsReady before any
230
+ emitting plugin tries to register its specs against the notification
231
+ service — no string-prefix heuristics, no manual `dependsOnPlugins`
232
+ list, no stub rows. Plugins that fail to declare their specs at
233
+ register time get a clear `Target type X is not registered. Did the
234
+ emitting plugin declare this spec via env.registerSubscriptionSpecs?`
235
+ error from the dispatcher.
236
+
237
+ **Removed** (no backwards compat):
238
+
239
+ - `catalogClient.notifySystemSubscribers` and
240
+ `catalogClient.notifyManySystemSubscribers`
241
+ - `notificationClient.notifyUsers` and `notificationClient.notifyGroups`
242
+ as direct dispatch primitives — replaced by spec-bound
243
+ `notifyForSubscription`
244
+ - catalog's `bootstrapNotificationGroups` (replaced by
245
+ `bootstrapNotificationTargets`)
246
+
247
+ **Enforcement**: the dispatcher rejects calls referencing unregistered
248
+ specIds, specs owned by other plugins, or resourceKeys that haven't been
249
+ pushed via `upsertNotificationResource`. Display metadata for any
250
+ groupId is recoverable via the spec registry, so audit lists render
251
+ correct labels even when an emitter's frontend isn't loaded.
252
+
253
+ **Per-field anomaly mute** keeps working — it now lives inside the
254
+ generic SubscriptionRow's optional `SubControls` panel
255
+ (`AnomalyFieldMuteList`), exposed through the catalog system detail
256
+ page's notifications card.
257
+
258
+ The catalog system detail page renders a "Notifications" card hosting
259
+ `SystemNotificationSubscriptionsSlot`. The matching group surface is
260
+ not yet rendered — group-level subscriptions are wired end-to-end on
261
+ the backend; a follow-up will add the host UI.
262
+
263
+ **Migration of existing subscribers**: target types declare a
264
+ `legacyGroupIdTemplate`; on first registration of each spec,
265
+ notification-backend reads subscribers from the legacy
266
+ `catalog.system.<id>` / `catalog.group.<id>` groups and seeds the new
267
+ spec groups exactly once per (spec × resource) pair, tracked in
268
+ `subscription_migrations`. Anomaly stays opt-in (its target also
269
+ declares the template, but the user-explicit nature of the original
270
+ opt-in flow means the seeding produces the same set of subscribers
271
+ they already had).
272
+
273
+ ### Patch Changes
274
+
275
+ - Updated dependencies [32d52c6]
276
+ - Updated dependencies [32d52c6]
277
+ - Updated dependencies [32d52c6]
278
+ - Updated dependencies [32d52c6]
279
+ - Updated dependencies [32d52c6]
280
+ - Updated dependencies [32d52c6]
281
+ - Updated dependencies [32d52c6]
282
+ - @checkstack/notification-common@1.0.0
283
+ - @checkstack/notification-frontend@0.3.0
284
+ - @checkstack/catalog-common@2.0.0
285
+ - @checkstack/incident-common@1.0.0
286
+ - @checkstack/dashboard-frontend@0.6.0
287
+ - @checkstack/frontend-api@0.4.1
288
+ - @checkstack/auth-frontend@0.5.32
289
+ - @checkstack/ui@1.7.0
290
+
3
291
  ## 0.6.1
4
292
 
5
293
  ### Patch Changes
package/package.json CHANGED
@@ -1,25 +1,28 @@
1
1
  {
2
2
  "name": "@checkstack/incident-frontend",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
+ "license": "Elastic-2.0",
4
5
  "type": "module",
5
6
  "main": "src/index.tsx",
6
7
  "checkstack": {
7
8
  "type": "frontend"
8
9
  },
9
10
  "scripts": {
10
- "typecheck": "tsc --noEmit",
11
+ "typecheck": "tsgo -b",
11
12
  "lint": "bun run lint:code",
12
13
  "lint:code": "eslint . --max-warnings 0"
13
14
  },
14
15
  "dependencies": {
15
- "@checkstack/auth-frontend": "0.5.30",
16
- "@checkstack/catalog-common": "1.5.2",
16
+ "@checkstack/auth-frontend": "0.5.32",
17
+ "@checkstack/catalog-common": "2.0.0",
17
18
  "@checkstack/common": "0.7.0",
18
- "@checkstack/dashboard-frontend": "0.5.0",
19
- "@checkstack/frontend-api": "0.3.11",
20
- "@checkstack/incident-common": "0.4.9",
21
- "@checkstack/signal-frontend": "0.0.16",
22
- "@checkstack/ui": "1.6.0",
19
+ "@checkstack/dashboard-frontend": "0.6.0",
20
+ "@checkstack/frontend-api": "0.4.1",
21
+ "@checkstack/incident-common": "1.0.0",
22
+ "@checkstack/notification-common": "1.0.0",
23
+ "@checkstack/notification-frontend": "0.3.0",
24
+ "@checkstack/signal-frontend": "0.1.0",
25
+ "@checkstack/ui": "1.7.0",
23
26
  "date-fns": "^4.1.0",
24
27
  "lucide-react": "^0.344.0",
25
28
  "react": "^18.2.0",
@@ -28,7 +31,7 @@
28
31
  "devDependencies": {
29
32
  "typescript": "^5.0.0",
30
33
  "@types/react": "^18.2.0",
31
- "@checkstack/tsconfig": "0.0.5",
34
+ "@checkstack/tsconfig": "0.0.6",
32
35
  "@checkstack/scripts": "0.1.2"
33
36
  }
34
37
  }
package/tsconfig.json CHANGED
@@ -2,5 +2,37 @@
2
2
  "extends": "@checkstack/tsconfig/frontend.json",
3
3
  "include": [
4
4
  "src"
5
+ ],
6
+ "references": [
7
+ {
8
+ "path": "../auth-frontend"
9
+ },
10
+ {
11
+ "path": "../catalog-common"
12
+ },
13
+ {
14
+ "path": "../common"
15
+ },
16
+ {
17
+ "path": "../dashboard-frontend"
18
+ },
19
+ {
20
+ "path": "../frontend-api"
21
+ },
22
+ {
23
+ "path": "../incident-common"
24
+ },
25
+ {
26
+ "path": "../notification-common"
27
+ },
28
+ {
29
+ "path": "../notification-frontend"
30
+ },
31
+ {
32
+ "path": "../signal-frontend"
33
+ },
34
+ {
35
+ "path": "../ui"
36
+ }
5
37
  ]
6
- }
38
+ }