@gloablehive/ipad-wechat-plugin 1.0.4 → 1.0.5

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.
@@ -78,6 +78,32 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
78
78
  supportsEditing: false,
79
79
  supportsDeleting: false,
80
80
  },
81
+ // Config adapter - for runtime account management
82
+ config: {
83
+ listAccountIds: (cfg) => {
84
+ const section = cfg.channels?.["ipad-wechat"];
85
+ if (section?.wechatAccountId) {
86
+ return [section.wechatAccountId];
87
+ }
88
+ return ["default"];
89
+ },
90
+ resolveAccount: (cfg, accountId) => {
91
+ return resolveAccount(cfg, accountId);
92
+ },
93
+ defaultAccountId: (cfg) => {
94
+ const section = cfg.channels?.["ipad-wechat"];
95
+ return section?.wechatAccountId || "default";
96
+ },
97
+ inspectAccount: (cfg, accountId) => {
98
+ const section = cfg.channels?.["ipad-wechat"];
99
+ const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
100
+ return {
101
+ enabled: hasCredentials,
102
+ configured: hasCredentials,
103
+ tokenStatus: hasCredentials ? "available" : "missing",
104
+ };
105
+ },
106
+ },
81
107
  // Setup adapter - for initial configuration
82
108
  setup: {
83
109
  resolveAccountId: (params) => {
@@ -89,32 +115,6 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
89
115
  },
90
116
  },
91
117
  }),
92
- // Config adapter - for runtime account management
93
- config: {
94
- listAccountIds: (cfg) => {
95
- const section = cfg.channels?.["ipad-wechat"];
96
- if (section?.wechatAccountId) {
97
- return [section.wechatAccountId];
98
- }
99
- return ["default"];
100
- },
101
- resolveAccount: (cfg, accountId) => {
102
- return resolveAccount(cfg, accountId);
103
- },
104
- defaultAccountId: (cfg) => {
105
- const section = cfg.channels?.["ipad-wechat"];
106
- return section?.wechatAccountId || "default";
107
- },
108
- inspectAccount: (cfg, accountId) => {
109
- const section = cfg.channels?.["ipad-wechat"];
110
- const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
111
- return {
112
- enabled: hasCredentials,
113
- configured: hasCredentials,
114
- tokenStatus: hasCredentials ? "available" : "missing",
115
- };
116
- },
117
- },
118
118
  security: {
119
119
  dm: {
120
120
  channelKey: "ipad-wechat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gloablehive/ipad-wechat-plugin",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for iPad WeChat protocol - enables sending/receiving WeChat messages through iPad protocol",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -114,6 +114,32 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
114
114
  supportsEditing: false,
115
115
  supportsDeleting: false,
116
116
  } as any,
117
+ // Config adapter - for runtime account management
118
+ config: {
119
+ listAccountIds: (cfg: any) => {
120
+ const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
121
+ if (section?.wechatAccountId) {
122
+ return [section.wechatAccountId];
123
+ }
124
+ return ["default"];
125
+ },
126
+ resolveAccount: (cfg: any, accountId?: string | null) => {
127
+ return resolveAccount(cfg, accountId);
128
+ },
129
+ defaultAccountId: (cfg: any) => {
130
+ const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
131
+ return section?.wechatAccountId || "default";
132
+ },
133
+ inspectAccount: (cfg: any, accountId?: string | null) => {
134
+ const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
135
+ const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
136
+ return {
137
+ enabled: hasCredentials,
138
+ configured: hasCredentials,
139
+ tokenStatus: hasCredentials ? "available" : "missing",
140
+ };
141
+ },
142
+ } as any,
117
143
  // Setup adapter - for initial configuration
118
144
  setup: {
119
145
  resolveAccountId: (params: any) => {
@@ -126,33 +152,6 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
126
152
  },
127
153
  }) as any,
128
154
 
129
- // Config adapter - for runtime account management
130
- config: {
131
- listAccountIds: (cfg: any) => {
132
- const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
133
- if (section?.wechatAccountId) {
134
- return [section.wechatAccountId];
135
- }
136
- return ["default"];
137
- },
138
- resolveAccount: (cfg: any, accountId?: string | null) => {
139
- return resolveAccount(cfg, accountId);
140
- },
141
- defaultAccountId: (cfg: any) => {
142
- const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
143
- return section?.wechatAccountId || "default";
144
- },
145
- inspectAccount: (cfg: any, accountId?: string | null) => {
146
- const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
147
- const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
148
- return {
149
- enabled: hasCredentials,
150
- configured: hasCredentials,
151
- tokenStatus: hasCredentials ? "available" : "missing",
152
- };
153
- },
154
- } as any,
155
-
156
155
  security: {
157
156
  dm: {
158
157
  channelKey: "ipad-wechat",