nia-wizard 0.1.28 → 0.1.30
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/README.md
CHANGED
|
@@ -166,8 +166,8 @@ This prints the canonical agent workflow:
|
|
|
166
166
|
|
|
167
167
|
1. Run `bun --version`
|
|
168
168
|
2. Install `@nozomioai/nia@latest` globally with Bun or npm
|
|
169
|
-
3. Tell the user to open `https://app.trynia.ai`
|
|
170
|
-
4. Tell the user to
|
|
169
|
+
3. Tell the user to open `https://app.trynia.ai/api-keys`
|
|
170
|
+
4. Tell the user to create an API key there
|
|
171
171
|
5. Ask the user to paste the `nk_...` key back to the agent
|
|
172
172
|
6. Run `nia auth login --api-key <nk_api_key>`
|
|
173
173
|
7. Run `nia skill --all`
|
package/dist/bin.js
CHANGED
|
@@ -9,7 +9,7 @@ var require_package = __commonJS({
|
|
|
9
9
|
"package.json"(exports, module) {
|
|
10
10
|
module.exports = {
|
|
11
11
|
name: "nia-wizard",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.30",
|
|
13
13
|
description: "CLI wizard to install Nia to your coding agents",
|
|
14
14
|
packageManager: "pnpm@10.30.3",
|
|
15
15
|
type: "module",
|
|
@@ -3341,6 +3341,7 @@ function dependenciesReady() {
|
|
|
3341
3341
|
import { spawnSync as spawnSync5 } from "child_process";
|
|
3342
3342
|
var NIA_CLI_PACKAGE = "@nozomioai/nia";
|
|
3343
3343
|
var LATEST_NIA_CLI_PACKAGE = `${NIA_CLI_PACKAGE}@latest`;
|
|
3344
|
+
var API_KEY_PATTERN = /^nk_[A-Za-z0-9_-]+$/;
|
|
3344
3345
|
function npmCommand() {
|
|
3345
3346
|
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
3346
3347
|
}
|
|
@@ -3357,17 +3358,21 @@ function hasCommand(command, args = ["--version"]) {
|
|
|
3357
3358
|
const result = spawnSync5(command, args, {
|
|
3358
3359
|
stdio: "pipe",
|
|
3359
3360
|
encoding: "utf-8",
|
|
3360
|
-
shell
|
|
3361
|
+
// On Windows, shell is needed to resolve .cmd shims (npm) via PATHEXT
|
|
3362
|
+
shell: process.platform === "win32"
|
|
3361
3363
|
});
|
|
3362
3364
|
debug(`${command} ${args.join(" ")} status`, result.status);
|
|
3363
3365
|
return result.status === 0;
|
|
3364
3366
|
}
|
|
3365
3367
|
function isNiaCliInstalled() {
|
|
3366
|
-
return hasCommand(
|
|
3368
|
+
return hasCommand("nia");
|
|
3367
3369
|
}
|
|
3368
3370
|
function hasBun() {
|
|
3369
3371
|
return hasCommand(bunCommand());
|
|
3370
3372
|
}
|
|
3373
|
+
function validateApiKey(apiKey) {
|
|
3374
|
+
return API_KEY_PATTERN.test(apiKey);
|
|
3375
|
+
}
|
|
3371
3376
|
function runLatestNia(args) {
|
|
3372
3377
|
if (hasBun()) {
|
|
3373
3378
|
const result2 = spawnSync5(bunxCommand(), ["-p", LATEST_NIA_CLI_PACKAGE, "nia", ...args], {
|
|
@@ -3378,7 +3383,7 @@ function runLatestNia(args) {
|
|
|
3378
3383
|
}
|
|
3379
3384
|
const result = spawnSync5(npxCommand(), ["-y", "-p", LATEST_NIA_CLI_PACKAGE, "nia", ...args], {
|
|
3380
3385
|
stdio: "inherit",
|
|
3381
|
-
shell:
|
|
3386
|
+
shell: process.platform === "win32"
|
|
3382
3387
|
});
|
|
3383
3388
|
return result.status === 0;
|
|
3384
3389
|
}
|
|
@@ -3398,7 +3403,7 @@ function ensureNiaCliInstalled() {
|
|
|
3398
3403
|
}) : spawnSync5(npmCommand(), ["install", "-g", LATEST_NIA_CLI_PACKAGE], {
|
|
3399
3404
|
stdio: "pipe",
|
|
3400
3405
|
encoding: "utf-8",
|
|
3401
|
-
shell:
|
|
3406
|
+
shell: process.platform === "win32"
|
|
3402
3407
|
});
|
|
3403
3408
|
if (installResult.status !== 0) {
|
|
3404
3409
|
installSpinner.stop("Failed to install @nozomioai/nia");
|
|
@@ -3427,6 +3432,10 @@ function runNiaSkill() {
|
|
|
3427
3432
|
return runLatestNia(["skill", "--all"]);
|
|
3428
3433
|
}
|
|
3429
3434
|
function runNiaAuthLogin(apiKey) {
|
|
3435
|
+
if (!validateApiKey(apiKey)) {
|
|
3436
|
+
clack_default.log.error("Invalid API key format. Keys should look like `nk_...` and contain only letters, numbers, `_`, or `-`.");
|
|
3437
|
+
return false;
|
|
3438
|
+
}
|
|
3430
3439
|
return runLatestNia(["auth", "login", "--api-key", apiKey]);
|
|
3431
3440
|
}
|
|
3432
3441
|
|
|
@@ -4036,9 +4045,9 @@ function getAgentGuideMarkdown() {
|
|
|
4036
4045
|
"",
|
|
4037
4046
|
"3. Tell the user to open this URL and sign in:",
|
|
4038
4047
|
"",
|
|
4039
|
-
"`https://app.trynia.ai`",
|
|
4048
|
+
"`https://app.trynia.ai/api-keys`",
|
|
4040
4049
|
"",
|
|
4041
|
-
"4. Tell the user to
|
|
4050
|
+
"4. Tell the user to create an API key on that page and copy the `nk_...` token.",
|
|
4042
4051
|
"",
|
|
4043
4052
|
"5. Ask the user to paste the API key back into the agent chat or session.",
|
|
4044
4053
|
"",
|
|
@@ -4058,7 +4067,7 @@ function getAgentGuideMarkdown() {
|
|
|
4058
4067
|
"",
|
|
4059
4068
|
"Send the user a message like this:",
|
|
4060
4069
|
"",
|
|
4061
|
-
"> I need your Nia API key to finish setup. Please open https://app.trynia.ai, sign in,
|
|
4070
|
+
"> I need your Nia API key to finish setup. Please open https://app.trynia.ai/api-keys, sign in, create a key, and paste the `nk_...` value here. Once you send it, I will finish the setup for you.",
|
|
4062
4071
|
"",
|
|
4063
4072
|
"## Expected Result",
|
|
4064
4073
|
"",
|
|
@@ -4089,4 +4098,4 @@ export {
|
|
|
4089
4098
|
getAgentGuideMarkdown,
|
|
4090
4099
|
printAgentGuide
|
|
4091
4100
|
};
|
|
4092
|
-
//# sourceMappingURL=chunk-
|
|
4101
|
+
//# sourceMappingURL=chunk-FFW4MJGP.js.map
|