@celljs/ta-agents 4.15.2 → 4.16.0

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.
@@ -37,6 +37,10 @@ var Acp;
37
37
  return options?.find((option) => option.category === category) ?? options?.find((option) => option.id === category);
38
38
  }
39
39
  Acp.optionOf = optionOf;
40
+ function own(meta) {
41
+ return !Object.keys(meta ?? {}).some((key) => /(parentToolCallId|memberEvent)$/.test(key));
42
+ }
43
+ Acp.own = own;
40
44
  })(Acp ||= {});
41
45
 
42
46
  // src/agent-bindings.ts
@@ -275,7 +279,7 @@ class AgentTurn {
275
279
  }
276
280
  open() {
277
281
  for (const run of this.tools.values()) {
278
- if (!run.done && !run.left && !this.stepped.has(run.id)) {
282
+ if (!run.done && !run.left && !run.others && !this.stepped.has(run.id)) {
279
283
  return true;
280
284
  }
281
285
  }
@@ -283,7 +287,7 @@ class AgentTurn {
283
287
  }
284
288
  step() {
285
289
  for (const run of this.tools.values()) {
286
- if (!run.done && !run.left) {
290
+ if (!run.done && !run.left && !run.others) {
287
291
  this.stepped.add(run.id);
288
292
  }
289
293
  }
@@ -334,6 +338,7 @@ class AgentTurn {
334
338
  output: "",
335
339
  done: false,
336
340
  left: false,
341
+ others: !Acp.own(update._meta),
337
342
  complete: false,
338
343
  terminal: "",
339
344
  updatedAt: Date.now()
@@ -581,7 +586,7 @@ class AgentSession {
581
586
  this.callbacks.title?.(this.title);
582
587
  }
583
588
  const phase = AgentSession.phase(meta);
584
- if (phase && !ids.some((id) => this.earlier.has(id)) && AgentSession.own(meta)) {
589
+ if (phase && !ids.some((id) => this.earlier.has(id)) && Acp.own(meta)) {
585
590
  this.phase(this.turn, phase, meta);
586
591
  }
587
592
  if (meta && Object.keys(meta).some((key) => /unsolicitedTurn$/.test(key)) && !this.turn) {
@@ -801,9 +806,6 @@ class AgentSession {
801
806
  static internal(meta) {
802
807
  return Object.entries(meta ?? {}).some(([key, value]) => /isCompactInternal$/.test(key) && value === true);
803
808
  }
804
- static own(meta) {
805
- return !Object.keys(meta ?? {}).some((key) => /(parentToolCallId|memberEvent)$/.test(key));
806
- }
807
809
  static requestIds(meta) {
808
810
  return Object.entries(meta ?? {}).filter(([key, value]) => /requestId$/i.test(key) && typeof value === "string" && value).map(([, value]) => value);
809
811
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-agents",
3
- "version": "4.15.2",
3
+ "version": "4.16.0",
4
4
  "description": "A pi package for Ta: other coding agents (CodeBuddy Code, Claude Code, Codex and any agent that speaks ACP) as models to pick, each running a conversation on its own harness",
5
5
  "keywords": [
6
6
  "pi-package"