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