@sma1lboy/kobe 0.5.2 → 0.5.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/dist/bin/kobed.js CHANGED
@@ -3431,6 +3431,15 @@ class Orchestrator {
3431
3431
  await this.store.update(task.id, { tabs });
3432
3432
  return tab;
3433
3433
  }
3434
+ async clearTab(id, tabId) {
3435
+ const task = this.requireTask(id);
3436
+ if (!task.tabs.some((t) => t.id === tabId)) {
3437
+ throw new Error(`clearTab: tab ${tabId} not found on task ${task.id}`);
3438
+ }
3439
+ await this.stopTab(task.id, tabId);
3440
+ await this.updateTab(task.id, tabId, { sessionId: null });
3441
+ this.dispatchEvent(task.id, tabId, { type: "chat.tab.cleared" });
3442
+ }
3434
3443
  async closeTab(id, tabId) {
3435
3444
  const task = this.requireTask(id);
3436
3445
  if (task.tabs.length <= 1) {
@@ -4681,6 +4690,12 @@ async function startDaemonServer(orch, options = {}) {
4681
4690
  broadcastTaskUpdated(orch, clients, taskId);
4682
4691
  return {};
4683
4692
  }
4693
+ case "chat.tab.clear": {
4694
+ const taskId = requireString2(payload, "taskId");
4695
+ await orch.clearTab(taskId, requireString2(payload, "tabId"));
4696
+ broadcastTaskUpdated(orch, clients, taskId);
4697
+ return {};
4698
+ }
4684
4699
  case "chat.sessions": {
4685
4700
  const sessions = await orch.listSessions(requireString2(payload, "taskId"));
4686
4701
  return { sessions };
package/dist/cli/index.js CHANGED
@@ -5601,8 +5601,8 @@ var init_keys = __esm(() => {
5601
5601
  });
5602
5602
 
5603
5603
  // src/tui/panes/filetree/FileTree.tsx
5604
- import { TextAttributes as TextAttributes3 } from "@opentui/core";
5605
5604
  import { watch } from "fs";
5605
+ import { TextAttributes as TextAttributes3 } from "@opentui/core";
5606
5606
  function statusToken(s) {
5607
5607
  switch (s) {
5608
5608
  case "M":
@@ -8825,7 +8825,7 @@ var init_package = __esm(() => {
8825
8825
  package_default = {
8826
8826
  $schema: "https://json.schemastore.org/package.json",
8827
8827
  name: "@sma1lboy/kobe",
8828
- version: "0.5.2",
8828
+ version: "0.5.4",
8829
8829
  description: "TUI orchestrator for Claude Code (codename)",
8830
8830
  type: "module",
8831
8831
  packageManager: "bun@1.3.13",
@@ -11035,6 +11035,15 @@ class Orchestrator {
11035
11035
  await this.store.update(task.id, { tabs });
11036
11036
  return tab;
11037
11037
  }
11038
+ async clearTab(id, tabId) {
11039
+ const task = this.requireTask(id);
11040
+ if (!task.tabs.some((t) => t.id === tabId)) {
11041
+ throw new Error(`clearTab: tab ${tabId} not found on task ${task.id}`);
11042
+ }
11043
+ await this.stopTab(task.id, tabId);
11044
+ await this.updateTab(task.id, tabId, { sessionId: null });
11045
+ this.dispatchEvent(task.id, tabId, { type: "chat.tab.cleared" });
11046
+ }
11038
11047
  async closeTab(id, tabId) {
11039
11048
  const task = this.requireTask(id);
11040
11049
  if (task.tabs.length <= 1) {
@@ -11408,6 +11417,9 @@ class RemoteOrchestrator {
11408
11417
  const res = await this.client.request("chat.tab.close", { taskId, tabId });
11409
11418
  return res.nextActive;
11410
11419
  }
11420
+ async clearTab(taskId, tabId) {
11421
+ await this.client.request("chat.tab.clear", { taskId, tabId });
11422
+ }
11411
11423
  async setActiveTab(taskId, tabId) {
11412
11424
  await this.client.request("chat.tab.activate", { taskId, tabId });
11413
11425
  }
@@ -13872,7 +13884,7 @@ function Table(props) {
13872
13884
  const [lp, rp] = padding(cellWidth(cell), columnWidths[ci()] ?? 0, align);
13873
13885
  return [(() => {
13874
13886
  var _el$11 = createElement("span");
13875
- insert(_el$11, () => " " + " ".repeat(lp));
13887
+ insert(_el$11, () => ` ${" ".repeat(lp)}`);
13876
13888
  return _el$11;
13877
13889
  })(), memo2(() => memo2(() => !!rowProps.isHeader)() ? (() => {
13878
13890
  var _el$13 = createElement("b");
@@ -13884,7 +13896,7 @@ function Table(props) {
13884
13896
  tokens
13885
13897
  })), (() => {
13886
13898
  var _el$12 = createElement("span");
13887
- insert(_el$12, () => " ".repeat(rp) + " \u2502");
13899
+ insert(_el$12, () => `${" ".repeat(rp)} \u2502`);
13888
13900
  return _el$12;
13889
13901
  })()];
13890
13902
  }
@@ -13978,7 +13990,7 @@ function VerticalTable(props) {
13978
13990
  children: (cell, ci) => (() => {
13979
13991
  var _el$22 = createElement("text"), _el$23 = createElement("b");
13980
13992
  insertNode(_el$22, _el$23);
13981
- insert(_el$23, () => (props.block.header[ci()] ?? `Column ${ci() + 1}`) + ": ");
13993
+ insert(_el$23, () => `${props.block.header[ci()] ?? `Column ${ci() + 1}`}: `);
13982
13994
  insert(_el$22, createComponent2(InlineSpans, {
13983
13995
  get tokens() {
13984
13996
  return parseInline(cell);
@@ -14225,8 +14237,8 @@ var init_Markdown = __esm(() => {
14225
14237
  init_solid();
14226
14238
  init_solid();
14227
14239
  init_dev();
14228
- init_theme();
14229
14240
  init_border();
14241
+ init_theme();
14230
14242
  init_markdown_parser();
14231
14243
  });
14232
14244
 
@@ -20607,6 +20619,8 @@ function applyEvent(state, ev, nowIso = new Date().toISOString()) {
20607
20619
  ...state,
20608
20620
  messages: capMessages([...state.messages, { kind: "system", text: ev.text, ts: nowIso }], nowIso)
20609
20621
  };
20622
+ case "chat.tab.cleared":
20623
+ return createInitialState();
20610
20624
  case "user_input.request": {
20611
20625
  if (ev.payload.kind === "approve_plan") {
20612
20626
  return {
@@ -20997,7 +21011,7 @@ function Chat(props) {
20997
21011
  entry: e,
20998
21012
  source: "user"
20999
21013
  });
21000
- return [...map.values()].sort((a, b) => a.entry.name.localeCompare(b.entry.name)).map(({
21014
+ const claudeEntries = [...map.values()].map(({
21001
21015
  entry,
21002
21016
  source
21003
21017
  }) => ({
@@ -21009,6 +21023,15 @@ function Chat(props) {
21009
21023
  send(`/${entry.name}`);
21010
21024
  }
21011
21025
  }));
21026
+ const kobeEntries = [{
21027
+ display: "/clear",
21028
+ description: "Reset this chat tab (drops session, keeps history on disk)",
21029
+ source: "builtin",
21030
+ onSelect: () => {
21031
+ send("/clear");
21032
+ }
21033
+ }];
21034
+ return [...kobeEntries, ...claudeEntries].sort((a, b) => a.display.localeCompare(b.display));
21012
21035
  });
21013
21036
  const session = useChatSession({
21014
21037
  taskId: () => props.taskId(),
@@ -21209,6 +21232,15 @@ function Chat(props) {
21209
21232
  return;
21210
21233
  if (hasPendingInput())
21211
21234
  return;
21235
+ if (text === "/clear") {
21236
+ setDraft("");
21237
+ try {
21238
+ await props.orchestrator.clearTab(taskId, tabId);
21239
+ } catch (err) {
21240
+ patchActiveState((s) => pushSystemError(s, `/clear failed: ${stringifyErr2(err)}`));
21241
+ }
21242
+ return;
21243
+ }
21212
21244
  const streaming = activeState().isStreaming;
21213
21245
  if (streaming && mode === "steer") {
21214
21246
  setDraft("");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sma1lboy/kobe",
4
- "version": "0.5.2",
4
+ "version": "0.5.4",
5
5
  "description": "TUI orchestrator for Claude Code (codename)",
6
6
  "type": "module",
7
7
  "packageManager": "bun@1.3.13",