mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(coding-agent): support PI_CODING_AGENT_DIR env var in example extensions (#2009)
This commit is contained in:
parent
b6b7fafddb
commit
f5b1084176
5 changed files with 13 additions and 15 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@mariozechner/pi-ai";
|
||||
import { readFileSync } from "fs";
|
||||
import { homedir } from "os";
|
||||
import { getAgentDir } from "packages/coding-agent/src/config.js";
|
||||
import { join } from "path";
|
||||
import { MODELS, streamGitLabDuo } from "./index.js";
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ async function main() {
|
|||
}
|
||||
|
||||
// Read auth
|
||||
const authPath = join(homedir(), ".pi", "agent", "auth.json");
|
||||
const authPath = join(getAgentDir(), "extensions", "auth.json");
|
||||
const authData = JSON.parse(readFileSync(authPath, "utf-8"));
|
||||
const gitlabCred = authData["gitlab-duo"];
|
||||
if (!gitlabCred?.access) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue