@papercraneai/cli 1.4.1 → 1.4.3

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/bin/papercrane.js CHANGED
@@ -29,7 +29,7 @@ program
29
29
  .description('Login to Papercrane. Opens browser for authentication, or use --api-key for direct login.')
30
30
  .option('--api-key <key>', 'API key for direct login (skips browser)')
31
31
  .option('--url <url>', 'API base URL (saves to config)')
32
- .option('--no-wait', 'Print auth URL and exit immediately (for AI assistants)')
32
+ .option('--nowait', 'Print auth URL and exit immediately (for AI assistants)')
33
33
  .option('--check', 'Check if pending login was completed')
34
34
  .action(async (options) => {
35
35
  try {
@@ -65,7 +65,7 @@ program
65
65
  if (options.check) {
66
66
  const pending = await getPendingSession();
67
67
  if (!pending) {
68
- console.log(chalk.yellow('No pending login session. Run: papercrane login --no-wait'));
68
+ console.log(chalk.yellow('No pending login session. Run: papercrane login --nowait'));
69
69
  process.exit(1);
70
70
  }
71
71
 
@@ -102,16 +102,18 @@ program
102
102
  if (!initRes.ok) {
103
103
  throw new Error('Failed to initialize login session');
104
104
  }
105
+ // Drain response body to avoid keeping the event loop alive (undici)
106
+ await initRes.arrayBuffer();
105
107
 
106
108
  const authUrl = `${baseUrl}/cli-auth?session=${session}`;
107
109
 
108
- // --no-wait: Print URL and exit immediately (for AI assistants)
109
- if (options.noWait) {
110
+ // --nowait: Print URL and exit immediately (for AI assistants)
111
+ if (options.nowait) {
110
112
  await setPendingSession({ session, baseUrl });
111
113
  console.log(chalk.cyan('\nOpen this URL to authenticate:\n'));
112
114
  console.log(` ${authUrl}\n`);
113
115
  console.log(chalk.dim('After authorizing, run: papercrane login --check\n'));
114
- return;
116
+ process.exit(0);
115
117
  }
116
118
 
117
119
  console.log(chalk.cyan('\nOpen this URL to authenticate:\n'));
@@ -840,4 +842,4 @@ program.action(async (_, cmd) => {
840
842
  }
841
843
  });
842
844
 
843
- program.parse();
845
+ program.parse();
package/lib/config.js CHANGED
@@ -125,7 +125,7 @@ export async function clearDefaultWorkspace() {
125
125
  }
126
126
 
127
127
  /**
128
- * Get pending login session (for --no-wait / --check flow)
128
+ * Get pending login session (for --nowait / --check flow)
129
129
  * @returns {Promise<{session: string, baseUrl: string}|null>}
130
130
  */
131
131
  export async function getPendingSession() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papercraneai/cli",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "CLI tool for managing OAuth credentials for LLM integrations",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,7 +17,12 @@
17
17
  "scripts": {
18
18
  "start": "node bin/papercrane.js"
19
19
  },
20
- "keywords": ["oauth", "cli", "authentication", "google"],
20
+ "keywords": [
21
+ "oauth",
22
+ "cli",
23
+ "authentication",
24
+ "google"
25
+ ],
21
26
  "author": "",
22
27
  "license": "MIT",
23
28
  "dependencies": {
@@ -28,4 +33,4 @@
28
33
  "open": "^8.4.2",
29
34
  "undici": "^6.0.0"
30
35
  }
31
- }
36
+ }