@coswic/aipay 0.7.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @coswic/aipay
2
2
 
3
+ ## 0.7.2 — 2026-10-09
4
+
5
+ - README: describe AI-Pay's invitation-only beta instead of self sign-up seats (only invited users can create an account; public registration is not open; your users must be invited before their first sign-in through your app; production does not accept top-ups at the moment), and explain what `aipay test` and the developer commands do when the user or the developer account is not invited. No behavior change.
6
+ - Depends on `@coswic/aipay-sdk` ^0.4.2 (documentation release).
7
+
8
+ ## 0.7.1 — 2026-09-30
9
+
10
+ - `aipay test`: when the completion step returns 402 `insufficient_balance`, the hint now says nothing was charged and that the app should tell the user their AI credit is insufficient, instead of telling the developer to top up in the Console.
11
+ - README: describe AI-Pay's free beta instead of invited testing (production does not accept top-ups at the moment), point to the environment's own API base and authorization server, and link the product and developer documentation.
12
+
13
+ ## 0.7.0 — 2026-09-11
14
+
15
+ - `aipay region set` accepts a full US address (`--line1`, `--line2`, `--city`, `--zip`, required for US accounts), and `aipay region` shows the address and the resolved sales-tax jurisdiction.
16
+
17
+ ## 0.6.0 — 2026-09-11
18
+
19
+ - Add `aipay region` and `aipay region set --country CC [--state US-XX] --accept-terms` to declare the developer account's region non-interactively; a `403 region_required` from the developer API is reported with the fix.
20
+
3
21
  ## 0.5.0 — 2026-09-08
4
22
 
5
23
  - Add `apps callbacks list/add/remove` with the developer’s own management authorization and linked-project defaults.
package/README.md CHANGED
@@ -9,6 +9,17 @@ npx @coswic/aipay@latest init --app <client_id> --auth <authorization server> --
9
9
  npx @coswic/aipay test
10
10
  ```
11
11
 
12
+ ## Documentation and links
13
+
14
+ - **Developer guide**: https://ai-pay.coswic.ai/docs?lang=en — the CLI section lists every command; its Markdown edition (https://ai-pay.coswic.ai/docs.md?lang=en) is what `aipay init` saves as `aipay-agent.md` for your coding agent.
15
+ - **SDK**: [`@coswic/aipay-sdk`](https://www.npmjs.com/package/@coswic/aipay-sdk) — installed by `aipay init`.
16
+ - **Models and prices**: https://ai-pay.coswic.ai/models?lang=en · **API contract**: https://ai-pay.coswic.ai/openapi.yaml
17
+ - **Product overview and what is open today**: https://ai-pay.coswic.ai/about?lang=en
18
+
19
+ AI-Pay's production environment is in a free beta limited to invited users: only invited users can create an account and use the service, public registration is not open, and your users must also be invited before their first sign-in through your app's "Sign in with AI-Pay". Production does not accept top-ups at the moment. `<api base>` and `<authorization server>` are the endpoints of the environment you integrate with — the developer guide fetched from that environment has both filled in.
20
+
21
+ `aipay test` signs in as a real user: during the invitation-only beta that user must already hold an invitation (and have accepted the latest Terms), otherwise the sign-in never reaches the callback and `test` ends with the loopback timeout. The developer account you use with `aipay login` must be invited too; otherwise the developer commands keep answering 401 ("run `aipay login` again").
22
+
12
23
  ## Commands
13
24
 
14
25
  | Command | What it does |
@@ -112,4 +123,9 @@ pnpm --filter @coswic/aipay test
112
123
  pnpm --filter @coswic/aipay build
113
124
  ```
114
125
 
126
+ Tests use a fresh temporary token directory and force file storage for each case, so a local
127
+ developer login or OS keychain cannot affect the suite. Tests that pass an explicit `env`
128
+ must also provide a temporary `AIPAY_CONFIG_DIR` and `AIPAY_TOKEN_STORE=file`; an empty
129
+ `env` falls back to the real home directory. Temporary credentials are removed after each test.
130
+
115
131
  Zero runtime dependencies besides the SDK. Node 20+.
@@ -120,7 +120,7 @@ export async function runTest(args, out, deps = {}) {
120
120
  catch (e) {
121
121
  if (e instanceof InsufficientBalanceError) {
122
122
  result.completion = { error: 'insufficient_balance' };
123
- out.line('warn', 'signed in fine, but this account has no balance for a completion — top up in the Console and rerun');
123
+ out.line('warn', 'signed in fine, but this account does not have enough AI credit for a completion (402 insufficient_balance; nothing was charged) — in your app, tell the user their AI credit is insufficient; rerun with an account that has credit');
124
124
  await reportSetupEvent(project.app.client_id, 'cli.test', { ok: false, error_code: 'insufficient_balance' }, out, env);
125
125
  out.result(result);
126
126
  return EXIT.problem;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@coswic/aipay",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "AI-Pay CLI — developer sign-in, App and callback management, project integration, diagnostics, and real sign-in + AI receipt verification.",
5
5
  "license": "MIT",
6
+ "homepage": "https://ai-pay.coswic.ai/docs?lang=en",
6
7
  "type": "module",
7
8
  "bin": {
8
9
  "aipay": "./dist/bin.js"
@@ -25,7 +26,7 @@
25
26
  "node": ">=20"
26
27
  },
27
28
  "dependencies": {
28
- "@coswic/aipay-sdk": "^0.3.2"
29
+ "@coswic/aipay-sdk": "^0.4.2"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@types/node": "^26.1.1",