@lightcone-ai/daemon 0.9.6 → 0.9.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.
- package/package.json +1 -1
- package/src/chat-bridge.js +19 -0
- package/src/index.js +4 -1
package/package.json
CHANGED
package/src/chat-bridge.js
CHANGED
|
@@ -294,6 +294,25 @@ server.tool('write_workspace', 'Write a file to the shared team workspace. Use t
|
|
|
294
294
|
return { content: [{ type: 'text', text: `Saved to team workspace: ${path}` }] };
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
+
// ── get_credential ───────────────────────────────────────────────────────────
|
|
298
|
+
server.tool('get_credential',
|
|
299
|
+
'Retrieve decrypted credential fields for a platform granted to this agent (e.g. XHS_COOKIE for "xhs"). Use when you need to inject credentials into a browser session or external call.',
|
|
300
|
+
{
|
|
301
|
+
platform: z.string().describe('Platform key, e.g. "xhs", "x", "youtube"'),
|
|
302
|
+
},
|
|
303
|
+
async ({ platform }) => {
|
|
304
|
+
try {
|
|
305
|
+
const grants = await api('GET', '/credential-grants');
|
|
306
|
+
const match = grants.find(g => g.platform === platform);
|
|
307
|
+
if (!match) return { content: [{ type: 'text', text: `No credential found for platform "${platform}". Ask the human to connect the account via Settings → 连接外部账号.` }] };
|
|
308
|
+
const fields = Object.entries(match.envVars).map(([k, v]) => `${k}=${v}`).join('\n');
|
|
309
|
+
return { content: [{ type: 'text', text: fields }] };
|
|
310
|
+
} catch (err) {
|
|
311
|
+
return { isError: true, content: [{ type: 'text', text: `Error: ${err.message}` }] };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
|
|
297
316
|
// ── skill_list ───────────────────────────────────────────────────────────────
|
|
298
317
|
server.tool('skill_list', 'List all skills available to you (platform + bound). Returns index only (name + description), not full content.', {}, async () => {
|
|
299
318
|
const skills = await api('GET', `/skills`);
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import 'dotenv/config';
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
import { DaemonConnection } from './connection.js';
|
|
4
5
|
import { AgentManager } from './agent-manager.js';
|
|
5
6
|
|
|
7
|
+
const { version } = createRequire(import.meta.url)('../package.json');
|
|
8
|
+
|
|
6
9
|
// ── CLI args ──────────────────────────────────────────────────────────────────
|
|
7
10
|
const args = process.argv.slice(2);
|
|
8
11
|
let cliServerUrl = '';
|
|
@@ -26,7 +29,7 @@ if (!MACHINE_API_KEY) {
|
|
|
26
29
|
process.exit(1);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
console.log(`[Daemon] Server: ${SERVER_URL}`);
|
|
32
|
+
console.log(`[Daemon] v${version} Server: ${SERVER_URL}`);
|
|
30
33
|
|
|
31
34
|
// ── Start ─────────────────────────────────────────────────────────────────────
|
|
32
35
|
const agentManager = new AgentManager({ serverUrl: SERVER_URL, machineApiKey: MACHINE_API_KEY });
|