MCPcopy
hub / github.com/coder/mux / seedPinnedTodos

Function seedPinnedTodos

src/browser/stores/WorkspaceStore.test.ts:717–750  ·  view source on GitHub ↗
(store: WorkspaceStore, workspaceId: string, todos: TodoItem[])

Source from the content-addressed store, hash-verified

715}
716
717function seedPinnedTodos(store: WorkspaceStore, workspaceId: string, todos: TodoItem[]): void {
718 const aggregator = store.getAggregator(workspaceId);
719 if (!aggregator) {
720 throw new Error(`Missing aggregator for ${workspaceId}`);
721 }
722
723 aggregator.handleStreamStart({
724 type: "stream-start",
725 workspaceId,
726 messageId: `${workspaceId}-stream`,
727 historySequence: 1,
728 model: "claude-sonnet-4",
729 startTime: 1_000,
730 });
731 aggregator.handleToolCallStart({
732 type: "tool-call-start",
733 workspaceId,
734 messageId: `${workspaceId}-stream`,
735 toolCallId: `${workspaceId}-todo-write`,
736 toolName: "todo_write",
737 args: { todos },
738 tokens: 10,
739 timestamp: 1_001,
740 });
741 aggregator.handleToolCallEnd({
742 type: "tool-call-end",
743 workspaceId,
744 messageId: `${workspaceId}-stream`,
745 toolCallId: `${workspaceId}-todo-write`,
746 toolName: "todo_write",
747 result: { success: true },
748 timestamp: 1_002,
749 });
750}
751
752describe("WorkspaceStore", () => {
753 let store: WorkspaceStore;

Callers 1

Calls 4

getAggregatorMethod · 0.80
handleStreamStartMethod · 0.65
handleToolCallStartMethod · 0.65
handleToolCallEndMethod · 0.65

Tested by

no test coverage detected