@kendoo.agentdesk/agentdesk 0.5.1 → 0.5.3
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/bin/agentdesk.mjs +42 -16
- package/cli/agents.mjs +24 -1
- package/package.json +1 -1
package/bin/agentdesk.mjs
CHANGED
|
@@ -10,26 +10,39 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
10
10
|
const __dirname = dirname(__filename);
|
|
11
11
|
const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const command = args[0];
|
|
15
|
+
|
|
16
|
+
// Blocking update check — require update for major/minor bumps, warn for patches
|
|
17
|
+
if (command !== "update") {
|
|
15
18
|
try {
|
|
16
19
|
const res = await fetch(`https://registry.npmjs.org/${pkg.name}/latest`, { signal: AbortSignal.timeout(3000) });
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
if (res.ok) {
|
|
21
|
+
const { version } = await res.json();
|
|
22
|
+
if (version !== pkg.version) {
|
|
23
|
+
const [curMajor, curMinor] = pkg.version.split(".").map(Number);
|
|
24
|
+
const [latMajor, latMinor] = version.split(".").map(Number);
|
|
25
|
+
const breaking = latMajor > curMajor || latMinor > curMinor;
|
|
26
|
+
|
|
27
|
+
const dim = "\x1b[2m";
|
|
28
|
+
const red = "\x1b[31m";
|
|
29
|
+
const yellow = "\x1b[33m";
|
|
30
|
+
const green = "\x1b[32m";
|
|
31
|
+
const cyan = "\x1b[36m";
|
|
32
|
+
const reset = "\x1b[0m";
|
|
33
|
+
|
|
34
|
+
if (breaking) {
|
|
35
|
+
console.log(`\n ${red}Update required:${reset} ${dim}${pkg.version}${reset} → ${green}${version}${reset}`);
|
|
36
|
+
console.log(` Run: ${cyan}agentdesk update${reset}\n`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
} else {
|
|
39
|
+
console.log(`\n ${yellow}Update available:${reset} ${dim}${pkg.version}${reset} → ${green}${version}${reset}`);
|
|
40
|
+
console.log(` Run: ${cyan}agentdesk update${reset}\n`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
27
43
|
}
|
|
28
44
|
} catch {}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const args = process.argv.slice(2);
|
|
32
|
-
const command = args[0];
|
|
45
|
+
}
|
|
33
46
|
|
|
34
47
|
if (!command || command === "help" || command === "--help") {
|
|
35
48
|
console.log(`
|
|
@@ -46,6 +59,7 @@ if (!command || command === "help" || command === "--help") {
|
|
|
46
59
|
agentdesk init Set up project and configure tracker
|
|
47
60
|
agentdesk team <TASK-ID> Run a team session on an existing task
|
|
48
61
|
agentdesk team -d "..." Create a task and run a session
|
|
62
|
+
agentdesk update Update to the latest version
|
|
49
63
|
|
|
50
64
|
Options:
|
|
51
65
|
--description, -d Task description or requirements
|
|
@@ -112,6 +126,18 @@ else if (command === "team") {
|
|
|
112
126
|
process.exit(code);
|
|
113
127
|
}
|
|
114
128
|
|
|
129
|
+
else if (command === "update") {
|
|
130
|
+
const { execSync } = await import("child_process");
|
|
131
|
+
console.log(`\n Updating ${pkg.name}...\n`);
|
|
132
|
+
try {
|
|
133
|
+
execSync(`npm i -g ${pkg.name}@latest`, { stdio: "inherit" });
|
|
134
|
+
console.log(`\n Updated successfully.\n`);
|
|
135
|
+
} catch {
|
|
136
|
+
console.error(`\n Update failed. Try manually: npm i -g ${pkg.name}@latest\n`);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
115
141
|
else if (command === "server") {
|
|
116
142
|
try {
|
|
117
143
|
await import("../server/index.mjs");
|
package/cli/agents.mjs
CHANGED
|
@@ -148,6 +148,7 @@ export const BUILT_IN_AGENTS = {
|
|
|
148
148
|
*/
|
|
149
149
|
export function resolveTeam(config) {
|
|
150
150
|
const teamConfig = config.team || null;
|
|
151
|
+
const customAgents = config.projectAgents || [];
|
|
151
152
|
|
|
152
153
|
// Default: all 7 agents
|
|
153
154
|
if (!teamConfig) {
|
|
@@ -162,7 +163,29 @@ export function resolveTeam(config) {
|
|
|
162
163
|
if (agent) {
|
|
163
164
|
team.push({ name: entry, ...agent });
|
|
164
165
|
} else {
|
|
165
|
-
|
|
166
|
+
// Check if it's a custom project agent
|
|
167
|
+
const custom = customAgents.find(a => a.name === entry);
|
|
168
|
+
if (custom) {
|
|
169
|
+
team.push({
|
|
170
|
+
name: custom.name,
|
|
171
|
+
badge: `** ${custom.name.toUpperCase()} **`,
|
|
172
|
+
role: custom.role || "Team Member",
|
|
173
|
+
description: custom.role || "Custom team member",
|
|
174
|
+
groundRules: custom.when ? `${custom.name} is invoked: ${custom.when}. How to use: ${custom.how || "as needed"}.` : "",
|
|
175
|
+
brainstorm: { tag: "SAY", focus: custom.role || "general input" },
|
|
176
|
+
planning: `${custom.role || custom.name} Review`,
|
|
177
|
+
execution: custom.when ? {
|
|
178
|
+
step: `${custom.name} reviews`,
|
|
179
|
+
tasks: [
|
|
180
|
+
`Review changes relevant to ${custom.role || "this agent's scope"}.`,
|
|
181
|
+
custom.how ? `Interaction: ${custom.how}` : "Provide feedback on the changes.",
|
|
182
|
+
],
|
|
183
|
+
order: 2.5,
|
|
184
|
+
} : null,
|
|
185
|
+
});
|
|
186
|
+
} else {
|
|
187
|
+
console.warn(`Warning: Unknown agent "${entry}" — skipping`);
|
|
188
|
+
}
|
|
166
189
|
}
|
|
167
190
|
} else if (typeof entry === "object" && entry.name) {
|
|
168
191
|
// Custom agent
|