feat: add plugin worker protocol, bootstrap and plugin_storage table

Worker-side ctx proxy plus the message envelope it talks over, and the
per-plugin key/value table behind ctx.storage with migrations for all
three dialects. Rows cascade with the plugin so uninstalling leaves
nothing behind.
This commit is contained in:
LukeGus committed 2026-09-21 07:19:01 -05:00
1 parent a1805cb7ae
commit 248698f62d
19 files changed
+30035

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
CREATE TABLE `plugin_storage` (
`id` int AUTO_INCREMENT NOT NULL,
`plugin_id` varchar(255) NOT NULL,
`key` varchar(255) NOT NULL,
`value` text NOT NULL,
`updated_at` varchar(255) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
CONSTRAINT `plugin_storage_id` PRIMARY KEY(`id`),
CONSTRAINT `idx_plugin_storage_plugin_key` UNIQUE(`plugin_id`,`key`)
);
--> statement-breakpoint
ALTER TABLE `plugin_storage` ADD CONSTRAINT `plugin_storage_plugin_id_plugins_id_fk` FOREIGN KEY (`plugin_id`) REFERENCES `plugins`(`id`) ON DELETE cascade ON UPDATE no action;
File diff suppressed because it is too large. Load diff
+7
View File
@@ -169,6 +169,13 @@
"when": 1789751455875,
"tag": "0023_even_beast",
"breakpoints": true
},
{
"idx": 24,
"version": "5",
"when": 1789991404402,
"tag": "0024_thin_colleen_wing",
"breakpoints": true
}
]
}
@@ -0,0 +1,10 @@
CREATE TABLE "plugin_storage" (
"id" serial PRIMARY KEY NOT NULL,
"plugin_id" varchar(255) NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"updated_at" varchar(255) DEFAULT CURRENT_TIMESTAMP NOT NULL
);
--> statement-breakpoint
ALTER TABLE "plugin_storage" ADD CONSTRAINT "plugin_storage_plugin_id_plugins_id_fk" FOREIGN KEY ("plugin_id") REFERENCES "public"."plugins"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "idx_plugin_storage_plugin_key" ON "plugin_storage" USING btree ("plugin_id","key");
File diff suppressed because it is too large. Load diff
+7
View File
@@ -176,6 +176,13 @@
"when": 1789751455415,
"tag": "0024_flimsy_forge",
"breakpoints": true
},
{
"idx": 25,
"version": "7",
"when": 1789991403847,
"tag": "0025_purple_squirrel_girl",
"breakpoints": true
}
]
}
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE `plugin_storage` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`plugin_id` text NOT NULL,
`key` text NOT NULL,
`value` text NOT NULL,
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
FOREIGN KEY (`plugin_id`) REFERENCES `plugins`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `idx_plugin_storage_plugin_key` ON `plugin_storage` (`plugin_id`,`key`);
File diff suppressed because it is too large. Load diff
+7
View File
@@ -148,6 +148,13 @@
"when": 1789751454932,
"tag": "0020_moaning_fat_cobra",
"breakpoints": true
},
{
"idx": 21,
"version": "6",
"when": 1789991403283,
"tag": "0021_dashing_lester",
"breakpoints": true
}
]
}