| export const PRODUCT_URL = 'https://claude.com/claude-code' |
|
|
| |
| export const CLAUDE_AI_BASE_URL = 'https://claude.ai' |
| export const CLAUDE_AI_STAGING_BASE_URL = 'https://claude-ai.staging.ant.dev' |
| export const CLAUDE_AI_LOCAL_BASE_URL = 'http://localhost:4000' |
|
|
| |
| |
| |
| |
| export function isRemoteSessionStaging( |
| sessionId?: string, |
| ingressUrl?: string, |
| ): boolean { |
| return ( |
| sessionId?.includes('_staging_') === true || |
| ingressUrl?.includes('staging') === true |
| ) |
| } |
|
|
| |
| |
| |
| |
| export function isRemoteSessionLocal( |
| sessionId?: string, |
| ingressUrl?: string, |
| ): boolean { |
| return ( |
| sessionId?.includes('_local_') === true || |
| ingressUrl?.includes('localhost') === true |
| ) |
| } |
|
|
| |
| |
| |
| export function getClaudeAiBaseUrl( |
| sessionId?: string, |
| ingressUrl?: string, |
| ): string { |
| if (isRemoteSessionLocal(sessionId, ingressUrl)) { |
| return CLAUDE_AI_LOCAL_BASE_URL |
| } |
| if (isRemoteSessionStaging(sessionId, ingressUrl)) { |
| return CLAUDE_AI_STAGING_BASE_URL |
| } |
| return CLAUDE_AI_BASE_URL |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export function getRemoteSessionUrl( |
| sessionId: string, |
| ingressUrl?: string, |
| ): string { |
| |
| const { toCompatSessionId } = |
| require('../bridge/sessionIdCompat.js') as typeof import('../bridge/sessionIdCompat.js') |
| |
| const compatId = toCompatSessionId(sessionId) |
| const baseUrl = getClaudeAiBaseUrl(compatId, ingressUrl) |
| return `${baseUrl}/code/${compatId}` |
| } |
|
|