adp-openclaw 0.0.75 → 0.0.76

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,5 +1,5 @@
1
- import type { OpenClawPluginApi } from "./src/sdk-compat.js";
2
- import { emptyPluginConfigSchema } from "./src/sdk-compat.js";
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
2
+ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
3
 
4
4
  // ============================================================================
5
5
  // PERFORMANCE NOTE: This file is the plugin entry point loaded by openclaw at
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adp-openclaw",
3
- "version": "0.0.75",
3
+ "version": "0.0.76",
4
4
  "description": "ADP-OpenClaw demo channel plugin (Go WebSocket backend)",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -4,8 +4,11 @@
4
4
  import type {
5
5
  ChannelPlugin,
6
6
  OpenClawConfig,
7
- } from "./sdk-compat.js";
8
- import { DEFAULT_ACCOUNT_ID } from "./sdk-compat.js";
7
+ } from "openclaw/plugin-sdk";
8
+
9
+ // DEFAULT_ACCOUNT_ID is "default" in all openclaw versions; inline it to avoid
10
+ // importing from plugin-sdk/core (whose subpath export is missing in <= 2026.3.2).
11
+ const DEFAULT_ACCOUNT_ID = "default";
9
12
  import { adpOpenclawSetupWizard } from "./onboarding.js";
10
13
  import { getActiveWebSocket } from "./runtime.js";
11
14
 
package/src/monitor.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Monitor: WebSocket connection to Go server for real-time message handling
2
2
  // Supports: API Token auth, conversation tracking for multi-turn dialogues
3
3
 
4
- import type { PluginLogger, OpenClawConfig } from "./sdk-compat.js";
4
+ import type { PluginLogger, OpenClawConfig } from "openclaw/plugin-sdk";
5
5
  import { getAdpOpenclawRuntime, setActiveWebSocket } from "./runtime.js";
6
6
  import {
7
7
  getChatHistory,
package/src/onboarding.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Setup wizard adapter for ADP OpenClaw channel plugin
2
2
  // Migrated from ChannelOnboardingAdapter to ChannelSetupWizard for openclaw >= 2026.3.22
3
- import type { ChannelSetupWizard } from "./sdk-compat.js";
4
- import type { OpenClawConfig } from "./sdk-compat.js";
3
+ import type { ChannelSetupWizard } from "openclaw/plugin-sdk";
4
+ import type { OpenClawConfig } from "openclaw/plugin-sdk";
5
5
 
6
6
  const channel = "adp-openclaw" as const;
7
7
 
package/src/runtime.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Runtime singleton for adp-openclaw plugin
2
- import type { PluginRuntime } from "./sdk-compat.js";
2
+ import type { PluginRuntime } from "openclaw/plugin-sdk";
3
3
  import type { WebSocket } from "ws";
4
4
 
5
5
  let adpOpenclawRuntime: PluginRuntime | null = null;
@@ -4,7 +4,7 @@
4
4
  // 1. Direct file reading (for local session files)
5
5
  // 2. CLI execution (via openclaw commands)
6
6
 
7
- import type { PluginLogger } from "./sdk-compat.js";
7
+ import type { PluginLogger } from "openclaw/plugin-sdk";
8
8
  import * as fs from "node:fs";
9
9
  import * as path from "node:path";
10
10
  import * as os from "node:os";
package/src/sdk-compat.ts DELETED
@@ -1,90 +0,0 @@
1
- /**
2
- * SDK Compatibility Layer
3
- *
4
- * openclaw@2026.3.2 does NOT have a `./plugin-sdk/core` subpath export in its
5
- * package.json "exports" map. Node's ESM resolver then falls back to the
6
- * filesystem, turning the request into
7
- * …/plugin-sdk/index.js/core (invalid — index.js is a file, not a dir)
8
- * which causes "Cannot find module" and the entire plugin fails to load.
9
- *
10
- * openclaw@2026.3.22+ added the missing subpath exports, so the direct
11
- * `import … from "openclaw/plugin-sdk/core"` works there.
12
- *
13
- * This module provides a single entry-point that:
14
- * 1. Tries `require("openclaw/plugin-sdk/core")` (works on >= 2026.3.22).
15
- * 2. Falls back to `require("openclaw/dist/plugin-sdk/core.js")` via
16
- * createRequire (works on older builds where the .js file exists but the
17
- * exports map omits it).
18
- * 3. If both fail, falls back to `require("openclaw/plugin-sdk")` which has
19
- * a subset of the exports (emptyPluginConfigSchema is there).
20
- *
21
- * Type-only imports are re-exported from the TypeScript declaration files
22
- * so that IDE autocompletion and type-checking continue to work when the
23
- * newer SDK is installed locally for development.
24
- */
25
-
26
- // ---------------------------------------------------------------------------
27
- // Re-export TYPES (erased at runtime — always safe, resolved at compile time
28
- // against whichever openclaw version the developer has installed locally).
29
- // ---------------------------------------------------------------------------
30
-
31
- export type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
32
- export type { ChannelPlugin } from "openclaw/plugin-sdk/core";
33
- export type { OpenClawConfig } from "openclaw/plugin-sdk/core";
34
- export type { PluginLogger } from "openclaw/plugin-sdk/core";
35
- export type { PluginRuntime } from "openclaw/plugin-sdk/core";
36
- export type { ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
37
-
38
- // ---------------------------------------------------------------------------
39
- // Runtime values — resolved with fallback so they work on 2026.3.2 as well.
40
- // ---------------------------------------------------------------------------
41
-
42
- import { createRequire } from "node:module";
43
-
44
- const require = createRequire(import.meta.url);
45
-
46
- /**
47
- * Try multiple require paths in order, returning the first that succeeds.
48
- */
49
- function tryRequire(...paths: string[]): Record<string, unknown> {
50
- let lastError: unknown;
51
- for (const p of paths) {
52
- try {
53
- return require(p) as Record<string, unknown>;
54
- } catch (e) {
55
- lastError = e;
56
- }
57
- }
58
- throw lastError;
59
- }
60
-
61
- // Attempt to load the core module, with fallbacks for older openclaw versions
62
- const _core = tryRequire(
63
- "openclaw/plugin-sdk/core", // >= 2026.3.22 (subpath export)
64
- "openclaw/dist/plugin-sdk/core.js", // older builds (direct file path — may be blocked by exports)
65
- "openclaw/plugin-sdk", // fallback barrel (has emptyPluginConfigSchema but not DEFAULT_ACCOUNT_ID)
66
- );
67
-
68
- // Attempt to load the setup module with fallback
69
- const _setup = tryRequire(
70
- "openclaw/plugin-sdk/setup", // >= 2026.3.22
71
- "openclaw/dist/plugin-sdk/setup.js", // older builds
72
- "openclaw/plugin-sdk", // fallback barrel
73
- );
74
-
75
- // ---- Exported runtime values ----
76
-
77
- /**
78
- * Returns an empty plugin config schema.
79
- * Available from both `plugin-sdk/core` and `plugin-sdk` (index).
80
- */
81
- export const emptyPluginConfigSchema = _core.emptyPluginConfigSchema as () => { schema: Record<string, unknown> };
82
-
83
- /**
84
- * Default account ID constant used by channel plugins.
85
- * Available from `plugin-sdk/core` and `plugin-sdk/setup`.
86
- */
87
- export const DEFAULT_ACCOUNT_ID: string =
88
- (_core.DEFAULT_ACCOUNT_ID as string | undefined) ??
89
- (_setup.DEFAULT_ACCOUNT_ID as string | undefined) ??
90
- "default";