@dccxx/auggiegw 1.0.7 ā 1.0.9
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/dist/cli.js +20 -10
- package/package.json +3 -2
- package/scripts/publish.js +40 -0
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,9 @@ function getSessionOptions(opts) {
|
|
|
28
28
|
else if (opts.deleteSession) {
|
|
29
29
|
sessionOptions.deleteSession = true;
|
|
30
30
|
}
|
|
31
|
+
if (opts.authOnly) {
|
|
32
|
+
sessionOptions.authOnly = true;
|
|
33
|
+
}
|
|
31
34
|
return sessionOptions;
|
|
32
35
|
}
|
|
33
36
|
function shouldDeleteSession(options) {
|
|
@@ -315,17 +318,23 @@ async function handleFetch(options) {
|
|
|
315
318
|
// Silently ignore auggie session delete errors
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
spinner.text = `Saving ${allPrompts.length} prompts...`;
|
|
322
|
-
for (const prompt of allPrompts) {
|
|
323
|
-
await savePromptToFile(prompt);
|
|
324
|
-
}
|
|
325
|
-
spinner.succeed(`Successfully saved ${allPrompts.length} prompts`);
|
|
321
|
+
// Skip prompt fetching if authOnly flag is set
|
|
322
|
+
if (options?.authOnly) {
|
|
323
|
+
spinner.succeed('Authentication successful (prompts skipped)');
|
|
326
324
|
}
|
|
327
325
|
else {
|
|
328
|
-
spinner.
|
|
326
|
+
spinner.text = 'Fetching prompts...';
|
|
327
|
+
const allPrompts = await getAllPrompts(token, config.apiUrl, spinner);
|
|
328
|
+
if (allPrompts.length > 0) {
|
|
329
|
+
spinner.text = `Saving ${allPrompts.length} prompts...`;
|
|
330
|
+
for (const prompt of allPrompts) {
|
|
331
|
+
await savePromptToFile(prompt);
|
|
332
|
+
}
|
|
333
|
+
spinner.succeed(`Successfully saved ${allPrompts.length} prompts`);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
spinner.warn('No prompts found');
|
|
337
|
+
}
|
|
329
338
|
}
|
|
330
339
|
}
|
|
331
340
|
}
|
|
@@ -373,7 +382,8 @@ program
|
|
|
373
382
|
.description('CLI tool for auggiegw authentication')
|
|
374
383
|
.version('1.0.0')
|
|
375
384
|
.option('--preserve-session', 'Preserve Auggie session (do not delete chat history)')
|
|
376
|
-
.option('--delete-session', 'Delete Auggie session (clear chat history)')
|
|
385
|
+
.option('--delete-session', 'Delete Auggie session (clear chat history)')
|
|
386
|
+
.option('--auth-only', 'Fetch authentication session only without fetching prompts');
|
|
377
387
|
program
|
|
378
388
|
.command('login [username] [password]')
|
|
379
389
|
.description('Login and store credentials')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dccxx/auggiegw",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A Node.js TypeScript package",
|
|
5
5
|
"main": "./dist/cli.js",
|
|
6
6
|
"types": "./dist/cli.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"lint": "bunx biome check --write",
|
|
14
14
|
"clean": "rm -rf dist",
|
|
15
|
-
"publish": "
|
|
15
|
+
"publish": "node scripts/publish.js",
|
|
16
|
+
"publish:manual": "npm publish --access public",
|
|
16
17
|
"dev:login": "bun run src/cli.ts login",
|
|
17
18
|
"dev:fetch": "bun run src/cli.ts fetch"
|
|
18
19
|
},
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Execute a command and handle errors
|
|
12
|
+
* @param {string} command - The command to execute
|
|
13
|
+
* @param {string} description - Description of what the command does
|
|
14
|
+
*/
|
|
15
|
+
function executeCommand(command, description) {
|
|
16
|
+
console.log(`\nš¦ ${description}...`);
|
|
17
|
+
try {
|
|
18
|
+
execSync(command, { stdio: 'inherit', cwd: join(__dirname, '..') });
|
|
19
|
+
console.log(`ā
${description} completed successfully`);
|
|
20
|
+
} catch (_error) {
|
|
21
|
+
console.error(`ā ${description} failed`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.log('š Starting publish workflow...\n');
|
|
27
|
+
|
|
28
|
+
// Step 1: Bump version
|
|
29
|
+
executeCommand('node scripts/bump-version.js', 'Bumping version');
|
|
30
|
+
|
|
31
|
+
// Step 2: Run linter
|
|
32
|
+
executeCommand('bun run lint', 'Running linter');
|
|
33
|
+
|
|
34
|
+
// Step 3: Build the project
|
|
35
|
+
executeCommand('bun run build', 'Building project');
|
|
36
|
+
|
|
37
|
+
// Step 4: Publish to npm
|
|
38
|
+
executeCommand('bun publish --access public', 'Publishing to npm');
|
|
39
|
+
|
|
40
|
+
console.log('\nš Publish workflow completed successfully!');
|