@compilr-dev/sdk 0.2.14 → 0.2.15

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.
@@ -88,20 +88,35 @@ export function createWorkItemTools(config) {
88
88
  offset: input.offset ?? 0,
89
89
  };
90
90
  const result = await ctx.workItems.query(queryInput);
91
- const items = result.items.map((item) => ({
92
- id: item.id,
93
- itemId: item.itemId,
94
- type: item.type,
95
- status: item.status,
96
- priority: item.priority,
97
- owner: item.owner,
98
- guidedStep: item.guidedStep,
99
- title: item.title,
100
- description: item.description,
101
- estimatedEffort: item.estimatedEffort,
102
- completedAt: item.completedAt?.toISOString(),
103
- commitHash: item.commitHash,
104
- createdAt: item.createdAt.toISOString(),
91
+ const comments = ctx.comments;
92
+ const items = await Promise.all(result.items.map(async (item) => {
93
+ const base = {
94
+ id: item.id,
95
+ itemId: item.itemId,
96
+ type: item.type,
97
+ status: item.status,
98
+ priority: item.priority,
99
+ owner: item.owner,
100
+ guidedStep: item.guidedStep,
101
+ title: item.title,
102
+ description: item.description,
103
+ estimatedEffort: item.estimatedEffort,
104
+ completedAt: item.completedAt?.toISOString(),
105
+ commitHash: item.commitHash,
106
+ createdAt: item.createdAt.toISOString(),
107
+ };
108
+ if (!comments)
109
+ return base;
110
+ const itemComments = await comments.listByWorkItem(item.id);
111
+ return {
112
+ ...base,
113
+ comments: itemComments.map((c) => ({
114
+ id: c.id,
115
+ author: c.author,
116
+ content: c.content,
117
+ createdAt: c.createdAt.toISOString(),
118
+ })),
119
+ };
105
120
  }));
106
121
  return createSuccessResult({
107
122
  success: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",