thepopebot 1.2.28 → 1.2.30

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.
package/lib/ai/model.js CHANGED
@@ -13,7 +13,8 @@ const DEFAULT_MODELS = {
13
13
  * LLM_PROVIDER — "anthropic" (default), "openai", "google"
14
14
  * LLM_MODEL — Model name override (e.g. "claude-sonnet-4-20250514")
15
15
  * ANTHROPIC_API_KEY — Required for anthropic provider
16
- * OPENAI_API_KEY — Required for openai provider
16
+ * OPENAI_API_KEY — Required for openai provider (optional with OPENAI_BASE_URL)
17
+ * OPENAI_BASE_URL — Custom OpenAI-compatible base URL (e.g. http://localhost:11434/v1 for Ollama)
17
18
  * GOOGLE_API_KEY — Required for google provider
18
19
  *
19
20
  * @param {object} [options]
@@ -40,14 +41,16 @@ export async function createModel(options = {}) {
40
41
  case 'openai': {
41
42
  const { ChatOpenAI } = await import('@langchain/openai');
42
43
  const apiKey = process.env.OPENAI_API_KEY;
43
- if (!apiKey) {
44
- throw new Error('OPENAI_API_KEY environment variable is required');
44
+ const baseURL = process.env.OPENAI_BASE_URL;
45
+ if (!apiKey && !baseURL) {
46
+ throw new Error('OPENAI_API_KEY environment variable is required (or set OPENAI_BASE_URL for local models)');
45
47
  }
46
- return new ChatOpenAI({
47
- modelName,
48
- maxTokens,
49
- openAIApiKey: apiKey,
50
- });
48
+ const config = { modelName, maxTokens };
49
+ config.apiKey = apiKey || 'not-needed';
50
+ if (baseURL) {
51
+ config.configuration = { baseURL };
52
+ }
53
+ return new ChatOpenAI(config);
51
54
  }
52
55
  case 'google': {
53
56
  const { ChatGoogleGenerativeAI } = await import('@langchain/google-genai');
@@ -84,19 +84,15 @@ function AppSidebar({ user }) {
84
84
  {
85
85
  className: collapsed ? "justify-center" : "",
86
86
  onClick: () => {
87
- window.location.href = "/notifications";
87
+ window.location.href = "/swarm";
88
88
  },
89
89
  children: [
90
- /* @__PURE__ */ jsx(BellIcon, { size: 16 }),
91
- !collapsed && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
92
- "Notifications",
93
- unreadCount > 0 && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center rounded-full bg-destructive px-1.5 py-0.5 text-[10px] font-medium leading-none text-destructive-foreground", children: unreadCount })
94
- ] }),
95
- collapsed && unreadCount > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 inline-flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground", children: unreadCount })
90
+ /* @__PURE__ */ jsx(SwarmIcon, { size: 16 }),
91
+ !collapsed && /* @__PURE__ */ jsx("span", { children: "Swarm" })
96
92
  ]
97
93
  }
98
94
  ) }),
99
- collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Notifications" })
95
+ collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Swarm" })
100
96
  ] }) }),
101
97
  /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
102
98
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
@@ -104,15 +100,19 @@ function AppSidebar({ user }) {
104
100
  {
105
101
  className: collapsed ? "justify-center" : "",
106
102
  onClick: () => {
107
- window.location.href = "/swarm";
103
+ window.location.href = "/notifications";
108
104
  },
109
105
  children: [
110
- /* @__PURE__ */ jsx(SwarmIcon, { size: 16 }),
111
- !collapsed && /* @__PURE__ */ jsx("span", { children: "Swarm" })
106
+ /* @__PURE__ */ jsx(BellIcon, { size: 16 }),
107
+ !collapsed && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
108
+ "Notifications",
109
+ unreadCount > 0 && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center rounded-full bg-destructive px-1.5 py-0.5 text-[10px] font-medium leading-none text-destructive-foreground", children: unreadCount })
110
+ ] }),
111
+ collapsed && unreadCount > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 inline-flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground", children: unreadCount })
112
112
  ]
113
113
  }
114
114
  ) }),
115
- collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Swarm" })
115
+ collapsed && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Notifications" })
116
116
  ] }) })
117
117
  ] })
118
118
  ] }),
@@ -97,6 +97,26 @@ export function AppSidebar({ user }) {
97
97
  </Tooltip>
98
98
  </SidebarMenuItem>
99
99
 
100
+ {/* Swarm */}
101
+ <SidebarMenuItem>
102
+ <Tooltip>
103
+ <TooltipTrigger asChild>
104
+ <SidebarMenuButton
105
+ className={collapsed ? 'justify-center' : ''}
106
+ onClick={() => {
107
+ window.location.href = '/swarm';
108
+ }}
109
+ >
110
+ <SwarmIcon size={16} />
111
+ {!collapsed && <span>Swarm</span>}
112
+ </SidebarMenuButton>
113
+ </TooltipTrigger>
114
+ {collapsed && (
115
+ <TooltipContent side="right">Swarm</TooltipContent>
116
+ )}
117
+ </Tooltip>
118
+ </SidebarMenuItem>
119
+
100
120
  {/* Notifications */}
101
121
  <SidebarMenuItem>
102
122
  <Tooltip>
@@ -131,26 +151,6 @@ export function AppSidebar({ user }) {
131
151
  </Tooltip>
132
152
  </SidebarMenuItem>
133
153
 
134
- {/* Swarm */}
135
- <SidebarMenuItem>
136
- <Tooltip>
137
- <TooltipTrigger asChild>
138
- <SidebarMenuButton
139
- className={collapsed ? 'justify-center' : ''}
140
- onClick={() => {
141
- window.location.href = '/swarm';
142
- }}
143
- >
144
- <SwarmIcon size={16} />
145
- {!collapsed && <span>Swarm</span>}
146
- </SidebarMenuButton>
147
- </TooltipTrigger>
148
- {collapsed && (
149
- <TooltipContent side="right">Swarm</TooltipContent>
150
- )}
151
- </Tooltip>
152
- </SidebarMenuItem>
153
-
154
154
  </SidebarMenu>
155
155
  </SidebarHeader>
156
156
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thepopebot",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
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": {