@aka_openclaw_plugin/mychat 0.1.19 → 0.2.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.
@@ -0,0 +1,2 @@
1
+ import { t as mychatPlugin } from "./channel-BVfWh6jv.js";
2
+ export { mychatPlugin };
@@ -0,0 +1,75 @@
1
+ import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-core";
2
+ import { z } from "zod";
3
+ const mychatConfigSchema = buildChannelConfigSchema(z.object({
4
+ enabled: z.boolean().optional(),
5
+ name: z.string().optional(),
6
+ baseUrl: z.string(),
7
+ wsUrl: z.string().optional(),
8
+ token: z.string().optional(),
9
+ defaultTo: z.string().optional(),
10
+ defaultAccountId: z.string().optional(),
11
+ dmPolicy: z.enum([
12
+ "open",
13
+ "allowlist",
14
+ "disabled"
15
+ ]).optional(),
16
+ groupPolicy: z.enum([
17
+ "open",
18
+ "allowlist",
19
+ "disabled"
20
+ ]).optional(),
21
+ allowFrom: z.array(z.string()).optional(),
22
+ groupAllowFrom: z.array(z.string()).optional(),
23
+ requireMention: z.boolean().optional(),
24
+ historyLimit: z.number().optional(),
25
+ mediaMaxMb: z.number().optional(),
26
+ actions: z.object({
27
+ messages: z.boolean().optional(),
28
+ threads: z.boolean().optional(),
29
+ reactions: z.boolean().optional()
30
+ }).optional(),
31
+ groups: z.record(z.string(), z.any()).optional(),
32
+ reconnect: z.object({
33
+ initialDelayMs: z.number().optional(),
34
+ maxDelayMs: z.number().optional(),
35
+ backoffMultiplier: z.number().optional()
36
+ }).optional(),
37
+ accounts: z.record(z.string(), z.any()).optional()
38
+ }), { uiHints: {
39
+ baseUrl: {
40
+ label: "API base URL",
41
+ placeholder: "http://localhost:3000"
42
+ },
43
+ wsUrl: {
44
+ label: "WebSocket URL",
45
+ placeholder: "ws://localhost:3000/ws"
46
+ },
47
+ token: {
48
+ label: "Bot token",
49
+ sensitive: true,
50
+ placeholder: "bot_xxxxxxxxxxxx"
51
+ },
52
+ defaultTo: {
53
+ label: "Default destination",
54
+ placeholder: "user-id or group-id"
55
+ },
56
+ dmPolicy: { label: "DM policy" },
57
+ groupPolicy: { label: "Group policy" },
58
+ allowFrom: { label: "Allowed senders" },
59
+ groupAllowFrom: { label: "Allowed group senders" },
60
+ groups: { label: "Group overrides" },
61
+ actions: { label: "Enabled actions" },
62
+ "actions.messages": { label: "Message actions" },
63
+ "actions.threads": { label: "Thread actions" },
64
+ "actions.reactions": { label: "Reaction actions" },
65
+ requireMention: { label: "Require @mention in groups" },
66
+ historyLimit: { label: "History message limit" },
67
+ mediaMaxMb: { label: "Max media size (MB)" },
68
+ reconnect: { label: "Reconnection settings" },
69
+ accounts: { label: "Accounts" },
70
+ defaultAccountId: { label: "Default account" },
71
+ enabled: { label: "Enabled" },
72
+ name: { label: "Display name" }
73
+ } });
74
+ //#endregion
75
+ export { mychatConfigSchema as t };
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ //#region extensions/mychat/index.ts
3
+ var mychat_default = defineBundledChannelEntry({
4
+ id: "mychat",
5
+ name: "MyChat",
6
+ description: "MyChat channel plugin",
7
+ importMetaUrl: import.meta.url,
8
+ plugin: {
9
+ specifier: "./channel-plugin-api.js",
10
+ exportName: "mychatPlugin"
11
+ },
12
+ runtime: {
13
+ specifier: "./runtime-setter-api.js",
14
+ exportName: "setMychatRuntime"
15
+ },
16
+ accountInspect: {
17
+ specifier: "./account-inspect-api.js",
18
+ exportName: "inspectMychatAccount"
19
+ }
20
+ });
21
+ //#endregion
22
+ export { mychat_default as default };
@@ -0,0 +1,53 @@
1
+ import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
2
+ //#region \0rolldown/runtime.js
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ //#endregion
29
+ //#region extensions/mychat/src/runtime.ts
30
+ var runtime_exports = /* @__PURE__ */ __exportAll({
31
+ getMychatRuntime: () => getMychatRuntime,
32
+ mychatRuntimeStore: () => mychatRuntimeStore,
33
+ setMychatRuntime: () => setMychatRuntime,
34
+ tryGetMychatRuntime: () => tryGetMychatRuntime
35
+ });
36
+ function setMychatRuntime(runtime) {
37
+ mychatRuntimeStore.setRuntime(runtime);
38
+ }
39
+ function getMychatRuntime() {
40
+ return mychatRuntimeStore.getRuntime();
41
+ }
42
+ function tryGetMychatRuntime() {
43
+ return mychatRuntimeStore.tryGetRuntime();
44
+ }
45
+ var mychatRuntimeStore;
46
+ var init_runtime = __esmMin((() => {
47
+ mychatRuntimeStore = createPluginRuntimeStore({
48
+ pluginId: "mychat",
49
+ errorMessage: "MyChat runtime not initialized. Ensure the plugin is registered."
50
+ });
51
+ }));
52
+ //#endregion
53
+ export { tryGetMychatRuntime as a, setMychatRuntime as i, init_runtime as n, __toCommonJS as o, runtime_exports as r, getMychatRuntime as t };
@@ -0,0 +1,5 @@
1
+ import { a as tryGetMychatRuntime, i as setMychatRuntime, n as init_runtime, t as getMychatRuntime } from "./runtime-CkiGSF1r.js";
2
+ //#region extensions/mychat/runtime-api.ts
3
+ init_runtime();
4
+ //#endregion
5
+ export { getMychatRuntime, setMychatRuntime, tryGetMychatRuntime };
@@ -1,4 +1,4 @@
1
- import { i as setMychatRuntime, n as init_runtime } from "../../runtime-COgwNLVk.js";
1
+ import { i as setMychatRuntime, n as init_runtime } from "./runtime-CkiGSF1r.js";
2
2
  //#region extensions/mychat/runtime-setter-api.ts
3
3
  init_runtime();
4
4
  //#endregion
@@ -0,0 +1,11 @@
1
+ import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ //#region extensions/mychat/setup-entry.ts
3
+ var setup_entry_default = defineBundledChannelSetupEntry({
4
+ importMetaUrl: import.meta.url,
5
+ plugin: {
6
+ specifier: "./setup-plugin-api.js",
7
+ exportName: "mychatSetupPlugin"
8
+ }
9
+ });
10
+ //#endregion
11
+ export { setup_entry_default as default };
@@ -0,0 +1,52 @@
1
+ import { n as resolveMychatAccounts, t as resolveMychatAccount } from "./accounts-BTv5784y.js";
2
+ import { t as mychatConfigSchema } from "./config-schema-CjCqWPdP.js";
3
+ //#region extensions/mychat/src/channel.setup.ts
4
+ /**
5
+ * Setup-specific plugin for the MyChat setup wizard.
6
+ * This is separate from the main plugin to keep setup-only surfaces
7
+ * out of lightweight channel plugin loads.
8
+ */
9
+ const mychatSetupPlugin = {
10
+ id: "mychat",
11
+ meta: {
12
+ label: "MyChat",
13
+ docsPath: "docs/plugins/mychat",
14
+ blurb: "Connect to MyChat server via bot token",
15
+ aliases: ["mychat"]
16
+ },
17
+ capabilities: {
18
+ chatTypes: [
19
+ "direct",
20
+ "group",
21
+ "thread"
22
+ ],
23
+ reactions: true,
24
+ media: true,
25
+ threads: true
26
+ },
27
+ reload: { configPrefixes: ["channels.mychat"] },
28
+ configSchema: mychatConfigSchema,
29
+ config: {
30
+ listAccountIds(cfg) {
31
+ return resolveMychatAccounts(cfg).map((a) => a.accountId);
32
+ },
33
+ resolveAccount(cfg, accountId) {
34
+ return resolveMychatAccount({
35
+ cfg,
36
+ accountId
37
+ });
38
+ },
39
+ async inspectAccount(account) {
40
+ return {
41
+ accountId: account.accountId,
42
+ enabled: account.enabled,
43
+ label: account.name ?? account.baseUrl
44
+ };
45
+ }
46
+ },
47
+ setup: { applyAccountConfig(params) {
48
+ return params.cfg;
49
+ } }
50
+ };
51
+ //#endregion
52
+ export { mychatSetupPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aka_openclaw_plugin/mychat",
3
- "version": "0.1.19",
3
+ "version": "0.2.0",
4
4
  "description": "OpenClaw MyChat channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,13 +9,12 @@
9
9
  },
10
10
  "type": "module",
11
11
  "exports": {
12
- ".": "./index.js",
13
- "./channel-plugin-api.js": "./channel-plugin-api.js",
14
- "./runtime-setter-api.js": "./runtime-setter-api.js",
15
- "./runtime-api.js": "./runtime-api.js",
16
- "./config-api.js": "./config-api.js",
17
- "./account-inspect-api.js": "./account-inspect-api.js",
18
- "./setup-plugin-api.js": "./setup-plugin-api.js"
12
+ ".": "./dist/index.js",
13
+ "./channel-plugin-api.js": "./dist/channel-plugin-api.js",
14
+ "./runtime-setter-api.js": "./dist/runtime-setter-api.js",
15
+ "./runtime-api.js": "./dist/runtime-api.js",
16
+ "./account-inspect-api.js": "./dist/account-inspect-api.js",
17
+ "./setup-plugin-api.js": "./dist/setup-plugin-api.js"
19
18
  },
20
19
  "dependencies": {
21
20
  "zod": "4.4.3"
@@ -64,7 +63,7 @@
64
63
  }
65
64
  },
66
65
  "files": [
67
- "*.js",
66
+ "dist/**",
68
67
  "openclaw.plugin.json"
69
68
  ]
70
69
  }
@@ -1,29 +0,0 @@
1
- import { t as resolveMychatAccount } from "../../accounts-BTbj82XM.js";
2
- //#region extensions/mychat/src/account-inspect.ts
3
- function inspectMychatAccount(params) {
4
- const account = resolveMychatAccount({
5
- cfg: params.cfg,
6
- accountId: params.accountId,
7
- });
8
- if (!account)
9
- return {
10
- accountId: params.accountId,
11
- enabled: false,
12
- baseUrl: "",
13
- tokenSource: "none",
14
- tokenStatus: "missing",
15
- };
16
- let tokenSource = "none";
17
- if (params.cfg.channels?.mychat?.accounts?.[params.accountId]?.token) tokenSource = "config";
18
- else if (params.envToken) tokenSource = "env";
19
- return {
20
- accountId: account.accountId,
21
- enabled: account.enabled,
22
- name: account.name,
23
- baseUrl: account.baseUrl,
24
- tokenSource,
25
- tokenStatus: account.token ? "configured" : "missing",
26
- };
27
- }
28
- //#endregion
29
- export { inspectMychatAccount };
package/api.js DELETED
@@ -1,11 +0,0 @@
1
- import { t as mychatPlugin } from "../../channel-CVeSfVdX.js";
2
- import {
3
- a as tryGetMychatRuntime,
4
- i as setMychatRuntime,
5
- n as init_runtime,
6
- t as getMychatRuntime,
7
- } from "../../runtime-COgwNLVk.js";
8
- //#region extensions/mychat/api.ts
9
- init_runtime();
10
- //#endregion
11
- export { getMychatRuntime, mychatPlugin, setMychatRuntime, tryGetMychatRuntime };
@@ -1,2 +0,0 @@
1
- import { t as mychatPlugin } from "../../channel-CVeSfVdX.js";
2
- export { mychatPlugin };
package/index.js DELETED
@@ -1,22 +0,0 @@
1
- import { t as defineBundledChannelEntry } from "../../channel-entry-contract-BO_RLNVM.js";
2
- //#region extensions/mychat/index.ts
3
- var mychat_default = defineBundledChannelEntry({
4
- id: "mychat",
5
- name: "MyChat",
6
- description: "MyChat channel plugin",
7
- importMetaUrl: import.meta.url,
8
- plugin: {
9
- specifier: "./channel-plugin-api.js",
10
- exportName: "mychatPlugin",
11
- },
12
- runtime: {
13
- specifier: "./runtime-setter-api.js",
14
- exportName: "setMychatRuntime",
15
- },
16
- accountInspect: {
17
- specifier: "./account-inspect-api.js",
18
- exportName: "inspectMychatAccount",
19
- },
20
- });
21
- //#endregion
22
- export { mychat_default as default };
package/runtime-api.js DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- a as tryGetMychatRuntime,
3
- i as setMychatRuntime,
4
- n as init_runtime,
5
- t as getMychatRuntime,
6
- } from "../../runtime-COgwNLVk.js";
7
- //#region extensions/mychat/runtime-api.ts
8
- init_runtime();
9
- //#endregion
10
- export { getMychatRuntime, setMychatRuntime, tryGetMychatRuntime };
package/setup-entry.js DELETED
@@ -1,11 +0,0 @@
1
- import { n as defineBundledChannelSetupEntry } from "../../channel-entry-contract-BO_RLNVM.js";
2
- //#region extensions/mychat/setup-entry.ts
3
- var setup_entry_default = defineBundledChannelSetupEntry({
4
- importMetaUrl: import.meta.url,
5
- plugin: {
6
- specifier: "./setup-plugin-api.js",
7
- exportName: "mychatSetupPlugin",
8
- },
9
- });
10
- //#endregion
11
- export { setup_entry_default as default };
@@ -1,50 +0,0 @@
1
- import { n as resolveMychatAccounts, t as resolveMychatAccount } from "../../accounts-BTbj82XM.js";
2
- import { t as mychatConfigSchema } from "../../config-schema-BmMH1S6B.js";
3
- //#region extensions/mychat/src/channel.setup.ts
4
- /**
5
- * Setup-specific plugin for the MyChat setup wizard.
6
- * This is separate from the main plugin to keep setup-only surfaces
7
- * out of lightweight channel plugin loads.
8
- */
9
- const mychatSetupPlugin = {
10
- id: "mychat",
11
- meta: {
12
- label: "MyChat",
13
- docsPath: "docs/plugins/mychat",
14
- blurb: "Connect to MyChat server via bot token",
15
- aliases: ["mychat"],
16
- },
17
- capabilities: {
18
- chatTypes: ["direct", "group", "thread"],
19
- reactions: true,
20
- media: true,
21
- threads: true,
22
- },
23
- reload: { configPrefixes: ["channels.mychat"] },
24
- configSchema: mychatConfigSchema,
25
- config: {
26
- listAccountIds(cfg) {
27
- return resolveMychatAccounts(cfg).map((a) => a.accountId);
28
- },
29
- resolveAccount(cfg, accountId) {
30
- return resolveMychatAccount({
31
- cfg,
32
- accountId,
33
- });
34
- },
35
- async inspectAccount(account) {
36
- return {
37
- accountId: account.accountId,
38
- enabled: account.enabled,
39
- label: account.name ?? account.baseUrl,
40
- };
41
- },
42
- },
43
- setup: {
44
- applyAccountConfig(params) {
45
- return params.cfg;
46
- },
47
- },
48
- };
49
- //#endregion
50
- export { mychatSetupPlugin };