@vanillagreen/pi-claude-bridge 1.6.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -2
- package/bundle/index.js +25449 -19866
- package/package.json +5 -5
- package/src/agents-md.ts +16 -6
- package/src/auth-presence.ts +158 -0
- package/src/config.ts +75 -3
- package/src/index.ts +443 -62
- package/src/prompt-context.ts +3 -8
package/src/prompt-context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
|
-
import { homedir } from "os";
|
|
3
2
|
import { dirname, join, resolve } from "path";
|
|
3
|
+
import { isolatedFromEnv, piUserDir } from "./config.js";
|
|
4
4
|
|
|
5
5
|
export interface PromptContextSettings {
|
|
6
6
|
includeAppendSystemPromptMd?: boolean;
|
|
@@ -14,12 +14,6 @@ export interface PromptContextAppend {
|
|
|
14
14
|
labels: string[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
function piUserDir(): string {
|
|
18
|
-
const configured = process.env.PI_CODING_AGENT_DIR?.trim();
|
|
19
|
-
if (configured) return resolve(configured.replace(/^~(?=\/|$)/, homedir()));
|
|
20
|
-
return join(homedir(), ".pi", "agent");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
17
|
function readTrimmed(path: string): string | undefined {
|
|
24
18
|
try {
|
|
25
19
|
if (!existsSync(path)) return undefined;
|
|
@@ -46,7 +40,8 @@ export function readAppendSystemPromptFiles(cwd: string): Array<{ label: string;
|
|
|
46
40
|
const files: Array<{ label: string; path: string }> = [
|
|
47
41
|
{ label: "global APPEND_SYSTEM.md", path: join(piUserDir(), "APPEND_SYSTEM.md") },
|
|
48
42
|
];
|
|
49
|
-
|
|
43
|
+
// Isolated mode: no cwd-ancestor discovery — the host app owns the prompt surface.
|
|
44
|
+
const projectPath = isolatedFromEnv() ? undefined : findProjectAppendSystem(cwd);
|
|
50
45
|
if (projectPath) files.push({ label: "project .pi/APPEND_SYSTEM.md", path: projectPath });
|
|
51
46
|
|
|
52
47
|
const seen = new Set<string>();
|