@im_dd/openclaw-listen-mode 0.1.2 → 0.1.4
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/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +77 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export { ListenModePlugin } from './plugin.js';
|
|
2
|
+
export declare function activate(api: {
|
|
3
|
+
registerHook: (hook: string, handler: (...args: unknown[]) => unknown) => void;
|
|
4
|
+
on: (event: string, handler: (...args: unknown[]) => unknown) => void;
|
|
5
|
+
registerService: (service: {
|
|
6
|
+
name: string;
|
|
7
|
+
start: () => Promise<void>;
|
|
8
|
+
stop: () => Promise<void>;
|
|
9
|
+
}) => void;
|
|
10
|
+
config: Record<string, unknown>;
|
|
11
|
+
logger: {
|
|
12
|
+
info: (...args: unknown[]) => void;
|
|
13
|
+
warn: (...args: unknown[]) => void;
|
|
14
|
+
error: (...args: unknown[]) => void;
|
|
15
|
+
debug: (...args: unknown[]) => void;
|
|
16
|
+
};
|
|
17
|
+
}): void;
|
|
18
|
+
export { activate as register };
|
|
2
19
|
export type { ListenModeConfig, DeepPartial, TriggerMode, Sensitivity, AckConfig, ReplyConfig, EmojiConfig, IntelligenceConfig, DynamicTimeoutConfigOptions, EmotionLevelConfig, PersonaConfigOptions, SessionConfigOptions, StatsConfigOptions, } from './types/config.js';
|
|
3
20
|
export type { InboundMessage, OutboundMessage, SplitMessage, } from './types/message.js';
|
|
4
21
|
export type { OpenClawPlugin, GatewayContext, SendOptions, SendToAgentOptions, LLMCallOptions, Logger, } from './types/plugin-api.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO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EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
export { ListenModePlugin } from './plugin.js';
|
|
2
|
+
// OpenClaw plugin entry point
|
|
3
|
+
import { ListenModePlugin } from './plugin.js';
|
|
4
|
+
export function activate(api) {
|
|
5
|
+
const plugin = new ListenModePlugin(api.config);
|
|
6
|
+
api.on('gateway:init', async (ctx) => {
|
|
7
|
+
await plugin.init(ctx);
|
|
8
|
+
});
|
|
9
|
+
api.on('message:inbound', async (message) => {
|
|
10
|
+
return plugin.onInboundMessage(message);
|
|
11
|
+
});
|
|
12
|
+
api.on('message:outbound', async (message) => {
|
|
13
|
+
return plugin.onOutboundMessage(message);
|
|
14
|
+
});
|
|
15
|
+
api.on('gateway:destroy', async () => {
|
|
16
|
+
await plugin.destroy();
|
|
17
|
+
});
|
|
18
|
+
api.logger.info('listen-mode plugin activated');
|
|
19
|
+
}
|
|
20
|
+
export { activate as register };
|
|
2
21
|
export { ListenState, } from './types/state.js';
|
|
3
22
|
export { DEFAULT_CONFIG } from './config/defaults.js';
|
|
4
23
|
// Analytics
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,GAMxB;IACC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAa,CAA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O,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "listen-mode",
|
|
3
|
+
"name": "Listen Mode",
|
|
4
|
+
"description": "Empathic listening mode plugin - pauses AI responses to let users express themselves fully before responding",
|
|
5
|
+
"version": "0.1.2",
|
|
6
|
+
"configSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"triggerMode": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": ["manual", "auto", "both"],
|
|
13
|
+
"default": "manual"
|
|
14
|
+
},
|
|
15
|
+
"silenceTimeoutMs": {
|
|
16
|
+
"type": "number",
|
|
17
|
+
"default": 30000
|
|
18
|
+
},
|
|
19
|
+
"maxListenTimeMs": {
|
|
20
|
+
"type": "number",
|
|
21
|
+
"default": 120000
|
|
22
|
+
},
|
|
23
|
+
"maxBufferMessages": {
|
|
24
|
+
"type": "integer",
|
|
25
|
+
"default": 20
|
|
26
|
+
},
|
|
27
|
+
"sensitivity": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": ["low", "medium", "high"],
|
|
30
|
+
"default": "medium"
|
|
31
|
+
},
|
|
32
|
+
"languages": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" },
|
|
35
|
+
"default": ["zh", "en"]
|
|
36
|
+
},
|
|
37
|
+
"systemHint": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"default": true
|
|
40
|
+
},
|
|
41
|
+
"ack": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"entryReply": { "type": "boolean", "default": true },
|
|
45
|
+
"intervalMessages": { "type": "array", "items": { "type": "integer" } },
|
|
46
|
+
"intervalMs": { "type": "array", "items": { "type": "number" } },
|
|
47
|
+
"useLLM": { "type": "boolean", "default": true },
|
|
48
|
+
"llmModel": { "type": "string", "default": "haiku" },
|
|
49
|
+
"llmTimeoutMs": { "type": "number", "default": 2000 }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"reply": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"splitEnabled": { "type": "boolean", "default": true },
|
|
56
|
+
"maxCharsPerMessage": { "type": "integer", "default": 50 },
|
|
57
|
+
"delayBaseMs": { "type": "number", "default": 1500 },
|
|
58
|
+
"delayPerCharMs": { "type": "number", "default": 150 },
|
|
59
|
+
"delayRandomMs": { "type": "number", "default": 1000 }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"emoji": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"enabled": { "type": "boolean", "default": true },
|
|
66
|
+
"frequency": { "type": "string", "enum": ["low", "moderate", "high"], "default": "moderate" },
|
|
67
|
+
"stickerEnabled": { "type": "boolean", "default": false },
|
|
68
|
+
"stickerDir": { "type": "string" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"byChannel": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@im_dd/openclaw-listen-mode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "OpenClaw plugin for empathic listening mode in chat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"openclaw.plugin.json"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "tsc -p tsconfig.build.json",
|