mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-09 18:29:39 +00:00
feat: new integration
This commit is contained in:
@@ -14,7 +14,7 @@ const printError = (msg: string) => UI.error(msg)
|
||||
const success = (msg: string) => UI.println(UI.Style.TEXT_SUCCESS_BOLD + msg + UI.Style.TEXT_NORMAL)
|
||||
const info = (msg: string) => UI.println(UI.Style.TEXT_NORMAL + msg)
|
||||
|
||||
type ToolType = "mcp_server" | "agent_skill" | "database_script" | "api_function"
|
||||
type ToolType = "mcp_server" | "agent_skill" | "database_script" | "api_function" | "coder_agent" | "prompt"
|
||||
|
||||
interface SyncedTool {
|
||||
id: string
|
||||
@@ -28,11 +28,27 @@ interface SyncedTool {
|
||||
url?: string
|
||||
tools: string[]
|
||||
auth_via: string
|
||||
interpolation_string?: string
|
||||
goals?: string
|
||||
temperature?: number
|
||||
max_tokens?: number
|
||||
llm_base_model?: string
|
||||
llm_provider?: string
|
||||
}
|
||||
|
||||
interface SyncedPrompt {
|
||||
id: string
|
||||
label: string
|
||||
interpolation_string: string
|
||||
prompt_type?: string
|
||||
available_to_agents?: string[]
|
||||
description?: string
|
||||
}
|
||||
|
||||
interface ToolSyncResult {
|
||||
success: boolean
|
||||
tools: SyncedTool[]
|
||||
prompts: SyncedPrompt[]
|
||||
by_type: Record<string, number>
|
||||
error?: string
|
||||
}
|
||||
@@ -101,12 +117,30 @@ try:
|
||||
"request_type": tool.request_type.value if tool.request_type else None,
|
||||
"url": tool.url,
|
||||
"tools": tool.tools,
|
||||
"auth_via": tool.auth_via
|
||||
"auth_via": tool.auth_via,
|
||||
"interpolation_string": tool.interpolation_string,
|
||||
"goals": tool.goals,
|
||||
"temperature": tool.temperature,
|
||||
"max_tokens": tool.max_tokens,
|
||||
"llm_base_model": tool.llm_base_model,
|
||||
"llm_provider": tool.llm_provider
|
||||
})
|
||||
|
||||
prompts_data = []
|
||||
for prompt in result.prompts:
|
||||
prompts_data.append({
|
||||
"id": prompt.id,
|
||||
"label": prompt.label,
|
||||
"interpolation_string": prompt.interpolation_string,
|
||||
"prompt_type": prompt.prompt_type,
|
||||
"available_to_agents": prompt.available_to_agents,
|
||||
"description": prompt.description
|
||||
})
|
||||
|
||||
print(json.dumps({
|
||||
"success": result.success,
|
||||
"tools": tools_data,
|
||||
"prompts": prompts_data,
|
||||
"by_type": result.by_type,
|
||||
"error": result.error
|
||||
}))
|
||||
@@ -138,7 +172,13 @@ try:
|
||||
"request_type": tool.request_type.value if tool.request_type else None,
|
||||
"url": tool.url,
|
||||
"tools": tool.tools,
|
||||
"auth_via": tool.auth_via
|
||||
"auth_via": tool.auth_via,
|
||||
"interpolation_string": tool.interpolation_string,
|
||||
"goals": tool.goals,
|
||||
"temperature": tool.temperature,
|
||||
"max_tokens": tool.max_tokens,
|
||||
"llm_base_model": tool.llm_base_model,
|
||||
"llm_provider": tool.llm_provider
|
||||
})
|
||||
|
||||
print(json.dumps({
|
||||
@@ -353,6 +393,8 @@ const ToolsListCommand = cmd({
|
||||
agent_skill: "Skill",
|
||||
database_script: "DB",
|
||||
api_function: "API",
|
||||
coder_agent: "Coder Agent",
|
||||
prompt: "Prompt",
|
||||
}[tool.tool_type]
|
||||
|
||||
info(` ${tool.name}`)
|
||||
|
||||
Reference in New Issue
Block a user