@artyfacts/claude 1.3.3 → 1.3.5
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/dist/cli.js +7 -6
- package/dist/cli.mjs +7 -6
- package/package.json +1 -1
- package/src/cli.ts +9 -7
package/dist/cli.js
CHANGED
|
@@ -789,12 +789,13 @@ function configureMcp(apiKey, baseUrl) {
|
|
|
789
789
|
const result = (0, import_child_process2.spawnSync)("claude", [
|
|
790
790
|
"mcp",
|
|
791
791
|
"add",
|
|
792
|
+
"artyfacts",
|
|
793
|
+
// Name first!
|
|
792
794
|
"-s",
|
|
793
795
|
"user",
|
|
794
796
|
// Available across all projects
|
|
795
|
-
|
|
797
|
+
"-e",
|
|
796
798
|
`ARTYFACTS_API_KEY=${apiKey}`,
|
|
797
|
-
"artyfacts",
|
|
798
799
|
"--",
|
|
799
800
|
"npx",
|
|
800
801
|
"-y",
|
|
@@ -896,7 +897,7 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
896
897
|
}
|
|
897
898
|
console.log(`\u{1F4EC} Found ${tasks.length} claimable task(s)`);
|
|
898
899
|
for (const task of tasks) {
|
|
899
|
-
if (activeTasks.has(task.
|
|
900
|
+
if (activeTasks.has(task.id)) {
|
|
900
901
|
continue;
|
|
901
902
|
}
|
|
902
903
|
console.log(`
|
|
@@ -919,11 +920,11 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
919
920
|
});
|
|
920
921
|
const taskUuid = claimData.task?.id || task.id;
|
|
921
922
|
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
922
|
-
activeTasks.add(task.
|
|
923
|
+
activeTasks.add(task.id);
|
|
923
924
|
console.log(" \u2713 Claimed!");
|
|
924
925
|
if (dryRun) {
|
|
925
926
|
console.log(" \u{1F4CB} Dry run - not executing");
|
|
926
|
-
activeTasks.delete(task.
|
|
927
|
+
activeTasks.delete(task.id);
|
|
927
928
|
continue;
|
|
928
929
|
}
|
|
929
930
|
console.log(" \u2192 Executing with Claude...");
|
|
@@ -960,7 +961,7 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
960
961
|
} catch (error) {
|
|
961
962
|
console.error(` \u2192 \u274C Error:`, error instanceof Error ? error.message : error);
|
|
962
963
|
} finally {
|
|
963
|
-
activeTasks.delete(task.
|
|
964
|
+
activeTasks.delete(task.id);
|
|
964
965
|
}
|
|
965
966
|
break;
|
|
966
967
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -30,12 +30,13 @@ function configureMcp(apiKey, baseUrl) {
|
|
|
30
30
|
const result = spawnSync("claude", [
|
|
31
31
|
"mcp",
|
|
32
32
|
"add",
|
|
33
|
+
"artyfacts",
|
|
34
|
+
// Name first!
|
|
33
35
|
"-s",
|
|
34
36
|
"user",
|
|
35
37
|
// Available across all projects
|
|
36
|
-
|
|
38
|
+
"-e",
|
|
37
39
|
`ARTYFACTS_API_KEY=${apiKey}`,
|
|
38
|
-
"artyfacts",
|
|
39
40
|
"--",
|
|
40
41
|
"npx",
|
|
41
42
|
"-y",
|
|
@@ -137,7 +138,7 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
137
138
|
}
|
|
138
139
|
console.log(`\u{1F4EC} Found ${tasks.length} claimable task(s)`);
|
|
139
140
|
for (const task of tasks) {
|
|
140
|
-
if (activeTasks.has(task.
|
|
141
|
+
if (activeTasks.has(task.id)) {
|
|
141
142
|
continue;
|
|
142
143
|
}
|
|
143
144
|
console.log(`
|
|
@@ -160,11 +161,11 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
160
161
|
});
|
|
161
162
|
const taskUuid = claimData.task?.id || task.id;
|
|
162
163
|
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
163
|
-
activeTasks.add(task.
|
|
164
|
+
activeTasks.add(task.id);
|
|
164
165
|
console.log(" \u2713 Claimed!");
|
|
165
166
|
if (dryRun) {
|
|
166
167
|
console.log(" \u{1F4CB} Dry run - not executing");
|
|
167
|
-
activeTasks.delete(task.
|
|
168
|
+
activeTasks.delete(task.id);
|
|
168
169
|
continue;
|
|
169
170
|
}
|
|
170
171
|
console.log(" \u2192 Executing with Claude...");
|
|
@@ -201,7 +202,7 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
201
202
|
} catch (error) {
|
|
202
203
|
console.error(` \u2192 \u274C Error:`, error instanceof Error ? error.message : error);
|
|
203
204
|
} finally {
|
|
204
|
-
activeTasks.delete(task.
|
|
205
|
+
activeTasks.delete(task.id);
|
|
205
206
|
}
|
|
206
207
|
break;
|
|
207
208
|
}
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -50,12 +50,13 @@ function configureMcp(apiKey: string, baseUrl: string): boolean {
|
|
|
50
50
|
|
|
51
51
|
try {
|
|
52
52
|
// Add MCP server with environment variable
|
|
53
|
-
// Format: claude mcp add -e KEY=value
|
|
53
|
+
// Format: claude mcp add <name> -s user -e KEY=value -- command
|
|
54
|
+
// (name must come before options!)
|
|
54
55
|
const result = spawnSync('claude', [
|
|
55
56
|
'mcp', 'add',
|
|
57
|
+
'artyfacts', // Name first!
|
|
56
58
|
'-s', 'user', // Available across all projects
|
|
57
|
-
|
|
58
|
-
'artyfacts',
|
|
59
|
+
'-e', `ARTYFACTS_API_KEY=${apiKey}`,
|
|
59
60
|
'--',
|
|
60
61
|
'npx', '-y', '@artyfacts/mcp-server',
|
|
61
62
|
], {
|
|
@@ -244,7 +245,8 @@ async function checkAndClaimTasks(
|
|
|
244
245
|
|
|
245
246
|
// Process first available task
|
|
246
247
|
for (const task of tasks) {
|
|
247
|
-
|
|
248
|
+
// Use task.id (UUID) for deduplication - matches SSE taskId
|
|
249
|
+
if (activeTasks.has(task.id)) {
|
|
248
250
|
continue; // Already processing
|
|
249
251
|
}
|
|
250
252
|
|
|
@@ -280,12 +282,12 @@ async function checkAndClaimTasks(
|
|
|
280
282
|
console.log(` 📎 Using task UUID: ${taskUuid} (from queue: ${task.id})`); // DEBUG
|
|
281
283
|
|
|
282
284
|
// Successfully claimed - now execute
|
|
283
|
-
activeTasks.add(task.
|
|
285
|
+
activeTasks.add(task.id);
|
|
284
286
|
console.log(' ✓ Claimed!');
|
|
285
287
|
|
|
286
288
|
if (dryRun) {
|
|
287
289
|
console.log(' 📋 Dry run - not executing');
|
|
288
|
-
activeTasks.delete(task.
|
|
290
|
+
activeTasks.delete(task.id);
|
|
289
291
|
continue;
|
|
290
292
|
}
|
|
291
293
|
|
|
@@ -323,7 +325,7 @@ async function checkAndClaimTasks(
|
|
|
323
325
|
} catch (error) {
|
|
324
326
|
console.error(` → ❌ Error:`, error instanceof Error ? error.message : error);
|
|
325
327
|
} finally {
|
|
326
|
-
activeTasks.delete(task.
|
|
328
|
+
activeTasks.delete(task.id);
|
|
327
329
|
}
|
|
328
330
|
|
|
329
331
|
// Only process one task at a time for now
|