@vtstech/pi-openrouter-sync 1.0.9 → 1.1.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/openrouter-sync.js +5 -4
- package/package.json +2 -2
package/openrouter-sync.js
CHANGED
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
MODELS_JSON_PATH as MODELS_FILE,
|
|
4
4
|
readModelsJson,
|
|
5
5
|
writeModelsJson,
|
|
6
|
-
BUILTIN_PROVIDERS
|
|
6
|
+
BUILTIN_PROVIDERS,
|
|
7
|
+
EXTENSION_VERSION
|
|
7
8
|
} from "@vtstech/pi-shared/ollama";
|
|
8
9
|
import { section, ok, warn } from "@vtstech/pi-shared/format";
|
|
9
10
|
var BRANDING = [
|
|
10
|
-
` \u26A1 Pi OpenRouter Sync
|
|
11
|
+
` \u26A1 Pi OpenRouter Sync v${EXTENSION_VERSION}`,
|
|
11
12
|
` Written by VTSTech`,
|
|
12
13
|
` GitHub: https://github.com/VTSTech`,
|
|
13
14
|
` Website: www.vts-tech.org`
|
|
@@ -15,7 +16,7 @@ var BRANDING = [
|
|
|
15
16
|
var OR_CONFIG = BUILTIN_PROVIDERS.openrouter;
|
|
16
17
|
function parseModelIds(args) {
|
|
17
18
|
return args.trim().split(/[\s,]+/).filter(Boolean).map((arg) => {
|
|
18
|
-
const match = arg.match(/openrouter\.ai\/(
|
|
19
|
+
const match = arg.match(/openrouter\.ai\/([^?#]+)/);
|
|
19
20
|
return match ? match[1] : arg;
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -27,7 +28,7 @@ function ensureProviderOrder(providers) {
|
|
|
27
28
|
if (orIdx !== -1) {
|
|
28
29
|
ordered["openrouter"] = providers["openrouter"];
|
|
29
30
|
}
|
|
30
|
-
if (olIdx !== -1 && olIdx < orIdx) {
|
|
31
|
+
if (olIdx !== -1 && (orIdx === -1 || olIdx < orIdx)) {
|
|
31
32
|
ordered["ollama"] = providers["ollama"];
|
|
32
33
|
}
|
|
33
34
|
for (const key of keys) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtstech/pi-openrouter-sync",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "OpenRouter model sync extension for Pi Coding Agent — add models from OpenRouter URLs or IDs",
|
|
5
5
|
"main": "openrouter-sync.js",
|
|
6
6
|
"keywords": ["pi-extensions"],
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/VTSTech/pi-coding-agent"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vtstech/pi-shared": "1.0
|
|
17
|
+
"@vtstech/pi-shared": "1.1.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mariozechner/pi-coding-agent": ">=0.66"
|