@wilm-ai/wilma-cli 1.6.0 → 1.6.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.
Files changed (4) hide show
  1. package/README.md +28 -0
  2. package/dist/index.js +12 -2
  3. package/package.json +11 -10
  4. package/LICENSE +0 -21
package/README.md CHANGED
@@ -99,6 +99,34 @@ If you've saved your TOTP secret via interactive setup, `--totp-secret` is not n
99
99
  Local config is stored in `~/.config/wilmai/config.json` (or `$XDG_CONFIG_HOME/wilmai/config.json`).
100
100
  Use `wilma config clear` to remove it. Override with `WILMAI_CONFIG_PATH`.
101
101
 
102
+ ## Troubleshooting: TLS errors on a managed laptop
103
+
104
+ A TLS certificate error means the network is intercepting TLS and re-signing with a
105
+ private root CA (common behind a corporate secure web gateway). Node ignores the OS
106
+ trust store, so `curl` and your browser keep working while every Wilma request fails.
107
+ A successful `npm install` is not evidence that TLS is healthy — the npm registry is
108
+ commonly exempt from inspection.
109
+
110
+ ```bash
111
+ NODE_USE_SYSTEM_CA=1 wilma summary --json # Node >=22.19 / >=24.6
112
+ node --use-system-ca "$(command -v wilma)" summary --json # Node >=22.15
113
+ NODE_EXTRA_CA_CERTS=/path/to/root-ca.pem wilma summary --json # explicit root
114
+ ```
115
+
116
+ Never use `NODE_TLS_REJECT_UNAUTHORIZED=0` — it turns verification off entirely.
117
+
118
+ With `--json`, transport failures carry a `code` and a `hint` alongside `status` and
119
+ `message`, so agents can branch on the cause:
120
+
121
+ ```json
122
+ {
123
+ "status": "error",
124
+ "message": "TLS certificate verification failed for https://example.inschool.fi (UNABLE_TO_GET_ISSUER_CERT_LOCALLY)",
125
+ "code": "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
126
+ "hint": "..."
127
+ }
128
+ ```
129
+
102
130
  ## Notes
103
131
  - Credentials and TOTP secrets are stored with lightweight obfuscation for convenience.
104
132
  - For multi-child accounts, you can pass `--student <id|name>` or `--all-students`.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { readFile, writeFile, mkdir, open, rm } from "node:fs/promises";
6
6
  import { spawn } from "node:child_process";
7
7
  import { homedir } from "node:os";
8
8
  import { dirname, resolve } from "node:path";
9
- import { WilmaClient, MfaRequiredError, listTenants, } from "@wilm-ai/wilma-client";
9
+ import { WilmaClient, MfaRequiredError, NetworkError, listTenants, } from "@wilm-ai/wilma-client";
10
10
  import { clearConfig, getConfigPath, loadConfig, obfuscateSecret, revealSecret, saveConfig, } from "./config.js";
11
11
  // Enable keypress events for escape key detection
12
12
  if (process.stdin.isTTY) {
@@ -2008,11 +2008,21 @@ main().catch((err) => {
2008
2008
  process.exit(1);
2009
2009
  }
2010
2010
  const message = err instanceof Error ? err.message : String(err);
2011
+ const isNetwork = err instanceof NetworkError;
2011
2012
  if (process.argv.includes("--json")) {
2012
- console.log(JSON.stringify({ status: "error", message }, null, 2));
2013
+ console.log(JSON.stringify({
2014
+ status: "error",
2015
+ message,
2016
+ ...(isNetwork && err.code ? { code: err.code } : {}),
2017
+ ...(isNetwork && err.hint ? { hint: err.hint } : {}),
2018
+ }, null, 2));
2013
2019
  }
2014
2020
  else {
2015
2021
  console.error("CLI error:", message);
2022
+ if (isNetwork && err.hint) {
2023
+ console.error("");
2024
+ console.error(err.hint);
2025
+ }
2016
2026
  }
2017
2027
  process.exit(1);
2018
2028
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wilm-ai/wilma-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,9 +8,17 @@
8
8
  "wilmai": "dist/index.js",
9
9
  "wilma": "dist/index.js"
10
10
  },
11
+ "scripts": {
12
+ "build": "tsc -p tsconfig.json",
13
+ "lint": "echo 'add lint'",
14
+ "test": "pnpm --filter @wilm-ai/wilma-client build && pnpm run build && node test/news-resources.mjs",
15
+ "start": "node dist/index.js",
16
+ "prepack": "pnpm --filter @wilm-ai/wilma-client build && pnpm --filter @wilm-ai/wilma-cli build",
17
+ "test:live": "tsc -p tsconfig.json && node test/live.spec.mjs"
18
+ },
11
19
  "dependencies": {
12
20
  "@inquirer/prompts": "^5.3.8",
13
- "@wilm-ai/wilma-client": "^1.5.0"
21
+ "@wilm-ai/wilma-client": "^1.5.1"
14
22
  },
15
23
  "devDependencies": {
16
24
  "typescript": "^5.6.3"
@@ -21,12 +29,5 @@
21
29
  ],
22
30
  "publishConfig": {
23
31
  "access": "public"
24
- },
25
- "scripts": {
26
- "build": "tsc -p tsconfig.json",
27
- "lint": "echo 'add lint'",
28
- "test": "pnpm --filter @wilm-ai/wilma-client build && pnpm run build && node test/news-resources.mjs",
29
- "start": "node dist/index.js",
30
- "test:live": "tsc -p tsconfig.json && node test/live.spec.mjs"
31
32
  }
32
- }
33
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Wilm.ai
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.