happy-coder 0.9.0-3 → 0.9.0-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/index.cjs +23 -16
- package/dist/index.mjs +23 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2327,23 +2327,30 @@ class OutgoingMessageQueue {
|
|
|
2327
2327
|
}
|
|
2328
2328
|
/**
|
|
2329
2329
|
* Process queue - send messages in ID order that are released
|
|
2330
|
+
* (Internal implementation without lock)
|
|
2330
2331
|
*/
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2341
|
-
this.sendFunction(item.logMessage);
|
|
2342
|
-
}
|
|
2343
|
-
item.sent = true;
|
|
2332
|
+
processQueueInternal() {
|
|
2333
|
+
this.queue.sort((a, b) => a.id - b.id);
|
|
2334
|
+
while (this.queue.length > 0) {
|
|
2335
|
+
const item = this.queue[0];
|
|
2336
|
+
if (!item.released) {
|
|
2337
|
+
break;
|
|
2338
|
+
}
|
|
2339
|
+
if (!item.sent) {
|
|
2340
|
+
if (item.logMessage.type !== "system") {
|
|
2341
|
+
this.sendFunction(item.logMessage);
|
|
2344
2342
|
}
|
|
2345
|
-
|
|
2343
|
+
item.sent = true;
|
|
2346
2344
|
}
|
|
2345
|
+
this.queue.shift();
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
/**
|
|
2349
|
+
* Process queue - send messages in ID order that are released
|
|
2350
|
+
*/
|
|
2351
|
+
async processQueue() {
|
|
2352
|
+
await this.lock.inLock(async () => {
|
|
2353
|
+
this.processQueueInternal();
|
|
2347
2354
|
});
|
|
2348
2355
|
}
|
|
2349
2356
|
/**
|
|
@@ -2358,7 +2365,7 @@ class OutgoingMessageQueue {
|
|
|
2358
2365
|
for (const item of this.queue) {
|
|
2359
2366
|
item.released = true;
|
|
2360
2367
|
}
|
|
2361
|
-
|
|
2368
|
+
this.processQueueInternal();
|
|
2362
2369
|
});
|
|
2363
2370
|
}
|
|
2364
2371
|
/**
|
|
@@ -2747,7 +2754,7 @@ async function loop(opts) {
|
|
|
2747
2754
|
}
|
|
2748
2755
|
|
|
2749
2756
|
var name = "happy-coder";
|
|
2750
|
-
var version = "0.9.0-
|
|
2757
|
+
var version = "0.9.0-4";
|
|
2751
2758
|
var description = "Claude Code session sharing CLI";
|
|
2752
2759
|
var author = "Kirill Dubovitskiy";
|
|
2753
2760
|
var license = "MIT";
|
package/dist/index.mjs
CHANGED
|
@@ -2306,23 +2306,30 @@ class OutgoingMessageQueue {
|
|
|
2306
2306
|
}
|
|
2307
2307
|
/**
|
|
2308
2308
|
* Process queue - send messages in ID order that are released
|
|
2309
|
+
* (Internal implementation without lock)
|
|
2309
2310
|
*/
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
if (
|
|
2319
|
-
|
|
2320
|
-
this.sendFunction(item.logMessage);
|
|
2321
|
-
}
|
|
2322
|
-
item.sent = true;
|
|
2311
|
+
processQueueInternal() {
|
|
2312
|
+
this.queue.sort((a, b) => a.id - b.id);
|
|
2313
|
+
while (this.queue.length > 0) {
|
|
2314
|
+
const item = this.queue[0];
|
|
2315
|
+
if (!item.released) {
|
|
2316
|
+
break;
|
|
2317
|
+
}
|
|
2318
|
+
if (!item.sent) {
|
|
2319
|
+
if (item.logMessage.type !== "system") {
|
|
2320
|
+
this.sendFunction(item.logMessage);
|
|
2323
2321
|
}
|
|
2324
|
-
|
|
2322
|
+
item.sent = true;
|
|
2325
2323
|
}
|
|
2324
|
+
this.queue.shift();
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* Process queue - send messages in ID order that are released
|
|
2329
|
+
*/
|
|
2330
|
+
async processQueue() {
|
|
2331
|
+
await this.lock.inLock(async () => {
|
|
2332
|
+
this.processQueueInternal();
|
|
2326
2333
|
});
|
|
2327
2334
|
}
|
|
2328
2335
|
/**
|
|
@@ -2337,7 +2344,7 @@ class OutgoingMessageQueue {
|
|
|
2337
2344
|
for (const item of this.queue) {
|
|
2338
2345
|
item.released = true;
|
|
2339
2346
|
}
|
|
2340
|
-
|
|
2347
|
+
this.processQueueInternal();
|
|
2341
2348
|
});
|
|
2342
2349
|
}
|
|
2343
2350
|
/**
|
|
@@ -2726,7 +2733,7 @@ async function loop(opts) {
|
|
|
2726
2733
|
}
|
|
2727
2734
|
|
|
2728
2735
|
var name = "happy-coder";
|
|
2729
|
-
var version = "0.9.0-
|
|
2736
|
+
var version = "0.9.0-4";
|
|
2730
2737
|
var description = "Claude Code session sharing CLI";
|
|
2731
2738
|
var author = "Kirill Dubovitskiy";
|
|
2732
2739
|
var license = "MIT";
|