(state: State, kind: string, body: string, signal?: AbortSignal)
| 1021 | } |
| 1022 | |
| 1023 | async function emitFmt(state: State, kind: string, body: string, signal?: AbortSignal): Promise<boolean> { |
| 1024 | if (kind === "text") { |
| 1025 | await emitText(state, body || SAMPLE_MARKDOWN, signal) |
| 1026 | return true |
| 1027 | } |
| 1028 | |
| 1029 | if (kind === "markdown" || kind === "md") { |
| 1030 | await emitText(state, body || SAMPLE_MARKDOWN, signal) |
| 1031 | return true |
| 1032 | } |
| 1033 | |
| 1034 | if (kind === "table") { |
| 1035 | await emitText(state, body || SAMPLE_TABLE, signal) |
| 1036 | return true |
| 1037 | } |
| 1038 | |
| 1039 | if (kind === "reasoning") { |
| 1040 | await emitReasoning(state, body || "Planning next steps [REDACTED] while preserving reducer ordering.", signal) |
| 1041 | return true |
| 1042 | } |
| 1043 | |
| 1044 | if (kind === "bash") { |
| 1045 | await emitBash(state, signal) |
| 1046 | return true |
| 1047 | } |
| 1048 | |
| 1049 | if (kind === "write") { |
| 1050 | emitWrite(state) |
| 1051 | return true |
| 1052 | } |
| 1053 | |
| 1054 | if (kind === "edit") { |
| 1055 | emitEdit(state) |
| 1056 | return true |
| 1057 | } |
| 1058 | |
| 1059 | if (kind === "patch") { |
| 1060 | emitPatch(state) |
| 1061 | return true |
| 1062 | } |
| 1063 | |
| 1064 | if (kind === "task") { |
| 1065 | emitTask(state) |
| 1066 | return true |
| 1067 | } |
| 1068 | |
| 1069 | if (kind === "todo") { |
| 1070 | emitTodo(state) |
| 1071 | return true |
| 1072 | } |
| 1073 | |
| 1074 | if (kind === "question") { |
| 1075 | emitQuestionTool(state) |
| 1076 | return true |
| 1077 | } |
| 1078 | |
| 1079 | if (kind === "error") { |
| 1080 | emitError(state, body || "demo error event") |
no test coverage detected