@seeed-studio/meshtastic 0.1.0

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/src/types.ts ADDED
@@ -0,0 +1,108 @@
1
+ import type { BaseProbeResult } from "openclaw/plugin-sdk";
2
+ import type {
3
+ BlockStreamingCoalesceConfig,
4
+ DmConfig,
5
+ DmPolicy,
6
+ GroupPolicy,
7
+ GroupToolPolicyBySenderConfig,
8
+ GroupToolPolicyConfig,
9
+ MarkdownConfig,
10
+ OpenClawConfig,
11
+ } from "openclaw/plugin-sdk";
12
+
13
+ export type MeshtasticChannelConfig = {
14
+ requireMention?: boolean;
15
+ tools?: GroupToolPolicyConfig;
16
+ toolsBySender?: GroupToolPolicyBySenderConfig;
17
+ skills?: string[];
18
+ enabled?: boolean;
19
+ allowFrom?: string[];
20
+ systemPrompt?: string;
21
+ };
22
+
23
+ export type MeshtasticMqttConfig = {
24
+ broker?: string;
25
+ port?: number;
26
+ username?: string;
27
+ password?: string;
28
+ topic?: string;
29
+ publishTopic?: string;
30
+ tls?: boolean;
31
+ };
32
+
33
+ export type MeshtasticTransport = "serial" | "http" | "mqtt";
34
+
35
+ /** LoRa region codes matching meshtastic.Config.LoRaConfig.RegionCode. */
36
+ export type MeshtasticRegion =
37
+ | "UNSET"
38
+ | "US"
39
+ | "EU_433"
40
+ | "EU_868"
41
+ | "CN"
42
+ | "JP"
43
+ | "ANZ"
44
+ | "KR"
45
+ | "TW"
46
+ | "RU"
47
+ | "IN"
48
+ | "NZ_865"
49
+ | "TH"
50
+ | "UA_433"
51
+ | "UA_868"
52
+ | "MY_433"
53
+ | "MY_919"
54
+ | "SG_923"
55
+ | "LORA_24";
56
+
57
+ export type MeshtasticAccountConfig = {
58
+ name?: string;
59
+ enabled?: boolean;
60
+ transport?: MeshtasticTransport;
61
+ /** LoRa region — applied to device on connect (serial/HTTP only). */
62
+ region?: MeshtasticRegion;
63
+ /** Device display name — sets the node's longName and auto-adds as mention pattern. */
64
+ nodeName?: string;
65
+ serialPort?: string;
66
+ httpAddress?: string;
67
+ httpTls?: boolean;
68
+ mqtt?: MeshtasticMqttConfig;
69
+ dmPolicy?: DmPolicy;
70
+ allowFrom?: string[];
71
+ defaultTo?: string;
72
+ groupPolicy?: GroupPolicy;
73
+ groupAllowFrom?: string[];
74
+ channels?: Record<string, MeshtasticChannelConfig>;
75
+ mentionPatterns?: string[];
76
+ markdown?: MarkdownConfig;
77
+ dms?: Record<string, DmConfig>;
78
+ textChunkLimit?: number;
79
+ blockStreaming?: boolean;
80
+ blockStreamingCoalesce?: BlockStreamingCoalesceConfig;
81
+ responsePrefix?: string;
82
+ };
83
+
84
+ export type MeshtasticConfig = MeshtasticAccountConfig & {
85
+ accounts?: Record<string, MeshtasticAccountConfig>;
86
+ };
87
+
88
+ export type CoreConfig = OpenClawConfig & {
89
+ channels?: OpenClawConfig["channels"] & {
90
+ meshtastic?: MeshtasticConfig;
91
+ };
92
+ };
93
+
94
+ export type MeshtasticInboundMessage = {
95
+ messageId: string;
96
+ senderNodeId: string;
97
+ senderName?: string;
98
+ channelIndex: number;
99
+ channelName?: string;
100
+ text: string;
101
+ timestamp: number;
102
+ isGroup: boolean;
103
+ };
104
+
105
+ export type MeshtasticProbe = BaseProbeResult<string> & {
106
+ transport: MeshtasticTransport;
107
+ address?: string;
108
+ };