Files
paperclip/packages/plugins/examples/plugin-hello-world-example/src/worker.ts
2026-03-13 16:22:34 -05:00

28 lines
705 B
TypeScript

import { definePlugin, runWorker } from "@paperclipai/plugin-sdk";
const PLUGIN_NAME = "hello-world-example";
const HEALTH_MESSAGE = "Hello World example plugin ready";
/**
* Worker lifecycle hooks for the Hello World reference plugin.
* This stays intentionally small so new authors can copy the shape quickly.
*/
const plugin = definePlugin({
/**
* Called when the host starts the plugin worker.
*/
async setup(ctx) {
ctx.logger.info(`${PLUGIN_NAME} plugin setup complete`);
},
/**
* Called by the host health probe endpoint.
*/
async onHealth() {
return { status: "ok", message: HEALTH_MESSAGE };
},
});
export default plugin;
runWorker(plugin, import.meta.url);