import Kink from '@termsurf/kink';
const host = '@termsurf/task';
Kink.code(host, (code) => code.toString(16).padStart(4, '0'));
Kink.base(host, 'abort_error', (take) => ({
    code: 1,
    note: 'Request timeout',
    link: take.link,
}));
Kink.base(host, 'command_missing', (take) => ({
    code: 2,
    note: `Command does not exist on OS.`,
    link: {
        name: take.name,
    },
}));
Kink.base(host, 'call_fail', () => ({
    code: 3,
    note: 'System unable to make request currently',
}));
Kink.base(host, 'form_fail', (take) => ({
    code: 4,
    note: 'Invalid link type',
    need: take.need,
    have: take.have,
    link: take.link,
    hint: take.message,
}));
// https://github.com/colinhacks/zod/blob/master/ERROR_HANDLING.md
Kink.base(host, 'unrecognized_keys', (take) => ({
    code: 4,
    note: 'Unrecognized keys in object',
    list: take.list,
    link: take.link,
    hint: take.message,
}));
Kink.base(host, 'file_missing_error', (take) => ({
    code: 4,
    note: `Task tool couldn't find file.`,
    link: { path: take.path },
}));
Kink.base(host, 'font_forge_error', (take) => ({
    code: 5,
    note: `Font forge error. ${take.note}`,
}));
Kink.base(host, 'io_match', (take) => ({
    code: 6,
    note: `Input and output formats are the same, must be different instead.`,
    link: { format: take.format },
}));
Kink.base(host, 'task_not_implemented', (take) => ({
    code: 6,
    note: `Task is not implemented yet.`,
    link: { task: take.task, link: take.link },
}));
export default function kink(form, link) {
    return Kink.make(host, form, link);
}
//# sourceMappingURL=kink.js.map