@magpie-community/opencode-opendesign-auth 0.1.15 → 0.1.17
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 +287 -2
- package/index.mjs +776 -16
- package/package.json +7 -2
- package/video.mjs +545 -0
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Open Design (open-design.ai) Cloud as a magpie / OpenCode provider: sign in
|
|
4
4
|
with the Open Design account, use the models its **Design Plan** entitles the
|
|
5
|
-
account to,
|
|
5
|
+
account to, generate videos with **Seedance 2.5 / 2.5 Flash / 2.0, Wan 2.7
|
|
6
|
+
and MAGI-2**, and watch the plan's **5-hour and 7-day allowance** and wallet
|
|
6
7
|
balance where every other subscription's usage shows.
|
|
7
8
|
|
|
8
9
|
Works in [magpie](https://usemagpie.ai) (which runs OpenCode provider plugins)
|
|
@@ -29,6 +30,7 @@ Open Design's cloud is two planes:
|
|
|
29
30
|
| --- | --- | --- | --- |
|
|
30
31
|
| Control | `amr-api.open-design.ai` | `vela_ctrl_…` | plan, wallet balance, the Design Plan's allowance windows, the workspace |
|
|
31
32
|
| Model | `amr-link.open-design.ai/v1` | `sk-amr-…` | `/models`, `/chat/completions`, `/responses`, `/messages` |
|
|
33
|
+
| Media | `amr-link.open-design.ai/api/v1/media` | `sk-amr-…` | `/models`, `/videos/tasks`, reference-image uploads |
|
|
32
34
|
|
|
33
35
|
A sign-in is the same device authorization the Open Design CLI
|
|
34
36
|
(`vela login`) runs:
|
|
@@ -100,6 +102,69 @@ doesn't name yet; they disagree with the plan for most models (Claude Haiku
|
|
|
100
102
|
Flash's 0.25× "限时谷价" row is a time-limited promotional price, not a
|
|
101
103
|
second model id, so the model keeps 0.5×.
|
|
102
104
|
|
|
105
|
+
### Video generation
|
|
106
|
+
|
|
107
|
+
The five video models appear in magpie's video settings and use its native
|
|
108
|
+
video API. They are video-only models, not additional chat models. Before
|
|
109
|
+
sign-in, or if the media catalog is temporarily unavailable, these models
|
|
110
|
+
are available:
|
|
111
|
+
|
|
112
|
+
| Model | ID | Duration | Resolution |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| Seedance 2.5 | `doubao-seedance-2-5-260628` | 4–30 s | 480p / 720p / 1080p |
|
|
115
|
+
| Seedance 2.5 Flash | `doubao-seedance-2-5-flash-261115` | 4–30 s | 480p / 720p |
|
|
116
|
+
| Seedance 2.0 | `doubao-seedance-2-0-260128` | 4–30 s | 480p / 720p / 1080p / 4K |
|
|
117
|
+
| Wan 2.7 | `wan-2.7` | 2–15 s | 720p / 1080p |
|
|
118
|
+
| MAGI-2 | `magi-2` | 4–5 s | 1080p, with native synchronized audio |
|
|
119
|
+
|
|
120
|
+
After sign-in, `GET /api/v1/media/models` selects the video models the
|
|
121
|
+
account's workspace offers; image and audio rows are not added. The task API
|
|
122
|
+
takes only the models that catalog lists: it answers any other with
|
|
123
|
+
`unknown or unavailable model`, so a model the public models page shows but
|
|
124
|
+
the account's catalog leaves out is not offered, and it appears once the
|
|
125
|
+
catalog lists it. The ordinary
|
|
126
|
+
chat catalog remains independent: a media catalog that refuses the key
|
|
127
|
+
(401/403) leaves the account no video models, one that can't be read keeps
|
|
128
|
+
the five above, and neither changes the chat models. `refresh-models.mjs`
|
|
129
|
+
still refreshes only the chat seed in `models.mjs`.
|
|
130
|
+
|
|
131
|
+
amr-link's chat catalog (`/v1/models`) also lists video models, with
|
|
132
|
+
`output_modalities: ["video"]`. Those are served as video models only, never
|
|
133
|
+
as chat models that take tools.
|
|
134
|
+
|
|
135
|
+
Magpie's OpenAI-shaped `POST /v1/videos`, `GET /v1/videos/{id}` and
|
|
136
|
+
`GET /v1/videos/{id}/content` are translated to Open Design's unified media
|
|
137
|
+
task API, from a JSON or multipart body. `seconds`/`duration`, `size`,
|
|
138
|
+
`ratio` and `resolution` are mapped to its task fields. For the five models
|
|
139
|
+
above, an explicit `ratio`, `resolution` or duration must be one the model
|
|
140
|
+
offers, while a `size` such as `1024x1792` picks the closest ratio it
|
|
141
|
+
offers. `input_reference` supplies a first frame; `reference_images`
|
|
142
|
+
supplies additional references. An image uploaded in magpie arrives as a
|
|
143
|
+
data URL, and a multipart body can carry one as a file. The plugin uploads
|
|
144
|
+
the image with `POST /uploads`, a PUT of the bytes and `/commit` before the
|
|
145
|
+
task is submitted. An image URL (`http://` or `https://`) gets a 400 and is
|
|
146
|
+
never downloaded, so a request can't have this computer fetch an address
|
|
147
|
+
on its network and upload what it answers. That includes a URL a client
|
|
148
|
+
sends through magpie: upload the image instead. A caller that uses the
|
|
149
|
+
plugin directly, not through magpie, can also pass the id of an asset it
|
|
150
|
+
has already committed. Seedance and Wan accept one first frame; MAGI-2
|
|
151
|
+
accepts up to five references. MAGI-2 always produces audio, so
|
|
152
|
+
`generate_audio:false` is refused. Every check runs before an image is
|
|
153
|
+
uploaded or a paid task is created.
|
|
154
|
+
|
|
155
|
+
Every new task gets its own idempotency key, or the `Idempotency-Key` the
|
|
156
|
+
request carries. A submission that fails on the network or with 502, 503
|
|
157
|
+
or 504 is sent at most three times, with the same key and body, so Open
|
|
158
|
+
Design starts one task for it; polling and downloading never submit
|
|
159
|
+
another. Open Design's 4xx answers reach magpie as they are (a 401 also
|
|
160
|
+
marks the sign-in expired), with the fields its validation rejected; its
|
|
161
|
+
5xx answers become 502. The returned video
|
|
162
|
+
id keeps both the model and task id, so status and MP4 content can be read
|
|
163
|
+
later without maintaining local state.
|
|
164
|
+
|
|
165
|
+
The account's key goes to `amr-link.open-design.ai` only: the presigned
|
|
166
|
+
upload URL and a download redirected to storage never receive it.
|
|
167
|
+
|
|
103
168
|
`models.mjs` is the seed the provider has *before* anyone signs in. Refresh
|
|
104
169
|
it from the live catalog with:
|
|
105
170
|
|
|
@@ -157,7 +222,7 @@ renew and `refresh` is empty.
|
|
|
157
222
|
## Use
|
|
158
223
|
|
|
159
224
|
```
|
|
160
|
-
magpie plugin # opendesign (Open Design,
|
|
225
|
+
magpie plugin # opendesign (Open Design, chat + video) signed in
|
|
161
226
|
magpie provider test opendesign
|
|
162
227
|
magpie quota # opendesign · Design Plan Go · 5h 32% ↻3h
|
|
163
228
|
```
|
|
@@ -189,3 +254,223 @@ Since Open Design falls back to the wallet balance once the Design Plan
|
|
|
189
254
|
allowance is out, an exhausted window holds the account rather than spending
|
|
190
255
|
the wallet. Set the account to spend its credits, or cap the windows, to
|
|
191
256
|
choose which of the two magpie does.
|
|
257
|
+
|
|
258
|
+
## Reset cards
|
|
259
|
+
|
|
260
|
+
A reset card clears the plan's usage windows once; the answer to a spend names
|
|
261
|
+
the windows it cleared, and that is what is reported. The account earns cards
|
|
262
|
+
from the invite campaign (open-design.ai/cloud/reset: a friend's first paid
|
|
263
|
+
subscription within 48 hours of registering gives both sides one) and from the
|
|
264
|
+
vendor's own grants. A card stops being usable 30 days after it was issued.
|
|
265
|
+
|
|
266
|
+
The plugin reads the cards the account can still spend — the ones the control
|
|
267
|
+
plane lists as available and whose expiry has not passed — and shows how many it
|
|
268
|
+
holds, and when the soonest one runs out, on the account's allowance card. The
|
|
269
|
+
count is shown even when it is none: magpie renders it as "0 resets", and an
|
|
270
|
+
account that holds no card is better told that than shown nothing, which reads
|
|
271
|
+
as a plugin that has no such feature. A card read that fails reports no count at
|
|
272
|
+
all, so a failed read never looks like an empty account.
|
|
273
|
+
|
|
274
|
+
On a magpie that shows card actions (v0.1.5169 and later) the card always carries
|
|
275
|
+
**Get reset cards**, which opens open-design.ai/cloud/reset — what a card is, and
|
|
276
|
+
how one is earned — and spends nothing. When the account holds a card the card
|
|
277
|
+
also carries **Use a reset card**, which magpie asks you to confirm before
|
|
278
|
+
running. `--yes` on the command below skips that question, so the command is the
|
|
279
|
+
one place a card can be spent without being asked.
|
|
280
|
+
|
|
281
|
+
magpie does not localize a card action, and hands a plugin no locale to localize
|
|
282
|
+
by, so each label and confirm carries both languages in one string, English
|
|
283
|
+
first and the Chinese after a "·".
|
|
284
|
+
|
|
285
|
+
Spending goes to `POST /api/v1/reset-cards/{cardId}/use` with the workspace
|
|
286
|
+
whose windows it clears. The card spent is the one that runs out first, so none
|
|
287
|
+
that lasts longer goes before it.
|
|
288
|
+
|
|
289
|
+
The operation id is the whole of the retry safety, and it outlives the click
|
|
290
|
+
that started it — and the host that ran it. magpie runs one plugin host per
|
|
291
|
+
`magpie quota action` while the window's host lives on, so the three values are
|
|
292
|
+
also kept in `opendesign-reset-pending.json` in magpie's own state directory,
|
|
293
|
+
`~/.magpie/opendesign/` — not in the project. The `directory` a host hands a
|
|
294
|
+
plugin is the directory that host was started in, so a record kept there would
|
|
295
|
+
land in whatever repository the reader happened to be in, and the command
|
|
296
|
+
line's directory is usually not the window's (the vendor's console keeps the
|
|
297
|
+
same three in `sessionStorage`, for the same reason).
|
|
298
|
+
That file is read at the start of every click, not once when the plugin is
|
|
299
|
+
created: a long-lived host would otherwise miss, and then overwrite, what a
|
|
300
|
+
command line's host wrote. A lock file beside it makes one spend at a time true
|
|
301
|
+
across both, and it is one lock for the whole file, not one for each account:
|
|
302
|
+
that file holds every account's entries, and a write by one account rewrites all
|
|
303
|
+
of it, so while any spend holds the lock every other click is refused — another
|
|
304
|
+
account's included — rather than queued behind it.
|
|
305
|
+
|
|
306
|
+
A card cannot be given back, so the rules about what a lost answer means are
|
|
307
|
+
deliberately blunt:
|
|
308
|
+
|
|
309
|
+
* a spend that gets no answer is asked again at the same id — never a new one,
|
|
310
|
+
which would spend a second card to clear windows already cleared;
|
|
311
|
+
* a click that follows an unresolved spend asks `GET /api/v1/reset-operations/{id}`
|
|
312
|
+
first. `state: "used"` naming this card, operation and workspace is the reset
|
|
313
|
+
having landed; a 404 is the control plane having no record of it, which is the
|
|
314
|
+
one reading that allows the same spend to be asked again, at that same id;
|
|
315
|
+
* a refusal the control plane means (400, 401, 402, 403, 404, 409, 422) is
|
|
316
|
+
final when it answers the *first* ask of a fresh spend, and clears what was
|
|
317
|
+
kept. A refusal to a re-ask or a resume is not final: a 409 there may be the
|
|
318
|
+
vendor saying "that card is already used" about the very operation being
|
|
319
|
+
asked, so it is settled by the operation record instead;
|
|
320
|
+
* anything else — a dropped connection, a gateway 5xx, a record still settling,
|
|
321
|
+
a body in a shape this plugin does not know — leaves the outcome unknown, and
|
|
322
|
+
it is reported as unknown. The card may already be spent, so it is never
|
|
323
|
+
reported as refused, and the next click resumes that same spend rather than
|
|
324
|
+
starting another;
|
|
325
|
+
* a record that cannot be read, or cannot be written, stops the click before
|
|
326
|
+
anything is spent, and the message names the file. Only "there is no file"
|
|
327
|
+
means an account has nothing pending;
|
|
328
|
+
* a record holding an entry this plugin cannot place — one missing its ids, its
|
|
329
|
+
card id, its operation id or its workspace — also stops the click before
|
|
330
|
+
anything is spent, and leaves the file exactly as it is. Dropping such an
|
|
331
|
+
entry would erase the only record of a spend that may already have landed, and
|
|
332
|
+
filling the missing part in from the account's current cards would ask a
|
|
333
|
+
*different* card at the old operation id, which spends a second card.
|
|
334
|
+
|
|
335
|
+
Only an answer that says `state: "used"` **and** names this card, this operation
|
|
336
|
+
and this workspace is a success; the vendor's console checks the same four
|
|
337
|
+
things. A click reads that success from two places only: the answer to its own
|
|
338
|
+
spend, or the operation record read at the start of the click. It never decides
|
|
339
|
+
"settled" from a record consulted after a refusal, because a wrong guess there
|
|
340
|
+
is what spends the next card. The cost is one extra click when an answer was
|
|
341
|
+
lost: that click reports unconfirmed, and the click after it reads the record.
|
|
342
|
+
That read settles the operation; it re-asks the same card only when the control
|
|
343
|
+
plane never received it, and it never reaches for a different card.
|
|
344
|
+
|
|
345
|
+
One spend runs at a time, across the window's host and a command line's, so two
|
|
346
|
+
clicks cannot both spend a card. A second click inside the same host, for the
|
|
347
|
+
same account, is handed the first click's own result instead of starting
|
|
348
|
+
anything, so it answers without a second spend. Every other overlap — another
|
|
349
|
+
host, or another account in the same host — is told at once that another reset
|
|
350
|
+
is running: it does not wait for the lock and it does not run once the lock is
|
|
351
|
+
free, because by then the holder has settled and emptied the record, and a click
|
|
352
|
+
that ran afterwards would read that emptiness as "nothing pending" and pick a
|
|
353
|
+
second card. A lock left by a host that died is taken over once it is older than
|
|
354
|
+
three times a click's own time budget. An entry is dropped once it
|
|
355
|
+
settles, and nothing is dropped on age — an old record is the one thing that
|
|
356
|
+
stops a spend whose answer was lost from being repeated, so getting rid of one
|
|
357
|
+
is a deliberate act, not a timer. The record names an account by every id its
|
|
358
|
+
sign-in answers to, plus a hash of its key; no key is ever written to disk.
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
magpie quota action opendesign use-reset
|
|
362
|
+
magpie quota action opendesign/<account> use-reset # when the provider holds more than one account
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Nothing is spent on a timer, on a reading, or on a request: only when the **Use a
|
|
366
|
+
reset card** button (or the command above) is run. **Get reset cards** just opens
|
|
367
|
+
a page, and spends nothing. A signing in with an API key is told it needs the
|
|
368
|
+
account sign-in, since the control plane takes no API key.
|
|
369
|
+
|
|
370
|
+
Two things this has not been checked against, because the account it was written
|
|
371
|
+
on held no card: a spend that really lands, and the exact body
|
|
372
|
+
`/api/v1/reset-operations/{id}` answers. The shapes above are the ones the
|
|
373
|
+
vendor's console reads. If the real body is a different shape, every click will
|
|
374
|
+
report unconfirmed and keep the record — it would rather stop and be looked at
|
|
375
|
+
than read an unknown body as "not spent" and spend another card. Deleting that
|
|
376
|
+
account's entry from `opendesign-reset-pending.json` clears it, but check the
|
|
377
|
+
account first: the entry may be the record of a card that really was spent, and
|
|
378
|
+
once it is gone the next click has nothing left to stop it spending another.
|
|
379
|
+
|
|
380
|
+
One known limitation, and it can spend a second card. A record is found by the
|
|
381
|
+
names a sign-in answers to, and a pasted control key is known only by a hash of
|
|
382
|
+
itself. Sign the same OpenDesign account in once through OAuth (which gives an
|
|
383
|
+
email or account id) and once by pasting a different control key under a second
|
|
384
|
+
magpie account, and the two have no name in common: a spend whose answer was
|
|
385
|
+
lost under one is not seen from the other, and a click there spends the next
|
|
386
|
+
card. The same blind spot covers another OS user, a different home directory and
|
|
387
|
+
WSL, because the record lives in one user's own directory. The file holds no
|
|
388
|
+
plain key: the account names, the card, workspace and operation ids, and the
|
|
389
|
+
first 16 hex digits of a hash.
|
|
390
|
+
|
|
391
|
+
## 中文
|
|
392
|
+
|
|
393
|
+
重置卡可以清空一次 Design Plan 的用量窗口,具体清了哪几个由接口返回的
|
|
394
|
+
`windows` 决定,本插件照实转述,不替它下结论。卡来自邀请活动
|
|
395
|
+
(open-design.ai/cloud/reset:好友注册后 48 小时内完成首次付费订阅,双方各得
|
|
396
|
+
一张)以及厂商自己的发放;发卡后 30 天失效。
|
|
397
|
+
|
|
398
|
+
账号卡片上会显示还有几张可用、最早一张什么时候到期。一张都没有时也会显示
|
|
399
|
+
`0 resets`,并保留 **Get reset cards · 获取重置卡** 这个按钮,点了打开
|
|
400
|
+
open-design.ai/cloud/reset,说明重置卡是什么、怎么获得,不会花掉任何卡;读到
|
|
401
|
+
卡列表失败时则完全不显示张数,免得和“确实没有”混成一件事。
|
|
402
|
+
|
|
403
|
+
有卡时同一张卡上会多一个 **Use a reset card · 用一张重置卡** 按钮,点了先弹确认。
|
|
404
|
+
`--yes` 会跳过这个确认,所以命令行是唯一能不问就用掉卡的地方。
|
|
405
|
+
|
|
406
|
+
花卡请求发到 `POST /api/v1/reset-cards/{cardId}/use`,带上要清空的那个工作区。
|
|
407
|
+
用掉的永远是最早过期的那张,免得先花掉能放更久的。
|
|
408
|
+
|
|
409
|
+
重试安全全靠 `operationId`,而且它活得比一次点击、也比跑它的宿主久。
|
|
410
|
+
magpie 每跑一次 `magpie quota action` 都是一个独立的插件宿主进程,而窗口里的宿主
|
|
411
|
+
是常驻的,所以 `cardId`、`operationId`、`workspaceId` 三个值还会写到 magpie 自己的
|
|
412
|
+
状态目录 `~/.magpie/opendesign/opendesign-reset-pending.json`,**不写进项目目录**:
|
|
413
|
+
宿主交给插件的 `directory` 就是它启动时的工作目录,写在那里会落进用户当时碰巧打开的
|
|
414
|
+
仓库里,而命令行的工作目录通常跟窗口的不一样(官方控制台存在 sessionStorage,理由
|
|
415
|
+
一样)。这个文件**每次点击开始时都会重读**,不是插件创建时读一次——常驻宿主否则就
|
|
416
|
+
会看不到命令行宿主写进去的记录,回写时还会把它整个覆盖掉。旁边另有一个锁文件,
|
|
417
|
+
它是整个文件一把锁、不是每个账号一把:这个文件装着所有账号的记录,改一个账号就会
|
|
418
|
+
重写整份,所以只要有一笔在跑,别的点击(包括另一个账号的)都会被直接拒绝,而不是
|
|
419
|
+
排队等着。
|
|
420
|
+
|
|
421
|
+
卡花掉就退不回来,所以「答复丢了算什么」这件事上的规矩故意定得很笨:
|
|
422
|
+
|
|
423
|
+
* 没收到答复的花卡请求,会用**同一个** id 再问一次,绝不新开一个——新开就等于
|
|
424
|
+
再花一张卡去清已经清过的窗口;
|
|
425
|
+
* 上一次悬着没结算时再点,会先读 `GET /api/v1/reset-operations/{id}`。返回
|
|
426
|
+
`state: "used"` 且卡、操作、工作区三项都对得上,就是已经生效;返回 404 表示控
|
|
427
|
+
制面没有这笔记录,这是**唯一**允许用同一个 id 重发的情形;
|
|
428
|
+
* 控制面明确拒绝(400、401、402、403、404、409、422)只在它回答**第一次**发出的
|
|
429
|
+
新花卡请求时算终局,会清掉记录。重发或续跑时收到的拒绝不算终局:那里的 409 很
|
|
430
|
+
可能就是厂商在说「这张卡已经被用掉了」,指的正是这笔操作,所以要改由操作记录来
|
|
431
|
+
判定;
|
|
432
|
+
* 其余情况——连接断开、网关 5xx、记录还没结算、返回形状对不上——一律当作「结果
|
|
433
|
+
未知」,如实报告,不会说成「被拒绝」,因为卡可能已经花掉了。下一次点击会续上同
|
|
434
|
+
一笔,不会另起一笔;
|
|
435
|
+
* 记录读不出来、或者写不进去,都会在花卡之前停下,并在报错里给出文件路径。只有
|
|
436
|
+
「文件不存在」才等于「这个账号没有悬着的记录」;
|
|
437
|
+
* 记录里有一条本插件认不出来的条目——缺了身份、卡号、操作号、工作区里任意一项——
|
|
438
|
+
同样在花卡之前停下,而且**文件原样不动**。丢掉这种条目会抹掉一笔可能已经落地的
|
|
439
|
+
记录;用账号当前的卡去补全更糟:那张卡的命运正是未知的,补上的会是**另一张**卡,
|
|
440
|
+
却沿用旧的操作号,于是又花掉一张。
|
|
441
|
+
|
|
442
|
+
只有同时满足 `state: "used"` **且** `cardId`、`operationId`、`workspaceId` 三项
|
|
443
|
+
都对得上,才算成功(官方控制台校验的也是这四项)。一次点击只在两个地方认定成功:
|
|
444
|
+
它自己那笔花卡请求的回答,或者点击开头读到的操作记录。**它绝不在拒绝之后回头补
|
|
445
|
+
读记录来判定已结算**——在那里猜错一次,下一次点击就会花掉第二张卡。代价是答复丢
|
|
446
|
+
失时要多点一次:那一次报「未确认」,再下一次读记录结算,全程不多花卡。
|
|
447
|
+
|
|
448
|
+
同一时间只允许一笔在跑,跨窗口宿主和命令行宿主都成立,所以两次点击不会各花一张
|
|
449
|
+
卡。同一个宿主里、同一个账号的第二次点击,直接拿到第一次的结果,不另起一笔;其余
|
|
450
|
+
的重叠——换一个宿主,或者在同一个宿主里换一个账号——都会**当场**被告知还有一笔在
|
|
451
|
+
进行,既不排队,也不花卡。排队是行不通的:等锁释放时,那一笔已经把记录结算清空,
|
|
452
|
+
排队进来的点击会把空读成「没有悬着的记录」,于是再花一张。宿主进程死掉留下的锁,
|
|
453
|
+
只要老过三次点击的时间预算就会被接管。记录在结算后删除,且**不会因为过期而自动
|
|
454
|
+
丢弃**——一条旧记录正是阻止「答复丢失的那笔被重复花掉」的唯一凭据,所以清掉它必须
|
|
455
|
+
是人主动做的事,不能交给定时器。记录里的账号名用这家登录方式能提供的全部身份(id、
|
|
456
|
+
邮箱、uid)再加上密钥的哈希;磁盘上不会出现密钥本身。
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
magpie quota action opendesign use-reset
|
|
460
|
+
magpie quota action opendesign/<账号> use-reset # 这个供应商下有多个账号时
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
不会因为定时、读用量或任何请求自动花卡,只有点 **用一张重置卡** 或敲上面这条
|
|
464
|
+
命令时才会花。**获取重置卡** 只是打开一个页面,不花卡。用 API key 登录的账号会
|
|
465
|
+
被告知需要账号登录,因为控制面不接受 API key。
|
|
466
|
+
|
|
467
|
+
有两件事没有验证过,因为写这个插件的账号手上没有卡:一次真正成功的花卡,以及
|
|
468
|
+
`/api/v1/reset-operations/{id}` 的真实响应体。上面的形状是从官方控制台读出来的。
|
|
469
|
+
如果真实返回体是另一种形状,插件会一直报「未确认」并保留记录——它宁可卡在这里让
|
|
470
|
+
人去查,也不会把读不懂的当「没花掉」再花一张。要恢复,删掉
|
|
471
|
+
`opendesign-reset-pending.json` 里对应那条即可——但删之前先去控制台核对:那条记录
|
|
472
|
+
可能就对应一张**确实已经用掉**的卡,删掉之后,下一次点击就没有东西拦着它再花一张
|
|
473
|
+
了。
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
另有一条已知限制,它会真的多花一张卡。记录是按「这次登录有哪几个名字」去找的,而粘贴的控制密钥只有它自己的哈希当名字。同一个 OpenDesign 账号先用 OAuth 登录(有邮箱或账号 id),再用另一把控制密钥登进第二个 magpie 账号,两边名字没有交集——在一边丢了答复的那一笔,另一边看不见,点下去就花掉下一张。换一个操作系统用户、换一个 home 目录、或者走 WSL,也是同一个盲区,因为记录只存在某个用户自己的目录里。文件里没有任何明文密钥:存的是账号名、卡号、工作区号、操作号,以及一段哈希的前 16 位。
|