11import asyncio
2- import json
32import logging
4- from typing import List
53
64from flexus_client_kit import ckit_client , ckit_bot_install , ckit_cloudtool , ckit_integrations_db , ckit_skills
75from flexus_simple_bots import prompts_common
86from flexus_simple_bots .integration_tester import integration_tester_bot
97from flexus_simple_bots .integration_tester import integration_tester_prompts
108
11- logger = logging .getLogger ("integration_tester" )
12-
13- INTEGRATION_TESTER_SKILLS = ckit_skills .static_skills_find (integration_tester_bot .INTEGRATION_TESTER_ROOTDIR , shared_skills_allowlist = "" , integration_skills_allowlist = "" )
14-
15-
16- def _build_experts (tools ):
17- builtin_skills = ckit_skills .read_name_description (integration_tester_bot .INTEGRATION_TESTER_ROOTDIR , INTEGRATION_TESTER_SKILLS )
18- tool_names = {t .name for rec in integration_tester_bot .INTEGRATION_TESTER_INTEGRATIONS for t in rec .integr_tools }
19- tool_names .add (integration_tester_bot .PLAN_BATCHES_TOOL .name )
20- allow_tools = "," .join (tool_names | ckit_cloudtool .KANBAN_ADVANCED | {"flexus_hand_over_task" })
21-
22- return [
23- ("default" , ckit_bot_install .FMarketplaceExpertInput (
24- fexp_system_prompt = integration_tester_prompts .DEFAULT_PROMPT ,
25- fexp_python_kernel = "" ,
26- fexp_allow_tools = allow_tools ,
27- fexp_nature = "NATURE_INTERACTIVE" ,
28- fexp_builtin_skills = builtin_skills ,
29- fexp_description = "Test API key integrations" ,
30- )),
31- ("autonomous" , ckit_bot_install .FMarketplaceExpertInput (
32- fexp_system_prompt = integration_tester_prompts .AUTONOMOUS_PROMPT ,
33- fexp_python_kernel = "" ,
34- fexp_allow_tools = allow_tools ,
35- fexp_nature = "NATURE_AUTONOMOUS" ,
36- fexp_inactivity_timeout = 600 ,
37- fexp_builtin_skills = builtin_skills ,
38- fexp_description = "Autonomous integration testing" ,
39- )),
40- ]
41-
9+ logger = logging .getLogger ("bot_integration_tester" )
10+
11+ TOOL_NAMESET = {t .name for t in integration_tester_bot .TOOLS }
12+
13+ EXPERTS = [
14+ ("default" , ckit_bot_install .FMarketplaceExpertInput (
15+ fexp_system_prompt = integration_tester_prompts .DEFAULT_PROMPT ,
16+ fexp_python_kernel = "" ,
17+ fexp_allow_tools = "," .join (TOOL_NAMESET | ckit_cloudtool .KANBAN_ADVANCED | {"flexus_hand_over_task" }),
18+ fexp_nature = "NATURE_INTERACTIVE" ,
19+ fexp_builtin_skills = ckit_skills .read_name_description (integration_tester_bot .INTEGRATION_TESTER_ROOTDIR , integration_tester_bot .INTEGRATION_TESTER_SKILLS ),
20+ fexp_description = "Test API key integrations" ,
21+ )),
22+ ("autonomous" , ckit_bot_install .FMarketplaceExpertInput (
23+ fexp_system_prompt = integration_tester_prompts .AUTONOMOUS_PROMPT ,
24+ fexp_python_kernel = "" ,
25+ fexp_allow_tools = "," .join (TOOL_NAMESET | ckit_cloudtool .KANBAN_ADVANCED | {"flexus_hand_over_task" }),
26+ fexp_nature = "NATURE_AUTONOMOUS" ,
27+ fexp_inactivity_timeout = 600 ,
28+ fexp_builtin_skills = ckit_skills .read_name_description (integration_tester_bot .INTEGRATION_TESTER_ROOTDIR , integration_tester_bot .INTEGRATION_TESTER_SKILLS ),
29+ fexp_description = "Autonomous integration testing" ,
30+ )),
31+ ]
4232
4333INTEGRATION_TESTER_DESC = """
4434**Job description**
@@ -77,19 +67,9 @@ def _ensure_marketplace_images() -> None:
7767 pic_small_path .write_bytes (fallback_small_path .read_bytes ())
7868
7969
80- async def install (
81- client : ckit_client .FlexusClient ,
82- bot_name : str ,
83- bot_version : str ,
84- tools : List [ckit_cloudtool .CloudTool ],
85- ):
86- setup_schema_path = integration_tester_bot .INTEGRATION_TESTER_ROOTDIR / "setup_schema.json"
87- integration_tester_setup_default = json .loads (setup_schema_path .read_text ())
88-
70+ async def install (client : ckit_client .FlexusClient ):
8971 _ensure_marketplace_images ()
9072
91- experts = _build_experts (tools )
92-
9373 await ckit_bot_install .marketplace_upsert_dev_bot (
9474 client ,
9575 ws_id = client .ws_id ,
@@ -109,7 +89,7 @@ async def install(
10989 },
11090 prompts_common .SCHED_TODO_5M | {"sched_when" : "EVERY:1m" , "sched_fexp_name" : "autonomous" },
11191 ],
112- marketable_setup_default = integration_tester_setup_default ,
92+ marketable_setup_default = integration_tester_bot . INTEGRATION_TESTER_SETUP_SCHEMA ,
11393 marketable_featured_actions = [
11494 {"feat_question" : "Test all integrations" , "feat_expert" : "default" },
11595 {"feat_question" : "Test gmail" , "feat_expert" : "default" },
@@ -120,11 +100,13 @@ async def install(
120100 {"feat_question" : "Test airtable" , "feat_expert" : "default" },
121101 {"feat_question" : "Test hubspot" , "feat_expert" : "default" },
122102 {"feat_question" : "Test twilio" , "feat_expert" : "default" },
103+ {"feat_question" : "Test resend" , "feat_expert" : "default" },
104+ {"feat_question" : "Test newsapi" , "feat_expert" : "default" },
123105 ],
124106 marketable_intro_message = "Hi! I'm Integration Tester. I create deterministic kanban batch tasks and resolve them autonomously." ,
125107 marketable_preferred_model_expensive = "gpt-5.4-mini" ,
126108 marketable_preferred_model_cheap = "gpt-5.4-mini" ,
127- marketable_experts = [(name , exp .filter_tools (tools )) for name , exp in experts ],
109+ marketable_experts = [(name , exp .filter_tools (integration_tester_bot . TOOLS )) for name , exp in EXPERTS ],
128110 add_integrations_into_expert_system_prompt = integration_tester_bot .INTEGRATION_TESTER_INTEGRATIONS ,
129111 marketable_tags = ["testing" , "integrations" , "qa" ],
130112 marketable_forms = ckit_bot_install .load_form_bundles (__file__ ),
@@ -140,6 +122,8 @@ async def install(
140122 "slack" ,
141123 "telegram" ,
142124 "twilio_manual" ,
125+ "resend" ,
126+ "newsapi" ,
143127 ],
144128 marketable_auth_scopes = {
145129 "gmail" : ckit_integrations_db .GOOGLE_OAUTH_BASE_SCOPES + [
@@ -171,8 +155,5 @@ async def install(
171155
172156
173157if __name__ == "__main__" :
174- from dotenv import load_dotenv
175- load_dotenv ()
176-
177158 client = ckit_client .FlexusClient ("integration_tester_install" )
178- asyncio .run (install (client , bot_name = "integration_tester" , bot_version = "dev" , tools = integration_tester_bot . TOOLS ))
159+ asyncio .run (install (client ))
0 commit comments