@mtreeai/msapling-cli 2.3.6-beta.11 → 2.3.6-beta.12

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 (2) hide show
  1. package/dist/index.js +22 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8045,18 +8045,24 @@ async function promptPassword(prompt) {
8045
8045
  stdin.on("data", onData);
8046
8046
  });
8047
8047
  }
8048
- async function loginWithEmailPassword(email, context) {
8048
+ async function loginWithEmailPassword(email, context, preSuppliedPassword) {
8049
8049
  context.addMessage("system", `Logging in as ${email}...`);
8050
- let password = "";
8051
- try {
8052
- password = await promptPassword("Password: ");
8053
- if (!password) {
8054
- context.addMessage("system", "Login cancelled.");
8050
+ let password = preSuppliedPassword || process.env.MSAPLING_PASSWORD || "";
8051
+ if (!password) {
8052
+ context.addMessage(
8053
+ "system",
8054
+ "NOTE: the interactive password prompt is known to leak keystrokes into the REPL input. Safer alternatives: /login <email> <password> OR set MSAPLING_PASSWORD env var OR use /login <token>."
8055
+ );
8056
+ try {
8057
+ password = await promptPassword("Password: ");
8058
+ if (!password) {
8059
+ context.addMessage("system", "Login cancelled.");
8060
+ return;
8061
+ }
8062
+ } catch (err) {
8063
+ context.addMessage("error", `Password prompt failed: ${err}`);
8055
8064
  return;
8056
8065
  }
8057
- } catch (err) {
8058
- context.addMessage("error", `Password prompt failed: ${err}`);
8059
- return;
8060
8066
  }
8061
8067
  try {
8062
8068
  const result = await context.client.loginEmailPassword(email, password);
@@ -8184,10 +8190,10 @@ var init_login = __esm({
8184
8190
  context.addMessage(
8185
8191
  "system",
8186
8192
  `Usage:
8187
- /login your@email.com Sign in with email + password
8188
- /login github GitHub device flow
8189
- /login guest Anonymous guest session (limited tier)
8190
- /login <token> Paste an API token from msapling.com \u2192 Settings \u2192 API Keys`
8193
+ /login your@email.com [pwd] Sign in with email + password (pwd may also come from MSAPLING_PASSWORD env var)
8194
+ /login github GitHub device flow
8195
+ /login guest Anonymous guest session (limited tier)
8196
+ /login <token> Paste an API token from msapling.com \u2192 Settings \u2192 API Keys`
8191
8197
  );
8192
8198
  return;
8193
8199
  }
@@ -8196,7 +8202,8 @@ var init_login = __esm({
8196
8202
  } else if (arg === "guest") {
8197
8203
  await loginAsGuest(context);
8198
8204
  } else if (isEmailAddress(arg)) {
8199
- await loginWithEmailPassword(arg, context);
8205
+ const inlinePassword = args2[1];
8206
+ await loginWithEmailPassword(arg, context, inlinePassword);
8200
8207
  } else if (isTokenLike(arg)) {
8201
8208
  await context.storage.saveToken(arg);
8202
8209
  context.client.setToken(arg);
@@ -13288,7 +13295,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
13288
13295
  var Header = () => /* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
13289
13296
  /* @__PURE__ */ jsxs(Text, { bold: true, color: "cyan", children: [
13290
13297
  "\u25CF MSapling CLI v",
13291
- "2.3.6-beta.11"
13298
+ "2.3.6-beta.12"
13292
13299
  ] }),
13293
13300
  /* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "Platinum Tier Architecture" }) })
13294
13301
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtreeai/msapling-cli",
3
- "version": "2.3.6-beta.11",
3
+ "version": "2.3.6-beta.12",
4
4
  "description": "MSapling CLI — React/Ink terminal client for the MSapling backend (chat, projects, MDrive, agent tools). Proprietary; redistribution prohibited.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "MSapling Team",