awesome-agents 0.1.5 → 0.1.8
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/CHANGELOG.md +44 -0
- package/README.md +36 -9
- package/docs/cli.md +33 -7
- package/docs/plans/public-builder-profiles-agent-model-cards/plan.md +105 -0
- package/docs/product/README.md +2 -1
- package/docs/product/command-model.md +13 -12
- package/docs/product/harness-targets.md +50 -1
- package/docs/product/open-questions.md +6 -0
- package/docs/product/product-scope.md +4 -4
- package/docs/product/profile-source-format.md +29 -0
- package/docs/product/site-profiles-and-model-cards.md +135 -0
- package/package.json +4 -2
- package/scripts/release.js +0 -4
- package/src/cli.js +140 -10
- package/src/constants.js +10 -4
- package/src/help.js +13 -10
- package/src/installer.js +114 -11
- package/src/renderers.js +222 -3
- package/src/skills.js +397 -0
- package/src/source.js +26 -4
package/src/source.js
CHANGED
|
@@ -90,6 +90,7 @@ export function normalizeGithubUrl(source) {
|
|
|
90
90
|
export async function materializeSource(sourceInput, options = {}) {
|
|
91
91
|
const home = options.home ?? os.homedir();
|
|
92
92
|
const source = sourceInput;
|
|
93
|
+
const requireAgentProfileLayout = options.requireAgentProfileLayout ?? true;
|
|
93
94
|
|
|
94
95
|
if (!source) {
|
|
95
96
|
throw new Error("Specify a source. Use a local path, owner/repo, or GitHub URL.");
|
|
@@ -97,7 +98,9 @@ export async function materializeSource(sourceInput, options = {}) {
|
|
|
97
98
|
|
|
98
99
|
if (isLocalSource(source, home)) {
|
|
99
100
|
const sourcePath = path.resolve(expandHome(source, home));
|
|
100
|
-
|
|
101
|
+
if (requireAgentProfileLayout) {
|
|
102
|
+
await assertAgentProfileLayout(sourcePath);
|
|
103
|
+
}
|
|
101
104
|
return {
|
|
102
105
|
kind: "local",
|
|
103
106
|
source: sourcePath,
|
|
@@ -106,14 +109,20 @@ export async function materializeSource(sourceInput, options = {}) {
|
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
const
|
|
112
|
+
const { sourceWithoutRef, ref } = splitGitRef(source);
|
|
113
|
+
const gitUrl = normalizeGithubUrl(sourceWithoutRef);
|
|
110
114
|
if (!gitUrl) {
|
|
111
115
|
throw new Error(`Unsupported source "${source}". Use a local path, owner/repo, or GitHub URL.`);
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
const tmpRoot = options.tmpRoot ?? os.tmpdir();
|
|
115
119
|
const cloneDir = await fs.mkdtemp(path.join(tmpRoot, "awesome-agents-source-"));
|
|
116
|
-
const
|
|
120
|
+
const cloneArgs = ["clone", "--depth=1"];
|
|
121
|
+
if (ref) {
|
|
122
|
+
cloneArgs.push("--branch", ref);
|
|
123
|
+
}
|
|
124
|
+
cloneArgs.push(gitUrl, cloneDir);
|
|
125
|
+
const clone = spawnSync("git", cloneArgs, {
|
|
117
126
|
encoding: "utf8"
|
|
118
127
|
});
|
|
119
128
|
|
|
@@ -123,7 +132,9 @@ export async function materializeSource(sourceInput, options = {}) {
|
|
|
123
132
|
throw new Error(`Could not clone ${source}: ${detail}`);
|
|
124
133
|
}
|
|
125
134
|
|
|
126
|
-
|
|
135
|
+
if (requireAgentProfileLayout) {
|
|
136
|
+
await assertAgentProfileLayout(cloneDir);
|
|
137
|
+
}
|
|
127
138
|
|
|
128
139
|
return {
|
|
129
140
|
kind: "git",
|
|
@@ -136,6 +147,17 @@ export async function materializeSource(sourceInput, options = {}) {
|
|
|
136
147
|
};
|
|
137
148
|
}
|
|
138
149
|
|
|
150
|
+
function splitGitRef(source) {
|
|
151
|
+
const hashIndex = source.lastIndexOf("#");
|
|
152
|
+
if (hashIndex <= 0 || hashIndex === source.length - 1) {
|
|
153
|
+
return { sourceWithoutRef: source, ref: undefined };
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
sourceWithoutRef: source.slice(0, hashIndex),
|
|
157
|
+
ref: source.slice(hashIndex + 1)
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
139
161
|
async function assertAgentProfileLayout(sourcePath) {
|
|
140
162
|
const entries = await discoverProfileEntries(sourcePath);
|
|
141
163
|
if (entries.length === 0) {
|