grix-connector 1.0.2 → 1.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/adapter/acp/acp-adapter.js +10 -8
- package/dist/adapter/claude/claude-adapter.js +16 -15
- package/dist/adapter/claude/claude-bridge-server.js +1 -1
- package/dist/adapter/claude/mcp-http-launcher.js +2 -2
- package/dist/adapter/codewhale/codewhale-adapter.js +4 -3
- package/dist/adapter/codex/codex-bridge.js +6 -6
- package/dist/adapter/cursor/cursor-adapter.js +3 -2
- package/dist/adapter/opencode/opencode-adapter.js +7 -4
- package/dist/adapter/openhuman/openhuman-adapter.js +5 -2
- package/dist/adapter/pi/pi-adapter.js +8 -5
- package/dist/bridge/adapter-pool.js +1 -1
- package/dist/bridge/bridge.js +10 -6
- package/dist/bridge/deferred-events.js +1 -1
- package/dist/bridge/event-queue.js +1 -1
- package/dist/bridge/send-controller.js +4 -1
- package/dist/core/admin/admin-server.js +1 -0
- package/dist/core/admin/admin-token.js +1 -0
- package/dist/core/admin/index.js +1 -0
- package/dist/core/aibot/client.js +2 -1
- package/dist/core/aibot/connection-handle.js +1 -1
- package/dist/core/file-ops/handler.js +1 -1
- package/dist/core/mcp/event-tool-executor.js +1 -1
- package/dist/core/mcp/event-tool-port.js +0 -0
- package/dist/core/protocol/message-metadata.js +1 -1
- package/dist/core/protocol/message-reference.js +1 -1
- package/dist/core/protocol/payload-parser.js +6 -6
- package/dist/core/protocol/protocol-text.js +1 -1
- package/dist/core/provider-quota/kiro.js +1 -1
- package/dist/core/text-segmentation/safe-markdown-stream-segmenter.js +6 -6
- package/dist/core/upgrade/upgrade-checker.js +1 -1
- package/dist/grix.js +4 -3
- package/dist/log.js +2 -2
- package/dist/manager.js +2 -1
- package/dist/mcp/stream-http/gateway.js +1 -1
- package/dist/mcp/stream-http/security.js +1 -1
- package/dist/mcp/stream-http/tool-schemas.js +1 -1
- package/dist/protocol/acp-client.js +1 -1
- package/openclaw-plugin/index.js +15 -10
- package/package.json +4 -3
package/openclaw-plugin/index.js
CHANGED
|
@@ -2575,7 +2575,7 @@ function computeAibotSendThrottleDelayMs(sentAtMs, nowMs) {
|
|
|
2575
2575
|
}
|
|
2576
2576
|
|
|
2577
2577
|
// src/core/protocol/protocol-text.ts
|
|
2578
|
-
var AIBOT_PROTOCOL_MAX_RUNES =
|
|
2578
|
+
var AIBOT_PROTOCOL_MAX_RUNES = 16 * 1024;
|
|
2579
2579
|
var AIBOT_PROTOCOL_MAX_BYTES = 12 * 1024;
|
|
2580
2580
|
var DEFAULT_OUTBOUND_TEXT_CHUNK_LIMIT = 1200;
|
|
2581
2581
|
var DEFAULT_STREAM_CHUNK_LIMIT = 48;
|
|
@@ -3668,6 +3668,11 @@ var AibotWsClient = class {
|
|
|
3668
3668
|
if (!normalizedDeltaContent && !opts.isFinish) {
|
|
3669
3669
|
return;
|
|
3670
3670
|
}
|
|
3671
|
+
if (!normalizedDeltaContent && opts.isFinish) {
|
|
3672
|
+
const msg = `grix client_stream_chunk: delta_content must not be empty (including finish chunk) sessionId=${sessionId} clientMsgId=${opts.clientMsgId} chunkSeq=${opts.chunkSeq}`;
|
|
3673
|
+
this.logError(msg);
|
|
3674
|
+
throw new Error(msg);
|
|
3675
|
+
}
|
|
3671
3676
|
const payload = {
|
|
3672
3677
|
session_id: sessionId,
|
|
3673
3678
|
client_msg_id: opts.clientMsgId,
|
|
@@ -6490,18 +6495,18 @@ function normalizeText3(value) {
|
|
|
6490
6495
|
return normalized || void 0;
|
|
6491
6496
|
}
|
|
6492
6497
|
function normalizeAttachmentType(attachment) {
|
|
6493
|
-
const
|
|
6494
|
-
if (
|
|
6495
|
-
return
|
|
6498
|
+
const contentType = normalizeText3(attachment.content_type);
|
|
6499
|
+
if (contentType) {
|
|
6500
|
+
return contentType;
|
|
6496
6501
|
}
|
|
6497
|
-
const kind = normalizeText3(attachment.
|
|
6502
|
+
const kind = normalizeText3(attachment.attachment_type)?.toLowerCase();
|
|
6498
6503
|
if (kind === "image" || kind === "audio" || kind === "video") {
|
|
6499
6504
|
return kind;
|
|
6500
6505
|
}
|
|
6501
6506
|
return void 0;
|
|
6502
6507
|
}
|
|
6503
6508
|
function resolveInboundAttachments(event) {
|
|
6504
|
-
return (event.attachments ?? []).filter((attachment) => Boolean(normalizeText3(attachment.
|
|
6509
|
+
return (event.attachments ?? []).filter((attachment) => Boolean(normalizeText3(attachment.media_url)));
|
|
6505
6510
|
}
|
|
6506
6511
|
function buildInboundMediaFields(event) {
|
|
6507
6512
|
const attachments = resolveInboundAttachments(event);
|
|
@@ -6510,7 +6515,7 @@ function buildInboundMediaFields(event) {
|
|
|
6510
6515
|
attachmentCount: 0
|
|
6511
6516
|
};
|
|
6512
6517
|
}
|
|
6513
|
-
const mediaUrls = attachments.map((attachment) => normalizeText3(attachment.
|
|
6518
|
+
const mediaUrls = attachments.map((attachment) => normalizeText3(attachment.media_url)).filter((entry) => Boolean(entry));
|
|
6514
6519
|
const mediaTypes = attachments.map((attachment) => normalizeAttachmentType(attachment)).filter((entry) => Boolean(entry));
|
|
6515
6520
|
return {
|
|
6516
6521
|
MediaUrl: mediaUrls[0],
|
|
@@ -6687,7 +6692,7 @@ function createAppendOnlyReplyStream(params) {
|
|
|
6687
6692
|
}
|
|
6688
6693
|
const chunkSeq = nextChunkSeq;
|
|
6689
6694
|
nextChunkSeq += 1;
|
|
6690
|
-
await params.client.sendStreamChunk(params.sessionId, "", {
|
|
6695
|
+
await params.client.sendStreamChunk(params.sessionId, "\n", {
|
|
6691
6696
|
eventId: params.eventId,
|
|
6692
6697
|
clientMsgId: params.clientMsgId,
|
|
6693
6698
|
chunkSeq,
|
|
@@ -7593,7 +7598,7 @@ Supported: skills, stop`;
|
|
|
7593
7598
|
}
|
|
7594
7599
|
if (chunkSeq > 0 && !runAbortController.signal.aborted) {
|
|
7595
7600
|
chunkSeq++;
|
|
7596
|
-
await client.sendStreamChunk(sessionId, "", {
|
|
7601
|
+
await client.sendStreamChunk(sessionId, "\n", {
|
|
7597
7602
|
eventId,
|
|
7598
7603
|
clientMsgId: stableClientMsgId,
|
|
7599
7604
|
chunkSeq,
|
|
@@ -7844,7 +7849,7 @@ async function monitorAibotProvider(options) {
|
|
|
7844
7849
|
senderId: toStringId2(event.sender_id),
|
|
7845
7850
|
content: String(event.content ?? ""),
|
|
7846
7851
|
accountId: account.accountId,
|
|
7847
|
-
mediaUrls: event.attachments?.map((a) => a.
|
|
7852
|
+
mediaUrls: event.attachments?.map((a) => a.media_url ?? "").filter(Boolean)
|
|
7848
7853
|
});
|
|
7849
7854
|
void processEvent({
|
|
7850
7855
|
event,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Connect local AI coding agents (Claude, Codex, Gemini, Qwen, DeepSeek, Cursor, OpenCode, Pi, OpenHuman, Reasonix) to the Grix scheduling platform. Also serves as an OpenClaw plugin for Grix channel transport.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,13 +20,14 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postinstall": "node scripts/install-guardian.mjs",
|
|
22
22
|
"prepublishOnly": "npm run build:all",
|
|
23
|
-
"build": "tsc",
|
|
23
|
+
"build": "npm run check:isolation && tsc",
|
|
24
|
+
"check:isolation": "node scripts/check-adapter-isolation.mjs",
|
|
24
25
|
"build:plugin": "node scripts/build-plugin.mjs",
|
|
25
26
|
"build:all": "npm run build && node scripts/minify-dist.mjs && npm run build:plugin",
|
|
26
27
|
"dev": "npm run build && node dist/grix.js",
|
|
27
28
|
"test": "node --experimental-vm-modules node_modules/vitest/vitest.mjs run",
|
|
28
29
|
"test:watch": "node --experimental-vm-modules node_modules/vitest/vitest.mjs",
|
|
29
|
-
"lint": "tsc --noEmit",
|
|
30
|
+
"lint": "npm run check:isolation && tsc --noEmit",
|
|
30
31
|
"start": "node dist/grix.js start",
|
|
31
32
|
"stop": "node dist/grix.js stop",
|
|
32
33
|
"restart": "node dist/grix.js restart",
|