Function
emit
(type: string, data: Record<string, unknown>)
Source from the content-addressed store, hash-verified
| 676 | const sessionID = sess.id |
| 677 | |
| 678 | function emit(type: string, data: Record<string, unknown>) { |
| 679 | if (args.format === "json") { |
| 680 | process.stdout.write( |
| 681 | JSON.stringify({ |
| 682 | type, |
| 683 | timestamp: Date.now(), |
| 684 | sessionID, |
| 685 | ...data, |
| 686 | }) + EOL, |
| 687 | ) |
| 688 | return true |
| 689 | } |
| 690 | return false |
| 691 | } |
| 692 | |
| 693 | // Consume one subscribed event stream for the active session and mirror it |
| 694 | // to stdout/UI. `client` is passed explicitly because attach mode may |
Tested by
no test coverage detected