import { buildAsanaMetadata, buildAsanaSpawnContextMessage, buildAsanaTicketDescription, getAsanaTaskByGid, } from '../external-issues/asana.js';
import { buildJiraMetadata, buildJiraSpawnContextMessage, buildJiraTicketDescription, getJiraIssueByKey, } from '../external-issues/jira.js';
import { buildLinearMetadata, buildLinearSpawnContextMessage, buildLinearTicketDescription, getLinearIssueByIdentifier, } from '../external-issues/linear.js';
import { buildShortcutMetadata, buildShortcutSpawnContextMessage, buildShortcutTicketDescription, getShortcutStoryByKey, } from '../external-issues/shortcut.js';
import { buildTrelloMetadata, buildTrelloSpawnContextMessage, buildTrelloTicketDescription, getTrelloCardById, } from '../external-issues/trello.js';
class LinearWorkSourceClient {
    provider = 'linear';
    async fetchByKey(key) {
        return getLinearIssueByIdentifier({}, key);
    }
    buildTicketDescription(envelope) {
        return buildLinearTicketDescription(envelope);
    }
    buildMetadata(envelope) {
        return buildLinearMetadata(envelope);
    }
    buildSpawnContextMessage(envelope, additionalMessage) {
        return buildLinearSpawnContextMessage(envelope, additionalMessage);
    }
}
class JiraWorkSourceClient {
    provider = 'jira';
    async fetchByKey(key) {
        return getJiraIssueByKey({}, key);
    }
    buildTicketDescription(envelope) {
        return buildJiraTicketDescription(envelope);
    }
    buildMetadata(envelope) {
        return buildJiraMetadata(envelope);
    }
    buildSpawnContextMessage(envelope, additionalMessage) {
        return buildJiraSpawnContextMessage(envelope, additionalMessage);
    }
}
class AsanaWorkSourceClient {
    provider = 'asana';
    async fetchByKey(key) {
        return getAsanaTaskByGid({}, key);
    }
    buildTicketDescription(envelope) {
        return buildAsanaTicketDescription(envelope);
    }
    buildMetadata(envelope) {
        return buildAsanaMetadata(envelope);
    }
    buildSpawnContextMessage(envelope, additionalMessage) {
        return buildAsanaSpawnContextMessage(envelope, additionalMessage);
    }
}
class ShortcutWorkSourceClient {
    provider = 'shortcut';
    async fetchByKey(key) {
        return getShortcutStoryByKey({}, key);
    }
    buildTicketDescription(envelope) {
        return buildShortcutTicketDescription(envelope);
    }
    buildMetadata(envelope) {
        return buildShortcutMetadata(envelope);
    }
    buildSpawnContextMessage(envelope, additionalMessage) {
        return buildShortcutSpawnContextMessage(envelope, additionalMessage);
    }
}
class TrelloWorkSourceClient {
    provider = 'trello';
    async fetchByKey(key) {
        return getTrelloCardById({}, key);
    }
    buildTicketDescription(envelope) {
        return buildTrelloTicketDescription(envelope);
    }
    buildMetadata(envelope) {
        return buildTrelloMetadata(envelope);
    }
    buildSpawnContextMessage(envelope, additionalMessage) {
        return buildTrelloSpawnContextMessage(envelope, additionalMessage);
    }
}
const SOURCE_CLIENTS = {
    linear: new LinearWorkSourceClient(),
    jira: new JiraWorkSourceClient(),
    asana: new AsanaWorkSourceClient(),
    shortcut: new ShortcutWorkSourceClient(),
    trello: new TrelloWorkSourceClient(),
};
export function getWorkSourceClient(provider) {
    return SOURCE_CLIENTS[provider] ?? null;
}
//# sourceMappingURL=client.js.map