happy-coder 0.9.0-3 → 0.9.0-5
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 +29 -16
- package/dist/index.mjs +29 -16
- package/dist/lib.d.cts +2 -0
- package/dist/lib.d.mts +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1515,6 +1515,7 @@ async function claudeRemote(opts) {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
isCompactCommand = false;
|
|
1517
1517
|
}
|
|
1518
|
+
opts.onReady();
|
|
1518
1519
|
const next = await opts.nextMessage();
|
|
1519
1520
|
if (!next) {
|
|
1520
1521
|
messages.end();
|
|
@@ -2327,23 +2328,30 @@ class OutgoingMessageQueue {
|
|
|
2327
2328
|
}
|
|
2328
2329
|
/**
|
|
2329
2330
|
* Process queue - send messages in ID order that are released
|
|
2331
|
+
* (Internal implementation without lock)
|
|
2330
2332
|
*/
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2341
|
-
this.sendFunction(item.logMessage);
|
|
2342
|
-
}
|
|
2343
|
-
item.sent = true;
|
|
2333
|
+
processQueueInternal() {
|
|
2334
|
+
this.queue.sort((a, b) => a.id - b.id);
|
|
2335
|
+
while (this.queue.length > 0) {
|
|
2336
|
+
const item = this.queue[0];
|
|
2337
|
+
if (!item.released) {
|
|
2338
|
+
break;
|
|
2339
|
+
}
|
|
2340
|
+
if (!item.sent) {
|
|
2341
|
+
if (item.logMessage.type !== "system") {
|
|
2342
|
+
this.sendFunction(item.logMessage);
|
|
2344
2343
|
}
|
|
2345
|
-
|
|
2344
|
+
item.sent = true;
|
|
2346
2345
|
}
|
|
2346
|
+
this.queue.shift();
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
/**
|
|
2350
|
+
* Process queue - send messages in ID order that are released
|
|
2351
|
+
*/
|
|
2352
|
+
async processQueue() {
|
|
2353
|
+
await this.lock.inLock(async () => {
|
|
2354
|
+
this.processQueueInternal();
|
|
2347
2355
|
});
|
|
2348
2356
|
}
|
|
2349
2357
|
/**
|
|
@@ -2358,7 +2366,7 @@ class OutgoingMessageQueue {
|
|
|
2358
2366
|
for (const item of this.queue) {
|
|
2359
2367
|
item.released = true;
|
|
2360
2368
|
}
|
|
2361
|
-
|
|
2369
|
+
this.processQueueInternal();
|
|
2362
2370
|
});
|
|
2363
2371
|
}
|
|
2364
2372
|
/**
|
|
@@ -2649,6 +2657,11 @@ async function claudeRemoteLauncher(session) {
|
|
|
2649
2657
|
types$1.logger.debug("[remote]: Session reset");
|
|
2650
2658
|
session.clearSessionId();
|
|
2651
2659
|
},
|
|
2660
|
+
onReady: () => {
|
|
2661
|
+
if (!pending && session.queue.size() === 0) {
|
|
2662
|
+
session.client.sendSessionEvent({ type: "ready" });
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2652
2665
|
signal: abortController.signal
|
|
2653
2666
|
});
|
|
2654
2667
|
if (!exitReason && abortController.signal.aborted) {
|
|
@@ -2747,7 +2760,7 @@ async function loop(opts) {
|
|
|
2747
2760
|
}
|
|
2748
2761
|
|
|
2749
2762
|
var name = "happy-coder";
|
|
2750
|
-
var version = "0.9.0-
|
|
2763
|
+
var version = "0.9.0-5";
|
|
2751
2764
|
var description = "Claude Code session sharing CLI";
|
|
2752
2765
|
var author = "Kirill Dubovitskiy";
|
|
2753
2766
|
var license = "MIT";
|
package/dist/index.mjs
CHANGED
|
@@ -1494,6 +1494,7 @@ async function claudeRemote(opts) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
isCompactCommand = false;
|
|
1496
1496
|
}
|
|
1497
|
+
opts.onReady();
|
|
1497
1498
|
const next = await opts.nextMessage();
|
|
1498
1499
|
if (!next) {
|
|
1499
1500
|
messages.end();
|
|
@@ -2306,23 +2307,30 @@ class OutgoingMessageQueue {
|
|
|
2306
2307
|
}
|
|
2307
2308
|
/**
|
|
2308
2309
|
* Process queue - send messages in ID order that are released
|
|
2310
|
+
* (Internal implementation without lock)
|
|
2309
2311
|
*/
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
if (
|
|
2319
|
-
|
|
2320
|
-
this.sendFunction(item.logMessage);
|
|
2321
|
-
}
|
|
2322
|
-
item.sent = true;
|
|
2312
|
+
processQueueInternal() {
|
|
2313
|
+
this.queue.sort((a, b) => a.id - b.id);
|
|
2314
|
+
while (this.queue.length > 0) {
|
|
2315
|
+
const item = this.queue[0];
|
|
2316
|
+
if (!item.released) {
|
|
2317
|
+
break;
|
|
2318
|
+
}
|
|
2319
|
+
if (!item.sent) {
|
|
2320
|
+
if (item.logMessage.type !== "system") {
|
|
2321
|
+
this.sendFunction(item.logMessage);
|
|
2323
2322
|
}
|
|
2324
|
-
|
|
2323
|
+
item.sent = true;
|
|
2325
2324
|
}
|
|
2325
|
+
this.queue.shift();
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Process queue - send messages in ID order that are released
|
|
2330
|
+
*/
|
|
2331
|
+
async processQueue() {
|
|
2332
|
+
await this.lock.inLock(async () => {
|
|
2333
|
+
this.processQueueInternal();
|
|
2326
2334
|
});
|
|
2327
2335
|
}
|
|
2328
2336
|
/**
|
|
@@ -2337,7 +2345,7 @@ class OutgoingMessageQueue {
|
|
|
2337
2345
|
for (const item of this.queue) {
|
|
2338
2346
|
item.released = true;
|
|
2339
2347
|
}
|
|
2340
|
-
|
|
2348
|
+
this.processQueueInternal();
|
|
2341
2349
|
});
|
|
2342
2350
|
}
|
|
2343
2351
|
/**
|
|
@@ -2628,6 +2636,11 @@ async function claudeRemoteLauncher(session) {
|
|
|
2628
2636
|
logger.debug("[remote]: Session reset");
|
|
2629
2637
|
session.clearSessionId();
|
|
2630
2638
|
},
|
|
2639
|
+
onReady: () => {
|
|
2640
|
+
if (!pending && session.queue.size() === 0) {
|
|
2641
|
+
session.client.sendSessionEvent({ type: "ready" });
|
|
2642
|
+
}
|
|
2643
|
+
},
|
|
2631
2644
|
signal: abortController.signal
|
|
2632
2645
|
});
|
|
2633
2646
|
if (!exitReason && abortController.signal.aborted) {
|
|
@@ -2726,7 +2739,7 @@ async function loop(opts) {
|
|
|
2726
2739
|
}
|
|
2727
2740
|
|
|
2728
2741
|
var name = "happy-coder";
|
|
2729
|
-
var version = "0.9.0-
|
|
2742
|
+
var version = "0.9.0-5";
|
|
2730
2743
|
var description = "Claude Code session sharing CLI";
|
|
2731
2744
|
var author = "Kirill Dubovitskiy";
|
|
2732
2745
|
var license = "MIT";
|
package/dist/lib.d.cts
CHANGED
|
@@ -319,6 +319,8 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
319
319
|
} | {
|
|
320
320
|
type: 'permission-mode-changed';
|
|
321
321
|
mode: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
|
322
|
+
} | {
|
|
323
|
+
type: 'ready';
|
|
322
324
|
}, id?: string): void;
|
|
323
325
|
/**
|
|
324
326
|
* Send a ping message to keep the connection alive
|
package/dist/lib.d.mts
CHANGED
|
@@ -319,6 +319,8 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
319
319
|
} | {
|
|
320
320
|
type: 'permission-mode-changed';
|
|
321
321
|
mode: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
|
322
|
+
} | {
|
|
323
|
+
type: 'ready';
|
|
322
324
|
}, id?: string): void;
|
|
323
325
|
/**
|
|
324
326
|
* Send a ping message to keep the connection alive
|