refactor(bash): centralize managed env prefix

This commit is contained in:
Yichen Jiang
2026-07-12 16:14:13 +08:00
parent df9617aaff
commit 48e7bde361
8 changed files with 51 additions and 34 deletions

View File

@@ -535,7 +535,7 @@ export const TYPE_API: readonly TypeApiEntry[] = [
},
{
name: 'BashEnvContributor',
declaration: 'export interface BashEnvContributor {\n name: string;\n variables: Readonly<Record<`DSH_${string}`, BashEnvVariable>>;\n resolve(execution: ToolExecution): Readonly<Partial<Record<`DSH_${string}`, string>>>;\n}',
declaration: 'export interface BashEnvContributor {\n name: string;\n variables: Readonly<Record<DshEnvironmentKey, BashEnvVariable>>;\n resolve(execution: ToolExecution): Readonly<Partial<Record<DshEnvironmentKey, string>>>;\n}',
},
{
name: 'BashEnvVariable',
@@ -543,7 +543,7 @@ export const TYPE_API: readonly TypeApiEntry[] = [
},
{
name: 'BashEnvVariableInfo',
declaration: 'export interface BashEnvVariableInfo extends BashEnvVariable {\n contributor: string;\n key: `DSH_${string}`;\n}',
declaration: 'export interface BashEnvVariableInfo extends BashEnvVariable {\n contributor: string;\n key: DshEnvironmentKey;\n}',
},
{
name: 'BashExecRequest',
@@ -659,7 +659,11 @@ export const TYPE_API: readonly TypeApiEntry[] = [
},
{
name: 'DshEnvironment',
declaration: 'export type DshEnvironment = Readonly<Record<`DSH_${string}`, string>>;',
declaration: 'export type DshEnvironment = Readonly<Record<DshEnvironmentKey, string>>;',
},
{
name: 'DshEnvironmentKey',
declaration: 'export type DshEnvironmentKey = `${typeof DSH_ENV_PREFIX}${string}`;',
},
{
name: 'FileDiff',