@botcord/botcord 0.1.3-beta.1 → 0.1.3

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/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @botcord/botcord — OpenClaw plugin for BotCord A2A messaging protocol.
3
3
  */
4
- import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
5
4
  import { botCordPlugin } from "./src/channel.js";
6
5
  import { setBotCordRuntime, setConfigGetter } from "./src/runtime.js";
7
6
  import { createMessagingTool, createUploadTool } from "./src/tools/messaging.js";
@@ -26,17 +25,18 @@ import {
26
25
  shouldRunBotCordLoopRiskCheck,
27
26
  } from "./src/loop-risk.js";
28
27
 
29
- export default defineChannelPluginEntry({
28
+ // Inline replacement for defineChannelPluginEntry from openclaw/plugin-sdk/core.
29
+ // Avoids missing dist artifacts in npm-installed openclaw (see openclaw#53685).
30
+ export default {
30
31
  id: "botcord",
31
32
  name: "BotCord",
32
33
  description: "BotCord A2A messaging protocol — secure agent-to-agent communication with Ed25519 signing",
33
- plugin: botCordPlugin,
34
+ register(api: any) {
35
+ setBotCordRuntime(api.runtime);
36
+ api.registerChannel({ plugin: botCordPlugin });
34
37
 
35
- setRuntime(runtime) {
36
- setBotCordRuntime(runtime);
37
- },
38
+ if (api.registrationMode !== "full") return;
38
39
 
39
- registerFull(api) {
40
40
  setConfigGetter(() => api.config);
41
41
 
42
42
  // Agent tools — `as any` needed until tool execute() return types are
@@ -54,7 +54,7 @@ export default defineChannelPluginEntry({
54
54
  api.registerTool(createBindTool() as any);
55
55
 
56
56
  // Hooks
57
- api.on("after_tool_call", async (event, ctx) => {
57
+ api.on("after_tool_call", async (event: any, ctx: any) => {
58
58
  if (ctx.toolName !== "botcord_send") return;
59
59
  if (!didBotCordSendSucceed(event.result, event.error)) return;
60
60
  recordBotCordOutboundText({
@@ -63,7 +63,7 @@ export default defineChannelPluginEntry({
63
63
  });
64
64
  });
65
65
 
66
- api.on("before_prompt_build", async (event, ctx) => {
66
+ api.on("before_prompt_build", async (event: any, ctx: any) => {
67
67
  if (!shouldRunBotCordLoopRiskCheck({
68
68
  channelId: ctx.channelId,
69
69
  prompt: event.prompt,
@@ -82,7 +82,7 @@ export default defineChannelPluginEntry({
82
82
  return { prependContext };
83
83
  }, { priority: 10 });
84
84
 
85
- api.on("session_end", async (_event, ctx) => {
85
+ api.on("session_end", async (_event: any, ctx: any) => {
86
86
  clearBotCordLoopRiskSession(ctx.sessionKey);
87
87
  });
88
88
 
@@ -95,7 +95,7 @@ export default defineChannelPluginEntry({
95
95
  const registerCli = createRegisterCli();
96
96
  api.registerCli(registerCli.setup, { commands: registerCli.commands });
97
97
  },
98
- });
98
+ };
99
99
 
100
100
  export { TopicTracker } from "./src/topic-tracker.js";
101
101
  export type { TopicState, TopicInfo } from "./src/topic-tracker.js";
@@ -2,7 +2,7 @@
2
2
  "id": "botcord",
3
3
  "name": "BotCord",
4
4
  "description": "Secure agent-to-agent messaging via the BotCord A2A protocol (Ed25519 signed envelopes)",
5
- "version": "0.1.3-beta.1",
5
+ "version": "0.1.3",
6
6
  "channels": [
7
7
  "botcord"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botcord/botcord",
3
- "version": "0.1.3-beta.1",
3
+ "version": "0.1.3",
4
4
  "description": "OpenClaw channel plugin for BotCord A2A messaging protocol (Ed25519 signed envelopes)",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
package/setup-entry.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // setup-entry.ts — lightweight entry for onboarding/config (no heavy deps like ws)
2
- import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
3
2
  import { botCordPlugin } from "./src/channel.js";
4
3
 
5
- export default defineSetupPluginEntry(botCordPlugin);
4
+ // Inline replacement for defineSetupPluginEntry (just returns { plugin }).
5
+ export default { plugin: botCordPlugin };
package/src/channel.ts CHANGED
@@ -4,11 +4,35 @@
4
4
  * security, messaging, and status adapters.
5
5
  */
6
6
  import type { ChannelPlugin, OpenClawConfig as ClawdbotConfig } from "openclaw/plugin-sdk/core";
7
- import {
8
- buildBaseChannelStatusSummary,
9
- createDefaultChannelRuntimeState,
10
- } from "openclaw/plugin-sdk/status-helpers";
11
- import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
7
+ // Inlined from openclaw/plugin-sdk/status-helpers and account-id to avoid
8
+ // missing dist artifacts in npm-installed openclaw (see openclaw#53685).
9
+ const DEFAULT_ACCOUNT_ID = "default";
10
+
11
+ function createDefaultChannelRuntimeState(accountId: string) {
12
+ return {
13
+ accountId,
14
+ running: false as const,
15
+ lastStartAt: null,
16
+ lastStopAt: null,
17
+ lastError: null,
18
+ };
19
+ }
20
+
21
+ function buildBaseChannelStatusSummary(snapshot: {
22
+ configured?: boolean | null;
23
+ running?: boolean | null;
24
+ lastStartAt?: number | null;
25
+ lastStopAt?: number | null;
26
+ lastError?: string | null;
27
+ }) {
28
+ return {
29
+ configured: snapshot.configured ?? false,
30
+ running: snapshot.running ?? false,
31
+ lastStartAt: snapshot.lastStartAt ?? null,
32
+ lastStopAt: snapshot.lastStopAt ?? null,
33
+ lastError: snapshot.lastError ?? null,
34
+ };
35
+ }
12
36
  import {
13
37
  resolveChannelConfig,
14
38
  resolveAccounts,
package/src/constants.ts CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  export type ReleaseChannel = "stable" | "beta";
11
11
 
12
- export const RELEASE_CHANNEL: ReleaseChannel = "beta";
12
+ export const RELEASE_CHANNEL: ReleaseChannel = "stable";
13
13
 
14
14
  const HUB_URLS: Record<ReleaseChannel, string> = {
15
15
  stable: "https://api.botcord.chat",
package/src/inbound.ts CHANGED
@@ -5,7 +5,20 @@
5
5
  import { getBotCordRuntime } from "./runtime.js";
6
6
  import { resolveAccountConfig } from "./config.js";
7
7
  import { buildSessionKey } from "./session-key.js";
8
- import { loadSessionStore } from "openclaw/plugin-sdk/mattermost";
8
+ import { readFileSync } from "node:fs";
9
+
10
+ // Simplified inline replacement for loadSessionStore from openclaw/plugin-sdk/mattermost.
11
+ // Avoids missing dist artifacts in npm-installed openclaw (see openclaw#53685).
12
+ function loadSessionStore(storePath: string): Record<string, any> {
13
+ try {
14
+ const raw = readFileSync(storePath, "utf-8");
15
+ if (!raw) return {};
16
+ const parsed = JSON.parse(raw);
17
+ return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
18
+ } catch {
19
+ return {};
20
+ }
21
+ }
9
22
  import { sanitizeUntrustedContent, sanitizeSenderName } from "./sanitize.js";
10
23
  import { BotCordClient } from "./client.js";
11
24
  import { createBotCordReplyDispatcher } from "./reply-dispatcher.js";