asterscanner 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,531 @@
1
+ /**
2
+ * Skill Schema Types
3
+ *
4
+ * This schema aligns with the official Agent Skills specification.
5
+ * See: https://agentskills.io/specification
6
+ *
7
+ * Key principles:
8
+ * - Skills are DIRECTORIES, not single files
9
+ * - Only `name` and `description` are required per spec
10
+ * - Optional fields: license, compatibility, metadata, allowed-tools
11
+ * - Skills can include executable scripts
12
+ * - Progressive disclosure: content loads in stages
13
+ */
14
+ // Regex that enforces: lowercase alphanumeric, single hyphens only, no leading/trailing hyphens
15
+ const NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;
16
+ /**
17
+ * Validate name according to official Agent Skills specification
18
+ * @param name - The skill name to validate
19
+ * @param directoryName - Optional parent directory name to check against
20
+ */
21
+ export function validateAnthropicName(name, directoryName) {
22
+ if (!name) {
23
+ return { valid: false, error: "Name is required" };
24
+ }
25
+ if (name.length > 64) {
26
+ return { valid: false, error: "Name must be 64 characters or less" };
27
+ }
28
+ if (!NAME_REGEX.test(name)) {
29
+ return {
30
+ valid: false,
31
+ error: "Name must be lowercase alphanumeric with single hyphens (no leading/trailing/consecutive hyphens)",
32
+ };
33
+ }
34
+ // ask-specific: block reserved words
35
+ // These are reserved to prevent impersonation of official entities
36
+ const RESERVED_WORDS = [
37
+ // AI companies (prevent impersonation)
38
+ "anthropic",
39
+ "claude",
40
+ "openai",
41
+ "chatgpt",
42
+ "google",
43
+ "gemini",
44
+ "microsoft",
45
+ "copilot",
46
+ "github",
47
+ "vercel",
48
+ "aws",
49
+ "amazon",
50
+ // Platform reserved words
51
+ "admin",
52
+ "system",
53
+ "official",
54
+ "verified",
55
+ "askskills",
56
+ "agentskills",
57
+ // Security-sensitive
58
+ "root",
59
+ "sudo",
60
+ "shell",
61
+ ];
62
+ for (const reserved of RESERVED_WORDS) {
63
+ if (name.includes(reserved)) {
64
+ return {
65
+ valid: false,
66
+ error: `Name cannot contain "${reserved}" - this word is reserved to prevent impersonation (ask registry rule)`,
67
+ };
68
+ }
69
+ }
70
+ // ask-specific: block XML tags
71
+ if (/<[^>]+>/.test(name)) {
72
+ return { valid: false, error: "Name cannot contain XML tags (ask registry rule)" };
73
+ }
74
+ // Validate directory name match if provided
75
+ if (directoryName && name !== directoryName) {
76
+ return {
77
+ valid: false,
78
+ error: `Name "${name}" must match parent directory name "${directoryName}"`,
79
+ };
80
+ }
81
+ return { valid: true };
82
+ }
83
+ /**
84
+ * Validate compatibility field per spec (max 500 chars)
85
+ */
86
+ export function validateCompatibility(compatibility) {
87
+ if (compatibility && compatibility.length > 500) {
88
+ return { valid: false, error: "Compatibility must be 500 characters or less" };
89
+ }
90
+ return { valid: true };
91
+ }
92
+ /**
93
+ * Validate description according to Anthropic's constraints
94
+ */
95
+ export function validateAnthropicDescription(description) {
96
+ if (!description || description.trim().length === 0) {
97
+ return { valid: false, error: "Description is required and must be non-empty" };
98
+ }
99
+ if (description.length > 1024) {
100
+ return { valid: false, error: "Description must be 1024 characters or less" };
101
+ }
102
+ if (/<[^>]+>/.test(description)) {
103
+ return { valid: false, error: "Description cannot contain XML tags" };
104
+ }
105
+ return { valid: true };
106
+ }
107
+ /**
108
+ * Validate a skill manifest
109
+ *
110
+ * Per Anthropic spec, only `name` and `description` are required.
111
+ * All other fields are ask extensions and are optional.
112
+ */
113
+ export function validateManifest(manifest) {
114
+ const errors = [];
115
+ const warnings = [];
116
+ let anthropicCompatible = true;
117
+ // Anthropic required fields
118
+ const nameValidation = validateAnthropicName(manifest.name || "");
119
+ if (!nameValidation.valid) {
120
+ errors.push(nameValidation.error);
121
+ anthropicCompatible = false;
122
+ }
123
+ const descValidation = validateAnthropicDescription(manifest.description || "");
124
+ if (!descValidation.valid) {
125
+ errors.push(descValidation.error);
126
+ anthropicCompatible = false;
127
+ }
128
+ // Check for ask extensions
129
+ const hasAskExtensions = !!(manifest.version ||
130
+ manifest.author ||
131
+ manifest.keywords?.length ||
132
+ manifest.categories?.length ||
133
+ manifest.contract ||
134
+ manifest.capabilities?.length ||
135
+ manifest.tests ||
136
+ manifest.execution ||
137
+ manifest.pricing);
138
+ // Warnings for missing recommended fields (not errors!)
139
+ if (!manifest.version) {
140
+ warnings.push("Consider adding 'version' for better skill management (ask extension)");
141
+ }
142
+ if (manifest.description && manifest.description.length < 50) {
143
+ warnings.push("Description is short. Consider describing both WHAT the skill does and WHEN to use it.");
144
+ }
145
+ // Contract validation (optional but if present, should be valid)
146
+ if (manifest.contract) {
147
+ if (manifest.contract.inputs) {
148
+ for (const input of manifest.contract.inputs) {
149
+ if (!input.name)
150
+ errors.push("Contract input missing name");
151
+ if (!input.type)
152
+ errors.push(`Contract input ${input.name} missing type`);
153
+ if (!input.description)
154
+ warnings.push(`Contract input ${input.name} missing description`);
155
+ }
156
+ }
157
+ if (manifest.contract.outputs) {
158
+ for (const output of manifest.contract.outputs) {
159
+ if (!output.name)
160
+ errors.push("Contract output missing name");
161
+ if (!output.type)
162
+ errors.push(`Contract output ${output.name} missing type`);
163
+ }
164
+ }
165
+ }
166
+ // Capability validation (optional)
167
+ if (manifest.capabilities) {
168
+ const validCapabilities = new Set([
169
+ "file:read",
170
+ "file:write",
171
+ "file:delete",
172
+ "file:execute",
173
+ "network:http",
174
+ "network:https",
175
+ "network:websocket",
176
+ "shell:execute",
177
+ "shell:background",
178
+ "process:spawn",
179
+ "database:read",
180
+ "database:write",
181
+ "secrets:read",
182
+ "env:read",
183
+ "api:external",
184
+ "oauth:required",
185
+ "ui:browser",
186
+ "ui:terminal",
187
+ "gpu:required",
188
+ "elevated:required",
189
+ ]);
190
+ for (const cap of manifest.capabilities) {
191
+ if (!validCapabilities.has(cap.capability)) {
192
+ errors.push(`Unknown capability: ${cap.capability}`);
193
+ }
194
+ if (!cap.reason) {
195
+ warnings.push(`Capability ${cap.capability} missing reason`);
196
+ }
197
+ }
198
+ }
199
+ // Test validation (optional)
200
+ if (manifest.tests?.tests) {
201
+ for (const test of manifest.tests.tests) {
202
+ if (!test.name)
203
+ errors.push("Test case missing name");
204
+ if (!test.input)
205
+ errors.push(`Test ${test.name} missing input`);
206
+ if (!test.expect)
207
+ errors.push(`Test ${test.name} missing expect`);
208
+ }
209
+ }
210
+ // Version format validation (optional field, but if present should be valid)
211
+ if (manifest.version && !/^\d+\.\d+\.\d+(-[\w.]+)?$/.test(manifest.version)) {
212
+ warnings.push("Invalid version format. Recommend using semver (e.g., 1.0.0)");
213
+ }
214
+ // Execution validation (ask protected-capability extension; omit => local).
215
+ if (manifest.execution) {
216
+ const { mode, runtime, handler, endpoint, transport } = manifest.execution;
217
+ if (mode !== "local" && mode !== "remote") {
218
+ errors.push(`Invalid execution.mode '${mode}' (expected 'local' or 'remote')`);
219
+ }
220
+ if (mode === "remote") {
221
+ if (runtime !== "hosted-function" && runtime !== "endpoint") {
222
+ errors.push("Remote execution requires runtime 'hosted-function' or 'endpoint'");
223
+ }
224
+ if (runtime === "hosted-function" && !handler) {
225
+ errors.push("Remote hosted-function execution requires a 'handler'");
226
+ }
227
+ if (runtime === "endpoint" && !endpoint) {
228
+ errors.push("Remote endpoint execution requires an 'endpoint' URL");
229
+ }
230
+ if (transport !== "mcp" && transport !== "cli") {
231
+ errors.push("Remote execution requires transport 'mcp' or 'cli'");
232
+ }
233
+ }
234
+ }
235
+ // Pricing validation (omit => free).
236
+ if (manifest.pricing) {
237
+ const { model, priceUsd } = manifest.pricing;
238
+ if (model !== "free" && model !== "paid") {
239
+ errors.push(`Invalid pricing.model '${model}' (expected 'free' or 'paid')`);
240
+ }
241
+ if (model === "paid" && !(typeof priceUsd === "number" && priceUsd > 0)) {
242
+ errors.push("Paid pricing requires a positive 'priceUsd' (cents)");
243
+ }
244
+ // Paid + remote is the defensible quadrant; paid + local is license/honor-
245
+ // enforced only (leaky) — allowed, but warn.
246
+ if (model === "paid" && (!manifest.execution || manifest.execution.mode === "local")) {
247
+ warnings.push("Paid local skills are license/honor-enforced only (the leaky quadrant). Use remote execution for strong source protection.");
248
+ }
249
+ }
250
+ return {
251
+ valid: errors.length === 0,
252
+ errors,
253
+ warnings,
254
+ anthropicCompatible,
255
+ hasAskExtensions,
256
+ };
257
+ }
258
+ /**
259
+ * Validate only the Anthropic-required fields
260
+ * Use this for quick validation when importing external skills
261
+ */
262
+ export function validateAnthropicCompatibility(name, description) {
263
+ const errors = [];
264
+ const nameResult = validateAnthropicName(name);
265
+ if (!nameResult.valid)
266
+ errors.push(nameResult.error);
267
+ const descResult = validateAnthropicDescription(description);
268
+ if (!descResult.valid)
269
+ errors.push(descResult.error);
270
+ return { valid: errors.length === 0, errors };
271
+ }
272
+ // ============================================================================
273
+ // PARSING
274
+ // ============================================================================
275
+ /**
276
+ * Parse SKILL.md frontmatter into manifest
277
+ */
278
+ export function parseSkillFrontmatter(content) {
279
+ const errors = [];
280
+ let manifest = {};
281
+ let body = content;
282
+ // Check for YAML frontmatter
283
+ const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
284
+ if (frontmatterMatch) {
285
+ const [, yaml, rest] = frontmatterMatch;
286
+ body = rest;
287
+ try {
288
+ // Simple YAML parsing (for production, use a proper YAML parser)
289
+ const lines = yaml.split("\n");
290
+ const stack = [
291
+ { obj: manifest, indent: -1 },
292
+ ];
293
+ for (const line of lines) {
294
+ if (!line.trim() || line.trim().startsWith("#"))
295
+ continue;
296
+ const match = line.match(/^(\s*)(\w+):\s*(.*)$/);
297
+ if (match) {
298
+ const [, indent, key, value] = match;
299
+ const indentLevel = indent.length;
300
+ // Pop stack to correct level
301
+ while (stack.length > 1 && stack[stack.length - 1].indent >= indentLevel) {
302
+ stack.pop();
303
+ }
304
+ const current = stack[stack.length - 1].obj;
305
+ if (value) {
306
+ // Simple value
307
+ current[key] = value.replace(/^["']|["']$/g, "");
308
+ }
309
+ else {
310
+ // Nested object or array
311
+ current[key] = {};
312
+ stack.push({ obj: current[key], indent: indentLevel });
313
+ }
314
+ }
315
+ }
316
+ }
317
+ catch (e) {
318
+ errors.push(`Failed to parse frontmatter: ${e}`);
319
+ }
320
+ }
321
+ else {
322
+ errors.push("SKILL.md must have YAML frontmatter (---\\n...\\n---)");
323
+ }
324
+ return { manifest, body, errors };
325
+ }
326
+ /**
327
+ * Parse a skill directory into a SkillDirectory structure
328
+ */
329
+ export function parseSkillDirectory(files) {
330
+ const errors = [];
331
+ // Find SKILL.md
332
+ const skillMdFile = files.find((f) => f.path === "SKILL.md" || f.path.endsWith("/SKILL.md"));
333
+ if (!skillMdFile) {
334
+ return { skill: null, errors: ["Missing required SKILL.md file"] };
335
+ }
336
+ // Parse SKILL.md
337
+ const { manifest, body, errors: parseErrors } = parseSkillFrontmatter(skillMdFile.content);
338
+ errors.push(...parseErrors);
339
+ // Validate required fields
340
+ if (!manifest.name || !manifest.description) {
341
+ errors.push("SKILL.md must have 'name' and 'description' in frontmatter");
342
+ return { skill: null, errors };
343
+ }
344
+ // Find skill.json (ask extensions)
345
+ const skillJsonFile = files.find((f) => f.path === "skill.json" || f.path.endsWith("/skill.json"));
346
+ let skillJson;
347
+ if (skillJsonFile) {
348
+ try {
349
+ skillJson = JSON.parse(skillJsonFile.content);
350
+ }
351
+ catch (e) {
352
+ errors.push(`Failed to parse skill.json: ${e}`);
353
+ }
354
+ }
355
+ // Categorize files per agentskills.io directory structure:
356
+ // - scripts/ -> executable code
357
+ // - references/ -> additional documentation
358
+ // - assets/ -> static resources
359
+ const skillFiles = [];
360
+ const scripts = [];
361
+ const references = [];
362
+ const assets = [];
363
+ for (const file of files) {
364
+ if (file.path === "SKILL.md" || file.path === "skill.json")
365
+ continue;
366
+ const skillFile = {
367
+ path: file.path,
368
+ content: file.content,
369
+ type: "resource",
370
+ };
371
+ // scripts/ directory - executable code
372
+ if (file.path.startsWith("scripts/") || file.path.includes("/scripts/")) {
373
+ skillFile.type = "script";
374
+ skillFile.executable =
375
+ file.path.endsWith(".py") ||
376
+ file.path.endsWith(".sh") ||
377
+ file.path.endsWith(".js") ||
378
+ file.path.endsWith(".ts");
379
+ scripts.push(skillFile);
380
+ }
381
+ // references/ directory - additional documentation (per spec)
382
+ else if (file.path.startsWith("references/") || file.path.includes("/references/")) {
383
+ skillFile.type = "markdown";
384
+ references.push(skillFile);
385
+ }
386
+ // assets/ directory - static resources (per spec)
387
+ else if (file.path.startsWith("assets/") || file.path.includes("/assets/")) {
388
+ skillFile.type = "resource";
389
+ assets.push(skillFile);
390
+ }
391
+ // Markdown files not in specific directories
392
+ else if (file.path.endsWith(".md")) {
393
+ skillFile.type = "markdown";
394
+ references.push(skillFile);
395
+ }
396
+ // Config files
397
+ else if (file.path.endsWith(".json") ||
398
+ file.path.endsWith(".yaml") ||
399
+ file.path.endsWith(".yml")) {
400
+ skillFile.type = "config";
401
+ assets.push(skillFile);
402
+ }
403
+ // Everything else is an asset
404
+ else {
405
+ assets.push(skillFile);
406
+ }
407
+ skillFiles.push(skillFile);
408
+ }
409
+ return {
410
+ skill: {
411
+ skillMd: skillMdFile.content,
412
+ metadata: manifest,
413
+ instructions: body,
414
+ skillJson,
415
+ files: skillFiles,
416
+ scripts: scripts.length > 0 ? scripts : undefined,
417
+ references: references.length > 0 ? references : undefined,
418
+ assets: assets.length > 0 ? assets : undefined,
419
+ },
420
+ errors,
421
+ };
422
+ }
423
+ // ============================================================================
424
+ // TYPE GUARDS
425
+ // ============================================================================
426
+ export function isValidParameterType(type) {
427
+ return [
428
+ "string",
429
+ "number",
430
+ "boolean",
431
+ "array",
432
+ "object",
433
+ "file",
434
+ "url",
435
+ "code",
436
+ "markdown",
437
+ "json",
438
+ "any",
439
+ ].includes(type);
440
+ }
441
+ export function isValidCapability(cap) {
442
+ return [
443
+ "file:read",
444
+ "file:write",
445
+ "file:delete",
446
+ "file:execute",
447
+ "network:http",
448
+ "network:https",
449
+ "network:websocket",
450
+ "shell:execute",
451
+ "shell:background",
452
+ "process:spawn",
453
+ "database:read",
454
+ "database:write",
455
+ "secrets:read",
456
+ "env:read",
457
+ "api:external",
458
+ "oauth:required",
459
+ "ui:browser",
460
+ "ui:terminal",
461
+ "gpu:required",
462
+ "elevated:required",
463
+ ].includes(cap);
464
+ }
465
+ export function isAnthropicCompatible(manifest) {
466
+ const nameValid = validateAnthropicName(manifest.name || "").valid;
467
+ const descValid = validateAnthropicDescription(manifest.description || "").valid;
468
+ return nameValid && descValid;
469
+ }
470
+ // ============================================================================
471
+ // CONVERSION UTILITIES
472
+ // ============================================================================
473
+ /**
474
+ * Convert a legacy single-file skill to directory structure
475
+ */
476
+ export function convertLegacySkill(legacyContent, skillName) {
477
+ const errors = [];
478
+ const files = [];
479
+ // Parse the legacy file
480
+ const { manifest, body, errors: parseErrors } = parseSkillFrontmatter(legacyContent);
481
+ errors.push(...parseErrors);
482
+ if (!manifest.name || !manifest.description) {
483
+ errors.push("Legacy skill must have name and description");
484
+ return { files: [], errors };
485
+ }
486
+ // Create Anthropic-compatible SKILL.md (only name + description)
487
+ const anthropicFrontmatter = `---
488
+ name: ${manifest.name.replace(/^@[\w-]+\//, "")}
489
+ description: ${manifest.description}
490
+ ---
491
+ `;
492
+ files.push({
493
+ path: `${skillName}/SKILL.md`,
494
+ content: anthropicFrontmatter + body,
495
+ });
496
+ // Create skill.json with ask extensions
497
+ const askExtensions = {};
498
+ if (manifest.version)
499
+ askExtensions.version = manifest.version;
500
+ if (manifest.author)
501
+ askExtensions.author = manifest.author;
502
+ if (manifest.license)
503
+ askExtensions.license = manifest.license;
504
+ if (manifest.keywords)
505
+ askExtensions.keywords = manifest.keywords;
506
+ if (manifest.categories)
507
+ askExtensions.categories = manifest.categories;
508
+ if (manifest.contract)
509
+ askExtensions.contract = manifest.contract;
510
+ if (manifest.capabilities)
511
+ askExtensions.capabilities = manifest.capabilities;
512
+ if (manifest.tests)
513
+ askExtensions.tests = manifest.tests;
514
+ if (Object.keys(askExtensions).length > 0) {
515
+ files.push({
516
+ path: `${skillName}/skill.json`,
517
+ content: JSON.stringify(askExtensions, null, 2),
518
+ });
519
+ }
520
+ return { files, errors };
521
+ }
522
+ /**
523
+ * Merge skill.json extensions into manifest
524
+ */
525
+ export function mergeExtensions(metadata, extensions) {
526
+ return {
527
+ ...metadata,
528
+ ...extensions,
529
+ };
530
+ }
531
+ //# sourceMappingURL=skill-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-schema.js","sourceRoot":"","sources":["../src/skill-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsDH,gGAAgG;AAChG,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,aAAsB;IAEtB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACrB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,oCAAoC,EAAE,CAAC;IACvE,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EACH,mGAAmG;SACtG,CAAC;IACJ,CAAC;IACD,qCAAqC;IACrC,mEAAmE;IACnE,MAAM,cAAc,GAAG;QACrB,uCAAuC;QACvC,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,KAAK;QACL,QAAQ;QACR,0BAA0B;QAC1B,OAAO;QACP,QAAQ;QACR,UAAU;QACV,UAAU;QACV,WAAW;QACX,aAAa;QACb,qBAAqB;QACrB,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,cAAc,EAAE,CAAC;QACtC,IAAI,I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@ -0,0 +1,119 @@
1
+ /**
2
+ * Skill Testing Framework
3
+ *
4
+ * Validates skill behavior against defined test cases.
5
+ * Can run in dry-run mode (validation only) or execution mode.
6
+ */
7
+ import type { SkillTestCase, SkillManifest, SkillCapability } from "./skill-schema.js";
8
+ export interface TestResult {
9
+ name: string;
10
+ passed: boolean;
11
+ duration: number;
12
+ error?: string;
13
+ details?: {
14
+ expectedOutput?: Record<string, unknown>;
15
+ actualOutput?: Record<string, unknown>;
16
+ mismatchedFields?: string[];
17
+ };
18
+ }
19
+ export interface TestSuiteResult {
20
+ total: number;
21
+ passed: number;
22
+ failed: number;
23
+ skipped: number;
24
+ duration: number;
25
+ results: TestResult[];
26
+ coverage: {
27
+ inputsCovered: string[];
28
+ outputsCovered: string[];
29
+ capabilitiesCovered: string[];
30
+ uncoveredInputs: string[];
31
+ uncoveredOutputs: string[];
32
+ };
33
+ }
34
+ export interface TestRunnerOptions {
35
+ /**
36
+ * Run tests in dry-run mode (validation only, no execution)
37
+ */
38
+ dryRun?: boolean;
39
+ /**
40
+ * Timeout per test in milliseconds
41
+ */
42
+ timeout?: number;
43
+ /**
44
+ * Only run tests matching this pattern
45
+ */
46
+ filter?: string;
47
+ /**
48
+ * Stop on first failure
49
+ */
50
+ bail?: boolean;
51
+ /**
52
+ * Verbose output
53
+ */
54
+ verbose?: boolean;
55
+ /**
56
+ * Custom executor for running test cases
57
+ * If not provided, tests run in validation-only mode
58
+ */
59
+ executor?: TestExecutor;
60
+ }
61
+ export type TestExecutor = (test: SkillTestCase, manifest: SkillManifest) => Promise<{
62
+ output: Record<string, unknown>;
63
+ success: boolean;
64
+ error?: string;
65
+ capabilitiesUsed?: SkillCapability[];
66
+ }>;
67
+ export declare class SkillTestRunner {
68
+ private options;
69
+ constructor(options?: TestRunnerOptions);
70
+ /**
71
+ * Run all tests in a skill's test suite
72
+ */
73
+ run(manifest: SkillManifest, skillContent: string): Promise<TestSuiteResult>;
74
+ /**
75
+ * Run a single test case
76
+ */
77
+ private runTest;
78
+ /**
79
+ * Validate test structure (dry-run mode)
80
+ */
81
+ private validateTestStructure;
82
+ /**
83
+ * Filter tests based on options
84
+ */
85
+ private filterTests;
86
+ /**
87
+ * Validate inputs against contract
88
+ */
89
+ private validateInputs;
90
+ /**
91
+ * Match actual output against expected
92
+ */
93
+ private matchOutput;
94
+ /**
95
+ * Deep equality check
96
+ */
97
+ private deepEqual;
98
+ /**
99
+ * Create a timeout promise
100
+ */
101
+ private timeout;
102
+ }
103
+ /**
104
+ * Run tests for a skill (validation only)
105
+ */
106
+ export declare function validateTests(manifest: SkillManifest, skillContent: string, options?: TestRunnerOptions): Promise<TestSuiteResult>;
107
+ /**
108
+ * Calculate test coverage percentage
109
+ */
110
+ export declare function calculateCoverage(result: TestSuiteResult): {
111
+ inputCoverage: number;
112
+ outputCoverage: number;
113
+ overallCoverage: number;
114
+ };
115
+ /**
116
+ * Format test results for display
117
+ */
118
+ export declare function formatTestResults(result: TestSuiteResult): string;
119
+ //# sourceMappingURL=skill-tester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-tester.d.ts","sourceRoot":"","sources":["../src/skill-tester.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EAEb,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAM3B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,E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