MCPcopy Create free account
hub / github.com/Noumena-Network/code / call

Function call

src/commands/render-trace/render-trace.ts:5–41  ·  view source on GitHub ↗
(
  args: string,
  _context: ToolUseContext,
)

Source from the content-addressed store, hash-verified

3import type { LocalCommandResult } from '../../types/command.js'
4
5export async function call(
6 args: string,
7 _context: ToolUseContext,
8): Promise<LocalCommandResult> {
9 const trace = getRenderTrace()
10 const cleanArgs = args.trim().toLowerCase()
11
12 if (cleanArgs === 'full') {
13 trace.armFullCapture()
14 return {
15 type: 'text',
16 value:
17 'Full capture armed for next 32 natural frames with row content and ANSI. ' +
18 'No repaint triggered — corruption state is preserved. ' +
19 'Privacy warning: traces may contain secrets. ' +
20 'Type /render-trace to dump when ready.',
21 }
22 }
23
24 if (cleanArgs === 'status') {
25 const status = trace.status
26 const remaining = trace.framesUntilFullDisable
27 return {
28 type: 'text',
29 value: `Status: ${status} | Full frames remaining: ${remaining}`,
30 }
31 }
32
33 // Default: dump
34 try {
35 const path = trace.dumpSync()
36 return { type: 'text', value: `Render trace dumped to:\n${path}` }
37 } catch (err) {
38 const message = err instanceof Error ? err.message : String(err)
39 return { type: 'text', value: `Failed to dump trace: ${message}` }
40 }
41}

Callers

nothing calls this directly

Calls 3

getRenderTraceFunction · 0.85
armFullCaptureMethod · 0.80
dumpSyncMethod · 0.80

Tested by

no test coverage detected