opencode-gitlab-duo-agentic 0.2.16 → 0.2.18

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1499,9 +1499,9 @@ var DuoWorkflowModel = class {
1499
1499
  dlog(`phase1: ${toolResults.length} total, ${freshResults.length} fresh`);
1500
1500
  let sentToolResults = false;
1501
1501
  for (const result of freshResults) {
1502
- const hashIdx = result.toolCallId.indexOf("#");
1503
- if (hashIdx !== -1) {
1504
- const originalId = result.toolCallId.substring(0, hashIdx);
1502
+ const subIdx = result.toolCallId.indexOf("_sub_");
1503
+ if (subIdx !== -1) {
1504
+ const originalId = result.toolCallId.substring(0, subIdx);
1505
1505
  const group = model.#multiCallGroups.get(originalId);
1506
1506
  if (!group) {
1507
1507
  model.#sentToolCallIds.add(result.toolCallId);
@@ -1511,8 +1511,13 @@ var DuoWorkflowModel = class {
1511
1511
  model.#sentToolCallIds.add(result.toolCallId);
1512
1512
  model.#pendingToolRequests.delete(result.toolCallId);
1513
1513
  if (group.collected.size === group.subIds.length) {
1514
- const aggregated = group.subIds.map((id) => group.collected.get(id) ?? "").join("\n");
1515
- session.sendToolResult(originalId, aggregated);
1514
+ const result2 = {};
1515
+ for (let i = 0; i < group.subIds.length; i++) {
1516
+ const label = group.labels[i] || `file_${i}`;
1517
+ const value = group.collected.get(group.subIds[i]) ?? "";
1518
+ result2[label] = { content: value };
1519
+ }
1520
+ session.sendToolResult(originalId, JSON.stringify(result2));
1516
1521
  model.#multiCallGroups.delete(originalId);
1517
1522
  model.#pendingToolRequests.delete(originalId);
1518
1523
  sentToolResults = true;
@@ -1600,9 +1605,10 @@ var DuoWorkflowModel = class {
1600
1605
  controller.enqueue({ type: "text-end", id: textId });
1601
1606
  }
1602
1607
  if (Array.isArray(mapped)) {
1603
- const subIds = mapped.map((_, i) => `${event.requestId}#${i}`);
1608
+ const subIds = mapped.map((_, i) => `${event.requestId}_sub_${i}`);
1604
1609
  model.#multiCallGroups.set(event.requestId, {
1605
1610
  subIds,
1611
+ labels: mapped.map((m) => String(m.args.filePath ?? m.args.path ?? "")),
1606
1612
  collected: /* @__PURE__ */ new Map()
1607
1613
  });
1608
1614
  model.#pendingToolRequests.set(event.requestId, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-gitlab-duo-agentic",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "OpenCode plugin and provider for GitLab Duo Agentic workflows",
5
5
  "license": "MIT",
6
6
  "type": "module",