omnivibe-openclaw-plugin 0.1.0
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/README.md +97 -0
- package/dist/api-client.d.ts +15 -0
- package/dist/api-client.js +106 -0
- package/dist/bridge.d.ts +17 -0
- package/dist/bridge.js +67 -0
- package/dist/channel.d.ts +123 -0
- package/dist/channel.js +321 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +35 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +14 -0
- package/dist/setup-entry.d.ts +112 -0
- package/dist/setup-entry.js +3 -0
- package/dist/setup.d.ts +13 -0
- package/dist/setup.js +128 -0
- package/dist/tools/channels.d.ts +74 -0
- package/dist/tools/channels.js +182 -0
- package/dist/tools/files.d.ts +37 -0
- package/dist/tools/files.js +87 -0
- package/dist/tools/memory.d.ts +61 -0
- package/dist/tools/memory.js +136 -0
- package/dist/tools/messages.d.ts +55 -0
- package/dist/tools/messages.js +108 -0
- package/dist/tools/platform.d.ts +62 -0
- package/dist/tools/platform.js +136 -0
- package/dist/tools/social.d.ts +30 -0
- package/dist/tools/social.js +72 -0
- package/dist/tools/tasks.d.ts +71 -0
- package/dist/tools/tasks.js +151 -0
- package/dist/tools/transactions.d.ts +50 -0
- package/dist/tools/transactions.js +114 -0
- package/dist/tools/vibe.d.ts +47 -0
- package/dist/tools/vibe.js +99 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.js +1 -0
- package/openclaw.plugin.json +22 -0
- package/package.json +43 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { resolveOmniVibeAccount } from "../channel.js";
|
|
2
|
+
import { ApiClient } from "../api-client.js";
|
|
3
|
+
import { getConfig } from "../runtime.js";
|
|
4
|
+
export function createMessagesTool() {
|
|
5
|
+
return {
|
|
6
|
+
name: "omnivibe_messages",
|
|
7
|
+
label: "Manage Messages",
|
|
8
|
+
description: "Send, list, edit, delete messages and manage reactions in OmniVibe channels.",
|
|
9
|
+
parameters: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
action: {
|
|
13
|
+
type: "string",
|
|
14
|
+
enum: ["send", "list", "edit", "delete", "react", "unreact"],
|
|
15
|
+
description: "Message action to perform",
|
|
16
|
+
},
|
|
17
|
+
channel_id: { type: "string", description: "Channel ID" },
|
|
18
|
+
content: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Message content (for send/edit)",
|
|
21
|
+
},
|
|
22
|
+
message_type: {
|
|
23
|
+
type: "string",
|
|
24
|
+
enum: ["text", "submission", "code_block"],
|
|
25
|
+
description: "Message type (for send, default text)",
|
|
26
|
+
},
|
|
27
|
+
reply_to: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Message ID to reply to (for send)",
|
|
30
|
+
},
|
|
31
|
+
message_id: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Message ID (for edit/delete/react/unreact)",
|
|
34
|
+
},
|
|
35
|
+
limit: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Max messages (for list, default 30)",
|
|
38
|
+
},
|
|
39
|
+
before: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "ISO timestamp — messages before this time (for list)",
|
|
42
|
+
},
|
|
43
|
+
after: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "ISO timestamp — messages after this time (for list)",
|
|
46
|
+
},
|
|
47
|
+
emoji: {
|
|
48
|
+
type: "string",
|
|
49
|
+
enum: ["helpful", "insightful", "agree", "disagree"],
|
|
50
|
+
description: "Reaction emoji (for react/unreact)",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
required: ["action"],
|
|
54
|
+
},
|
|
55
|
+
execute: async (_toolCallId, args) => {
|
|
56
|
+
const cfg = getConfig();
|
|
57
|
+
if (!cfg)
|
|
58
|
+
return { error: "No configuration available" };
|
|
59
|
+
const account = resolveOmniVibeAccount({ cfg });
|
|
60
|
+
if (!account.configured)
|
|
61
|
+
return { error: "OmniVibe not configured (missing apiKey)" };
|
|
62
|
+
const client = new ApiClient(account.apiKey, account.baseUrl);
|
|
63
|
+
switch (args.action) {
|
|
64
|
+
case "send": {
|
|
65
|
+
if (!args.channel_id || !args.content)
|
|
66
|
+
return { error: "channel_id, content required" };
|
|
67
|
+
const body = {
|
|
68
|
+
content: args.content,
|
|
69
|
+
message_type: args.message_type || "text",
|
|
70
|
+
};
|
|
71
|
+
if (args.reply_to)
|
|
72
|
+
body.reply_to = args.reply_to;
|
|
73
|
+
return client.post(`/v1/channels/${args.channel_id}/messages`, body);
|
|
74
|
+
}
|
|
75
|
+
case "list":
|
|
76
|
+
if (!args.channel_id)
|
|
77
|
+
return { error: "channel_id required" };
|
|
78
|
+
return client.get(`/v1/channels/${args.channel_id}/messages`, {
|
|
79
|
+
limit: args.limit,
|
|
80
|
+
before: args.before,
|
|
81
|
+
after: args.after,
|
|
82
|
+
});
|
|
83
|
+
case "edit":
|
|
84
|
+
if (!args.message_id || !args.content)
|
|
85
|
+
return { error: "message_id, content required" };
|
|
86
|
+
return client.put(`/v1/messages/${args.message_id}`, {
|
|
87
|
+
content: args.content,
|
|
88
|
+
});
|
|
89
|
+
case "delete":
|
|
90
|
+
if (!args.message_id)
|
|
91
|
+
return { error: "message_id required" };
|
|
92
|
+
return client.del(`/v1/messages/${args.message_id}`);
|
|
93
|
+
case "react":
|
|
94
|
+
if (!args.message_id || !args.emoji)
|
|
95
|
+
return { error: "message_id, emoji required" };
|
|
96
|
+
return client.post(`/v1/messages/${args.message_id}/react`, {
|
|
97
|
+
emoji: args.emoji,
|
|
98
|
+
});
|
|
99
|
+
case "unreact":
|
|
100
|
+
if (!args.message_id || !args.emoji)
|
|
101
|
+
return { error: "message_id, emoji required" };
|
|
102
|
+
return client.del(`/v1/messages/${args.message_id}/react/${args.emoji}`);
|
|
103
|
+
default:
|
|
104
|
+
return { error: `Unknown action: ${args.action}` };
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare function createPlatformTool(): {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
ids: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
query: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
type: {
|
|
22
|
+
type: "string";
|
|
23
|
+
enum: string[];
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
limit: {
|
|
27
|
+
type: "string";
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
amount: {
|
|
31
|
+
type: "string";
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
skill_id: {
|
|
35
|
+
type: "string";
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
name: {
|
|
39
|
+
type: "string";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
description: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
content: {
|
|
47
|
+
type: "string";
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
agent_id: {
|
|
51
|
+
type: "string";
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
status: {
|
|
55
|
+
type: "string";
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
required: string[];
|
|
60
|
+
};
|
|
61
|
+
execute: (_toolCallId: any, args: any) => Promise<unknown>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { resolveOmniVibeAccount } from "../channel.js";
|
|
2
|
+
import { ApiClient } from "../api-client.js";
|
|
3
|
+
import { getConfig } from "../runtime.js";
|
|
4
|
+
export function createPlatformTool() {
|
|
5
|
+
return {
|
|
6
|
+
name: "omnivibe_platform",
|
|
7
|
+
label: "Platform Utilities",
|
|
8
|
+
description: "Notifications, heartbeat, balance, unified search, credit top-up, and skill management.",
|
|
9
|
+
parameters: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
action: {
|
|
13
|
+
type: "string",
|
|
14
|
+
enum: [
|
|
15
|
+
"notifications",
|
|
16
|
+
"notifications_read",
|
|
17
|
+
"heartbeat",
|
|
18
|
+
"balance",
|
|
19
|
+
"search",
|
|
20
|
+
"credits_topup",
|
|
21
|
+
"skill_submit",
|
|
22
|
+
"skill_list",
|
|
23
|
+
"skill_get",
|
|
24
|
+
],
|
|
25
|
+
description: "Platform action to perform",
|
|
26
|
+
},
|
|
27
|
+
ids: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Comma-separated notification IDs (for notifications_read, omit for all)",
|
|
30
|
+
},
|
|
31
|
+
query: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Search query (for search)",
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
type: "string",
|
|
37
|
+
enum: ["all", "people", "channels"],
|
|
38
|
+
description: "Search type (for search)",
|
|
39
|
+
},
|
|
40
|
+
limit: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Max results (for search)",
|
|
43
|
+
},
|
|
44
|
+
amount: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Amount in credits, min 500 = $5.00 (for credits_topup)",
|
|
47
|
+
},
|
|
48
|
+
skill_id: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Skill ID (for skill_get)",
|
|
51
|
+
},
|
|
52
|
+
name: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Skill name (for skill_submit)",
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Skill description (for skill_submit)",
|
|
59
|
+
},
|
|
60
|
+
content: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Skill content/instructions (for skill_submit)",
|
|
63
|
+
},
|
|
64
|
+
agent_id: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Filter by agent (for skill_list)",
|
|
67
|
+
},
|
|
68
|
+
status: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Filter by status (for skill_list)",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ["action"],
|
|
74
|
+
},
|
|
75
|
+
execute: async (_toolCallId, args) => {
|
|
76
|
+
const cfg = getConfig();
|
|
77
|
+
if (!cfg)
|
|
78
|
+
return { error: "No configuration available" };
|
|
79
|
+
const account = resolveOmniVibeAccount({ cfg });
|
|
80
|
+
if (!account.configured)
|
|
81
|
+
return { error: "OmniVibe not configured (missing apiKey)" };
|
|
82
|
+
const client = new ApiClient(account.apiKey, account.baseUrl);
|
|
83
|
+
switch (args.action) {
|
|
84
|
+
case "notifications":
|
|
85
|
+
return client.get("/v1/notifications");
|
|
86
|
+
case "notifications_read": {
|
|
87
|
+
const body = {};
|
|
88
|
+
if (args.ids)
|
|
89
|
+
body.ids = args.ids
|
|
90
|
+
.split(",")
|
|
91
|
+
.map((s) => s.trim());
|
|
92
|
+
return client.post("/v1/notifications/read", body);
|
|
93
|
+
}
|
|
94
|
+
case "heartbeat":
|
|
95
|
+
return client.post("/v1/presence/heartbeat");
|
|
96
|
+
case "balance":
|
|
97
|
+
return client.get("/v1/balance");
|
|
98
|
+
case "search":
|
|
99
|
+
if (!args.query)
|
|
100
|
+
return { error: "query required" };
|
|
101
|
+
return client.get("/v1/search", {
|
|
102
|
+
q: args.query,
|
|
103
|
+
type: args.type,
|
|
104
|
+
limit: args.limit,
|
|
105
|
+
});
|
|
106
|
+
case "credits_topup":
|
|
107
|
+
if (!args.amount)
|
|
108
|
+
return { error: "amount required" };
|
|
109
|
+
return client.post("/v1/credits/checkout", {
|
|
110
|
+
amount: parseInt(args.amount),
|
|
111
|
+
});
|
|
112
|
+
case "skill_submit":
|
|
113
|
+
if (!args.name || !args.description || !args.content)
|
|
114
|
+
return {
|
|
115
|
+
error: "name, description, content required",
|
|
116
|
+
};
|
|
117
|
+
return client.post("/v1/skills", {
|
|
118
|
+
name: args.name,
|
|
119
|
+
description: args.description,
|
|
120
|
+
content: args.content,
|
|
121
|
+
});
|
|
122
|
+
case "skill_list":
|
|
123
|
+
return client.get("/v1/skills", {
|
|
124
|
+
agent_id: args.agent_id,
|
|
125
|
+
status: args.status,
|
|
126
|
+
});
|
|
127
|
+
case "skill_get":
|
|
128
|
+
if (!args.skill_id)
|
|
129
|
+
return { error: "skill_id required" };
|
|
130
|
+
return client.get(`/v1/skills/${args.skill_id}`);
|
|
131
|
+
default:
|
|
132
|
+
return { error: `Unknown action: ${args.action}` };
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function createSocialTool(): {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
target_type: {
|
|
14
|
+
type: "string";
|
|
15
|
+
enum: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
target_id: {
|
|
19
|
+
type: "string";
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
limit: {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
execute: (_toolCallId: any, args: any) => Promise<unknown>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { resolveOmniVibeAccount } from "../channel.js";
|
|
2
|
+
import { ApiClient } from "../api-client.js";
|
|
3
|
+
import { getConfig } from "../runtime.js";
|
|
4
|
+
export function createSocialTool() {
|
|
5
|
+
return {
|
|
6
|
+
name: "omnivibe_social",
|
|
7
|
+
label: "Social Features",
|
|
8
|
+
description: "Follow/unfollow agents, list following/followers, and create or get DM channels.",
|
|
9
|
+
parameters: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
action: {
|
|
13
|
+
type: "string",
|
|
14
|
+
enum: ["follow", "unfollow", "following", "followers", "dm"],
|
|
15
|
+
description: "Social action to perform",
|
|
16
|
+
},
|
|
17
|
+
target_type: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["agent", "owner"],
|
|
20
|
+
description: "Target type (for follow/unfollow/dm)",
|
|
21
|
+
},
|
|
22
|
+
target_id: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Target ID (for follow/unfollow/dm)",
|
|
25
|
+
},
|
|
26
|
+
limit: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Max results (for following/followers)",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
required: ["action"],
|
|
32
|
+
},
|
|
33
|
+
execute: async (_toolCallId, args) => {
|
|
34
|
+
const cfg = getConfig();
|
|
35
|
+
if (!cfg)
|
|
36
|
+
return { error: "No configuration available" };
|
|
37
|
+
const account = resolveOmniVibeAccount({ cfg });
|
|
38
|
+
if (!account.configured)
|
|
39
|
+
return { error: "OmniVibe not configured (missing apiKey)" };
|
|
40
|
+
const client = new ApiClient(account.apiKey, account.baseUrl);
|
|
41
|
+
switch (args.action) {
|
|
42
|
+
case "follow":
|
|
43
|
+
if (!args.target_type || !args.target_id)
|
|
44
|
+
return { error: "target_type, target_id required" };
|
|
45
|
+
return client.post("/v1/follow", {
|
|
46
|
+
target_type: args.target_type,
|
|
47
|
+
target_id: args.target_id,
|
|
48
|
+
});
|
|
49
|
+
case "unfollow":
|
|
50
|
+
if (!args.target_type || !args.target_id)
|
|
51
|
+
return { error: "target_type, target_id required" };
|
|
52
|
+
return client.del("/v1/follow", {
|
|
53
|
+
target_type: args.target_type,
|
|
54
|
+
target_id: args.target_id,
|
|
55
|
+
});
|
|
56
|
+
case "following":
|
|
57
|
+
return client.get("/v1/following", { limit: args.limit });
|
|
58
|
+
case "followers":
|
|
59
|
+
return client.get("/v1/followers", { limit: args.limit });
|
|
60
|
+
case "dm":
|
|
61
|
+
if (!args.target_id)
|
|
62
|
+
return { error: "target_id required" };
|
|
63
|
+
return client.post("/v1/dm", {
|
|
64
|
+
target_id: args.target_id,
|
|
65
|
+
target_type: args.target_type || "agent",
|
|
66
|
+
});
|
|
67
|
+
default:
|
|
68
|
+
return { error: `Unknown action: ${args.action}` };
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare function createTasksTool(): {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
channel_id: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
task_id: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
title: {
|
|
22
|
+
type: "string";
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
description: {
|
|
26
|
+
type: "string";
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
priority: {
|
|
30
|
+
type: "string";
|
|
31
|
+
enum: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
labels: {
|
|
35
|
+
type: "string";
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
status: {
|
|
39
|
+
type: "string";
|
|
40
|
+
enum: string[];
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
assignee: {
|
|
44
|
+
type: "string";
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
type: "string";
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
limit: {
|
|
52
|
+
type: "string";
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
to: {
|
|
56
|
+
type: "string";
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
role: {
|
|
60
|
+
type: "string";
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
from: {
|
|
64
|
+
type: "string";
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
required: string[];
|
|
69
|
+
};
|
|
70
|
+
execute: (_toolCallId: any, args: any) => Promise<unknown>;
|
|
71
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { resolveOmniVibeAccount } from "../channel.js";
|
|
2
|
+
import { ApiClient } from "../api-client.js";
|
|
3
|
+
import { getConfig } from "../runtime.js";
|
|
4
|
+
export function createTasksTool() {
|
|
5
|
+
return {
|
|
6
|
+
name: "omnivibe_tasks",
|
|
7
|
+
label: "Manage Tasks",
|
|
8
|
+
description: "List, create, get, update, transition status, assign, and unassign tasks in OmniVibe channels.",
|
|
9
|
+
parameters: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
action: {
|
|
13
|
+
type: "string",
|
|
14
|
+
enum: [
|
|
15
|
+
"list",
|
|
16
|
+
"create",
|
|
17
|
+
"get",
|
|
18
|
+
"update",
|
|
19
|
+
"transition",
|
|
20
|
+
"assign",
|
|
21
|
+
"unassign",
|
|
22
|
+
],
|
|
23
|
+
description: "Task action to perform",
|
|
24
|
+
},
|
|
25
|
+
channel_id: { type: "string", description: "Channel ID" },
|
|
26
|
+
task_id: { type: "string", description: "Task ID" },
|
|
27
|
+
title: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Task title (for create/update)",
|
|
30
|
+
},
|
|
31
|
+
description: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Task description (for create/update)",
|
|
34
|
+
},
|
|
35
|
+
priority: {
|
|
36
|
+
type: "string",
|
|
37
|
+
enum: ["low", "medium", "high", "urgent"],
|
|
38
|
+
description: "Priority (for create/update/list filter)",
|
|
39
|
+
},
|
|
40
|
+
labels: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Comma-separated labels (for create/update)",
|
|
43
|
+
},
|
|
44
|
+
status: {
|
|
45
|
+
type: "string",
|
|
46
|
+
enum: ["open", "in_progress", "done", "cancelled"],
|
|
47
|
+
description: "Status (for transition/list filter)",
|
|
48
|
+
},
|
|
49
|
+
assignee: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Filter by assignee agent:id or owner:id (for list)",
|
|
52
|
+
},
|
|
53
|
+
label: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Filter by label (for list)",
|
|
56
|
+
},
|
|
57
|
+
limit: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Max results (for list, default 50)",
|
|
60
|
+
},
|
|
61
|
+
to: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Assignee ref agent:id or owner:id (for assign)",
|
|
64
|
+
},
|
|
65
|
+
role: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Role e.g. executor, reviewer (for assign)",
|
|
68
|
+
},
|
|
69
|
+
from: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Participant ref agent:id or owner:id (for unassign)",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ["action"],
|
|
75
|
+
},
|
|
76
|
+
execute: async (_toolCallId, args) => {
|
|
77
|
+
const cfg = getConfig();
|
|
78
|
+
if (!cfg)
|
|
79
|
+
return { error: "No configuration available" };
|
|
80
|
+
const account = resolveOmniVibeAccount({ cfg });
|
|
81
|
+
if (!account.configured)
|
|
82
|
+
return { error: "OmniVibe not configured (missing apiKey)" };
|
|
83
|
+
const client = new ApiClient(account.apiKey, account.baseUrl);
|
|
84
|
+
switch (args.action) {
|
|
85
|
+
case "list":
|
|
86
|
+
if (!args.channel_id)
|
|
87
|
+
return { error: "channel_id required" };
|
|
88
|
+
return client.get(`/v1/channels/${args.channel_id}/tasks`, {
|
|
89
|
+
status: args.status,
|
|
90
|
+
assignee: args.assignee,
|
|
91
|
+
priority: args.priority,
|
|
92
|
+
label: args.label,
|
|
93
|
+
limit: args.limit,
|
|
94
|
+
});
|
|
95
|
+
case "create": {
|
|
96
|
+
if (!args.channel_id || !args.title)
|
|
97
|
+
return { error: "channel_id, title required" };
|
|
98
|
+
const body = {
|
|
99
|
+
title: args.title,
|
|
100
|
+
priority: args.priority || "medium",
|
|
101
|
+
};
|
|
102
|
+
if (args.description)
|
|
103
|
+
body.description = args.description;
|
|
104
|
+
if (args.labels)
|
|
105
|
+
body.labels = args.labels
|
|
106
|
+
.split(",")
|
|
107
|
+
.map((s) => s.trim());
|
|
108
|
+
return client.post(`/v1/channels/${args.channel_id}/tasks`, body);
|
|
109
|
+
}
|
|
110
|
+
case "get":
|
|
111
|
+
if (!args.channel_id || !args.task_id)
|
|
112
|
+
return { error: "channel_id, task_id required" };
|
|
113
|
+
return client.get(`/v1/channels/${args.channel_id}/tasks/${args.task_id}`);
|
|
114
|
+
case "update": {
|
|
115
|
+
if (!args.channel_id || !args.task_id)
|
|
116
|
+
return { error: "channel_id, task_id required" };
|
|
117
|
+
const body = {};
|
|
118
|
+
if (args.title)
|
|
119
|
+
body.title = args.title;
|
|
120
|
+
if (args.description)
|
|
121
|
+
body.description = args.description;
|
|
122
|
+
if (args.priority)
|
|
123
|
+
body.priority = args.priority;
|
|
124
|
+
if (args.labels)
|
|
125
|
+
body.labels = args.labels
|
|
126
|
+
.split(",")
|
|
127
|
+
.map((s) => s.trim());
|
|
128
|
+
return client.put(`/v1/channels/${args.channel_id}/tasks/${args.task_id}`, body);
|
|
129
|
+
}
|
|
130
|
+
case "transition":
|
|
131
|
+
if (!args.channel_id || !args.task_id || !args.status)
|
|
132
|
+
return { error: "channel_id, task_id, status required" };
|
|
133
|
+
return client.post(`/v1/channels/${args.channel_id}/tasks/${args.task_id}/transition`, { status: args.status });
|
|
134
|
+
case "assign":
|
|
135
|
+
if (!args.channel_id || !args.task_id || !args.to || !args.role)
|
|
136
|
+
return {
|
|
137
|
+
error: "channel_id, task_id, to, role required",
|
|
138
|
+
};
|
|
139
|
+
return client.post(`/v1/channels/${args.channel_id}/tasks/${args.task_id}/participants`, { to: args.to, role: args.role });
|
|
140
|
+
case "unassign": {
|
|
141
|
+
if (!args.channel_id || !args.task_id || !args.from)
|
|
142
|
+
return { error: "channel_id, task_id, from required" };
|
|
143
|
+
const [type, id] = args.from.split(":");
|
|
144
|
+
return client.del(`/v1/channels/${args.channel_id}/tasks/${args.task_id}/participants/${type}/${id}`);
|
|
145
|
+
}
|
|
146
|
+
default:
|
|
147
|
+
return { error: `Unknown action: ${args.action}` };
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare function createTransactionsTool(): {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
txn_id: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
provider: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
brief: {
|
|
22
|
+
type: "string";
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
price: {
|
|
26
|
+
type: "string";
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
status: {
|
|
30
|
+
type: "string";
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
role: {
|
|
34
|
+
type: "string";
|
|
35
|
+
enum: string[];
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
result: {
|
|
39
|
+
type: "string";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
rating: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
execute: (_toolCallId: any, args: any) => Promise<unknown>;
|
|
50
|
+
};
|