ubiquity-os / ubiquity-os-kernel

1 stars 13 forks source link

Express Style Module Chaining #3

Closed 0x4007 closed 7 months ago

0x4007 commented 8 months ago

Express.js allows us to attach route handlers. From memory this appears in the style of:


app.get("*", myHandler);

function myHandler(req: Express.Request, res: Express.Response, next: Express.NextFunction) { ... }

I think it's a good idea to allow for similar composability for the bot events, with easy plugin chaining. If I recall correctly, every time a route handler is added, it will shift into the beginning of the handlers array. We should emulate Express's implementation by looking at their source code.

gitcoindev commented 7 months ago

/start

ubiquibot[bot] commented 7 months ago
! No price label is set, so this is not ready to be self assigned yet.
0x4007 commented 7 months ago

This implicitly requires a ubiquibot-config.yml schema update as well to support adding separate plugins from other repositories/API endpoints.

Did you put any thoughts into this after starting?

ubiquibot[bot] commented 7 months ago
# No linked pull requests to close
0x4007 commented 7 months ago

I think it makes more sense to focus on designing a .yml config schema that is compatible with "unix style piping" so that the kernel knows to pipe output from one plugin to the next just from the ubiquibot-config.yml information.

ubiquibot[bot] commented 7 months ago
# Issue was not closed as completed. Skipping.