Skip to content

feat: externalize artifact engine URL to shared config - #2

Merged
dahai80 merged 2 commits into
mainfrom
feature/artifacts-config-externalize
Jul 27, 2026
Merged

feat: externalize artifact engine URL to shared config#2
dahai80 merged 2 commits into
mainfrom
feature/artifacts-config-externalize

Conversation

@dahai80

@dahai80 dahai80 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

目的

配置外部化:所有项目配置从配置文件读取,不能写死在代码里。

改动

  • 新增 src/utils/artifactConfig.ts — 集中读取 artifacts-engine URL
    • 优先级:ARTIFACT_ENGINE_URL 环境变量 > ~/.fusion/artifacts/config.yaml > 默认值
    • 内置轻量 YAML section 解析(无需第三方依赖)
    • 缓存结果避免重复读文件
  • 修改 ArtifactCreateTool.ts — 替换硬编码 ARTIFACT_ENGINE_URLgetArtifactEngineURL()
  • 修改 ArtifactUpdateTool.ts — 同上
  • 修改 artifactInjection.ts — 同上

配置文件格式

fusion-artifacts-enginedefault_config.yaml 一致:

server:
  host: "127.0.0.1"
  port: 8892

用户修改 ~/.fusion/artifacts/config.yaml 即可改变所有客户端连接地址,无需改代码。

🤖 Generated with Claude Code

dahai80 and others added 2 commits July 27, 2026 09:29
- Replace hardcoded ~/.fusion with getClaudeConfigHomeDir() (~/.fusion-code)
- Replace custom parseYAMLSection with existing parseYaml() utility
- Fix cache guard: cachedURL !== null instead of truthy check
- Add logging for config load and errors

Co-Authored-By: Claude <noreply@anthropic.com>
@dahai80
dahai80 force-pushed the feature/artifacts-config-externalize branch from 5c95d1f to 507df09 Compare July 27, 2026 01:30
@dahai80
dahai80 merged commit 8a56079 into main Jul 27, 2026
1 check passed
@dahai80
dahai80 deleted the feature/artifacts-config-externalize branch July 27, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant