@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 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 claimedTask = await claimResponse.json().catch(() => ({ id: task.id }));
850
- const taskUuid = claimedTask.id || task.id;
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 claimedTask = await claimResponse.json().catch(() => ({ id: task.id }));
105
- const taskUuid = claimedTask.id || task.id;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artyfacts/claude",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Claude adapter for Artyfacts - Execute tasks using Claude Code CLI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
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
- const claimedTask = await claimResponse.json().catch(() => ({ id: task.id })) as {
201
- id: string;
202
- section_id: string;
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 = claimedTask.id || task.id;
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);