@magpie-community/opencode-qoder-auth 0.2.31 → 0.2.32

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 +7 -0
  2. package/index.mjs +11 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -296,6 +296,13 @@ the account's credentials.
296
296
  - A helper that is there but can't be read, or gives an invalid identity,
297
297
  is `failed` and asked again later, rather than a false "no activity"
298
298
  result.
299
+ - With the identity read and sent, a list with no daily claim is
300
+ `inactive`, with a message (since 0.2.32) saying Qoder offered this
301
+ device's identity no daily credits campaign, that Qoder decides that per
302
+ device, and that the credits can be claimed in Qoder desktop when it
303
+ shows them (#304: a Linux CLI identity was offered none while the same
304
+ account's desktop identity was). The plugin never sends another
305
+ device's identity.
299
306
 
300
307
  Qoder CN (since 0.2.30) sends its own device identity the same way when
301
308
  Qoder CN is installed: its desktop 0.4.9 and CLI (`qoderclicn`) both ask
package/index.mjs CHANGED
@@ -1655,6 +1655,12 @@ class RuntimeMissing extends Error {
1655
1655
  }
1656
1656
  }
1657
1657
 
1658
+ // noCampaign is why a check-in asked with this machine's own device
1659
+ // identity found nothing to claim: all the list says is that it offered
1660
+ // that identity no daily credits, not why.
1661
+ const noCampaign = (name) =>
1662
+ `${name} check-in: ${name} offered this device's identity, read from this machine's own ${name} runtime-info, no daily credits campaign right now. ${name} decides per device whether to offer it; if ${name} desktop shows today's credits, claim them there`
1663
+
1658
1664
  // Read the SDK identity as Qoder does: environment 3 is international, 0
1659
1665
  // Qoder CN; on Windows and macOS the uid goes over stdin, never into the
1660
1666
  // command line.
@@ -2094,7 +2100,11 @@ const makePlugin = (site) => async ({ client }) => {
2094
2100
  // (no Qoder CN on this machine) or ask again (it didn't answer).
2095
2101
  if (unread instanceof RuntimeMissing) return { outcome: "ineligible", message: unread.message }
2096
2102
  if (unread) return { outcome: "failed", message: unread.message }
2097
- return { outcome: "inactive" }
2103
+ // Asked with this machine's own identity and still offered nothing:
2104
+ // Qoder decides per device (plugins#304, a Linux CLI identity was
2105
+ // offered none while the same account's desktop identity was), so
2106
+ // say that much, and where the credits can still be claimed.
2107
+ return { outcome: "inactive", message: noCampaign(site.name) }
2098
2108
  }
2099
2109
  const claimRes = await call(base.replace(/\/$/, "") + "/" + encodeURIComponent(campaign.campaignId) + "/claim", "POST", "{}")
2100
2110
  let claim = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-qoder-auth",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Qoder subscriptions in OpenCode and magpie: Qoder (qoder.com) and Qoder CN (qoder.cn)",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",