openclaw-extension-typex 1.0.10 → 1.0.12

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.
@@ -20,7 +20,7 @@ function readFileIfExists(filePath) {
20
20
  }
21
21
  }
22
22
  function resolveAccountConfig(cfg, accountId) {
23
- const accounts = cfg.channels?.typex?.accounts;
23
+ const accounts = cfg.channels?.['openclaw-extension-typex']?.accounts;
24
24
  if (!accounts || typeof accounts !== "object") {
25
25
  return undefined;
26
26
  }
@@ -33,7 +33,7 @@ function resolveAccountConfig(cfg, accountId) {
33
33
  return matchKey ? accounts[matchKey] : undefined;
34
34
  }
35
35
  function mergeTypeXAccountConfig(cfg, accountId) {
36
- const { accounts: _ignored, ...base } = (cfg.channels?.typex ?? {});
36
+ const { accounts: _ignored, ...base } = (cfg.channels?.['openclaw-extension-typex'] ?? {});
37
37
  const account = resolveAccountConfig(cfg, accountId) ?? {};
38
38
  return { ...base, ...account };
39
39
  }
@@ -49,7 +49,7 @@ function resolveAppSecret(config) {
49
49
  return {};
50
50
  }
51
51
  function listTypeXAccountIds(cfg) {
52
- const typexCfg = cfg.channels?.typex;
52
+ const typexCfg = cfg.channels?.['openclaw-extension-typex'];
53
53
  const accounts = typexCfg?.accounts;
54
54
  const ids = new Set();
55
55
  const baseConfigured = Boolean(typexCfg?.appId?.trim() && (typexCfg?.appSecret?.trim() || Boolean(typexCfg?.appSecretFile)));
@@ -73,7 +73,7 @@ function resolveDefaultTypeXAccountId(cfg) {
73
73
  }
74
74
  function resolveTypeXAccount(params) {
75
75
  const accountId = (0, plugin_sdk_1.normalizeAccountId)(params.accountId);
76
- const baseEnabled = params.cfg.channels?.typex?.enabled !== false;
76
+ const baseEnabled = params.cfg.channels?.['openclaw-extension-typex']?.enabled !== false;
77
77
  const merged = mergeTypeXAccountConfig(params.cfg, accountId);
78
78
  const accountEnabled = merged.enabled !== false;
79
79
  const enabled = baseEnabled && accountEnabled;
@@ -15,7 +15,7 @@ const firstDefined = (...values) => {
15
15
  */
16
16
  function resolveTypeXConfig(params) {
17
17
  const { cfg, accountId } = params;
18
- const typexCfg = cfg.channels?.typex;
18
+ const typexCfg = cfg.channels?.['openclaw-extension-typex'];
19
19
  const accountCfg = accountId ? typexCfg?.accounts?.[accountId] : undefined;
20
20
  const defaults = cfg.channels?.defaults;
21
21
  return {
@@ -24,6 +24,7 @@ async function processTypeXMessage(client, payload, appId, options = {}) {
24
24
  // Attempt simple parsing if it looks like JSON? For now assume plain text or handle in future.
25
25
  // Basic logging
26
26
  logger?.info(`Processing TypeX message from ${senderId} in ${chatId}`);
27
+ logger?.info(`channel: ${JSON.stringify(channel)}, account: ${accountId}, type: ${typeof accountId}}`);
27
28
  // Build Context for Agent
28
29
  const ctx = {
29
30
  Body: text,
@@ -33,12 +34,12 @@ async function processTypeXMessage(client, payload, appId, options = {}) {
33
34
  SenderId: senderId,
34
35
  SenderName: payload.sender_name || "User",
35
36
  ChatType: "dm", // Simplified, TypeX mostly DM for now?
36
- Provider: "typex",
37
- Surface: "typex",
37
+ Provider: "openclaw-extension-typex",
38
+ Surface: "openclaw-extension-typex",
38
39
  Timestamp: payload.create_time || Date.now(),
39
40
  MessageSid: payload.message_id,
40
41
  AccountId: accountId,
41
- OriginatingChannel: "typex",
42
+ OriginatingChannel: "openclaw-extension-typex",
42
43
  OriginatingTo: chatId,
43
44
  };
44
45
  // Dispatch to Agent
@@ -46,9 +47,10 @@ async function processTypeXMessage(client, payload, appId, options = {}) {
46
47
  ctx,
47
48
  cfg,
48
49
  dispatcherOptions: {
49
- channel: "typex",
50
+ channel: "openclaw-extension-typex",
50
51
  accountId,
51
52
  deliver: async (payload) => {
53
+ logger?.info(`payload: ${payload}`);
52
54
  const responsePayload = payload;
53
55
  // Handle text response
54
56
  if (responsePayload.text) {
@@ -12,7 +12,7 @@ exports.typexOutbound = {
12
12
  const client = (0, client_js_1.getTypeXClient)(accountId ?? undefined);
13
13
  const result = await (0, send_js_1.sendMessageTypeX)(client, { text });
14
14
  return {
15
- channel: "typex",
15
+ channel: "openclaw-extension-typex",
16
16
  messageId: result?.message_id || "unknown",
17
17
  chatId: to,
18
18
  };
@@ -21,7 +21,7 @@ exports.typexOutbound = {
21
21
  const client = (0, client_js_1.getTypeXClient)(accountId ?? undefined);
22
22
  const result = await (0, send_js_1.sendMessageTypeX)(client, { text: text || "" }, { mediaUrl });
23
23
  return {
24
- channel: "typex",
24
+ channel: "openclaw-extension-typex",
25
25
  messageId: result?.message_id || "unknown",
26
26
  chatId: to,
27
27
  };
@@ -8,13 +8,12 @@ const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
8
8
  const accounts_js_1 = require("./client/accounts.js");
9
9
  const client_js_1 = require("./client/client.js");
10
10
  exports.typexOnboardingAdapter = {
11
- channel: "typex",
11
+ channel: "openclaw-extension-typex",
12
12
  getStatus: async ({ cfg }) => {
13
13
  const accountId = (0, accounts_js_1.resolveDefaultTypeXAccountId)(cfg);
14
- const configured = Boolean(cfg.channels?.typex?.accounts?.[accountId]?.email &&
15
- cfg.channels?.typex?.accounts?.[accountId]?.token);
14
+ const configured = Boolean(cfg.channels?.['openclaw-extension-typex']?.accounts?.[accountId]?.token);
16
15
  return {
17
- channel: "typex",
16
+ channel: "openclaw-extension-typex",
18
17
  configured,
19
18
  statusLines: [`TypeX (${accountId}): ${configured ? "configured" : "not configured"}`],
20
19
  selectionHint: configured ? "configured" : "setup needed",
@@ -22,7 +21,7 @@ exports.typexOnboardingAdapter = {
22
21
  };
23
22
  },
24
23
  configure: async ({ cfg, prompter }) => {
25
- const typexCfg = (cfg.channels?.typex ?? {});
24
+ const typexCfg = (cfg.channels?.['openclaw-extension-typex'] ?? {});
26
25
  const client = (0, client_js_1.getTypeXClient)(undefined, { skipConfigCheck: true, typexCfg, prompter });
27
26
  await prompter.note(`Initializing TypeX ...\nPlease scan the QR code shortly.`, "TypeX Setup");
28
27
  try {
@@ -55,15 +54,15 @@ exports.typexOnboardingAdapter = {
55
54
  }
56
55
  if (!cfg.channels)
57
56
  cfg.channels = {};
58
- if (!cfg.channels.typex)
59
- cfg.channels.typex = {};
60
- if (!cfg.channels.typex.accounts)
61
- cfg.channels.typex.accounts = {};
57
+ if (!cfg.channels['openclaw-extension-typex'])
58
+ cfg.channels['openclaw-extension-typex'] = {};
59
+ if (!cfg.channels['openclaw-extension-typex'].accounts)
60
+ cfg.channels['openclaw-extension-typex'].accounts = {};
62
61
  // save config
63
- cfg.channels.typex.accounts[userId] = {
62
+ cfg.channels['openclaw-extension-typex'].accounts[userId] = {
64
63
  token: token,
65
64
  };
66
- cfg.channels.typex.defaultAccount = userId;
65
+ cfg.channels['openclaw-extension-typex'].defaultAccount = userId;
67
66
  await prompter.note("Success! TypeX linked.", "Done");
68
67
  await client.sendMessage("openclaw linked");
69
68
  return { cfg, accountId: userId };
package/dist/plugin.js CHANGED
@@ -41,13 +41,13 @@ exports.typexPlugin = {
41
41
  configSchema: (0, plugin_sdk_1.buildChannelConfigSchema)(config_schema_js_1.TypeXConfigSchema),
42
42
  config: {
43
43
  listAccountIds: (cfg) => {
44
- const accs = cfg.channels?.typex?.accounts || {};
44
+ const accs = cfg.channels?.['openclaw-extension-typex']?.accounts || {};
45
45
  return Object.keys(accs);
46
46
  },
47
47
  resolveAccount: (cfg, accountId) => {
48
48
  const id = accountId || plugin_sdk_1.DEFAULT_ACCOUNT_ID;
49
- const globalCheck = cfg.channels?.typex;
50
- const account = cfg.channels?.typex?.accounts?.[id] ||
49
+ const globalCheck = cfg.channels?.['openclaw-extension-typex'];
50
+ const account = cfg.channels?.['openclaw-extension-typex']?.accounts?.[id] ||
51
51
  (id === plugin_sdk_1.DEFAULT_ACCOUNT_ID ? globalCheck : undefined);
52
52
  return {
53
53
  accountId: id,
@@ -59,7 +59,7 @@ exports.typexPlugin = {
59
59
  };
60
60
  },
61
61
  defaultAccountId: (cfg) => {
62
- const accs = cfg.channels?.typex?.accounts || {};
62
+ const accs = cfg.channels?.['openclaw-extension-typex']?.accounts || {};
63
63
  const first = Object.keys(accs)[0];
64
64
  return first || plugin_sdk_1.DEFAULT_ACCOUNT_ID;
65
65
  },
@@ -79,7 +79,7 @@ exports.typexPlugin = {
79
79
  gateway: {
80
80
  startAccount: async (ctx) => {
81
81
  const { account, log, setStatus, abortSignal, runtime, cfg } = ctx;
82
- const typexCfg = (cfg.channels?.typex ?? {});
82
+ const typexCfg = (cfg.channels?.['openclaw-extension-typex'] ?? {});
83
83
  log?.info(`[${account.accountId}] TypeX Provider starting...`);
84
84
  setStatus({
85
85
  accountId: account.accountId,
@@ -1,29 +1,25 @@
1
1
  {
2
2
  "id": "openclaw-extension-typex",
3
- "name": "openclaw-extension-typex",
4
- "version": "1.0.8",
3
+ "name": "TypeX",
4
+ "version": "1.0.11",
5
5
  "description": "TypeX channel integration for OpenClaw",
6
6
  "channels": [
7
- "typex"
7
+ "openclaw-extension-typex"
8
8
  ],
9
9
  "entry": "dist/index.js",
10
10
  "configSchema": {
11
11
  "type": "object",
12
- "properties": {
13
- "channels": {
14
- "type": "object"
15
- }
16
- },
17
- "additionalProperties": true
12
+ "properties": {},
13
+ "additionalProperties": false
18
14
  },
19
15
  "channel": {
20
- "id": "typex",
16
+ "id": "openclaw-extension-typex",
21
17
  "label": "TypeX",
22
18
  "selectionLabel": "TypeX (QR Code Login)",
23
19
  "detailLabel": "TypeX Bot",
24
20
  "blurb": "TypeX bot via QR Code login.",
25
21
  "aliases": [
26
- "typex"
22
+ "openclaw-extension-typex"
27
23
  ],
28
24
  "order": 100,
29
25
  "quickstartAllowFrom": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-extension-typex",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "TypeX channel integration for OpenClaw",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",