clawkit-ai 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sync.mjs +71 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawkit-ai",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Transform your OpenClaw agent into a production-ready AI assistant with memory, skills, and a dashboard",
5
5
  "type": "module",
6
6
  "bin": {
package/src/sync.mjs CHANGED
@@ -196,9 +196,79 @@ function gatherState(workspace) {
196
196
  if (tzMatch) state.preferences.timezone = tzMatch[1];
197
197
  }
198
198
 
199
- // Connected accounts from TOOLS.md
199
+ // Connected accounts from TOOLS.md + docs/tool-configs.md
200
200
  state.connectedAccounts = parseAccountsFromTools(workspace);
201
201
 
202
+ // Also pull from OpenClaw gateway config
203
+ try {
204
+ const gwPath = join(process.env.HOME || '', '.openclaw', 'openclaw.json');
205
+ if (existsSync(gwPath)) {
206
+ const gw = JSON.parse(readFileSync(gwPath, 'utf8'));
207
+
208
+ // Telegram bot
209
+ const tgToken = gw.channels?.telegram?.botToken;
210
+ if (tgToken && !state.connectedAccounts.telegram) {
211
+ state.connectedAccounts.telegram = {
212
+ credential: tgToken === '__OPENCLAW_REDACTED__' ? 'configured (gateway)' : tgToken,
213
+ label: 'Telegram Bot',
214
+ connectedAt: new Date().toISOString(),
215
+ };
216
+ }
217
+
218
+ // Brave Search
219
+ const braveKey = gw.tools?.web?.search?.apiKey;
220
+ if (braveKey && !state.connectedAccounts.brave_search) {
221
+ state.connectedAccounts.brave_search = {
222
+ credential: braveKey === '__OPENCLAW_REDACTED__' ? 'configured (gateway)' : braveKey,
223
+ label: 'Brave Search',
224
+ connectedAt: new Date().toISOString(),
225
+ };
226
+ }
227
+
228
+ // Anthropic (from auth profiles or model providers)
229
+ const hasAnthropic = gw.auth?.profiles?.['anthropic:manual'] || gw.models?.providers?.anthropic;
230
+ if (hasAnthropic && !state.connectedAccounts.anthropic) {
231
+ state.connectedAccounts.anthropic = {
232
+ credential: 'configured (gateway)',
233
+ label: 'Anthropic',
234
+ connectedAt: new Date().toISOString(),
235
+ };
236
+ }
237
+
238
+ // OpenRouter
239
+ const hasOR = gw.auth?.profiles?.['openrouter:default'];
240
+ if (hasOR && !state.connectedAccounts.openrouter) {
241
+ state.connectedAccounts.openrouter = {
242
+ credential: 'configured (gateway)',
243
+ label: 'OpenRouter',
244
+ connectedAt: new Date().toISOString(),
245
+ };
246
+ }
247
+
248
+ // Any model providers with API keys
249
+ const providers = gw.models?.providers || {};
250
+ for (const [name, prov] of Object.entries(providers)) {
251
+ const key = name.toLowerCase().replace(/[^a-z0-9]/g, '_');
252
+ if (!state.connectedAccounts[key] && prov.apiKey) {
253
+ state.connectedAccounts[key] = {
254
+ credential: prov.apiKey === '__OPENCLAW_REDACTED__' ? 'configured (gateway)' : prov.apiKey,
255
+ label: name.charAt(0).toUpperCase() + name.slice(1),
256
+ connectedAt: new Date().toISOString(),
257
+ };
258
+ }
259
+ }
260
+
261
+ // Browser
262
+ if (gw.browser?.enabled && !state.connectedAccounts.browser) {
263
+ state.connectedAccounts.browser = {
264
+ credential: gw.browser.executablePath || 'enabled',
265
+ label: 'Browser',
266
+ connectedAt: new Date().toISOString(),
267
+ };
268
+ }
269
+ }
270
+ } catch {}
271
+
202
272
  // Skills
203
273
  const skillsDir = join(workspace, 'skills');
204
274
  if (existsSync(skillsDir)) {