MCPcopy
hub / github.com/forloopcodes/contextplus / withRequestActivity

Function withRequestActivity

src/index.ts:55–64  ·  view source on GitHub ↗
(
  handler: (args: TArgs) => Promise<TResult>,
  options?: { useEmbeddingTracker?: boolean },
)

Source from the content-addressed store, hash-verified

53let ensureTrackerRunning = () => { };
54
55function withRequestActivity<TArgs, TResult>(
56 handler: (args: TArgs) => Promise<TResult>,
57 options?: { useEmbeddingTracker?: boolean },
58): (args: TArgs) => Promise<TResult> {
59 return async (args: TArgs): Promise<TResult> => {
60 noteServerActivity();
61 if (options?.useEmbeddingTracker) ensureTrackerRunning();
62 return handler(args);
63 };
64}
65
66function parseAgentTarget(input?: string): AgentTarget {
67 const normalized = (input ?? "claude").toLowerCase();

Callers 1

index.tsFile · 0.85

Calls 2

noteServerActivityFunction · 0.85
ensureTrackerRunningFunction · 0.85

Tested by

no test coverage detected