|
1 | 1 | import { Context, Effect, Layer } from "effect" |
2 | 2 |
|
3 | | -import { InstanceState } from "@/effect" |
| 3 | +import { Instance } from "../project/instance" |
4 | 4 |
|
5 | 5 | import PROMPT_ANTHROPIC from "./prompt/anthropic.txt" |
6 | 6 | import PROMPT_DEFAULT from "./prompt/default.txt" |
@@ -43,18 +43,18 @@ export const layer = Layer.effect( |
43 | 43 | Service, |
44 | 44 | Effect.gen(function* () { |
45 | 45 | const skill = yield* Skill.Service |
46 | | - const ctx = yield* InstanceState.context |
47 | 46 |
|
48 | 47 | return Service.of({ |
49 | 48 | environment(model) { |
| 49 | + const project = Instance.project |
50 | 50 | return [ |
51 | 51 | [ |
52 | 52 | `You are powered by the model named ${model.api.id}. The exact model ID is ${model.providerID}/${model.api.id}`, |
53 | 53 | `Here is some useful information about the environment you are running in:`, |
54 | 54 | `<env>`, |
55 | | - ` Working directory: ${ctx.directory}`, |
56 | | - ` Workspace root folder: ${ctx.worktree}`, |
57 | | - ` Is directory a git repo: ${ctx.project.vcs === "git" ? "yes" : "no"}`, |
| 55 | + ` Working directory: ${Instance.directory}`, |
| 56 | + ` Workspace root folder: ${Instance.worktree}`, |
| 57 | + ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, |
58 | 58 | ` Platform: ${process.platform}`, |
59 | 59 | ` Today's date: ${new Date().toDateString()}`, |
60 | 60 | `</env>`, |
|
0 commit comments