type RuntimeMacro = {
  VERSION: string
  BUILD_TIME: string
  FEEDBACK_CHANNEL: string
  VERSION_CHANGELOG: string
}

const defaultRuntimeMacro: RuntimeMacro = {
  VERSION:
    process.env.CLAUDE_CODE_VERSION ??
    process.env.npm_package_version ??
    '666.444.0',
  BUILD_TIME: '',
  FEEDBACK_CHANNEL: '#claude-code',
  VERSION_CHANGELOG: '',
}

const globalMacro = (globalThis as { MACRO?: Partial<RuntimeMacro> }).MACRO

export const runtimeMacro: RuntimeMacro = {
  ...defaultRuntimeMacro,
  ...globalMacro,
  VERSION: globalMacro?.VERSION ?? defaultRuntimeMacro.VERSION,
}
