feat(artifact): add cloud-artifacts config with token/URL defaults

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-20 14:38:55 +08:00
parent 4584a43736
commit e2e6f4bd87

View File

@@ -0,0 +1,21 @@
/**
* Cloud Artifacts service configuration.
* Token/URL have hardcoded production defaults; env vars override for self-hosted deployments.
*/
export const ARTIFACTS_DEFAULT_TOKEN = 'claude-code-best'
export const ARTIFACTS_DEFAULT_URL =
'https://cloud-artifacts.claude-code-best.win'
export function getArtifactsToken(): string {
return process.env.CLAUDE_ARTIFACTS_TOKEN ?? ARTIFACTS_DEFAULT_TOKEN
}
export function getArtifactsBaseUrl(): string {
return process.env.CLAUDE_ARTIFACTS_URL ?? ARTIFACTS_DEFAULT_URL
}
/** Strip trailing slash so `${base}/upload` is well-formed. */
export function getUploadUrl(): string {
const base = getArtifactsBaseUrl()
return base.endsWith('/') ? `${base}upload` : `${base}/upload`
}