@elizaos/plugin-x 2.0.3-beta.6 → 2.0.3-beta.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/chunk-VU26ZOMZ.js +176 -0
- package/dist/chunk-VU26ZOMZ.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13106 -0
- package/dist/index.js.map +1 -0
- package/dist/lifeops-message-adapter.d.ts +21 -0
- package/dist/lifeops-message-adapter.js +7 -0
- package/dist/lifeops-message-adapter.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/lifeops-message-adapter.ts
|
|
8
|
+
import {
|
|
9
|
+
BaseMessageAdapter,
|
|
10
|
+
NotYetImplementedError
|
|
11
|
+
} from "@elizaos/core/node";
|
|
12
|
+
function record(value) {
|
|
13
|
+
return value && typeof value === "object" ? value : {};
|
|
14
|
+
}
|
|
15
|
+
function stringField(value, fallback = "") {
|
|
16
|
+
return typeof value === "string" && value.length > 0 ? value : fallback;
|
|
17
|
+
}
|
|
18
|
+
function firstStringField(...values) {
|
|
19
|
+
for (const value of values) {
|
|
20
|
+
const normalized = stringField(value);
|
|
21
|
+
if (normalized) return normalized;
|
|
22
|
+
}
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
function getXRuntimeService(runtime) {
|
|
26
|
+
const service = runtime.getService("x") ?? runtime.getService("twitter");
|
|
27
|
+
return service && typeof service === "object" ? service : null;
|
|
28
|
+
}
|
|
29
|
+
function encodeDraftBody(body) {
|
|
30
|
+
return Buffer.from(body, "utf8").toString("base64url");
|
|
31
|
+
}
|
|
32
|
+
function decodeDraftBody(encoded) {
|
|
33
|
+
return Buffer.from(encoded, "base64url").toString("utf8");
|
|
34
|
+
}
|
|
35
|
+
function memoryToMessageRef(memory) {
|
|
36
|
+
const metadata = record(memory.metadata);
|
|
37
|
+
const content = record(memory.content);
|
|
38
|
+
const x = record(metadata.x);
|
|
39
|
+
const sender = record(metadata.sender);
|
|
40
|
+
const receivedAtMs = Number(memory.createdAt);
|
|
41
|
+
const senderId = firstStringField(x.senderId, sender.id, memory.entityId) || "unknown";
|
|
42
|
+
const senderHandle = firstStringField(x.senderUsername, sender.username);
|
|
43
|
+
const body = stringField(content.text);
|
|
44
|
+
const externalId = firstStringField(
|
|
45
|
+
x.dmEventId,
|
|
46
|
+
metadata.messageIdFull,
|
|
47
|
+
memory.id
|
|
48
|
+
);
|
|
49
|
+
const threadId = firstStringField(x.conversationId, memory.roomId, senderId);
|
|
50
|
+
return {
|
|
51
|
+
id: `twitter:${externalId}`,
|
|
52
|
+
source: "twitter",
|
|
53
|
+
externalId,
|
|
54
|
+
threadId,
|
|
55
|
+
from: {
|
|
56
|
+
identifier: senderId,
|
|
57
|
+
displayName: senderHandle
|
|
58
|
+
},
|
|
59
|
+
to: [],
|
|
60
|
+
snippet: body.slice(0, 200),
|
|
61
|
+
body,
|
|
62
|
+
receivedAtMs: Number.isFinite(receivedAtMs) ? receivedAtMs : Date.now(),
|
|
63
|
+
hasAttachments: false,
|
|
64
|
+
isRead: false,
|
|
65
|
+
channelId: threadId,
|
|
66
|
+
metadata
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function normalizeListLimit(limit) {
|
|
70
|
+
if (limit === void 0) return 25;
|
|
71
|
+
if (!Number.isFinite(limit)) return 25;
|
|
72
|
+
return Math.min(100, Math.max(1, Math.floor(limit)));
|
|
73
|
+
}
|
|
74
|
+
function parseDraftId(draftId) {
|
|
75
|
+
const parts = draftId.split(":");
|
|
76
|
+
if (parts.length !== 4 || parts[0] !== "twitter") {
|
|
77
|
+
throw new Error(`[XDmAdapter] malformed draftId ${draftId}`);
|
|
78
|
+
}
|
|
79
|
+
const participantId = parts[1] ? decodeURIComponent(parts[1]) : "";
|
|
80
|
+
const text = parts[3] ? decodeDraftBody(parts[3]) : "";
|
|
81
|
+
if (!participantId) {
|
|
82
|
+
throw new Error(
|
|
83
|
+
`[XDmAdapter] cannot resolve recipient from draftId ${draftId}`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (!text) {
|
|
87
|
+
throw new Error(`[XDmAdapter] cannot resolve body from draftId ${draftId}`);
|
|
88
|
+
}
|
|
89
|
+
return { participantId, text };
|
|
90
|
+
}
|
|
91
|
+
var XDmAdapter = class extends BaseMessageAdapter {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments);
|
|
94
|
+
this.source = "twitter";
|
|
95
|
+
}
|
|
96
|
+
isAvailable(runtime) {
|
|
97
|
+
return Boolean(getXRuntimeService(runtime));
|
|
98
|
+
}
|
|
99
|
+
capabilities() {
|
|
100
|
+
return {
|
|
101
|
+
list: true,
|
|
102
|
+
search: false,
|
|
103
|
+
manage: {},
|
|
104
|
+
send: { reply: true, new: true, schedule: false },
|
|
105
|
+
worlds: "single",
|
|
106
|
+
channels: "implicit"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async listMessagesImpl(runtime, opts) {
|
|
110
|
+
const service = getXRuntimeService(runtime);
|
|
111
|
+
if (typeof service?.fetchDirectMessagesForAccount !== "function") {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
const limit = normalizeListLimit(opts.limit);
|
|
115
|
+
const sinceMs = opts.sinceMs;
|
|
116
|
+
const memories = await service.fetchDirectMessagesForAccount("default", {
|
|
117
|
+
participantId: void 0,
|
|
118
|
+
limit
|
|
119
|
+
});
|
|
120
|
+
const refs = memories.map(memoryToMessageRef);
|
|
121
|
+
return refs.filter((ref) => {
|
|
122
|
+
if (sinceMs !== void 0 && Number.isFinite(ref.receivedAtMs) && ref.receivedAtMs < sinceMs) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async getMessageImpl(runtime, id) {
|
|
129
|
+
const all = await this.listMessages(runtime, { limit: 100 });
|
|
130
|
+
return all.find((ref) => ref.id === id) ?? null;
|
|
131
|
+
}
|
|
132
|
+
async createDraftImpl(_runtime, draft) {
|
|
133
|
+
const recipient = draft.to[0]?.identifier;
|
|
134
|
+
if (!recipient) {
|
|
135
|
+
throw new Error(
|
|
136
|
+
"[XDmAdapter] createDraft requires a recipient identifier"
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
if (!draft.body.trim()) {
|
|
140
|
+
throw new Error("[XDmAdapter] createDraft requires non-empty body");
|
|
141
|
+
}
|
|
142
|
+
const draftId = `twitter:${encodeURIComponent(recipient)}:${Date.now()}:${encodeDraftBody(draft.body)}`;
|
|
143
|
+
const preview = draft.body.length > 200 ? `${draft.body.slice(0, 197)}...` : draft.body;
|
|
144
|
+
return { draftId, preview };
|
|
145
|
+
}
|
|
146
|
+
async sendDraftImpl(runtime, draftId) {
|
|
147
|
+
const service = getXRuntimeService(runtime);
|
|
148
|
+
if (typeof service?.sendDirectMessageForAccount !== "function") {
|
|
149
|
+
throw new Error("[XDmAdapter] X runtime service is unavailable");
|
|
150
|
+
}
|
|
151
|
+
const { participantId, text } = parseDraftId(draftId);
|
|
152
|
+
const sent = await service.sendDirectMessageForAccount("default", {
|
|
153
|
+
participantId,
|
|
154
|
+
text
|
|
155
|
+
});
|
|
156
|
+
if (sent.ok === false) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`[XDmAdapter] failed to send direct message${sent.status ? ` (status ${sent.status})` : ""}`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
externalId: sent.messageId ?? `${participantId}:${Date.now()}`
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
scheduleSendImpl(_runtime, _draftId, _sendAtMs) {
|
|
166
|
+
throw new NotYetImplementedError(
|
|
167
|
+
"x_dm adapter: native scheduleSend (use core's local timer fallback)"
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
__export,
|
|
174
|
+
XDmAdapter
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=chunk-VU26ZOMZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lifeops-message-adapter.ts"],"sourcesContent":["import {\n BaseMessageAdapter,\n type DraftRequest,\n type IAgentRuntime,\n type ListOptions,\n type Memory,\n type MessageAdapterCapabilities,\n type MessageRef,\n type MessageSource,\n NotYetImplementedError,\n} from \"@elizaos/core/node\";\n\ntype XRuntimeServiceLike = {\n sendDirectMessageForAccount?: (\n accountId: string,\n params: { participantId: string; text: string },\n ) => Promise<{ ok?: boolean; status?: number; messageId?: string | null }>;\n fetchDirectMessagesForAccount?: (\n accountId: string,\n params?: { participantId?: string; limit?: number },\n ) => Promise<Memory[]>;\n};\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === \"object\"\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction stringField(value: unknown, fallback = \"\"): string {\n return typeof value === \"string\" && value.length > 0 ? value : fallback;\n}\n\nfunction firstStringField(...values: unknown[]): string {\n for (const value of values) {\n const normalized = stringField(value);\n if (normalized) return normalized;\n }\n return \"\";\n}\n\nfunction getXRuntimeService(\n runtime: IAgentRuntime,\n): XRuntimeServiceLike | null {\n const service = runtime.getService(\"x\") ?? runtime.getService(\"twitter\");\n return service && typeof service === \"object\"\n ? (service as XRuntimeServiceLike)\n : null;\n}\n\nfunction encodeDraftBody(body: string): string {\n return Buffer.from(body, \"utf8\").toString(\"base64url\");\n}\n\nfunction decodeDraftBody(encoded: string): string {\n return Buffer.from(encoded, \"base64url\").toString(\"utf8\");\n}\n\nfunction memoryToMessageRef(memory: Memory): MessageRef {\n const metadata = record(memory.metadata);\n const content = record(memory.content);\n const x = record(metadata.x);\n const sender = record(metadata.sender);\n const receivedAtMs = Number(memory.createdAt);\n const senderId =\n firstStringField(x.senderId, sender.id, memory.entityId) || \"unknown\";\n const senderHandle = firstStringField(x.senderUsername, sender.username);\n const body = stringField(content.text);\n const externalId = firstStringField(\n x.dmEventId,\n metadata.messageIdFull,\n memory.id,\n );\n const threadId = firstStringField(x.conversationId, memory.roomId, senderId);\n return {\n id: `twitter:${externalId}`,\n source: \"twitter\",\n externalId,\n threadId,\n from: {\n identifier: senderId,\n displayName: senderHandle,\n },\n to: [],\n snippet: body.slice(0, 200),\n body,\n receivedAtMs: Number.isFinite(receivedAtMs) ? receivedAtMs : Date.now(),\n hasAttachments: false,\n isRead: false,\n channelId: threadId,\n metadata,\n };\n}\n\nfunction normalizeListLimit(limit: number | undefined): number {\n if (limit === undefined) return 25;\n if (!Number.isFinite(limit)) return 25;\n return Math.min(100, Math.max(1, Math.floor(limit)));\n}\n\nfunction parseDraftId(draftId: string): {\n participantId: string;\n text: string;\n} {\n const parts = draftId.split(\":\");\n if (parts.length !== 4 || parts[0] !== \"twitter\") {\n throw new Error(`[XDmAdapter] malformed draftId ${draftId}`);\n }\n const participantId = parts[1] ? decodeURIComponent(parts[1]) : \"\";\n const text = parts[3] ? decodeDraftBody(parts[3]) : \"\";\n if (!participantId) {\n throw new Error(\n `[XDmAdapter] cannot resolve recipient from draftId ${draftId}`,\n );\n }\n if (!text) {\n throw new Error(`[XDmAdapter] cannot resolve body from draftId ${draftId}`);\n }\n return { participantId, text };\n}\n\nexport class XDmAdapter extends BaseMessageAdapter {\n readonly source: MessageSource = \"twitter\";\n\n isAvailable(runtime: IAgentRuntime): boolean {\n return Boolean(getXRuntimeService(runtime));\n }\n\n capabilities(): MessageAdapterCapabilities {\n return {\n list: true,\n search: false,\n manage: {},\n send: { reply: true, new: true, schedule: false },\n worlds: \"single\",\n channels: \"implicit\",\n };\n }\n\n protected async listMessagesImpl(\n runtime: IAgentRuntime,\n opts: ListOptions,\n ): Promise<MessageRef[]> {\n const service = getXRuntimeService(runtime);\n if (typeof service?.fetchDirectMessagesForAccount !== \"function\") {\n return [];\n }\n\n const limit = normalizeListLimit(opts.limit);\n const sinceMs = opts.sinceMs;\n const memories = await service.fetchDirectMessagesForAccount(\"default\", {\n participantId: undefined,\n limit,\n });\n const refs = memories.map(memoryToMessageRef);\n return refs.filter((ref) => {\n if (\n sinceMs !== undefined &&\n Number.isFinite(ref.receivedAtMs) &&\n ref.receivedAtMs < sinceMs\n ) {\n return false;\n }\n return true;\n });\n }\n\n protected async getMessageImpl(\n runtime: IAgentRuntime,\n id: string,\n ): Promise<MessageRef | null> {\n const all = await this.listMessages(runtime, { limit: 100 });\n return all.find((ref) => ref.id === id) ?? null;\n }\n\n protected async createDraftImpl(\n _runtime: IAgentRuntime,\n draft: DraftRequest,\n ): Promise<{ draftId: string; preview: string }> {\n const recipient = draft.to[0]?.identifier;\n if (!recipient) {\n throw new Error(\n \"[XDmAdapter] createDraft requires a recipient identifier\",\n );\n }\n if (!draft.body.trim()) {\n throw new Error(\"[XDmAdapter] createDraft requires non-empty body\");\n }\n const draftId = `twitter:${encodeURIComponent(recipient)}:${Date.now()}:${encodeDraftBody(draft.body)}`;\n const preview =\n draft.body.length > 200 ? `${draft.body.slice(0, 197)}...` : draft.body;\n return { draftId, preview };\n }\n\n protected async sendDraftImpl(\n runtime: IAgentRuntime,\n draftId: string,\n ): Promise<{ externalId: string }> {\n const service = getXRuntimeService(runtime);\n if (typeof service?.sendDirectMessageForAccount !== \"function\") {\n throw new Error(\"[XDmAdapter] X runtime service is unavailable\");\n }\n\n const { participantId, text } = parseDraftId(draftId);\n const sent = await service.sendDirectMessageForAccount(\"default\", {\n participantId,\n text,\n });\n if (sent.ok === false) {\n throw new Error(\n `[XDmAdapter] failed to send direct message${\n sent.status ? ` (status ${sent.status})` : \"\"\n }`,\n );\n }\n return {\n externalId: sent.messageId ?? `${participantId}:${Date.now()}`,\n };\n }\n\n protected scheduleSendImpl(\n _runtime: IAgentRuntime,\n _draftId: string,\n _sendAtMs: number,\n ): Promise<{ scheduledId: string }> {\n throw new NotYetImplementedError(\n \"x_dm adapter: native scheduleSend (use core's local timer fallback)\",\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;AAAA,EACE;AAAA,EAQA;AAAA,OACK;AAaP,SAAS,OAAO,OAAyC;AACvD,SAAO,SAAS,OAAO,UAAU,WAC5B,QACD,CAAC;AACP;AAEA,SAAS,YAAY,OAAgB,WAAW,IAAY;AAC1D,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AACjE;AAEA,SAAS,oBAAoB,QAA2B;AACtD,aAAW,SAAS,QAAQ;AAC1B,UAAM,aAAa,YAAY,KAAK;AACpC,QAAI,WAAY,QAAO;AAAA,EACzB;AACA,SAAO;AACT;AAEA,SAAS,mBACP,SAC4B;AAC5B,QAAM,UAAU,QAAQ,WAAW,GAAG,KAAK,QAAQ,WAAW,SAAS;AACvE,SAAO,WAAW,OAAO,YAAY,WAChC,UACD;AACN;AAEA,SAAS,gBAAgB,MAAsB;AAC7C,SAAO,OAAO,KAAK,MAAM,MAAM,EAAE,SAAS,WAAW;AACvD;AAEA,SAAS,gBAAgB,SAAyB;AAChD,SAAO,OAAO,KAAK,SAAS,WAAW,EAAE,SAAS,MAAM;AAC1D;AAEA,SAAS,mBAAmB,QAA4B;AACtD,QAAM,WAAW,OAAO,OAAO,QAAQ;AACvC,QAAM,UAAU,OAAO,OAAO,OAAO;AACrC,QAAM,IAAI,OAAO,SAAS,CAAC;AAC3B,QAAM,SAAS,OAAO,SAAS,MAAM;AACrC,QAAM,eAAe,OAAO,OAAO,SAAS;AAC5C,QAAM,WACJ,iBAAiB,EAAE,UAAU,OAAO,IAAI,OAAO,QAAQ,KAAK;AAC9D,QAAM,eAAe,iBAAiB,EAAE,gBAAgB,OAAO,QAAQ;AACvE,QAAM,OAAO,YAAY,QAAQ,IAAI;AACrC,QAAM,aAAa;AAAA,IACjB,EAAE;AAAA,IACF,SAAS;AAAA,IACT,OAAO;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mB,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,gBAAgB,MAAM,IAAI,CAAC;AACrG,UAAM,UACJ,MAAM,KAAK,SAAS,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,GAAG,CAAC,QAAQ,MAAM;AACrE,WAAO,EAAE,SAAS,QAAQ;AAAA,EAC5B;AAAA,EAEA,MAAgB,cACd,SACA,SACiC;AACjC,UAAM,UAAU,mBAAmB,OAAO;AAC1C,QAAI,OAAO,SAAS,gCAAgC,YAAY;AAC9D,YAAM,IAAI,MAAM,+CAA+C;AAAA,IACjE;AAEA,UAAM,EAAE,eAAe,KAAK,IAAI,aAAa,OAAO;AACpD,UAAM,OAAO,MAAM,QAAQ,4BAA4B,WAAW;AAAA,MAChE;AAAA,MACA;AAAA,IACF,CAAC;AACD,QAAI,KAAK,OAAO,OAAO;AACrB,YAAM,IAAI;AAAA,QACR,6CACE,KAAK,SAAS,YAAY,KAAK,MAAM,MAAM,EAC7C;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,MACL,YAAY,KAAK,aAAa,GAAG,aAAa,IAAI,KAAK,IAAI,CAAC;AAAA,IAC9D;AAAA,EACF;AAAA,EAEU,iBACR,UACA,UACA,WACkC;AAClC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Provider, Plugin } from '@elizaos/core';
|
|
2
|
+
export { XDmAdapter } from './lifeops-message-adapter.js';
|
|
3
|
+
import '@elizaos/core/node';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* X (Twitter) identity provider.
|
|
7
|
+
*
|
|
8
|
+
* Makes the agent aware of its own X account: `@username`, screen name
|
|
9
|
+
* (the human-readable display name), bio/description, and any configured
|
|
10
|
+
* nicknames. Without this provider the agent only had a vague sense of its
|
|
11
|
+
* handle (via the `{{twitterUserName}}` template variable) and no awareness of
|
|
12
|
+
* its bio, display name, or nicknames at all.
|
|
13
|
+
*
|
|
14
|
+
* Reads the already-loaded profile from `XService.getActiveProfile()`; it never
|
|
15
|
+
* triggers a network call and returns empty context when the X client has not
|
|
16
|
+
* finished authenticating.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
declare const xIdentityProvider: Provider;
|
|
20
|
+
|
|
21
|
+
declare const XPlugin: Plugin;
|
|
22
|
+
|
|
23
|
+
export { XPlugin, XPlugin as default, xIdentityProvider };
|