@hasna/skills 0.10.42 → 0.10.43

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
@@ -56,6 +56,11 @@ changes), when the profile holds a credential `skills login` did not store
56
56
  - An API key you already have: `printenv MY_SKILLS_KEY | skills login --api-key`
57
57
  reads it from stdin, verifies it and stores it. Nothing is echoed.
58
58
  - An email code instead of the browser: `skills login --email you@example.com`.
59
+ Interactive code input is masked. For an agent or headless terminal, first
60
+ request a code with `skills login --email you@example.com --json`, then send
61
+ the fresh code through stdin to `skills login --email you@example.com
62
+ --code-stdin --json`. This finishes the same sign-in without requesting another
63
+ code. Keep the code out of shell commands, arguments and logs.
59
64
  - Running `skills` in a terminal opens the interactive browser. It also works
60
65
  signed out and has the same account commands: `/login`, `/logout`, `/whoami`.
61
66
 
package/bin/index.js CHANGED
@@ -36868,7 +36868,7 @@ var package_default;
36868
36868
  var init_package = __esm(() => {
36869
36869
  package_default = {
36870
36870
  name: "@hasna/skills",
36871
- version: "0.10.42",
36871
+ version: "0.10.43",
36872
36872
  description: "Skills library for AI coding agents",
36873
36873
  type: "module",
36874
36874
  bin: {
@@ -83228,7 +83228,7 @@ async function persistSignIn(result2, origin, env3 = process.env, issuedBy = "si
83228
83228
  const created = await new RemoteSkillsAuthClient(origin).request("/api/auth/keys", {
83229
83229
  method: "POST",
83230
83230
  headers: { Authorization: `Bearer ${result2.token}` },
83231
- body: JSON.stringify({ name: "cli" })
83231
+ body: JSON.stringify({ name: "cli", scopes: HOSTED_CLI_API_KEY_SCOPES })
83232
83232
  });
83233
83233
  apiKey = isRecord7(created) && typeof created.key === "string" && created.key.trim() ? created.key : undefined;
83234
83234
  }
@@ -83441,13 +83441,22 @@ function openVerificationPage(url2, signInOrigin) {
83441
83441
  return false;
83442
83442
  }
83443
83443
  }
83444
- var SKILLS_CLI_DEVICE_CLIENT = "skills-cli", SLOW_DOWN_INCREMENT_MS = 5000, MIN_INTERVAL_MS = 1000, MAX_INTERVAL_MS = 60000, DEFAULT_INTERVAL_SECONDS = 5, DEFAULT_EXPIRES_IN_SECONDS = 900, LOOPBACK_HOSTS;
83444
+ var SKILLS_CLI_DEVICE_CLIENT = "skills-cli", HOSTED_CLI_API_KEY_SCOPES, SLOW_DOWN_INCREMENT_MS = 5000, MIN_INTERVAL_MS = 1000, MAX_INTERVAL_MS = 60000, DEFAULT_INTERVAL_SECONDS = 5, DEFAULT_EXPIRES_IN_SECONDS = 900, LOOPBACK_HOSTS;
83445
83445
  var init_sign_in = __esm(() => {
83446
83446
  init_transport();
83447
83447
  init_auth_store();
83448
83448
  init_fleet_credentials();
83449
83449
  init_instance_credentials();
83450
83450
  init_remote_auth();
83451
+ HOSTED_CLI_API_KEY_SCOPES = [
83452
+ "skills:read",
83453
+ "skills:run",
83454
+ "runs:read",
83455
+ "connectors:read",
83456
+ "connectors:write",
83457
+ "billing:read",
83458
+ "billing:write"
83459
+ ];
83451
83460
  LOOPBACK_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);
83452
83461
  });
83453
83462
 
@@ -117159,11 +117168,11 @@ async function doLogin(email5, code2, json3, target) {
117159
117168
  }
117160
117169
  if (!json3)
117161
117170
  console.log(source_default.green("\u2713 Code sent to " + email5));
117162
- if (json3 || !isTTY) {
117163
- console.log(JSON.stringify({ status: "code_sent", email: email5, message: `Check email for 6-digit code, then run: skills login --email ${email5} --code <CODE>${targetFlag(target)}` }));
117171
+ if (json3 || !isTTY || !process.stderr.isTTY) {
117172
+ console.log(JSON.stringify({ status: "code_sent", email: email5, message: `Supply the fresh six-digit code on stdin to: skills login --email ${email5} --code-stdin${targetFlag(target)}` }));
117164
117173
  return;
117165
117174
  }
117166
- const answer = await prompt(source_default.bold("Code: "));
117175
+ const answer = await promptCode();
117167
117176
  if (answer === null)
117168
117177
  return;
117169
117178
  code2 = answer;
@@ -117354,6 +117363,10 @@ Waiting for authentication...`));
117354
117363
  await finishSignIn(outcome.result, target, json3);
117355
117364
  }
117356
117365
  async function runLogin(options) {
117366
+ if (options.codeStdin && (!options.email || options.code !== undefined || options.apiKey !== undefined || options.device || options.poll)) {
117367
+ writeCommandError(new Error("--code-stdin requires --email and cannot be combined with --code, --api-key, --device or --poll"), "Invalid login options", options.json);
117368
+ return;
117369
+ }
117357
117370
  if (options.apiKey !== undefined && (options.device || options.poll || options.email || options.code)) {
117358
117371
  writeCommandError(new Error("--api-key cannot be combined with --device, --poll, --email or --code"), "Invalid login options", options.json);
117359
117372
  return;
@@ -117394,7 +117407,16 @@ async function runLogin(options) {
117394
117407
  writeCommandError(new Error("Email required. Use: skills login --email you@example.com"), "Email required", options.json);
117395
117408
  return;
117396
117409
  }
117397
- await doLogin(email5, options.code, options.json, target);
117410
+ let code2 = options.code;
117411
+ if (options.codeStdin) {
117412
+ try {
117413
+ code2 = await readCode();
117414
+ } catch (error61) {
117415
+ writeCommandError(error61, "Could not read the verification code", options.json);
117416
+ return;
117417
+ }
117418
+ }
117419
+ await doLogin(email5, code2, options.json, target);
117398
117420
  }
117399
117421
  async function runLogout(options) {
117400
117422
  const result2 = await signOut({ revoke: options.revoke, environmentProfile: getEnvironmentProfile() });
@@ -117473,7 +117495,7 @@ async function runWhoami(options) {
117473
117495
  }
117474
117496
  }
117475
117497
  function withLoginOptions(command) {
117476
- return command.option("--url <origin>", "Sign in to this Skills server instead of the default (your own instance)").option("--email <email>", "Sign in with an email code (non-interactive with --code)").option("--code <code>", "Verification code from the sign-in email").option("--api-key [key]", "Verify and store an API key; with no value, read it from stdin").option("--device", "Print a code to approve on another device; do not open a browser", false).option("--no-open", "Do not open a browser").option("--poll", "Wait for approval, resuming a pending `skills login --device` session", false).option("--poll-timeout-ms <ms>", "Maximum time to wait for approval").option("--json", "Output result as JSON", false);
117498
+ return command.option("--url <origin>", "Sign in to this Skills server instead of the default (your own instance)").option("--email <email>", "Sign in with an email code (non-interactive with --code-stdin)").option("--code <code>", "Legacy verification code argument; prefer --code-stdin to keep it out of shell history").option("--code-stdin", "Read a previously requested six-digit verification code from stdin").option("--api-key [key]", "Verify and store an API key; with no value, read it from stdin").option("--device", "Print a code to approve on another device; do not open a browser", false).option("--no-open", "Do not open a browser").option("--poll", "Wait for approval, resuming a pending `skills login --device` session", false).option("--poll-timeout-ms <ms>", "Maximum time to wait for approval").option("--json", "Output result as JSON", false);
117477
117499
  }
117478
117500
  function registerAccountCommands(parent) {
117479
117501
  withLoginOptions(parent.command("login").description("Sign in (browser by default; --device, --email or --api-key; --url for your own server)")).action(async (options) => runLogin(options));
@@ -117531,7 +117553,7 @@ function registerAuth(parent) {
117531
117553
  writeCommandError(error61, "Failed to add Skills publication scope", options.json);
117532
117554
  }
117533
117555
  });
117534
- withLoginOptions(auth.command("login").description("Sign in with browser/device code, email code or an API key (same as `skills login`)").option("--membership-id <id>", "Enroll an exact workspace membership into an explicit HASNA_PROFILE").option("--code-stdin", "Read a fresh six-digit code for workspace enrollment from stdin")).action(async (options) => {
117556
+ withLoginOptions(auth.command("login").description("Sign in with browser/device code, email code or an API key (same as `skills login`)").option("--membership-id <id>", "Enroll an exact workspace membership into an explicit HASNA_PROFILE")).action(async (options) => {
117535
117557
  if (options.membershipId !== undefined) {
117536
117558
  if (options.apiKey || options.device || options.code || options.poll || options.url) {
117537
117559
  writeCommandError(new Error("Workspace login uses email and --code-stdin; do not combine it with device, API key, --url or --code login."), "Invalid login options", options.json);
@@ -117540,10 +117562,6 @@ function registerAuth(parent) {
117540
117562
  await loginWorkspace({ email: options.email, codeStdin: options.codeStdin, json: options.json, membershipId: options.membershipId });
117541
117563
  return;
117542
117564
  }
117543
- if (options.codeStdin) {
117544
- writeCommandError(new Error("--code-stdin requires --membership-id for this login flow."), "Invalid login options", options.json);
117545
- return;
117546
- }
117547
117565
  await runLogin(options);
117548
117566
  });
117549
117567
  auth.command("signup").description("Create or sign in with your email (passwordless)").option("--url <origin>", "Sign up on this Skills server instead of the default (your own instance)").option("--email <email>", "Email address (non-interactive)").option("--code <code>", "Verification code (non-interactive)").option("--json", "Output result as JSON without prompting", false).action(async (options) => {
@@ -117582,6 +117600,7 @@ function registerAuth(parent) {
117582
117600
  var isTTY, DEFAULT_DEVICE_POLL_TIMEOUT_MS, CONFIG_HINT_STATUSES;
117583
117601
  var init_auth = __esm(() => {
117584
117602
  init_workspace_selection();
117603
+ init_customer_verification();
117585
117604
  init_workspace_profile();
117586
117605
  init_source();
117587
117606
  init_auth_store();
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env bun
1
2
  // @bun
2
3
  var __create = Object.create;
3
4
  var __getProtoOf = Object.getPrototypeOf;
package/bin/mcp.js CHANGED
@@ -20019,7 +20019,7 @@ var package_default;
20019
20019
  var init_package = __esm(() => {
20020
20020
  package_default = {
20021
20021
  name: "@hasna/skills",
20022
- version: "0.10.42",
20022
+ version: "0.10.43",
20023
20023
  description: "Skills library for AI coding agents",
20024
20024
  type: "module",
20025
20025
  bin: {
package/bin/migrate.js CHANGED
@@ -7,7 +7,7 @@ import { join as join5 } from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@hasna/skills",
10
- version: "0.10.42",
10
+ version: "0.10.43",
11
11
  description: "Skills library for AI coding agents",
12
12
  type: "module",
13
13
  bin: {
package/bin/server.js CHANGED
@@ -24122,7 +24122,7 @@ var init_dist_es9 = __esm(() => {
24122
24122
  // package.json
24123
24123
  var package_default = {
24124
24124
  name: "@hasna/skills",
24125
- version: "0.10.42",
24125
+ version: "0.10.43",
24126
24126
  description: "Skills library for AI coding agents",
24127
24127
  type: "module",
24128
24128
  bin: {
package/bin/worker.js CHANGED
@@ -24125,7 +24125,7 @@ import { randomUUID as randomUUID6 } from "crypto";
24125
24125
  // package.json
24126
24126
  var package_default = {
24127
24127
  name: "@hasna/skills",
24128
- version: "0.10.42",
24128
+ version: "0.10.43",
24129
24129
  description: "Skills library for AI coding agents",
24130
24130
  type: "module",
24131
24131
  bin: {
package/dist/index.js CHANGED
@@ -11040,7 +11040,7 @@ function replaceSkillSession(expected, replacement, plan, options = {}, beforeCo
11040
11040
  // package.json
11041
11041
  var package_default = {
11042
11042
  name: "@hasna/skills",
11043
- version: "0.10.42",
11043
+ version: "0.10.43",
11044
11044
  description: "Skills library for AI coding agents",
11045
11045
  type: "module",
11046
11046
  bin: {
package/dist/sdk/index.js CHANGED
@@ -32373,7 +32373,7 @@ var init_event_sink = __esm(() => {
32373
32373
  // package.json
32374
32374
  var package_default = {
32375
32375
  name: "@hasna/skills",
32376
- version: "0.10.42",
32376
+ version: "0.10.43",
32377
32377
  description: "Skills library for AI coding agents",
32378
32378
  type: "module",
32379
32379
  bin: {
@@ -1 +1,2 @@
1
+ #!/usr/bin/env bun
1
2
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.10.42",
3
+ "version": "0.10.43",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {