modelroom 0.0.3 → 0.0.4
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/CHANGELOG.md +7 -0
- package/dist/lib/server.d.ts.map +1 -1
- package/dist/lib/server.js +2 -1
- package/dist/lib/server.js.map +1 -1
- package/package.json +2 -2
- package/ui/assets/app.js +38 -37
- package/ui/dashboard.html +13 -321
- package/ui/kit.html +10 -1
- package/ui/modelroom.css +1 -1
- package/ui/room.html +9 -0
- package/ui/settings.html +12 -114
package/ui/room.html
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
9
|
<title>Room — modelroom</title>
|
|
10
10
|
<link rel="stylesheet" href="/ui/modelroom.css">
|
|
11
|
+
<script>
|
|
12
|
+
// Theme before paint: the bundle is React, but the first frame should not flash.
|
|
13
|
+
try {
|
|
14
|
+
var stored = localStorage.getItem('modelroom.theme');
|
|
15
|
+
document.documentElement.dataset.theme = stored
|
|
16
|
+
? JSON.parse(stored)
|
|
17
|
+
: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
18
|
+
} catch (error) { /* the default is light */ }
|
|
19
|
+
</script>
|
|
11
20
|
</head>
|
|
12
21
|
<body class="h-dvh overflow-hidden bg-background text-foreground font-sans">
|
|
13
22
|
<div id="root" data-app="room" class="h-full"></div>
|
package/ui/settings.html
CHANGED
|
@@ -1,125 +1,23 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<!-- modelroom — settings: how modelroom talks to your agent -->
|
|
2
|
+
<!-- modelroom — settings: how modelroom talks to your agent. -->
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
<title>Settings — modelroom</title>
|
|
8
8
|
<link rel="stylesheet" href="/ui/modelroom.css">
|
|
9
|
-
</head>
|
|
10
|
-
<body class="min-h-dvh bg-base-200 text-base-content font-sans">
|
|
11
|
-
|
|
12
|
-
<div class="navbar bg-base-100 border-b border-base-300">
|
|
13
|
-
<div class="flex-1 gap-3">
|
|
14
|
-
<a class="btn btn-ghost btn-sm" href="/">← Rooms</a>
|
|
15
|
-
<span class="font-semibold">Settings</span>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<main class="mx-auto w-full max-w-3xl p-5 flex flex-col gap-4">
|
|
20
|
-
|
|
21
|
-
<section class="card bg-base-100 border border-base-300">
|
|
22
|
-
<div class="card-body gap-3">
|
|
23
|
-
<h2 class="card-title text-base">Agent</h2>
|
|
24
|
-
<p class="text-sm opacity-70">modelroom drives the agent you already use. Nothing here is sent anywhere by modelroom itself.</p>
|
|
25
|
-
|
|
26
|
-
<label class="form-control w-full">
|
|
27
|
-
<span class="label-text">Adapter</span>
|
|
28
|
-
<select class="select select-bordered" id="adapter">
|
|
29
|
-
<option value="opencode">opencode — OpenCode CLI (sessions, model, agent)</option>
|
|
30
|
-
<option value="command">command — any CLI, with args containing {prompt} and {session}</option>
|
|
31
|
-
</select>
|
|
32
|
-
</label>
|
|
33
|
-
|
|
34
|
-
<div class="grid gap-3 sm:grid-cols-2">
|
|
35
|
-
<label class="form-control">
|
|
36
|
-
<span class="label-text">Command</span>
|
|
37
|
-
<input class="input input-bordered font-mono text-sm" id="command" placeholder="opencode">
|
|
38
|
-
</label>
|
|
39
|
-
<label class="form-control">
|
|
40
|
-
<span class="label-text">Agent name</span>
|
|
41
|
-
<input class="input input-bordered font-mono text-sm" id="agent" placeholder="build">
|
|
42
|
-
</label>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<label class="form-control">
|
|
46
|
-
<span class="label-text">Model <span class="opacity-60">(optional — many agents fail on an unset default)</span></span>
|
|
47
|
-
<input class="input input-bordered font-mono text-sm" id="model" placeholder="e.g. openrouter/deepseek/deepseek-v4.1-flash">
|
|
48
|
-
</label>
|
|
49
|
-
|
|
50
|
-
<label class="label cursor-pointer justify-start gap-3">
|
|
51
|
-
<input type="checkbox" class="checkbox checkbox-sm" id="standalone">
|
|
52
|
-
<span class="label-text text-sm">Run the agent against its own server, using this process's environment (opencode)</span>
|
|
53
|
-
</label>
|
|
54
|
-
|
|
55
|
-
<div class="flex items-center gap-3">
|
|
56
|
-
<button class="btn btn-primary btn-sm" id="save">Save</button>
|
|
57
|
-
<span class="text-sm text-success" id="saved"></span>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</section>
|
|
61
|
-
|
|
62
|
-
<section class="card bg-base-100 border border-base-300">
|
|
63
|
-
<div class="card-body gap-2">
|
|
64
|
-
<h2 class="card-title text-base">Config</h2>
|
|
65
|
-
<div class="text-sm opacity-80 mr-prose" id="configSummary">…</div>
|
|
66
|
-
<p class="text-xs opacity-60 mr-prose">
|
|
67
|
-
Committed settings live in <code>modelroom.json</code>. Anything you save here is kept locally in
|
|
68
|
-
<code>.modelroom/state.json</code> (git-ignored). Editable room files are:
|
|
69
|
-
<span id="docList" class="font-mono"></span>.
|
|
70
|
-
</p>
|
|
71
|
-
</div>
|
|
72
|
-
</section>
|
|
73
|
-
|
|
74
|
-
<section class="card bg-base-100 border border-base-300">
|
|
75
|
-
<div class="card-body gap-2">
|
|
76
|
-
<h2 class="card-title text-base">Thumbnails</h2>
|
|
77
|
-
<p class="text-sm opacity-70 mr-prose">
|
|
78
|
-
Rendering an artifact to PNG needs Playwright and a browser:
|
|
79
|
-
<code>npm i -D playwright && npx playwright install chromium</code>.
|
|
80
|
-
modelroom works without it — rooms simply show no thumbnail.
|
|
81
|
-
</p>
|
|
82
|
-
<div class="text-xs opacity-60" id="pngState"></div>
|
|
83
|
-
</div>
|
|
84
|
-
</section>
|
|
85
|
-
|
|
86
|
-
</main>
|
|
87
|
-
|
|
88
9
|
<script>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
(async function init() {
|
|
99
|
-
const data = await (await fetch('/api/rooms')).json();
|
|
100
|
-
const cfg = data.config;
|
|
101
|
-
$('adapter').value = cfg.agent.adapter;
|
|
102
|
-
$('command').value = cfg.agent.command || '';
|
|
103
|
-
$('agent').value = cfg.agent.agent || '';
|
|
104
|
-
$('model').value = cfg.agent.model || '';
|
|
105
|
-
$('standalone').checked = cfg.agent.standalone !== false;
|
|
106
|
-
$('configSummary').innerHTML = summary(cfg);
|
|
107
|
-
$('docList').textContent = cfg.docs.join(', ');
|
|
108
|
-
})();
|
|
109
|
-
|
|
110
|
-
$('save').addEventListener('click', async () => {
|
|
111
|
-
const body = {
|
|
112
|
-
adapter: $('adapter').value,
|
|
113
|
-
command: $('command').value.trim(),
|
|
114
|
-
agent: $('agent').value.trim(),
|
|
115
|
-
model: $('model').value.trim(),
|
|
116
|
-
standalone: $('standalone').checked,
|
|
117
|
-
};
|
|
118
|
-
const res = await fetch('/api/settings', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
119
|
-
const data = await res.json();
|
|
120
|
-
$('saved').textContent = res.ok ? `saved ${new Date().toLocaleTimeString()}` : `failed: ${data.error || res.status}`;
|
|
121
|
-
if (res.ok && data.config) $('configSummary').innerHTML = summary(data.config);
|
|
122
|
-
});
|
|
10
|
+
// Theme before paint: the bundle is React, but the first frame should not flash.
|
|
11
|
+
try {
|
|
12
|
+
var stored = localStorage.getItem('modelroom.theme');
|
|
13
|
+
document.documentElement.dataset.theme = stored
|
|
14
|
+
? JSON.parse(stored)
|
|
15
|
+
: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
16
|
+
} catch (error) { /* the default is light */ }
|
|
123
17
|
</script>
|
|
18
|
+
</head>
|
|
19
|
+
<body class="bg-background text-foreground font-sans">
|
|
20
|
+
<div id="root" data-app="settings"></div>
|
|
21
|
+
<script type="module" src="/ui/assets/app.js"></script>
|
|
124
22
|
</body>
|
|
125
23
|
</html>
|