@markmdev/pebble 0.1.7 → 0.1.8

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/index.js CHANGED
@@ -2072,9 +2072,26 @@ data: ${message}
2072
2072
  results.push({ id: issueId, success: false, error: "Cannot close epic with open children" });
2073
2073
  continue;
2074
2074
  }
2075
+ const pendingVerifications = getVerifications(issueId).filter((v) => v.status !== "closed");
2076
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
2077
+ if (pendingVerifications.length > 0) {
2078
+ const updateEvent = {
2079
+ type: "update",
2080
+ issueId,
2081
+ timestamp,
2082
+ data: { status: "pending_verification" }
2083
+ };
2084
+ appendEvent(updateEvent, pebbleDir);
2085
+ results.push({
2086
+ id: issueId,
2087
+ success: true,
2088
+ error: `Moved to pending_verification (${pendingVerifications.length} verification(s) pending)`
2089
+ });
2090
+ continue;
2091
+ }
2075
2092
  const event = {
2076
2093
  issueId,
2077
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2094
+ timestamp,
2078
2095
  type: "close",
2079
2096
  data: { reason: "Bulk close" }
2080
2097
  };
@@ -2170,7 +2187,7 @@ data: ${message}
2170
2187
  issue = localIssue;
2171
2188
  targetFile = path2.join(pebbleDir, "issues.jsonl");
2172
2189
  }
2173
- const { title, type, priority, status, description, parent } = req.body;
2190
+ const { title, type, priority, status, description, parent, relatedTo } = req.body;
2174
2191
  const updates = {};
2175
2192
  if (title !== void 0) {
2176
2193
  if (typeof title !== "string" || title.trim() === "") {
@@ -2229,6 +2246,28 @@ data: ${message}
2229
2246
  }
2230
2247
  updates.parent = parent;
2231
2248
  }
2249
+ if (relatedTo !== void 0) {
2250
+ if (!Array.isArray(relatedTo)) {
2251
+ res.status(400).json({ error: "relatedTo must be an array" });
2252
+ return;
2253
+ }
2254
+ for (const relatedId of relatedTo) {
2255
+ if (isMultiWorktree()) {
2256
+ const found = findIssueInSources(relatedId, issueFiles);
2257
+ if (!found) {
2258
+ res.status(400).json({ error: `Related issue not found: ${relatedId}` });
2259
+ return;
2260
+ }
2261
+ } else {
2262
+ const relatedIssue = getIssue(relatedId);
2263
+ if (!relatedIssue) {
2264
+ res.status(400).json({ error: `Related issue not found: ${relatedId}` });
2265
+ return;
2266
+ }
2267
+ }
2268
+ }
2269
+ updates.relatedTo = relatedTo;
2270
+ }
2232
2271
  if (Object.keys(updates).length === 0) {
2233
2272
  res.status(400).json({ error: "No valid updates provided" });
2234
2273
  return;
@@ -2286,6 +2325,30 @@ data: ${message}
2286
2325
  }
2287
2326
  const { reason } = req.body;
2288
2327
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
2328
+ let pendingVerifications = [];
2329
+ if (isMultiWorktree()) {
2330
+ const allIssues = mergeIssuesFromFiles(issueFiles);
2331
+ pendingVerifications = allIssues.filter(
2332
+ (i) => i.verifies === issueId && i.status !== "closed"
2333
+ );
2334
+ } else {
2335
+ pendingVerifications = getVerifications(issueId).filter((v) => v.status !== "closed");
2336
+ }
2337
+ if (pendingVerifications.length > 0) {
2338
+ const updateEvent = {
2339
+ type: "update",
2340
+ issueId,
2341
+ timestamp,
2342
+ data: { status: "pending_verification" }
2343
+ };
2344
+ appendEventToFile(updateEvent, targetFile);
2345
+ const updatedIssue = { ...issue, status: "pending_verification", updatedAt: timestamp };
2346
+ res.json({
2347
+ ...updatedIssue,
2348
+ _pendingVerifications: pendingVerifications.map((v) => ({ id: v.id, title: v.title }))
2349
+ });
2350
+ return;
2351
+ }
2289
2352
  const event = {
2290
2353
  type: "close",
2291
2354
  issueId,