Skip to content

Commit eed1d2a

Browse files
committed
fix(twister): type Goal/TodayItem id fields as Uuid, not string
Goal.id/focusId, TodayItem.id/threadIds/focusId/goalId, and the corresponding Plot-tool method signatures (archiveGoal, updateTodayItem, getTodayThreadId) now use the branded Uuid type consistently with every other id field in the SDK (Thread.id, Focus.id, Link.id, etc.), instead of plain string.
1 parent 3a36390 commit eed1d2a

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎twister/src/goal.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* cleared (`null`) ones.
1616
*/
1717

18+
import { type Uuid } from "./utils/uuid";
19+
1820
/**
1921
* Lifecycle status of a goal.
2022
* - `active`: live; shapes day planning.
@@ -40,7 +42,7 @@ export type GoalCadence = {
4042
*/
4143
export type Goal = {
4244
/** Unique identifier for the goal */
43-
id: string;
45+
id: Uuid;
4446
/** Short imperative, e.g. "Ship the Today feature" */
4547
title: string;
4648
/** Freeform elaboration / agent notes */
@@ -54,7 +56,7 @@ export type Goal = {
5456
/** Recurring effort budget */
5557
cadence: GoalCadence | null;
5658
/** Linked focus id, or null when the goal isn't tied to a focus */
57-
focusId: string | null;
59+
focusId: Uuid | null;
5860
};
5961

6062
/** Type for creating a new goal: `title` is required, all else optional. */

‎twister/src/plot.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ export type TodayItemKind = "todo" | "event" | "urgent" | "goal" | "update";
14951495
* server-authored and read-only from the SDK.
14961496
*/
14971497
export type TodayItem = {
1498-
id: string;
1498+
id: Uuid;
14991499
/** The user-local day this item belongs to, as an ISO date ("YYYY-MM-DD"). */
15001500
day: string;
15011501
section: TodayItemSection;
@@ -1507,11 +1507,11 @@ export type TodayItem = {
15071507
/** 1–2 sentence support text, mainly for "updates" items. */
15081508
detail: string | null;
15091509
/** Linked threads; the first is the primary open target. May be empty (e.g. goal items). */
1510-
threadIds: string[];
1510+
threadIds: Uuid[];
15111511
/** The focus this item is labeled with, if any. */
1512-
focusId: string | null;
1512+
focusId: Uuid | null;
15131513
/** The goal this item derives from, if any. */
1514-
goalId: string | null;
1514+
goalId: Uuid | null;
15151515
/** Event start (events only). */
15161516
startsAt: Date | string | null;
15171517
/** Event end (events only). */

‎twister/src/tools/plot.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ export abstract class Plot extends ITool {
690690
* @throws Error if the goal does not exist
691691
*/
692692
// eslint-disable-next-line @typescript-eslint/no-unused-vars
693-
abstract archiveGoal(id: string): Promise<void>;
693+
abstract archiveGoal(id: Uuid): Promise<void>;
694694

695695
/**
696696
* Lists the user's current Today snapshot: all non-archived items for the
@@ -716,7 +716,7 @@ export abstract class Plot extends ITool {
716716
*/
717717
// eslint-disable-next-line @typescript-eslint/no-unused-vars
718718
abstract updateTodayItem(update: {
719-
id: string;
719+
id: Uuid;
720720
rank?: number;
721721
checked?: boolean;
722722
dismissed?: boolean;
@@ -728,7 +728,7 @@ export abstract class Plot extends ITool {
728728
*
729729
* Requires `today` access ({@link TodayAccess.Read} or higher).
730730
*/
731-
abstract getTodayThreadId(): Promise<string | null>;
731+
abstract getTodayThreadId(): Promise<Uuid | null>;
732732

733733
/**
734734
* Retrieves links from connected source channels.

0 commit comments

Comments
 (0)