akemon 0.2.12 → 0.2.14

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/context.js CHANGED
@@ -49,6 +49,10 @@ function parseConversation(content) {
49
49
  content: m[3],
50
50
  });
51
51
  }
52
+ else if (rounds.length > 0 && line !== "") {
53
+ // Continuation line — append to previous round
54
+ rounds[rounds.length - 1].content += "\n" + line;
55
+ }
52
56
  }
53
57
  }
54
58
  return { summary, rounds };
@@ -31,6 +31,7 @@ export class TaskModule {
31
31
  orderRetry = new Map();
32
32
  userTaskRetry = new Map();
33
33
  gaveUp = new Set();
34
+ executing = new Set(); // orders currently being fulfilled
34
35
  // Push notification support
35
36
  urgentOrderIds = new Set();
36
37
  triggerWorkFn = null;
@@ -130,6 +131,8 @@ export class TaskModule {
130
131
  for (const order of orders) {
131
132
  if (this.gaveUp.has(order.id))
132
133
  continue;
134
+ if (this.executing.has(order.id))
135
+ continue;
133
136
  const retry = this.orderRetry.get(order.id);
134
137
  if (retry && Date.now() < retry.nextAt)
135
138
  continue;
@@ -205,6 +208,8 @@ export class TaskModule {
205
208
  // Execute sequentially
206
209
  for (const item of filtered) {
207
210
  try {
211
+ if (item.type === "order")
212
+ this.executing.add(item.id);
208
213
  switch (item.type) {
209
214
  case "order":
210
215
  await this.executeOrder(item.data);
@@ -221,6 +226,10 @@ export class TaskModule {
221
226
  catch (err) {
222
227
  console.log(`[task] Error processing ${item.type}:${item.id}: ${err.message}`);
223
228
  }
229
+ finally {
230
+ if (item.type === "order")
231
+ this.executing.delete(item.id);
232
+ }
224
233
  }
225
234
  bus.emit(SIG.CYCLE_END, sig(SIG.CYCLE_END, { ts: Date.now() }));
226
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akemon",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "Agent work marketplace — train your agent, let it work for others",
5
5
  "type": "module",
6
6
  "license": "MIT",