magpie-aws-quick-bridge 0.1.1 → 0.1.2
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 +2 -5
- package/index.mjs +2 -3
- package/package.json +1 -1
- package/plugin/chat.mjs +3 -3
- package/plugin/messages.mjs +1 -1
- package/plugin/oauth.mjs +2 -1
- package/plugin/toolbridge.mjs +3 -2
- package/plugin/upstream.mjs +1 -1
- package/plugin/wire.mjs +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
我做的一个 [Magpie](https://usemagpie.ai) 供应商插件,把 **Amazon Quick(QuickWork)** 接入 Magpie:在 Magpie 里登录 Amazon Quick 账号后,Claude Code、Codex、OpenCode 等所有 agent 都能以 `aws-quick/<model>` 使用它。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
使用中遇到问题或有建议,欢迎提 [issue](https://github.com/DaBinBinah/magpie-AWS-Quick-bridge/issues),或者在 [X 上找我](https://x.com/yedabinbinah)。
|
|
14
14
|
|
|
15
15
|
> 非官方项目,与 Amazon / AWS 无关联。请仅在你拥有或获得明确授权的账号上使用,并遵守相关服务条款。
|
|
16
16
|
|
|
@@ -87,8 +87,6 @@ magpie plugin login aws-quick
|
|
|
87
87
|
magpie plugin options magpie-AWS-Quick-bridge '{"thinking_effort": "medium", "timezone": "Asia/Shanghai", "locale": "zh-CN"}'
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
名称与 quickproxy 的 `config.json` 保持一致:
|
|
91
|
-
|
|
92
90
|
| 选项 | 默认 | 说明 |
|
|
93
91
|
|---|---|---|
|
|
94
92
|
| `thinking_effort` | 空 | 请求没有指定推理档位时使用:`off`、`low`、`medium`、`high` |
|
|
@@ -140,7 +138,6 @@ plugin/messages.mjs OpenAI 消息 → user_message 文本与 system_prompt
|
|
|
140
138
|
plugin/toolbridge.mjs 客户端工具的文本协议与流式解析
|
|
141
139
|
plugin/chat.mjs chat completions 的 JSON / SSE 回复
|
|
142
140
|
test/ 单元测试、模拟上游、端到端测试
|
|
143
|
-
cmd/ internal/ Go 版独立反代 quickproxy(docs/quickproxy.md)
|
|
144
141
|
```
|
|
145
142
|
|
|
146
143
|
## 开发与测试
|
|
@@ -212,4 +209,4 @@ DaBinBinah
|
|
|
212
209
|
|
|
213
210
|
[GNU General Public License v3.0](LICENSE)。
|
|
214
211
|
|
|
215
|
-
Magpie 插件部分(`index.mjs`、`plugin/`、`test/`)© 2026 DaBinBinah。登录流程、协议编解码和工具桥接移植自 [aws-quickwork-2api](https://github.com/jasonxu114514/aws-quickwork-2api)(© Jason Xu,GPL-3.0
|
|
212
|
+
Magpie 插件部分(`index.mjs`、`plugin/`、`test/`)© 2026 DaBinBinah。登录流程、协议编解码和工具桥接移植自 [aws-quickwork-2api](https://github.com/jasonxu114514/aws-quickwork-2api)(© Jason Xu,GPL-3.0);按 GPL-3.0 的要求保留这条来源说明,并以同一许可证发布。
|
package/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ const REFRESH_LEAD_MS = 10 * 60_000
|
|
|
18
18
|
|
|
19
19
|
const MODEL_NAMES = { smart: "Quick Smart", fast: "Quick Fast", balanced: "Quick Balanced", auto: "Quick Auto" }
|
|
20
20
|
|
|
21
|
-
// "30s", "5m", "1h"
|
|
21
|
+
// "30s", "5m", "1h" or a number of seconds.
|
|
22
22
|
function durationMs(value, fallback) {
|
|
23
23
|
if (typeof value === "number" && value > 0) return value * 1000
|
|
24
24
|
const m = /^\s*(\d+(?:\.\d+)?)\s*(ms|s|m|h)?\s*$/.exec(String(value ?? ""))
|
|
@@ -28,8 +28,7 @@ function durationMs(value, fallback) {
|
|
|
28
28
|
|
|
29
29
|
const text = (value, fallback = "") => (typeof value === "string" && value.trim() ? value.trim() : fallback)
|
|
30
30
|
|
|
31
|
-
// The plugin's options (plugins.json)
|
|
32
|
-
// config.json uses.
|
|
31
|
+
// The plugin's options (plugins.json).
|
|
33
32
|
function settings(options = {}) {
|
|
34
33
|
// 0 takes any free port
|
|
35
34
|
const port = typeof options.callback_port === "number" ? options.callback_port : Number(options.callback_port || NaN)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magpie-aws-quick-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "OpenCode / magpie provider plugin: Amazon Quick (QuickWork) with its own desktop sign-in, as OpenAI-compatible chat with streaming and tool calls",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
package/plugin/chat.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// OpenAI chat completions on top of one Amazon Quick turn, ported from
|
|
2
|
-
// internal/proxy/server.go. Account rotation and retries
|
|
3
|
-
// request is tried once and a failure is answered with a
|
|
4
|
-
// act on.
|
|
2
|
+
// aws-quickwork-2api's internal/proxy/server.go. Account rotation and retries
|
|
3
|
+
// are magpie's, so a request is tried once and a failure is answered with a
|
|
4
|
+
// status magpie can act on.
|
|
5
5
|
|
|
6
6
|
import { callId, formatPrompt, lastUserText, systemPrompt, titleFor, uuid } from "./messages.mjs"
|
|
7
7
|
import { BridgeStream, buildToolBridgePrompt, parseClientToolCalls, parseToolChoice, requestedToolNames } from "./toolbridge.mjs"
|
package/plugin/messages.mjs
CHANGED
package/plugin/oauth.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Native Amazon Quick desktop sign-in and token refresh, ported from
|
|
2
|
-
// internal/oauth. Nothing here needs the official
|
|
2
|
+
// aws-quickwork-2api's internal/oauth. Nothing here needs the official
|
|
3
|
+
// desktop app.
|
|
3
4
|
|
|
4
5
|
import { createHash, randomBytes, timingSafeEqual } from "node:crypto"
|
|
5
6
|
|
package/plugin/toolbridge.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Client tools over a text protocol, ported from
|
|
2
|
-
// internal/proxy/toolbridge.go. Amazon Quick accepts no
|
|
3
|
-
// so they travel in the system prompt and come back as
|
|
2
|
+
// aws-quickwork-2api's internal/proxy/toolbridge.go. Amazon Quick accepts no
|
|
3
|
+
// client tool schemas, so they travel in the system prompt and come back as
|
|
4
|
+
// markers in the text.
|
|
4
5
|
|
|
5
6
|
import { argumentString, callId } from "./messages.mjs"
|
|
6
7
|
|
package/plugin/upstream.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// One chat turn over the Amazon Quick bidi WebSocket, ported from
|
|
2
|
-
// internal/proxy/upstream.go.
|
|
2
|
+
// aws-quickwork-2api's internal/proxy/upstream.go.
|
|
3
3
|
|
|
4
4
|
import { argumentString, callId, titleFor, uuid } from "./messages.mjs"
|
|
5
5
|
import { GATEWAY_WS_PATH } from "./oauth.mjs"
|
package/plugin/wire.mjs
CHANGED