Files
aiturk-hermes-ide/apps/desktop/src/lib/aiturk-provider.ts
T
yilsemandClaude Opus 5.5 25d8c18c10 feat(aiturk): one-click sign-in for AITURK IDE (1.0.0-beta.14)
The onboarding and provider settings get a Sign in button: the IDE shows a
short code, opens the turkservis.online approval page, and after approval
saves the TurkServis provider itself and hands a separate member key to the
AITURK CLI over stdin (aiturk login --key-stdin --keep-other-account).
Keys never reach the renderer, logs, process arguments or URLs. Pasting an
API key remains as the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ppceaR5s6cvMnm7uGRnf
2026-10-03 15:13:23 +03:00

25 lines
903 B
TypeScript

import { connectionScoped, profileScoped } from '@/api/client'
import type { CustomEndpointUpdate } from '@/types/hermes'
export const AITURK_API_BASE_URL = 'https://ai.turkservis.online/v1'
export const AITURK_ACCOUNT_URL = 'https://turkservis.online/panel'
/** Where the main process should save the provider after a one-click sign-in:
* the same (connection, profile) the renderer's saveCustomEndpoint targets. */
export function aiturkLoginScope(): { connectionId?: string; profile?: string } {
return { ...connectionScoped(), ...profileScoped() }
}
export function aiturkEndpoint(apiKey: string, model = '', models?: string[]): CustomEndpointUpdate {
return {
id: 'turkservis',
name: 'TurkServis · AITURK',
base_url: AITURK_API_BASE_URL,
api_key: apiKey.trim(),
model,
discover_models: true,
make_default: true,
...(models?.length ? { models } : {})
}
}