@2en/clawly-plugins 1.17.0 → 1.17.1
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/cron-hook.ts +1 -1
- package/package.json +1 -1
- package/tools/clawly-send-message.ts +5 -5
package/cron-hook.ts
CHANGED
|
@@ -24,7 +24,7 @@ const DELIVERY_SUFFIX = [
|
|
|
24
24
|
'---',
|
|
25
25
|
'DELIVERY INSTRUCTIONS (mandatory):',
|
|
26
26
|
'When done, you MUST deliver your result to the user:',
|
|
27
|
-
'1. Call the clawly_send_message tool with a brief, natural summary of your result.',
|
|
27
|
+
'1. Call the clawly_send_message tool with role="assistant" and a brief, natural summary of your result.',
|
|
28
28
|
'2. Call clawly_is_user_online to check if the user is online.',
|
|
29
29
|
'3. If offline, also call clawly_send_app_push with a short notification.',
|
|
30
30
|
].join('\n')
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Agent tool: clawly_send_message — send a message to the main session
|
|
3
3
|
* agent from an isolated context (e.g. cron job).
|
|
4
4
|
*
|
|
5
|
-
* - role: "
|
|
6
|
-
* - role: "assistant" — injects into transcript via chat.inject (no agent trigger,
|
|
5
|
+
* - role: "assistant" (default) — injects into transcript via chat.inject (no agent trigger,
|
|
7
6
|
* since the calling agent has already decided to send)
|
|
7
|
+
* - role: "user" — triggers agent turn via gateway RPC
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type {PluginApi} from '../index'
|
|
@@ -23,7 +23,7 @@ const parameters: Record<string, unknown> = {
|
|
|
23
23
|
type: 'string',
|
|
24
24
|
enum: ['user', 'assistant'],
|
|
25
25
|
description:
|
|
26
|
-
'Message role. "
|
|
26
|
+
'Message role. "assistant" (default) injects into transcript as assistant without triggering a run. "user" sends as user and triggers agent run.',
|
|
27
27
|
},
|
|
28
28
|
sessionKey: {
|
|
29
29
|
type: 'string',
|
|
@@ -36,7 +36,7 @@ export function registerSendMessageTool(api: PluginApi) {
|
|
|
36
36
|
api.registerTool({
|
|
37
37
|
name: TOOL_NAME,
|
|
38
38
|
description:
|
|
39
|
-
'Send a message to the user via the main session
|
|
39
|
+
'Send a message to the user via the main session. Use this from cron jobs or isolated sessions to deliver results to the user. By default injects as an assistant message (no agent run). Set role to "user" to trigger an agent run instead.',
|
|
40
40
|
parameters,
|
|
41
41
|
async execute(_toolCallId, params) {
|
|
42
42
|
const message = typeof params.message === 'string' ? params.message.trim() : ''
|
|
@@ -45,7 +45,7 @@ export function registerSendMessageTool(api: PluginApi) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const agent = typeof params.agent === 'string' ? params.agent.trim() : 'clawly'
|
|
48
|
-
const role = params.role === '
|
|
48
|
+
const role = params.role === 'user' ? 'user' : 'assistant'
|
|
49
49
|
|
|
50
50
|
try {
|
|
51
51
|
if (role === 'assistant') {
|