@keystrokehq/cli 0.0.104 → 0.0.106
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 +1 -1
- package/dist/index.mjs +29 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ keystroke auth logout
|
|
|
35
35
|
| `platformUrl` | `https://api.keystroke.ai` | Platform API (direct; used by CLI platform commands) |
|
|
36
36
|
| `serverUrl` | `http://localhost:3001` | Local keystroke server API (`keystroke dev` / `keystroke start`) |
|
|
37
37
|
|
|
38
|
-
`auth login` persists both `webUrl` and `platformUrl`. Local dev: `--web-url http://localhost:3000` (platform URL resolves to `http://localhost:3002`). Cloud auth does not change `serverUrl` — local project commands still hit your dev server.
|
|
38
|
+
`auth login` persists both `webUrl` and `platformUrl`. Omit `--web-url` to always reset to production defaults (`https://app.keystroke.ai` / `https://api.keystroke.ai`), even if a previous login pointed at localhost. Local dev: `--web-url http://localhost:3000` (platform URL resolves to `http://localhost:3002`). Cloud auth does not change `serverUrl` — local project commands still hit your dev server.
|
|
39
39
|
|
|
40
40
|
Existing commands do not require auth yet. Use `resolveCliAuth()` when adding protected commands.
|
|
41
41
|
|
package/dist/index.mjs
CHANGED
|
@@ -11849,7 +11849,7 @@ function registerCredentialsCommand(program) {
|
|
|
11849
11849
|
/** OAuth device-flow client id for `keystroke auth login`. */
|
|
11850
11850
|
const CLI_CLIENT_ID = "keystroke-cli";
|
|
11851
11851
|
//#endregion
|
|
11852
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
11852
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/version.mjs
|
|
11853
11853
|
const PACKAGE_VERSION = "1.6.11";
|
|
11854
11854
|
//#endregion
|
|
11855
11855
|
//#region ../../node_modules/.pnpm/better-call@1.3.5_zod@4.4.3/node_modules/better-call/dist/error.mjs
|
|
@@ -11974,7 +11974,7 @@ var BetterAuthError = class extends Error {
|
|
|
11974
11974
|
}
|
|
11975
11975
|
};
|
|
11976
11976
|
//#endregion
|
|
11977
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
11977
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
|
|
11978
11978
|
const deviceAuthorizationClient = () => {
|
|
11979
11979
|
return {
|
|
11980
11980
|
id: "device-authorization",
|
|
@@ -12119,7 +12119,7 @@ let onMount = ($store, initialize) => {
|
|
|
12119
12119
|
});
|
|
12120
12120
|
};
|
|
12121
12121
|
//#endregion
|
|
12122
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12122
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/query.mjs
|
|
12123
12123
|
const isServer = () => typeof window === "undefined";
|
|
12124
12124
|
const useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
12125
12125
|
const value = /* @__PURE__ */ atom({
|
|
@@ -12213,7 +12213,7 @@ const useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
|
12213
12213
|
return value;
|
|
12214
12214
|
};
|
|
12215
12215
|
//#endregion
|
|
12216
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12216
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
12217
12217
|
const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
12218
12218
|
const now$1 = () => Math.floor(Date.now() / 1e3);
|
|
12219
12219
|
var WindowBroadcastChannel = class {
|
|
@@ -12256,7 +12256,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
|
12256
12256
|
return globalThis[kBroadcastChannel];
|
|
12257
12257
|
}
|
|
12258
12258
|
//#endregion
|
|
12259
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12259
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
12260
12260
|
const kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
12261
12261
|
var WindowFocusManager = class {
|
|
12262
12262
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -12285,7 +12285,7 @@ function getGlobalFocusManager() {
|
|
|
12285
12285
|
return globalThis[kFocusManager];
|
|
12286
12286
|
}
|
|
12287
12287
|
//#endregion
|
|
12288
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12288
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/online-manager.mjs
|
|
12289
12289
|
const kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
12290
12290
|
var WindowOnlineManager = class {
|
|
12291
12291
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -12317,7 +12317,7 @@ function getGlobalOnlineManager() {
|
|
|
12317
12317
|
return globalThis[kOnlineManager];
|
|
12318
12318
|
}
|
|
12319
12319
|
//#endregion
|
|
12320
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12320
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/parser.mjs
|
|
12321
12321
|
const PROTO_POLLUTION_PATTERNS = {
|
|
12322
12322
|
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
12323
12323
|
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
@@ -12387,7 +12387,7 @@ function parseJSON(value, options = { strict: true }) {
|
|
|
12387
12387
|
return betterJSONParse(value, options);
|
|
12388
12388
|
}
|
|
12389
12389
|
//#endregion
|
|
12390
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12390
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
12391
12391
|
const now = () => Math.floor(Date.now() / 1e3);
|
|
12392
12392
|
/**
|
|
12393
12393
|
* Normalize $fetch response: `throw: true` returns data directly, otherwise `{ data, error }`.
|
|
@@ -12585,7 +12585,7 @@ Object.freeze({
|
|
|
12585
12585
|
}
|
|
12586
12586
|
});
|
|
12587
12587
|
//#endregion
|
|
12588
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12588
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/url.mjs
|
|
12589
12589
|
function checkHasPath(url) {
|
|
12590
12590
|
try {
|
|
12591
12591
|
return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
|
|
@@ -12657,7 +12657,7 @@ function getOrigin(url) {
|
|
|
12657
12657
|
}
|
|
12658
12658
|
}
|
|
12659
12659
|
//#endregion
|
|
12660
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12660
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
12661
12661
|
const redirectPlugin = {
|
|
12662
12662
|
id: "redirect",
|
|
12663
12663
|
name: "Redirect",
|
|
@@ -12672,7 +12672,7 @@ const redirectPlugin = {
|
|
|
12672
12672
|
} }
|
|
12673
12673
|
};
|
|
12674
12674
|
//#endregion
|
|
12675
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
12675
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/session-atom.mjs
|
|
12676
12676
|
function getSessionAtom($fetch, options) {
|
|
12677
12677
|
const $signal = /* @__PURE__ */ atom(false);
|
|
12678
12678
|
const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
|
|
@@ -13159,7 +13159,7 @@ var betterFetch = async (url, options) => {
|
|
|
13159
13159
|
};
|
|
13160
13160
|
};
|
|
13161
13161
|
//#endregion
|
|
13162
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
13162
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/config.mjs
|
|
13163
13163
|
const resolvePublicAuthUrl = (basePath) => {
|
|
13164
13164
|
if (typeof process === "undefined") return void 0;
|
|
13165
13165
|
const path = basePath ?? "/api/auth";
|
|
@@ -13257,12 +13257,12 @@ const getClientConfig = (options, loadEnv) => {
|
|
|
13257
13257
|
};
|
|
13258
13258
|
};
|
|
13259
13259
|
//#endregion
|
|
13260
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
13260
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
13261
13261
|
function isAtom(value) {
|
|
13262
13262
|
return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
|
|
13263
13263
|
}
|
|
13264
13264
|
//#endregion
|
|
13265
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
13265
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/proxy.mjs
|
|
13266
13266
|
function getMethod(path, knownPathMethods, args) {
|
|
13267
13267
|
const method = knownPathMethods[path];
|
|
13268
13268
|
const { fetchOptions, query: _query, ...body } = args || {};
|
|
@@ -13342,7 +13342,7 @@ function capitalizeFirstLetter(str) {
|
|
|
13342
13342
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
13343
13343
|
}
|
|
13344
13344
|
//#endregion
|
|
13345
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.
|
|
13345
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.11_@tanstack+react-start@1.168.25_crossws@0.4.5_srvx@0.11.15__react-dom_58475d05a96f62cc1b6c1cd2acbead1f/node_modules/better-auth/dist/client/vanilla.mjs
|
|
13346
13346
|
function createAuthClient(options) {
|
|
13347
13347
|
const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
|
|
13348
13348
|
const resolvedHooks = {};
|
|
@@ -13428,15 +13428,23 @@ async function getSessionWithBearer(baseURL, accessToken) {
|
|
|
13428
13428
|
};
|
|
13429
13429
|
}
|
|
13430
13430
|
//#endregion
|
|
13431
|
+
//#region src/auth/resolve-login-targets.ts
|
|
13432
|
+
function resolveAuthLoginTargets(options, config) {
|
|
13433
|
+
const webUrl = options.webUrl ?? "https://app.keystroke.ai";
|
|
13434
|
+
return {
|
|
13435
|
+
webUrl,
|
|
13436
|
+
platformUrl: resolvePlatformUrlForWebUrl(webUrl, {
|
|
13437
|
+
platformUrl: options.platformUrl,
|
|
13438
|
+
fallback: options.webUrl ? getPlatformUrl(config) : DEFAULT_PLATFORM_URL
|
|
13439
|
+
})
|
|
13440
|
+
};
|
|
13441
|
+
}
|
|
13442
|
+
//#endregion
|
|
13431
13443
|
//#region src/commands/auth/login.ts
|
|
13432
13444
|
function registerAuthLoginCommand(auth) {
|
|
13433
|
-
auth.command("login").description("Authenticate via browser device flow").option("--web-url <url>", "Web dashboard origin (
|
|
13445
|
+
auth.command("login").description("Authenticate via browser device flow").option("--web-url <url>", "Web dashboard origin (omit to use production defaults; local dev: http://localhost:3000)").option("--platform-url <url>", "Platform API origin (derived from web URL when omitted)").option("--org <id>", "Active organization id (skips prompt when you belong to several)").action(async (options) => {
|
|
13434
13446
|
const config = createCliConfig();
|
|
13435
|
-
const webUrl = options
|
|
13436
|
-
const platformUrl = resolvePlatformUrlForWebUrl(webUrl, {
|
|
13437
|
-
platformUrl: options.platformUrl,
|
|
13438
|
-
fallback: getPlatformUrl(config)
|
|
13439
|
-
});
|
|
13447
|
+
const { webUrl, platformUrl } = resolveAuthLoginTargets(options, config);
|
|
13440
13448
|
config.set("webUrl", webUrl);
|
|
13441
13449
|
config.set("platformUrl", platformUrl);
|
|
13442
13450
|
try {
|