@magpie-community/opencode-zcode-auth 0.1.41 → 0.1.42

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.
Files changed (3) hide show
  1. package/README.md +9 -8
  2. package/index.mjs +6 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -136,14 +136,15 @@ never read or buffered on the way.
136
136
 
137
137
  **Free first.** Picking `-Trial` by hand keeps the choice the user's,
138
138
  but an agent that always asks the plain model never sees the gift.
139
- `freeFirst` turns the preference around: the plain model spends the
140
- account's own live gift first, and falls back to the coding plan when
141
- the gift cannot serve it — a bucket that is spent, a model the gift
142
- does not serve, no ZCode session, or the minute's rest a refusal just
143
- earned. Turn it on for the whole plugin in magpie's Plugins › Options
139
+ `freeFirst`, on by default since 0.1.42, turns the preference around:
140
+ the plain model spends the account's own live gift first, and falls
141
+ back to the coding plan when the gift cannot serve it — a bucket that
142
+ is spent, a model the gift does not serve, no ZCode session, or the
143
+ minute's rest a refusal just earned. Turn it off for the whole plugin
144
+ in magpie's Plugins › Options
144
145
 
145
146
  ```json
146
- { "freeFirst": true }
147
+ { "freeFirst": false }
147
148
  ```
148
149
 
149
150
  or on the provider alone, under `provider.zcode.options` in the config
@@ -271,8 +272,8 @@ once) and posts each plan to
271
272
  account's ZCode session, as the app does. An answer of nothing to claim
272
273
  carries an `until` half an hour out, so magpie's loop asks again then,
273
274
  and again, all day while neither list names a plan — two GETs, nothing
274
- posted: ZCode drops plans into the feed on its own schedule (a reset
275
- card, a weekend banner starting at 19:00 Beijing), and one that arrives
275
+ posted: ZCode drops plans into the feed on its own schedule (a weekend
276
+ banner starting at 19:00 Beijing, say), and one that arrives
276
277
  after the day's ask used to sit unclaimed past its short life. The
277
278
  other answers stand for the day: a claimed plan leaves the feed, so
278
279
  asking again half an hour later would find nothing and flip the card
package/index.mjs CHANGED
@@ -804,7 +804,7 @@ async function toClaim(s) {
804
804
 
805
805
  // RECHECK is how long an "nothing to claim" stands before magpie's loop
806
806
  // asks again: ZCode drops gift plans into the feed during the day (a
807
- // reset card, a weekend banner) on its own schedule, and the day's ask
807
+ // weekend banner, say) on its own schedule, and the day's ask
808
808
  // may have run hours before, so an inactive settled for the day lets a
809
809
  // plan sit unclaimed past its short life (the weekend plan of
810
810
  // testdata/touch-1030-wk.json starts 19:00 Beijing). `until` wakes the
@@ -2241,9 +2241,12 @@ export async function ZCodeAuthPlugin({ client }, options = {}) {
2241
2241
  }
2242
2242
  // freeFirst reads the option from the provider config's options first,
2243
2243
  // and from the plugin's own (magpie's Plugins › Options) when the
2244
- // provider carries no freeFirst of its own.
2244
+ // provider carries no freeFirst of its own. It is on unless one of them
2245
+ // says false: a gift ZCode hands out (each weekend, sgfvdsg86265 on X)
2246
+ // lapses unused behind an agent that asks the plain model, and every
2247
+ // failure of the gift is answered from the plan.
2245
2248
  const freeFirst = (providerOptions) =>
2246
- providerOptions?.freeFirst !== undefined ? providerOptions.freeFirst === true : options?.freeFirst === true
2249
+ providerOptions?.freeFirst !== undefined ? providerOptions.freeFirst !== false : options?.freeFirst !== false
2247
2250
  const oauth = (site) => ({
2248
2251
  type: "oauth",
2249
2252
  label: `ZCode: ${SITES[site].name}${site === "bigmodel" ? " (智谱)" : ""} GLM Coding Plan`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-zcode-auth",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan, and claims its gift plans daily",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",