mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
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:
21
packages/builtin-tools/src/tools/ArtifactTool/config.ts
Normal file
21
packages/builtin-tools/src/tools/ArtifactTool/config.ts
Normal 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`
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user