workspace-architect 2.0.5 → 2.1.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/README.md +8 -5
- package/assets-manifest.json +536 -536
- package/bin/cli.js +37 -2
- package/package.json +2 -1
package/bin/cli.js
CHANGED
|
@@ -16,6 +16,40 @@ const MANIFEST_PATH = path.join(ROOT_DIR, 'assets-manifest.json');
|
|
|
16
16
|
// Check if running in local development mode (assets folder exists)
|
|
17
17
|
const IS_LOCAL = await fs.pathExists(ASSETS_DIR);
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Normalize collection items to flat array format for processing.
|
|
21
|
+
* Supports both old flat array format and new nested object format.
|
|
22
|
+
*
|
|
23
|
+
* Old format: ["instructions:reactjs", "prompts:code-review"]
|
|
24
|
+
* New format: { "instructions": ["reactjs"], "prompts": ["code-review"] }
|
|
25
|
+
*
|
|
26
|
+
* @param {Array|Object} items - Collection items in either format
|
|
27
|
+
* @returns {Array} Flat array of items in "type:name" format
|
|
28
|
+
*/
|
|
29
|
+
function normalizeCollectionItems(items) {
|
|
30
|
+
if (!items) return [];
|
|
31
|
+
|
|
32
|
+
// If it's already an array (old format), return as-is
|
|
33
|
+
if (Array.isArray(items)) {
|
|
34
|
+
return items;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// If it's an object (new format), convert to flat array
|
|
38
|
+
if (typeof items === 'object') {
|
|
39
|
+
const flatItems = [];
|
|
40
|
+
for (const [type, names] of Object.entries(items)) {
|
|
41
|
+
if (Array.isArray(names)) {
|
|
42
|
+
for (const name of names) {
|
|
43
|
+
flatItems.push(`${type}:${name}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return flatItems;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
|
|
19
53
|
program
|
|
20
54
|
.name('workspace-architect')
|
|
21
55
|
.description('CLI to download GitHub Copilot instructions, prompts, and agents (alias: wsa)')
|
|
@@ -178,7 +212,8 @@ async function downloadAsset(id, options) {
|
|
|
178
212
|
}
|
|
179
213
|
|
|
180
214
|
const collectionContent = await fs.readJson(sourcePath);
|
|
181
|
-
|
|
215
|
+
const rawItems = collectionContent.items || (Array.isArray(collectionContent) ? collectionContent : []);
|
|
216
|
+
items = normalizeCollectionItems(rawItems);
|
|
182
217
|
} else {
|
|
183
218
|
const manifest = await getManifest();
|
|
184
219
|
const asset = manifest.assets[type]?.[name];
|
|
@@ -187,7 +222,7 @@ async function downloadAsset(id, options) {
|
|
|
187
222
|
throw new Error(`Collection not found: ${id}`);
|
|
188
223
|
}
|
|
189
224
|
|
|
190
|
-
items = asset.items || [];
|
|
225
|
+
items = normalizeCollectionItems(asset.items || []);
|
|
191
226
|
}
|
|
192
227
|
|
|
193
228
|
console.log(chalk.blue(`Downloading collection: ${name}`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspace-architect",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A comprehensive library of specialized AI agents and personas for GitHub Copilot, ranging from architectural planning and specific tech stacks to advanced cognitive reasoning models.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"workspace-architect": "./bin/cli.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"test:local": "node bin/cli.js list && node bin/cli.js download instructions a11y --dry-run",
|
|
12
12
|
"analyze": "node scripts/analyze-collections.js",
|
|
13
13
|
"generate-manifest": "node scripts/generate-manifest.js",
|
|
14
|
+
"migrate-collections": "node scripts/migrate-collections-format.js",
|
|
14
15
|
"prepublishOnly": "npm run generate-manifest",
|
|
15
16
|
"fetch-upstream": "node scripts/fetch-upstream-assets.js",
|
|
16
17
|
"sync-agents": "node scripts/sync-agents.js",
|