Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.1 KB
Raw Blame
import * as path from 'node:path';
import { services } from '../services';

const serviceClientDirectories = {
  'agent-harness': 'service-agent-harness',
  auth: 'service-auth',
  calendar: 'service-calendar',
  cognition: 'service-cognition',
  connection: 'service-connection',
  contacts: 'service-contacts',
  email: 'service-email',
  notification: 'service-notification',
  properties: 'service-properties',
  'scheduled-action': 'service-scheduled-action',
  search: 'service-search',
  'static-files': 'service-static-files',
  storage: 'service-storage',
  unfurl: 'service-unfurl',
} satisfies Record<(typeof services)[number], string>;

const serviceClientsDirectory = path.resolve(
  import.meta.dirname,
  '../../../apps/web/src/lib/service-clients',
);
const specsDirectory = path.resolve(import.meta.dirname, '../specs');

for (const service of services) {
  const destination = path.join(specsDirectory, `${service}.json`);
  const source = path.join(
    serviceClientsDirectory,
    serviceClientDirectories[service],
    'openapi.json',
  );
  await Bun.write(destination, Bun.file(source));
  console.log(`Synced ${service}`);
}