@artyfacts/claude 1.2.0 → 1.2.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/dist/cli.js +12 -3
- package/dist/cli.mjs +12 -3
- package/package.json +1 -1
- package/src/cli.ts +17 -3
package/dist/cli.js
CHANGED
|
@@ -846,6 +846,12 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
846
846
|
console.log(` \u26A0\uFE0F Could not claim: ${error.error || "Unknown error"}`);
|
|
847
847
|
continue;
|
|
848
848
|
}
|
|
849
|
+
const claimedTask = await claimResponse.json().catch((e) => {
|
|
850
|
+
console.log(` \u26A0\uFE0F Could not parse claim response: ${e}`);
|
|
851
|
+
return { id: task.id };
|
|
852
|
+
});
|
|
853
|
+
const taskUuid = claimedTask.id || task.id;
|
|
854
|
+
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
849
855
|
activeTasks.add(task.section_id);
|
|
850
856
|
console.log(" \u2713 Claimed!");
|
|
851
857
|
if (dryRun) {
|
|
@@ -856,7 +862,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
856
862
|
console.log(" \u2192 Executing with Claude...");
|
|
857
863
|
try {
|
|
858
864
|
const result = await executor.execute({
|
|
859
|
-
taskId:
|
|
865
|
+
taskId: taskUuid,
|
|
866
|
+
// Use UUID instead of section_id
|
|
860
867
|
heading: task.heading,
|
|
861
868
|
content: task.content,
|
|
862
869
|
artifactId: task.artifact_id,
|
|
@@ -867,7 +874,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
867
874
|
await completeTask({
|
|
868
875
|
baseUrl,
|
|
869
876
|
apiKey,
|
|
870
|
-
taskId:
|
|
877
|
+
taskId: taskUuid,
|
|
878
|
+
// Use UUID instead of section_id
|
|
871
879
|
output: result.output,
|
|
872
880
|
summary: result.summary
|
|
873
881
|
});
|
|
@@ -877,7 +885,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
877
885
|
await blockTask({
|
|
878
886
|
baseUrl,
|
|
879
887
|
apiKey,
|
|
880
|
-
taskId:
|
|
888
|
+
taskId: taskUuid,
|
|
889
|
+
// Use UUID instead of section_id
|
|
881
890
|
reason: result.error || "Execution failed"
|
|
882
891
|
});
|
|
883
892
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -101,6 +101,12 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
101
101
|
console.log(` \u26A0\uFE0F Could not claim: ${error.error || "Unknown error"}`);
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
|
+
const claimedTask = await claimResponse.json().catch((e) => {
|
|
105
|
+
console.log(` \u26A0\uFE0F Could not parse claim response: ${e}`);
|
|
106
|
+
return { id: task.id };
|
|
107
|
+
});
|
|
108
|
+
const taskUuid = claimedTask.id || task.id;
|
|
109
|
+
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
104
110
|
activeTasks.add(task.section_id);
|
|
105
111
|
console.log(" \u2713 Claimed!");
|
|
106
112
|
if (dryRun) {
|
|
@@ -111,7 +117,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
111
117
|
console.log(" \u2192 Executing with Claude...");
|
|
112
118
|
try {
|
|
113
119
|
const result = await executor.execute({
|
|
114
|
-
taskId:
|
|
120
|
+
taskId: taskUuid,
|
|
121
|
+
// Use UUID instead of section_id
|
|
115
122
|
heading: task.heading,
|
|
116
123
|
content: task.content,
|
|
117
124
|
artifactId: task.artifact_id,
|
|
@@ -122,7 +129,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
122
129
|
await completeTask({
|
|
123
130
|
baseUrl,
|
|
124
131
|
apiKey,
|
|
125
|
-
taskId:
|
|
132
|
+
taskId: taskUuid,
|
|
133
|
+
// Use UUID instead of section_id
|
|
126
134
|
output: result.output,
|
|
127
135
|
summary: result.summary
|
|
128
136
|
});
|
|
@@ -132,7 +140,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
|
|
|
132
140
|
await blockTask({
|
|
133
141
|
baseUrl,
|
|
134
142
|
apiKey,
|
|
135
|
-
taskId:
|
|
143
|
+
taskId: taskUuid,
|
|
144
|
+
// Use UUID instead of section_id
|
|
136
145
|
reason: result.error || "Execution failed"
|
|
137
146
|
});
|
|
138
147
|
}
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -196,6 +196,19 @@ async function checkAndClaimTasks(
|
|
|
196
196
|
continue;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
// Get the claimed task data (includes UUID which is globally unique)
|
|
200
|
+
const claimedTask = await claimResponse.json().catch((e) => {
|
|
201
|
+
console.log(` ⚠️ Could not parse claim response: ${e}`);
|
|
202
|
+
return { id: task.id };
|
|
203
|
+
}) as {
|
|
204
|
+
id: string;
|
|
205
|
+
section_id: string;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// Use UUID for subsequent calls (globally unique, avoids org filter issues)
|
|
209
|
+
const taskUuid = claimedTask.id || task.id;
|
|
210
|
+
console.log(` 📎 Using task UUID: ${taskUuid} (from queue: ${task.id})`); // DEBUG
|
|
211
|
+
|
|
199
212
|
// Successfully claimed - now execute
|
|
200
213
|
activeTasks.add(task.section_id);
|
|
201
214
|
console.log(' ✓ Claimed!');
|
|
@@ -209,8 +222,9 @@ async function checkAndClaimTasks(
|
|
|
209
222
|
console.log(' → Executing with Claude...');
|
|
210
223
|
|
|
211
224
|
try {
|
|
225
|
+
// Use UUID for context/complete (more reliable than section_id)
|
|
212
226
|
const result = await executor.execute({
|
|
213
|
-
taskId:
|
|
227
|
+
taskId: taskUuid, // Use UUID instead of section_id
|
|
214
228
|
heading: task.heading,
|
|
215
229
|
content: task.content,
|
|
216
230
|
artifactId: task.artifact_id,
|
|
@@ -222,7 +236,7 @@ async function checkAndClaimTasks(
|
|
|
222
236
|
await completeTask({
|
|
223
237
|
baseUrl,
|
|
224
238
|
apiKey,
|
|
225
|
-
taskId:
|
|
239
|
+
taskId: taskUuid, // Use UUID instead of section_id
|
|
226
240
|
output: result.output,
|
|
227
241
|
summary: result.summary,
|
|
228
242
|
});
|
|
@@ -232,7 +246,7 @@ async function checkAndClaimTasks(
|
|
|
232
246
|
await blockTask({
|
|
233
247
|
baseUrl,
|
|
234
248
|
apiKey,
|
|
235
|
-
taskId:
|
|
249
|
+
taskId: taskUuid, // Use UUID instead of section_id
|
|
236
250
|
reason: result.error || 'Execution failed',
|
|
237
251
|
});
|
|
238
252
|
}
|