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

Function writeTaskReport

src/node/services/attachmentService.completedReports.test.ts:15–38  ·  view source on GitHub ↗
(
  sessionDir: string,
  params: {
    childTaskId: string;
    updatedAtMs: number;
    parentWorkspaceId?: string;
    workflowOwnedAncestorWorkspaceIds?: string[];
    title?: string;
  }
)

Source from the content-addressed store, hash-verified

13const WORKSPACE_ID = "workspace-reports-test";
14
15async function writeTaskReport(
16 sessionDir: string,
17 params: {
18 childTaskId: string;
19 updatedAtMs: number;
20 parentWorkspaceId?: string;
21 workflowOwnedAncestorWorkspaceIds?: string[];
22 title?: string;
23 }
24): Promise<void> {
25 await upsertSubagentReportArtifact({
26 workspaceId: WORKSPACE_ID,
27 workspaceSessionDir: sessionDir,
28 childTaskId: params.childTaskId,
29 parentWorkspaceId: params.parentWorkspaceId ?? WORKSPACE_ID,
30 ancestorWorkspaceIds: [params.parentWorkspaceId ?? WORKSPACE_ID],
31 reportMarkdown: "# Report\n\nSome findings.",
32 ...(params.workflowOwnedAncestorWorkspaceIds
33 ? { workflowOwnedAncestorWorkspaceIds: params.workflowOwnedAncestorWorkspaceIds }
34 : {}),
35 ...(params.title !== undefined ? { title: params.title } : {}),
36 nowMs: params.updatedAtMs,
37 });
38}
39
40async function writeWorkflowRun(
41 sessionDir: string,

Calls 1

Tested by

no test coverage detected