콘텐츠로 이동

TansrConfig

이 콘텐츠는 아직 번역되지 않았습니다.

type TansrConfig = {
$schemaVersion: 1;
audit?: {
dir?: string;
enabled?: boolean;
};
budget?: {
maxTotalTokens?: number;
maxUsd?: number;
onExceeded: "block" | "warn";
};
effort?: "max" | "low" | "medium" | "high";
fallbacks: Record<string, string[]>;
hooks?: {
allowManagedHooksOnly?: boolean;
disableAllHooks?: boolean;
PermissionDenied?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PermissionRequest?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PostToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PreToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
SessionEnd?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
SessionStart?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
Stop?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
UserPromptSubmit?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
};
locale?: string;
mcpServers?: Record<string,
| {
args?: string[];
command: string;
cwd?: string;
enabled?: boolean;
env?: Record<string, string>;
load?: "lazy" | "eager";
pool?: {
connections?: number;
maxInflightPerConnection?: number;
queueTimeoutMs?: number;
};
reconnect?: {
enabled?: boolean;
initialBackoffMs?: number;
maxAttempts?: number | null;
maxBackoffMs?: number;
};
toolAllowlist?: string[];
transport: "stdio";
}
| {
enabled?: boolean;
headers?: Record<string, string>;
load?: "lazy" | "eager";
pool?: {
connections?: number;
maxInflightPerConnection?: number;
queueTimeoutMs?: number;
};
reconnect?: {
enabled?: boolean;
initialBackoffMs?: number;
maxAttempts?: number | null;
maxBackoffMs?: number;
};
toolAllowlist?: string[];
transport: "http";
url: string;
}>;
modelAliases: {
fast?: string;
main?: string;
reasoning?: string;
};
outputStyle?: string;
permissions?: {
allow?: string[];
ask?: string[];
classifier?: {
callBudget?: number | "off";
enabled?: boolean;
tightenOutsideAuto?: boolean;
};
defaultMode?: | "default"
| "acceptEdits"
| "plan"
| "bypassPermissions"
| "auto"
| "dontAsk";
deny?: string[];
disableBaselineProtection?: boolean;
projectAskBudget?: number | "off";
recommendedRules?: boolean;
};
policy?: {
trust?: {
keys: Record<string, string>;
unsignedPolicy?: "accept" | "reject";
};
};
providers: Record<string, {
auth?: {
env: string;
};
baseUrl: string;
capability?: {
background?: boolean;
defaultContextWithoutModifier?: number;
effectiveContext?: number;
hostedTools?: string[];
inputModalities: {
document: "supported" | "rejected" | "silently_dropped";
image: "supported" | "rejected" | "silently_dropped";
};
maxContext: number;
maxOutput?: number;
modelModifiers: string[];
promptCaching: {
maxBreakpoints?: number;
minCacheableTokens?: number;
mode: "explicit" | "implicit" | "ignored";
ttlSeconds?: number;
};
quirks: {
claudeModelNameMapping: boolean;
countTokensEndpoint?: boolean;
maxTokensExcludesReasoning?: boolean;
minTimeoutMs?: number;
modelsEndpoint?: boolean;
stopSequences?: "ignored" | "honored" | "misreported_end_turn";
streamUsageLocation?: "message_start" | "message_delta" | "both";
systemRoleInMessages: boolean;
unknownModelFallback: boolean;
};
reasoning?: boolean;
sampling: {
temperature?: {
clampEpsilon: number;
max: number;
maxExclusive: boolean;
min: number;
minExclusive: boolean;
};
temperatureFixed?: number;
temperatureRange?: [number, number];
};
thinking: {
budgetMaxTokens?: number;
budgetTokens: "ignored" | "honored";
cannotDisable: boolean;
effortParam?: string;
mustEchoBack: boolean;
signatureShape?: "opaque" | "always_empty" | "absent";
toggleValues: string[];
};
thinkingOptional?: boolean;
toolChoice: boolean;
vision: boolean;
};
models: Record<string, string>;
pricing?: Record<string, {
cachedInputPerMillion?: number;
inputPerMillion: number;
outputPerMillion: number;
peakMultiplier?: number;
tiers?: {
cachedInputPerMillion?: number;
inputPerMillion: number;
outputPerMillion: number;
upToInputTokens?: number;
}[];
}>;
protocol: "anthropic" | "openai" | "openai-responses" | "twp";
}>;
sandbox?: {
allowWrite?: string[];
mode?: "off" | "on" | "required";
network?: "allow" | "deny";
};
semanticIndex?: {
branch?: string;
repoId?: string;
timeoutMs?: number;
topK?: number;
url?: string;
};
telemetry: {
enabled: boolean;
};
ui?: {
theme?: "dark" | "light" | "high-contrast" | "colorblind";
};
verify?: {
command?: string;
timeoutMs?: number;
};
workspaceTrust?: {
enforce?: boolean;
};
};

五层合并后的完整配置(TansrConfigSchema 推导)。

$schemaVersion: 1;

optional audit?: {
dir?: string;
enabled?: boolean;
};
optional dir?: string;
optional enabled?: boolean;

optional budget?: {
maxTotalTokens?: number;
maxUsd?: number;
onExceeded: "block" | "warn";
};
optional maxTotalTokens?: number;
optional maxUsd?: number;
onExceeded: "block" | "warn";

optional effort?: "max" | "low" | "medium" | "high";

fallbacks: Record<string, string[]>;

optional hooks?: {
allowManagedHooksOnly?: boolean;
disableAllHooks?: boolean;
PermissionDenied?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PermissionRequest?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PostToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
PreToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
SessionEnd?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
SessionStart?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
Stop?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
UserPromptSubmit?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
};
optional allowManagedHooksOnly?: boolean;
optional disableAllHooks?: boolean;
optional PermissionDenied?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional PermissionRequest?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional PostToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional PreToolUse?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional SessionEnd?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional SessionStart?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional Stop?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];
optional UserPromptSubmit?: {
hooks: (
| {
command: ...[];
timeoutMs?: ... | ...;
type: "command";
}
| {
headers?: ... | ...;
timeoutMs?: ... | ...;
type: "http";
url: string;
})[];
matcher?: string;
}[];

optional locale?: string;

optional mcpServers?: Record<string,
| {
args?: string[];
command: string;
cwd?: string;
enabled?: boolean;
env?: Record<string, string>;
load?: "lazy" | "eager";
pool?: {
connections?: number;
maxInflightPerConnection?: number;
queueTimeoutMs?: number;
};
reconnect?: {
enabled?: boolean;
initialBackoffMs?: number;
maxAttempts?: number | null;
maxBackoffMs?: number;
};
toolAllowlist?: string[];
transport: "stdio";
}
| {
enabled?: boolean;
headers?: Record<string, string>;
load?: "lazy" | "eager";
pool?: {
connections?: number;
maxInflightPerConnection?: number;
queueTimeoutMs?: number;
};
reconnect?: {
enabled?: boolean;
initialBackoffMs?: number;
maxAttempts?: number | null;
maxBackoffMs?: number;
};
toolAllowlist?: string[];
transport: "http";
url: string;
}>;

modelAliases: {
fast?: string;
main?: string;
reasoning?: string;
};
optional fast?: string;
optional main?: string;
optional reasoning?: string;

optional outputStyle?: string;

optional permissions?: {
allow?: string[];
ask?: string[];
classifier?: {
callBudget?: number | "off";
enabled?: boolean;
tightenOutsideAuto?: boolean;
};
defaultMode?: | "default"
| "acceptEdits"
| "plan"
| "bypassPermissions"
| "auto"
| "dontAsk";
deny?: string[];
disableBaselineProtection?: boolean;
projectAskBudget?: number | "off";
recommendedRules?: boolean;
};
optional allow?: string[];
optional ask?: string[];
optional classifier?: {
callBudget?: number | "off";
enabled?: boolean;
tightenOutsideAuto?: boolean;
};
optional callBudget?: number | "off";
optional enabled?: boolean;
optional tightenOutsideAuto?: boolean;
optional defaultMode?:
| "default"
| "acceptEdits"
| "plan"
| "bypassPermissions"
| "auto"
| "dontAsk";
optional deny?: string[];
optional disableBaselineProtection?: boolean;
optional projectAskBudget?: number | "off";
optional recommendedRules?: boolean;

optional policy?: {
trust?: {
keys: Record<string, string>;
unsignedPolicy?: "accept" | "reject";
};
};
optional trust?: {
keys: Record<string, string>;
unsignedPolicy?: "accept" | "reject";
};
keys: Record<string, string>;
optional unsignedPolicy?: "accept" | "reject";

providers: Record<string, {
auth?: {
env: string;
};
baseUrl: string;
capability?: {
background?: boolean;
defaultContextWithoutModifier?: number;
effectiveContext?: number;
hostedTools?: string[];
inputModalities: {
document: "supported" | "rejected" | "silently_dropped";
image: "supported" | "rejected" | "silently_dropped";
};
maxContext: number;
maxOutput?: number;
modelModifiers: string[];
promptCaching: {
maxBreakpoints?: number;
minCacheableTokens?: number;
mode: "explicit" | "implicit" | "ignored";
ttlSeconds?: number;
};
quirks: {
claudeModelNameMapping: boolean;
countTokensEndpoint?: boolean;
maxTokensExcludesReasoning?: boolean;
minTimeoutMs?: number;
modelsEndpoint?: boolean;
stopSequences?: "ignored" | "honored" | "misreported_end_turn";
streamUsageLocation?: "message_start" | "message_delta" | "both";
systemRoleInMessages: boolean;
unknownModelFallback: boolean;
};
reasoning?: boolean;
sampling: {
temperature?: {
clampEpsilon: number;
max: number;
maxExclusive: boolean;
min: number;
minExclusive: boolean;
};
temperatureFixed?: number;
temperatureRange?: [number, number];
};
thinking: {
budgetMaxTokens?: number;
budgetTokens: "ignored" | "honored";
cannotDisable: boolean;
effortParam?: string;
mustEchoBack: boolean;
signatureShape?: "opaque" | "always_empty" | "absent";
toggleValues: string[];
};
thinkingOptional?: boolean;
toolChoice: boolean;
vision: boolean;
};
models: Record<string, string>;
pricing?: Record<string, {
cachedInputPerMillion?: number;
inputPerMillion: number;
outputPerMillion: number;
peakMultiplier?: number;
tiers?: {
cachedInputPerMillion?: number;
inputPerMillion: number;
outputPerMillion: number;
upToInputTokens?: number;
}[];
}>;
protocol: "anthropic" | "openai" | "openai-responses" | "twp";
}>;

optional sandbox?: {
allowWrite?: string[];
mode?: "off" | "on" | "required";
network?: "allow" | "deny";
};
optional allowWrite?: string[];
optional mode?: "off" | "on" | "required";
optional network?: "allow" | "deny";

optional semanticIndex?: {
branch?: string;
repoId?: string;
timeoutMs?: number;
topK?: number;
url?: string;
};
optional branch?: string;
optional repoId?: string;
optional timeoutMs?: number;
optional topK?: number;
optional url?: string;

telemetry: {
enabled: boolean;
};
enabled: boolean;

optional ui?: {
theme?: "dark" | "light" | "high-contrast" | "colorblind";
};
optional theme?: "dark" | "light" | "high-contrast" | "colorblind";

optional verify?: {
command?: string;
timeoutMs?: number;
};
optional command?: string;
optional timeoutMs?: number;

optional workspaceTrust?: {
enforce?: boolean;
};
optional enforce?: boolean;