opencode-magpie-plugin 0.7.1 → 0.7.3
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 +45 -22
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +110 -31
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
# opencode-magpie-plugin
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/opencode-magpie-plugin)
|
|
4
|
-
[](https://github.com/yee94/yuri-plugins/actions/workflows/ci.yml)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**把 Magpie 里的模型、路由组和生图能力带进 OpenCode V2,不再手工维护另一份模型配置。**
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## 包边界
|
|
12
|
-
|
|
13
|
-
本包只负责 OpenCode 侧的模型发现、价格、工具和网关连接,不包含 Claude Code 订阅渠道的提示词改写。
|
|
14
|
-
可选的 [`magpie-yuri-adapter`](../magpie-yuri-adapter/README.md) 是另一个独立 npm 包,安装在 Magpie 服务器端,不由本包依赖或自动启用。完整仓库结构见 [monorepo README](../../README.md)。
|
|
15
|
-
|
|
16
|
-
### 为什么 Magpie 路由图显示 `magpie`,不是 OpenCode?
|
|
17
|
-
|
|
18
|
-
**提示词里的身份和网关的调用方标签是两回事。** Adapter 不改请求头或认证信息,不能把路由图改名。
|
|
19
|
-
|
|
20
|
-
Magpie 的调用方识别取决于 Agent 专用 Gateway Key、`User-Agent` 和转发元数据;在 Magpie → Magpie 的链路上,接收端也可能识别为 `magpie`。`X-Magpie-Agent` 是标签,不能无条件覆盖直接调用者的身份。特别是 `ctx.agent` 与路由图记录的转发来源不一定相同,不能只凭显示名推断插件是否命中。
|
|
21
|
-
|
|
22
|
-
本插件现有 `options.agentID` 仅设置 `X-Magpie-Agent`,不会修改真实 `User-Agent` 或生成 Agent 专用 Key。参见下方的 [Agent 标签与原生归属](#agent-标签与原生归属)。要恢复正确的调用方显示,应检查正在使用的连接、Key 和转发头,而不是继续替换提示词中的品牌名。
|
|
23
|
-
|
|
24
|
-
插件图标沿用 [Magpie 官网的小尺寸喜鹊 SVG](https://usemagpie.ai/img/magpie-small.svg),保留原始轮廓,透明底、`currentColor` 单色渲染。源文件为 [`icon.svg`](icon.svg),`package.json` 顶层 `icon` 内嵌同一图形的 data URI,不依赖远程图片。
|
|
9
|
+
你已经用 Magpie 管理了 Cursor、WorkBuddy 或远程网关,希望 OpenCode 里的列表能跟着更新,也能看清模型来源、能力和参考价格。这个插件负责这一侧的接入和呈现;账号登录、路由和请求转发仍交给 Magpie。
|
|
25
10
|
|
|
26
11
|
## 它解决什么问题
|
|
27
12
|
|
|
@@ -47,6 +32,8 @@ OpenCode V2
|
|
|
47
32
|
|
|
48
33
|
这不是一个绕过 Magpie 的社区插件宿主:**推理请求仍经过所配置的 Magpie 网关**。
|
|
49
34
|
|
|
35
|
+
如果你遇到的是 Claude Code 订阅渠道的 TUI 请求被拒绝,请看另一个独立包 [`magpie-claude-opencode-adapter`](../magpie-claude-opencode-adapter/README.md)。本包不包含那段提示词改写,也不会自动启用它。
|
|
36
|
+
|
|
50
37
|
## 前置条件
|
|
51
38
|
|
|
52
39
|
1. 使用支持 `setup()`、`provider.transform` 和原生 provider runtime 的 **OpenCode V2**。不支持 V1。
|
|
@@ -205,6 +192,32 @@ Responses 和 Anthropic 请求同样在该前缀下使用 `responses`、`message
|
|
|
205
192
|
|
|
206
193
|
模型发现、30 秒刷新和推理都使用同一个远端与 token。远程模式不读取本机 Magpie 地址或 Fast 配置,也不会自动启动本机网关、失败后回退到本机。首次发现失败会报错;后续刷新失败保留最近成功的目录。目录请求不跟随重定向,反代应直接处理所配置的地址。
|
|
207
194
|
|
|
195
|
+
### 同时连接多个网关
|
|
196
|
+
|
|
197
|
+
只添加一条插件配置,把原来各条配置的 `options` 放进 `gateways` 数组。`{}` 使用本机 Magpie;`remote`、`agentID`、`groups`、`order` 都可以按网关配置。
|
|
198
|
+
|
|
199
|
+
```jsonc
|
|
200
|
+
{
|
|
201
|
+
"plugins": [{
|
|
202
|
+
"package": "opencode-magpie-plugin",
|
|
203
|
+
"options": {
|
|
204
|
+
"gateways": [
|
|
205
|
+
{},
|
|
206
|
+
{
|
|
207
|
+
"agentID": "yuri",
|
|
208
|
+
"remote": {
|
|
209
|
+
"baseURL": "https://magpie.example.com/v1",
|
|
210
|
+
"token": "{env:MAGPIE_REMOTE_TOKEN}"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}]
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
模型按原有 provider ID 和 model ID 合并。不同模型都保留,同 ID 时后面的网关覆盖前面的定义;推理使用该模型来源网关的地址、token 和 Agent 标签。单个网关发现失败不影响其他网关,刷新失败保留它上次成功的目录。生图列表同样按原模型 ID 合并,指定模型时使用列表中对应的网关;省略模型时使用最后一项网关的默认生图模型。
|
|
220
|
+
|
|
208
221
|
### Agent 标签与原生归属
|
|
209
222
|
|
|
210
223
|
`options.agentID` 是可选的请求标签,默认 `opencode`;支持 1–64 个小写字母、数字、`.`、`_`、`-`,且首位为字母或数字。它会用于模型发现、目录刷新、推理和生图请求的 `X-Magpie-Agent`,但**不会覆盖 OpenCode 的真实 User-Agent,也不是 UI 来源检测**。
|
|
@@ -361,8 +374,8 @@ console.log(getModelPricing('claude-opus-4-6', 'cursor'));
|
|
|
361
374
|
## 本地开发 / file 模式
|
|
362
375
|
|
|
363
376
|
```sh
|
|
364
|
-
git clone https://github.com/yee94/
|
|
365
|
-
cd
|
|
377
|
+
git clone https://github.com/yee94/yuri-plugins.git
|
|
378
|
+
cd yuri-plugins
|
|
366
379
|
corepack enable
|
|
367
380
|
pnpm install
|
|
368
381
|
pnpm check
|
|
@@ -372,7 +385,7 @@ pnpm check
|
|
|
372
385
|
|
|
373
386
|
```jsonc
|
|
374
387
|
{
|
|
375
|
-
"plugins": ["file:///absolute/path/
|
|
388
|
+
"plugins": ["file:///absolute/path/yuri-plugins/packages/opencode-magpie-plugin/dist"]
|
|
376
389
|
}
|
|
377
390
|
```
|
|
378
391
|
|
|
@@ -382,6 +395,14 @@ pnpm check
|
|
|
382
395
|
|
|
383
396
|
## 排查
|
|
384
397
|
|
|
398
|
+
### 为什么 Magpie 路由图显示 `magpie`,不是 OpenCode?
|
|
399
|
+
|
|
400
|
+
路由图读取的是调用方连接信息,不是提示词。Magpie 的来源识别取决于 Agent 专用 Gateway Key、`User-Agent` 和转发元数据;经过另一层 Magpie 时,接收端可能识别为 `magpie`。中间件的 `ctx.agent` 与记录的原始转发来源也可能不同。
|
|
401
|
+
|
|
402
|
+
本插件的 `options.agentID` 只设置 `X-Magpie-Agent`,不会修改真实 `User-Agent` 或生成 Agent 专用 Key,也不能无条件覆盖直接调用方身份。应检查正在使用的连接和转发标签,不能通过修改提示词来给路由图改名。详见 [Agent 标签与原生归属](#agent-标签与原生归属)。
|
|
403
|
+
|
|
404
|
+
### 其他问题
|
|
405
|
+
|
|
385
406
|
| 现象 | 检查项 |
|
|
386
407
|
| --- | --- |
|
|
387
408
|
| `/plugins` 没有 `magpie.providers` | 全局配置是否被当前服务读取;file 模式是否填写 `dist` 目录并已构建;查看 OpenCode 日志 |
|
|
@@ -411,7 +432,7 @@ pnpm --filter opencode-magpie-plugin check
|
|
|
411
432
|
pnpm --dir packages/opencode-magpie-plugin pack
|
|
412
433
|
```
|
|
413
434
|
|
|
414
|
-
|
|
435
|
+
维护者推送 `opencode-magpie-plugin@v<本包版本>` 标签即可只发布本包,发布流程见[仓库根 README](../../README.md)。
|
|
415
436
|
|
|
416
437
|
测试覆盖目录分组与替换、options 呈现(分桶、排序、非法配置)、wire model ID、协议元数据、价格归一化与覆盖、未知价格、会话头、网关身份检查、自动启动与并发去重、未安装提示、刷新失败和清理。测试不消耗真实服务额度。
|
|
417
438
|
|
|
@@ -419,6 +440,8 @@ pnpm --dir packages/opencode-magpie-plugin pack
|
|
|
419
440
|
|
|
420
441
|
## 相关项目与许可证
|
|
421
442
|
|
|
443
|
+
插件图标沿用 [Magpie 官网的小尺寸喜鹊 SVG](https://usemagpie.ai/img/magpie-small.svg)。源文件为 [`icon.svg`](icon.svg),`package.json` 的 `icon` 内嵌同一图形,不依赖远程图片。
|
|
444
|
+
|
|
422
445
|
- [Magpie](https://usemagpie.ai/):账号、网关、路由和上游转接。
|
|
423
446
|
- [OpenCode V2 plugins](https://opencode.ai/v2/docs/build/plugins):插件生命周期与动态 provider API。
|
|
424
447
|
|
package/dist/index.d.mts
CHANGED
|
@@ -58,6 +58,7 @@ type ModelInfo2 = {
|
|
|
58
58
|
}[];
|
|
59
59
|
package?: string;
|
|
60
60
|
settings?: Record<string, unknown>;
|
|
61
|
+
headers?: Record<string, string>;
|
|
61
62
|
body?: Record<string, unknown>;
|
|
62
63
|
};
|
|
63
64
|
type ProviderEditor = {
|
|
@@ -117,6 +118,10 @@ type PluginContext = {
|
|
|
117
118
|
type SessionHookEvents = {
|
|
118
119
|
'http.request': {
|
|
119
120
|
sessionID: string;
|
|
121
|
+
model: {
|
|
122
|
+
providerID: string;
|
|
123
|
+
id: string;
|
|
124
|
+
};
|
|
120
125
|
request: Request;
|
|
121
126
|
};
|
|
122
127
|
context: ModelMessages;
|
package/dist/index.mjs
CHANGED
|
@@ -399,6 +399,15 @@ const parsePresentation = (options) => {
|
|
|
399
399
|
order: parseOrder(options.order)
|
|
400
400
|
};
|
|
401
401
|
};
|
|
402
|
+
const parseGatewayOptions = (options) => {
|
|
403
|
+
if (!isRecord(options) || !Object.hasOwn(options, "gateways")) return void 0;
|
|
404
|
+
if (Object.keys(options).length !== 1) throw invalidOptions("options.gateways", "请将其他选项放在各网关配置内");
|
|
405
|
+
if (!Array.isArray(options.gateways) || options.gateways.length === 0) throw invalidOptions("options.gateways", "必须是非空数组");
|
|
406
|
+
return options.gateways.map((entry, index) => {
|
|
407
|
+
if (!isRecord(entry)) throw invalidOptions(`options.gateways[${index}]`, "必须是对象");
|
|
408
|
+
return entry;
|
|
409
|
+
});
|
|
410
|
+
};
|
|
402
411
|
const modelCost = (row, group, catalog) => {
|
|
403
412
|
const pricingID = row.id.slice(row.id.indexOf("/") + 1).replace(/@\d+(?:k|m)$/i, "");
|
|
404
413
|
const builtin = group ? void 0 : getModelPricing(pricingID, pricingProvider(row.owned_by));
|
|
@@ -781,7 +790,26 @@ const drawImage = async (connection, input, signal) => {
|
|
|
781
790
|
const markdownImage = (path) => `[\]]/.test(path) ? `<${path}>` : path})`;
|
|
782
791
|
const NAMESPACE = "magpie";
|
|
783
792
|
/** One call to the model's code mode: found with `search`, never listed in its context. */
|
|
784
|
-
const registerImageTools = (editor,
|
|
793
|
+
const registerImageTools = (editor, connections) => {
|
|
794
|
+
const defaultConnection = connections[connections.length - 1];
|
|
795
|
+
const list = async (signal) => {
|
|
796
|
+
const results = await Promise.allSettled(connections.map(async (connection) => ({
|
|
797
|
+
connection,
|
|
798
|
+
models: await listImageModels(connection, signal)
|
|
799
|
+
})));
|
|
800
|
+
signal.throwIfAborted();
|
|
801
|
+
const catalog = /* @__PURE__ */ new Map();
|
|
802
|
+
for (const result of results) {
|
|
803
|
+
if (result.status === "rejected") continue;
|
|
804
|
+
const { connection, models } = result.value;
|
|
805
|
+
for (const { id, name } of models) catalog.set(id, {
|
|
806
|
+
name,
|
|
807
|
+
connection
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
if (results.every((result) => result.status === "rejected")) throw results[0].reason;
|
|
811
|
+
return catalog;
|
|
812
|
+
};
|
|
785
813
|
editor.namespace({
|
|
786
814
|
name: NAMESPACE,
|
|
787
815
|
description: "Magpie image generation."
|
|
@@ -800,8 +828,8 @@ const registerImageTools = (editor, connection) => {
|
|
|
800
828
|
},
|
|
801
829
|
options,
|
|
802
830
|
execute: async (_input, context) => {
|
|
803
|
-
const models = await
|
|
804
|
-
return { content: models.
|
|
831
|
+
const models = await list(context.signal);
|
|
832
|
+
return { content: models.size ? Array.from(models, ([id, { name }]) => `${id} ${name}`).join("\n") : "No image model is available in Magpie." };
|
|
805
833
|
}
|
|
806
834
|
});
|
|
807
835
|
editor.add({
|
|
@@ -832,7 +860,14 @@ const registerImageTools = (editor, connection) => {
|
|
|
832
860
|
},
|
|
833
861
|
options,
|
|
834
862
|
execute: async (input, context) => {
|
|
835
|
-
const
|
|
863
|
+
const draw = input;
|
|
864
|
+
let connection = defaultConnection;
|
|
865
|
+
if (draw.model && connections.length > 1) {
|
|
866
|
+
const match = (await list(context.signal)).get(draw.model);
|
|
867
|
+
if (!match) throw new Error(`Magpie 生图模型不可用:${draw.model}`);
|
|
868
|
+
connection = match.connection;
|
|
869
|
+
}
|
|
870
|
+
const { path, model } = await drawImage(connection, draw, context.signal);
|
|
836
871
|
return { content: `${markdownImage(path)}${model ? `\n(${model})` : ""}` };
|
|
837
872
|
}
|
|
838
873
|
});
|
|
@@ -871,28 +906,76 @@ const plugin = {
|
|
|
871
906
|
id: "magpie.providers",
|
|
872
907
|
setup: (ctx) => setupPlugin(ctx)
|
|
873
908
|
};
|
|
874
|
-
const
|
|
875
|
-
if (!ctx.provider) throw new Error("Magpie 插件需要 OpenCode V2 provider.transform。");
|
|
876
|
-
const presentation = parsePresentation(ctx.options);
|
|
877
|
-
const connection = await resolveConnection(ctx.options);
|
|
909
|
+
const loadGatewayInventory = async (connection, presentation, reprice = false) => {
|
|
878
910
|
const { baseURL, token, agentID } = connection;
|
|
879
|
-
const apiURL = new URL(baseURL);
|
|
880
911
|
await connection.ensure();
|
|
881
|
-
|
|
882
|
-
let inventory = buildInventory(await fetchModels(baseURL, token, agentID), baseURL, {
|
|
912
|
+
return buildInventory(await fetchModels(baseURL, token, agentID), baseURL, {
|
|
883
913
|
apiKey: token,
|
|
884
914
|
agentID,
|
|
885
|
-
catalog:
|
|
915
|
+
catalog: (await loadCatalogCache(reprice)).data,
|
|
886
916
|
fastModelIDs: connection.remote ? void 0 : await loadFastModelIDs(),
|
|
887
917
|
presentation
|
|
888
918
|
});
|
|
919
|
+
};
|
|
920
|
+
const setupPlugin = async (ctx) => {
|
|
921
|
+
if (!ctx.provider) throw new Error("Magpie 插件需要 OpenCode V2 provider.transform。");
|
|
922
|
+
const gatewayOptions = parseGatewayOptions(ctx.options);
|
|
923
|
+
const gateways = await Promise.all((gatewayOptions ?? [ctx.options]).map(async (options) => {
|
|
924
|
+
const presentation = parsePresentation(options);
|
|
925
|
+
const connection = await resolveConnection(options);
|
|
926
|
+
return {
|
|
927
|
+
presentation,
|
|
928
|
+
connection,
|
|
929
|
+
apiURL: new URL(connection.baseURL)
|
|
930
|
+
};
|
|
931
|
+
}));
|
|
932
|
+
const multi = gateways.length > 1;
|
|
933
|
+
const warn = (message, error, baseURL) => {
|
|
934
|
+
console.warn(baseURL ? `[magpie] ${baseURL} ${message}` : `[magpie] ${message}`, error instanceof Error ? error.message : String(error));
|
|
935
|
+
};
|
|
936
|
+
const discover = async (previous) => Promise.all(gateways.map(async ({ connection, presentation }, index) => {
|
|
937
|
+
const last = previous?.[index];
|
|
938
|
+
try {
|
|
939
|
+
return await loadGatewayInventory(connection, presentation, last && hasUnpricedModel(last));
|
|
940
|
+
} catch (error) {
|
|
941
|
+
if (!previous && !multi) throw error;
|
|
942
|
+
warn(previous ? "模型刷新失败,保留上次目录:" : "模型发现失败,将在下一轮重试:", error, multi ? connection.baseURL : void 0);
|
|
943
|
+
return last ?? [];
|
|
944
|
+
}
|
|
945
|
+
}));
|
|
946
|
+
const merge = (inventories$1) => {
|
|
947
|
+
const providers$1 = /* @__PURE__ */ new Map();
|
|
948
|
+
inventories$1.forEach((inventory, index) => {
|
|
949
|
+
for (const { info, models } of inventory) {
|
|
950
|
+
const merged = providers$1.get(info.id) ?? {
|
|
951
|
+
info,
|
|
952
|
+
models: /* @__PURE__ */ new Map()
|
|
953
|
+
};
|
|
954
|
+
merged.info = info;
|
|
955
|
+
for (const model of models) merged.models.set(model.id, {
|
|
956
|
+
model: multi ? {
|
|
957
|
+
...model,
|
|
958
|
+
headers: info.headers
|
|
959
|
+
} : model,
|
|
960
|
+
gatewayIndex: index
|
|
961
|
+
});
|
|
962
|
+
providers$1.set(info.id, merged);
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
return providers$1;
|
|
966
|
+
};
|
|
967
|
+
let inventories = await discover();
|
|
968
|
+
let providers = merge(inventories);
|
|
889
969
|
const { track, cleanup } = createTrackedSetup();
|
|
890
970
|
let disposed = false;
|
|
891
971
|
let refreshing = false;
|
|
892
972
|
try {
|
|
893
973
|
await track(ctx.provider.transform((editor) => {
|
|
894
|
-
|
|
895
|
-
editor.add(
|
|
974
|
+
providers.forEach(({ info, models }) => {
|
|
975
|
+
editor.add({
|
|
976
|
+
info,
|
|
977
|
+
models: Array.from(models.values(), ({ model }) => model)
|
|
978
|
+
});
|
|
896
979
|
});
|
|
897
980
|
}));
|
|
898
981
|
for (const name of [
|
|
@@ -902,15 +985,19 @@ const setupPlugin = async (ctx) => {
|
|
|
902
985
|
"title"
|
|
903
986
|
]) await track(ctx.session.hook(name, normalizeOpenAICallIDs, { providerID: "openai" }));
|
|
904
987
|
if (ctx.tool && ctx.skill) {
|
|
905
|
-
|
|
988
|
+
const connections = gateways.map(({ connection }) => connection);
|
|
989
|
+
await track(ctx.tool.transform((editor) => registerImageTools(editor, connections)));
|
|
906
990
|
await track(ctx.skill.transform((editor) => registerImageSkill(editor, fileURLToPath(new URL("./", import.meta.url)))));
|
|
907
991
|
}
|
|
908
992
|
await track(ctx.session.hook("http.request", async (event) => {
|
|
993
|
+
const gatewayIndex = multi ? providers.get(event.model.providerID)?.models.get(event.model.id)?.gatewayIndex : 0;
|
|
994
|
+
if (gatewayIndex === void 0) return;
|
|
995
|
+
const { apiURL, connection } = gateways[gatewayIndex];
|
|
909
996
|
const url = new URL(event.request.url);
|
|
910
997
|
if (url.origin !== apiURL.origin || !url.pathname.startsWith(`${apiURL.pathname.replace(/\/$/, "")}/`)) return;
|
|
911
998
|
await connection.ensure();
|
|
912
999
|
event.request.headers.set("X-Magpie-Session", event.sessionID);
|
|
913
|
-
event.request.headers.set("X-Magpie-Agent", agentID ?? "opencode");
|
|
1000
|
+
if (!multi) event.request.headers.set("X-Magpie-Agent", connection.agentID ?? "opencode");
|
|
914
1001
|
}));
|
|
915
1002
|
await reloadProviderCatalog(ctx);
|
|
916
1003
|
} catch (error) {
|
|
@@ -918,13 +1005,14 @@ const setupPlugin = async (ctx) => {
|
|
|
918
1005
|
throw error;
|
|
919
1006
|
}
|
|
920
1007
|
const apply = async (next) => {
|
|
921
|
-
if (disposed || JSON.stringify(next) === JSON.stringify(
|
|
922
|
-
const previous =
|
|
923
|
-
|
|
1008
|
+
if (disposed || JSON.stringify(next) === JSON.stringify(inventories)) return;
|
|
1009
|
+
const previous = providers;
|
|
1010
|
+
providers = merge(next);
|
|
924
1011
|
try {
|
|
925
1012
|
await reloadProviderCatalog(ctx);
|
|
1013
|
+
inventories = next;
|
|
926
1014
|
} catch (error) {
|
|
927
|
-
|
|
1015
|
+
providers = previous;
|
|
928
1016
|
throw error;
|
|
929
1017
|
}
|
|
930
1018
|
};
|
|
@@ -932,18 +1020,9 @@ const setupPlugin = async (ctx) => {
|
|
|
932
1020
|
if (disposed || refreshing) return;
|
|
933
1021
|
refreshing = true;
|
|
934
1022
|
try {
|
|
935
|
-
await
|
|
936
|
-
const rows = await fetchModels(baseURL, token, agentID);
|
|
937
|
-
catalog = await loadCatalogCache(hasUnpricedModel(inventory));
|
|
938
|
-
await apply(buildInventory(rows, baseURL, {
|
|
939
|
-
apiKey: token,
|
|
940
|
-
agentID,
|
|
941
|
-
catalog: catalog.data,
|
|
942
|
-
fastModelIDs: connection.remote ? void 0 : await loadFastModelIDs(),
|
|
943
|
-
presentation
|
|
944
|
-
}));
|
|
1023
|
+
await apply(await discover(inventories));
|
|
945
1024
|
} catch (error) {
|
|
946
|
-
|
|
1025
|
+
warn("模型刷新失败,保留上次目录:", error);
|
|
947
1026
|
} finally {
|
|
948
1027
|
refreshing = false;
|
|
949
1028
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-magpie-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Discover Magpie providers and models in OpenCode V2 with built-in pricing and automatic local gateway startup",
|
|
5
5
|
"icon": "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2044%2044'%20fill='currentColor'%3E%3Cpath%20fill-rule='evenodd'%20d='M1.5,5.5C1.3,5.7,1.2,6.5,1.2,6.9C1.2,6.9,1.2,7,1.2,7.1C1.1,7.4,1.3,8,1.4,8.3C1.4,8.4,1.5,8.5,1.5,8.7C1.5,8.9,1.7,9,1.8,9.3C2.2,9.9,2.2,10,2.3,10.1C2.4,10.2,2.5,10.3,2.6,10.5C2.8,10.8,3,11.1,3.2,11.3C3.3,11.3,3.4,11.6,3.6,11.8C3.8,12,4.1,12.4,4.2,12.5C4.7,13,5.2,13.7,5.4,13.9C6,14.5,6.5,15.1,6.7,15.3C6.7,15.4,6.9,15.5,6.9,15.7C7.3,15.9,7.7,16.5,7.9,16.8C7.9,16.8,8,16.9,8,16.9C8.1,16.9,8.2,17.2,8.2,17.3C8.2,17.3,8.1,17.2,8.1,17.1C7.9,16.9,7.9,16.9,7.6,16.6C7.5,16.5,7.4,16.5,7.4,16.3C7.2,16.2,6.7,15.7,6.3,15.2C6.1,15.1,6,14.9,6,14.9C5.9,14.8,5.7,14.7,5.7,14.6C5.6,14.5,5.4,14.3,5.3,14.2C5.1,14.1,4.9,13.8,4.7,13.5C4.5,13.3,4.2,13.1,4.1,12.9C4.1,12.9,3.8,12.7,3.8,12.5C3.5,12.3,3,11.8,2.8,11.4C1.8,10.5,0.9,9.6,0.7,9.6C0.6,9.7,0.6,9.8,0.5,10C0.5,10.1,0.6,10.2,0.5,10.3C0.5,10.4,0.6,10.5,0.6,10.6C0.5,10.7,0.5,10.9,0.6,11C0.5,11.1,0.6,11.4,0.6,11.5C0.9,12.9,1.3,13.8,2.8,14.9C2.9,15.1,3.3,15.3,3.4,15.4C3.4,15.5,3.6,15.6,3.7,15.7C4.2,16,6.4,17.8,7,18.4C7.4,18.8,7.4,18.8,7.5,18.9C7.6,19,7.7,19,7.7,19.1C7.7,19.2,7.8,19.2,7.9,19.2C7.9,19.3,8.1,19.4,8.1,19.5C8.2,19.6,8.2,19.7,8.3,19.7C8.3,19.7,8.3,19.7,8.2,19.7C8.2,19.6,8.1,19.6,8,19.6C7.9,19.5,7.9,19.4,7.8,19.4C7.7,19.3,7.6,19.2,7.6,19.2C7.6,19.1,7.5,19,7.3,18.9C7.2,18.9,6.9,18.6,6.7,18.4C6.1,17.8,4.5,16.6,3.5,16C3.4,15.8,3,15.6,2.9,15.5C2.6,15.3,1.5,14.6,0.9,14.3C0.7,14.1,0.6,14.1,0.6,14.2C0.5,14.5,0.8,15.9,0.9,16.1C0.9,16.2,1,16.2,0.9,16.3C1.2,16.8,1.9,17.6,2.7,18.3C2.8,18.5,4,19.2,4.7,19.5C6.2,20.5,6.6,20.7,7.4,21.5C8.2,22.2,8.7,22.7,9.3,23.6C9.5,24.1,9.9,24.4,10.3,25.3C10.4,25.5,10.5,25.8,10.5,25.8C10.7,25.8,10.8,25.7,11,25.4C11.6,25,11.9,24.6,12.3,24.3C12.8,24,13,23.8,13,23.7C13.1,23.7,13.1,23.8,13,24C12,24.8,11,26,10.2,26.9C10.1,27.1,9.9,27.5,9.7,27.7C9.5,27.8,9.4,28,9.4,28C9.4,28,9.3,28.3,9.1,28.5C8.6,29.2,7.7,30.8,7.7,30.9C7.7,31,7.8,31,8.3,30.8C9,30.4,9.5,30.2,10.4,30C11.7,29.6,12.5,29.6,11.6,30C10.5,30.2,9.7,30.6,9.2,31.2C8.8,31.7,8.8,31.7,9.3,31.7C10.1,31.8,10.9,31.9,11.6,32.2C12.8,32.7,13.5,33.1,15.5,34.8C16.4,35.5,17.3,36.2,17.8,36.4C17.9,36.5,18.1,36.7,18.2,36.8C19.1,37.3,21.2,38.1,22.3,38.3C22.4,38.3,22.7,38.3,22.8,38.3C22.8,38.5,23,38.5,23,38.5C23.1,38.5,23.2,38.5,23.3,38.5C23.6,38.6,25.9,38.6,26.1,38.5C26.2,38.5,26.3,38.5,26.4,38.5C26.5,38.5,26.6,38.5,26.7,38.3C26.7,38.3,27,38.3,27.1,38.3C28.3,38.1,30.2,37.3,31.4,36.7C31.5,36.7,31.7,36.4,31.8,36.4C32.2,36.2,33.2,35.4,33.4,35.2C34.2,34.5,35.5,33,35.8,32.6C35.8,32.5,36,32.2,36.1,32C36.4,31.8,36.6,31.4,36.6,31.2C36.7,31.1,36.8,30.9,36.9,30.8C37.2,30.4,37.5,29.6,37.7,29.2C37.7,29.1,37.8,28.7,37.9,28.7C38.1,28.5,38.4,27.1,38.5,26.8C39,25.2,39.1,23.7,39,22.4C39,22.2,38.9,21.9,38.9,21.8C38.9,21.7,38.9,21.6,38.9,21.4C38.6,20.5,38.5,19.9,38.2,19C37.9,18.5,37.5,17.5,37.3,17.2C37,16.8,36.8,15.8,36.8,15.2C36.8,13.8,37.7,12.7,39.6,12.2C40.1,12.1,41.3,11.8,42.1,11.7C43.5,11.5,43.5,11.5,43.4,11.3C42.9,10.7,40.9,9.9,39.2,9.7C37.9,9.5,38.1,9.5,37.6,9C37,8.6,36.4,8,36,7.9C36,7.8,35.8,7.8,35.7,7.7C35.1,7.3,34.2,7,33.1,6.9C32.6,6.7,31.6,6.9,31,7C29.6,7.3,28.3,8,27.3,9.2C26.7,9.8,26.2,10.8,25.7,11.7C25.5,12.1,24.8,13.4,24.7,13.7C24.6,13.9,24.5,14.1,24.1,14.7C23.5,15.7,22.1,16.9,20.6,17.8C20.5,18,20.3,18.2,20.1,18.3C19.7,18.5,19.4,18.8,19.1,19C18.9,19.1,18.7,19.3,18.5,19.4C18,19.8,17.2,20.3,17,20.5C16.9,20.5,16.8,20.6,16.7,20.7C16.3,20.8,16.1,20.9,16,20.9C15.5,20.8,14.9,20.5,14.2,20.2C13.7,19.8,12.7,18.9,12.4,18.6C12.3,18.5,12.2,18.4,12.1,18.2C11.9,18,11.2,17.1,11,16.6C10.9,16.5,10.8,16.4,10.7,16.3C10.7,16.2,10.6,16.1,10.6,15.9C10.5,15.9,10.4,15.7,10.4,15.6C10.3,15.5,10.2,15.2,10.1,15C10,14.8,9.8,14.4,9.7,14.2C9.6,14,9.5,13.7,9.4,13.6C9.4,13.4,9.3,13.2,9.2,13C9.2,12.8,9,12.6,9,12.5C8.9,12.3,8.7,12.1,8.7,12C8.7,12,8.5,11.7,8.5,11.7C8.3,11.2,8.2,10.9,7.5,10C6.4,8.3,4.2,6.4,2.7,5.8C2,5.5,1.6,5.4,1.5,5.5ZM28.4,16.7C29.2,16.9,29.7,17.2,29.9,17.7C30.1,18.2,30,18.9,29.6,19.4C29.2,19.9,28.2,20.9,27.6,21.2C26.8,21.7,25.3,22.4,24.2,22.7C23.9,22.8,23.6,22.9,23.5,22.9C22.8,23.2,20.7,23.7,19.6,24C19,24.2,18.4,24.3,18.1,24.4C17.9,24.4,16.1,24.9,15.3,25.1C14.6,25.2,14.7,25.1,15.7,23.6C16.4,22.7,18.5,20.6,19.4,19.9C20.8,18.8,21.4,18.4,23.2,17.6C23.8,17.4,25.6,16.8,25.9,16.8C25.9,16.8,26.3,16.8,26.6,16.7C26.8,16.7,28.2,16.7,28.4,16.7ZM30.4,20.2C30.5,20.3,30.6,20.6,30.6,20.7C31.7,23.1,33.4,24.6,35.6,25.3C36.1,25.5,36.7,25.7,37.2,25.8C37.7,25.8,37.8,25.9,37.8,26.1C37.7,26.2,37.7,26.3,37.7,26.5C37.7,26.6,37.7,26.8,37.6,27C37.4,28.5,36.8,29.9,36.1,31C36.1,31.2,35.9,31.4,35.9,31.6C35.7,31.9,35.2,32.6,34.7,33.3C32.6,35.6,29.7,37.3,26.6,37.8C26.5,37.8,26.3,37.9,26.2,37.9C25.8,37.9,23.7,37.9,23.3,37.9C23.2,37.9,23,37.8,22.9,37.8C21.1,37.6,19.3,36.8,18,35.7C17.7,35.4,17,34.7,16.8,34.5C16.3,33.8,16.1,33,16.3,32.5C16.5,31.8,16.8,31.6,17.9,31.1C19.1,30.5,19.4,30.4,20.2,30C21.4,29.4,23.2,28.4,23.9,27.9C23.9,27.8,24.2,27.7,24.5,27.6C26.3,26.3,28,24.6,28.9,22.9C29.5,22.2,29.7,21.6,29.9,20.7C30.1,20,30.2,19.9,30.4,20.2Z'/%3E%3C/svg%3E",
|
|
6
6
|
"type": "module",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "git+https://github.com/yee94/
|
|
41
|
+
"url": "git+https://github.com/yee94/yuri-plugins.git",
|
|
42
42
|
"directory": "packages/opencode-magpie-plugin"
|
|
43
43
|
},
|
|
44
44
|
"bugs": {
|
|
45
|
-
"url": "https://github.com/yee94/
|
|
45
|
+
"url": "https://github.com/yee94/yuri-plugins/issues"
|
|
46
46
|
},
|
|
47
|
-
"homepage": "https://github.com/yee94/
|
|
47
|
+
"homepage": "https://github.com/yee94/yuri-plugins/tree/main/packages/opencode-magpie-plugin#readme",
|
|
48
48
|
"author": "yee94",
|
|
49
49
|
"keywords": [
|
|
50
50
|
"opencode",
|