(err: unknown)
| 153 | } |
| 154 | |
| 155 | function extractErrorMessage(err: unknown): string { |
| 156 | if (typeof err === "string") return err; |
| 157 | if (err && typeof err === "object") { |
| 158 | const e = err as Record<string, unknown>; |
| 159 | if (typeof e.message === "string") return e.message; |
| 160 | if (e.data && typeof e.data === "object") { |
| 161 | const d = e.data as Record<string, unknown>; |
| 162 | if (typeof d.message === "string") return d.message; |
| 163 | } |
| 164 | if (typeof e.name === "string") return e.name; |
| 165 | try { return JSON.stringify(err); } catch { return ""; } |
| 166 | } |
| 167 | return String(err ?? ""); |
| 168 | } |
| 169 | |
| 170 | export const AgentmemoryCapturePlugin: Plugin = async (ctx) => { |
| 171 | projectPath = ctx.worktree || ctx.project?.id || process.cwd(); |
no outgoing calls
no test coverage detected