openclaw-extension-typex 1.0.19 → 1.0.21
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/README.md +8 -0
- package/dist/agent-tools-send.d.ts +50 -0
- package/dist/agent-tools-send.js +353 -0
- package/dist/client/accounts.d.ts +1 -1
- package/dist/client/accounts.js +10 -10
- package/dist/client/client.d.ts +48 -8
- package/dist/client/client.js +303 -115
- package/dist/client/config.d.ts +3 -2
- package/dist/client/domain.d.ts +7 -0
- package/dist/client/domain.js +9 -0
- package/dist/client/message.d.ts +2 -1
- package/dist/client/message.js +203 -61
- package/dist/client/monitor.d.ts +2 -1
- package/dist/client/monitor.js +36 -7
- package/dist/client/outbound.d.ts +1 -1
- package/dist/client/outbound.js +49 -4
- package/dist/client/runtime.d.ts +1 -1
- package/dist/client/send.d.ts +8 -0
- package/dist/client/send.js +11 -1
- package/dist/client/types.d.ts +17 -1
- package/dist/config-schema.d.ts +4 -2
- package/dist/config-schema.js +4 -4
- package/dist/directory.d.ts +24 -0
- package/dist/directory.js +94 -0
- package/dist/index.d.ts +178 -130
- package/dist/index.js +10 -9
- package/dist/normalize.js +7 -2
- package/dist/onboarding.d.ts +2 -2
- package/dist/onboarding.js +2 -2
- package/dist/plugin.d.ts +65 -22
- package/dist/plugin.js +81 -18
- package/dist/setup-entry.d.ts +181 -0
- package/dist/setup-entry.js +5 -0
- package/dist/types.d.ts +1 -1
- package/openclaw.plugin.json +4 -3
- package/package.json +26 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type DirectoryEntry = {
|
|
2
|
+
kind: "user" | "group" | "channel";
|
|
3
|
+
id: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
raw?: unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare const typexDirectory: {
|
|
8
|
+
self: () => Promise<null>;
|
|
9
|
+
listPeers: ({ cfg, accountId, query, limit }: any) => Promise<DirectoryEntry[]>;
|
|
10
|
+
listGroups: ({ cfg, accountId, query, limit }: any) => Promise<{
|
|
11
|
+
kind: "group";
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
raw: any;
|
|
15
|
+
}[]>;
|
|
16
|
+
listPeersLive: (params: any) => Promise<DirectoryEntry[]>;
|
|
17
|
+
listGroupsLive: (params: any) => Promise<{
|
|
18
|
+
kind: "group";
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
raw: any;
|
|
22
|
+
}[]>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.typexDirectory = void 0;
|
|
4
|
+
const account_id_1 = require("openclaw/plugin-sdk/account-id");
|
|
5
|
+
const client_js_1 = require("./client/client.js");
|
|
6
|
+
function normalizeQuery(value) {
|
|
7
|
+
return (value ?? "").trim().toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function normalizeNameKey(value) {
|
|
10
|
+
return normalizeQuery(value).replace(/\s+/g, "");
|
|
11
|
+
}
|
|
12
|
+
function resolveClient(accountId, cfg) {
|
|
13
|
+
const typexCfg = (cfg.channels?.["openclaw-extension-typex"] ?? {});
|
|
14
|
+
const client = (0, client_js_1.getTypeXClient)(accountId ?? undefined, { typexCfg });
|
|
15
|
+
return { client, typexCfg };
|
|
16
|
+
}
|
|
17
|
+
exports.typexDirectory = {
|
|
18
|
+
self: async () => null,
|
|
19
|
+
listPeers: async ({ cfg, accountId, query, limit }) => {
|
|
20
|
+
const { client, typexCfg } = resolveClient(accountId, cfg);
|
|
21
|
+
const resolvedAccountId = accountId ?? account_id_1.DEFAULT_ACCOUNT_ID;
|
|
22
|
+
const account = typexCfg.accounts?.[resolvedAccountId];
|
|
23
|
+
const allowFrom = account?.allowFrom ?? typexCfg.allowFrom ?? [];
|
|
24
|
+
const q = normalizeQuery(query);
|
|
25
|
+
const max = limit && limit > 0 ? limit : undefined;
|
|
26
|
+
const configPeers = Array.from(new Set(allowFrom
|
|
27
|
+
.map((entry) => String(entry).trim())
|
|
28
|
+
.filter((entry) => entry && entry !== "*")
|
|
29
|
+
.map((entry) => entry.replace(/^typex:/i, ""))))
|
|
30
|
+
.filter((id) => (!q ? true : id.toLowerCase().includes(q)))
|
|
31
|
+
.map((id) => ({ kind: "user", id: `user:${id}`, name: id }));
|
|
32
|
+
if (!q)
|
|
33
|
+
return configPeers.slice(0, max);
|
|
34
|
+
try {
|
|
35
|
+
if (client.mode === "bot")
|
|
36
|
+
return configPeers.slice(0, max);
|
|
37
|
+
const [feeds, contacts] = await Promise.all([
|
|
38
|
+
client.fetchFeedsByName(q),
|
|
39
|
+
client.fetchContactsByName(q),
|
|
40
|
+
]);
|
|
41
|
+
const contactEntries = contacts.map((contact) => ({
|
|
42
|
+
kind: "user",
|
|
43
|
+
id: `user:${contact.friend_id ?? contact.id}`,
|
|
44
|
+
name: String(contact.name ?? contact.alias ?? contact.friend_id ?? contact.id),
|
|
45
|
+
raw: contact,
|
|
46
|
+
}));
|
|
47
|
+
const seenContactNames = new Set(contactEntries.map((entry) => normalizeNameKey(entry.name)));
|
|
48
|
+
const feedEntries = feeds
|
|
49
|
+
.filter((feed) => {
|
|
50
|
+
const feedName = normalizeNameKey(feed.name ?? "");
|
|
51
|
+
return feed.chat_id && (!feedName || !seenContactNames.has(feedName));
|
|
52
|
+
})
|
|
53
|
+
.map((feed) => ({
|
|
54
|
+
kind: "user",
|
|
55
|
+
id: `chat:${feed.chat_id}`,
|
|
56
|
+
name: String(feed.name ?? feed.chat_id),
|
|
57
|
+
raw: feed,
|
|
58
|
+
}));
|
|
59
|
+
const all = [...configPeers, ...contactEntries, ...feedEntries];
|
|
60
|
+
const unique = Array.from(new Map(all.map((entry) => [entry.id, entry])).values());
|
|
61
|
+
return unique.slice(0, max);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error("Failed to fetch peers from TypeX directory", error);
|
|
65
|
+
return configPeers.slice(0, max);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
listGroups: async ({ cfg, accountId, query, limit }) => {
|
|
69
|
+
const { client } = resolveClient(accountId, cfg);
|
|
70
|
+
const q = normalizeQuery(query);
|
|
71
|
+
const max = limit && limit > 0 ? limit : undefined;
|
|
72
|
+
if (!q || client.mode !== "user")
|
|
73
|
+
return [];
|
|
74
|
+
try {
|
|
75
|
+
const feeds = await client.fetchFeedsByName(q);
|
|
76
|
+
const groups = feeds
|
|
77
|
+
.filter((feed) => Boolean(feed.chat_id))
|
|
78
|
+
.map((feed) => ({
|
|
79
|
+
kind: "group",
|
|
80
|
+
id: `chat:${feed.chat_id}`,
|
|
81
|
+
name: String(feed.name ?? feed.chat_id),
|
|
82
|
+
raw: feed,
|
|
83
|
+
}))
|
|
84
|
+
.slice(0, max);
|
|
85
|
+
return groups;
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error("Failed to fetch groups from TypeX directory", error);
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
listPeersLive: async (params) => exports.typexDirectory.listPeers(params),
|
|
93
|
+
listGroupsLive: async (params) => exports.typexDirectory.listGroups(params),
|
|
94
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,140 +1,188 @@
|
|
|
1
1
|
import { normalizeTypeXTarget } from "./normalize.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
configSchema: import("../node_modules/openclaw/dist/plugin-sdk/src/channels/plugins/types.plugin.js", { with: { "resolution-mode": "import" } }).ChannelConfigSchema;
|
|
7
|
+
register: (api: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawPluginApi) => void;
|
|
8
|
+
channelPlugin: {
|
|
9
|
+
messaging: {
|
|
10
|
+
normalizeTarget: typeof normalizeTypeXTarget;
|
|
11
|
+
targetResolver: {
|
|
12
|
+
looksLikeId: (raw: string) => boolean;
|
|
13
|
+
hint: string;
|
|
14
|
+
};
|
|
9
15
|
};
|
|
10
|
-
};
|
|
11
|
-
register(api: OpenClawPluginApi): void;
|
|
12
|
-
id: "openclaw-extension-typex";
|
|
13
|
-
meta: {
|
|
14
16
|
id: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
nativeCommands: false;
|
|
31
|
-
blockStreaming: false;
|
|
32
|
-
};
|
|
33
|
-
reload: {
|
|
34
|
-
configPrefixes: string[];
|
|
35
|
-
};
|
|
36
|
-
outbound: any;
|
|
37
|
-
configSchema: import("openclaw/plugin-sdk", { with: { "resolution-mode": "import" } }).ChannelConfigSchema;
|
|
38
|
-
config: {
|
|
39
|
-
listAccountIds: (cfg: import("openclaw/plugin-sdk", { with: { "resolution-mode": "import" } }).OpenClawConfig) => string[];
|
|
40
|
-
resolveAccount: (cfg: import("openclaw/plugin-sdk", { with: { "resolution-mode": "import" } }).OpenClawConfig, accountId: string | null | undefined) => {
|
|
41
|
-
accountId: string;
|
|
42
|
-
name: any;
|
|
43
|
-
enabled: boolean;
|
|
44
|
-
configured: boolean;
|
|
45
|
-
tokenSource: string;
|
|
46
|
-
config: any;
|
|
17
|
+
meta: {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
selectionLabel: string;
|
|
21
|
+
detailLabel: string;
|
|
22
|
+
docsPath: string;
|
|
23
|
+
docsLabel: string;
|
|
24
|
+
blurb: string;
|
|
25
|
+
order: number;
|
|
26
|
+
showInSetup: boolean;
|
|
27
|
+
exposure: {
|
|
28
|
+
setup: boolean;
|
|
29
|
+
docs: boolean;
|
|
30
|
+
configured: boolean;
|
|
31
|
+
};
|
|
47
32
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) => import("openclaw/plugin-sdk", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
58
|
-
isConfigured: (acc: any) => any;
|
|
59
|
-
describeAccount: (acc: any) => {
|
|
60
|
-
accountId: any;
|
|
61
|
-
name: any;
|
|
62
|
-
enabled: any;
|
|
63
|
-
configured: any;
|
|
64
|
-
tokenSource: any;
|
|
33
|
+
setupWizard: import("openclaw/plugin-sdk/setup", { with: { "resolution-mode": "import" } }).ChannelSetupWizardAdapter;
|
|
34
|
+
capabilities: {
|
|
35
|
+
chatTypes: ("group" | "direct")[];
|
|
36
|
+
media: true;
|
|
37
|
+
reactions: false;
|
|
38
|
+
threads: false;
|
|
39
|
+
polls: false;
|
|
40
|
+
nativeCommands: false;
|
|
41
|
+
blockStreaming: true;
|
|
65
42
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
gateway: {
|
|
70
|
-
startAccount: (ctx: import("openclaw/plugin-sdk", { with: { "resolution-mode": "import" } }).ChannelGatewayContext<any>) => Promise<void>;
|
|
71
|
-
};
|
|
72
|
-
security: {
|
|
73
|
-
resolveDmPolicy: () => {
|
|
74
|
-
policy: string;
|
|
75
|
-
allowFrom: never[];
|
|
76
|
-
policyPath: string;
|
|
77
|
-
allowFromPath: string;
|
|
78
|
-
approveHint: string;
|
|
79
|
-
normalizeEntry: (s: string) => string;
|
|
43
|
+
agentPrompt: {
|
|
44
|
+
messageToolHints: () => string[];
|
|
80
45
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
accountId: string
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
46
|
+
agentTools: ({ cfg }: {
|
|
47
|
+
cfg?: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
48
|
+
}) => import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelAgentTool[];
|
|
49
|
+
actions: import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelMessageActionAdapter;
|
|
50
|
+
reload: {
|
|
51
|
+
configPrefixes: string[];
|
|
52
|
+
};
|
|
53
|
+
outbound: any;
|
|
54
|
+
configSchema: import("../node_modules/openclaw/dist/plugin-sdk/src/channels/plugins/types.plugin.js", { with: { "resolution-mode": "import" } }).ChannelConfigSchema;
|
|
55
|
+
config: {
|
|
56
|
+
listAccountIds: (cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig) => string[];
|
|
57
|
+
resolveAccount: (cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig, accountId: string | null | undefined) => {
|
|
58
|
+
accountId: string;
|
|
59
|
+
name: any;
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
configured: boolean;
|
|
62
|
+
tokenSource: string;
|
|
63
|
+
config: any;
|
|
64
|
+
};
|
|
65
|
+
defaultAccountId: (cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig) => string;
|
|
66
|
+
setAccountEnabled: ({ cfg }: {
|
|
67
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
68
|
+
accountId: string;
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
}) => import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
71
|
+
deleteAccount: ({ cfg }: {
|
|
72
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
73
|
+
accountId: string;
|
|
74
|
+
}) => import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
75
|
+
isConfigured: (acc: any) => any;
|
|
76
|
+
describeAccount: (acc: any) => {
|
|
77
|
+
accountId: any;
|
|
78
|
+
name: any;
|
|
79
|
+
enabled: any;
|
|
80
|
+
configured: any;
|
|
81
|
+
tokenSource: any;
|
|
82
|
+
};
|
|
83
|
+
resolveAllowFrom: ({ cfg, accountId }: {
|
|
84
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
85
|
+
accountId?: string | null;
|
|
86
|
+
}) => any;
|
|
87
|
+
formatAllowFrom: ({ allowFrom }: {
|
|
88
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
89
|
+
accountId?: string | null;
|
|
90
|
+
allowFrom: Array<string | number>;
|
|
91
|
+
}) => string[];
|
|
92
|
+
};
|
|
93
|
+
gateway: {
|
|
94
|
+
startAccount: (ctx: import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelGatewayContext<any>) => Promise<void>;
|
|
95
|
+
};
|
|
96
|
+
security: {
|
|
97
|
+
resolveDmPolicy: () => {
|
|
98
|
+
policy: string;
|
|
99
|
+
allowFrom: never[];
|
|
100
|
+
policyPath: string;
|
|
101
|
+
allowFromPath: string;
|
|
102
|
+
approveHint: string;
|
|
103
|
+
normalizeEntry: (s: string) => string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
groups: {
|
|
107
|
+
resolveRequireMention: ({ cfg, groupId }: import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelGroupContext) => any;
|
|
108
|
+
};
|
|
109
|
+
directory: {
|
|
110
|
+
self: () => Promise<null>;
|
|
111
|
+
listPeers: ({ cfg, accountId, query, limit }: any) => Promise<{
|
|
112
|
+
kind: "user" | "group" | "channel";
|
|
113
|
+
id: string;
|
|
114
|
+
name?: string;
|
|
115
|
+
raw?: unknown;
|
|
116
|
+
}[]>;
|
|
117
|
+
listGroups: ({ cfg, accountId, query, limit }: any) => Promise<{
|
|
118
|
+
kind: "group";
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
raw: any;
|
|
122
|
+
}[]>;
|
|
123
|
+
listPeersLive: (params: any) => Promise<{
|
|
124
|
+
kind: "user" | "group" | "channel";
|
|
125
|
+
id: string;
|
|
126
|
+
name?: string;
|
|
127
|
+
raw?: unknown;
|
|
128
|
+
}[]>;
|
|
129
|
+
listGroupsLive: (params: any) => Promise<{
|
|
130
|
+
kind: "group";
|
|
131
|
+
id: string;
|
|
132
|
+
name: string;
|
|
133
|
+
raw: any;
|
|
134
|
+
}[]>;
|
|
97
135
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
status: {
|
|
137
|
+
defaultRuntime: {
|
|
138
|
+
accountId: string;
|
|
139
|
+
running: false;
|
|
140
|
+
lastStartAt: null;
|
|
141
|
+
lastStopAt: null;
|
|
142
|
+
lastError: null;
|
|
143
|
+
};
|
|
144
|
+
collectStatusIssues: () => never[];
|
|
145
|
+
buildChannelSummary: ({ snapshot }: {
|
|
146
|
+
account: any;
|
|
147
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
148
|
+
defaultAccountId: string;
|
|
149
|
+
snapshot: import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelAccountSnapshot;
|
|
150
|
+
}) => Promise<{
|
|
151
|
+
configured: boolean | undefined;
|
|
152
|
+
tokenSource: string | undefined;
|
|
153
|
+
running: boolean | undefined;
|
|
154
|
+
lastStartAt: number | null | undefined;
|
|
155
|
+
lastStopAt: number | null | undefined;
|
|
156
|
+
lastError: string | null | undefined;
|
|
157
|
+
probe: unknown;
|
|
158
|
+
lastProbeAt: number | null | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
probeAccount: () => Promise<{
|
|
161
|
+
ok: boolean;
|
|
162
|
+
timestamp: number;
|
|
163
|
+
}>;
|
|
164
|
+
buildAccountSnapshot: ({ account, runtime }: {
|
|
165
|
+
account: any;
|
|
166
|
+
cfg: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).OpenClawConfig;
|
|
167
|
+
runtime?: import("openclaw/plugin-sdk/channel-contract", { with: { "resolution-mode": "import" } }).ChannelAccountSnapshot;
|
|
168
|
+
probe?: unknown;
|
|
169
|
+
audit?: unknown;
|
|
170
|
+
}) => {
|
|
171
|
+
accountId: any;
|
|
172
|
+
name: any;
|
|
173
|
+
enabled: any;
|
|
174
|
+
configured: any;
|
|
175
|
+
tokenSource: any;
|
|
176
|
+
running: boolean;
|
|
177
|
+
lastStartAt: number | null;
|
|
178
|
+
lastStopAt: number | null;
|
|
179
|
+
lastError: string | null;
|
|
180
|
+
lastInboundAt: null;
|
|
181
|
+
lastOutboundAt: null;
|
|
182
|
+
};
|
|
183
|
+
logSelfId: () => void;
|
|
136
184
|
};
|
|
137
|
-
logSelfId: () => void;
|
|
138
185
|
};
|
|
186
|
+
setChannelRuntime?: (runtime: import("openclaw/plugin-sdk/channel-core", { with: { "resolution-mode": "import" } }).PluginRuntime) => void;
|
|
139
187
|
};
|
|
140
|
-
export
|
|
188
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const channel_core_1 = require("openclaw/plugin-sdk/channel-core");
|
|
2
4
|
const plugin_js_1 = require("./plugin.js");
|
|
3
5
|
const normalize_js_1 = require("./normalize.js");
|
|
4
6
|
const runtime_js_1 = require("./client/runtime.js");
|
|
@@ -6,14 +8,13 @@ const plugin = {
|
|
|
6
8
|
...plugin_js_1.typexPlugin,
|
|
7
9
|
messaging: {
|
|
8
10
|
normalizeTarget: normalize_js_1.normalizeTypeXTarget,
|
|
9
|
-
targetResolver:
|
|
10
|
-
looksLikeId: () => true,
|
|
11
|
-
hint: "chat_id",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
register(api) {
|
|
15
|
-
(0, runtime_js_1.setTypeXRuntime)(api.runtime);
|
|
16
|
-
api.registerChannel(plugin_js_1.typexPlugin);
|
|
11
|
+
targetResolver: plugin_js_1.typexPlugin.messaging.targetResolver,
|
|
17
12
|
},
|
|
18
13
|
};
|
|
19
|
-
|
|
14
|
+
exports.default = (0, channel_core_1.defineChannelPluginEntry)({
|
|
15
|
+
id: plugin.id,
|
|
16
|
+
name: plugin.meta.label,
|
|
17
|
+
description: plugin.meta.blurb,
|
|
18
|
+
plugin,
|
|
19
|
+
setRuntime: runtime_js_1.setTypeXRuntime,
|
|
20
|
+
});
|
package/dist/normalize.js
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeTypeXTarget = normalizeTypeXTarget;
|
|
4
4
|
function normalizeTypeXTarget(raw) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const normalized = raw.replace(/^typex:/i, "").trim();
|
|
6
|
+
if (!normalized) {
|
|
7
|
+
return normalized;
|
|
8
|
+
}
|
|
9
|
+
if (/^dm:/i.test(normalized)) {
|
|
10
|
+
return `user:${normalized.slice(3).trim()}`;
|
|
11
|
+
}
|
|
7
12
|
return normalized;
|
|
8
13
|
}
|
package/dist/onboarding.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
1
|
+
import type { ChannelSetupWizardAdapter } from "openclaw/plugin-sdk/setup";
|
|
2
|
+
export declare const typexSetupWizard: ChannelSetupWizardAdapter;
|
package/dist/onboarding.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.typexSetupWizard = void 0;
|
|
7
7
|
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");
|
|
@@ -19,7 +19,7 @@ function extractQrCodeId(qrcodeData) {
|
|
|
19
19
|
return new URLSearchParams(queryOnly).get("qr_code_id") || "";
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
exports.
|
|
22
|
+
exports.typexSetupWizard = {
|
|
23
23
|
channel: CHANNEL_ID,
|
|
24
24
|
getStatus: async ({ cfg }) => {
|
|
25
25
|
const accountId = (0, accounts_js_1.resolveDefaultTypeXAccountId)(cfg);
|