@mulmoclaude/core 1.4.0 → 1.5.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.
@@ -1179,6 +1179,7 @@ var TASKS_BASE_URL = "https://tasks.googleapis.com/tasks/v1";
1179
1179
  var TASKS_API_LABEL = "Google Tasks API";
1180
1180
  var DEFAULT_TASK_LIST_ID = "@default";
1181
1181
  var TASK_STATUS_COMPLETED = "completed";
1182
+ var TASK_STATUS_NEEDS_ACTION = "needsAction";
1182
1183
  var MAX_TASK_LISTS = 50;
1183
1184
  var toTaskListSummary = (value) => {
1184
1185
  const record = asRecord(value);
@@ -1226,8 +1227,9 @@ async function createTask(accessToken, input) {
1226
1227
  }
1227
1228
  /** PATCH body for a task edit — only the fields the caller supplied. As with
1228
1229
  * events, `undefined` means "leave as is" and `""` means "clear it", so the
1229
- * two must stay distinct. `status` is deliberately absent: `completeTask`
1230
- * owns that transition, and two ways to set it would drift apart. */
1230
+ * two must stay distinct. `status` is deliberately absent: `completeTask` /
1231
+ * `uncompleteTask` own that transition, and two ways to set it would drift
1232
+ * apart. */
1231
1233
  var buildTaskPatch = (input) => ({
1232
1234
  ...input.title !== void 0 ? { title: input.title } : {},
1233
1235
  ...input.notes !== void 0 ? { notes: input.notes } : {},
@@ -1245,6 +1247,25 @@ async function completeTask(accessToken, input) {
1245
1247
  body: JSON.stringify({ status: TASK_STATUS_COMPLETED })
1246
1248
  }));
1247
1249
  }
1250
+ /** Send a completed task back to the to-do list.
1251
+ *
1252
+ * Its own function rather than a flag on `completeTask`, and deliberately not
1253
+ * a `status` field on `updateTask`: one kind per target state keeps the name
1254
+ * honest and leaves exactly one code path setting each value.
1255
+ *
1256
+ * The patch carries `status` alone — mirroring `completeTask`, which also
1257
+ * sets only `status` and lets Google fill in the `completed` timestamp. Note
1258
+ * that whether Google *clears* that timestamp on the way back is its
1259
+ * behaviour, not ours, and is unverified here: `TaskSummary` doesn't carry
1260
+ * `completed`, so nothing in this codebase would show a stale one. If a
1261
+ * reopened task ever displays a completion date in Google's own UI, this is
1262
+ * the place to add `completed: null` to the patch. */
1263
+ async function uncompleteTask(accessToken, input) {
1264
+ return toTaskSummary(await googleRequest(TASKS_API_LABEL, accessToken, tasksUrl(input.taskListId, `/${encodeURIComponent(input.taskId)}`), {
1265
+ method: "PATCH",
1266
+ body: JSON.stringify({ status: TASK_STATUS_NEEDS_ACTION })
1267
+ }));
1268
+ }
1248
1269
  async function deleteTask(accessToken, input) {
1249
1270
  await googleRequest(TASKS_API_LABEL, accessToken, tasksUrl(input.taskListId, `/${encodeURIComponent(input.taskId)}`), { method: "DELETE" });
1250
1271
  }
@@ -1423,6 +1444,7 @@ exports.toDriveFileSummary = toDriveFileSummary;
1423
1444
  exports.toEventSummary = toEventSummary;
1424
1445
  exports.toTaskListSummary = toTaskListSummary;
1425
1446
  exports.toTaskSummary = toTaskSummary;
1447
+ exports.uncompleteTask = uncompleteTask;
1426
1448
  exports.unlinkGoogle = unlinkGoogle;
1427
1449
  exports.unsyncedGroups = unsyncedGroups;
1428
1450
  exports.updateCalendarEvent = updateCalendarEvent;