mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-07-07 05:37:56 +02:00
fix: resolve all biome warnings and formatting issues
- Remove unnecessary non-null assertions where values are guaranteed - Replace array index access with .at() for safer element retrieval - Use local variables to avoid repeated process.env lookups - Replace any types with unknown in functional utilities - Use nullish coalescing for TOTP hash byte access - Auto-format security patches to match biome config
This commit is contained in:
@@ -219,9 +219,9 @@ async function setupRouter(): Promise<ShannonConfig> {
|
||||
|
||||
const router: ShannonConfig['router'] = { default: defaultModel };
|
||||
if (routerProvider === 'openai') {
|
||||
router!.openai_key = apiKey;
|
||||
router.openai_key = apiKey;
|
||||
} else {
|
||||
router!.openrouter_key = apiKey;
|
||||
router.openrouter_key = apiKey;
|
||||
}
|
||||
|
||||
return { router };
|
||||
|
||||
@@ -65,11 +65,8 @@ export function start(args: StartArgs): void {
|
||||
const containerName = `shannon-worker-${suffix}`;
|
||||
|
||||
// 8. Generate workspace name if not provided
|
||||
let workspace = args.workspace;
|
||||
if (!workspace) {
|
||||
const hostname = new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, '-');
|
||||
workspace = `${hostname}_shannon-${Date.now()}`;
|
||||
}
|
||||
const workspace =
|
||||
args.workspace ?? `${new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, '-')}_shannon-${Date.now()}`;
|
||||
|
||||
// 9. Resolve credentials
|
||||
const credentialsDir = getCredentialsDir();
|
||||
@@ -142,7 +139,7 @@ export function start(args: StartArgs): void {
|
||||
|
||||
// Clear waiting line and show info
|
||||
process.stdout.write('\r\x1b[K');
|
||||
printInfo(args, useRouter, workspace!, workflowId, repo.hostPath, workspacesDir);
|
||||
printInfo(args, useRouter, workspace, workflowId, repo.hostPath, workspacesDir);
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user