@burdenoff/planmagnet-fe-sdk 2026.703.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.
@@ -0,0 +1,840 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+ import { ApolloClient } from '@apollo/client/core';
4
+ import * as graphql from 'graphql';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
7
+ import { ClassValue } from 'clsx';
8
+
9
+ /**
10
+ * Domain types for the PlanMagnet task SDK.
11
+ *
12
+ * These mirror the wspace-planmagnet-svc schema (WorkItem / Project) but are
13
+ * kept hand-written for Phase 1 so the SDK compiles without a live `schema:pull`.
14
+ * Phase 2 should replace the hand-written slices with codegen output.
15
+ */
16
+ /** Board columns (WorkItemStatus). Logical UI order, not schema alpha order. */
17
+ type TaskStatus = "BACKLOG" | "TODO" | "IN_PROGRESS" | "IN_REVIEW" | "TESTING" | "DONE" | "CANCELLED";
18
+ /** Work-item type (WorkItemType). */
19
+ type TaskType = "TASK" | "STORY" | "BUG" | "EPIC" | "SUB_TASK";
20
+ /** Work-item priority (WorkItemPriority). */
21
+ type TaskPriority = "NONE" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
22
+ /** Cross-product entity link relation (WorkItemLinkRelation). */
23
+ type WorkItemLinkRelation = "RELATED_TO" | "BLOCKS" | "AFFECTS" | "INSPECTS" | "PRODUCES" | "WORKS_ON";
24
+ /**
25
+ * A work item as rendered on the board — the summary field set from
26
+ * `WorkItemSummaryFields`.
27
+ */
28
+ interface Task {
29
+ id: string;
30
+ key: string;
31
+ title: string;
32
+ type: TaskType;
33
+ status: TaskStatus;
34
+ priority: TaskPriority;
35
+ assigneeId?: string | null;
36
+ sprintId?: string | null;
37
+ storyPoints?: number | null;
38
+ dueDate?: string | null;
39
+ labels: string[];
40
+ }
41
+ /**
42
+ * A work item with the full field set from `WorkItemFields` — used by the
43
+ * detail view (view + inline edit). Superset of `Task` (the board summary).
44
+ */
45
+ interface WorkItemDetail {
46
+ id: string;
47
+ workspaceId: string;
48
+ projectId: string;
49
+ key: string;
50
+ title: string;
51
+ description?: string | null;
52
+ type: TaskType;
53
+ status: TaskStatus;
54
+ priority: TaskPriority;
55
+ assigneeId?: string | null;
56
+ reporterId?: string | null;
57
+ parentId?: string | null;
58
+ sprintId?: string | null;
59
+ storyPoints?: number | null;
60
+ estimateMinutes?: number | null;
61
+ timeSpentMinutes?: number | null;
62
+ dueDate?: string | null;
63
+ labels: string[];
64
+ tags: string[];
65
+ sortOrder?: number | null;
66
+ metadata?: unknown;
67
+ createdBy?: string | null;
68
+ createdAt?: string | null;
69
+ updatedAt?: string | null;
70
+ updatedBy?: string | null;
71
+ deletedAt?: string | null;
72
+ }
73
+ /** Project summary (for the create form's project selector / board scoping). */
74
+ interface Project {
75
+ id: string;
76
+ name: string;
77
+ key: string;
78
+ status: string;
79
+ methodology: string;
80
+ ownerId: string;
81
+ startDate?: string | null;
82
+ endDate?: string | null;
83
+ tags: string[];
84
+ }
85
+ /** Input for `planmagnetCreateWorkItem`. projectId + title + type are required. */
86
+ interface CreateTaskInput {
87
+ projectId: string;
88
+ title: string;
89
+ type: TaskType;
90
+ description?: string;
91
+ status?: TaskStatus;
92
+ priority?: TaskPriority;
93
+ assigneeId?: string;
94
+ reporterId?: string;
95
+ parentId?: string;
96
+ sprintId?: string;
97
+ storyPoints?: number;
98
+ estimateMinutes?: number;
99
+ dueDate?: string;
100
+ labels?: string[];
101
+ tags?: string[];
102
+ sortOrder?: number;
103
+ }
104
+ /** Input for `planmagnetUpdateWorkItem`. */
105
+ interface UpdateTaskInput {
106
+ title?: string;
107
+ description?: string;
108
+ type?: TaskType;
109
+ status?: TaskStatus;
110
+ priority?: TaskPriority;
111
+ assigneeId?: string;
112
+ sprintId?: string;
113
+ storyPoints?: number;
114
+ dueDate?: string;
115
+ labels?: string[];
116
+ tags?: string[];
117
+ sortOrder?: number;
118
+ }
119
+ /** Filter for `planmagnetWorkItems`. */
120
+ interface ListTasksInput {
121
+ assigneeId?: string;
122
+ parentId?: string;
123
+ priority?: TaskPriority;
124
+ projectId?: string;
125
+ reporterId?: string;
126
+ search?: string;
127
+ sprintId?: string;
128
+ status?: TaskStatus;
129
+ type?: TaskType;
130
+ }
131
+ /** Cursor pagination input (PlanmagnetPaginationInput / PaginationInput). */
132
+ interface TaskPaginationInput {
133
+ after?: string;
134
+ before?: string;
135
+ first?: number;
136
+ last?: number;
137
+ }
138
+ interface TaskPageInfo {
139
+ hasNextPage: boolean;
140
+ hasPreviousPage: boolean;
141
+ startCursor?: string | null;
142
+ endCursor?: string | null;
143
+ totalCount: number;
144
+ }
145
+ /** Shape returned by the ListWorkItems query. */
146
+ interface WorkItemList {
147
+ items: Task[];
148
+ pageInfo: TaskPageInfo;
149
+ totalCount: number;
150
+ }
151
+ /** Shape returned by the GetProjects query. */
152
+ interface ProjectList {
153
+ items: Project[];
154
+ pageInfo: TaskPageInfo;
155
+ totalCount: number;
156
+ }
157
+ /** Board column definition. */
158
+ interface BoardColumn {
159
+ status: TaskStatus;
160
+ label: string;
161
+ }
162
+ /**
163
+ * The default, ordered board columns. Product-agnostic — no farm semantics.
164
+ * TESTING/CANCELLED are omitted from the default board but are valid statuses;
165
+ * callers can override via TaskBoardCoreProps.columns.
166
+ */
167
+ declare const DEFAULT_BOARD_COLUMNS: BoardColumn[];
168
+ /** Priority filter options (UI order). */
169
+ declare const TASK_PRIORITIES: TaskPriority[];
170
+ /** Type filter options (UI order). */
171
+ declare const TASK_TYPES: TaskType[];
172
+ /** All work-item statuses (UI/logical order). */
173
+ declare const TASK_STATUSES: TaskStatus[];
174
+ /**
175
+ * Human-readable label for an enum value: lower-cases and turns `_` into a
176
+ * space (e.g. `IN_PROGRESS` → `in progress`, `SUB_TASK` → `sub task`). The UI
177
+ * capitalizes visually via CSS, so this stays product-agnostic.
178
+ */
179
+ declare function enumLabel(value: string): string;
180
+
181
+ interface TaskBoardCoreProps {
182
+ /** Scope the board to one project (client-side filter for Phase 1). */
183
+ projectId?: string;
184
+ /** Board columns to render (defaults to DEFAULT_BOARD_COLUMNS). */
185
+ columns?: BoardColumn[];
186
+ /** Read-only mode — hides interactive affordances (no create/drag in Phase 1 either way). */
187
+ readonly?: boolean;
188
+ /** Hide the board header (title + count). */
189
+ hideHeader?: boolean;
190
+ /** Hide the priority/type filter bar. */
191
+ hideFilters?: boolean;
192
+ /**
193
+ * Field names to hide on each task card. Product-agnostic hook so hosts can
194
+ * suppress fields that don't apply. Supported: 'key' | 'priority' | 'type' |
195
+ * 'labels' | 'storyPoints' | 'assignee' | 'dueDate'.
196
+ */
197
+ hiddenFields?: string[];
198
+ /** Called when a task card is clicked. */
199
+ onTaskClick?: (task: Task) => void;
200
+ /** Extra classes on the root container. */
201
+ className?: string;
202
+ /**
203
+ * Optional explicit workspace ID. Falls back to the PlanMagnetProvider context.
204
+ * At least one must be present or the query is skipped.
205
+ */
206
+ workspaceId?: string;
207
+ }
208
+ /**
209
+ * TaskBoardCore — provider-less, prop-driven, product-agnostic Kanban board.
210
+ *
211
+ * - Reads Apollo via the ambient `<ApolloProvider>` (BYO). It never creates a
212
+ * client and never assumes a router.
213
+ * - `workspaceId` comes from a prop or the PlanMagnetProvider context.
214
+ * - Read-only in Phase 1 (no drag/create). Farm-free: no Field/Crop logic.
215
+ */
216
+ declare function TaskBoardCore({ projectId, columns, readonly: _readonly, hideHeader, hideFilters, hiddenFields, onTaskClick, className, workspaceId: workspaceIdProp, }: TaskBoardCoreProps): react.JSX.Element;
217
+
218
+ interface TaskBoardProps extends TaskBoardCoreProps {
219
+ /** Workspace API gateway URL (URL mode). */
220
+ apiGatewayUrl?: string;
221
+ /** Platform identity token. */
222
+ authToken?: string;
223
+ /** Workspace access token (X-Workspace-Authorization). */
224
+ workspaceToken?: string;
225
+ /** Workspace ID. Required. */
226
+ workspaceId: string;
227
+ /** Tenant ID. */
228
+ tenantId?: string;
229
+ /** Organization ID. */
230
+ organizationId?: string;
231
+ /** Optional host allowlist for embedded deployments. */
232
+ trustedOrigins?: string[];
233
+ /** Called on UNAUTHENTICATED / FORBIDDEN. */
234
+ onAuthError?: () => void;
235
+ /** BYO: provide your own already-authed workspace Apollo client. */
236
+ workspaceClient?: ApolloClient;
237
+ }
238
+ /**
239
+ * TaskBoard — standalone, embeddable, product-agnostic task board.
240
+ *
241
+ * Thin wrapper that self-provisions (or accepts) an Apollo client via
242
+ * PlanMagnetProvider, then renders TaskBoardCore. Mirrors the FluidGrids
243
+ * `WorkflowBuilder` (standalone) → `WorkflowBuilderCore` (BYO) split.
244
+ *
245
+ * Two mount modes:
246
+ * - URL mode: <TaskBoard apiGatewayUrl={..} authToken={..} workspaceId={..} />
247
+ * - BYO mode: <TaskBoard workspaceClient={hostClient} workspaceId={..} />
248
+ *
249
+ * @example URL mode
250
+ * ```tsx
251
+ * <TaskBoard
252
+ * apiGatewayUrl="https://graphqlworkspaces.burdenoff.com"
253
+ * authToken={token}
254
+ * workspaceId="ws-123"
255
+ * onTaskClick={(t) => console.log(t)}
256
+ * />
257
+ * ```
258
+ *
259
+ * @example BYO client (host shell injects its authed client)
260
+ * ```tsx
261
+ * <TaskBoard workspaceClient={hostClient} workspaceId="ws-123" readonly />
262
+ * ```
263
+ */
264
+ declare function TaskBoard({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TaskBoardProps): react.JSX.Element;
265
+
266
+ /**
267
+ * Supported hideable field keys for the create form. Product-agnostic hook so
268
+ * hosts can suppress fields that don't apply to their domain.
269
+ */
270
+ type CreateTaskField = "description" | "type" | "status" | "priority" | "assignee" | "dueDate" | "labels" | "storyPoints";
271
+ interface CreateTaskCoreProps {
272
+ /**
273
+ * Project the new work item belongs to. `projectId` is REQUIRED by the
274
+ * backend (`PlanmagnetCreateWorkItemInput.projectId`). The form blocks submit
275
+ * until a project id is present.
276
+ */
277
+ projectId?: string;
278
+ /** Field names to hide on the form. */
279
+ hiddenFields?: CreateTaskField[];
280
+ /** Default values applied on first render. */
281
+ defaultValues?: Partial<CreateTaskInput>;
282
+ /** Hide the form header (title + subtitle). */
283
+ hideHeader?: boolean;
284
+ /** Custom submit-button label. */
285
+ submitLabel?: string;
286
+ /** Called with the created work item on success. */
287
+ onCreated?: (workItem: WorkItemDetail) => void;
288
+ /** Called when the create mutation errors. */
289
+ onError?: (error: Error) => void;
290
+ /** Called when the cancel button is pressed (button only shown if provided). */
291
+ onCancel?: () => void;
292
+ /** Extra classes on the root container. */
293
+ className?: string;
294
+ /** Explicit workspace ID. Falls back to PlanMagnetProvider context. */
295
+ workspaceId?: string;
296
+ }
297
+ /**
298
+ * CreateTaskCore — provider-less, prop-driven controlled form that creates a
299
+ * WorkItem via `planmagnetCreateWorkItem`. BYO-Apollo (reads the ambient
300
+ * ApolloProvider), semantic-token styled, farm-free.
301
+ *
302
+ * Mirrors the TaskBoardCore contract: `workspaceId` from a prop or the
303
+ * PlanMagnetProvider context, `hiddenFields` for host-driven field suppression.
304
+ */
305
+ declare function CreateTaskCore({ projectId: projectIdProp, hiddenFields, defaultValues, hideHeader, submitLabel, onCreated, onError, onCancel, className, workspaceId: workspaceIdProp, }: CreateTaskCoreProps): react.JSX.Element;
306
+
307
+ interface CreateTaskProps extends CreateTaskCoreProps {
308
+ /** Workspace API gateway URL (URL mode). */
309
+ apiGatewayUrl?: string;
310
+ /** Platform identity token. */
311
+ authToken?: string;
312
+ /** Workspace access token (X-Workspace-Authorization). */
313
+ workspaceToken?: string;
314
+ /** Workspace ID. Required. */
315
+ workspaceId: string;
316
+ /** Tenant ID. */
317
+ tenantId?: string;
318
+ /** Organization ID. */
319
+ organizationId?: string;
320
+ /** Optional host allowlist for embedded deployments. */
321
+ trustedOrigins?: string[];
322
+ /** Called on UNAUTHENTICATED / FORBIDDEN. */
323
+ onAuthError?: () => void;
324
+ /** BYO: provide your own already-authed workspace Apollo client. */
325
+ workspaceClient?: ApolloClient;
326
+ }
327
+ /**
328
+ * CreateTask — standalone, embeddable work-item create form.
329
+ *
330
+ * Thin wrapper that self-provisions (or accepts) an Apollo client via
331
+ * PlanMagnetProvider, then renders CreateTaskCore. Mirrors the
332
+ * TaskBoard → TaskBoardCore split.
333
+ *
334
+ * @example URL mode
335
+ * ```tsx
336
+ * <CreateTask
337
+ * apiGatewayUrl="https://graphqlworkspaces.burdenoff.com"
338
+ * authToken={token}
339
+ * workspaceId="ws-123"
340
+ * projectId="proj-1"
341
+ * onCreated={(wi) => console.log(wi)}
342
+ * />
343
+ * ```
344
+ *
345
+ * @example BYO client
346
+ * ```tsx
347
+ * <CreateTask workspaceClient={hostClient} workspaceId="ws-123" projectId="proj-1" />
348
+ * ```
349
+ */
350
+ declare function CreateTask({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: CreateTaskProps): react.JSX.Element;
351
+
352
+ /** Columns available in the compact list. */
353
+ type TaskListColumn = "key" | "title" | "type" | "status" | "priority" | "assignee" | "dueDate" | "storyPoints" | "labels";
354
+ /** Sort keys for the list. */
355
+ type TaskListSort = "priority" | "status" | "title" | "type" | "dueDate" | "storyPoints";
356
+ interface TaskListCoreProps {
357
+ /** Scope to one project (server-side filter). */
358
+ projectId?: string;
359
+ /** Filter by status. */
360
+ status?: TaskStatus;
361
+ /** Filter by type. */
362
+ type?: TaskType;
363
+ /** Filter by priority. */
364
+ priority?: TaskPriority;
365
+ /** Filter by assignee actor id. */
366
+ assigneeId?: string;
367
+ /** Free-text search (server-side). */
368
+ search?: string;
369
+ /** Columns to render (order preserved). */
370
+ columns?: TaskListColumn[];
371
+ /** Sort key (client-side). */
372
+ sortBy?: TaskListSort;
373
+ /** Sort direction. Defaults to ascending. */
374
+ sortDir?: "asc" | "desc";
375
+ /** Hide the header (title + count). */
376
+ hideHeader?: boolean;
377
+ /** Called with the work-item id when a row is clicked. */
378
+ onSelect?: (id: string) => void;
379
+ /** Max items to fetch (pagination.first). Defaults to 200. */
380
+ limit?: number;
381
+ /** Extra classes on the root container. */
382
+ className?: string;
383
+ /** Explicit workspace ID. Falls back to PlanMagnetProvider context. */
384
+ workspaceId?: string;
385
+ }
386
+ /**
387
+ * TaskListCore — provider-less, prop-driven compact list/table of work items.
388
+ *
389
+ * Same data source as TaskBoardCore (`LIST_WORK_ITEMS`) but a dense table
390
+ * layout instead of a kanban. Filters map to the server-side `WorkItemFilter`;
391
+ * sort is applied client-side. BYO-Apollo, semantic-token only, farm-free.
392
+ */
393
+ declare function TaskListCore({ projectId, status, type, priority, assigneeId, search, columns, sortBy, sortDir, hideHeader, onSelect, limit, className, workspaceId: workspaceIdProp, }: TaskListCoreProps): react.JSX.Element;
394
+
395
+ interface TaskListProps extends TaskListCoreProps {
396
+ /** Workspace API gateway URL (URL mode). */
397
+ apiGatewayUrl?: string;
398
+ /** Platform identity token. */
399
+ authToken?: string;
400
+ /** Workspace access token (X-Workspace-Authorization). */
401
+ workspaceToken?: string;
402
+ /** Workspace ID. Required. */
403
+ workspaceId: string;
404
+ /** Tenant ID. */
405
+ tenantId?: string;
406
+ /** Organization ID. */
407
+ organizationId?: string;
408
+ /** Optional host allowlist for embedded deployments. */
409
+ trustedOrigins?: string[];
410
+ /** Called on UNAUTHENTICATED / FORBIDDEN. */
411
+ onAuthError?: () => void;
412
+ /** BYO: provide your own already-authed workspace Apollo client. */
413
+ workspaceClient?: ApolloClient;
414
+ }
415
+ /**
416
+ * TaskList — standalone, embeddable compact list/table of work items.
417
+ *
418
+ * Thin wrapper that self-provisions (or accepts) an Apollo client via
419
+ * PlanMagnetProvider, then renders TaskListCore. Mirrors the
420
+ * TaskBoard → TaskBoardCore split.
421
+ *
422
+ * @example
423
+ * ```tsx
424
+ * <TaskList
425
+ * workspaceClient={hostClient}
426
+ * workspaceId="ws-123"
427
+ * sortBy="priority"
428
+ * onSelect={(id) => openTask(id)}
429
+ * />
430
+ * ```
431
+ */
432
+ declare function TaskList({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TaskListProps): react.JSX.Element;
433
+
434
+ /** Fields that can be hidden / suppressed on the detail view + edit form. */
435
+ type TaskDetailField = "description" | "type" | "status" | "priority" | "assignee" | "dueDate" | "labels" | "storyPoints";
436
+ interface TaskDetailCoreProps {
437
+ /** Work-item id to fetch + edit. Required. */
438
+ id: string;
439
+ /** Start in read-only mode with no edit affordance. */
440
+ readonly?: boolean;
441
+ /** Field names to hide. */
442
+ hiddenFields?: TaskDetailField[];
443
+ /** Hide the header (key + title). */
444
+ hideHeader?: boolean;
445
+ /** Called with the updated work item after a successful save. */
446
+ onUpdated?: (workItem: WorkItemDetail) => void;
447
+ /** Called when the update mutation errors. */
448
+ onError?: (error: Error) => void;
449
+ /** Extra classes on the root container. */
450
+ className?: string;
451
+ }
452
+ /**
453
+ * TaskDetailCore — provider-less, prop-driven single work-item view with inline
454
+ * edit. Fetches via `planmagnetWorkItem(id)`, saves via
455
+ * `planmagnetUpdateWorkItem`. BYO-Apollo, semantic-token only, farm-free.
456
+ */
457
+ declare function TaskDetailCore({ id, readonly, hiddenFields, hideHeader, onUpdated, onError, className, }: TaskDetailCoreProps): react.JSX.Element;
458
+
459
+ interface TaskDetailProps extends TaskDetailCoreProps {
460
+ /** Workspace API gateway URL (URL mode). */
461
+ apiGatewayUrl?: string;
462
+ /** Platform identity token. */
463
+ authToken?: string;
464
+ /** Workspace access token (X-Workspace-Authorization). */
465
+ workspaceToken?: string;
466
+ /** Workspace ID. Required (scopes the client headers). */
467
+ workspaceId: string;
468
+ /** Tenant ID. */
469
+ tenantId?: string;
470
+ /** Organization ID. */
471
+ organizationId?: string;
472
+ /** Optional host allowlist for embedded deployments. */
473
+ trustedOrigins?: string[];
474
+ /** Called on UNAUTHENTICATED / FORBIDDEN. */
475
+ onAuthError?: () => void;
476
+ /** BYO: provide your own already-authed workspace Apollo client. */
477
+ workspaceClient?: ApolloClient;
478
+ }
479
+ /**
480
+ * TaskDetail — standalone, embeddable single work-item view with inline edit.
481
+ *
482
+ * Thin wrapper that self-provisions (or accepts) an Apollo client via
483
+ * PlanMagnetProvider, then renders TaskDetailCore. Mirrors the
484
+ * TaskBoard → TaskBoardCore split.
485
+ *
486
+ * @example
487
+ * ```tsx
488
+ * <TaskDetail
489
+ * workspaceClient={hostClient}
490
+ * workspaceId="ws-123"
491
+ * id="wi-1"
492
+ * onUpdated={(wi) => console.log(wi)}
493
+ * />
494
+ * ```
495
+ */
496
+ declare function TaskDetail({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TaskDetailProps): react.JSX.Element;
497
+
498
+ /**
499
+ * Which SDK fields the composed page should suppress. The union of the create
500
+ * form fields and the detail fields — the page fans a single `hiddenFields`
501
+ * prop out to the board, create form, and detail view so hosts configure the
502
+ * whole experience in one place.
503
+ */
504
+ type TasksPageField = CreateTaskField | TaskDetailField;
505
+ /** Payload passed to `onTaskSaved` when a create/update completes. */
506
+ interface TasksPageSaved {
507
+ workItem: WorkItemDetail;
508
+ operation: "created" | "updated";
509
+ }
510
+ interface TasksPageCoreProps {
511
+ /**
512
+ * Explicit workspace ID. Falls back to the PlanMagnetProvider context. At
513
+ * least one must be present or the board query is skipped.
514
+ */
515
+ workspaceId?: string;
516
+ /**
517
+ * Project the "New task" flow creates work items in. REQUIRED for create —
518
+ * the backend `PlanmagnetCreateWorkItemInput.projectId` is non-null. When
519
+ * omitted the board still renders read-only-ish (create is disabled).
520
+ */
521
+ projectId?: string;
522
+ /** Scope the board to a single project (client-side filter). */
523
+ boardProjectId?: string;
524
+ /** Board columns to render (defaults to DEFAULT_BOARD_COLUMNS). */
525
+ columns?: BoardColumn[];
526
+ /** Read-only — hides the "New task" button and disables detail editing. */
527
+ readonly?: boolean;
528
+ /**
529
+ * Field names to hide across the board cards, create form, and detail view.
530
+ * A product-agnostic hook so hosts can suppress fields that don't apply.
531
+ */
532
+ hiddenFields?: TasksPageField[];
533
+ /** Hide the board's priority/type filter bar. */
534
+ hideFilters?: boolean;
535
+ /**
536
+ * Header/title slot. Pass a string for the default heading, or any node to
537
+ * fully own the header area. Omit for no header.
538
+ */
539
+ header?: ReactNode;
540
+ /** Called after a successful create OR update (board is refetched first). */
541
+ onTaskSaved?: (saved: TasksPageSaved) => void;
542
+ /** How the create form is surfaced. Defaults to "modal". */
543
+ createSurface?: "modal" | "inline";
544
+ /** How the detail view is surfaced. Defaults to "drawer". */
545
+ detailSurface?: "drawer" | "inline";
546
+ /** Extra classes on the root container. */
547
+ className?: string;
548
+ }
549
+ /**
550
+ * TasksPageCore — a complete, provider-less, BYO-Apollo Tasks experience in a
551
+ * single mount. Composes the existing `TaskBoardCore`, `CreateTaskCore`, and
552
+ * `TaskDetailCore` so a host app (e.g. HealthyBowl) doesn't have to wire the
553
+ * three together itself:
554
+ *
555
+ * - renders the kanban `TaskBoardCore`,
556
+ * - a "New task" button opens `CreateTaskCore` (modal or inline),
557
+ * - clicking a card opens `TaskDetailCore` (drawer or inline) with inline edit,
558
+ * - `CreateTaskCore.onCreated` + `TaskDetailCore.onUpdated` refetch the board.
559
+ *
560
+ * BYO-Apollo like the sibling cores: reads the ambient `<ApolloProvider>` and
561
+ * takes `workspaceId` from a prop or the PlanMagnetProvider context. Semantic
562
+ * tokens only, farm-free, strict TS.
563
+ */
564
+ declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, hideFilters, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
565
+
566
+ interface TasksPageProps extends TasksPageCoreProps {
567
+ /** Workspace API gateway URL (URL mode). */
568
+ apiGatewayUrl?: string;
569
+ /** Platform identity token. */
570
+ authToken?: string;
571
+ /** Workspace access token (X-Workspace-Authorization). */
572
+ workspaceToken?: string;
573
+ /** Workspace ID. Required. */
574
+ workspaceId: string;
575
+ /** Tenant ID. */
576
+ tenantId?: string;
577
+ /** Organization ID. */
578
+ organizationId?: string;
579
+ /** Optional host allowlist for embedded deployments. */
580
+ trustedOrigins?: string[];
581
+ /** Called on UNAUTHENTICATED / FORBIDDEN. */
582
+ onAuthError?: () => void;
583
+ /** BYO: provide your own already-authed workspace Apollo client. */
584
+ workspaceClient?: ApolloClient;
585
+ }
586
+ /**
587
+ * TasksPage — standalone, embeddable, composed Tasks experience.
588
+ *
589
+ * The Phase-3 embed target: a single mount that gives a host app a complete
590
+ * Tasks page (kanban board + "New task" create flow + click-to-open detail with
591
+ * inline edit). Thin wrapper that self-provisions (or accepts) an Apollo client
592
+ * via PlanMagnetProvider, then renders TasksPageCore. Mirrors the
593
+ * TaskBoard → TaskBoardCore split.
594
+ *
595
+ * Two mount modes:
596
+ * - URL mode: <TasksPage apiGatewayUrl={..} authToken={..} workspaceId={..} projectId={..} />
597
+ * - BYO mode: <TasksPage workspaceClient={hostClient} workspaceId={..} projectId={..} />
598
+ *
599
+ * @example BYO client (HealthyBowl shell injects its authed client)
600
+ * ```tsx
601
+ * <TasksPage
602
+ * workspaceClient={hostClient}
603
+ * workspaceId="ws-123"
604
+ * projectId="proj-1"
605
+ * header="Farm Tasks"
606
+ * onTaskSaved={({ workItem, operation }) => console.log(operation, workItem)}
607
+ * />
608
+ * ```
609
+ */
610
+ declare function TasksPage({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TasksPageProps): react.JSX.Element;
611
+
612
+ interface PlanMagnetProviderProps {
613
+ /** Workspace API gateway URL. Required unless a client is injected. */
614
+ apiGatewayUrl?: string;
615
+ /** Platform identity token. */
616
+ authToken?: string;
617
+ /** Workspace access token (X-Workspace-Authorization). */
618
+ workspaceToken?: string;
619
+ /** Workspace ID. Required. */
620
+ workspaceId: string;
621
+ /** Tenant ID. */
622
+ tenantId?: string;
623
+ /** Organization ID. */
624
+ organizationId?: string;
625
+ /** Optional host allowlist for embedded deployments. */
626
+ trustedOrigins?: string[];
627
+ /** Called on UNAUTHENTICATED / FORBIDDEN so the host can trigger re-auth. */
628
+ onAuthError?: () => void;
629
+ /**
630
+ * BYO: host shell injects its already-authed workspace Apollo client
631
+ * (e.g. microfe / HealthyBowl shell). Takes priority over apiGatewayUrl.
632
+ */
633
+ workspaceClient?: ApolloClient;
634
+ /** @deprecated Use workspaceClient instead. */
635
+ apolloClient?: ApolloClient;
636
+ children: ReactNode;
637
+ }
638
+ interface PlanMagnetContextValue {
639
+ apiGatewayUrl?: string;
640
+ authToken?: string;
641
+ workspaceId: string;
642
+ tenantId?: string;
643
+ organizationId?: string;
644
+ trustedOrigins?: string[];
645
+ workspaceClient: ApolloClient;
646
+ }
647
+ /**
648
+ * PlanMagnetProvider — mirrors the FluidGrids client-injection model.
649
+ *
650
+ * Resolution priority for the workspace Apollo client:
651
+ * 1. `workspaceClient` (host-injected)
652
+ * 2. `apolloClient` (legacy alias)
653
+ * 3. `createPlanMagnetClient({ apiGatewayUrl, ... })`
654
+ * Throws if none of the above is available.
655
+ *
656
+ * Unlike the microfe provider, this ALWAYS mounts its own `<ApolloProvider>`
657
+ * (with the injected-or-built client) so an embedded TaskBoard renders inside
658
+ * any host page — no reliance on an ambient ApolloProvider.
659
+ */
660
+ declare function PlanMagnetProvider({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient: externalWorkspaceClient, apolloClient: legacyClient, children, }: PlanMagnetProviderProps): react.JSX.Element;
661
+ declare function usePlanMagnetContext(): PlanMagnetContextValue;
662
+ /**
663
+ * Safe variant — returns null instead of throwing when used outside a provider.
664
+ * TaskBoardCore uses this so a `workspaceId` prop can substitute for context.
665
+ */
666
+ declare function usePlanMagnetContextSafe(): PlanMagnetContextValue | null;
667
+
668
+ interface PlanMagnetClientConfig {
669
+ /** Workspace API gateway base URL (e.g. https://graphqlworkspaces.burdenoff.com). */
670
+ apiGatewayUrl: string;
671
+ /** Platform identity token → `Authorization: Bearer <authToken>`. */
672
+ authToken?: string;
673
+ /** Workspace access token → `X-Workspace-Authorization: Bearer <workspaceToken>`. */
674
+ workspaceToken?: string;
675
+ /** Workspace ID → `x-workspace-id`. Required for task queries. */
676
+ workspaceId: string;
677
+ /** Tenant ID → `x-tenant-id` (optional). */
678
+ tenantId?: string;
679
+ /**
680
+ * Optional callback invoked when the gateway returns UNAUTHENTICATED / FORBIDDEN
681
+ * (or a network-level 401/403). Host shells use this to trigger re-auth / logout.
682
+ */
683
+ onAuthError?: () => void;
684
+ }
685
+ /**
686
+ * Create a new Apollo client for the PlanMagnet SDK.
687
+ *
688
+ * HTTP-only (no subscriptions) — tasks are read/write over queries + mutations.
689
+ * Injects the dual-token workspace headers on every request.
690
+ */
691
+ declare function createPlanMagnetClient(config: PlanMagnetClientConfig): ApolloClient;
692
+ /**
693
+ * Set the module-level client (SDK-managed mode or wrapper injection).
694
+ */
695
+ declare function setPlanMagnetClient(client: ApolloClient): void;
696
+ /**
697
+ * Get the module-level client.
698
+ * @throws if the client is not initialized.
699
+ */
700
+ declare function getPlanMagnetClient(): ApolloClient;
701
+ /**
702
+ * Get the client if available, or null if not initialized.
703
+ */
704
+ declare function getPlanMagnetClientSafe(): ApolloClient | null;
705
+ /**
706
+ * Whether the module-level client is ready.
707
+ */
708
+ declare function isPlanMagnetClientReady(): boolean;
709
+ /**
710
+ * Poll until the module-level client is initialized (or timeout).
711
+ */
712
+ declare function waitForPlanMagnetClient(timeoutMs?: number, intervalMs?: number): Promise<ApolloClient | null>;
713
+ /**
714
+ * Reset the client reference (cleanup on unmount).
715
+ */
716
+ declare function resetPlanMagnetClient(): void;
717
+
718
+ /**
719
+ * PlanMagnet task GraphQL operation documents.
720
+ *
721
+ * Hand-written `gql` documents bundled with the SDK. They target the composed
722
+ * gateway supergraph, whose root fields AND input types are Planmagnet-prefixed
723
+ * (see wspace-planmagnet-svc/.hive-schema.graphql — the source of truth). A GraphQL
724
+ * operation's variable *type definitions* are part of the query document and are
725
+ * validated by the gateway, so the input type names MUST match the schema exactly
726
+ * (`PlanmagnetCreateWorkItemInput`, `PlanmagnetWorkItemFilter`,
727
+ * `PlanmagnetPaginationInput`, …). Un-prefixed names pass Apollo MockedProvider
728
+ * but FAIL live gateway validation ("Unknown type …").
729
+ *
730
+ * Phase 3: replace with codegen output after `bun run schema:pull && bun run codegen`.
731
+ */
732
+ declare const WORK_ITEM_SUMMARY_FIELDS: graphql.DocumentNode;
733
+ declare const WORK_ITEM_FIELDS: graphql.DocumentNode;
734
+ declare const PROJECT_SUMMARY_FIELDS: graphql.DocumentNode;
735
+ declare const LIST_WORK_ITEMS: graphql.DocumentNode;
736
+ declare const GET_WORK_ITEM: graphql.DocumentNode;
737
+ declare const GET_PROJECTS: graphql.DocumentNode;
738
+ declare const CREATE_WORK_ITEM: graphql.DocumentNode;
739
+ declare const UPDATE_WORK_ITEM: graphql.DocumentNode;
740
+ declare const MOVE_WORK_ITEM: graphql.DocumentNode;
741
+
742
+ /**
743
+ * Configuration module for the PlanMagnet SDK.
744
+ */
745
+ /** Result passed to the onTaskSaved callback after a successful create/update. */
746
+ interface TaskSavedResult {
747
+ /** Work-item row ID. */
748
+ id: string;
749
+ /** Human-readable work-item key (e.g. "PM-123"). */
750
+ key: string;
751
+ /** Work-item title. */
752
+ title: string;
753
+ /** Project the work item belongs to. */
754
+ projectId: string;
755
+ /** What kind of save operation occurred. */
756
+ operation: "created" | "updated";
757
+ }
758
+ interface PlanMagnetConfig {
759
+ /** GraphQL endpoint URL (workspace gateway). */
760
+ apiGatewayUrl: string;
761
+ /** Auth token for API calls. */
762
+ authToken?: string;
763
+ /** Current workspace ID. */
764
+ workspaceId: string;
765
+ /** Current tenant ID. */
766
+ tenantId?: string;
767
+ /** Organization ID. */
768
+ organizationId?: string;
769
+ /** Optional allowlist for host origins embedding the SDK. */
770
+ trustedOrigins?: string[];
771
+ /** Product ID for host-app isolation (e.g. 'healthybowl', 'workspaces'). */
772
+ productId?: string;
773
+ /** Product name for display purposes. */
774
+ productName?: string;
775
+ /**
776
+ * Callback invoked after a work item is successfully created/updated.
777
+ * Host apps (e.g. HealthyBowl) can use this to sync metadata to their own
778
+ * backends. Errors thrown here are caught and logged — they never block the save.
779
+ */
780
+ onTaskSaved?: (result: TaskSavedResult) => void | Promise<void>;
781
+ }
782
+ /**
783
+ * Live-access proxy to the current configuration.
784
+ */
785
+ declare const config: PlanMagnetConfig;
786
+ /**
787
+ * Get the full configuration object (a copy).
788
+ */
789
+ declare function getPlanMagnetConfig(): PlanMagnetConfig;
790
+ /**
791
+ * Merge in runtime configuration.
792
+ */
793
+ declare function setPlanMagnetConfig(newConfig: Partial<PlanMagnetConfig>): void;
794
+ /**
795
+ * Reset configuration to defaults.
796
+ */
797
+ declare function resetPlanMagnetConfig(): void;
798
+ /**
799
+ * Enforce an optional host-origin allowlist for embedded deployments.
800
+ * @throws if the current window origin is not in the allowlist.
801
+ */
802
+ declare function validateTrustedOrigin(trustedOrigins?: string[]): void;
803
+ /**
804
+ * Resolve the GraphQL endpoint URL.
805
+ */
806
+ declare function getGraphQLEndpoint(baseUrl?: string): string;
807
+
808
+ declare const badgeVariants: (props?: ({
809
+ variant?: "default" | "muted" | "secondary" | "accent" | "destructive" | null | undefined;
810
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
811
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
812
+ }
813
+ /**
814
+ * Badge — a small owned pill primitive used for task status/priority/type.
815
+ * Semantic-token only.
816
+ */
817
+ declare function Badge({ className, variant, ...props }: BadgeProps): react.JSX.Element;
818
+
819
+ interface ModalProps {
820
+ open: boolean;
821
+ onClose: () => void;
822
+ children: ReactNode;
823
+ ariaLabel?: string;
824
+ className?: string;
825
+ }
826
+ /** Centered modal card overlay (owned, semantic-token only). */
827
+ declare function Modal(props: ModalProps): react.JSX.Element;
828
+ interface DrawerProps {
829
+ open: boolean;
830
+ onClose: () => void;
831
+ children: ReactNode;
832
+ ariaLabel?: string;
833
+ className?: string;
834
+ }
835
+ /** Right-anchored slide-over drawer overlay (owned, semantic-token only). */
836
+ declare function Drawer(props: DrawerProps): react.JSX.Element;
837
+
838
+ declare function cn(...inputs: ClassValue[]): string;
839
+
840
+ export { 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, PROJECT_SUMMARY_FIELDS, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, type Project, type ProjectList, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, 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, type TaskType, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, 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 };