@checkstack/backend 0.8.2 → 0.9.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 (42) hide show
  1. package/CHANGELOG.md +333 -0
  2. package/drizzle/0001_slim_mordo.sql +34 -0
  3. package/drizzle/meta/0001_snapshot.json +444 -0
  4. package/drizzle/meta/_journal.json +7 -0
  5. package/package.json +18 -13
  6. package/src/index.ts +276 -17
  7. package/src/plugin-deregistration.test.ts +137 -0
  8. package/src/plugin-manager/api-router.ts +35 -11
  9. package/src/plugin-manager/plugin-loader.ts +73 -0
  10. package/src/plugin-manager.ts +295 -105
  11. package/src/schema.ts +79 -1
  12. package/src/services/cache-manager.test.ts +172 -0
  13. package/src/services/cache-manager.ts +67 -14
  14. package/src/services/compatibility-checker.test.ts +146 -0
  15. package/src/services/compatibility-checker.ts +137 -0
  16. package/src/services/dev-auth.test.ts +87 -0
  17. package/src/services/dev-auth.ts +56 -0
  18. package/src/services/event-bus.test.ts +52 -0
  19. package/src/services/event-bus.ts +27 -1
  20. package/src/services/plugin-artifact-store.ts +131 -0
  21. package/src/services/plugin-bundle-resolver.ts +76 -0
  22. package/src/services/plugin-event-recorder.ts +87 -0
  23. package/src/services/plugin-installers/catalog-installer.ts +33 -0
  24. package/src/services/plugin-installers/github-installer.ts +207 -0
  25. package/src/services/plugin-installers/install-from-tarball.ts +69 -0
  26. package/src/services/plugin-installers/installer-registry.ts +51 -0
  27. package/src/services/plugin-installers/npm-installer.ts +156 -0
  28. package/src/services/plugin-installers/plugin-install-error.ts +37 -0
  29. package/src/services/plugin-installers/tarball-installer.ts +80 -0
  30. package/src/services/plugin-installers/tarball-utils.test.ts +200 -0
  31. package/src/services/plugin-installers/tarball-utils.ts +172 -0
  32. package/src/services/plugin-manager-orchestrator.ts +522 -0
  33. package/src/services/plugin-manager-router.ts +219 -0
  34. package/src/services/queue-manager.ts +77 -2
  35. package/src/services/queue-proxy.ts +7 -0
  36. package/src/utils/plugin-discovery.test.ts +6 -0
  37. package/src/utils/plugin-discovery.ts +6 -1
  38. package/tsconfig.json +3 -0
  39. package/src/plugin-lifecycle.test.ts +0 -276
  40. package/src/plugin-manager/plugin-admin-router.ts +0 -89
  41. package/src/services/plugin-installer.test.ts +0 -90
  42. package/src/services/plugin-installer.ts +0 -70
package/CHANGELOG.md CHANGED
@@ -1,5 +1,338 @@
1
1
  # @checkstack/backend
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - aa89bc5: Replace the bespoke `registerInfrastructureTab()` registry with a standard
8
+ slot-extension contract (`InfrastructureTabsSlot` from
9
+ `@checkstack/infrastructure-common`). Plugins now contribute infrastructure
10
+ tabs via `createSlotExtension`, depending only on the slot owner.
11
+
12
+ The slot system in `@checkstack/frontend-api` gains a second type parameter
13
+ on `createSlot<TContext, TMetadata>` so extensions can declare typed static
14
+ metadata at registration time (label, icon, access rules, ordering for the
15
+ infrastructure tab bar). A new `useSlotExtensions(slot)` hook returns typed
16
+ extensions and subscribes to plugin lifecycle changes.
17
+
18
+ Each tab body now stacks a **Runtime** sub-section (live state, read-only)
19
+ on top of a **Configuration** sub-section (settings, gated by `canUpdate`).
20
+
21
+ **Queue runtime panel.** Surfaces aggregated counts (pending / processing /
22
+ completed / failed) plus three sub-tabs of recent jobs: **Active**, **Recent
23
+ failed** (with the failure message), and **Recent completed** (with
24
+ duration). Job payloads are deliberately not surfaced — they may carry
25
+ secrets and need a separate manage-access gate to be shown.
26
+
27
+ To support this, `Queue<T>` gains a required `listJobs(opts)` method
28
+ returning `JobSummary[]` (no payloads), and `QueueStats` gains a
29
+ `scope: "instance" | "cluster"` field. The in-memory queue keeps rolling
30
+ ring buffers (200 entries) for completed/failed history and tracks active
31
+ jobs by id; BullMQ uses native `getJobs`. `QueueManager.listJobs` aggregates
32
+ across queues and sorts (most-recent-first for terminal states, FIFO for
33
+ active/waiting/delayed).
34
+
35
+ **Cache runtime panel.** Lists the top N entries by size (or by recency) so
36
+ operators can debug a cache filling up. Values are deliberately omitted —
37
+ PII / secret risk. Backends opt in via an optional `listEntries?` method on
38
+ `CacheProvider`; non-supporting backends return `{ supported: false }` and
39
+ the UI renders a "not supported by this backend" hint. The in-memory cache
40
+ implements it using its existing per-entry byte tracking.
41
+
42
+ `CacheStats` also gains `scope: "instance" | "cluster"`.
43
+
44
+ **Multi-instance scope warning.** A new `<InstanceScopeBanner>` component in
45
+ `@checkstack/ui` renders a yellow banner above any runtime panel whose
46
+ backend reports `scope: "instance"` — i.e. in-memory queue or cache running
47
+ in a horizontally scaled deployment. The banner explains the metrics are
48
+ local to the responding replica and recommends switching to a clustered
49
+ backend (Redis-backed queue / cache) for cluster-wide visibility.
50
+
51
+ **Bug fix — stable cache provider proxy.** `CacheManagerImpl.getProvider()`
52
+ now returns a single stable proxy that delegates to whatever provider is
53
+ currently active. Previously, consumers of `createCachedScope` (and any
54
+ direct `cacheManager.getProvider()` caller) captured the active provider
55
+ reference at plugin-init time. After any `setActiveBackend` call — including
56
+ saving the same memory config in the new Cache tab, which reconstructs the
57
+ in-memory cache — those scopes wrote to an orphaned old provider while the
58
+ runtime panel read stats from the new (empty) one, making the runtime panel
59
+ appear to report 0 keys. With the proxy, all consumers share a single stable
60
+ identity and writes always land in the active provider.
61
+
62
+ **Bytes tracking on the in-memory cache.** `InMemoryCache.getStats().sizeBytes`
63
+ now returns a running approximation (UTF-8 bytes of the key plus
64
+ `v8.serialize(value).byteLength`, with a JSON fallback) that's kept in sync
65
+ across all eviction paths. Treat the number as a sanity gauge; it doesn't
66
+ include `Map` per-entry overhead.
67
+
68
+ **Pagination.** Both `Queue<T>.listJobs` and `CacheProvider.listEntries?`
69
+ are offset-paginated. Inputs gain an `offset: number`; outputs change to
70
+ `{ items, total: number | null, hasMore: boolean }`. `total` is nullable
71
+ so backends that can't compute it cheaply still paginate via `hasMore`.
72
+ The UI uses the existing `<Pagination>` component with a 25-row default
73
+ page size. `QueueManager.listJobs` aggregates by over-fetching
74
+ `[0, offset+limit)` per queue, merge-sorting, then slicing the window —
75
+ optimal for the single-queue case, acceptable for the multi-queue case
76
+ within the UI's reasonable page-depth bounds. BullMQ uses native offset
77
+ ranges via `getJobs(types, start, end)` plus `getJobCounts` for `total`.
78
+
79
+ **Pending tab.** The Queue runtime panel exposes a virtual `"pending"`
80
+ state (waiting ∪ delayed, FIFO). It's now the default sub-tab, since
81
+ "what's queued up?" is the most common question. Per-row state is shown
82
+ when viewing the combined list.
83
+
84
+ **Recurring schedules visible under Pending.** Cron- and interval-based
85
+ recurring jobs (e.g. healthchecks) are surfaced under Pending/Delayed
86
+ between fires, with a `nextRunAt` countdown column and a "(recurring)"
87
+ label. `JobSummary` gains optional `nextRunAt: Date` and `recurring:
88
+ boolean` fields. The in-memory queue synthesises these rows from its
89
+ `recurringJobs` registry; BullMQ already materialises the next fire of
90
+ each scheduler as a delayed job and we now surface its trigger time and
91
+ the `repeatJobKey`-derived `recurring` flag.
92
+
93
+ **Bug fix — drop hook emits with no listeners.** `EventBus.emit` no
94
+ longer enqueues a job when zero listeners (distributed or instance-local)
95
+ are registered for the hook. Previously, hooks like
96
+ `core.plugin.initialized` — emitted on every plugin init but subscribed
97
+ to by nothing in the core repo — accumulated one waiting job per emit
98
+ forever. The in-memory queue's `processNext` short-circuits when there
99
+ are zero consumer groups, so its post-loop cleanup never ran for these
100
+ orphaned jobs. The fix drops the emit at the source and logs a debug
101
+ line. Note: in distributed deployments using a Redis-backed queue, this
102
+ means a subscriber on another replica won't receive an event if no
103
+ replica that emits it has a local listener. Plugins needing cross-process
104
+ delivery must register their listener on every replica that should
105
+ receive the hook.
106
+
107
+ **Breaking notes (treated as minor under beta semantics)**:
108
+
109
+ - `@checkstack/infrastructure-common` removes `registerInfrastructureTab`
110
+ and `getInfrastructureTabs`; former callers must register an extension
111
+ into `InfrastructureTabsSlot`.
112
+ - `@checkstack/queue-api`'s `Queue<T>` interface requires the new
113
+ `listJobs(opts)` method returning `ListJobsResult` (paginated). Both
114
+ bundled queue backends (memory, BullMQ) are updated; out-of-tree
115
+ implementations will need to add it.
116
+ - `QueueStats` and `CacheStats` add a required `scope` field.
117
+ - `CacheProvider.listEntries?` (when implemented) now returns
118
+ `ListEntriesResult` instead of `CacheEntrySummary[]`.
119
+ - `JobState` adds a `"pending"` variant.
120
+
121
+ - Updated dependencies [42abfff]
122
+ - Updated dependencies [aa89bc5]
123
+ - @checkstack/common@0.9.0
124
+ - @checkstack/queue-api@0.3.0
125
+ - @checkstack/cache-api@0.3.0
126
+ - @checkstack/api-docs-common@0.1.12
127
+ - @checkstack/auth-common@0.6.6
128
+ - @checkstack/backend-api@0.15.1
129
+ - @checkstack/pluginmanager-common@0.2.1
130
+ - @checkstack/signal-backend@0.2.4
131
+ - @checkstack/signal-common@0.2.2
132
+
133
+ ## 0.9.0
134
+
135
+ ### Minor Changes
136
+
137
+ - 50e5f5f: Add `bunx @checkstack/scripts dev` — a local Checkstack dev server for
138
+ plugin authors that runs from the plugin's own repo without a monorepo
139
+ checkout.
140
+
141
+ Mechanics:
142
+
143
+ - The dev command spawns `core/backend`'s production entry as a child
144
+ process with three env vars wired in:
145
+ - `CHECKSTACK_DEV_PLUGIN_PATH=<cwd>` — backend skips filesystem
146
+ discovery and imports the plugin at this path as a manual plugin.
147
+ - `CHECKSTACK_DEV_EXTRA_PLUGIN_PATHS=<JSON array>` — additional
148
+ backend plugins co-loaded as manual plugins. The dev command walks
149
+ the plugin under dev's `package.json#dependencies` recursively to
150
+ discover every `@checkstack/*-backend` package and pass their
151
+ module paths through. Auto-includes
152
+ `@checkstack/queue-memory-backend` +
153
+ `@checkstack/cache-memory-backend` when no other queue/cache
154
+ provider is in the dep graph, so `coreServices.queueManager` /
155
+ `coreServices.cacheManager` always have a registered strategy on
156
+ boot. Without this co-loading, plugins that depend on
157
+ `healthcheck-backend`, `notification-backend`, etc. would hit
158
+ unregistered services and the boot would deadlock.
159
+ - `CHECKSTACK_DEV_AUTH=true` — backend registers a synthetic
160
+ `AuthService` that auto-grants every registered access rule.
161
+ Refused when `NODE_ENV=production` so accidental misuse is loud.
162
+ - A file watcher under the plugin's `./src` triggers a full backend
163
+ restart (debounced) on save. Bun's startup is sub-second for a single
164
+ plugin, so the loop stays tight.
165
+ - For frontend plugins (or bundle primaries with a `-frontend`
166
+ sibling), the dev command additionally spawns a Vite dev server on
167
+ port 5173 (configurable via `--frontend-port`). Vite serves
168
+ `core/frontend`'s new `dev-main.tsx` shell — the same App.tsx,
169
+ loadPlugins(), ThemeProvider, etc. that ship in production. The
170
+ plugin module is mounted via a `virtual:checkstack-dev-plugin` alias
171
+ Vite resolves at config time. React Fast Refresh works for component
172
+ edits.
173
+ - On boot, the dev command validates the plugin's `package.json`
174
+ against the same `installPackageMetadataSchema` the runtime install
175
+ pipeline uses, so missing required fields fail fast.
176
+
177
+ Reuses 100% of the production boot code path — no parallel dev backend
178
+ to drift from. New code surfaces:
179
+
180
+ - `core/backend/src/services/dev-auth.ts` — the synthetic auth service.
181
+ Inert unless `CHECKSTACK_DEV_AUTH=true`.
182
+ - `core/scripts/src/commands/dev-server.ts` — the CLI command.
183
+ - `core/scripts/src/commands/dev-deps-resolver.ts` — pure function that
184
+ walks the plugin's deps and resolves the co-load set; covered by 8
185
+ unit tests.
186
+ - `core/scripts/src/commands/dev-frontend.ts` — Vite spawn helper.
187
+ - `core/frontend/src/dev-main.tsx` — frontend dev-shell entry.
188
+
189
+ `@checkstack/scripts` now depends on `@checkstack/backend`,
190
+ `@checkstack/frontend`, `@checkstack/frontend-api`, `@checkstack/ui`,
191
+ `vite`, and `@vitejs/plugin-react` so a `bunx` invocation pulls in
192
+ everything needed for the dev server in one shot.
193
+
194
+ Replaces the previous "three patterns" plugin-development guide with a
195
+ single `bun run dev` workflow.
196
+
197
+ A new ESLint rule branch in `no-extraneous-runtime-deps` ignores
198
+ `virtual:` module specifiers (resolved by bundler aliases at runtime,
199
+ not installed from npm).
200
+
201
+ Scaffold templates updated for one-click compatibility — `bun run create`
202
+ now produces plugin packages that pass the dev-server's
203
+ `installPackageMetadataSchema` gate and ship `dev` / `pack` scripts plus
204
+ `@checkstack/scripts` in devDependencies, so a freshly scaffolded plugin
205
+ runs `bun run dev` without any further file edits. Required metadata
206
+ (`description`, `author`, `license: "Elastic-2.0"`, `checkstack.pluginId`)
207
+ is filled in by the scaffold; `@checkstack/scripts plugin-pack
208
+ --validate-only` accepts the rendered package.json directly. Templates
209
+ also reformatted from one-line JSON-in-handlebars to readable
210
+ multi-line.
211
+
212
+ New scaffold tests in `core/scripts/src/templates.test.ts` render each
213
+ template type and assert: dev-server validation passes, `dev` script
214
+ present (backend/frontend), `pack` script present, `@checkstack/scripts`
215
+ in devDependencies.
216
+
217
+ In addition, the new `dev-internals.ts`, `dev-lifecycle.ts`,
218
+ `dev-deps-resolver.ts`, and refactored `dev-frontend.ts` ship 58
219
+ unit tests covering arg parsing, package.json validation, backend
220
+ entry resolution, frontend-spawn decision, child env construction,
221
+ the debounce watcher, the spawn → restart → shutdown lifecycle (with
222
+ hard-kill SIGKILL fallback), the dev-auth service, and the bundle
223
+ sibling resolver — all driven through injectable seams so no real
224
+ process / Postgres / Vite is needed at test time.
225
+
226
+ - 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
227
+ (including private GitHub Enterprise instances), or tarball uploads at
228
+ runtime, with multi-package bundles, dependency-derived compatibility checks,
229
+ multi-instance coordination via a Postgres artifact store, and
230
+ single-coordinator destructive cleanup.
231
+
232
+ Highlights:
233
+
234
+ - New `PluginSource` discriminated union and `PluginInstaller` /
235
+ `PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
236
+ GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
237
+ GitHub Enterprise can install from `https://ghe.example.com/api/v3`
238
+ instead of `api.github.com`.
239
+ - New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
240
+ every plugin's `package.json` at install time. Required fields: `name`,
241
+ `version`, `description`, `author`, `license`, `checkstack.type`,
242
+ `checkstack.pluginId`. Optional: `checkstack.bundle`,
243
+ `checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
244
+ - New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
245
+ `list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
246
+ `events` procedures.
247
+ - New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
248
+ with per-row uninstall (typed-confirmation modal, schema/configs/cascade
249
+ toggles), install page with NPM / Tarball Upload / GitHub Release tabs
250
+ (Catalog tab disabled — coming soon), and an events page surfacing the
251
+ install/uninstall audit log.
252
+ - New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
253
+ per-package mode produces an npm-shaped tarball; `--bundle` mode produces
254
+ an outer tarball containing every sibling declared in
255
+ `package.json#checkstack.bundle`. Published to npm so external authors
256
+ can `bunx` it directly without a workspace checkout.
257
+ - Compatibility derived from `package.json#dependencies` ranges
258
+ (`semver.satisfies` against the platform's loaded `@checkstack/*`
259
+ versions) — no separate `compatibility` field.
260
+ - Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
261
+ install/uninstall; receiving instances do in-process register/unregister
262
+ only. Destructive ops (drop schema, delete plugin_configs, delete
263
+ artifacts, delete `plugins` rows) run exactly once on the originator.
264
+ - Fresh-instance bootstrap: `loadPlugins()` hydrates any
265
+ `is_uninstallable=true` plugin missing from `node_modules` from the
266
+ artifact store before normal Phase 1 register.
267
+ - New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
268
+ (audit/error log). `plugins` extended with `version`, `metadata`,
269
+ `source`, `bundle_id`, `is_primary`. Local plugin sync now writes
270
+ `version` from each plugin's `package.json` so the admin UI shows real
271
+ versions instead of `—`.
272
+ - Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
273
+ the install UI; access-gated by `pluginmanager.plugin.manage`.
274
+ - Plugin Manager menu link added to the user menu (main grid, alongside
275
+ Profile / Notification Settings / etc.).
276
+
277
+ Cross-cutting changes:
278
+
279
+ - Backend request/response logging now flows through `rootLogger` (winston)
280
+ instead of `hono/logger`. 5xx responses include the response body inline
281
+ so swallowed early-return errors are visible in the log.
282
+ - The `/api/:pluginId/*` dispatcher now logs which core service is missing
283
+ or which `pluginId` had no metadata when it 500s.
284
+ - New `registerCorePluginMetadata` on `PluginManager` for core routers
285
+ (like the plugin manager itself) that need their metadata visible to the
286
+ RPC dispatcher without going through the full plugin lifecycle.
287
+ - ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
288
+ between `null` (writes a real SQL NULL) and `undefined` (skip the column
289
+ on insert), so treating them as interchangeable produced latent bugs at
290
+ the persistence boundary. The bulk of the patch-bumped packages above
291
+ reflect lint-fix touches that landed when this rule was relaxed.
292
+ - Workspace-wide license normalization to `Elastic-2.0` (matches
293
+ `LICENSE.md`). Every `package.json` in the workspace now declares the
294
+ same SPDX identifier; the patch bumps capture this.
295
+
296
+ Plugin packages (every `plugins/*`): added a `pack` npm script
297
+ (`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
298
+ `pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
299
+ so install-time validation passes, stubbed any missing required metadata
300
+ fields (`description`, `author`, `license`), and added
301
+ `checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
302
+ jira, queue-bullmq, queue-memory, cache-memory).
303
+
304
+ Breaking changes:
305
+
306
+ - The legacy single-method `PluginInstaller` interface (`install(packageName)`)
307
+ is removed. Callers must use `coreServices.pluginInstallerRegistry`.
308
+ - The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
309
+ Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
310
+ and `createPluginManagerRouter` in `core/backend`.
311
+ - `@checkstack/test-utils-backend` no longer exports
312
+ `createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
313
+ it shimmed is gone).
314
+
315
+ Note: bumps are limited to `minor` (for packages with new public API
316
+ surface) and `patch` (for downstream consumers, license normalization,
317
+ and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
318
+ the legacy interface had no third-party consumers in the wild before this
319
+ runtime plugin system landed, and the contract surface is the same shape
320
+ modulo the rename.
321
+
322
+ ### Patch Changes
323
+
324
+ - Updated dependencies [50e5f5f]
325
+ - @checkstack/auth-common@0.6.5
326
+ - @checkstack/backend-api@0.15.0
327
+ - @checkstack/common@0.8.0
328
+ - @checkstack/drizzle-helper@0.0.5
329
+ - @checkstack/pluginmanager-common@0.2.0
330
+ - @checkstack/queue-api@0.2.18
331
+ - @checkstack/signal-backend@0.2.3
332
+ - @checkstack/api-docs-common@0.1.11
333
+ - @checkstack/cache-api@0.2.4
334
+ - @checkstack/signal-common@0.2.1
335
+
3
336
  ## 0.8.2
4
337
 
5
338
  ### Patch Changes
@@ -0,0 +1,34 @@
1
+ CREATE TABLE "plugin_artifacts" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "plugin_name" text NOT NULL,
4
+ "version" text NOT NULL,
5
+ "bundle_id" uuid,
6
+ "tarball" text NOT NULL,
7
+ "content_hash" text NOT NULL,
8
+ "size_bytes" integer NOT NULL,
9
+ "created_at" timestamp DEFAULT now() NOT NULL
10
+ );
11
+ --> statement-breakpoint
12
+ CREATE TABLE "plugin_install_events" (
13
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
14
+ "plugin_name" text,
15
+ "bundle_id" uuid,
16
+ "action" text NOT NULL,
17
+ "phase" text NOT NULL,
18
+ "status" text NOT NULL,
19
+ "source" jsonb,
20
+ "error" text,
21
+ "instance_id" text NOT NULL,
22
+ "user_id" text,
23
+ "created_at" timestamp DEFAULT now() NOT NULL
24
+ );
25
+ --> statement-breakpoint
26
+ ALTER TABLE "plugins" ADD COLUMN "version" text DEFAULT '' NOT NULL;--> statement-breakpoint
27
+ ALTER TABLE "plugins" ADD COLUMN "metadata" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
28
+ ALTER TABLE "plugins" ADD COLUMN "source" jsonb;--> statement-breakpoint
29
+ ALTER TABLE "plugins" ADD COLUMN "bundle_id" uuid;--> statement-breakpoint
30
+ ALTER TABLE "plugins" ADD COLUMN "is_primary" boolean DEFAULT false NOT NULL;--> statement-breakpoint
31
+ CREATE UNIQUE INDEX "plugin_artifacts_name_version_idx" ON "plugin_artifacts" USING btree ("plugin_name","version");--> statement-breakpoint
32
+ CREATE INDEX "plugin_artifacts_content_hash_idx" ON "plugin_artifacts" USING btree ("content_hash");--> statement-breakpoint
33
+ CREATE INDEX "plugin_install_events_name_created_idx" ON "plugin_install_events" USING btree ("plugin_name","created_at");--> statement-breakpoint
34
+ CREATE INDEX "plugin_install_events_status_created_idx" ON "plugin_install_events" USING btree ("status","created_at");