@artyfacts/claude 1.2.1 → 1.2.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/dist/cli.js +6 -2
- package/dist/cli.mjs +6 -2
- package/package.json +1 -1
- package/src/cli.ts +9 -4
package/dist/cli.js
CHANGED
|
@@ -846,8 +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
|
|
850
|
-
|
|
849
|
+
const claimData = await claimResponse.json().catch((e) => {
|
|
850
|
+
console.log(` \u26A0\uFE0F Could not parse claim response: ${e}`);
|
|
851
|
+
return { task: { id: task.id } };
|
|
852
|
+
});
|
|
853
|
+
const taskUuid = claimData.task?.id || task.id;
|
|
854
|
+
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
851
855
|
activeTasks.add(task.section_id);
|
|
852
856
|
console.log(" \u2713 Claimed!");
|
|
853
857
|
if (dryRun) {
|
package/dist/cli.mjs
CHANGED
|
@@ -101,8 +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
|
|
105
|
-
|
|
104
|
+
const claimData = await claimResponse.json().catch((e) => {
|
|
105
|
+
console.log(` \u26A0\uFE0F Could not parse claim response: ${e}`);
|
|
106
|
+
return { task: { id: task.id } };
|
|
107
|
+
});
|
|
108
|
+
const taskUuid = claimData.task?.id || task.id;
|
|
109
|
+
console.log(` \u{1F4CE} Using task UUID: ${taskUuid} (from queue: ${task.id})`);
|
|
106
110
|
activeTasks.add(task.section_id);
|
|
107
111
|
console.log(" \u2713 Claimed!");
|
|
108
112
|
if (dryRun) {
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -197,13 +197,18 @@ async function checkAndClaimTasks(
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// Get the claimed task data (includes UUID which is globally unique)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
// Response format: { success: true, task: { id: ..., artifact_id: ..., ... } }
|
|
201
|
+
const claimData = await claimResponse.json().catch((e) => {
|
|
202
|
+
console.log(` ⚠️ Could not parse claim response: ${e}`);
|
|
203
|
+
return { task: { id: task.id } };
|
|
204
|
+
}) as {
|
|
205
|
+
success?: boolean;
|
|
206
|
+
task?: { id: string; artifact_id?: string };
|
|
203
207
|
};
|
|
204
208
|
|
|
205
209
|
// Use UUID for subsequent calls (globally unique, avoids org filter issues)
|
|
206
|
-
const taskUuid =
|
|
210
|
+
const taskUuid = claimData.task?.id || task.id;
|
|
211
|
+
console.log(` 📎 Using task UUID: ${taskUuid} (from queue: ${task.id})`); // DEBUG
|
|
207
212
|
|
|
208
213
|
// Successfully claimed - now execute
|
|
209
214
|
activeTasks.add(task.section_id);
|