Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Commit 6f10a1f

Browse files
christseclaude
andcommitted
fix: use application/vnd.card+source for .gts files in watch
When fetching .gts files from the server, use the proper Accept header to get clean source code instead of compiled output. Previously used '*/*' which returned compiled code with scoped CSS attributes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d059764 commit 6f10a1f

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

src/commands/watch.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { resolveWorkspace } from '../lib/workspace-resolver.js';
66
import { CheckpointManager, type CheckpointChange } from '../lib/checkpoint-manager.js';
77
import { createHash } from 'crypto';
88
import { getEditingFiles } from '../lib/edit-lock.js';
9+
import { getProfileManager, formatProfileBadge } from '../lib/profile-manager.js';
910

1011
interface WatchOptions {
1112
interval?: number;
@@ -38,16 +39,22 @@ export async function watchCommand(
3839
const intervalMs = (options.interval || 30) * 1000;
3940
const debounceMs = (options.debounce ?? 5) * 1000;
4041

41-
// Initialize Matrix client (shared across all realms)
42-
const matrixUrl = process.env.MATRIX_URL;
43-
const username = process.env.MATRIX_USERNAME;
44-
const password = process.env.MATRIX_PASSWORD;
42+
// Get credentials from profile manager (falls back to env vars)
43+
const profileManager = getProfileManager();
44+
const credentials = await profileManager.getActiveCredentials();
4545

46-
if (!matrixUrl || !username || !password) {
47-
console.error('Missing required environment variables: MATRIX_URL, MATRIX_USERNAME, MATRIX_PASSWORD');
46+
if (!credentials) {
47+
console.error('No credentials found. Run "boxel profile add" or set environment variables.');
4848
process.exit(1);
4949
}
5050

51+
const { matrixUrl, username, password, profileId } = credentials;
52+
53+
// Show active profile if using one
54+
if (profileId) {
55+
console.log(`${formatProfileBadge(profileId)}\n`);
56+
}
57+
5158
const matrixClient = new MatrixClient({
5259
matrixURL: new URL(matrixUrl),
5360
username,
@@ -170,7 +177,11 @@ export async function watchCommand(
170177
const fileResponse = await fetch(fileUrl, {
171178
headers: {
172179
'Authorization': realm.jwt,
173-
'Accept': file.endsWith('.json') ? 'application/vnd.card+json' : '*/*',
180+
'Accept': file.endsWith('.json')
181+
? 'application/vnd.card+json'
182+
: file.endsWith('.gts')
183+
? 'application/vnd.card+source'
184+
: '*/*',
174185
},
175186
});
176187

0 commit comments

Comments
 (0)