@senior-skills/core 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.
- package/dist/application/agent-selection.d.ts +42 -0
- package/dist/application/agent-selection.d.ts.map +1 -0
- package/dist/application/agent-selection.js +143 -0
- package/dist/application/agent-selection.js.map +1 -0
- package/dist/application/apply-skill-updates.d.ts +10 -0
- package/dist/application/apply-skill-updates.d.ts.map +1 -0
- package/dist/application/apply-skill-updates.js +75 -0
- package/dist/application/apply-skill-updates.js.map +1 -0
- package/dist/application/check-updates.d.ts +40 -0
- package/dist/application/check-updates.d.ts.map +1 -0
- package/dist/application/check-updates.js +130 -0
- package/dist/application/check-updates.js.map +1 -0
- package/dist/application/context.d.ts +28 -0
- package/dist/application/context.d.ts.map +1 -0
- package/dist/application/context.js +2 -0
- package/dist/application/context.js.map +1 -0
- package/dist/application/create-skill.d.ts +33 -0
- package/dist/application/create-skill.d.ts.map +1 -0
- package/dist/application/create-skill.js +58 -0
- package/dist/application/create-skill.js.map +1 -0
- package/dist/application/diagnose.d.ts +44 -0
- package/dist/application/diagnose.d.ts.map +1 -0
- package/dist/application/diagnose.js +228 -0
- package/dist/application/diagnose.js.map +1 -0
- package/dist/application/install-skills.d.ts +59 -0
- package/dist/application/install-skills.d.ts.map +1 -0
- package/dist/application/install-skills.js +191 -0
- package/dist/application/install-skills.js.map +1 -0
- package/dist/application/list-installed.d.ts +39 -0
- package/dist/application/list-installed.d.ts.map +1 -0
- package/dist/application/list-installed.js +68 -0
- package/dist/application/list-installed.js.map +1 -0
- package/dist/application/package-loader.d.ts +42 -0
- package/dist/application/package-loader.d.ts.map +1 -0
- package/dist/application/package-loader.js +320 -0
- package/dist/application/package-loader.js.map +1 -0
- package/dist/application/publish-skill.d.ts +41 -0
- package/dist/application/publish-skill.d.ts.map +1 -0
- package/dist/application/publish-skill.js +112 -0
- package/dist/application/publish-skill.js.map +1 -0
- package/dist/application/remove-skills.d.ts +34 -0
- package/dist/application/remove-skills.d.ts.map +1 -0
- package/dist/application/remove-skills.js +95 -0
- package/dist/application/remove-skills.js.map +1 -0
- package/dist/application/resolution-source.d.ts +25 -0
- package/dist/application/resolution-source.d.ts.map +1 -0
- package/dist/application/resolution-source.js +60 -0
- package/dist/application/resolution-source.js.map +1 -0
- package/dist/application/resolve-suggestions.d.ts +17 -0
- package/dist/application/resolve-suggestions.d.ts.map +1 -0
- package/dist/application/resolve-suggestions.js +77 -0
- package/dist/application/resolve-suggestions.js.map +1 -0
- package/dist/application/search-skills.d.ts +36 -0
- package/dist/application/search-skills.d.ts.map +1 -0
- package/dist/application/search-skills.js +78 -0
- package/dist/application/search-skills.js.map +1 -0
- package/dist/application/update-skills.d.ts +55 -0
- package/dist/application/update-skills.d.ts.map +1 -0
- package/dist/application/update-skills.js +115 -0
- package/dist/application/update-skills.js.map +1 -0
- package/dist/application/validate-package.d.ts +27 -0
- package/dist/application/validate-package.d.ts.map +1 -0
- package/dist/application/validate-package.js +165 -0
- package/dist/application/validate-package.js.map +1 -0
- package/dist/application/workspace.d.ts +22 -0
- package/dist/application/workspace.d.ts.map +1 -0
- package/dist/application/workspace.js +66 -0
- package/dist/application/workspace.js.map +1 -0
- package/dist/domain/agent.d.ts +89 -0
- package/dist/domain/agent.d.ts.map +1 -0
- package/dist/domain/agent.js +20 -0
- package/dist/domain/agent.js.map +1 -0
- package/dist/domain/errors.d.ts +91 -0
- package/dist/domain/errors.d.ts.map +1 -0
- package/dist/domain/errors.js +121 -0
- package/dist/domain/errors.js.map +1 -0
- package/dist/domain/integrity.d.ts +19 -0
- package/dist/domain/integrity.d.ts.map +1 -0
- package/dist/domain/integrity.js +0 -0
- package/dist/domain/integrity.js.map +1 -0
- package/dist/domain/js-literal.d.ts +22 -0
- package/dist/domain/js-literal.d.ts.map +1 -0
- package/dist/domain/js-literal.js +221 -0
- package/dist/domain/js-literal.js.map +1 -0
- package/dist/domain/lockfile.d.ts +36 -0
- package/dist/domain/lockfile.d.ts.map +1 -0
- package/dist/domain/lockfile.js +148 -0
- package/dist/domain/lockfile.js.map +1 -0
- package/dist/domain/manifest.d.ts +96 -0
- package/dist/domain/manifest.d.ts.map +1 -0
- package/dist/domain/manifest.js +448 -0
- package/dist/domain/manifest.js.map +1 -0
- package/dist/domain/path-safety.d.ts +19 -0
- package/dist/domain/path-safety.d.ts.map +1 -0
- package/dist/domain/path-safety.js +125 -0
- package/dist/domain/path-safety.js.map +1 -0
- package/dist/domain/posix-path.d.ts +28 -0
- package/dist/domain/posix-path.d.ts.map +1 -0
- package/dist/domain/posix-path.js +84 -0
- package/dist/domain/posix-path.js.map +1 -0
- package/dist/domain/receipt.d.ts +41 -0
- package/dist/domain/receipt.d.ts.map +1 -0
- package/dist/domain/receipt.js +93 -0
- package/dist/domain/receipt.js.map +1 -0
- package/dist/domain/registry-index.d.ts +41 -0
- package/dist/domain/registry-index.d.ts.map +1 -0
- package/dist/domain/registry-index.js +150 -0
- package/dist/domain/registry-index.js.map +1 -0
- package/dist/domain/resolver.d.ts +54 -0
- package/dist/domain/resolver.d.ts.map +1 -0
- package/dist/domain/resolver.js +238 -0
- package/dist/domain/resolver.js.map +1 -0
- package/dist/domain/skill-document.d.ts +16 -0
- package/dist/domain/skill-document.d.ts.map +1 -0
- package/dist/domain/skill-document.js +60 -0
- package/dist/domain/skill-document.js.map +1 -0
- package/dist/domain/skill-package.d.ts +43 -0
- package/dist/domain/skill-package.d.ts.map +1 -0
- package/dist/domain/skill-package.js +63 -0
- package/dist/domain/skill-package.js.map +1 -0
- package/dist/domain/skill-ref.d.ts +30 -0
- package/dist/domain/skill-ref.d.ts.map +1 -0
- package/dist/domain/skill-ref.js +119 -0
- package/dist/domain/skill-ref.js.map +1 -0
- package/dist/domain/validation.d.ts +30 -0
- package/dist/domain/validation.d.ts.map +1 -0
- package/dist/domain/validation.js +32 -0
- package/dist/domain/validation.js.map +1 -0
- package/dist/domain/version.d.ts +23 -0
- package/dist/domain/version.d.ts.map +1 -0
- package/dist/domain/version.js +81 -0
- package/dist/domain/version.js.map +1 -0
- package/dist/domain/workflow-document.d.ts +23 -0
- package/dist/domain/workflow-document.d.ts.map +1 -0
- package/dist/domain/workflow-document.js +56 -0
- package/dist/domain/workflow-document.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/ports/agent-adapter.d.ts +65 -0
- package/dist/ports/agent-adapter.d.ts.map +1 -0
- package/dist/ports/agent-adapter.js +28 -0
- package/dist/ports/agent-adapter.js.map +1 -0
- package/dist/ports/config-store.d.ts +27 -0
- package/dist/ports/config-store.d.ts.map +1 -0
- package/dist/ports/config-store.js +2 -0
- package/dist/ports/config-store.js.map +1 -0
- package/dist/ports/infrastructure.d.ts +123 -0
- package/dist/ports/infrastructure.d.ts.map +1 -0
- package/dist/ports/infrastructure.js +9 -0
- package/dist/ports/infrastructure.js.map +1 -0
- package/dist/ports/installation.d.ts +86 -0
- package/dist/ports/installation.d.ts.map +1 -0
- package/dist/ports/installation.js +2 -0
- package/dist/ports/installation.js.map +1 -0
- package/dist/ports/skill-registry.d.ts +74 -0
- package/dist/ports/skill-registry.d.ts.map +1 -0
- package/dist/ports/skill-registry.js +2 -0
- package/dist/ports/skill-registry.js.map +1 -0
- package/dist/ports/updates.d.ts +31 -0
- package/dist/ports/updates.d.ts.map +1 -0
- package/dist/ports/updates.js +4 -0
- package/dist/ports/updates.js.map +1 -0
- package/dist/testing/doubles.d.ts +127 -0
- package/dist/testing/doubles.d.ts.map +1 -0
- package/dist/testing/doubles.js +299 -0
- package/dist/testing/doubles.js.map +1 -0
- package/dist/testing/in-memory-file-system.d.ts +61 -0
- package/dist/testing/in-memory-file-system.d.ts.map +1 -0
- package/dist/testing/in-memory-file-system.js +297 -0
- package/dist/testing/in-memory-file-system.js.map +1 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type IssueSeverity = 'error' | 'warning' | 'info';
|
|
2
|
+
export interface ValidationIssue {
|
|
3
|
+
readonly severity: IssueSeverity;
|
|
4
|
+
/** Stable identifier, e.g. `manifest.name.mismatch`. Used in tests and docs. */
|
|
5
|
+
readonly rule: string;
|
|
6
|
+
/** Dotted path into the document, or a file path. */
|
|
7
|
+
readonly at: string;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
/** Concrete fix, when there is an obvious one. */
|
|
10
|
+
readonly hint?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidationReport {
|
|
13
|
+
readonly ok: boolean;
|
|
14
|
+
readonly issues: readonly ValidationIssue[];
|
|
15
|
+
readonly errors: readonly ValidationIssue[];
|
|
16
|
+
readonly warnings: readonly ValidationIssue[];
|
|
17
|
+
}
|
|
18
|
+
export declare function buildReport(issues: readonly ValidationIssue[]): ValidationReport;
|
|
19
|
+
/** Small helper so validators read as a list of rules rather than a list of pushes. */
|
|
20
|
+
export declare class IssueCollector {
|
|
21
|
+
private readonly issues;
|
|
22
|
+
error(rule: string, at: string, message: string, hint?: string): void;
|
|
23
|
+
warn(rule: string, at: string, message: string, hint?: string): void;
|
|
24
|
+
info(rule: string, at: string, message: string, hint?: string): void;
|
|
25
|
+
private add;
|
|
26
|
+
absorb(issues: readonly ValidationIssue[]): void;
|
|
27
|
+
all(): readonly ValidationIssue[];
|
|
28
|
+
report(): ValidationReport;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/domain/validation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAA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2
|
+
const errors = issues.filter((issue) => issue.severity === 'error');
|
|
3
|
+
const warnings = issues.filter((issue) => issue.severity === 'warning');
|
|
4
|
+
return { ok: errors.length === 0, issues, errors, warnings };
|
|
5
|
+
}
|
|
6
|
+
/** Small helper so validators read as a list of rules rather than a list of pushes. */
|
|
7
|
+
export class IssueCollector {
|
|
8
|
+
issues = [];
|
|
9
|
+
error(rule, at, message, hint) {
|
|
10
|
+
this.add('error', rule, at, message, hint);
|
|
11
|
+
}
|
|
12
|
+
warn(rule, at, message, hint) {
|
|
13
|
+
this.add('warning', rule, at, message, hint);
|
|
14
|
+
}
|
|
15
|
+
info(rule, at, message, hint) {
|
|
16
|
+
this.add('info', rule, at, message, hint);
|
|
17
|
+
}
|
|
18
|
+
add(severity, rule, at, message, hint) {
|
|
19
|
+
const issue = hint === undefined ? { severity, rule, at, message } : { severity, rule, at, message, hint };
|
|
20
|
+
this.issues.push(issue);
|
|
21
|
+
}
|
|
22
|
+
absorb(issues) {
|
|
23
|
+
this.issues.push(...issues);
|
|
24
|
+
}
|
|
25
|
+
all() {
|
|
26
|
+
return this.issues;
|
|
27
|
+
}
|
|
28
|
+
report() {
|
|
29
|
+
return buildReport(this.issues);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/domain/validation.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,WAAW,CAAC,MAAkC;IAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACxE,OAAO,EAAE,EAAE,EAAE,MAAM,CAA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CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A validated, strict semantic version string. Nominal typing keeps unvalidated strings
|
|
3
|
+
* from reaching the resolver: the only way to obtain one is through {@link parseVersion}.
|
|
4
|
+
*/
|
|
5
|
+
export type SemanticVersion = string & {
|
|
6
|
+
readonly __brand: 'SemanticVersion';
|
|
7
|
+
};
|
|
8
|
+
export declare function isSemanticVersion(value: string): boolean;
|
|
9
|
+
export declare function parseVersion(value: string, context?: string): SemanticVersion;
|
|
10
|
+
export declare function parseRange(value: string, context?: string): string;
|
|
11
|
+
export declare function satisfies(version: SemanticVersion, range: string): boolean;
|
|
12
|
+
export declare function compareVersions(a: SemanticVersion, b: SemanticVersion): number;
|
|
13
|
+
export declare function isPrerelease(version: SemanticVersion): boolean;
|
|
14
|
+
export declare function sortVersionsDescending(versions: readonly SemanticVersion[]): readonly SemanticVersion[];
|
|
15
|
+
/** Highest version satisfying `range`, or undefined. Stable releases win ties by sorting. */
|
|
16
|
+
export declare function maxSatisfying(versions: readonly SemanticVersion[], range: string): SemanticVersion | undefined;
|
|
17
|
+
/** True when every listed range can be satisfied by at least one of the versions. */
|
|
18
|
+
export declare function intersects(ranges: readonly string[]): boolean;
|
|
19
|
+
export type VersionBump = 'major' | 'minor' | 'patch' | 'prerelease' | 'same' | 'downgrade';
|
|
20
|
+
/** Classifies a version change, used by `update` to describe what it did. */
|
|
21
|
+
export declare function classifyChange(from: SemanticVersion, to: SemanticVersion): VersionBump;
|
|
22
|
+
export declare function increment(version: SemanticVersion, release: 'major' | 'minor' | 'patch'): SemanticVersion;
|
|
23
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/domain/version.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO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"./errors.js";
|
|
3
|
+
export function isSemanticVersion(value) {
|
|
4
|
+
return semver.valid(value, { loose: false }) !== null;
|
|
5
|
+
}
|
|
6
|
+
export function parseVersion(value, context) {
|
|
7
|
+
if (!isSemanticVersion(value)) {
|
|
8
|
+
throw new AgentSkillsError(ErrorCode.INVALID_VERSION, `Invalid version "${value}"`, {
|
|
9
|
+
details: context === undefined ? [] : [`In: ${context}`],
|
|
10
|
+
hints: [
|
|
11
|
+
'Versions must be strict semver: MAJOR.MINOR.PATCH (e.g. 1.0.0, 2.3.1-rc.1)',
|
|
12
|
+
'Ranges such as ^1.0.0 belong in dependencies, not in the version field',
|
|
13
|
+
],
|
|
14
|
+
data: { value, context },
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
export function parseRange(value, context) {
|
|
20
|
+
if (semver.validRange(value) === null) {
|
|
21
|
+
throw new AgentSkillsError(ErrorCode.INVALID_VERSION, `Invalid version range "${value}"`, {
|
|
22
|
+
details: context === undefined ? [] : [`In: ${context}`],
|
|
23
|
+
hints: ['Valid forms: 1.2.0, ^1.2.0, ~1.2, >=1.0.0 <2.0.0, *'],
|
|
24
|
+
data: { value, context },
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
export function satisfies(version, range) {
|
|
30
|
+
// includePrerelease keeps `1.0.0-rc.1` resolvable when a user asks for it explicitly,
|
|
31
|
+
// while `maxSatisfying` below still prefers stable releases because they sort higher.
|
|
32
|
+
return semver.satisfies(version, range, { includePrerelease: true });
|
|
33
|
+
}
|
|
34
|
+
export function compareVersions(a, b) {
|
|
35
|
+
return semver.compare(a, b);
|
|
36
|
+
}
|
|
37
|
+
export function isPrerelease(version) {
|
|
38
|
+
return semver.prerelease(version) !== null;
|
|
39
|
+
}
|
|
40
|
+
export function sortVersionsDescending(versions) {
|
|
41
|
+
return [...versions].sort((a, b) => semver.rcompare(a, b));
|
|
42
|
+
}
|
|
43
|
+
/** Highest version satisfying `range`, or undefined. Stable releases win ties by sorting. */
|
|
44
|
+
export function maxSatisfying(versions, range) {
|
|
45
|
+
const stable = versions.filter((version) => semver.prerelease(version) === null);
|
|
46
|
+
const pool = stable.length > 0 ? stable : versions;
|
|
47
|
+
const best = semver.maxSatisfying([...pool], range, { includePrerelease: true });
|
|
48
|
+
if (best !== null)
|
|
49
|
+
return best;
|
|
50
|
+
// Fall back to the full set so an explicit prerelease range still resolves.
|
|
51
|
+
const fallback = semver.maxSatisfying([...versions], range, { includePrerelease: true });
|
|
52
|
+
return fallback === null ? undefined : fallback;
|
|
53
|
+
}
|
|
54
|
+
/** True when every listed range can be satisfied by at least one of the versions. */
|
|
55
|
+
export function intersects(ranges) {
|
|
56
|
+
return ranges.every((a, index) => ranges.slice(index + 1).every((b) => semver.intersects(a, b, { includePrerelease: true })));
|
|
57
|
+
}
|
|
58
|
+
/** Classifies a version change, used by `update` to describe what it did. */
|
|
59
|
+
export function classifyChange(from, to) {
|
|
60
|
+
const comparison = semver.compare(from, to);
|
|
61
|
+
if (comparison === 0)
|
|
62
|
+
return 'same';
|
|
63
|
+
if (comparison > 0)
|
|
64
|
+
return 'downgrade';
|
|
65
|
+
const diff = semver.diff(from, to);
|
|
66
|
+
if (diff === 'major' || diff === 'premajor')
|
|
67
|
+
return 'major';
|
|
68
|
+
if (diff === 'minor' || diff === 'preminor')
|
|
69
|
+
return 'minor';
|
|
70
|
+
if (diff === 'patch' || diff === 'prepatch')
|
|
71
|
+
return 'patch';
|
|
72
|
+
return 'prerelease';
|
|
73
|
+
}
|
|
74
|
+
export function increment(version, release) {
|
|
75
|
+
const next = semver.inc(version, release);
|
|
76
|
+
if (next === null) {
|
|
77
|
+
throw new AgentSkillsError(ErrorCode.INVALID_VERSION, `Cannot increment "${version}"`);
|
|
78
|
+
}
|
|
79
|
+
return next;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
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AAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,gBAAgB,CAAC,SAAS,CAAC,eAAe,EAAE,qBAAqB,OAAO,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,IAAuB,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SkillDocument } from './skill-document.ts';
|
|
2
|
+
/**
|
|
3
|
+
* A workflow's entrypoint is JavaScript, not Markdown, so its identity lives in
|
|
4
|
+
* `export const meta = { … }` rather than in YAML frontmatter.
|
|
5
|
+
*
|
|
6
|
+
* Reading it statically — never executing the script — is what lets `validate`, `search` and
|
|
7
|
+
* `info` describe a workflow the same way they describe a skill. The result is deliberately a
|
|
8
|
+
* {@link SkillDocument}: `meta` becomes the frontmatter and the script becomes the body, so
|
|
9
|
+
* every rule downstream (name agreement, description required, version match) applies to all
|
|
10
|
+
* package kinds without knowing which one it is looking at.
|
|
11
|
+
*
|
|
12
|
+
* The two constraints enforced here are Claude Code's own: the declaration must be the first
|
|
13
|
+
* statement, and it must be a pure literal. A package this parser accepts is one the agent
|
|
14
|
+
* can compile.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseWorkflowDocument(text: string, source?: string): SkillDocument;
|
|
17
|
+
/**
|
|
18
|
+
* Renders a workflow document back to a script. Used by the scaffold; installs copy the
|
|
19
|
+
* author's bytes verbatim rather than round-tripping, because reformatting someone's
|
|
20
|
+
* JavaScript is not this tool's business.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stringifyWorkflowDocument(doc: SkillDocument): string;
|
|
23
|
+
//# sourceMappingURL=workflow-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-document.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAgB,GAAG,aAAa,CA0CzF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AgentSkillsError, ErrorCode } from "./errors.js";
|
|
2
|
+
import { parseJsLiteral, skipTrivia } from "./js-literal.js";
|
|
3
|
+
/**
|
|
4
|
+
* A workflow's entrypoint is JavaScript, not Markdown, so its identity lives in
|
|
5
|
+
* `export const meta = { … }` rather than in YAML frontmatter.
|
|
6
|
+
*
|
|
7
|
+
* Reading it statically — never executing the script — is what lets `validate`, `search` and
|
|
8
|
+
* `info` describe a workflow the same way they describe a skill. The result is deliberately a
|
|
9
|
+
* {@link SkillDocument}: `meta` becomes the frontmatter and the script becomes the body, so
|
|
10
|
+
* every rule downstream (name agreement, description required, version match) applies to all
|
|
11
|
+
* package kinds without knowing which one it is looking at.
|
|
12
|
+
*
|
|
13
|
+
* The two constraints enforced here are Claude Code's own: the declaration must be the first
|
|
14
|
+
* statement, and it must be a pure literal. A package this parser accepts is one the agent
|
|
15
|
+
* can compile.
|
|
16
|
+
*/
|
|
17
|
+
export function parseWorkflowDocument(text, source = 'WORKFLOW.js') {
|
|
18
|
+
const normalized = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
|
|
19
|
+
const start = skipTrivia(normalized, 0);
|
|
20
|
+
const declaration = /^export\s+const\s+meta\s*=\s*/.exec(normalized.slice(start));
|
|
21
|
+
if (declaration === null) {
|
|
22
|
+
throw new AgentSkillsError(ErrorCode.INVALID_PACKAGE, `${source} does not begin with an "export const meta" declaration`, {
|
|
23
|
+
details: ['It must be the first statement, before any other code.'],
|
|
24
|
+
hints: [
|
|
25
|
+
'Example:',
|
|
26
|
+
'export const meta = {',
|
|
27
|
+
" name: 'ship-review',",
|
|
28
|
+
" description: 'What the workflow does.',",
|
|
29
|
+
'};',
|
|
30
|
+
],
|
|
31
|
+
data: { source },
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const { value, end } = parseJsLiteral(normalized, start + declaration[0].length, `${source}: meta must be a pure literal`);
|
|
35
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
36
|
+
throw new AgentSkillsError(ErrorCode.INVALID_PACKAGE, `${source}: meta must be an object`, {
|
|
37
|
+
data: { source },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
frontmatter: value,
|
|
42
|
+
body: normalized
|
|
43
|
+
.slice(end)
|
|
44
|
+
.replace(/^[;\s]*\n/, '')
|
|
45
|
+
.trimStart(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Renders a workflow document back to a script. Used by the scaffold; installs copy the
|
|
50
|
+
* author's bytes verbatim rather than round-tripping, because reformatting someone's
|
|
51
|
+
* JavaScript is not this tool's business.
|
|
52
|
+
*/
|
|
53
|
+
export function stringifyWorkflowDocument(doc) {
|
|
54
|
+
return `export const meta = ${JSON.stringify(doc.frontmatter, null, 2)};\n\n${doc.body.trimStart()}`;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=workflow-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-document.js","sourceRoot":"","sources":["../../src/domain/workflow-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,MAAM,GAAG,aAAa;IACxE,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAA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,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;AACvG,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@senior-skills/core` — the agent-agnostic heart of senior-skills.
|
|
3
|
+
*
|
|
4
|
+
* Contains the domain model, the application services, and the port interfaces every
|
|
5
|
+
* adapter implements. It has no knowledge of Claude Code, Codex, git, HTTP or the
|
|
6
|
+
* filesystem: those live behind the ports re-exported below.
|
|
7
|
+
*/
|
|
8
|
+
export { AgentSkillsError, ErrorCode, ExitCode, exitCodeFor, isAgentSkillsError, type AgentSkillsErrorOptions, } from './domain/errors.ts';
|
|
9
|
+
export { detectionFrom, entryNameFor, INSTALL_SCOPES, type AgentDetection, type AgentId, type AgentLayout, type AgentLocation, type AgentTarget, type DetectionEvidence, type DetectionStrength, type EntryShape, type InstallScope, type LayoutEntry, type LocationContext, } from './domain/agent.ts';
|
|
10
|
+
export { computeIntegrity, computePackageIntegrity, INTEGRITY_PREFIX, isIntegrityString, } from './domain/integrity.ts';
|
|
11
|
+
export { CURRENT_LOCKFILE_VERSION, LOCKFILE_NAME, assertIntegrityMatches, emptyLockfile, parseLockfile, stringifyLockfile, withSkill, withoutSkill, type Lockfile, type LockedSkill, } from './domain/lockfile.ts';
|
|
12
|
+
export { COMMAND_ENTRYPOINT, CURRENT_SCHEMA_VERSION, WORKFLOW_ENTRYPOINT, DEFAULT_PACKAGE_KIND, MANIFEST_FILENAME, PACKAGE_KINDS, SKILL_ENTRYPOINT, entrypointFor, parseManifest, stringifyManifest, type AgentCompatibility, type PackageKind, type ParsedManifest, type SkillAuthor, type SkillDependency, type SkillManifest, type SkillRepository, } from './domain/manifest.ts';
|
|
13
|
+
export { MAX_PATH_SEGMENTS, MAX_SEGMENT_LENGTH, inspectPath, isSafePath, normalizeSafePath, type PathSafetyRule, type PathSafetyViolation, } from './domain/path-safety.ts';
|
|
14
|
+
export * as posix from './domain/posix-path.ts';
|
|
15
|
+
export { CURRENT_RECEIPT_VERSION, RECEIPT_DIRNAME, parseReceipt, receiptPath, stringifyReceipt, type InstallReceipt, type ReceiptFile, } from './domain/receipt.ts';
|
|
16
|
+
export { CURRENT_INDEX_VERSION, findIndexEntry, parseRegistryIndex, stringifyRegistryIndex, type IndexSkillEntry, type IndexVersionEntry, type RegistryIndex, type RegistryKind, } from './domain/registry-index.ts';
|
|
17
|
+
export { Resolver, type ResolutionResult, type ResolutionSource, type ResolveOptions, type ResolvedSkill, } from './domain/resolver.ts';
|
|
18
|
+
export { documentDescription, documentName, documentVersion, parseSkillDocument, stringifySkillDocument, type SkillDocument, } from './domain/skill-document.ts';
|
|
19
|
+
export { parseWorkflowDocument, stringifyWorkflowDocument } from './domain/workflow-document.ts';
|
|
20
|
+
export { parseJsLiteral, skipTrivia } from './domain/js-literal.ts';
|
|
21
|
+
export { buildSkillPackage, decodeText, encodeText, parseEntrypoint, findFile, isManifestFile, packageSize, readTextFile, type PackageFile, type SkillPackage, } from './domain/skill-package.ts';
|
|
22
|
+
export { LATEST, SKILL_NAME_MAX_LENGTH, SKILL_NAME_MIN_LENGTH, assertValidSkillName, formatSkillRef, isValidSkillName, parseSkillRef, validateSkillName, type SkillRef, } from './domain/skill-ref.ts';
|
|
23
|
+
export { buildReport, IssueCollector, type IssueSeverity, type ValidationIssue, type ValidationReport, } from './domain/validation.ts';
|
|
24
|
+
export { classifyChange, compareVersions, increment, intersects, isSemanticVersion, isPrerelease, maxSatisfying, parseRange, parseVersion, satisfies, sortVersionsDescending, type SemanticVersion, type VersionBump, } from './domain/version.ts';
|
|
25
|
+
export { AgentCatalog, type AgentAdapter, type DetectionContext } from './ports/agent-adapter.ts';
|
|
26
|
+
export type { AgentConfig, AgentSkillsConfig, CacheConfig, ConfigStore, } from './ports/config-store.ts';
|
|
27
|
+
export type { ArchiveEntry, ArchiveReader, Clock, CommandOptions, CommandResult, CommandRunner, DirEntry, Environment, FileStat, FileSystem, Hasher, HttpClient, HttpRequestOptions, HttpResponse, LogLevel, Logger, } from './ports/infrastructure.ts';
|
|
28
|
+
export type { InstallationEngine, PackageExtractor, InstallOutcome, InstallRequest, InstallResult, InstalledSkill, UninstallRequest, UninstallResult, } from './ports/installation.ts';
|
|
29
|
+
export type { FederatedRegistry, FetchedPackage, RefreshOptions, RegistryConfig, RegistryFactory, RegistryRouter, SearchQuery, SkillRegistry, SkillSummary, } from './ports/skill-registry.ts';
|
|
30
|
+
export { ALL_AGENTS, detectAgents, detectionContext, locationContext, selectAgents, targetsFor, type AgentSelection, type AgentSelectionOptions, } from './application/agent-selection.ts';
|
|
31
|
+
export type { ApplicationContext } from './application/context.ts';
|
|
32
|
+
export { emptyUpdateState, type UpdateState, type UpdateStateStore, type ToolUpdater, type ToolUpdateAction, type SelectionPrompt, } from './ports/updates.ts';
|
|
33
|
+
export { CheckUpdates, UPDATE_REMINDER_MS, type UpdateNotice, type SkillUpdateNotice, type UpdateNotices, } from './application/check-updates.ts';
|
|
34
|
+
export { ApplySkillUpdates } from './application/apply-skill-updates.ts';
|
|
35
|
+
export { CreateSkill, type CreateOptions, type CreateReport } from './application/create-skill.ts';
|
|
36
|
+
export { DiagnoseSystem, type CheckStatus, type DiagnosticCheck, type DiagnosticSection, type DoctorOptions, type DoctorReport, } from './application/diagnose.ts';
|
|
37
|
+
export { InstallSkills, formatIssue, type InstallOptions, type InstallReport, type InstallResolvedSkill, } from './application/install-skills.ts';
|
|
38
|
+
export { ListInstalled, type ListEntry, type ListOptions, type ListReport, } from './application/list-installed.ts';
|
|
39
|
+
export { DEFAULT_MAX_FILES, DEFAULT_MAX_TOTAL_BYTES, loadPackageFromDirectory, peekSkillDocument, scaffoldPackage, type LoadPackageOptions, type LoadedPackage, } from './application/package-loader.ts';
|
|
40
|
+
export { PublishSkill, type PublishOptions, type PublishReport, } from './application/publish-skill.ts';
|
|
41
|
+
export { RemoveSkills, type RemoveOptions, type RemoveReport, } from './application/remove-skills.ts';
|
|
42
|
+
export { FederationResolutionSource } from './application/resolution-source.ts';
|
|
43
|
+
export { DescribeSkill, SearchSkills, type SearchOptions, type SkillInfo, } from './application/search-skills.ts';
|
|
44
|
+
export { UpdateSkills, type UpdateChange, type UpdateOptions, type UpdateReport, type UpdateAddition, } from './application/update-skills.ts';
|
|
45
|
+
export { pathSafetyIssues, validateDirectory, validatePackage, type ValidateDirectoryResult, type ValidatePackageOptions, } from './application/validate-package.ts';
|
|
46
|
+
export { findProjectRoot, lockfilePath, pinsFrom, readLockfile, requireProjectRoot, writeLockfile, } from './application/workspace.ts';
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC;AAE9B,O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;AAExC,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@senior-skills/core` — the agent-agnostic heart of senior-skills.
|
|
3
|
+
*
|
|
4
|
+
* Contains the domain model, the application services, and the port interfaces every
|
|
5
|
+
* adapter implements. It has no knowledge of Claude Code, Codex, git, HTTP or the
|
|
6
|
+
* filesystem: those live behind the ports re-exported below.
|
|
7
|
+
*/
|
|
8
|
+
// --- Domain -----------------------------------------------------------------------------
|
|
9
|
+
export { AgentSkillsError, ErrorCode, ExitCode, exitCodeFor, isAgentSkillsError, } from "./domain/errors.js";
|
|
10
|
+
export { detectionFrom, entryNameFor, INSTALL_SCOPES, } from "./domain/agent.js";
|
|
11
|
+
export { computeIntegrity, computePackageIntegrity, INTEGRITY_PREFIX, isIntegrityString, } from "./domain/integrity.js";
|
|
12
|
+
export { CURRENT_LOCKFILE_VERSION, LOCKFILE_NAME, assertIntegrityMatches, emptyLockfile, parseLockfile, stringifyLockfile, withSkill, withoutSkill, } from "./domain/lockfile.js";
|
|
13
|
+
export { COMMAND_ENTRYPOINT, CURRENT_SCHEMA_VERSION, WORKFLOW_ENTRYPOINT, DEFAULT_PACKAGE_KIND, MANIFEST_FILENAME, PACKAGE_KINDS, SKILL_ENTRYPOINT, entrypointFor, parseManifest, stringifyManifest, } from "./domain/manifest.js";
|
|
14
|
+
export { MAX_PATH_SEGMENTS, MAX_SEGMENT_LENGTH, inspectPath, isSafePath, normalizeSafePath, } from "./domain/path-safety.js";
|
|
15
|
+
export * as posix from "./domain/posix-path.js";
|
|
16
|
+
export { CURRENT_RECEIPT_VERSION, RECEIPT_DIRNAME, parseReceipt, receiptPath, stringifyReceipt, } from "./domain/receipt.js";
|
|
17
|
+
export { CURRENT_INDEX_VERSION, findIndexEntry, parseRegistryIndex, stringifyRegistryIndex, } from "./domain/registry-index.js";
|
|
18
|
+
export { Resolver, } from "./domain/resolver.js";
|
|
19
|
+
export { documentDescription, documentName, documentVersion, parseSkillDocument, stringifySkillDocument, } from "./domain/skill-document.js";
|
|
20
|
+
export { parseWorkflowDocument, stringifyWorkflowDocument } from "./domain/workflow-document.js";
|
|
21
|
+
export { parseJsLiteral, skipTrivia } from "./domain/js-literal.js";
|
|
22
|
+
export { buildSkillPackage, decodeText, encodeText, parseEntrypoint, findFile, isManifestFile, packageSize, readTextFile, } from "./domain/skill-package.js";
|
|
23
|
+
export { LATEST, SKILL_NAME_MAX_LENGTH, SKILL_NAME_MIN_LENGTH, assertValidSkillName, formatSkillRef, isValidSkillName, parseSkillRef, validateSkillName, } from "./domain/skill-ref.js";
|
|
24
|
+
export { buildReport, IssueCollector, } from "./domain/validation.js";
|
|
25
|
+
export { classifyChange, compareVersions, increment, intersects, isSemanticVersion, isPrerelease, maxSatisfying, parseRange, parseVersion, satisfies, sortVersionsDescending, } from "./domain/version.js";
|
|
26
|
+
// --- Ports ------------------------------------------------------------------------------
|
|
27
|
+
export { AgentCatalog } from "./ports/agent-adapter.js";
|
|
28
|
+
// --- Application ------------------------------------------------------------------------
|
|
29
|
+
export { ALL_AGENTS, detectAgents, detectionContext, locationContext, selectAgents, targetsFor, } from "./application/agent-selection.js";
|
|
30
|
+
export { emptyUpdateState, } from "./ports/updates.js";
|
|
31
|
+
export { CheckUpdates, UPDATE_REMINDER_MS, } from "./application/check-updates.js";
|
|
32
|
+
export { ApplySkillUpdates } from "./application/apply-skill-updates.js";
|
|
33
|
+
export { CreateSkill } from "./application/create-skill.js";
|
|
34
|
+
export { DiagnoseSystem, } from "./application/diagnose.js";
|
|
35
|
+
export { InstallSkills, formatIssue, } from "./application/install-skills.js";
|
|
36
|
+
export { ListInstalled, } from "./application/list-installed.js";
|
|
37
|
+
export { DEFAULT_MAX_FILES, DEFAULT_MAX_TOTAL_BYTES, loadPackageFromDirectory, peekSkillDocument, scaffoldPackage, } from "./application/package-loader.js";
|
|
38
|
+
export { PublishSkill, } from "./application/publish-skill.js";
|
|
39
|
+
export { RemoveSkills, } from "./application/remove-skills.js";
|
|
40
|
+
export { FederationResolutionSource } from "./application/resolution-source.js";
|
|
41
|
+
export { DescribeSkill, SearchSkills, } from "./application/search-skills.js";
|
|
42
|
+
export { UpdateSkills, } from "./application/update-skills.js";
|
|
43
|
+
export { pathSafetyIssues, validateDirectory, validatePackage, } from "./application/validate-package.js";
|
|
44
|
+
export { findProjectRoot, lockfilePath, pinsFrom, readLockfile, requireProjectRoot, writeLockfile, } from "./application/workspace.js";
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2FAA2F;AAC3F,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,GAYf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,EAChB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C,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAGhB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AgentDetection, AgentId, AgentLayout, AgentLocation, InstallScope, LocationContext } from '../domain/agent.ts';
|
|
2
|
+
import type { PackageKind } from '../domain/manifest.ts';
|
|
3
|
+
import type { SkillPackage } from '../domain/skill-package.ts';
|
|
4
|
+
import type { ValidationIssue } from '../domain/validation.ts';
|
|
5
|
+
import type { CommandRunner, Environment, FileSystem } from './infrastructure.ts';
|
|
6
|
+
/**
|
|
7
|
+
* What an adapter may consult while detecting its agent.
|
|
8
|
+
*
|
|
9
|
+
* Detection is the one adapter method that must look at the real world, so it gets ports
|
|
10
|
+
* rather than reaching for `node:fs` — which is what makes "Codex is installed" a fact a
|
|
11
|
+
* unit test can fabricate with a fake home directory and a fake PATH.
|
|
12
|
+
*/
|
|
13
|
+
export interface DetectionContext {
|
|
14
|
+
readonly env: Environment;
|
|
15
|
+
readonly fs: FileSystem;
|
|
16
|
+
readonly commands: CommandRunner;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The extension point of the whole system. Supporting a new coding agent means shipping one
|
|
20
|
+
* implementation of this interface — no change to core, to the installer, or to the CLI.
|
|
21
|
+
*
|
|
22
|
+
* Note what is *absent*: `install` and `uninstall`. Adapters describe and project; the single
|
|
23
|
+
* hardened installer performs every write.
|
|
24
|
+
*/
|
|
25
|
+
export interface AgentAdapter {
|
|
26
|
+
/** Stable identifier, recorded in receipts and lockfiles. Never localised. */
|
|
27
|
+
readonly id: AgentId;
|
|
28
|
+
readonly displayName: string;
|
|
29
|
+
/** Accepted on `--agent`, e.g. `claude` for `claude-code`. */
|
|
30
|
+
readonly aliases: readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Keys this adapter accepts under `agentOverrides.<id>`. Anything else is a validation
|
|
33
|
+
* error, which keeps the escape hatch narrow.
|
|
34
|
+
*/
|
|
35
|
+
readonly overrideKeys: readonly string[];
|
|
36
|
+
/** Evidence-based detection, so `doctor` can explain its conclusion. */
|
|
37
|
+
detect(ctx: DetectionContext): Promise<AgentDetection>;
|
|
38
|
+
/**
|
|
39
|
+
* Where this agent keeps packages of one kind, and whether one package is a directory or
|
|
40
|
+
* a single file there. The only place a path convention is written down.
|
|
41
|
+
*
|
|
42
|
+
* Returns `undefined` when the agent has no concept of that kind — installs targeting it
|
|
43
|
+
* are then reported as skipped rather than written somewhere invented.
|
|
44
|
+
*/
|
|
45
|
+
locationFor(kind: PackageKind, scope: InstallScope, ctx: LocationContext): AgentLocation | undefined;
|
|
46
|
+
/** Pure projection of a neutral package onto this agent's on-disk shape. */
|
|
47
|
+
layoutFor(pkg: SkillPackage): AgentLayout;
|
|
48
|
+
/** Agent-specific package checks, e.g. frontmatter this agent cannot accept. */
|
|
49
|
+
validate(pkg: SkillPackage): readonly ValidationIssue[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Registry of known adapters. Built-in adapters are registered by the CLI's composition
|
|
53
|
+
* root; a third-party adapter package is registered the same way, which is what keeps
|
|
54
|
+
* "add an agent without touching core" true.
|
|
55
|
+
*/
|
|
56
|
+
export declare class AgentCatalog {
|
|
57
|
+
private readonly adapters;
|
|
58
|
+
register(adapter: AgentAdapter): this;
|
|
59
|
+
all(): readonly AgentAdapter[];
|
|
60
|
+
ids(): readonly AgentId[];
|
|
61
|
+
/** Resolves an id or an alias, case-insensitively. */
|
|
62
|
+
find(idOrAlias: string): AgentAdapter | undefined;
|
|
63
|
+
has(id: AgentId): boolean;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=agent-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-adapter.d.ts","sour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AAS,eAAe,EAAE,CAAC;CACzD;AAED;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAE7D,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAKrC,GAAG,IAAI,SAAS,YAAY,EAAE;IAI9B,GAAG,IAAI,SAAS,OAAO,EAAE;IAIzB,sDAAsD;IACtD,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IASjD,GAAG,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO;CAG1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry of known adapters. Built-in adapters are registered by the CLI's composition
|
|
3
|
+
* root; a third-party adapter package is registered the same way, which is what keeps
|
|
4
|
+
* "add an agent without touching core" true.
|
|
5
|
+
*/
|
|
6
|
+
export class AgentCatalog {
|
|
7
|
+
adapters = new Map();
|
|
8
|
+
register(adapter) {
|
|
9
|
+
this.adapters.set(adapter.id, adapter);
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
all() {
|
|
13
|
+
return [...this.adapters.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
14
|
+
}
|
|
15
|
+
ids() {
|
|
16
|
+
return this.all().map((adapter) => adapter.id);
|
|
17
|
+
}
|
|
18
|
+
/** Resolves an id or an alias, case-insensitively. */
|
|
19
|
+
find(idOrAlias) {
|
|
20
|
+
const needle = idOrAlias.trim().toLowerCase();
|
|
21
|
+
return this.all().find((adapter) => adapter.id.toLowerCase() === needle ||
|
|
22
|
+
adapter.aliases.some((alias) => alias.toLowerCase() === needle));
|
|
23
|
+
}
|
|
24
|
+
has(id) {
|
|
25
|
+
return this.adapters.has(id);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=agent-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-adapter.js","sourceRoot":"","sources":["../../src/ports/agent-adapter.ts"],"names":[],"mappings":"AAoEA;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACN,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE7D,QAAQ,CAAC,OAAqB;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG;QACD,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,sDAAsD;IACtD,IAAI,CAAC,SAAiB;QACpB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CACpB,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM;YACnC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAClE,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,EAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentId } from '../domain/agent.ts';
|
|
2
|
+
import type { RegistryConfig } from './skill-registry.ts';
|
|
3
|
+
export interface AgentConfig {
|
|
4
|
+
readonly enabled: boolean;
|
|
5
|
+
/** Overrides the adapter's default global skill root. Escape hatch for convention drift. */
|
|
6
|
+
readonly globalRoot?: string;
|
|
7
|
+
/** Overrides the adapter's default project-relative skill directory. */
|
|
8
|
+
readonly projectRoot?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CacheConfig {
|
|
11
|
+
readonly ttlSeconds: number;
|
|
12
|
+
}
|
|
13
|
+
export interface AgentSkillsConfig {
|
|
14
|
+
readonly schemaVersion: number;
|
|
15
|
+
/** Ordered: earlier registries take precedence. */
|
|
16
|
+
readonly registries: readonly RegistryConfig[];
|
|
17
|
+
readonly agents: Readonly<Record<AgentId, AgentConfig>>;
|
|
18
|
+
readonly cache: CacheConfig;
|
|
19
|
+
}
|
|
20
|
+
/** Persisted user configuration. A port so tests never touch a real home directory. */
|
|
21
|
+
export interface ConfigStore {
|
|
22
|
+
load(): Promise<AgentSkillsConfig>;
|
|
23
|
+
save(config: AgentSkillsConfig): Promise<void>;
|
|
24
|
+
/** Absolute path of the config file, for `doctor` and error messages. */
|
|
25
|
+
location(): string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=config-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../../src/ports/config-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,uFAAuF;AACvF,MAAM,WAAW,WAAW;IAC1B,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,yEAAyE;IACzE,QAAQ,IAAI,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-store.js","sourceRoot":"","sources":["../../src/ports/config-store.ts"],"names":[],"mappings":""}
|