MCPcopy Create free account
hub / github.com/TanStack/ai / createHook

Function createHook

packages/ai-devtools/tests/hook-dashboard-model.test.ts:100–120  ·  view source on GitHub ↗
(
  id: string,
  hookName: string,
  outputKind: HookOutputKind | undefined,
  updatedAt: number,
  runIds: Array<string> = [],
)

Source from the content-addressed store, hash-verified

98})
99
100function createHook(
101 id: string,
102 hookName: string,
103 outputKind: HookOutputKind | undefined,
104 updatedAt: number,
105 runIds: Array<string> = [],
106): HookRecord {
107 return {
108 id,
109 hookName,
110 ...(outputKind ? { outputKind } : {}),
111 lifecycle: 'active',
112 registeredAt: updatedAt,
113 updatedAt,
114 state: {},
115 tools: [],
116 runIds,
117 eventIds: [],
118 activityRunIds: [],
119 }
120}
121
122function createRun(id: string, status: RunRecord['status']): RunRecord {
123 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected