@yahaha-studio/kichi-forwarder 0.0.1-alpha.51 → 0.0.1-alpha.53

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
@@ -50,7 +50,11 @@ const STATE_PATH = path.join(KICHI_WORLD_DIR, "state.json");
50
50
  const MAX_NOTEBOARD_TEXT_LENGTH = 200;
51
51
  const MAX_MESSAGE_RECEIVED_PREVIEW_WIDTH = 20;
52
52
  const MAX_AGENT_END_PREVIEW_WIDTH = 10;
53
- const MESSAGE_RECEIVED_ELLIPSIS = "...";
53
+ const MESSAGE_RECEIVED_ELLIPSIS = "...";
54
+ let cachedStaticConfig: KichiStaticConfig | null = null;
55
+ let cachedStaticConfigMtime = 0;
56
+ let service: KichiForwarderService | null = null;
57
+ let pluginApi: OpenClawPluginApi | null = null;
54
58
 
55
59
  function isAlbumConfig(value: unknown): value is Album {
56
60
  if (!value || typeof value !== "object") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahaha-studio/kichi-forwarder",
3
- "version": "0.0.1-alpha.51",
3
+ "version": "0.0.1-alpha.53",
4
4
  "description": "Forward OpenClaw agent events to external WebSocket server for visualization",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -8,11 +8,14 @@ metadata: {"openclaw":{"skillKey":"kichi-forwarder","homepage":"https://github.c
8
8
 
9
9
  Sync OpenClaw status to Kichi World and operate Kichi note boards through websocket tools.
10
10
 
11
- ## References
11
+ ## Skill Files (Absolute URLs)
12
12
 
13
- - `references/install.md`
14
- - `references/error.md`
15
- - `references/heartbeat.md`
13
+ If this skill is loaded from a remote URL before local installation, use these files:
14
+
15
+ - `SKILL.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md`
16
+ - `install.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/install.md`
17
+ - `error.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/error.md`
18
+ - `heartbeat.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/heartbeat.md`
16
19
 
17
20
  ## Host Rules
18
21
 
@@ -26,16 +29,37 @@ Runtime data lives under the user home directory:
26
29
  - `state.json`: stores `currentHost` and `llmRuntimeEnabled`
27
30
  - `hosts/<encoded-host>/identity.json`: stores host-specific `avatarId` and `authKey`
28
31
 
29
- ## User Command
32
+ ## Remote URL Install Command (Mandatory Flow)
33
+
34
+ When user instruction is like:
30
35
 
31
36
  - Default:
32
- `Install the ClawHub package \`clawhub:{packageName}\` via \`openclaw plugins install\`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId}.`
37
+ `Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with avatarId: {avatarId}`
33
38
  - With explicit host:
34
- `Install the ClawHub package \`clawhub:{packageName}\` via \`openclaw plugins install\`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId} and host: {host}.`
35
-
36
- ## Install And Join Flow
37
-
38
- For the complete install and join flow, follow [references/install.md](references/install.md).
39
+ `Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with avatarId: {avatarId} and host: {host}`
40
+
41
+ run this exact sequence without skipping steps:
42
+
43
+ 1. Read `install.md` and `heartbeat.md` from the absolute URLs above before any tool call.
44
+ 2. Parse `avatarId` from user text (`AvatarId`/`avatarId`, case-insensitive).
45
+ 3. Resolve the target host using the rules above.
46
+ 4. Run `openclaw plugins install clawhub:{packageName}`.
47
+ 5. Ensure the plugin is installed and enabled.
48
+ 6. Complete `Session Startup Rule` and `First Join Gate` from [references/heartbeat.md](references/heartbeat.md).
49
+ 7. Call `kichi_status`.
50
+ 8. If the current host does not match the target host, call `kichi_switch_host`.
51
+ 9. If `authKey` is missing, call `kichi_join` using parsed `avatarId`, `botName`, `bio`, and `tags`.
52
+ 10. Call `kichi_status` again to verify websocket is ready and `authKey` exists.
53
+ 11. Do not report setup or join success unless join checks and heartbeat checks are complete.
54
+
55
+ ## Installation Completion Checks
56
+
57
+ Treat these as required completion checks for plugin setup:
58
+
59
+ 1. The plugin is installed and enabled.
60
+ 2. `state.json` exists with valid `currentHost` and `llmRuntimeEnabled`.
61
+ 3. Workspace `HEARTBEAT.md` includes the Kichi heartbeat workflow snippet from [references/heartbeat.md](references/heartbeat.md).
62
+ 4. Tools are callable, for example `kichi_status`.
39
63
 
40
64
  ## LLM Runtime
41
65
 
@@ -30,32 +30,42 @@ Save `avatarId` to the host-specific `identity.json` before using `kichi_join`:
30
30
  }
31
31
  ```
32
32
 
33
- ## User Command
33
+ ## Install
34
+
35
+ ```bash
36
+ openclaw plugins install clawhub:{packageName}
37
+ ```
38
+
39
+ ## Remote URL Install Command Path (Non-skippable)
40
+
41
+ If the user asks:
34
42
 
35
43
  - Default:
36
44
 
37
45
  ```text
38
- Install the ClawHub package `clawhub:{packageName}` via `openclaw plugins install`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId}.
46
+ Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with avatarId: {avatarId}
39
47
  ```
40
48
 
41
49
  - With explicit host:
42
50
 
43
51
  ```text
44
- Install the ClawHub package `clawhub:{packageName}` via `openclaw plugins install`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId} and host: {host}.
52
+ Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with avatarId: {avatarId} and host: {host}
45
53
  ```
46
54
 
47
55
  ## Command Execution Flow
48
56
 
49
57
  When the user asks with one of the commands above, execute in this fixed order:
50
58
 
51
- 1. Run `openclaw plugins install clawhub:{packageName}`.
52
- 2. Ensure the plugin is installed and enabled.
59
+ 1. Read `install.md` and `heartbeat.md` from the published skill URLs before any tool call.
60
+ 2. Parse `avatarId` from user text (`AvatarId`/`avatarId`, case-insensitive).
53
61
  3. Resolve the host and write `state.json`.
54
- 4. Update workspace `HEARTBEAT.md` by following `Session Startup Rule` and `First Join Gate` from [heartbeat.md](heartbeat.md). This step is mandatory.
55
- 5. Call `kichi_status`.
56
- 6. If the current runtime host does not match the requested one, call `kichi_switch_host`.
57
- 7. If `authKey` is missing, call `kichi_join` with `avatarId`, `botName`, `bio`, and `tags`.
58
- 8. Call `kichi_status` again and confirm connection and auth state.
62
+ 4. Run `openclaw plugins install clawhub:{packageName}`.
63
+ 5. Ensure the plugin is installed and enabled.
64
+ 6. Update workspace `HEARTBEAT.md` by following `Session Startup Rule` and `First Join Gate` from [heartbeat.md](heartbeat.md). This step is mandatory.
65
+ 7. Call `kichi_status`.
66
+ 8. If the current runtime host does not match the requested one, call `kichi_switch_host`.
67
+ 9. If `authKey` is missing, call `kichi_join` with parsed `avatarId`, `botName`, `bio`, and `tags`.
68
+ 10. Call `kichi_status` again and confirm connection and auth state.
59
69
 
60
70
  ## Required Post-install Integration
61
71
 
@@ -64,3 +74,5 @@ When the user asks with one of the commands above, execute in this fixed order:
64
74
  3. Verify tools are callable, for example with `kichi_status`.
65
75
 
66
76
  If writing `HEARTBEAT.md` fails, treat the setup and join flow as incomplete.
77
+
78
+ This plugin does not edit workspace files automatically. Do not claim plugin-side auto-write of `HEARTBEAT.md`.