@dhf-claude/grix 0.1.10 → 0.1.11
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/daemon.js +39 -2
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/daemon.js
CHANGED
|
@@ -15674,7 +15674,7 @@ var init_package = __esm({
|
|
|
15674
15674
|
"package.json"() {
|
|
15675
15675
|
package_default = {
|
|
15676
15676
|
name: "@dhf-claude/grix",
|
|
15677
|
-
version: "0.1.
|
|
15677
|
+
version: "0.1.11",
|
|
15678
15678
|
description: "Claude Code channel plugin for Aibot Grix",
|
|
15679
15679
|
type: "module",
|
|
15680
15680
|
repository: {
|
|
@@ -21304,7 +21304,8 @@ __export(main_exports, {
|
|
|
21304
21304
|
notifyWorkerReady: () => notifyWorkerReady,
|
|
21305
21305
|
run: () => run,
|
|
21306
21306
|
shouldIgnoreWorkerStatusUpdate: () => shouldIgnoreWorkerStatusUpdate,
|
|
21307
|
-
shouldNotifyWorkerReady: () => shouldNotifyWorkerReady
|
|
21307
|
+
shouldNotifyWorkerReady: () => shouldNotifyWorkerReady,
|
|
21308
|
+
shouldPreserveWorkerStatusOnRegister: () => shouldPreserveWorkerStatusOnRegister
|
|
21308
21309
|
});
|
|
21309
21310
|
import process15 from "node:process";
|
|
21310
21311
|
function usage() {
|
|
@@ -21386,6 +21387,21 @@ function shouldIgnoreWorkerStatusUpdate(previousBinding, payload) {
|
|
|
21386
21387
|
}
|
|
21387
21388
|
return false;
|
|
21388
21389
|
}
|
|
21390
|
+
function shouldPreserveWorkerStatusOnRegister(previousBinding, payload) {
|
|
21391
|
+
if (!previousBinding) {
|
|
21392
|
+
return false;
|
|
21393
|
+
}
|
|
21394
|
+
if (shouldIgnoreWorkerStatusUpdate(previousBinding, payload)) {
|
|
21395
|
+
return false;
|
|
21396
|
+
}
|
|
21397
|
+
const currentStatus = normalizeString35(previousBinding.worker_status);
|
|
21398
|
+
if (currentStatus !== "connected" && currentStatus !== "ready") {
|
|
21399
|
+
return false;
|
|
21400
|
+
}
|
|
21401
|
+
return Boolean(
|
|
21402
|
+
normalizeString35(previousBinding.worker_control_url) && normalizeString35(previousBinding.worker_control_token)
|
|
21403
|
+
);
|
|
21404
|
+
}
|
|
21389
21405
|
function buildWorkerReadyNoticeText(binding) {
|
|
21390
21406
|
return "claude ready! please retry again.";
|
|
21391
21407
|
}
|
|
@@ -21483,6 +21499,27 @@ async function run(argv = [], env = process15.env) {
|
|
|
21483
21499
|
if (!existing) {
|
|
21484
21500
|
return { ok: false, reason: "binding_not_found" };
|
|
21485
21501
|
}
|
|
21502
|
+
if (shouldIgnoreWorkerStatusUpdate(existing, payload)) {
|
|
21503
|
+
logger.trace({
|
|
21504
|
+
stage: "worker_register_ignored_stale",
|
|
21505
|
+
aibot_session_id: aibotSessionID,
|
|
21506
|
+
worker_id: payload?.worker_id,
|
|
21507
|
+
claude_session_id: payload?.claude_session_id,
|
|
21508
|
+
expected_worker_id: existing?.worker_id,
|
|
21509
|
+
expected_claude_session_id: existing?.claude_session_id
|
|
21510
|
+
}, { level: "error" });
|
|
21511
|
+
return { ok: true };
|
|
21512
|
+
}
|
|
21513
|
+
if (shouldPreserveWorkerStatusOnRegister(existing, payload)) {
|
|
21514
|
+
logger.trace({
|
|
21515
|
+
stage: "worker_register_preserved_existing_status",
|
|
21516
|
+
aibot_session_id: aibotSessionID,
|
|
21517
|
+
worker_id: payload?.worker_id,
|
|
21518
|
+
claude_session_id: payload?.claude_session_id,
|
|
21519
|
+
worker_status: existing?.worker_status
|
|
21520
|
+
});
|
|
21521
|
+
return { ok: true };
|
|
21522
|
+
}
|
|
21486
21523
|
await bindingRegistry.markWorkerStarting(aibotSessionID, {
|
|
21487
21524
|
workerID,
|
|
21488
21525
|
workerPid,
|
package/dist/index.js
CHANGED
|
@@ -25776,8 +25776,8 @@ function createWorkerApp({ env = process4.env } = {}) {
|
|
|
25776
25776
|
await elicitationStore.init();
|
|
25777
25777
|
await interactionService.restoreEventState();
|
|
25778
25778
|
await bridge.startControlServer();
|
|
25779
|
-
await mcp.connect(new StdioServerTransport());
|
|
25780
25779
|
if (!bridge.isDaemonBridgeActive()) {
|
|
25780
|
+
await mcp.connect(new StdioServerTransport());
|
|
25781
25781
|
logger.info("worker started without daemon bridge for MCP health checks");
|
|
25782
25782
|
return;
|
|
25783
25783
|
}
|
|
@@ -25787,6 +25787,7 @@ function createWorkerApp({ env = process4.env } = {}) {
|
|
|
25787
25787
|
pid: process4.pid
|
|
25788
25788
|
});
|
|
25789
25789
|
await bridge.sendConnectedStatus();
|
|
25790
|
+
await mcp.connect(new StdioServerTransport());
|
|
25790
25791
|
interactionService.startDispatchPumps();
|
|
25791
25792
|
logger.info("worker connected in daemon bridge mode");
|
|
25792
25793
|
},
|