@critical-path/svelte 0.11.0 → 0.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @critical-path/svelte
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e2a7eef: Introduce Bret Victor's Ladder of Abstraction and Critical Path Method (CPM) timeline synthesis to the framework data model:
8
+ - **Core Domain**: Multi-scale timeline synthesis model across Macro phase rollups, Standard CPM Gantt schedule (early/late bounds, float/slack calculation, bottleneck identification), and Concrete grounding (deliverables, file attachments, daily effort distribution, and reality deltas). Added `calculateCriticalPath`, `getTimelineLadder`, and `getTaskLadder` to `CriticalPathEngine`.
9
+ - **Server Router**: HTTP endpoints `GET /projects/:id/critical-path`, `GET /projects/:id/ladder`, and `GET /tasks/:id/ladder`.
10
+ - **Client SDK**: `CriticalPathClient` methods `calculateCriticalPath`, `getTimelineLadder`, and `getTaskLadder`.
11
+ - **MCP**: New AI tools `calculate_critical_path`, `get_timeline_ladder`, and `get_task_ladder`.
12
+ - **React**: Custom hooks `useTimelineLadder`, `useCriticalPath`, and `useTaskLadder`.
13
+ - **Svelte 5**: Svelte 5 Runes state classes `TimelineLadderState` and `CriticalPathState`.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [e2a7eef]
18
+ - @critical-path/core@0.16.0
19
+ - @critical-path/client@0.10.0
20
+ - @critical-path/mcp@0.3.0
21
+
22
+ ## 0.12.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 105f3d3: Synchronize feature parity between `@critical-path/react` and `@critical-path/svelte`:
27
+ - `@critical-path/react`: Added `updateTask` with optimistic updates and rollback to `useTasks`, and introduced `useTaskActivity` hook for unified threaded discussions and attachments.
28
+ - `@critical-path/svelte`: Added `KanbanState` (`createKanbanState`), `TaskTransitionsState` (`createTaskTransitionsState`), and `DeliverableSummaryState` (`createDeliverableSummaryState`) using native Svelte 5 runes.
29
+
3
30
  ## 0.11.0
4
31
 
5
32
  ### Minor Changes
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Svelte 5 Runes Reactive Integrations for Critical Path.**
4
4
 
5
- `@critical-path/svelte` provides Svelte 5 Runes reactive state classes and factories (`ProjectState`, `TaskState`, `WorkflowState`, `CommentState`, `AttachmentState`, `TaskActivityState`) for building project management UIs in Svelte 5 and SvelteKit applications.
5
+ `@critical-path/svelte` provides Svelte 5 Runes reactive state classes and factories (`ProjectState`, `TaskState`, `KanbanState`, `TaskTransitionsState`, `WorkflowState`, `CommentState`, `AttachmentState`, `TaskActivityState`, `DeliverableState`, `DeliverableSummaryState`, `WebMcpState`) for building project management UIs in Svelte 5 and SvelteKit applications.
6
6
 
7
7
  ---
8
8
 
@@ -52,7 +52,39 @@ pnpm add @critical-path/svelte svelte@^5.0.0
52
52
  {/if}
53
53
  ```
54
54
 
55
- ### 2. Unified Task Activity & Threaded Discussions (`TaskActivityState`)
55
+ ### 2. Reactive Kanban Board (`KanbanState`)
56
+
57
+ Buckets tasks reactively into workflow columns (`backlog`, `todo`, `in_progress`, etc.) or semantic columns (`not_started`, `in_progress`, `completed`, `canceled`):
58
+
59
+ ```svelte
60
+ <script lang="ts">
61
+ import { onMount } from 'svelte';
62
+ import { createCriticalPathClient, createKanbanState } from '@critical-path/svelte';
63
+
64
+ const client = createCriticalPathClient({ baseUrl: '/api/critical-path' });
65
+ const kanban = createKanbanState(client, 'proj_1');
66
+
67
+ onMount(() => {
68
+ kanban.fetch();
69
+ });
70
+ </script>
71
+
72
+ <div class="board" style="display: flex; gap: 16px;">
73
+ {#each Object.entries(kanban.columns) as [status, tasks]}
74
+ <div class="column">
75
+ <h3>{status} ({tasks.length})</h3>
76
+ {#each tasks as task}
77
+ <div class="card">
78
+ <h4>{task.title}</h4>
79
+ <button on:click={() => kanban.moveTask(task.id, 'done')}>Mark Done</button>
80
+ </div>
81
+ {/each}
82
+ </div>
83
+ {/each}
84
+ </div>
85
+ ```
86
+
87
+ ### 3. Unified Task Activity & Threaded Discussions (`TaskActivityState`)
56
88
 
57
89
  Combines threaded comments with inline attachments (`attachment.commentId === comment.id`) and standalone attachments in a single reactive store:
58
90
 
@@ -106,6 +138,68 @@ Combines threaded comments with inline attachments (`attachment.commentId === co
106
138
  {/each}
107
139
  ```
108
140
 
141
+ ### 4. Bret Victor's Ladder of Abstraction (`TimelineLadderState`)
142
+
143
+ Fluidly traverse between Macro phase health, Standard Gantt tasks with CPM critical paths, and Concrete deliverables/effort using Svelte 5 Runes:
144
+
145
+ ```svelte
146
+ <script lang="ts">
147
+ import { onMount } from 'svelte';
148
+ import { createCriticalPathClient, createTimelineLadderState, createCriticalPathState } from '@critical-path/svelte';
149
+
150
+ const client = createCriticalPathClient({ baseUrl: '/api/critical-path' });
151
+ const ladderState = createTimelineLadderState(client, 'proj_1', { level: 'all' });
152
+ const cpmState = createCriticalPathState(client, 'proj_1');
153
+
154
+ onMount(() => {
155
+ ladderState.fetch();
156
+ cpmState.fetch();
157
+ });
158
+ </script>
159
+
160
+ <!-- Level Switcher -->
161
+ <div class="flex gap-2">
162
+ <button on:click={() => ladderState.setLevel('macro')}>Macro</button>
163
+ <button on:click={() => ladderState.setLevel('standard')}>Standard Gantt</button>
164
+ <button on:click={() => ladderState.setLevel('concrete')}>Concrete</button>
165
+ <button on:click={() => ladderState.setLevel('all')}>All Rungs</button>
166
+ </div>
167
+
168
+ {#if ladderState.loading}
169
+ <p>Loading timeline ladder...</p>
170
+ {:else}
171
+ <!-- Macro Rung -->
172
+ {#if ladderState.macro}
173
+ <div class="macro-banner">
174
+ <h3>Phase Health: {ladderState.macro.health} ({ladderState.macro.overallProgressPercentage}% Complete)</h3>
175
+ <p>Total Duration: {ladderState.macro.totalDurationHours}h | Critical Path: {ladderState.macro.criticalPathDurationHours}h</p>
176
+ </div>
177
+ {/if}
178
+
179
+ <!-- Standard Rung -->
180
+ {#if ladderState.standard}
181
+ <div class="standard-gantt">
182
+ <h4>Gantt Schedule</h4>
183
+ {#each ladderState.standard.tasks as item}
184
+ <div class:is-critical={item.isCritical}>
185
+ {item.task.title} (Early Start: {item.schedule.earlyStart}h, Total Slack: {item.schedule.totalSlack}h)
186
+ </div>
187
+ {/each}
188
+ </div>
189
+ {/if}
190
+
191
+ <!-- Concrete Rung -->
192
+ {#if ladderState.concrete}
193
+ <div class="concrete-grounding">
194
+ <h4>Concrete Ground Truth</h4>
195
+ {#each Object.entries(ladderState.concrete) as [taskId, evidence]}
196
+ <div>Task {taskId}: {evidence.deliverables.length} deliverables, {evidence.attachments.length} files</div>
197
+ {/each}
198
+ </div>
199
+ {/if}
200
+ {/if}
201
+ ```
202
+
109
203
  ---
110
204
 
111
205
  ## 📄 License
@@ -0,0 +1,13 @@
1
+ import type { CriticalPathClient } from '@critical-path/client';
2
+ import type { CriticalPathAnalysis } from '@critical-path/core';
3
+ export declare class CriticalPathState {
4
+ private client;
5
+ projectId: string;
6
+ data: CriticalPathAnalysis | null;
7
+ loading: boolean;
8
+ error: Error | null;
9
+ constructor(client: CriticalPathClient, projectId: string);
10
+ fetch(): Promise<void>;
11
+ }
12
+ export declare function createCriticalPathState(client: CriticalPathClient, projectId: string): CriticalPathState;
13
+ //# sourceMappingURL=critical-path-state.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"critical-path-state.svelte.d.ts","sourceRoot":"","sources":["../src/critical-path-state.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,qBAAa,iBAAiB;IAM1B,OAAO,CAAC,MAAM;IACP,SAAS,EAAE,MAAM;IAN1B,IAAI,8BAA6C;IACjD,OAAO,UAA0B;IACjC,KAAK,eAA8B;gBAGzB,MAAM,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM;IAGpB,KAAK;CAWZ;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,MAAM,GAChB,iBAAiB,CAEnB"}
@@ -0,0 +1,14 @@
1
+ import type { CriticalPathClient } from '@critical-path/client';
2
+ import type { DeliverableSummary } from '@critical-path/core';
3
+ export declare class DeliverableSummaryState {
4
+ private client;
5
+ deliverableId?: string | undefined;
6
+ summary: DeliverableSummary | null;
7
+ loading: boolean;
8
+ error: Error | null;
9
+ get data(): DeliverableSummary | null;
10
+ constructor(client: CriticalPathClient, deliverableId?: string | undefined);
11
+ fetch(deliverableId?: string): Promise<void>;
12
+ }
13
+ export declare function createDeliverableSummaryState(client: CriticalPathClient, deliverableId?: string): DeliverableSummaryState;
14
+ //# sourceMappingURL=deliverable-summary-state.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliverable-summary-state.svelte.d.ts","sourceRoot":"","sources":["../src/deliverable-summary-state.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,qBAAa,uBAAuB;IAStB,OAAO,CAAC,MAAM;IAA6B,aAAa,CAAC,EAAE,MAAM;IAR7E,OAAO,4BAA2C;IAClD,OAAO,UAA0B;IACjC,KAAK,eAA8B;IAEnC,IAAI,IAAI,IAAI,kBAAkB,GAAG,IAAI,CAEpC;gBAEmB,MAAM,EAAE,kBAAkB,EAAS,aAAa,CAAC,EAAE,MAAM,YAAA;IAEvE,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM;CAkBnC;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,kBAAkB,EAC1B,aAAa,CAAC,EAAE,MAAM,GACrB,uBAAuB,CAEzB"}
package/dist/index.d.ts CHANGED
@@ -7,5 +7,10 @@ export * from './comment-state.svelte.js';
7
7
  export * from './attachment-state.svelte.js';
8
8
  export * from './activity-state.svelte.js';
9
9
  export * from './deliverable-state.svelte.js';
10
+ export * from './deliverable-summary-state.svelte.js';
11
+ export * from './kanban-state.svelte.js';
12
+ export * from './task-transitions-state.svelte.js';
10
13
  export * from './webmcp-state.svelte.js';
14
+ export * from './critical-path-state.svelte.js';
15
+ export * from './timeline-ladder-state.svelte.js';
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB,CAEnF;AAED,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB,CAEnF;AAED,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}