(source: string, self: Effect.Effect<A, E, R>)
| 30 | const systemHook = "experimental.chat.system.transform" |
| 31 | |
| 32 | function withProject<A, E, R>(source: string, self: Effect.Effect<A, E, R>) { |
| 33 | return Effect.gen(function* () { |
| 34 | const test = yield* TestInstance |
| 35 | const file = path.join(test.directory, "plugin.ts") |
| 36 | yield* Effect.all( |
| 37 | [ |
| 38 | Effect.promise(() => Bun.write(file, source)), |
| 39 | Effect.promise(() => |
| 40 | Bun.write( |
| 41 | path.join(test.directory, "opencode.json"), |
| 42 | JSON.stringify( |
| 43 | { |
| 44 | $schema: "https://opencode.ai/config.json", |
| 45 | plugin: [pathToFileURL(file).href], |
| 46 | }, |
| 47 | null, |
| 48 | 2, |
| 49 | ), |
| 50 | ), |
| 51 | ), |
| 52 | ], |
| 53 | { discard: true, concurrency: 2 }, |
| 54 | ) |
| 55 | return yield* self |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | const triggerSystemTransform = Effect.fn("PluginTriggerTest.triggerSystemTransform")(function* () { |
| 60 | const plugin = yield* Plugin.Service |
no test coverage detected