@@ -177,18 +177,9 @@ describe("sourceLabel", () => {
177177} ) ;
178178
179179describe ( "eventIcon" , ( ) => {
180- const allKinds = [
181- KIND_TOOL_CALL ,
182- KIND_DIFC_FILTERED ,
183- KIND_GUARD_BLOCKED ,
184- KIND_NET_ALLOWED ,
185- KIND_NET_BLOCKED ,
186- KIND_AGENT_TURN ,
187- KIND_AGENT_TOOL_START ,
188- KIND_AGENT_TOOL_DONE ,
189- ] ;
190-
191- it . each ( allKinds ) ( "returns non-default icon for %s" , ( kind ) => {
180+ const allKinds = [ KIND_TOOL_CALL , KIND_DIFC_FILTERED , KIND_GUARD_BLOCKED , KIND_NET_ALLOWED , KIND_NET_BLOCKED , KIND_AGENT_TURN , KIND_AGENT_TOOL_START , KIND_AGENT_TOOL_DONE ] ;
181+
182+ it . each ( allKinds ) ( "returns non-default icon for %s" , kind => {
192183 const icon = eventIcon ( kind ) ;
193184 expect ( icon ) . not . toBe ( "·" ) ;
194185 expect ( icon . length ) . toBeGreaterThan ( 0 ) ;
@@ -343,19 +334,14 @@ describe("collectFirewallEvents", () => {
343334
344335 it ( "classifies entries with 4xx/5xx HTTP status as net_blocked" , ( ) => {
345336 const auditPath = path . join ( tmpDir , "audit.jsonl" ) ;
346- writeJsonl ( auditPath , [
347- { ts : 1705312800.0 , host : "blocked.example.com" , status : 403 } ,
348- ] ) ;
337+ writeJsonl ( auditPath , [ { ts : 1705312800.0 , host : "blocked.example.com" , status : 403 } ] ) ;
349338 const events = collectFirewallEvents ( { auditJsonlPath : auditPath } ) ;
350339 expect ( events [ 0 ] . kind ) . toBe ( KIND_NET_BLOCKED ) ;
351340 } ) ;
352341
353342 it ( "skips entries with missing ts" , ( ) => {
354343 const auditPath = path . join ( tmpDir , "audit.jsonl" ) ;
355- writeJsonl ( auditPath , [
356- { host : "no-ts.example.com" } ,
357- { ts : 1705312800.0 , host : "ok.example.com" } ,
358- ] ) ;
344+ writeJsonl ( auditPath , [ { host : "no-ts.example.com" } , { ts : 1705312800.0 , host : "ok.example.com" } ] ) ;
359345 const events = collectFirewallEvents ( { auditJsonlPath : auditPath } ) ;
360346 expect ( events ) . toHaveLength ( 1 ) ;
361347 } ) ;
@@ -486,9 +472,7 @@ describe("collectAgentEvents", () => {
486472 const sessionDir = path . join ( tmpDir , "sandbox" , "agent" , "logs" , "copilot-session-state" , "uuid-xyz" ) ;
487473 fs . mkdirSync ( sessionDir , { recursive : true } ) ;
488474 const eventsPath = path . join ( sessionDir , "events.jsonl" ) ;
489- writeJsonl ( eventsPath , [
490- { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ,
491- ] ) ;
475+ writeJsonl ( eventsPath , [ { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ] ) ;
492476 const events = collectAgentEvents ( { logDir : tmpDir } ) ;
493477 expect ( events ) . toHaveLength ( 1 ) ;
494478 } ) ;
@@ -512,21 +496,15 @@ describe("collectUnifiedTimelineEvents", () => {
512496 it ( "merges and sorts events from all three sources" , ( ) => {
513497 // Gateway at t+2s
514498 const gwPath = path . join ( tmpDir , "gateway.jsonl" ) ;
515- writeJsonl ( gwPath , [
516- { timestamp : "2024-01-15T10:00:02Z" , event : "tool_call" , server_name : "srv" , tool_name : "get_file" } ,
517- ] ) ;
499+ writeJsonl ( gwPath , [ { timestamp : "2024-01-15T10:00:02Z" , event : "tool_call" , server_name : "srv" , tool_name : "get_file" } ] ) ;
518500
519501 // Firewall at t+3s
520502 const auditPath = path . join ( tmpDir , "audit.jsonl" ) ;
521- writeJsonl ( auditPath , [
522- { ts : new Date ( "2024-01-15T10:00:03Z" ) . getTime ( ) / 1000 , host : "api.example.com" , decision : "TCP_TUNNEL:HIER_DIRECT" } ,
523- ] ) ;
503+ writeJsonl ( auditPath , [ { ts : new Date ( "2024-01-15T10:00:03Z" ) . getTime ( ) / 1000 , host : "api.example.com" , decision : "TCP_TUNNEL:HIER_DIRECT" } ] ) ;
524504
525505 // Agent at t+1s
526506 const eventsPath = path . join ( tmpDir , "events.jsonl" ) ;
527- writeJsonl ( eventsPath , [
528- { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ,
529- ] ) ;
507+ writeJsonl ( eventsPath , [ { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ] ) ;
530508
531509 const events = collectUnifiedTimelineEvents ( {
532510 gatewayJsonlPath : gwPath ,
@@ -557,9 +535,7 @@ describe("buildUnifiedTimelineMarkdown", () => {
557535 } ) ;
558536
559537 it ( "wraps output in a <details> block" , ( ) => {
560- const events = [
561- { source : SOURCE_GATEWAY , kind : KIND_TOOL_CALL , time : new Date ( "2024-01-15T10:00:02Z" ) , detail : "srv/get_file" , status : "success" } ,
562- ] ;
538+ const events = [ { source : SOURCE_GATEWAY , kind : KIND_TOOL_CALL , time : new Date ( "2024-01-15T10:00:02Z" ) , detail : "srv/get_file" , status : "success" } ] ;
563539 const md = buildUnifiedTimelineMarkdown ( events ) ;
564540 expect ( md ) . toContain ( "<details>" ) ;
565541 expect ( md ) . toContain ( "</details>" ) ;
@@ -579,9 +555,7 @@ describe("buildUnifiedTimelineMarkdown", () => {
579555 } ) ;
580556
581557 it ( "contains a Markdown table header row" , ( ) => {
582- const events = [
583- { source : SOURCE_AGENT , kind : KIND_AGENT_TURN , time : new Date ( "2024-01-15T10:00:01Z" ) , detail : "turn 1" , status : "" } ,
584- ] ;
558+ const events = [ { source : SOURCE_AGENT , kind : KIND_AGENT_TURN , time : new Date ( "2024-01-15T10:00:01Z" ) , detail : "turn 1" , status : "" } ] ;
585559 const md = buildUnifiedTimelineMarkdown ( events ) ;
586560 expect ( md ) . toContain ( "| Time | Src | Kind | Detail | Status |" ) ;
587561 } ) ;
@@ -602,9 +576,7 @@ describe("buildUnifiedTimelineMarkdown", () => {
602576 } ) ;
603577
604578 it ( "escapes pipe characters in detail/status to avoid breaking Markdown tables" , ( ) => {
605- const events = [
606- { source : SOURCE_GATEWAY , kind : KIND_TOOL_CALL , time : new Date ( "2024-01-15T10:00:00Z" ) , detail : "srv|tool" , status : "ok|extra" } ,
607- ] ;
579+ const events = [ { source : SOURCE_GATEWAY , kind : KIND_TOOL_CALL , time : new Date ( "2024-01-15T10:00:00Z" ) , detail : "srv|tool" , status : "ok|extra" } ] ;
608580 const md = buildUnifiedTimelineMarkdown ( events ) ;
609581 // After escaping, literal | inside cells should not appear
610582 const rows = md . split ( "\n" ) . filter ( l => l . startsWith ( "| 10:" ) ) ;
@@ -631,9 +603,7 @@ describe("generateUnifiedTimelineSummary", () => {
631603
632604 it ( "renders a non-empty summary when at least one source has events" , ( ) => {
633605 const eventsPath = path . join ( tmpDir , "events.jsonl" ) ;
634- writeJsonl ( eventsPath , [
635- { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ,
636- ] ) ;
606+ writeJsonl ( eventsPath , [ { type : "user.message" , id : "m1" , timestamp : "2024-01-15T10:00:01Z" , data : { } } ] ) ;
637607 const result = generateUnifiedTimelineSummary ( {
638608 gatewayJsonlPath : "/nonexistent" ,
639609 rpcMessagesPath : "/nonexistent2" ,
0 commit comments