()
| 104 | } |
| 105 | |
| 106 | async data(): Promise<PlanData> { |
| 107 | if (!this._planId || !this._planFilePath) return null; |
| 108 | let content = ''; |
| 109 | try { |
| 110 | content = await this.agent.kaos.readText(this._planFilePath); |
| 111 | } catch (error) { |
| 112 | if (!isMissingFileError(error)) throw error; |
| 113 | } |
| 114 | return { |
| 115 | id: this._planId, |
| 116 | content, |
| 117 | path: this._planFilePath, |
| 118 | }; |
| 119 | } |
| 120 | |
| 121 | private async writeEmptyPlanFile(path: string): Promise<void> { |
| 122 | await this.ensurePlanDirectory(path); |
no test coverage detected