@ryan_nookpi/pi-extension-cc-system-prompt 0.1.2 → 0.2.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 +6 -3
- package/index.ts +9 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @ryan_nookpi/pi-extension-cc-system-prompt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use your **Claude Code subscription** (Max, Team, Enterprise) with pi.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Claude Code's API uses a dedicated system prompt to identify itself. This extension swaps pi's system prompt with that Claude Code-style prompt when you select a Claude model, so the API recognizes requests as coming from Claude Code and routes them through your subscription plan.
|
|
6
|
+
|
|
7
|
+
Pi's original system prompt is preserved by injecting it once as a persistent `<system-reminder>` message.
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
@@ -24,5 +26,6 @@ pi install npm:@ryan_nookpi/pi-extension-cc-system-prompt
|
|
|
24
26
|
|
|
25
27
|
## Notes
|
|
26
28
|
|
|
27
|
-
-
|
|
29
|
+
- No additional API charges — requests are billed against your existing Claude Code subscription.
|
|
30
|
+
- This relies on undocumented Anthropic internal behavior and may break at any time without notice.
|
|
28
31
|
- Vendored prompt fragments come from `Piebald-AI/claude-code-system-prompts`.
|
package/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
5
6
|
|
|
6
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
8
|
const VENDOR_DIR = join(__dirname, "vendor", "system-prompts");
|
|
@@ -123,6 +124,13 @@ export function wrapSystemPromptAsReminder(systemPrompt: string): string {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
export default function ccSystemPrompt(pi: ExtensionAPI) {
|
|
127
|
+
pi.registerMessageRenderer(REMINDER_CUSTOM_TYPE, (_message, { expanded }, theme) => {
|
|
128
|
+
if (!expanded) {
|
|
129
|
+
return new Text(theme.fg("dim", "▸ Claude Code system prompt injected"), 0, 0);
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
});
|
|
133
|
+
|
|
126
134
|
pi.on("before_agent_start", async (event, ctx) => {
|
|
127
135
|
const modelId = ctx.model?.id;
|
|
128
136
|
if (!shouldApply(modelId)) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryan_nookpi/pi-extension-cc-system-prompt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Claude Code system prompt extension for pi.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@
|
|
30
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|