thepopebot 1.2.63 → 1.2.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,20 +130,6 @@ function AppSidebar({ user }) {
130
130
  ) }),
131
131
  collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Notifications" })
132
132
  ] }) }),
133
- /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
134
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
135
- SidebarMenuButton,
136
- {
137
- className: collapsed ? "justify-center" : "",
138
- onClick: () => window.open("https://www.skool.com/ai-architects", "_blank"),
139
- children: [
140
- /* @__PURE__ */ jsx(LifeBuoyIcon, { size: 16 }),
141
- !collapsed && /* @__PURE__ */ jsx("span", { children: "Support" })
142
- ]
143
- }
144
- ) }),
145
- collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Support" })
146
- ] }) }),
147
133
  updateAvailable && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
148
134
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
149
135
  SidebarMenuButton,
@@ -169,6 +155,20 @@ function AppSidebar({ user }) {
169
155
  "Upgrade to v",
170
156
  updateAvailable
171
157
  ] })
158
+ ] }) }),
159
+ /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
160
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
161
+ SidebarMenuButton,
162
+ {
163
+ className: collapsed ? "justify-center" : "",
164
+ onClick: () => window.open("https://www.skool.com/ai-architects", "_blank"),
165
+ children: [
166
+ /* @__PURE__ */ jsx(LifeBuoyIcon, { size: 16 }),
167
+ !collapsed && /* @__PURE__ */ jsx("span", { children: "Support" })
168
+ ]
169
+ }
170
+ ) }),
171
+ collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Support" })
172
172
  ] }) })
173
173
  ] })
174
174
  ] }),
@@ -162,24 +162,6 @@ export function AppSidebar({ user }) {
162
162
  </Tooltip>
163
163
  </SidebarMenuItem>
164
164
 
165
- {/* Support */}
166
- <SidebarMenuItem>
167
- <Tooltip>
168
- <TooltipTrigger asChild>
169
- <SidebarMenuButton
170
- className={collapsed ? 'justify-center' : ''}
171
- onClick={() => window.open('https://www.skool.com/ai-architects', '_blank')}
172
- >
173
- <LifeBuoyIcon size={16} />
174
- {!collapsed && <span>Support</span>}
175
- </SidebarMenuButton>
176
- </TooltipTrigger>
177
- {collapsed && (
178
- <TooltipContent side="right">Support</TooltipContent>
179
- )}
180
- </Tooltip>
181
- </SidebarMenuItem>
182
-
183
165
  {/* Upgrade (only when update is available) */}
184
166
  {updateAvailable && (
185
167
  <SidebarMenuItem>
@@ -212,6 +194,24 @@ export function AppSidebar({ user }) {
212
194
  </SidebarMenuItem>
213
195
  )}
214
196
 
197
+ {/* Support */}
198
+ <SidebarMenuItem>
199
+ <Tooltip>
200
+ <TooltipTrigger asChild>
201
+ <SidebarMenuButton
202
+ className={collapsed ? 'justify-center' : ''}
203
+ onClick={() => window.open('https://www.skool.com/ai-architects', '_blank')}
204
+ >
205
+ <LifeBuoyIcon size={16} />
206
+ {!collapsed && <span>Support</span>}
207
+ </SidebarMenuButton>
208
+ </TooltipTrigger>
209
+ {collapsed && (
210
+ <TooltipContent side="right">Support</TooltipContent>
211
+ )}
212
+ </Tooltip>
213
+ </SidebarMenuItem>
214
+
215
215
  </SidebarMenu>
216
216
  </SidebarHeader>
217
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thepopebot",
3
- "version": "1.2.63",
3
+ "version": "1.2.64",
4
4
  "type": "module",
5
5
  "description": "Create autonomous AI agents with a two-layer architecture: Next.js Event Handler + Docker Agent.",
6
6
  "bin": {
@@ -110,6 +110,7 @@ export function writeEnvFile(config) {
110
110
  providerEnvKey,
111
111
  providerApiKey,
112
112
  openaiApiKey,
113
+ openaiBaseUrl,
113
114
  telegramChatId,
114
115
  telegramVerification,
115
116
  appUrl,
@@ -122,6 +123,7 @@ export function writeEnvFile(config) {
122
123
  if (providerEnvKey !== 'OPENAI_API_KEY') {
123
124
  apiKeyLines += `\n\n# OpenAI API key for Whisper voice transcription (optional)\nOPENAI_API_KEY=${openaiApiKey || ''}`;
124
125
  }
126
+ apiKeyLines += `\n\n# OpenAI-compatible base URL (optional, event handler only)\nOPENAI_BASE_URL=${openaiBaseUrl || ''}`;
125
127
 
126
128
  // Generate AUTH_SECRET (32 random bytes, base64 encoded)
127
129
  const authSecret = randomBytes(32).toString('base64');
package/setup/setup.mjs CHANGED
@@ -114,6 +114,7 @@ async function main() {
114
114
  let agentModel = null;
115
115
  const collectedKeys = {};
116
116
  let braveKey = null;
117
+ let openaiBaseUrl = null;
117
118
  let webhookSecret = null;
118
119
  let owner = null;
119
120
  let repo = null;
@@ -421,7 +422,11 @@ async function main() {
421
422
  const providerLabel = env.LLM_PROVIDER === 'custom'
422
423
  ? 'Custom / Local'
423
424
  : (PROVIDERS[env.LLM_PROVIDER]?.label || env.LLM_PROVIDER);
424
- printSuccess(`LLM: ${providerLabel} / ${env.LLM_MODEL} (${maskSecret(existingKey)})`);
425
+ let llmDisplay = `LLM: ${providerLabel} / ${env.LLM_MODEL} (${maskSecret(existingKey)})`;
426
+ if (env.LLM_PROVIDER === 'openai' && env.OPENAI_BASE_URL) {
427
+ llmDisplay += ` @ ${env.OPENAI_BASE_URL}`;
428
+ }
429
+ printSuccess(llmDisplay);
425
430
  if (!await confirm('Reconfigure?', false)) {
426
431
  agentProvider = env.LLM_PROVIDER;
427
432
  agentModel = env.LLM_MODEL;
@@ -477,6 +482,69 @@ async function main() {
477
482
  }
478
483
  }
479
484
 
485
+ // OpenAI custom base URL (event handler only, not the Docker agent)
486
+ if (agentProvider === 'openai') {
487
+ if (isRerun && env?.OPENAI_BASE_URL) {
488
+ // Existing base URL — offer to reconfigure
489
+ printSuccess(`Custom API URL: ${env.OPENAI_BASE_URL}`);
490
+ if (await confirm('Reconfigure?', false)) {
491
+ const useCustomUrl = await confirm('Use a custom OpenAI-compatible API URL?', false);
492
+ if (useCustomUrl) {
493
+ printInfo('If the model runs on this machine, use http://host.docker.internal:<port>');
494
+ printInfo('instead of localhost (localhost won\'t work from inside Docker)\n');
495
+ const { baseUrl } = await inquirer.prompt([
496
+ {
497
+ type: 'input',
498
+ name: 'baseUrl',
499
+ message: 'OpenAI-compatible base URL:',
500
+ validate: (input) => {
501
+ if (!input) return 'URL is required';
502
+ if (!input.startsWith('http://') && !input.startsWith('https://')) {
503
+ return 'URL must start with http:// or https://';
504
+ }
505
+ return true;
506
+ },
507
+ },
508
+ ]);
509
+ openaiBaseUrl = baseUrl;
510
+ changedVars['OPENAI_BASE_URL'] = openaiBaseUrl;
511
+ printSuccess(`Custom base URL: ${openaiBaseUrl}`);
512
+ } else {
513
+ // Clear existing base URL
514
+ changedVars['OPENAI_BASE_URL'] = '';
515
+ }
516
+ } else {
517
+ openaiBaseUrl = env.OPENAI_BASE_URL;
518
+ }
519
+ } else if (!openaiBaseUrl) {
520
+ // No existing base URL — ask if they want one
521
+ const useCustomUrl = await confirm('Use a custom OpenAI-compatible API URL? (e.g. Ollama, vLLM)', false);
522
+ if (useCustomUrl) {
523
+ printInfo('If the model runs on this machine, use http://host.docker.internal:<port>');
524
+ printInfo('instead of localhost (localhost won\'t work from inside Docker)\n');
525
+ const { baseUrl } = await inquirer.prompt([
526
+ {
527
+ type: 'input',
528
+ name: 'baseUrl',
529
+ message: 'OpenAI-compatible base URL:',
530
+ validate: (input) => {
531
+ if (!input) return 'URL is required';
532
+ if (!input.startsWith('http://') && !input.startsWith('https://')) {
533
+ return 'URL must start with http:// or https://';
534
+ }
535
+ return true;
536
+ },
537
+ },
538
+ ]);
539
+ openaiBaseUrl = baseUrl;
540
+ if (isRerun) {
541
+ changedVars['OPENAI_BASE_URL'] = openaiBaseUrl;
542
+ }
543
+ printSuccess(`Custom base URL: ${openaiBaseUrl}`);
544
+ }
545
+ }
546
+ }
547
+
480
548
  // Step 3b: Voice Messages (OpenAI optional)
481
549
  if (collectedKeys['OPENAI_API_KEY']) {
482
550
  printSuccess('Your OpenAI key can also power voice messages.');
@@ -684,6 +752,7 @@ async function main() {
684
752
  providerEnvKey,
685
753
  providerApiKey: collectedKeys[providerEnvKey] || '',
686
754
  openaiApiKey: collectedKeys['OPENAI_API_KEY'] || '',
755
+ openaiBaseUrl: openaiBaseUrl || '',
687
756
  telegramChatId: null,
688
757
  telegramVerification: null,
689
758
  appUrl,