mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 13:36:48 +00:00
feat(plugins): hero widget slot + Koffi reference plugin
Widget plugins can now declare capabilities.widget.slot 'hero' to render as a transparent, click-through overlay sitting on the boarding-pass bar's top edge (migration 157 persists capabilities; manifest validation server+SDK, feed exposes the slot, dashboard mounts hero frames above the pass). Sidebar stays the default slot. Replaces the trip-countdown example with Koffi, the TREK mascot: an animated suitcase with a 14-state behavior engine driven by real trip data — walking, waving, napping, trolley rolls, passport-stamp stickers, a split-flap luggage- tag countdown under 7 days, and sunglasses while the trip runs. Validated by the SDK suite like any author plugin; published as mauriceboe/trek-plugin-koffi in the registry. Migrations 156/157 follow the idempotent ALTER pattern (the reconciliation test re-runs everything from v135, so duplicate-column must stay non-fatal).
This commit is contained in:
@@ -86,8 +86,8 @@ describe('scaffold + validate CLIs', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('reference plugin (examples/trip-countdown)', () => {
|
||||
const dir = path.resolve(import.meta.dirname, '..', 'examples', 'trip-countdown');
|
||||
describe('reference plugin (examples/koffi)', () => {
|
||||
const dir = path.resolve(import.meta.dirname, '..', 'examples', 'koffi');
|
||||
|
||||
it('passes the same validation authors run', () => {
|
||||
const r = validatePluginDir(dir);
|
||||
@@ -95,10 +95,13 @@ describe('reference plugin (examples/trip-countdown)', () => {
|
||||
expect(r.ok).toBe(true);
|
||||
});
|
||||
|
||||
it('has a valid, minimal-permission manifest', () => {
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(dir, 'trek-plugin.json'), 'utf8'));
|
||||
it('has a valid, minimal-permission hero-widget manifest', () => {
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(dir, 'trek-plugin.json'), 'utf8')) as {
|
||||
capabilities?: { widget?: { slot?: string } };
|
||||
};
|
||||
const res = validateManifest(manifest);
|
||||
expect(res.ok).toBe(true);
|
||||
expect(res.manifest?.permissions).toEqual(['db:read:trips']);
|
||||
expect(manifest.capabilities?.widget?.slot).toBe('hero');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user