@artyfacts/claude 1.2.0 → 1.2.1

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,6 +846,8 @@ 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
851
  activeTasks.add(task.section_id);
850
852
  console.log(" \u2713 Claimed!");
851
853
  if (dryRun) {
@@ -856,7 +858,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
856
858
  console.log(" \u2192 Executing with Claude...");
857
859
  try {
858
860
  const result = await executor.execute({
859
- taskId: task.section_id,
861
+ taskId: taskUuid,
862
+ // Use UUID instead of section_id
860
863
  heading: task.heading,
861
864
  content: task.content,
862
865
  artifactId: task.artifact_id,
@@ -867,7 +870,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
867
870
  await completeTask({
868
871
  baseUrl,
869
872
  apiKey,
870
- taskId: task.section_id,
873
+ taskId: taskUuid,
874
+ // Use UUID instead of section_id
871
875
  output: result.output,
872
876
  summary: result.summary
873
877
  });
@@ -877,7 +881,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
877
881
  await blockTask({
878
882
  baseUrl,
879
883
  apiKey,
880
- taskId: task.section_id,
884
+ taskId: taskUuid,
885
+ // Use UUID instead of section_id
881
886
  reason: result.error || "Execution failed"
882
887
  });
883
888
  }
package/dist/cli.mjs CHANGED
@@ -101,6 +101,8 @@ 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
106
  activeTasks.add(task.section_id);
105
107
  console.log(" \u2713 Claimed!");
106
108
  if (dryRun) {
@@ -111,7 +113,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
111
113
  console.log(" \u2192 Executing with Claude...");
112
114
  try {
113
115
  const result = await executor.execute({
114
- taskId: task.section_id,
116
+ taskId: taskUuid,
117
+ // Use UUID instead of section_id
115
118
  heading: task.heading,
116
119
  content: task.content,
117
120
  artifactId: task.artifact_id,
@@ -122,7 +125,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
122
125
  await completeTask({
123
126
  baseUrl,
124
127
  apiKey,
125
- taskId: task.section_id,
128
+ taskId: taskUuid,
129
+ // Use UUID instead of section_id
126
130
  output: result.output,
127
131
  summary: result.summary
128
132
  });
@@ -132,7 +136,8 @@ async function checkAndClaimTasks(baseUrl, apiKey, agentId, activeTasks, executo
132
136
  await blockTask({
133
137
  baseUrl,
134
138
  apiKey,
135
- taskId: task.section_id,
139
+ taskId: taskUuid,
140
+ // Use UUID instead of section_id
136
141
  reason: result.error || "Execution failed"
137
142
  });
138
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artyfacts/claude",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
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
@@ -196,6 +196,15 @@ 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(() => ({ id: task.id })) as {
201
+ id: string;
202
+ section_id: string;
203
+ };
204
+
205
+ // Use UUID for subsequent calls (globally unique, avoids org filter issues)
206
+ const taskUuid = claimedTask.id || task.id;
207
+
199
208
  // Successfully claimed - now execute
200
209
  activeTasks.add(task.section_id);
201
210
  console.log(' ✓ Claimed!');
@@ -209,8 +218,9 @@ async function checkAndClaimTasks(
209
218
  console.log(' → Executing with Claude...');
210
219
 
211
220
  try {
221
+ // Use UUID for context/complete (more reliable than section_id)
212
222
  const result = await executor.execute({
213
- taskId: task.section_id,
223
+ taskId: taskUuid, // Use UUID instead of section_id
214
224
  heading: task.heading,
215
225
  content: task.content,
216
226
  artifactId: task.artifact_id,
@@ -222,7 +232,7 @@ async function checkAndClaimTasks(
222
232
  await completeTask({
223
233
  baseUrl,
224
234
  apiKey,
225
- taskId: task.section_id,
235
+ taskId: taskUuid, // Use UUID instead of section_id
226
236
  output: result.output,
227
237
  summary: result.summary,
228
238
  });
@@ -232,7 +242,7 @@ async function checkAndClaimTasks(
232
242
  await blockTask({
233
243
  baseUrl,
234
244
  apiKey,
235
- taskId: task.section_id,
245
+ taskId: taskUuid, // Use UUID instead of section_id
236
246
  reason: result.error || 'Execution failed',
237
247
  });
238
248
  }