@elizaos/plugin-signal 2.0.0-alpha
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/accounts.d.ts +124 -0
- package/dist/accounts.d.ts.map +1 -0
- package/dist/actions/listContacts.d.ts +4 -0
- package/dist/actions/listContacts.d.ts.map +1 -0
- package/dist/actions/listGroups.d.ts +4 -0
- package/dist/actions/listGroups.d.ts.map +1 -0
- package/dist/actions/sendMessage.d.ts +4 -0
- package/dist/actions/sendMessage.d.ts.map +1 -0
- package/dist/actions/sendReaction.d.ts +4 -0
- package/dist/actions/sendReaction.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1488 -0
- package/dist/index.js.map +19 -0
- package/dist/providers/conversationState.d.ts +7 -0
- package/dist/providers/conversationState.d.ts.map +1 -0
- package/dist/rpc.d.ts +163 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/service.d.ts +53 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/types.d.ts +172 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { IAgentRuntime } from "@elizaos/core";
|
|
2
|
+
/**
|
|
3
|
+
* Default account identifier used when no specific account is configured
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_ACCOUNT_ID = "default";
|
|
6
|
+
/**
|
|
7
|
+
* DM-specific configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface SignalDmConfig {
|
|
10
|
+
/** If false, ignore all incoming Signal DMs */
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/** Direct message access policy */
|
|
13
|
+
policy?: "open" | "disabled" | "allowlist" | "pairing";
|
|
14
|
+
/** Allowlist for DM senders (phone numbers or UUIDs) */
|
|
15
|
+
allowFrom?: Array<string | number>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Group-specific configuration
|
|
19
|
+
*/
|
|
20
|
+
export interface SignalGroupConfig {
|
|
21
|
+
/** If false, ignore all group messages */
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
/** Group message access policy */
|
|
24
|
+
policy?: "open" | "disabled" | "allowlist";
|
|
25
|
+
/** Require bot mention to respond in groups */
|
|
26
|
+
requireMention?: boolean;
|
|
27
|
+
/** Allowlist for groups (IDs or names) */
|
|
28
|
+
allowFrom?: Array<string | number>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reaction notification mode
|
|
32
|
+
*/
|
|
33
|
+
export type SignalReactionNotificationMode = "off" | "own" | "all" | "allowlist";
|
|
34
|
+
/**
|
|
35
|
+
* Configuration for a single Signal account
|
|
36
|
+
*/
|
|
37
|
+
export interface SignalAccountConfig {
|
|
38
|
+
/** Optional display name for this account */
|
|
39
|
+
name?: string;
|
|
40
|
+
/** If false, do not start this Signal account */
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
/** Signal account phone number in E.164 format */
|
|
43
|
+
account?: string;
|
|
44
|
+
/** Signal CLI HTTP server URL */
|
|
45
|
+
httpUrl?: string;
|
|
46
|
+
/** Signal CLI HTTP server host */
|
|
47
|
+
httpHost?: string;
|
|
48
|
+
/** Signal CLI HTTP server port */
|
|
49
|
+
httpPort?: number;
|
|
50
|
+
/** Path to signal-cli binary */
|
|
51
|
+
cliPath?: string;
|
|
52
|
+
/** Auto-start signal-cli daemon if not running */
|
|
53
|
+
autoStart?: boolean;
|
|
54
|
+
/** Outbound text chunk size (chars) */
|
|
55
|
+
textChunkLimit?: number;
|
|
56
|
+
/** History limit for context */
|
|
57
|
+
historyLimit?: number;
|
|
58
|
+
/** Reaction notification mode */
|
|
59
|
+
reactionNotifications?: SignalReactionNotificationMode;
|
|
60
|
+
/** Reaction allowlist when mode is 'allowlist' */
|
|
61
|
+
reactionAllowlist?: Array<string | number>;
|
|
62
|
+
/** DM configuration */
|
|
63
|
+
dm?: SignalDmConfig;
|
|
64
|
+
/** Group configuration */
|
|
65
|
+
group?: SignalGroupConfig;
|
|
66
|
+
/** Whether to ignore group messages */
|
|
67
|
+
shouldIgnoreGroupMessages?: boolean;
|
|
68
|
+
/** Allowed groups */
|
|
69
|
+
allowedGroups?: string[];
|
|
70
|
+
/** Blocked numbers */
|
|
71
|
+
blockedNumbers?: string[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Multi-account Signal configuration structure
|
|
75
|
+
*/
|
|
76
|
+
export interface SignalMultiAccountConfig {
|
|
77
|
+
/** Default/base configuration applied to all accounts */
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
account?: string;
|
|
80
|
+
httpUrl?: string;
|
|
81
|
+
/** Per-account configuration overrides */
|
|
82
|
+
accounts?: Record<string, SignalAccountConfig>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Resolved Signal account with all configuration merged
|
|
86
|
+
*/
|
|
87
|
+
export interface ResolvedSignalAccount {
|
|
88
|
+
accountId: string;
|
|
89
|
+
enabled: boolean;
|
|
90
|
+
name?: string;
|
|
91
|
+
account?: string;
|
|
92
|
+
baseUrl: string;
|
|
93
|
+
configured: boolean;
|
|
94
|
+
config: SignalAccountConfig;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Normalizes an account ID, returning the default if not provided
|
|
98
|
+
*/
|
|
99
|
+
export declare function normalizeAccountId(accountId?: string | null): string;
|
|
100
|
+
/**
|
|
101
|
+
* Gets the multi-account configuration from runtime settings
|
|
102
|
+
*/
|
|
103
|
+
export declare function getMultiAccountConfig(runtime: IAgentRuntime): SignalMultiAccountConfig;
|
|
104
|
+
/**
|
|
105
|
+
* Lists all configured account IDs
|
|
106
|
+
*/
|
|
107
|
+
export declare function listSignalAccountIds(runtime: IAgentRuntime): string[];
|
|
108
|
+
/**
|
|
109
|
+
* Resolves the default account ID to use
|
|
110
|
+
*/
|
|
111
|
+
export declare function resolveDefaultSignalAccountId(runtime: IAgentRuntime): string;
|
|
112
|
+
/**
|
|
113
|
+
* Resolves a complete Signal account configuration
|
|
114
|
+
*/
|
|
115
|
+
export declare function resolveSignalAccount(runtime: IAgentRuntime, accountId?: string | null): ResolvedSignalAccount;
|
|
116
|
+
/**
|
|
117
|
+
* Lists all enabled Signal accounts
|
|
118
|
+
*/
|
|
119
|
+
export declare function listEnabledSignalAccounts(runtime: IAgentRuntime): ResolvedSignalAccount[];
|
|
120
|
+
/**
|
|
121
|
+
* Checks if multi-account mode is enabled
|
|
122
|
+
*/
|
|
123
|
+
export declare function isMultiAccountEnabled(runtime: IAgentRuntime): boolean;
|
|
124
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../src/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACvD,wDAAwD;IACxD,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IAC3C,+CAA+C;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,GAAG,KAAK,G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C,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAMpE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,wBAAwB,CAWtF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,CAcrE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAM5E;AA2ED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,qBAAqB,CA8BvB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,qBAAqB,EAAE,CAIzF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAGrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listContacts.d.ts","sourceRoot":"","sources":["../../src/actions/listContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,YAAY,EAAE,MA2F1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listGroups.d.ts","sourceRoot":"","sources":["../../src/actions/listGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,UAAU,EAAE,MAwFxB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendMessage.d.ts","sourceRoot":"","sources":["../../src/actions/sendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAYZ,MAAM,eAAe,CAAC;AAuBvB,eAAO,MAAM,WAAW,EAAE,MAmIzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendReaction.d.ts","sourceRoot":"","sources":["../../src/actions/sendReaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAYZ,MAAM,eAAe,CAAC;AA2BvB,eAAO,MAAM,YAAY,EAAE,MAyH1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Plugin } from "@elizaos/core";
|
|
2
|
+
declare const signalPlugin: Plugin;
|
|
3
|
+
export default signalPlugin;
|
|
4
|
+
export { SignalService } from "./service";
|
|
5
|
+
export { SIGNAL_SERVICE_NAME } from "./types";
|
|
6
|
+
export type { ISignalService, SignalAttachment, SignalContact, SignalEventPayloadMap, SignalGroup, SignalGroupMember, SignalMessage, SignalMessageReceivedPayload, SignalMessageSendOptions, SignalMessageSentPayload, SignalQuote, SignalReactionInfo, SignalReactionPayload, SignalSettings, } from "./types";
|
|
7
|
+
export { SignalEventTypes, SignalApiError, SignalClientNotAvailableError, SignalConfigurationError, SignalPluginError, SignalServiceNotInitializedError, getSignalContactDisplayName, isValidE164, isValidGroupId, isValidUuid, normalizeE164, MAX_SIGNAL_MESSAGE_LENGTH, MAX_SIGNAL_ATTACHMENT_SIZE, } from "./types";
|
|
8
|
+
export { conversationStateProvider } from "./providers/conversationState";
|
|
9
|
+
export { sendMessage } from "./actions/sendMessage";
|
|
10
|
+
export { sendReaction } from "./actions/sendReaction";
|
|
11
|
+
export { listContacts } from "./actions/listContacts";
|
|
12
|
+
export { listGroups } from "./actions/listGroups";
|
|
13
|
+
export { DEFAULT_ACCOUNT_ID, isMultiAccountEnabled, listEnabledSignalAccounts, listSignalAccountIds, normalizeAccountId, resolveDefaultSignalAccountId, resolveSignalAccount, type ResolvedSignalAccount, type SignalAccountConfig, type SignalDmConfig, type SignalGroupConfig, type SignalMultiAccountConfig, type SignalReactionNotificationMode, } from "./accounts";
|
|
14
|
+
export { createSignalEventStream, normalizeBaseUrl, parseSignalEventData, signalCheck, signalGetVersion, signalListAccounts, signalListContacts, signalListGroups, signalRpcRequest, signalSend, signalSendReaction, signalSendReadReceipt, signalSendTyping, streamSignalEvents, type SignalCheckResult, type SignalRpcError, type SignalRpcOptions, type SignalRpcResponse, type SignalSseEvent, } from "./rpc";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAiBxE,QAAA,MAAM,YAAY,EAAE,MAoEnB,CAAC;AAEF,eAAe,YAAY,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,6BAA6B,EA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