Personal Telegram developer console for GitHub
feat(cloudflare): register READ plugin at runtime
davoodmehraban89 committed
Oct 4, 2026 at 23:30 UTC
739580fc52d46450c7e29558e79d973cdf50abb9
1 file changed
+10
-2
src/bot.js
+10
-2
@@ -11,6 +11,8 @@ import { AuditLogger } from './core/audit.js';
11
import { PluginRouter } from './core/router.js';
12
import { buildApprovedActionFailedView, buildCallbackFailureView } from './core/callback-failure-view.js';
13
import { createGitHubPlugin } from './plugins/github/plugin.js';
14
+import { CloudflareService } from './plugins/cloudflare/service.js';
15
+import { createCloudflarePlugin } from './plugins/cloudflare/plugin.js';
16
17
const INTENT_ID_PATTERN = /^[A-Za-z0-9_-]{8}$/;
18
const QUICK_MENU = Object.freeze({
@@ -124,10 +126,16 @@ export class NexaDevBot {
126
menu: this.menu,
127
workspaces: this.workspaceStore.isConfigured() ? this.workspaceStore : null
128
});
127
- this.registry = new PluginRegistry([this.githubPlugin]);
129
+ this.cloudflare = new CloudflareService({
130
+ token: env.CLOUDFLARE_API_TOKEN || '',
131
+ accountId: env.CLOUDFLARE_ACCOUNT_ID || '',
132
+ workerName: env.CLOUDFLARE_WORKER_NAME || 'nexa-dev-bot'
133
+ });
134
+ this.cloudflarePlugin = createCloudflarePlugin({ cloudflare: this.cloudflare });
135
+ this.registry = new PluginRegistry([this.githubPlugin, this.cloudflarePlugin]);
136
this.policy = new ActionPolicy();
137
this.audit = new AuditLogger({
130
- secrets: [env.TELEGRAM_BOT_TOKEN, env.TELEGRAM_WEBHOOK_SECRET, env.GITHUB_TOKEN, env.APPROVAL_SIGNING_SECRET]
138
+ secrets: [env.TELEGRAM_BOT_TOKEN, env.TELEGRAM_WEBHOOK_SECRET, env.GITHUB_TOKEN, env.CLOUDFLARE_API_TOKEN, env.APPROVAL_SIGNING_SECRET]
139
});
140
this.router = new PluginRouter({ registry: this.registry, policy: this.policy, audit: this.audit });
141
}