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

Function saveLocalParentWorkspace

src/node/services/taskService.test.ts:245–280  ·  view source on GitHub ↗
(
  config: Config,
  rootDir: string,
  options?: {
    agentAiDefaults?: Record<string, { modelString?: string; thinkingLevel?: ThinkingLevel }>;
    subagentAiDefaults?: Record<string, { modelString?: string; thinkingLevel?: ThinkingLevel }>;
    parentAiSettings?: { model: string; thinkingLevel: ThinkingLevel };
  }
)

Source from the content-addressed store, hash-verified

243}
244
245async function saveLocalParentWorkspace(
246 config: Config,
247 rootDir: string,
248 options?: {
249 agentAiDefaults?: Record<string, { modelString?: string; thinkingLevel?: ThinkingLevel }>;
250 subagentAiDefaults?: Record<string, { modelString?: string; thinkingLevel?: ThinkingLevel }>;
251 parentAiSettings?: { model: string; thinkingLevel: ThinkingLevel };
252 }
253): Promise<{ parentId: string; projectPath: string }> {
254 const projectPath = await createTestProject(rootDir, "repo", { initGit: false });
255 const parentId = "1111111111";
256 await saveWorkspaces(
257 config,
258 projectPath,
259 [
260 {
261 path: projectPath,
262 id: parentId,
263 name: "parent",
264 createdAt: new Date().toISOString(),
265 runtimeConfig: { type: "local" },
266 aiSettings: options?.parentAiSettings ?? {
267 model: "anthropic:claude-opus-4-6",
268 thinkingLevel: "high",
269 },
270 },
271 ],
272 {
273 taskSettings: { maxParallelAgentTasks: 3, maxTaskNestingDepth: 3 },
274 agentAiDefaults: options?.agentAiDefaults,
275 subagentAiDefaults: options?.subagentAiDefaults,
276 migrations: { execSubagentDefaultsSplit: true },
277 }
278 );
279 return { parentId, projectPath };
280}
281
282function stubStableIds(config: Config, ids: string[], fallbackId = "fffffffff0"): void {
283 let nextIdIndex = 0;

Callers 3

Calls 2

createTestProjectFunction · 0.85
saveWorkspacesFunction · 0.85

Tested by

no test coverage detected