date is already injected by OpenCode's system.ts. omo-env now contains only Timezone and Locale, which are stable across requests and never break cache.
17 lines
569 B
TypeScript
17 lines
569 B
TypeScript
/**
|
|
* Creates OmO-specific environment context (timezone, locale).
|
|
* Note: Working directory, platform, and date are already provided by OpenCode's system.ts,
|
|
* so we only include fields that OpenCode doesn't provide to avoid duplication.
|
|
* See: https://github.com/code-yeongyu/oh-my-opencode/issues/379
|
|
*/
|
|
export function createEnvContext(): string {
|
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
const locale = Intl.DateTimeFormat().resolvedOptions().locale
|
|
|
|
return `
|
|
<omo-env>
|
|
Timezone: ${timezone}
|
|
Locale: ${locale}
|
|
</omo-env>`
|
|
}
|