@vibecodr/cli 0.2.0 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2
4
+
5
+ - show command-specific help for nested `vibecodr pulse <command> --help|-h|-help` requests
6
+
7
+ ## 0.2.1
8
+
9
+ - preserve encrypted offline sessions when refresh fails because the authorization server is temporarily unavailable
10
+ - continue clearing stored auth on OAuth `invalid_grant` so revoked or expired refresh tokens fail closed
11
+
3
12
  ## 0.2.0
4
13
 
5
14
  - rename the npm package to `@vibecodr/cli` while keeping `vibecodr` as the primary executable and `vibecodr-mcp` as a compatibility alias
@@ -23,6 +23,12 @@ function computeExpiresAt(expiresIn) {
23
23
  return undefined;
24
24
  return new Date(Date.now() + expiresIn * 1000).toISOString();
25
25
  }
26
+ function oauthErrorCode(error) {
27
+ if (!error || typeof error !== "object")
28
+ return undefined;
29
+ const code = error.errorCode;
30
+ return typeof code === "string" ? code : undefined;
31
+ }
26
32
  function normalizeServerUrlForSessionMatch(value) {
27
33
  if (!value)
28
34
  return undefined;
@@ -285,10 +291,17 @@ export class TokenManager {
285
291
  resource,
286
292
  ...(discovery.authorizationServerMetadata ? { metadata: discovery.authorizationServerMetadata } : {})
287
293
  }).catch(async (error) => {
288
- await this.secretStore.delete(profileName).catch(() => undefined);
289
- throw new CliError("auth.refresh_failed", "Failed to refresh the stored session.", EXIT_CODES.authFailed, {
294
+ const invalidGrant = oauthErrorCode(error) === "invalid_grant";
295
+ if (invalidGrant) {
296
+ await this.secretStore.delete(profileName).catch(() => undefined);
297
+ }
298
+ throw new CliError("auth.refresh_failed", invalidGrant
299
+ ? "The stored refresh token is invalid or expired."
300
+ : "Failed to refresh the stored session.", EXIT_CODES.authFailed, {
290
301
  cause: error,
291
- nextStep: "Run vibecodr login to re-authenticate."
302
+ nextStep: invalidGrant
303
+ ? "Run vibecodr login to re-authenticate."
304
+ : "Retry after the authorization server recovers. The stored offline session was preserved."
292
305
  });
293
306
  });
294
307
  const updated = {
@@ -13,7 +13,22 @@ const PULSE_ACTIONS = {
13
13
  archive: { toolName: "archive_pulse", requiresConfirm: true },
14
14
  restore: { toolName: "restore_pulse", requiresConfirm: true }
15
15
  };
16
- function pulseHelpText() {
16
+ const PULSE_COMMAND_HELP = {
17
+ list: "Usage: vibecodr pulse list [--limit <n>] [--offset <n>]",
18
+ get: "Usage: vibecodr pulse get <pulse-id>",
19
+ status: "Usage: vibecodr pulse status <pulse-id>",
20
+ run: "Usage: vibecodr pulse run <pulse-id> [--input-json <json> | --input-file <path>] --confirm",
21
+ archive: "Usage: vibecodr pulse archive <pulse-id> --confirm",
22
+ restore: "Usage: vibecodr pulse restore <pulse-id> --confirm",
23
+ create: "Usage: vibecodr pulse create --name <name> (--code <source> | --code-file <path>) [--descriptor-json <json> | --descriptor-file <path>] [--slug <slug>] [--visibility public|unlisted|private] --confirm",
24
+ deploy: "Usage: vibecodr pulse deploy --name <name> (--code <source> | --code-file <path>) [--descriptor-json <json> | --descriptor-file <path>] [--slug <slug>] [--visibility public|unlisted|private] --confirm"
25
+ };
26
+ function pulseHelpText(subcommand) {
27
+ if (subcommand) {
28
+ const commandHelp = PULSE_COMMAND_HELP[subcommand];
29
+ if (commandHelp)
30
+ return commandHelp;
31
+ }
17
32
  return [
18
33
  "Usage: vibecodr pulse <command> [options]",
19
34
  "",
@@ -86,10 +101,14 @@ async function invokePulseTool(context, toolName, input) {
86
101
  export async function runPulseCommand(args, context) {
87
102
  const subcommand = args[0];
88
103
  const commandArgs = args.slice(1);
89
- if (!subcommand || isHelpToken(subcommand) || commandArgs.some((arg) => isHelpToken(arg))) {
104
+ if (!subcommand || isHelpToken(subcommand)) {
90
105
  context.output.info(pulseHelpText());
91
106
  return;
92
107
  }
108
+ if (commandArgs.some((arg) => isHelpToken(arg))) {
109
+ context.output.info(pulseHelpText(subcommand));
110
+ return;
111
+ }
93
112
  if (subcommand === "create" || subcommand === "deploy") {
94
113
  await runPulsePublishCommand(commandArgs, context);
95
114
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibecodr/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Vibecodr CLI for login, live MCP tool discovery, and live tool invocation.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",