kernelpm 0.1.1 → 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 +4 -0
- package/dist/daemon.js +17 -0
- package/package.json +27 -27
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,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "kernelpm",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "kernelpm daemon — keeps opencode sessions alive on a server (via `opencode serve`) and exposes them over a local control socket.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"bin": {
|
|
7
|
-
"kernelpm": "dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc -p tsconfig.json",
|
|
14
|
-
"dev": "tsx src/cli.ts",
|
|
15
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
16
|
-
"test": "tsx test/run.ts",
|
|
17
|
-
"prepublishOnly": "npm run build"
|
|
18
|
-
},
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "^22.10.2",
|
|
24
|
-
"tsx": "^4.19.2",
|
|
25
|
-
"typescript": "^5.3.3"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "kernelpm",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "kernelpm daemon — keeps opencode sessions alive on a server (via `opencode serve`) and exposes them over a local control socket.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"kernelpm": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc -p tsconfig.json",
|
|
14
|
+
"dev": "tsx src/cli.ts",
|
|
15
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
16
|
+
"test": "tsx test/run.ts",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.10.2",
|
|
24
|
+
"tsx": "^4.19.2",
|
|
25
|
+
"typescript": "^5.3.3"
|
|
26
|
+
}
|
|
27
|
+
}
|