@coswic/aipay 0.7.0 → 0.7.1

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,18 @@
1
1
  # @coswic/aipay
2
2
 
3
+ ## 0.7.1 — 2026-09-30
4
+
5
+ - `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.
6
+ - 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.
7
+
8
+ ## 0.7.0 — 2026-09-11
9
+
10
+ - `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.
11
+
12
+ ## 0.6.0 — 2026-09-11
13
+
14
+ - 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.
15
+
3
16
  ## 0.5.0 — 2026-09-08
4
17
 
5
18
  - Add `apps callbacks list/add/remove` with the developer’s own management authorization and linked-project defaults.
package/README.md CHANGED
@@ -9,6 +9,15 @@ 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: signing in with a Google account for the first time creates an account while self sign-up seats last; once they are full, only invited emails can create an account. 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
+
12
21
  ## Commands
13
22
 
14
23
  | Command | What it does |
@@ -112,4 +121,9 @@ pnpm --filter @coswic/aipay test
112
121
  pnpm --filter @coswic/aipay build
113
122
  ```
114
123
 
124
+ Tests use a fresh temporary token directory and force file storage for each case, so a local
125
+ developer login or OS keychain cannot affect the suite. Tests that pass an explicit `env`
126
+ must also provide a temporary `AIPAY_CONFIG_DIR` and `AIPAY_TOKEN_STORE=file`; an empty
127
+ `env` falls back to the real home directory. Temporary credentials are removed after each test.
128
+
115
129
  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.1",
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.1"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@types/node": "^26.1.1",