Files
clawhub/convex/githubSkillSyncNode.ts
T
Patrick Erichsen 76638de7ad feat: run full ClawScan for GitHub skills
Adds full ClawScan execution for GitHub-backed skills and updates the static audit ignore list for newly reported DOMPurify advisories.
2026-06-15 17:36:41 -07:00

41 lines
1.2 KiB
TypeScript

"use node";
import { v } from "convex/values";
import { internalAction } from "./functions";
import { syncGitHubSkillSourcesHandler, verifyGitHubSkillHandler } from "./githubSkillSync";
import { Events, logErrorEvent } from "./lib/observabilityEvents";
function getErrorMessage(error: unknown) {
if (error instanceof Error) return error.message;
if (typeof error === "string") return error;
if (error && typeof error === "object" && "message" in error) {
const message = (error as { message?: unknown }).message;
if (typeof message === "string") return message;
}
return String(error);
}
export const syncGitHubSkillSourcesInternal = internalAction({
args: {
cursor: v.optional(v.union(v.string(), v.null())),
batchSize: v.optional(v.number()),
},
handler: async (ctx, args) => {
try {
return await syncGitHubSkillSourcesHandler(ctx, args);
} catch (error) {
logErrorEvent(Events.GitHubSkillSourceSyncFailed, { error: getErrorMessage(error) });
throw error;
}
},
});
export const verifyGitHubSkillInternal = internalAction({
args: {
skillId: v.id("skills"),
contentHash: v.string(),
force: v.optional(v.boolean()),
},
handler: verifyGitHubSkillHandler,
});