Skip to content

index.js

15 lines · 1.2 KB · JavaScript
Raw
import { login, refresh } from 'skylight-mcp/dist/auth-session-login.js';
import { SkylightClient } from 'skylight-mcp/dist/client.js';
import { createOperations } from './operations.js';
const account = {mode:'session',name:'Skylight',baseUrl:'https://app.ourskylight.com/api',authBaseUrl:'https://app.ourskylight.com',email:'{{secret:skylightEmail}}',password:'{{secret:skylightPassword}}'};
const client = new SkylightClient({account,tokens:()=>login({authBaseUrl:account.authBaseUrl,email:account.email,password:account.password}),refreshFn:refreshToken=>refresh({authBaseUrl:account.authBaseUrl,refreshToken}),persistence:null});
const dispatch = createOperations(client, account);
/**
 * Read and manage Skylight through Kody, including events, profiles, chores, routines, lists, meals, rewards, photos and settings.
 * @param input - operation and args; writes preview by default, then require confirm:true and the matching previewToken. tools returns schemas.
 * @returns Read results, a no-network write preview, or the result of an explicitly confirmed write.
 * @example
 * import skylight from 'kody:@tannerlinsley/skylight';
 * await skylight({operation:'tools',mode:'write'});
 */
export default async function skylight(input={}) { return dispatch(input); }