迁移至新觅源码库 — 替换社区链接,保留AI功能

This commit is contained in:
新觅源码库
2026-06-02 03:44:33 +00:00
parent 7aa483f003
commit f10cd4cd9a
51 changed files with 328 additions and 1338 deletions
+3 -3
View File
@@ -107,7 +107,7 @@ function normalizeGithubRepoUrl(raw: string): string {
return raw
.trim()
.replace(/^git\+/, '')
.replace(/^git@github\.com:/, 'https://github.com/')
.replace(/^git@github\.com:/, 'https://www.xinmi.cloud/')
.replace(/\.git$/, '')
}
@@ -127,7 +127,7 @@ function getPreviewRepoApiUrl(): string {
const baseUrl = getPreviewRepoBaseUrl()
const match = baseUrl.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)$/)
if (!match) throw new Error(`Preview zip fallback only supports GitHub repositories: ${baseUrl}`)
return `https://api.github.com/repos/${match[1]}/${match[2]}`
return `https://api.www.xinmi.cloud/repos/${match[1]}/${match[2]}`
}
function getPreviewGithubRepoParts(): { owner: string; repo: string } {
@@ -902,7 +902,7 @@ async function downloadGithubZip(ref: string, targetDir: string, type: 'tag' | '
const { owner, repo } = getPreviewGithubRepoParts()
const refKind = type === 'branch' ? 'heads' : 'tags'
const archiveKind = process.platform === 'win32' ? 'zip' : 'tar.gz'
const url = `https://codeload.github.com/${owner}/${repo}/${archiveKind}/refs/${refKind}/${encodeURIComponent(ref)}`
const url = `https://codeload.www.xinmi.cloud/${owner}/${repo}/${archiveKind}/refs/${refKind}/${encodeURIComponent(ref)}`
appendPreviewActionLog(`download archive: ${url}`)
const res = await fetch(url, {
headers: { 'User-Agent': 'hermes-web-ui-preview' },
@@ -10,7 +10,7 @@ const DEFAULT_AGENT_BRIDGE_STARTUP_TIMEOUT_MS = 120000
const DEFAULT_AGENT_BRIDGE_RESTART_DELAY_MS = 1000
const MAX_AGENT_BRIDGE_RESTART_DELAY_MS = 30000
const OPENROUTER_WEB_UI_ATTRIBUTION_ENV = {
HERMES_OPENROUTER_APP_REFERER: 'https://ekkolearnai.com',
HERMES_OPENROUTER_APP_REFERER: 'https://www.xinmi.cloud',
HERMES_OPENROUTER_APP_TITLE: 'Hermes Web UI',
HERMES_OPENROUTER_APP_CATEGORIES: 'cli-agent,personal-agent',
} as const
@@ -3,16 +3,16 @@
*
* Mirrors the upstream hermes-agent implementation
* (`hermes_cli/copilot_auth.py:155-275`):
* - POST https://github.com/login/device/code → device_code, user_code, verification_uri
* - POST https://github.com/login/oauth/access_token → access_token (after user approves)
* - POST https://www.xinmi.cloud/login/device/code → device_code, user_code, verification_uri
* - POST https://www.xinmi.cloud/login/oauth/access_token → access_token (after user approves)
* - Polling rules per RFC 8628: authorization_pending, slow_down, expired_token, access_denied
*
* Client ID `Ov23li8tweQw6odWQebz` is reused from upstream hermes-agent for now;
* a dedicated web-ui OAuth App can be registered later without changing the protocol.
*/
const GITHUB_DEVICE_CODE_URL = 'https://github.com/login/device/code'
const GITHUB_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token'
const GITHUB_DEVICE_CODE_URL = 'https://www.xinmi.cloud/login/device/code'
const GITHUB_ACCESS_TOKEN_URL = 'https://www.xinmi.cloud/login/oauth/access_token'
export const COPILOT_OAUTH_CLIENT_ID = 'Ov23li8tweQw6odWQebz'
export const COPILOT_OAUTH_SCOPE = 'read:user'
const FETCH_TIMEOUT_MS = 15_000
@@ -6,7 +6,7 @@ import { join } from 'path'
const execFileAsync = promisify(execFile)
const COPILOT_API_TOKEN_URL = 'https://api.github.com/copilot_internal/v2/token'
const COPILOT_API_TOKEN_URL = 'https://api.www.xinmi.cloud/copilot_internal/v2/token'
const COPILOT_MODELS_URL = 'https://api.githubcopilot.com/models'
const EDITOR_VERSION = 'vscode/1.104.1'
const PLUGIN_VERSION = 'copilot-chat/0.20.0'