UNPKG

@blundergoat/goat-flow

Version:

AI coding agent harness and local dashboard for Claude Code, OpenAI Codex, Google Antigravity, and GitHub Copilot - setup audits, guardrails, structured skills, deny hooks, and persistent learning loops.

74 lines 3.35 kB
/** * Scoring path for content uploaded or pasted through the dashboard "Evaluate skill" flow, where * the artifact has no trusted on-disk location. Scores the supplied markdown with disk scanning * disabled, then turns the metric breakdown into actionable improvement tips for the modal. * * The no-disk rule is a safety boundary, not an optimisation: a user-supplied name must never cause * sibling files of an installed skill to be composed into the score, so host composition is stripped * and `scanDisk: false` is passed throughout. Artifact kind is inferred from content when the caller * does not specify it, and the upload name is sanitised before use as an id. */ import { type ArtifactKind, type MetricName, type QualityConfig } from "./quality-config.js"; import type { MetricSeverity, SkillQualityReport } from "./skill-quality-types.js"; /** * Uploaded single-file artifact payload; scoring must not read sibling files from disk. */ interface EvaluateInput { /** Raw markdown content (uploaded file or pasted text). */ content: string; /** Optional name; falls back to a generic placeholder. */ suggestedName?: string | undefined; /** Optional explicit kind; otherwise inferred from frontmatter. */ kind?: ArtifactKind | undefined; } /** * Dashboard-facing remediation generated from one metric detail string. */ interface ImprovementTip { metric: MetricName; severity: MetricSeverity; message: string; } /** * Skill-quality report plus actionable dashboard tips for uploaded content. */ interface EvaluateResult extends SkillQualityReport { tips: ImprovementTip[]; } /** * Score uploaded markdown content (no file IO) and synthesise actionable * improvement tips from the metric breakdown. Used by the dashboard * "Evaluate skill" modal. * * @param projectRoot - Project whose quality config supplies rubric settings. * @param input - Uploaded markdown and optional naming/classification hints. * @param config - Optional scoring config; host composition is stripped before scoring. */ export declare function evaluateContent(projectRoot: string, input: EvaluateInput, config?: QualityConfig): EvaluateResult; /** * One uploaded bundle file after dashboard request decoding has validated size and name. */ interface EvaluateBundleFile { name: string; content: string; } /** * Multi-file upload payload where only user-provided files contribute to composition. */ interface EvaluateBundleInput { files: EvaluateBundleFile[]; suggestedName?: string | undefined; kind?: ArtifactKind | undefined; } /** * Score a multi-file uploaded skill bundle (no file IO). Picks a primary file * - `SKILL.md` if any of the dropped files is named that, otherwise `files[0]` * - and treats the remaining files as sibling `.md` files appended to the * composed surface. The same composition recipe applies as for on-disk skills: * preamble + conventions are still pulled in if available, and the bundle * surface contributes to gate/evidence/tool-deps scoring. `composedFrom` lists * every input file in drop order, plus preamble/conventions when composed in. */ export declare function evaluateUploadedBundle(projectRoot: string, input: EvaluateBundleInput, config?: QualityConfig): EvaluateResult; export {}; //# sourceMappingURL=skill-quality-upload.d.ts.map