Skip to content

Commit fc0945c

Browse files
committed
fix(generate-types): re-sync hardcoded TS output with contracts.ts
The TypeScript-as-Go-string literal in cmd/generate-types/main.go drifted from frontend/src/types/contracts.ts when PR #424 (Server Config tab parity) and PR #463 (per-tool enable/disable) edited contracts.ts directly without updating the generator. Running `go run ./cmd/generate-types` (invoked by Makefile's `frontend-build` target) silently reverts those fields, producing a dirty working tree on every `make build`: - Server.isolation_defaults - IsolationConfig.network_mode, IsolationConfig.extra_args - IsolationDefaults (entire interface) - Tool.disabled, Tool.approval_status The reverted contracts.ts also feeds back into Vite's bundle hashes, which is the likely reason web/frontend/dist/* also churns on rebuilds. This commit catches the generator up to the actual contracts.ts content. After this, `go run ./cmd/generate-types` is idempotent against HEAD. Verified: generator output is byte-identical to contracts.ts.
1 parent 0597762 commit fc0945c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

cmd/generate-types/main.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export interface HealthStatus {
117117
created: string; // ISO date string
118118
updated: string; // ISO date string
119119
isolation?: IsolationConfig;
120+
isolation_defaults?: IsolationDefaults; // Resolved baseline values (read-only, used as placeholders)
120121
oauth_status?: 'authenticated' | 'expired' | 'error' | 'none'; // OAuth authentication status
121122
token_expires_at?: string; // ISO date string when OAuth token expires
122123
user_logged_out?: boolean; // True if user explicitly logged out (prevents auto-reconnection)
@@ -135,12 +136,27 @@ export interface OAuthConfig {
135136
export interface IsolationConfig {
136137
enabled: boolean;
137138
image?: string;
139+
network_mode?: string;
140+
extra_args?: string[];
138141
memory_limit?: string;
139142
cpu_limit?: string;
140143
working_dir?: string;
141144
timeout?: string;
142145
}
143146
147+
// IsolationDefaults reports the resolved baseline Docker isolation
148+
// values the backend will apply when no per-server override is set.
149+
// Populated on server-list / server-get responses; the Web UI uses these
150+
// as placeholders so "empty = inherit" is discoverable instead of
151+
// mysterious. Never sent back on PATCH requests.
152+
export interface IsolationDefaults {
153+
runtime_type?: string;
154+
image?: string;
155+
network_mode?: string;
156+
extra_args?: string[];
157+
working_dir?: string;
158+
}
159+
144160
`)
145161

146162
// Tool types
@@ -151,6 +167,12 @@ export interface IsolationConfig {
151167
schema?: Record<string, any>;
152168
usage: number;
153169
last_used?: string; // ISO date string
170+
// Mirrors contracts.Tool.Disabled on the Go side — present when an
171+
// approval record exists for this tool. Absent means "enabled" (default).
172+
disabled?: boolean;
173+
// Tool-level quarantine status surfaced by the same approval record.
174+
// Optional because non-quarantined tools simply omit the field.
175+
approval_status?: string;
154176
}
155177
156178
export interface SearchResult {

0 commit comments

Comments
 (0)