@billjr99/pi-openai-compat 1.1.24 → 1.1.25
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/index.ts +11 -14
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -760,8 +760,7 @@ export default async function (pi: ExtensionAPI) {
|
|
|
760
760
|
let modelsUrl: string | undefined = tpl.modelsUrl;
|
|
761
761
|
if (key === "cloudflare_workers") {
|
|
762
762
|
const entered = await ctx.ui.input(
|
|
763
|
-
"Account ID"
|
|
764
|
-
"Your Cloudflare Account ID (find it on the Cloudflare dashboard overview page):"
|
|
763
|
+
"Account ID: your Cloudflare Account ID (find it on the Cloudflare dashboard overview page)"
|
|
765
764
|
);
|
|
766
765
|
if (entered == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
767
766
|
const accountId = entered.trim();
|
|
@@ -770,24 +769,21 @@ export default async function (pi: ExtensionAPI) {
|
|
|
770
769
|
if (modelsUrl) modelsUrl = modelsUrl.replace("YOUR_ACCOUNT_ID", accountId);
|
|
771
770
|
} else if (key === "cloudflare_ai_gateway") {
|
|
772
771
|
const accountIdInput = await ctx.ui.input(
|
|
773
|
-
"Account ID"
|
|
774
|
-
"Your Cloudflare Account ID (find it on the Cloudflare dashboard overview page):"
|
|
772
|
+
"Account ID: your Cloudflare Account ID (find it on the Cloudflare dashboard overview page)"
|
|
775
773
|
);
|
|
776
774
|
if (accountIdInput == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
777
775
|
const accountId = accountIdInput.trim();
|
|
778
776
|
if (!accountId) { ctx.ui.notify("Account ID cannot be empty.", "error"); return; }
|
|
779
777
|
|
|
780
778
|
const gatewayInput = await ctx.ui.input(
|
|
781
|
-
"Gateway Name"
|
|
782
|
-
"Your AI Gateway name/slug (find it under AI → AI Gateway in the Cloudflare dashboard):"
|
|
779
|
+
"Gateway Name: your AI Gateway name/slug (find it under AI → AI Gateway in the Cloudflare dashboard)"
|
|
783
780
|
);
|
|
784
781
|
if (gatewayInput == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
785
782
|
const gatewaySlug = gatewayInput.trim();
|
|
786
783
|
if (!gatewaySlug) { ctx.ui.notify("Gateway name cannot be empty.", "error"); return; }
|
|
787
784
|
|
|
788
785
|
const providerInput = await ctx.ui.input(
|
|
789
|
-
"Provider"
|
|
790
|
-
"Upstream provider slug (e.g. openai, workers-ai, anthropic — must match your gateway config):"
|
|
786
|
+
"Provider: upstream provider slug (e.g. openai, workers-ai, anthropic — must match your gateway config; press Enter for openai)"
|
|
791
787
|
);
|
|
792
788
|
if (providerInput == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
793
789
|
const provider = providerInput.trim() || "openai";
|
|
@@ -804,10 +800,11 @@ export default async function (pi: ExtensionAPI) {
|
|
|
804
800
|
}
|
|
805
801
|
} else if (tpl.promptUrl) {
|
|
806
802
|
const defaultUrl = tpl.baseUrl;
|
|
803
|
+
// pi renders only the dialog title, so the guidance goes there.
|
|
807
804
|
const prompt = isLocalUrl(defaultUrl)
|
|
808
|
-
? `Base URL
|
|
809
|
-
: "Base URL
|
|
810
|
-
const entered = await ctx.ui.input(
|
|
805
|
+
? `Base URL: press Enter for default (${defaultUrl})`
|
|
806
|
+
: "Base URL: your endpoint (e.g. https://api.example.com/v1)";
|
|
807
|
+
const entered = await ctx.ui.input(prompt);
|
|
811
808
|
if (entered == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
812
809
|
baseUrl = (entered.trim() || defaultUrl).replace(/\/+$/, "");
|
|
813
810
|
if (!baseUrl) { ctx.ui.notify("Base URL cannot be empty.", "error"); return; }
|
|
@@ -817,9 +814,9 @@ export default async function (pi: ExtensionAPI) {
|
|
|
817
814
|
let apiKey: string | null = null;
|
|
818
815
|
if (!tpl.keyless && !isLocalUrl(baseUrl)) {
|
|
819
816
|
const keyPrompt = tpl.keyHint
|
|
820
|
-
? `
|
|
821
|
-
: "
|
|
822
|
-
const entered = await ctx.ui.input(
|
|
817
|
+
? `API Key: required — get it at ${tpl.keyHint}`
|
|
818
|
+
: "API Key: leave blank if keyless";
|
|
819
|
+
const entered = await ctx.ui.input(keyPrompt);
|
|
823
820
|
if (entered == null) { ctx.ui.notify("Login cancelled.", "info"); return; }
|
|
824
821
|
apiKey = entered.trim() || null;
|
|
825
822
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@billjr99/pi-openai-compat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "pi-coding-agent extension: OpenAI-compatible endpoint support (OpenRouter, NVIDIA NIM, Nous Portal, Ollama, custom)",
|
|
5
5
|
"author": "Bill Mongan <https://github.com/BillJr99>",
|
|
6
6
|
"license": "MIT",
|