MCPcopy
hub / github.com/CopilotKit/CopilotKit / threadRecord

Function threadRecord

packages/angular/src/lib/threads.spec.ts:15–39  ·  view source on GitHub ↗

* Minimal thread record matching the platform `/threads` list payload, with * sensible defaults so tests only specify the fields they assert on.

(
  overrides: Partial<{
    id: string;
    organizationId: string;
    agentId: string;
    createdById: string;
    name: string | null;
    archived: boolean;
    createdAt: string;
    updatedAt: string;
    lastRunAt: string;
  }>,
)

Source from the content-addressed store, hash-verified

13 * sensible defaults so tests only specify the fields they assert on.
14 */
15function threadRecord(
16 overrides: Partial<{
17 id: string;
18 organizationId: string;
19 agentId: string;
20 createdById: string;
21 name: string | null;
22 archived: boolean;
23 createdAt: string;
24 updatedAt: string;
25 lastRunAt: string;
26 }>,
27): Record<string, unknown> {
28 return {
29 id: "t-1",
30 organizationId: "org-1",
31 agentId: "agent-1",
32 createdById: "user-1",
33 name: null,
34 archived: false,
35 createdAt: "2024-01-01T00:00:00.000Z",
36 updatedAt: "2024-01-01T00:00:00.000Z",
37 ...overrides,
38 };
39}
40
41/** Builds a Response-like object accepted by rxjs `fromFetch`. */
42function jsonResponse(body: unknown, init?: { ok?: boolean; status?: number }) {

Callers 1

threads.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…