@truss-harness/cli 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +4 -0
- package/dist/config.js +10 -3
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type McpServerConfigurations } from "@truss-harness/mcp";
|
|
|
2
2
|
import { type LocalEndpointKind } from "@truss-harness/provider-openai-compatible";
|
|
3
3
|
import type { AgentMode, ClientConfiguration } from "./runtime.js";
|
|
4
4
|
import type { PermissionMode } from "./protocol.js";
|
|
5
|
+
export type TuiThemeName = "forest" | "sage" | "dusk";
|
|
5
6
|
export interface ProfileConfiguration {
|
|
6
7
|
readonly provider?: LocalEndpointKind;
|
|
7
8
|
readonly baseUrl?: string;
|
|
@@ -13,6 +14,8 @@ export interface ProfileConfiguration {
|
|
|
13
14
|
/** Name of an environment variable containing a local endpoint token. */
|
|
14
15
|
readonly apiKeyEnv?: string;
|
|
15
16
|
readonly mcpServers?: McpServerConfigurations;
|
|
17
|
+
/** Visual preset used by the terminal UI. */
|
|
18
|
+
readonly tuiTheme?: TuiThemeName;
|
|
16
19
|
}
|
|
17
20
|
export interface HarnessConfiguration extends ProfileConfiguration {
|
|
18
21
|
readonly defaultProfile?: string;
|
|
@@ -26,6 +29,7 @@ export interface ConfigurationOverrides extends ProfileConfiguration {
|
|
|
26
29
|
export interface ResolvedConfiguration extends ClientConfiguration {
|
|
27
30
|
readonly profile?: string;
|
|
28
31
|
readonly permission: PermissionMode;
|
|
32
|
+
readonly tuiTheme?: TuiThemeName;
|
|
29
33
|
readonly paths: {
|
|
30
34
|
readonly user: string;
|
|
31
35
|
readonly workspace: string;
|
package/dist/config.js
CHANGED
|
@@ -13,6 +13,9 @@ function validMode(value) {
|
|
|
13
13
|
function validPermission(value) {
|
|
14
14
|
return value === "ask" || value === "auto-read" || value === "auto-all" ? value : undefined;
|
|
15
15
|
}
|
|
16
|
+
function validTuiTheme(value) {
|
|
17
|
+
return value === "forest" || value === "sage" || value === "dusk" ? value : undefined;
|
|
18
|
+
}
|
|
16
19
|
function object(value) {
|
|
17
20
|
return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
18
21
|
}
|
|
@@ -29,7 +32,8 @@ function parseProfile(value) {
|
|
|
29
32
|
internetAccess: typeof source.internetAccess === "boolean" ? source.internetAccess : undefined,
|
|
30
33
|
systemPrompt: typeof source.systemPrompt === "string" ? source.systemPrompt : undefined,
|
|
31
34
|
apiKeyEnv: typeof source.apiKeyEnv === "string" ? source.apiKeyEnv : undefined,
|
|
32
|
-
mcpServers: source.mcpServers === undefined ? undefined : parseMcpServerConfigurations(source.mcpServers)
|
|
35
|
+
mcpServers: source.mcpServers === undefined ? undefined : parseMcpServerConfigurations(source.mcpServers),
|
|
36
|
+
tuiTheme: validTuiTheme(source.tuiTheme)
|
|
33
37
|
};
|
|
34
38
|
}
|
|
35
39
|
function parseConfiguration(value) {
|
|
@@ -79,7 +83,8 @@ function environmentConfiguration(environment) {
|
|
|
79
83
|
: environment.TRUSS_HARNESS_INTERNET_ACCESS === "true" || environment.TRUSS_HARNESS_INTERNET_ACCESS === "1",
|
|
80
84
|
systemPrompt: environment.TRUSS_HARNESS_SYSTEM_PROMPT,
|
|
81
85
|
apiKeyEnv: environment.TRUSS_HARNESS_API_KEY ? "TRUSS_HARNESS_API_KEY" : undefined,
|
|
82
|
-
mcpServers
|
|
86
|
+
mcpServers,
|
|
87
|
+
tuiTheme: validTuiTheme(environment.TRUSS_HARNESS_TUI_THEME)
|
|
83
88
|
};
|
|
84
89
|
}
|
|
85
90
|
const profileKeys = [
|
|
@@ -91,7 +96,8 @@ const profileKeys = [
|
|
|
91
96
|
"internetAccess",
|
|
92
97
|
"systemPrompt",
|
|
93
98
|
"apiKeyEnv",
|
|
94
|
-
"mcpServers"
|
|
99
|
+
"mcpServers",
|
|
100
|
+
"tuiTheme"
|
|
95
101
|
];
|
|
96
102
|
function mergeProfiles(...sources) {
|
|
97
103
|
const merged = {};
|
|
@@ -165,6 +171,7 @@ export async function resolveConfiguration(options) {
|
|
|
165
171
|
systemPrompt: merged.systemPrompt,
|
|
166
172
|
mcpServers,
|
|
167
173
|
profile,
|
|
174
|
+
tuiTheme: merged.tuiTheme,
|
|
168
175
|
paths
|
|
169
176
|
};
|
|
170
177
|
}
|