@dhf-claude/grix 0.1.9 → 0.1.10
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/.claude-plugin/plugin.json +1 -1
- package/dist/daemon.js +56 -8
- package/package.json +4 -4
package/dist/daemon.js
CHANGED
|
@@ -15674,17 +15674,17 @@ 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.10",
|
|
15678
15678
|
description: "Claude Code channel plugin for Aibot Grix",
|
|
15679
15679
|
type: "module",
|
|
15680
15680
|
repository: {
|
|
15681
15681
|
type: "git",
|
|
15682
|
-
url: "git+
|
|
15682
|
+
url: "git+ssh://git@github.com/askie/grix-claude.git"
|
|
15683
15683
|
},
|
|
15684
15684
|
bugs: {
|
|
15685
|
-
url: "https://github.com/askie/
|
|
15685
|
+
url: "https://github.com/askie/grix-claude/issues"
|
|
15686
15686
|
},
|
|
15687
|
-
homepage: "https://github.com/askie/
|
|
15687
|
+
homepage: "https://github.com/askie/grix-claude#readme",
|
|
15688
15688
|
publishConfig: {
|
|
15689
15689
|
access: "public"
|
|
15690
15690
|
},
|
|
@@ -15945,6 +15945,13 @@ function withOptionalString(target, key, value) {
|
|
|
15945
15945
|
target[key] = normalized;
|
|
15946
15946
|
}
|
|
15947
15947
|
}
|
|
15948
|
+
function normalizeSessionActivityKind(value) {
|
|
15949
|
+
const normalized = normalizeString20(value);
|
|
15950
|
+
if (!normalized || normalized === "composing") {
|
|
15951
|
+
return "typing";
|
|
15952
|
+
}
|
|
15953
|
+
return normalized;
|
|
15954
|
+
}
|
|
15948
15955
|
function buildAuthPayload(config) {
|
|
15949
15956
|
const clientVersion = normalizeString20(config?.clientVersion) || pluginVersion;
|
|
15950
15957
|
const hostVersion = normalizeString20(config?.hostVersion) || clientVersion;
|
|
@@ -15973,7 +15980,7 @@ function buildSessionActivityPayload({
|
|
|
15973
15980
|
}) {
|
|
15974
15981
|
const payload = {
|
|
15975
15982
|
session_id: normalizeString20(sessionID),
|
|
15976
|
-
kind:
|
|
15983
|
+
kind: normalizeSessionActivityKind(kind),
|
|
15977
15984
|
active: active === true
|
|
15978
15985
|
};
|
|
15979
15986
|
if (Number.isFinite(Number(ttlMs)) && Number(ttlMs) > 0) {
|
|
@@ -18896,6 +18903,11 @@ var init_runtime = __esm({
|
|
|
18896
18903
|
if (normalizedMsg) {
|
|
18897
18904
|
payload.msg = normalizedMsg;
|
|
18898
18905
|
}
|
|
18906
|
+
this.stopTypingForEvent({
|
|
18907
|
+
eventID: event.event_id,
|
|
18908
|
+
sessionID: event.session_id,
|
|
18909
|
+
msgID: event.msg_id
|
|
18910
|
+
});
|
|
18899
18911
|
this.aibotClient.sendEventResult(payload);
|
|
18900
18912
|
this.trace({
|
|
18901
18913
|
stage: "event_result_sent",
|
|
@@ -19196,6 +19208,33 @@ var init_runtime = __esm({
|
|
|
19196
19208
|
msg_id: event.msg_id
|
|
19197
19209
|
});
|
|
19198
19210
|
}
|
|
19211
|
+
stopTypingForEvent({
|
|
19212
|
+
eventID,
|
|
19213
|
+
sessionID = "",
|
|
19214
|
+
msgID = ""
|
|
19215
|
+
} = {}) {
|
|
19216
|
+
const normalizedEventID = normalizeString32(eventID);
|
|
19217
|
+
const normalizedSessionID = normalizeString32(sessionID) || this.messageDeliveryStore.getRememberedSessionID(normalizedEventID);
|
|
19218
|
+
if (!normalizedEventID || !normalizedSessionID || typeof this.aibotClient?.setSessionComposing !== "function") {
|
|
19219
|
+
return;
|
|
19220
|
+
}
|
|
19221
|
+
try {
|
|
19222
|
+
this.aibotClient.setSessionComposing({
|
|
19223
|
+
sessionID: normalizedSessionID,
|
|
19224
|
+
kind: "typing",
|
|
19225
|
+
active: false,
|
|
19226
|
+
refMsgID: normalizeString32(msgID),
|
|
19227
|
+
refEventID: normalizedEventID
|
|
19228
|
+
});
|
|
19229
|
+
} catch (error) {
|
|
19230
|
+
this.trace({
|
|
19231
|
+
stage: "event_typing_stop_failed",
|
|
19232
|
+
event_id: normalizedEventID,
|
|
19233
|
+
session_id: normalizedSessionID,
|
|
19234
|
+
error: error instanceof Error ? error.message : String(error)
|
|
19235
|
+
}, "error");
|
|
19236
|
+
}
|
|
19237
|
+
}
|
|
19199
19238
|
async shouldResumeClaudeSession(binding) {
|
|
19200
19239
|
const claudeSessionID = normalizeString32(binding?.claude_session_id);
|
|
19201
19240
|
const cwd = normalizeString32(binding?.cwd);
|
|
@@ -20122,6 +20161,12 @@ var init_runtime = __esm({
|
|
|
20122
20161
|
const nextPayload = this.buildForwardedWorkerEventResult(payload, failureOptions);
|
|
20123
20162
|
await this.recordWorkerEventResultObserved(nextPayload);
|
|
20124
20163
|
await this.notifyWorkerEventResultFailure(nextPayload, failureOptions);
|
|
20164
|
+
const record = this.getPendingEvent(nextPayload?.event_id);
|
|
20165
|
+
this.stopTypingForEvent({
|
|
20166
|
+
eventID: nextPayload?.event_id,
|
|
20167
|
+
sessionID: nextPayload?.session_id || record?.sessionID,
|
|
20168
|
+
msgID: record?.msgID
|
|
20169
|
+
});
|
|
20125
20170
|
this.aibotClient.sendEventResult(nextPayload);
|
|
20126
20171
|
await this.handleEventCompleted(nextPayload?.event_id);
|
|
20127
20172
|
return nextPayload;
|
|
@@ -20791,12 +20836,13 @@ var init_runtime = __esm({
|
|
|
20791
20836
|
if (!event.event_id || !event.session_id || !event.msg_id) {
|
|
20792
20837
|
return;
|
|
20793
20838
|
}
|
|
20839
|
+
this.ack(event);
|
|
20794
20840
|
const queue = this.sessionQueues.ensure(event.session_id);
|
|
20795
|
-
queue.run(() => this.handleEvent(rawPayload)).catch((err) => {
|
|
20841
|
+
queue.run(() => this.handleEvent(rawPayload, { alreadyAcked: true })).catch((err) => {
|
|
20796
20842
|
this.trace({ stage: "handle_event_error", session_id: event.session_id, event_id: event.event_id, error: String(err?.message ?? err) }, "error");
|
|
20797
20843
|
});
|
|
20798
20844
|
}
|
|
20799
|
-
async handleEvent(rawPayload) {
|
|
20845
|
+
async handleEvent(rawPayload, { alreadyAcked = false } = {}) {
|
|
20800
20846
|
const event = normalizeInboundEventPayload(rawPayload);
|
|
20801
20847
|
if (!event.event_id || !event.session_id || !event.msg_id) {
|
|
20802
20848
|
return;
|
|
@@ -20808,7 +20854,9 @@ var init_runtime = __esm({
|
|
|
20808
20854
|
msg_id: event.msg_id,
|
|
20809
20855
|
sender_id: event.sender_id
|
|
20810
20856
|
});
|
|
20811
|
-
|
|
20857
|
+
if (!alreadyAcked) {
|
|
20858
|
+
this.ack(event);
|
|
20859
|
+
}
|
|
20812
20860
|
if (isRecordOnlyMirror(event)) {
|
|
20813
20861
|
this.trace({
|
|
20814
20862
|
stage: "event_mirrored_record_only",
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhf-claude/grix",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Claude Code channel plugin for Aibot Grix",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+
|
|
8
|
+
"url": "git+ssh://git@github.com/askie/grix-claude.git"
|
|
9
9
|
},
|
|
10
10
|
"bugs": {
|
|
11
|
-
"url": "https://github.com/askie/
|
|
11
|
+
"url": "https://github.com/askie/grix-claude/issues"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/askie/
|
|
13
|
+
"homepage": "https://github.com/askie/grix-claude#readme",
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|