import { kody } from 'kody:runtime' export type ListPackagesResult = { packages: Array<{ packageId: string kodyId: string name: string description: string tags: string[] hasApp: boolean hidden: boolean updatedAt: string }> } /** * List saved packages for a Raycast (or other external) command builder. * * Live `@kody/raycast` lists the official kody-scope packages. Fork or install * this listing into the caller's account so HTTP clients see *their* packages. * * @returns Saved package summaries with ids, names, and tags. * * @example * import listPackages from 'kody:@kody/raycast/list-packages' * const { packages } = await listPackages() */ export default async function listPackages(): Promise { const result = await kody.packageList({}) return { packages: result.packages.map(pkg => ({ packageId: pkg.package_id, kodyId: pkg.kody_id, name: pkg.name, description: pkg.description, tags: pkg.tags, hasApp: pkg.has_app, hidden: pkg.hidden, updatedAt: pkg.updated_at, })), } }