Build & Push Frontend Docker Image / build-and-push (push) Canceled after 0s
Build Validation / validate (push) Canceled after 6s
Build & Push Backend Docker Image / build-and-push (push) Failing after 10m10s
Build & Push Gateway Docker Image / build-and-push (push) Failing after 10m9s
A professional workspace for AI coding agents with: - Real-time streaming chat with SSE - Session management (fork, clone, tree navigation) - MCP tools browser & metadata panel - Skills browser (global, project, package sources) - Voice input & STT provider configuration - Integrated terminal & file explorer - Model selector with capability metadata - Keyboard-first UI with command palette - 8 languages (en, pt-BR, es, ja, zh-CN, ar, bn, hi) - Tauri 2 desktop app - React 19 + TypeScript + Vite 8 + Tailwind CSS 4 - Pi Agent extension runtime Originally forked from OpenCodeUI, now an independent project. License: GPL-3.0-only
33 lines
981 B
TypeScript
33 lines
981 B
TypeScript
// ============================================
|
|
// Tool API - Decoupled
|
|
// ============================================
|
|
|
|
import { piClient } from './piClient'
|
|
import type { ToolIDs, ToolList } from '../types/api/tool'
|
|
|
|
/**
|
|
* 获取工具 ID 列表
|
|
*/
|
|
export async function getToolIds(directory?: string): Promise<ToolIDs> {
|
|
try {
|
|
const q = `?directory=${encodeURIComponent(directory || '')}`
|
|
const data = await piClient.get<{ ids: ToolIDs }>(`/api/tools/ids${q}`)
|
|
return data.ids || []
|
|
} catch {
|
|
return []
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取工具列表(带详细信息)
|
|
*/
|
|
export async function getTools(provider: string, model: string, directory?: string): Promise<ToolList> {
|
|
try {
|
|
const q = `?provider=${encodeURIComponent(provider)}&model=${encodeURIComponent(model)}&directory=${encodeURIComponent(directory || '')}`
|
|
const data = await piClient.get<{ tools: ToolList }>(`/api/tools/list${q}`)
|
|
return data.tools || []
|
|
} catch {
|
|
return []
|
|
}
|
|
}
|