mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-02 10:44:52 +01:00
Initialize the operational skill for legacy continuation fixtures, verify task attachment bytes, allow Claude’s optional custom-answer field, and distinguish unstarted dependency-blocked wakes from failed provider executions. Co-Authored-By: Paperclip <noreply@paperclip.ing>
11 lines
704 B
TypeScript
11 lines
704 B
TypeScript
import type { RunnerApi } from "./api.js";
|
|
|
|
/** Bare company creation does not populate its skill library. Match the
|
|
* production onboarding setup before evaluating legacy API instructions. */
|
|
export async function prepareLegacyContinuationSkill(api: RunnerApi, companyId: string, agentId: string) {
|
|
const key = "paperclipai/paperclip/paperclip";
|
|
const skills = await api.get<Array<{ key: string }>>(`/api/companies/${companyId}/skills`);
|
|
if (!skills.some(skill => skill.key === key)) throw new Error("Continuation fixture is missing the bundled Paperclip operational skill");
|
|
await api.post(`/api/agents/${agentId}/skills/sync?companyId=${companyId}`, { desiredSkills: [key], mode: "add" });
|
|
}
|