@k-electron/k-bench 0.4.1 → 0.6.0

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.
@@ -102,12 +102,7 @@ export function createApp(service, options) {
102
102
  });
103
103
  return c.json(workspace);
104
104
  });
105
- app.post("/api/workspaces/:id/open", async (c) => {
106
- const body = await jsonBody(c.req.raw);
107
- return c.json(await service.openWorkspace(c.req.param("id"), {
108
- showWorker: body.showWorker === true,
109
- }));
110
- });
105
+ app.post("/api/workspaces/:id/open", async (c) => c.json(await service.openWorkspace(c.req.param("id"))));
111
106
  // The whole record: the tabs in order, and the one shown (null for the Worker).
112
107
  app.put("/api/workspaces/:id/right-pane", async (c) => {
113
108
  const { shown, tabs } = await jsonBody(c.req.raw);
@@ -166,14 +166,18 @@ function launchHooks() {
166
166
  return hooks;
167
167
  }
168
168
  /**
169
- * The `--settings` every launch passes: k-bench's hooks and, with Focus view on, its keys.
169
+ * The `--settings` every launch passes: k-bench's hooks, Claude Code's `dark` theme and, with
170
+ * Focus view on, its keys. The theme is fixed, not a Launch option: the owner's own theme may
171
+ * be `light`, which colours some text near-black, unreadable on k-bench's dark terminal.
170
172
  * Focus view needs both keys: it does nothing without the fullscreen renderer, and
171
173
  * fullscreen is not the default on every machine. `--settings` applies to that launch only
172
- * and adds to the owner's own settings and hooks, leaving their files unchanged.
174
+ * and adds to the owner's own settings and hooks, or outranks them, leaving their files
175
+ * unchanged.
173
176
  */
174
177
  function launchSettings(focusView) {
175
178
  return JSON.stringify({
176
179
  hooks: launchHooks(),
180
+ theme: "dark",
177
181
  ...(focusView ? { viewMode: "focus", tui: "fullscreen" } : {}),
178
182
  });
179
183
  }
@@ -181,7 +185,7 @@ function launchSettings(focusView) {
181
185
  * The flags that follow the one naming the conversation. This is where Launch options become
182
186
  * flags: a Default option adds nothing. Advisor Off is not a flag (there is none): the
183
187
  * launcher sets `CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1` for it. `--settings` is always passed,
184
- * for k-bench's hooks.
188
+ * for k-bench's hooks and the dark theme.
185
189
  */
186
190
  function launchOptionArguments(options) {
187
191
  const { model, effort, advisor, focusView } = options;
@@ -182,19 +182,13 @@ export class Service {
182
182
  /**
183
183
  * Makes the Workspace the Open Workspace and, unless it is Missing, starts its Stopped
184
184
  * Prime and Worker, resuming their conversations. Opening it again changes nothing that
185
- * is running. With `showWorker` (the owner chose it by name), its right Pane shows the
186
- * Worker again, keeping its tabs.
185
+ * is running.
187
186
  */
188
- async openWorkspace(id, options = {}) {
187
+ async openWorkspace(id) {
189
188
  const workspace = this.store.getWorkspace(id);
190
189
  if (!workspace)
191
190
  throw new ServiceError("not_found", "Unknown Workspace");
192
- this.store.transaction(() => {
193
- this.store.setOpenWorkspaceId(id);
194
- if (options.showWorker) {
195
- this.store.setRightPane(id, { ...this.rightPane(id), shown: null });
196
- }
197
- });
191
+ this.store.setOpenWorkspaceId(id);
198
192
  if (isDirectory(workspace.folder))
199
193
  await this.startRoles(id);
200
194
  return { id };