@alfe.ai/openclaw-google-chat 0.0.6 → 0.0.7
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/plugin2.cjs +5 -5
- package/dist/plugin2.js +5 -5
- package/package.json +1 -1
package/dist/plugin2.cjs
CHANGED
|
@@ -51,9 +51,9 @@ var StateManager = class {
|
|
|
51
51
|
}
|
|
52
52
|
if (this.dirty) await this.flush();
|
|
53
53
|
}
|
|
54
|
-
/** Get the last-seen timestamp for a space, or
|
|
54
|
+
/** Get the last-seen timestamp for a space, or undefined if not yet tracked. */
|
|
55
55
|
getLastSeenTimestamp(spaceName) {
|
|
56
|
-
return this.state.spaces[spaceName]?.lastSeenTimestamp
|
|
56
|
+
return this.state.spaces[spaceName]?.lastSeenTimestamp;
|
|
57
57
|
}
|
|
58
58
|
/** Get the agent's userId for a space (if previously resolved). */
|
|
59
59
|
getAgentUserId(spaceName) {
|
|
@@ -66,7 +66,7 @@ var StateManager = class {
|
|
|
66
66
|
/** Update state for a space. */
|
|
67
67
|
updateSpace(spaceName, data) {
|
|
68
68
|
const existing = this.state.spaces[spaceName] ?? {
|
|
69
|
-
lastSeenTimestamp: (/* @__PURE__ */ new Date(
|
|
69
|
+
lastSeenTimestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
70
70
|
agentUserId: "",
|
|
71
71
|
peerUserId: ""
|
|
72
72
|
};
|
|
@@ -280,7 +280,7 @@ var GChatPoller = class {
|
|
|
280
280
|
} catch (err) {
|
|
281
281
|
this.log.warn(`Failed to resolve members for ${spaceName}: ${err instanceof Error ? err.message : String(err)}`);
|
|
282
282
|
}
|
|
283
|
-
const lastSeenTimestamp = this.stateManager.getLastSeenTimestamp(spaceName)
|
|
283
|
+
const lastSeenTimestamp = this.stateManager.getLastSeenTimestamp(spaceName) ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
284
284
|
this.stateManager.updateSpace(spaceName, {
|
|
285
285
|
lastSeenTimestamp,
|
|
286
286
|
agentUserId,
|
|
@@ -305,7 +305,7 @@ var GChatPoller = class {
|
|
|
305
305
|
let peerDisplayName = null;
|
|
306
306
|
for (const m of members) {
|
|
307
307
|
if (m.member.type !== "HUMAN") continue;
|
|
308
|
-
if (this.agentEmail && m.member.displayName
|
|
308
|
+
if (this.agentEmail && m.member.displayName?.toLowerCase().includes(this.agentEmail.split("@")[0].toLowerCase())) agentUserId = m.member.name;
|
|
309
309
|
else {
|
|
310
310
|
peerUserId = m.member.name;
|
|
311
311
|
peerDisplayName = m.member.displayName || null;
|
package/dist/plugin2.js
CHANGED
|
@@ -51,9 +51,9 @@ var StateManager = class {
|
|
|
51
51
|
}
|
|
52
52
|
if (this.dirty) await this.flush();
|
|
53
53
|
}
|
|
54
|
-
/** Get the last-seen timestamp for a space, or
|
|
54
|
+
/** Get the last-seen timestamp for a space, or undefined if not yet tracked. */
|
|
55
55
|
getLastSeenTimestamp(spaceName) {
|
|
56
|
-
return this.state.spaces[spaceName]?.lastSeenTimestamp
|
|
56
|
+
return this.state.spaces[spaceName]?.lastSeenTimestamp;
|
|
57
57
|
}
|
|
58
58
|
/** Get the agent's userId for a space (if previously resolved). */
|
|
59
59
|
getAgentUserId(spaceName) {
|
|
@@ -66,7 +66,7 @@ var StateManager = class {
|
|
|
66
66
|
/** Update state for a space. */
|
|
67
67
|
updateSpace(spaceName, data) {
|
|
68
68
|
const existing = this.state.spaces[spaceName] ?? {
|
|
69
|
-
lastSeenTimestamp: (/* @__PURE__ */ new Date(
|
|
69
|
+
lastSeenTimestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
70
70
|
agentUserId: "",
|
|
71
71
|
peerUserId: ""
|
|
72
72
|
};
|
|
@@ -280,7 +280,7 @@ var GChatPoller = class {
|
|
|
280
280
|
} catch (err) {
|
|
281
281
|
this.log.warn(`Failed to resolve members for ${spaceName}: ${err instanceof Error ? err.message : String(err)}`);
|
|
282
282
|
}
|
|
283
|
-
const lastSeenTimestamp = this.stateManager.getLastSeenTimestamp(spaceName)
|
|
283
|
+
const lastSeenTimestamp = this.stateManager.getLastSeenTimestamp(spaceName) ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
284
284
|
this.stateManager.updateSpace(spaceName, {
|
|
285
285
|
lastSeenTimestamp,
|
|
286
286
|
agentUserId,
|
|
@@ -305,7 +305,7 @@ var GChatPoller = class {
|
|
|
305
305
|
let peerDisplayName = null;
|
|
306
306
|
for (const m of members) {
|
|
307
307
|
if (m.member.type !== "HUMAN") continue;
|
|
308
|
-
if (this.agentEmail && m.member.displayName
|
|
308
|
+
if (this.agentEmail && m.member.displayName?.toLowerCase().includes(this.agentEmail.split("@")[0].toLowerCase())) agentUserId = m.member.name;
|
|
309
309
|
else {
|
|
310
310
|
peerUserId = m.member.name;
|
|
311
311
|
peerDisplayName = m.member.displayName || null;
|
package/package.json
CHANGED