kernelpm 0.1.3 → 0.1.8

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/control.js CHANGED
@@ -134,6 +134,10 @@ class SocketClient {
134
134
  await this.daemon.restart(msg.id);
135
135
  this.send({ t: 'ok', rid });
136
136
  break;
137
+ case 'renameSession':
138
+ await this.daemon.rename(msg.id, msg.title);
139
+ this.send({ t: 'ok', rid });
140
+ break;
137
141
  case 'listDir': {
138
142
  const dir = resolveDir(msg.path);
139
143
  this.send({ t: 'dir', rid, path: dir, entries: await readDir(dir) });
package/dist/daemon.js CHANGED
@@ -130,6 +130,23 @@ class Daemon {
130
130
  restart(id) {
131
131
  return this.require(id).restart();
132
132
  }
133
+ /**
134
+ * Update a session's title. Persists the new meta and pushes a `status`
135
+ * message to every attached client so the app re-renders the row immediately.
136
+ * Throws if the session id is unknown or the new title is empty.
137
+ */
138
+ async rename(id, title) {
139
+ const trimmed = title.trim();
140
+ if (!trimmed)
141
+ throw new Error('el título no puede estar vacío');
142
+ const meta = this.store.get(id);
143
+ if (!meta)
144
+ throw new Error('no such session');
145
+ const next = { ...meta, title: trimmed, updatedAt: Date.now() };
146
+ await this.store.upsert(next);
147
+ this.broadcast(id, { t: 'status', id, meta: next });
148
+ return next;
149
+ }
133
150
  /* ------------------------------ client fan-out ----------------------------- */
134
151
  addClient(c) {
135
152
  this.clients.add(c);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kernelpm",
3
- "version": "0.1.3",
3
+ "version": "0.1.8",
4
4
  "description": "kernelpm daemon — keeps opencode sessions alive on a server (via `opencode serve`) and exposes them over a local control socket.",
5
5
  "license": "MIT",
6
6
  "bin": {