pi-graphite 0.1.0 → 0.1.1
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/package.json +1 -1
- package/src/lib/exec.ts +3 -5
- package/src/tools/repo.ts +8 -7
package/package.json
CHANGED
package/src/lib/exec.ts
CHANGED
|
@@ -7,8 +7,6 @@ export interface GtRunOptions {
|
|
|
7
7
|
signal?: AbortSignal;
|
|
8
8
|
/** Extra env vars merged into process.env */
|
|
9
9
|
env?: Record<string, string>;
|
|
10
|
-
/** Disable injection of --no-interactive (only for cases that need a TTY) */
|
|
11
|
-
allowInteractive?: boolean;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export interface GtRunResult {
|
|
@@ -45,7 +43,8 @@ export function truncateOutput(s: string): string {
|
|
|
45
43
|
* Run `gt` with structured args. Never builds a shell string.
|
|
46
44
|
*
|
|
47
45
|
* - Always injects --cwd <abs>.
|
|
48
|
-
* -
|
|
46
|
+
* - Always injects --no-interactive. No escape hatch by design: agent-driven
|
|
47
|
+
* tools must never block on a TTY prompt.
|
|
49
48
|
* - Does not inject --quiet (we want stderr diagnostics).
|
|
50
49
|
*/
|
|
51
50
|
export async function runGt(
|
|
@@ -53,8 +52,7 @@ export async function runGt(
|
|
|
53
52
|
opts: GtRunOptions,
|
|
54
53
|
): Promise<GtRunResult> {
|
|
55
54
|
const cwd = resolvePath(opts.cwd);
|
|
56
|
-
const args = ["--cwd", cwd];
|
|
57
|
-
if (!opts.allowInteractive) args.push("--no-interactive");
|
|
55
|
+
const args = ["--cwd", cwd, "--no-interactive"];
|
|
58
56
|
args.push(...rawArgs);
|
|
59
57
|
|
|
60
58
|
return new Promise<GtRunResult>((resolve) => {
|
package/src/tools/repo.ts
CHANGED
|
@@ -83,16 +83,17 @@ export function registerRepo(pi: ExtensionAPI) {
|
|
|
83
83
|
details: { result: f },
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
// Additional trunk
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
allowInteractive: false,
|
|
91
|
-
});
|
|
86
|
+
// Additional trunk: `gt trunk --add` typically prompts; with
|
|
87
|
+
// --no-interactive it will fail fast. Surface that failure to the
|
|
88
|
+
// caller instead of pretending it worked.
|
|
89
|
+
const r = await runGt(args, { cwd, signal });
|
|
92
90
|
const f = formatResult(r);
|
|
93
91
|
return {
|
|
94
92
|
content: [{ type: "text", text: renderText("gt trunk --add", f) }],
|
|
95
|
-
details: {
|
|
93
|
+
details: {
|
|
94
|
+
result: f,
|
|
95
|
+
note: "`gt trunk --add` is interactive; this call runs with --no-interactive and may fail. Add the trunk via `gt config` or `gt init --trunk` instead.",
|
|
96
|
+
},
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
99
|
|