@kendoo.agentdesk/agentdesk 0.9.1 → 0.9.2
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/cli/daemon.mjs +2 -0
- package/cli/orchestrator.mjs +20 -5
- package/cli/team.mjs +2 -0
- package/package.json +1 -1
package/cli/daemon.mjs
CHANGED
|
@@ -370,6 +370,8 @@ export async function runDaemon() {
|
|
|
370
370
|
inboxUrl, sessionUrl,
|
|
371
371
|
cwd: project.path,
|
|
372
372
|
mode: mode || "full",
|
|
373
|
+
apiKey,
|
|
374
|
+
serverUrl: agentdeskServer,
|
|
373
375
|
onEvent(event) {
|
|
374
376
|
sendBuffered(sessionId, event);
|
|
375
377
|
// Track file paths for metadata logging
|
package/cli/orchestrator.mjs
CHANGED
|
@@ -14,6 +14,19 @@ const CLI_VERSION = JSON.parse(readFileSync(join(__dirname, "../package.json"),
|
|
|
14
14
|
import { buildAgentPrompt, getAgentTools } from "./agent-prompts.mjs";
|
|
15
15
|
import { detectProject, generateContext } from "./detect.mjs";
|
|
16
16
|
|
|
17
|
+
// Fetch decrypted tracker credentials from server
|
|
18
|
+
async function fetchTrackerCredentials(projectName, apiKey, serverUrl) {
|
|
19
|
+
if (!apiKey || !serverUrl || !projectName) return {};
|
|
20
|
+
try {
|
|
21
|
+
const res = await fetch(`${serverUrl}/api/projects/${projectName}/settings/credentials`, {
|
|
22
|
+
headers: { "x-api-key": apiKey },
|
|
23
|
+
signal: AbortSignal.timeout(5000),
|
|
24
|
+
});
|
|
25
|
+
if (res.ok) return await res.json();
|
|
26
|
+
} catch {}
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
function loadDotEnv(dir) {
|
|
18
31
|
const envPath = join(dir, ".env");
|
|
19
32
|
if (!existsSync(envPath)) return {};
|
|
@@ -37,11 +50,11 @@ function timestamp() {
|
|
|
37
50
|
export async function runOrchestrator({
|
|
38
51
|
taskId, taskLink, description, createTask, tracker, config,
|
|
39
52
|
project, team, teamSections, inboxUrl, sessionUrl, cwd,
|
|
40
|
-
onEvent, mode = "full",
|
|
53
|
+
onEvent, mode = "full", apiKey, serverUrl,
|
|
41
54
|
}) {
|
|
42
55
|
// --- Lite mode: single process, legacy behavior ---
|
|
43
56
|
if (mode === "lite") {
|
|
44
|
-
return runLiteMode({ taskId, taskLink, description, createTask, tracker, config, project, teamSections, inboxUrl, sessionUrl, cwd, onEvent });
|
|
57
|
+
return runLiteMode({ taskId, taskLink, description, createTask, tracker, config, project, teamSections, inboxUrl, sessionUrl, cwd, onEvent, apiKey, serverUrl });
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
// --- Full mode: independent sub-agents ---
|
|
@@ -54,7 +67,8 @@ export async function runOrchestrator({
|
|
|
54
67
|
totalSteps: 0,
|
|
55
68
|
};
|
|
56
69
|
|
|
57
|
-
const
|
|
70
|
+
const trackerCreds = await fetchTrackerCredentials(project?.name, apiKey, serverUrl);
|
|
71
|
+
const env = { ...process.env, ...loadDotEnv(cwd), ...trackerCreds };
|
|
58
72
|
|
|
59
73
|
// Emit event to WebSocket (same protocol as single-process mode)
|
|
60
74
|
function emit(event) {
|
|
@@ -303,8 +317,9 @@ export async function runOrchestrator({
|
|
|
303
317
|
|
|
304
318
|
// --- Lite mode: single Claude process with all agents as personas ---
|
|
305
319
|
|
|
306
|
-
async function runLiteMode({ taskId, taskLink, description, createTask, tracker, config, project, teamSections, inboxUrl, sessionUrl, cwd, onEvent }) {
|
|
307
|
-
const
|
|
320
|
+
async function runLiteMode({ taskId, taskLink, description, createTask, tracker, config, project, teamSections, inboxUrl, sessionUrl, cwd, onEvent, apiKey, serverUrl }) {
|
|
321
|
+
const trackerCreds = await fetchTrackerCredentials(project?.name, apiKey, serverUrl);
|
|
322
|
+
const env = { ...process.env, ...loadDotEnv(cwd), ...trackerCreds };
|
|
308
323
|
const startTime = Date.now();
|
|
309
324
|
let totalInputTokens = 0;
|
|
310
325
|
let totalOutputTokens = 0;
|
package/cli/team.mjs
CHANGED