@neta-art/cohub-cli 1.0.1 → 1.0.3
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/commands/spaces.js +18 -6
- package/package.json +2 -2
package/dist/commands/spaces.js
CHANGED
|
@@ -381,15 +381,27 @@ function registerSessions(spacesCmd) {
|
|
|
381
381
|
const client = createClient(token);
|
|
382
382
|
const session = client.space(spaceId).session(id);
|
|
383
383
|
process.stdout.write(" Listening for events...\n\n");
|
|
384
|
-
|
|
384
|
+
let lastAppendPath = null;
|
|
385
|
+
session.on("turn.patch", (e) => {
|
|
385
386
|
if (opts.json) {
|
|
386
387
|
console.log(JSON.stringify(e));
|
|
387
388
|
}
|
|
388
389
|
else {
|
|
389
|
-
const
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
const ops = e.payload?.ops;
|
|
391
|
+
for (const op of ops ?? []) {
|
|
392
|
+
if (op.o === "append" && typeof op.v === "string" && op.p?.endsWith("/text")) {
|
|
393
|
+
lastAppendPath = op.p;
|
|
394
|
+
process.stdout.write(op.v);
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
if (op.o === "append" && typeof op.p === "string") {
|
|
398
|
+
lastAppendPath = op.p;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
if (!op.o && !op.p && typeof op.v === "string" && lastAppendPath?.endsWith("/text")) {
|
|
402
|
+
process.stdout.write(op.v);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
393
405
|
}
|
|
394
406
|
});
|
|
395
407
|
session.on("turn.final", () => {
|
|
@@ -399,7 +411,7 @@ function registerSessions(spacesCmd) {
|
|
|
399
411
|
session.on("turn.error", (e) => {
|
|
400
412
|
process.stderr.write(`\n ✗ Error\n`);
|
|
401
413
|
if (opts.json)
|
|
402
|
-
process.stderr.write(JSON.stringify(e)
|
|
414
|
+
process.stderr.write(`${JSON.stringify(e)}\n`);
|
|
403
415
|
process.exit(1);
|
|
404
416
|
});
|
|
405
417
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"commander": "^13.1.0",
|
|
17
|
-
"@neta-art/cohub": "1.2.
|
|
17
|
+
"@neta-art/cohub": "1.2.2"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|