Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add Pi coding-agent provider #3818

Closedahmadaccino(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/3818/headopened View on GitHub

Showing 34 changed files with 125 additions and 0 deletions (loading 31).

x
0 of 34 viewed, 34 left
11 additions and 0 deletionsapps/server/scripts/cli.tsModified
View file
@@ -180,6 +180,17 @@
const webDist = path.join(repoRoot, "apps/web/dist");
const clientTarget = path.join(serverDir, "dist/client");
​
+ // Pi loads the approval-gate extension at runtime; vp pack won't emit it, so copy it next to the bundle.
+ const piExtensionSource = path.join(serverDir, "src/provider/assets/pi/t3-approvals.ts");
+ const piAssetTargetDir = path.join(serverDir, "dist/assets/pi");
+ if (yield* fs.exists(piExtensionSource)) {
+ yield* fs.makeDirectory(piAssetTargetDir, { recursive: true });
+ yield* fs.copyFile(piExtensionSource, path.join(piAssetTargetDir, "t3-approvals.ts"));
+ yield* Effect.log("[cli] Bundled Pi approval extension into dist/assets/pi");
+ } else {
+ return yield* new ServerCliBuildAssetMissingError({ assetPath: piExtensionSource });
+ }
Resolvedby ahmadaccino(GitHub profile, opens in a new tab)
+​
if (yield* fs.exists(webDist)) {
yield* fs.copy(webDist, clientTarget);
yield* applyDevelopmentIconOverrides(repoRoot, serverDir);
114 additions and 0 deletionsapps/server/scripts/pi-mock-rpc.tsAdded
View file
@@ -0,0 +1,114 @@
+#!/usr/bin/env node
+// @effect-diagnostics nodeBuiltinImport:off
+// Fake `pi --mode rpc` for tests; driven by `PI_MOCK_*` env vars.
+import * as NodeReadline from "node:readline";
+​
+const assistantText = process.env["PI_MOCK_ASSISTANT_TEXT"] ?? '{"title":"Mock title"}';
+const emitInvalidJson = process.env["PI_MOCK_EMIT_INVALID_JSON"] === "1";