@burdenoff/planmagnet-fe-sdk 2026.703.2 → 2026.704.1

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { DragEvent, ReactNode, HTMLAttributes, ComponentType } from 'react';
2
+ import { HTMLAttributes, ReactNode, ComponentType, DragEvent } from 'react';
3
3
  import { ApolloClient } from '@apollo/client/core';
4
4
  import * as graphql from 'graphql';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -7,6 +7,32 @@ import { VariantProps } from 'class-variance-authority';
7
7
  import { LucideProps } from 'lucide-react';
8
8
  import { ClassValue } from 'clsx';
9
9
 
10
+ declare const badgeVariants: (props?: ({
11
+ variant?: "default" | "muted" | "secondary" | "accent" | "destructive" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
14
+ }
15
+ /**
16
+ * Badge — a small owned pill primitive used for task status/priority/type.
17
+ * Semantic-token only.
18
+ */
19
+ declare function Badge({ className, variant, ...props }: BadgeProps): react.JSX.Element;
20
+
21
+ declare const SIZES: {
22
+ readonly sm: "h-5 w-5 text-[9px]";
23
+ readonly md: "h-6 w-6 text-[10px]";
24
+ readonly lg: "h-8 w-8 text-xs";
25
+ };
26
+ interface AvatarProps {
27
+ /** Assignee actor id (used for the deterministic tint + fallback initials). */
28
+ id?: string | null;
29
+ /** Resolved display name, if the host has a directory. */
30
+ name?: string | null;
31
+ size?: keyof typeof SIZES;
32
+ className?: string;
33
+ }
34
+ declare function Avatar({ id, name, size, className }: AvatarProps): react.JSX.Element;
35
+
10
36
  /**
11
37
  * Domain types for the PlanMagnet task SDK.
12
38
  *
@@ -155,6 +181,89 @@ interface ProjectList {
155
181
  pageInfo: TaskPageInfo;
156
182
  totalCount: number;
157
183
  }
184
+ /**
185
+ * A link between a work item and an external entity owned by another product
186
+ * (`WorkItemLink`). HealthyBowl pins a task to a Field/Crop/Animal/Pest record
187
+ * via `sourceProduct: "healthybowl"` + `entityType`/`entityId`, snapshotting a
188
+ * label + deep-link so a deleted record degrades gracefully. The OUTPUT type is
189
+ * bare `WorkItemLink`; server-side all ids except `id` are `String`.
190
+ */
191
+ interface WorkItemLink {
192
+ id: string;
193
+ workspaceId: string;
194
+ workItemId: string;
195
+ sourceProduct: string;
196
+ entityType: string;
197
+ entityId: string;
198
+ relationType: WorkItemLinkRelation;
199
+ displayNameSnapshot?: string | null;
200
+ deepLinkSnapshot?: string | null;
201
+ metadata?: unknown;
202
+ createdBy: string;
203
+ onBehalfOf?: string | null;
204
+ createdAt: string;
205
+ updatedAt: string;
206
+ }
207
+ /**
208
+ * Input for `planmagnetLinkWorkItem` (PlanmagnetCreateWorkItemLinkInput).
209
+ * Required: workItemId, sourceProduct, entityType, entityId. `relationType` is
210
+ * optional (server defaults to RELATED_TO).
211
+ */
212
+ interface CreateWorkItemLinkInput {
213
+ workItemId: string;
214
+ sourceProduct: string;
215
+ entityType: string;
216
+ entityId: string;
217
+ relationType?: WorkItemLinkRelation;
218
+ displayNameSnapshot?: string;
219
+ deepLinkSnapshot?: string;
220
+ metadata?: unknown;
221
+ }
222
+ /** Filter for `planmagnetWorkItemLinks` (PlanmagnetWorkItemLinkFilter). */
223
+ interface ListWorkItemLinksInput {
224
+ workItemId?: string;
225
+ sourceProduct?: string;
226
+ entityType?: string;
227
+ entityId?: string;
228
+ relationType?: WorkItemLinkRelation;
229
+ }
230
+ /** Shape returned by the ListWorkItemLinks query (PlanmagnetWorkItemLinkList). */
231
+ interface WorkItemLinkList {
232
+ items: WorkItemLink[];
233
+ pageInfo: TaskPageInfo;
234
+ totalCount: number;
235
+ }
236
+ /** Milestone status (MilestoneStatus). */
237
+ type MilestoneStatus = "PENDING" | "IN_PROGRESS" | "COMPLETED" | "MISSED" | "CANCELLED";
238
+ /**
239
+ * A project milestone (e.g. a harvest window). Rendered as a flag on the
240
+ * Timeline. `sortOrder`/`tagsV2` are intentionally omitted (see LIST_MILESTONES).
241
+ */
242
+ interface Milestone {
243
+ id: string;
244
+ projectId: string;
245
+ name: string;
246
+ description?: string | null;
247
+ status: MilestoneStatus;
248
+ dueDate?: string | null;
249
+ completedAt?: string | null;
250
+ ownerId?: string | null;
251
+ createdAt: string;
252
+ updatedAt: string;
253
+ }
254
+ /** Filter for `planmagnetMilestones` (PlanmagnetMilestoneFilter). */
255
+ interface ListMilestonesInput {
256
+ ownerId?: string;
257
+ projectId?: string;
258
+ search?: string;
259
+ status?: MilestoneStatus;
260
+ }
261
+ /** Shape returned by LIST_MILESTONES (PlanmagnetMilestoneList). */
262
+ interface MilestoneList {
263
+ items: Milestone[];
264
+ pageInfo: TaskPageInfo;
265
+ totalCount: number;
266
+ }
158
267
  /** Board column definition. */
159
268
  interface BoardColumn {
160
269
  status: TaskStatus;
@@ -179,6 +288,106 @@ declare const TASK_STATUSES: TaskStatus[];
179
288
  */
180
289
  declare function enumLabel(value: string): string;
181
290
 
291
+ /**
292
+ * Optional host hook to render an icon for a linked entity type (e.g. a leaf
293
+ * for FIELD, a cow for ANIMAL). The SDK is farm-free, so it renders a generic
294
+ * link glyph unless the host supplies one.
295
+ */
296
+ type RenderLinkIcon = (entityType: string) => ReactNode;
297
+ interface LinkChipProps {
298
+ link: WorkItemLink;
299
+ renderIcon?: RenderLinkIcon;
300
+ className?: string;
301
+ }
302
+ /**
303
+ * LinkChip — a compact chip for a WorkItemLink (the task's linked farm record).
304
+ * Shows the snapshotted label (falls back to the entity type), tinted with the
305
+ * primary token so it reads as the mockup's green linked-record chip in the
306
+ * forest theme. Deep-links via `deepLinkSnapshot` when present; the click is
307
+ * stopped from bubbling so it doesn't also open the task.
308
+ */
309
+ declare function LinkChip({ link, renderIcon, className }: LinkChipProps): react.JSX.Element;
310
+
311
+ /**
312
+ * Linear-style task indicators — status, priority, type.
313
+ *
314
+ * A hard rule of the codebase is "semantic tokens only, never raw colors". The
315
+ * default token palette only exposes a handful of hues (primary / secondary /
316
+ * muted / accent / destructive), which is not enough to give each of the six
317
+ * statuses its own distinct color like a raw-palette design would.
318
+ *
319
+ * So — exactly like Linear — status is differentiated primarily by icon SHAPE
320
+ * (dashed → empty → dotted → filled → check), with a subtle muted→primary tone
321
+ * progression, and priority by a filled-BAR count. This reads as a polished PM
322
+ * tool while staying 100% within the semantic-token contract.
323
+ */
324
+ interface StatusMeta {
325
+ icon: ComponentType<LucideProps>;
326
+ /** Icon tone (semantic token). */
327
+ tone: string;
328
+ }
329
+ /**
330
+ * Per-status icon + tone. Shape carries the meaning; tone progresses from muted
331
+ * (not started) toward primary (in flight / done). Overridable by hosts only
332
+ * via the column labels, never by raw color.
333
+ */
334
+ declare const STATUS_META: Record<TaskStatus, StatusMeta>;
335
+ interface StatusIconProps {
336
+ status: TaskStatus;
337
+ className?: string;
338
+ }
339
+ /** A single status glyph — shape-differentiated, token-toned. */
340
+ declare function StatusIcon({ status, className }: StatusIconProps): react.JSX.Element;
341
+ interface StatusPillProps {
342
+ status: TaskStatus;
343
+ className?: string;
344
+ }
345
+ /** Status as a compact bordered pill (icon + label) — used in the list view. */
346
+ declare function StatusPill({ status, className }: StatusPillProps): react.JSX.Element;
347
+ interface PriorityMeta {
348
+ /** Number of filled bars (0–3). */
349
+ level: number;
350
+ /** Fill tone (semantic token) applied to the filled bars + label. */
351
+ tone: string;
352
+ }
353
+ declare const PRIORITY_META: Record<TaskPriority, PriorityMeta>;
354
+ interface PriorityIndicatorProps {
355
+ priority: TaskPriority;
356
+ /** Show the text label next to the bars. */
357
+ showLabel?: boolean;
358
+ className?: string;
359
+ }
360
+ /**
361
+ * Linear-style priority signal — three bars, filled by level. NONE renders all
362
+ * bars faint (its own recognizable "no priority" look).
363
+ */
364
+ declare function PriorityIndicator({ priority, showLabel, className, }: PriorityIndicatorProps): react.JSX.Element;
365
+ interface TypeBadgeProps {
366
+ type: TaskType;
367
+ className?: string;
368
+ }
369
+ /** Work-item type as a subtle badge. */
370
+ declare function TypeBadge({ type, className }: TypeBadgeProps): react.JSX.Element;
371
+
372
+ interface ModalProps {
373
+ open: boolean;
374
+ onClose: () => void;
375
+ children: ReactNode;
376
+ ariaLabel?: string;
377
+ className?: string;
378
+ }
379
+ /** Centered modal card overlay (owned, semantic-token only). */
380
+ declare function Modal(props: ModalProps): react.JSX.Element;
381
+ interface DrawerProps {
382
+ open: boolean;
383
+ onClose: () => void;
384
+ children: ReactNode;
385
+ ariaLabel?: string;
386
+ className?: string;
387
+ }
388
+ /** Right-anchored slide-over drawer overlay (owned, semantic-token only). */
389
+ declare function Drawer(props: DrawerProps): react.JSX.Element;
390
+
182
391
  /**
183
392
  * Optional host hook: resolve an assignee id to a display name (the SDK has no
184
393
  * user directory). When omitted the avatar falls back to id-initials.
@@ -186,6 +395,11 @@ declare function enumLabel(value: string): string;
186
395
  type ResolveAssignee = (assigneeId: string) => {
187
396
  name?: string | null;
188
397
  } | null | undefined;
398
+ /** A selectable assignee for the create/edit picker (host-provided directory). */
399
+ interface AssigneeOption {
400
+ id: string;
401
+ name: string;
402
+ }
189
403
  interface TaskCardProps {
190
404
  task: Task;
191
405
  /** Field names to hide (key/type/priority/labels/storyPoints/assignee/dueDate). */
@@ -198,6 +412,10 @@ interface TaskCardProps {
198
412
  /** True while this card is the one being dragged. */
199
413
  dragging?: boolean;
200
414
  resolveAssignee?: ResolveAssignee;
415
+ /** Linked farm records for this task (rendered as chips). */
416
+ links?: WorkItemLink[];
417
+ /** Optional host hook to render an icon per linked-entity type. */
418
+ renderLinkIcon?: RenderLinkIcon;
201
419
  className?: string;
202
420
  }
203
421
  /**
@@ -205,7 +423,7 @@ interface TaskCardProps {
205
423
  * only real fields (no invented assignee names or entity links). Semantic
206
424
  * tokens only.
207
425
  */
208
- declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, dragging, resolveAssignee, className, }: TaskCardProps): react.JSX.Element;
426
+ declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, dragging, resolveAssignee, links, renderLinkIcon, className, }: TaskCardProps): react.JSX.Element;
209
427
 
210
428
  interface TaskBoardCoreProps {
211
429
  /** Scope the board to one project (client-side filter for Phase 1). */
@@ -239,6 +457,14 @@ interface TaskBoardCoreProps {
239
457
  resolveAssignee?: ResolveAssignee;
240
458
  /** Called when a task card is clicked. */
241
459
  onTaskClick?: (task: Task) => void;
460
+ /**
461
+ * When set, the board fetches WorkItemLinks for this `sourceProduct` (e.g.
462
+ * "healthybowl") and renders a linked-record chip on each card. Omitted → no
463
+ * link fetch (SDK stays farm-free).
464
+ */
465
+ linkSourceProduct?: string;
466
+ /** Optional host hook to render an icon per linked-entity type. */
467
+ renderLinkIcon?: RenderLinkIcon;
242
468
  /** Extra classes on the root container. */
243
469
  className?: string;
244
470
  /**
@@ -257,7 +483,7 @@ interface TaskBoardCoreProps {
257
483
  * (optimistic cache update + `UPDATE_WORK_ITEM`; reverts on error). Filtering
258
484
  * is controlled by the parent toolbar. Farm-free, semantic-token only.
259
485
  */
260
- declare function TaskBoardCore({ projectId, columns, readonly, hideHeader, priority, type, search, assigneeId, hiddenFields, resolveAssignee, onTaskClick, className, workspaceId: workspaceIdProp, }: TaskBoardCoreProps): react.JSX.Element;
486
+ declare function TaskBoardCore({ projectId, columns, readonly, hideHeader, priority, type, search, assigneeId, hiddenFields, resolveAssignee, linkSourceProduct, renderLinkIcon, onTaskClick, className, workspaceId: workspaceIdProp, }: TaskBoardCoreProps): react.JSX.Element;
261
487
 
262
488
  interface TaskBoardProps extends TaskBoardCoreProps {
263
489
  /** Workspace API gateway URL (URL mode). */
@@ -319,6 +545,8 @@ interface CreateTaskCoreProps {
319
545
  * until a project id is present.
320
546
  */
321
547
  projectId?: string;
548
+ /** Optional host-provided member directory → renders an assignee picker. */
549
+ assigneeOptions?: AssigneeOption[];
322
550
  /** Field names to hide on the form. */
323
551
  hiddenFields?: CreateTaskField[];
324
552
  /** Default values applied on first render. */
@@ -346,7 +574,7 @@ interface CreateTaskCoreProps {
346
574
  * Mirrors the TaskBoardCore contract: `workspaceId` from a prop or the
347
575
  * PlanMagnetProvider context, `hiddenFields` for host-driven field suppression.
348
576
  */
349
- declare function CreateTaskCore({ projectId: projectIdProp, hiddenFields, defaultValues, hideHeader, submitLabel, onCreated, onError, onCancel, className, workspaceId: workspaceIdProp, }: CreateTaskCoreProps): react.JSX.Element;
577
+ declare function CreateTaskCore({ projectId: projectIdProp, assigneeOptions, hiddenFields, defaultValues, hideHeader, submitLabel, onCreated, onError, onCancel, className, workspaceId: workspaceIdProp, }: CreateTaskCoreProps): react.JSX.Element;
350
578
 
351
579
  interface CreateTaskProps extends CreateTaskCoreProps {
352
580
  /** Workspace API gateway URL (URL mode). */
@@ -394,7 +622,7 @@ interface CreateTaskProps extends CreateTaskCoreProps {
394
622
  declare function CreateTask({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: CreateTaskProps): react.JSX.Element;
395
623
 
396
624
  /** Columns available in the compact list. */
397
- type TaskListColumn = "key" | "title" | "type" | "status" | "priority" | "assignee" | "dueDate" | "storyPoints" | "labels";
625
+ type TaskListColumn = "key" | "title" | "type" | "status" | "priority" | "assignee" | "dueDate" | "storyPoints" | "linkedRecord" | "labels";
398
626
  /** Sort keys for the list. */
399
627
  type TaskListSort = "priority" | "status" | "title" | "type" | "dueDate" | "storyPoints";
400
628
  interface TaskListCoreProps {
@@ -422,6 +650,13 @@ interface TaskListCoreProps {
422
650
  onSelect?: (id: string) => void;
423
651
  /** Optional host hook to resolve an assignee id → display name. */
424
652
  resolveAssignee?: ResolveAssignee;
653
+ /**
654
+ * When set, fetch WorkItemLinks for this `sourceProduct` and populate the
655
+ * "linkedRecord" column. Omitted → no link fetch.
656
+ */
657
+ linkSourceProduct?: string;
658
+ /** Optional host hook to render an icon per linked-entity type. */
659
+ renderLinkIcon?: RenderLinkIcon;
425
660
  /** Max items to fetch (pagination.first). Defaults to 200. */
426
661
  limit?: number;
427
662
  /** Extra classes on the root container. */
@@ -437,7 +672,7 @@ interface TaskListCoreProps {
437
672
  * headers. Filters map to the server-side filter; sort is client-side.
438
673
  * BYO-Apollo, semantic-token only, farm-free.
439
674
  */
440
- declare function TaskListCore({ projectId, status, type, priority, assigneeId, search, columns, sortBy, sortDir, hideHeader, onSelect, resolveAssignee, limit, className, workspaceId: workspaceIdProp, }: TaskListCoreProps): react.JSX.Element;
675
+ declare function TaskListCore({ projectId, status, type, priority, assigneeId, search, columns, sortBy, sortDir, hideHeader, onSelect, resolveAssignee, linkSourceProduct, renderLinkIcon, limit, className, workspaceId: workspaceIdProp, }: TaskListCoreProps): react.JSX.Element;
441
676
 
442
677
  interface TaskListProps extends TaskListCoreProps {
443
678
  /** Workspace API gateway URL (URL mode). */
@@ -496,6 +731,8 @@ interface TaskTimelineCoreProps {
496
731
  onSelect?: (id: string) => void;
497
732
  /** Optional host hook to resolve an assignee id → display name. */
498
733
  resolveAssignee?: ResolveAssignee;
734
+ /** Fetch + flag project milestones on the timeline (default true). */
735
+ showMilestones?: boolean;
499
736
  className?: string;
500
737
  workspaceId?: string;
501
738
  }
@@ -508,7 +745,7 @@ interface TaskTimelineCoreProps {
508
745
  * honest to the data. Overdue and undated work is surfaced explicitly so nothing
509
746
  * hides. BYO-Apollo, semantic-token only, farm-free.
510
747
  */
511
- declare function TaskTimelineCore({ projectId, priority, type, search, assigneeId, defaultMode, onSelect, resolveAssignee, className, workspaceId: workspaceIdProp, }: TaskTimelineCoreProps): react.JSX.Element;
748
+ declare function TaskTimelineCore({ projectId, priority, type, search, assigneeId, defaultMode, onSelect, resolveAssignee, showMilestones, className, workspaceId: workspaceIdProp, }: TaskTimelineCoreProps): react.JSX.Element;
512
749
 
513
750
  /** The three task views the toolbar can switch between. */
514
751
  type TaskView = "board" | "list" | "timeline";
@@ -525,6 +762,9 @@ interface TaskToolbarProps {
525
762
  onTypeChange: (type: TaskType | "ALL") => void;
526
763
  onNewTask?: () => void;
527
764
  canCreate?: boolean;
765
+ /** "My tasks" toggle — only rendered when `onMineChange` is provided. */
766
+ mine?: boolean;
767
+ onMineChange?: (mine: boolean) => void;
528
768
  className?: string;
529
769
  }
530
770
  /**
@@ -532,7 +772,7 @@ interface TaskToolbarProps {
532
772
  * view tabs (Board / List / Timeline) + search + priority/type filters + a
533
773
  * "New task" action. Fully controlled; semantic-token only.
534
774
  */
535
- declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, className, }: TaskToolbarProps): react.JSX.Element;
775
+ declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, mine, onMineChange, className, }: TaskToolbarProps): react.JSX.Element;
536
776
 
537
777
  /** Fields that can be hidden / suppressed on the detail view + edit form. */
538
778
  type TaskDetailField = "description" | "type" | "status" | "priority" | "assignee" | "dueDate" | "labels" | "storyPoints";
@@ -547,8 +787,14 @@ interface TaskDetailCoreProps {
547
787
  hideHeader?: boolean;
548
788
  /** Called with the updated work item after a successful save. */
549
789
  onUpdated?: (workItem: WorkItemDetail) => void;
550
- /** Called when the update mutation errors. */
790
+ /** Called after a successful delete (with the deleted id). Enables the Delete button. */
791
+ onDeleted?: (id: string) => void;
792
+ /** Called when a mutation errors. */
551
793
  onError?: (error: Error) => void;
794
+ /** Optional host hook to resolve an assignee id → display name. */
795
+ resolveAssignee?: ResolveAssignee;
796
+ /** Optional host-provided member directory → renders a picker instead of a raw id field. */
797
+ assigneeOptions?: AssigneeOption[];
552
798
  /** Extra classes on the root container. */
553
799
  className?: string;
554
800
  }
@@ -557,7 +803,7 @@ interface TaskDetailCoreProps {
557
803
  * edit. Fetches via `planmagnetWorkItem(id)`, saves via
558
804
  * `planmagnetUpdateWorkItem`. BYO-Apollo, semantic-token only, farm-free.
559
805
  */
560
- declare function TaskDetailCore({ id, readonly, hiddenFields, hideHeader, onUpdated, onError, className, }: TaskDetailCoreProps): react.JSX.Element;
806
+ declare function TaskDetailCore({ id, readonly, hiddenFields, hideHeader, onUpdated, onDeleted, onError, resolveAssignee, assigneeOptions, className, }: TaskDetailCoreProps): react.JSX.Element;
561
807
 
562
808
  interface TaskDetailProps extends TaskDetailCoreProps {
563
809
  /** Workspace API gateway URL (URL mode). */
@@ -598,6 +844,96 @@ interface TaskDetailProps extends TaskDetailCoreProps {
598
844
  */
599
845
  declare function TaskDetail({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TaskDetailProps): react.JSX.Element;
600
846
 
847
+ /**
848
+ * TaskLabels — every user-facing string the SDK renders, so a host (e.g.
849
+ * HealthyBowl, which ships 6 languages) can inject translations. English
850
+ * defaults are used when no `labels` are provided, so the SDK works standalone.
851
+ * The SDK stays farm-free + string-agnostic; the host owns translation.
852
+ */
853
+ interface TaskLabels {
854
+ board: string;
855
+ list: string;
856
+ timeline: string;
857
+ searchPlaceholder: string;
858
+ allPriorities: string;
859
+ allTypes: string;
860
+ newTask: string;
861
+ myTasks: string;
862
+ noTasks: string;
863
+ noTasksFound: string;
864
+ dropHere: string;
865
+ unassigned: string;
866
+ assigned: string;
867
+ overdue: string;
868
+ noDueDate: string;
869
+ milestones: string;
870
+ today: string;
871
+ week: string;
872
+ month: string;
873
+ tasksSingular: string;
874
+ tasksPlural: string;
875
+ colTask: string;
876
+ colStatus: string;
877
+ colPriority: string;
878
+ colAssignee: string;
879
+ colDueDate: string;
880
+ colPoints: string;
881
+ colLinkedRecord: string;
882
+ colType: string;
883
+ colKey: string;
884
+ colLabels: string;
885
+ newTaskHeading: string;
886
+ newTaskSubtitle: string;
887
+ title: string;
888
+ titlePlaceholder: string;
889
+ description: string;
890
+ descriptionPlaceholder: string;
891
+ typeLabel: string;
892
+ statusLabel: string;
893
+ priorityLabel: string;
894
+ assigneeLabel: string;
895
+ assigneePlaceholder: string;
896
+ dueDateLabel: string;
897
+ storyPointsLabel: string;
898
+ labelsLabel: string;
899
+ labelsPlaceholder: string;
900
+ create: string;
901
+ creating: string;
902
+ cancel: string;
903
+ edit: string;
904
+ del: string;
905
+ deletePrompt: string;
906
+ yes: string;
907
+ no: string;
908
+ save: string;
909
+ saving: string;
910
+ taskNotFound: string;
911
+ projectRequired: string;
912
+ errorLoading: string;
913
+ moveFailed: string;
914
+ failedToCreate: string;
915
+ failedToSave: string;
916
+ failedToDelete: string;
917
+ overdueLabel: string;
918
+ more: string;
919
+ status: Record<TaskStatus, string>;
920
+ priority: Record<TaskPriority, string>;
921
+ type: Record<TaskType, string>;
922
+ }
923
+ /** English defaults — the SDK renders these when no `labels` prop is provided. */
924
+ declare const DEFAULT_TASK_LABELS: TaskLabels;
925
+ declare const TaskLabelsProvider: react.Provider<TaskLabels>;
926
+ /** Read the active task labels (English defaults if no host override). */
927
+ declare function useTaskLabels(): TaskLabels;
928
+ /** A host may override any subset; missing keys fall back to English. */
929
+ type PartialTaskLabels = Partial<Omit<TaskLabels, "status" | "priority" | "type">> & {
930
+ status?: Partial<TaskLabels["status"]>;
931
+ priority?: Partial<TaskLabels["priority"]>;
932
+ type?: Partial<TaskLabels["type"]>;
933
+ };
934
+ /** Merge a host's partial overrides onto the English defaults. */
935
+ declare function mergeTaskLabels(overrides?: PartialTaskLabels): TaskLabels;
936
+
601
937
  /**
602
938
  * Which SDK fields the composed page should suppress. The union of the create
603
939
  * form fields and the detail fields — the page fans a single `hiddenFields`
@@ -639,6 +975,23 @@ interface TasksPageCoreProps {
639
975
  defaultView?: TaskView;
640
976
  /** Optional host hook to resolve an assignee id → display name. */
641
977
  resolveAssignee?: ResolveAssignee;
978
+ /**
979
+ * When set, the board + list fetch WorkItemLinks for this `sourceProduct`
980
+ * (e.g. "healthybowl") and render linked-record chips / a "Linked Record"
981
+ * column. Omitted → no link fetch (SDK stays farm-free).
982
+ */
983
+ linkSourceProduct?: string;
984
+ /** Optional host hook to render an icon per linked-entity type. */
985
+ renderLinkIcon?: RenderLinkIcon;
986
+ /** Optional host-provided member directory → renders assignee pickers in create/edit. */
987
+ assigneeOptions?: AssigneeOption[];
988
+ /**
989
+ * The current user's actor id. When provided, the toolbar shows a "My tasks"
990
+ * toggle that filters every view to items assigned to this actor.
991
+ */
992
+ currentActorId?: string;
993
+ /** Host-provided translations for every UI string (English defaults otherwise). */
994
+ labels?: PartialTaskLabels;
642
995
  /**
643
996
  * Header/title slot rendered ABOVE the toolbar. Pass a string for the default
644
997
  * heading, or any node to fully own the title area. Omit for no title (e.g.
@@ -663,7 +1016,7 @@ interface TasksPageCoreProps {
663
1016
  * BYO-Apollo: reads the ambient `<ApolloProvider>` and takes `workspaceId` from
664
1017
  * a prop or the PlanMagnetProvider context. Semantic tokens only, farm-free.
665
1018
  */
666
- declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
1019
+ declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, linkSourceProduct, renderLinkIcon, assigneeOptions, currentActorId, labels, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
667
1020
 
668
1021
  interface TasksPageProps extends TasksPageCoreProps {
669
1022
  /** Workspace API gateway URL (URL mode). */
@@ -767,6 +1120,38 @@ declare function usePlanMagnetContext(): PlanMagnetContextValue;
767
1120
  */
768
1121
  declare function usePlanMagnetContextSafe(): PlanMagnetContextValue | null;
769
1122
 
1123
+ interface UseWorkItemLinksResult {
1124
+ /** Links grouped by the work item they belong to. */
1125
+ linksByItem: Map<string, WorkItemLink[]>;
1126
+ loading: boolean;
1127
+ }
1128
+ /**
1129
+ * useWorkItemLinks — batch-fetch WorkItemLinks for a workspace (scoped to one
1130
+ * `sourceProduct`, e.g. "healthybowl") in ONE query and group them by
1131
+ * `workItemId`. WorkItem has no `links` field, so the board/list join links to
1132
+ * items client-side. Skips entirely when no `sourceProduct` is provided, so the
1133
+ * SDK stays farm-free and link-fetching is opt-in per host.
1134
+ */
1135
+ declare function useWorkItemLinks(workspaceId: string | undefined, sourceProduct: string | undefined, limit?: number): UseWorkItemLinksResult;
1136
+
1137
+ interface UseMilestonesResult {
1138
+ milestones: Milestone[];
1139
+ /** Milestones grouped by their due day (yyyy-MM-dd), for timeline flags. */
1140
+ byDay: Map<string, Milestone[]>;
1141
+ loading: boolean;
1142
+ }
1143
+ /**
1144
+ * useMilestones — fetch a project's milestones (e.g. a harvest window) for the
1145
+ * Timeline to flag. Skips when no workspaceId. Errors are swallowed by Apollo's
1146
+ * error return so a milestone RBAC/serialization hiccup never breaks the board;
1147
+ * `milestones` is simply empty. Farm-free; opt-in via `enabled`.
1148
+ */
1149
+ declare function useMilestones(workspaceId: string | undefined, opts?: {
1150
+ projectId?: string;
1151
+ enabled?: boolean;
1152
+ limit?: number;
1153
+ }): UseMilestonesResult;
1154
+
770
1155
  interface PlanMagnetClientConfig {
771
1156
  /** Workspace API gateway base URL (e.g. https://graphqlworkspaces.burdenoff.com). */
772
1157
  apiGatewayUrl: string;
@@ -840,6 +1225,13 @@ declare const GET_PROJECTS: graphql.DocumentNode;
840
1225
  declare const CREATE_WORK_ITEM: graphql.DocumentNode;
841
1226
  declare const UPDATE_WORK_ITEM: graphql.DocumentNode;
842
1227
  declare const MOVE_WORK_ITEM: graphql.DocumentNode;
1228
+ declare const WORK_ITEM_LINK_FIELDS: graphql.DocumentNode;
1229
+ declare const LIST_WORK_ITEM_LINKS: graphql.DocumentNode;
1230
+ declare const CREATE_WORK_ITEM_LINK: graphql.DocumentNode;
1231
+ declare const DELETE_WORK_ITEM_LINK: graphql.DocumentNode;
1232
+ declare const MILESTONE_FIELDS: graphql.DocumentNode;
1233
+ declare const LIST_MILESTONES: graphql.DocumentNode;
1234
+ declare const DELETE_WORK_ITEM: graphql.DocumentNode;
843
1235
 
844
1236
  /**
845
1237
  * Configuration module for the PlanMagnet SDK.
@@ -907,112 +1299,6 @@ declare function validateTrustedOrigin(trustedOrigins?: string[]): void;
907
1299
  */
908
1300
  declare function getGraphQLEndpoint(baseUrl?: string): string;
909
1301
 
910
- declare const badgeVariants: (props?: ({
911
- variant?: "default" | "muted" | "secondary" | "accent" | "destructive" | null | undefined;
912
- } & class_variance_authority_types.ClassProp) | undefined) => string;
913
- interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
914
- }
915
- /**
916
- * Badge — a small owned pill primitive used for task status/priority/type.
917
- * Semantic-token only.
918
- */
919
- declare function Badge({ className, variant, ...props }: BadgeProps): react.JSX.Element;
920
-
921
- declare const SIZES: {
922
- readonly sm: "h-5 w-5 text-[9px]";
923
- readonly md: "h-6 w-6 text-[10px]";
924
- readonly lg: "h-8 w-8 text-xs";
925
- };
926
- interface AvatarProps {
927
- /** Assignee actor id (used for the deterministic tint + fallback initials). */
928
- id?: string | null;
929
- /** Resolved display name, if the host has a directory. */
930
- name?: string | null;
931
- size?: keyof typeof SIZES;
932
- className?: string;
933
- }
934
- declare function Avatar({ id, name, size, className }: AvatarProps): react.JSX.Element;
935
-
936
- /**
937
- * Linear-style task indicators — status, priority, type.
938
- *
939
- * A hard rule of the codebase is "semantic tokens only, never raw colors". The
940
- * default token palette only exposes a handful of hues (primary / secondary /
941
- * muted / accent / destructive), which is not enough to give each of the six
942
- * statuses its own distinct color like a raw-palette design would.
943
- *
944
- * So — exactly like Linear — status is differentiated primarily by icon SHAPE
945
- * (dashed → empty → dotted → filled → check), with a subtle muted→primary tone
946
- * progression, and priority by a filled-BAR count. This reads as a polished PM
947
- * tool while staying 100% within the semantic-token contract.
948
- */
949
- interface StatusMeta {
950
- icon: ComponentType<LucideProps>;
951
- /** Icon tone (semantic token). */
952
- tone: string;
953
- }
954
- /**
955
- * Per-status icon + tone. Shape carries the meaning; tone progresses from muted
956
- * (not started) toward primary (in flight / done). Overridable by hosts only
957
- * via the column labels, never by raw color.
958
- */
959
- declare const STATUS_META: Record<TaskStatus, StatusMeta>;
960
- interface StatusIconProps {
961
- status: TaskStatus;
962
- className?: string;
963
- }
964
- /** A single status glyph — shape-differentiated, token-toned. */
965
- declare function StatusIcon({ status, className }: StatusIconProps): react.JSX.Element;
966
- interface StatusPillProps {
967
- status: TaskStatus;
968
- className?: string;
969
- }
970
- /** Status as a compact bordered pill (icon + label) — used in the list view. */
971
- declare function StatusPill({ status, className }: StatusPillProps): react.JSX.Element;
972
- interface PriorityMeta {
973
- /** Number of filled bars (0–3). */
974
- level: number;
975
- /** Fill tone (semantic token) applied to the filled bars + label. */
976
- tone: string;
977
- }
978
- declare const PRIORITY_META: Record<TaskPriority, PriorityMeta>;
979
- interface PriorityIndicatorProps {
980
- priority: TaskPriority;
981
- /** Show the text label next to the bars. */
982
- showLabel?: boolean;
983
- className?: string;
984
- }
985
- /**
986
- * Linear-style priority signal — three bars, filled by level. NONE renders all
987
- * bars faint (its own recognizable "no priority" look).
988
- */
989
- declare function PriorityIndicator({ priority, showLabel, className, }: PriorityIndicatorProps): react.JSX.Element;
990
- interface TypeBadgeProps {
991
- type: TaskType;
992
- className?: string;
993
- }
994
- /** Work-item type as a subtle badge. */
995
- declare function TypeBadge({ type, className }: TypeBadgeProps): react.JSX.Element;
996
-
997
- interface ModalProps {
998
- open: boolean;
999
- onClose: () => void;
1000
- children: ReactNode;
1001
- ariaLabel?: string;
1002
- className?: string;
1003
- }
1004
- /** Centered modal card overlay (owned, semantic-token only). */
1005
- declare function Modal(props: ModalProps): react.JSX.Element;
1006
- interface DrawerProps {
1007
- open: boolean;
1008
- onClose: () => void;
1009
- children: ReactNode;
1010
- ariaLabel?: string;
1011
- className?: string;
1012
- }
1013
- /** Right-anchored slide-over drawer overlay (owned, semantic-token only). */
1014
- declare function Drawer(props: DrawerProps): react.JSX.Element;
1015
-
1016
1302
  declare function cn(...inputs: ClassValue[]): string;
1017
1303
 
1018
- export { Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, DEFAULT_BOARD_COLUMNS, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_WORK_ITEMS, type ListTasksInput, MOVE_WORK_ITEM, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, WORK_ITEM_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, usePlanMagnetContext, usePlanMagnetContextSafe, validateTrustedOrigin, waitForPlanMagnetClient };
1304
+ export { type AssigneeOption, Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, type CreateWorkItemLinkInput, DEFAULT_BOARD_COLUMNS, DEFAULT_TASK_LABELS, DELETE_WORK_ITEM, DELETE_WORK_ITEM_LINK, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_MILESTONES, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, type LinkChipProps, type ListMilestonesInput, type ListTasksInput, type ListWorkItemLinksInput, MILESTONE_FIELDS, MOVE_WORK_ITEM, type Milestone, type MilestoneList, type MilestoneStatus, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PartialTaskLabels, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type RenderLinkIcon, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, type TaskLabels, TaskLabelsProvider, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, type UseMilestonesResult, type UseWorkItemLinksResult, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLink, type WorkItemLinkList, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, mergeTaskLabels, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, useMilestones, usePlanMagnetContext, usePlanMagnetContextSafe, useTaskLabels, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };