MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / createDeps

Function createDeps

apps/kimi-web/test/workspace-state.test.ts:92–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90}
91
92function createDeps(): UseWorkspaceStateDeps {
93 return {
94 taskPoller: {},
95 sideChat: {},
96 modelProvider: {},
97 pushOperationFailure: vi.fn(),
98 activity: computed(() => 'running'),
99 inFlightPromptSessions: new Set(),
100 sessionsKnownEmpty: new Set(),
101 setSessions: vi.fn(),
102 updateSession: vi.fn(),
103 upsertSessionFront: vi.fn(),
104 appendSession: vi.fn(),
105 forgetSession: vi.fn(),
106 setActiveSessionId: vi.fn(),
107 updateSessionMessages: vi.fn(),
108 nextOptimisticMsgId: () => 'msg_opt_1',
109 getEventConn: () => null,
110 syncSessionFromSnapshot: vi.fn(),
111 subscribeToSessionEvents: vi.fn(),
112 hasLoadedMessages: vi.fn(),
113 refreshSessionStatus: vi.fn(),
114 persistSessionProfile: vi.fn(),
115 mergedWorkspaces: computed(() => []),
116 workspacesView: computed(() => []),
117 status: computed(() => ({})),
118 workspaceIdForSession: vi.fn(),
119 savePermissionToStorage: vi.fn(),
120 savePlanModeToStorage: vi.fn(),
121 saveSwarmModeToStorage: vi.fn(),
122 saveGoalModeToStorage: vi.fn(),
123 draftModes: { planMode: false, swarmMode: false, goalMode: false },
124 saveUnread: vi.fn(),
125 saveActiveWorkspaceToStorage: vi.fn(),
126 saveHiddenWorkspacesToStorage: vi.fn(),
127 goalErrorMessage: vi.fn(),
128 basename: (path: string) => path.split('/').at(-1) ?? path,
129 resetFastMoon: vi.fn(),
130 initialized: ref(true),
131 selectedDiffPath: ref(null),
132 fileDiffLines: ref([]),
133 fileDiffLoading: ref(false),
134 } as unknown as UseWorkspaceStateDeps;
135}
136
137function createMemoryStorage(): Storage {
138 const data = new Map<string, string>();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected