@link-assistant/agent 0.0.11 → 0.0.13
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/package.json +1 -1
- package/src/cli/cmd/auth.ts +3 -2
- package/src/index.js +29 -0
package/package.json
CHANGED
package/src/cli/cmd/auth.ts
CHANGED
|
@@ -132,9 +132,10 @@ export const AuthLoginCommand = cmd({
|
|
|
132
132
|
vercel: 5,
|
|
133
133
|
};
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
// Note: Using `select` instead of `autocomplete` because `autocomplete` is only
|
|
136
|
+
// available in @clack/prompts v1.0.0-alpha.1+, while this package uses stable v0.11.0
|
|
137
|
+
let provider = await prompts.select({
|
|
136
138
|
message: 'Select provider',
|
|
137
|
-
maxItems: 8,
|
|
138
139
|
options: [
|
|
139
140
|
...pipe(
|
|
140
141
|
providers,
|
package/src/index.js
CHANGED
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
import { McpCommand } from './cli/cmd/mcp.ts';
|
|
17
17
|
import { AuthCommand } from './cli/cmd/auth.ts';
|
|
18
18
|
import { Flag } from './flag/flag.ts';
|
|
19
|
+
import { FormatError } from './cli/error.ts';
|
|
20
|
+
import { UI } from './cli/ui.ts';
|
|
19
21
|
|
|
20
22
|
// Track if any errors occurred during execution
|
|
21
23
|
let hasError = false;
|
|
@@ -561,6 +563,33 @@ async function main() {
|
|
|
561
563
|
'Use existing Claude OAuth credentials from ~/.claude/.credentials.json (from Claude Code CLI)',
|
|
562
564
|
default: false,
|
|
563
565
|
})
|
|
566
|
+
.fail((msg, err, yargs) => {
|
|
567
|
+
// Handle errors from command handlers
|
|
568
|
+
if (err) {
|
|
569
|
+
// Check if it's a CancelledError (user pressed ESC)
|
|
570
|
+
if (UI.CancelledError.isInstance(err)) {
|
|
571
|
+
// Exit silently without showing error or help text
|
|
572
|
+
process.exit(0);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// Format other errors using FormatError
|
|
576
|
+
const formatted = FormatError(err);
|
|
577
|
+
if (formatted) {
|
|
578
|
+
console.error(formatted);
|
|
579
|
+
} else {
|
|
580
|
+
// Fallback to default error formatting
|
|
581
|
+
console.error(err.message || err);
|
|
582
|
+
}
|
|
583
|
+
process.exit(1);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Handle validation errors (msg without err)
|
|
587
|
+
if (msg) {
|
|
588
|
+
console.error(msg);
|
|
589
|
+
console.error(`\n${yargs.help()}`);
|
|
590
|
+
process.exit(1);
|
|
591
|
+
}
|
|
592
|
+
})
|
|
564
593
|
.help().argv;
|
|
565
594
|
|
|
566
595
|
// If a command was executed (like mcp), yargs handles it
|