@danieldeusing/seedr 0.1.92 → 0.1.94
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/{chunk-XNSAC6CK.js → chunk-PEGEA2KN.js} +100 -75
- package/dist/cli.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/config/registry.ts
|
|
4
4
|
import { readFile as readFile3, readdir, writeFile as writeFile2, mkdir as mkdir2, mkdtemp, rm as rm2 } from "fs/promises";
|
|
5
|
-
import { existsSync as
|
|
5
|
+
import { existsSync as existsSync11 } from "fs";
|
|
6
6
|
import { tmpdir } from "os";
|
|
7
|
-
import { join as
|
|
7
|
+
import { join as join13, dirname as dirname6 } from "path";
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
9
9
|
|
|
10
10
|
// ../registry-ops/src/paths.ts
|
|
@@ -23,6 +23,9 @@ var KNOWN_TYPES = new Set(ALL_TYPES);
|
|
|
23
23
|
function typeDirName(type) {
|
|
24
24
|
return type === "settings" || type === "mcp" ? type : `${type}s`;
|
|
25
25
|
}
|
|
26
|
+
function mainFileName(type) {
|
|
27
|
+
return type === "skill" ? "SKILL.md" : `${type}.md`;
|
|
28
|
+
}
|
|
26
29
|
|
|
27
30
|
// ../registry-ops/src/agents.ts
|
|
28
31
|
var CANONICAL_AGENTS = ["claude", "copilot", "antigravity", "codex", "opencode"];
|
|
@@ -58,7 +61,7 @@ function isFirstParty(sourceType) {
|
|
|
58
61
|
|
|
59
62
|
// ../registry-ops/src/fsPaths.ts
|
|
60
63
|
import { existsSync, readFileSync } from "fs";
|
|
61
|
-
import { join } from "path";
|
|
64
|
+
import { dirname, join } from "path";
|
|
62
65
|
var REPO_CONFIG_FILE = "seedr.config.json";
|
|
63
66
|
function resolveRegistryDir(repoRoot) {
|
|
64
67
|
const config = join(repoRoot, REPO_CONFIG_FILE);
|
|
@@ -77,12 +80,30 @@ import { createHash } from "crypto";
|
|
|
77
80
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "fs";
|
|
78
81
|
import { join as join2, relative } from "path";
|
|
79
82
|
|
|
83
|
+
// ../registry-ops/src/localSource.ts
|
|
84
|
+
import { createHash as createHash2 } from "crypto";
|
|
85
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync } from "fs";
|
|
86
|
+
import { basename, join as join3, relative as relative2 } from "path";
|
|
87
|
+
|
|
88
|
+
// ../registry-ops/src/gitIgnore.ts
|
|
89
|
+
import { spawnSync } from "child_process";
|
|
90
|
+
|
|
91
|
+
// ../registry-ops/src/localSources.ts
|
|
92
|
+
import { existsSync as existsSync4, mkdirSync, readFileSync as readFileSync4, writeFileSync } from "fs";
|
|
93
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
94
|
+
var LOCAL_SOURCES_FILE = join4(".seedr", "local-sources.json");
|
|
95
|
+
|
|
96
|
+
// ../registry-ops/src/sourceDiff.ts
|
|
97
|
+
import { spawnSync as spawnSync2 } from "child_process";
|
|
98
|
+
import { existsSync as existsSync5, statSync as statSync2 } from "fs";
|
|
99
|
+
import { basename as basename2, join as join5 } from "path";
|
|
100
|
+
|
|
80
101
|
// ../registry-ops/src/read.ts
|
|
81
|
-
import { existsSync as
|
|
82
|
-
import { join as
|
|
102
|
+
import { existsSync as existsSync6, readdirSync as readdirSync3, readFileSync as readFileSync5 } from "fs";
|
|
103
|
+
import { join as join6 } from "path";
|
|
83
104
|
|
|
84
105
|
// ../registry-ops/src/compile.ts
|
|
85
|
-
import { mkdirSync, writeFileSync } from "fs";
|
|
106
|
+
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
86
107
|
|
|
87
108
|
// ../registry-ops/src/identity.ts
|
|
88
109
|
import { execFile } from "child_process";
|
|
@@ -90,30 +111,37 @@ import { promisify } from "util";
|
|
|
90
111
|
var execFileAsync = promisify(execFile);
|
|
91
112
|
|
|
92
113
|
// ../registry-ops/src/ops/addLocal.ts
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
|
|
114
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync4, statSync as statSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
115
|
+
import { basename as basename3, join as join8 } from "path";
|
|
116
|
+
|
|
117
|
+
// ../registry-ops/src/ops/copy.ts
|
|
118
|
+
import { copyFileSync, mkdirSync as mkdirSync3, readdirSync as readdirSync4, realpathSync, rmdirSync, rmSync, statSync as statSync3 } from "fs";
|
|
119
|
+
import { join as join7 } from "path";
|
|
96
120
|
|
|
97
121
|
// ../registry-ops/src/ops/addRemote.ts
|
|
98
|
-
import { mkdirSync as
|
|
122
|
+
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
99
123
|
|
|
100
124
|
// ../registry-ops/src/ops/remove.ts
|
|
101
125
|
import { rmSync as rmSync2 } from "fs";
|
|
102
126
|
|
|
103
127
|
// ../registry-ops/src/ops/setLabels.ts
|
|
104
|
-
import { writeFileSync as
|
|
128
|
+
import { writeFileSync as writeFileSync5 } from "fs";
|
|
129
|
+
|
|
130
|
+
// ../registry-ops/src/ops/source.ts
|
|
131
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync6, rmSync as rmSync3, statSync as statSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
132
|
+
import { basename as basename4, join as join9 } from "path";
|
|
105
133
|
|
|
106
134
|
// ../registry-ops/src/ops/update.ts
|
|
107
|
-
import { existsSync as
|
|
108
|
-
import { dirname, resolve, sep } from "path";
|
|
135
|
+
import { existsSync as existsSync9, lstatSync, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
|
|
136
|
+
import { dirname as dirname3, resolve, sep } from "path";
|
|
109
137
|
|
|
110
138
|
// ../registry-ops/src/tx.ts
|
|
111
|
-
import { existsSync as
|
|
112
|
-
import { dirname as
|
|
139
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync8, readFileSync as readFileSync6, rmSync as rmSync4, writeFileSync as writeFileSync8 } from "fs";
|
|
140
|
+
import { dirname as dirname4, join as join10, relative as relative3, resolve as resolve2 } from "path";
|
|
113
141
|
var DEFAULT_LOCK_STALE_MS = 10 * 60 * 1e3;
|
|
114
142
|
|
|
115
143
|
// ../registry-ops/src/migrate.ts
|
|
116
|
-
import { writeFileSync as
|
|
144
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
117
145
|
|
|
118
146
|
// src/utils/slug.ts
|
|
119
147
|
var SLUG_PATTERN2 = /^[a-z0-9][a-z0-9-]*$/;
|
|
@@ -130,11 +158,11 @@ function assertValidSlug(value, what = "item slug") {
|
|
|
130
158
|
}
|
|
131
159
|
|
|
132
160
|
// src/utils/digest.ts
|
|
133
|
-
import { createHash as
|
|
161
|
+
import { createHash as createHash3 } from "crypto";
|
|
134
162
|
import { readFile } from "fs/promises";
|
|
135
|
-
import { join as
|
|
163
|
+
import { join as join11 } from "path";
|
|
136
164
|
function sha256Hex(bytes) {
|
|
137
|
-
return
|
|
165
|
+
return createHash3("sha256").update(bytes).digest("hex");
|
|
138
166
|
}
|
|
139
167
|
function digestFromFileHashes(entries) {
|
|
140
168
|
const sorted = [...entries].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
@@ -150,7 +178,7 @@ async function computeContentDigest(root, relativePaths) {
|
|
|
150
178
|
const entries = await Promise.all(
|
|
151
179
|
relativePaths.map(async (relativePath) => ({
|
|
152
180
|
path: relativePath,
|
|
153
|
-
sha256: sha256Hex(await readFile(
|
|
181
|
+
sha256: sha256Hex(await readFile(join11(root, ...relativePath.split("/"))))
|
|
154
182
|
}))
|
|
155
183
|
);
|
|
156
184
|
return digestFromFileHashes(entries);
|
|
@@ -194,7 +222,7 @@ import {
|
|
|
194
222
|
} from "fs/promises";
|
|
195
223
|
import { randomBytes } from "crypto";
|
|
196
224
|
import { homedir } from "os";
|
|
197
|
-
import { basename as
|
|
225
|
+
import { basename as basename5, dirname as dirname5, join as join12, relative as relative4, resolve as resolve3, isAbsolute, sep as sep2 } from "path";
|
|
198
226
|
async function exists(path) {
|
|
199
227
|
try {
|
|
200
228
|
await access(path);
|
|
@@ -227,11 +255,11 @@ function assertSafePathSegment(value, what) {
|
|
|
227
255
|
}
|
|
228
256
|
}
|
|
229
257
|
function isStrictDescendant(root, candidate) {
|
|
230
|
-
const rel =
|
|
258
|
+
const rel = relative4(root, candidate);
|
|
231
259
|
return rel !== "" && !isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${sep2}`);
|
|
232
260
|
}
|
|
233
261
|
function isSameOrDescendant(root, candidate) {
|
|
234
|
-
return
|
|
262
|
+
return relative4(root, candidate) === "" || isStrictDescendant(root, candidate);
|
|
235
263
|
}
|
|
236
264
|
async function realpathOrNull(path) {
|
|
237
265
|
try {
|
|
@@ -250,7 +278,7 @@ async function resolveContained(root, ...segments) {
|
|
|
250
278
|
if (realRoot === null) {
|
|
251
279
|
return resolved;
|
|
252
280
|
}
|
|
253
|
-
let ancestor =
|
|
281
|
+
let ancestor = dirname5(resolved);
|
|
254
282
|
for (; ; ) {
|
|
255
283
|
const realAncestor = await realpathOrNull(ancestor);
|
|
256
284
|
if (realAncestor !== null) {
|
|
@@ -261,8 +289,8 @@ async function resolveContained(root, ...segments) {
|
|
|
261
289
|
}
|
|
262
290
|
return resolved;
|
|
263
291
|
}
|
|
264
|
-
const parent =
|
|
265
|
-
if (parent === ancestor ||
|
|
292
|
+
const parent = dirname5(ancestor);
|
|
293
|
+
if (parent === ancestor || relative4(absoluteRoot, ancestor) === "") {
|
|
266
294
|
return resolved;
|
|
267
295
|
}
|
|
268
296
|
ancestor = parent;
|
|
@@ -294,7 +322,7 @@ async function removePathEntry(path) {
|
|
|
294
322
|
return true;
|
|
295
323
|
}
|
|
296
324
|
async function moveDirectory(source, destination) {
|
|
297
|
-
await mkdir(
|
|
325
|
+
await mkdir(dirname5(destination), { recursive: true });
|
|
298
326
|
try {
|
|
299
327
|
await rename(source, destination);
|
|
300
328
|
} catch (error2) {
|
|
@@ -304,7 +332,7 @@ async function moveDirectory(source, destination) {
|
|
|
304
332
|
}
|
|
305
333
|
}
|
|
306
334
|
async function writeFileAtomic(path, data, options = {}) {
|
|
307
|
-
const tempPath =
|
|
335
|
+
const tempPath = join12(dirname5(path), `${basename5(path)}.${randomBytes(6).toString("hex")}.tmp`);
|
|
308
336
|
try {
|
|
309
337
|
await writeFile(tempPath, data, options.mode === void 0 ? {} : { mode: options.mode });
|
|
310
338
|
await rename(tempPath, path);
|
|
@@ -330,31 +358,31 @@ async function restoreFile(path, snapshot) {
|
|
|
330
358
|
await writeFileAtomic(path, snapshot.content, { mode: snapshot.mode });
|
|
331
359
|
}
|
|
332
360
|
async function installFile(source, destination, method) {
|
|
333
|
-
await ensureDir(
|
|
361
|
+
await ensureDir(dirname5(destination));
|
|
334
362
|
await removePathEntry(destination);
|
|
335
363
|
if (method === "symlink") {
|
|
336
|
-
const relPath =
|
|
364
|
+
const relPath = relative4(dirname5(destination), source);
|
|
337
365
|
await symlink(relPath, destination);
|
|
338
366
|
} else {
|
|
339
367
|
await copyFile(source, destination);
|
|
340
368
|
}
|
|
341
369
|
}
|
|
342
370
|
async function writeTextFile(path, content) {
|
|
343
|
-
await ensureDir(
|
|
371
|
+
await ensureDir(dirname5(path));
|
|
344
372
|
await writeFile(path, content, "utf-8");
|
|
345
373
|
}
|
|
346
374
|
function getAgentsPath(contentType, slug, scope, cwd) {
|
|
347
375
|
const base = scope === "user" ? homedir() : cwd;
|
|
348
|
-
return
|
|
376
|
+
return join12(base, ".agents", contentType + "s", slug);
|
|
349
377
|
}
|
|
350
378
|
async function copyDirectory(source, destination) {
|
|
351
379
|
await cp(source, destination, { recursive: true });
|
|
352
380
|
}
|
|
353
381
|
async function installDirectory(source, destination, method) {
|
|
354
|
-
await ensureDir(
|
|
382
|
+
await ensureDir(dirname5(destination));
|
|
355
383
|
await removePathEntry(destination);
|
|
356
384
|
if (method === "symlink") {
|
|
357
|
-
const relPath =
|
|
385
|
+
const relPath = relative4(dirname5(destination), source);
|
|
358
386
|
await symlink(relPath, destination);
|
|
359
387
|
} else {
|
|
360
388
|
await copyDirectory(source, destination);
|
|
@@ -465,13 +493,13 @@ function resolveItemSource(item) {
|
|
|
465
493
|
}
|
|
466
494
|
|
|
467
495
|
// src/config/registry.ts
|
|
468
|
-
var __dirname2 =
|
|
496
|
+
var __dirname2 = dirname6(fileURLToPath(import.meta.url));
|
|
469
497
|
var FETCH_TIMEOUT_MS = 15e3;
|
|
470
498
|
function findPackageRoot(startDir) {
|
|
471
499
|
let dir = startDir;
|
|
472
500
|
for (; ; ) {
|
|
473
|
-
if (
|
|
474
|
-
const parent =
|
|
501
|
+
if (existsSync11(join13(dir, "package.json"))) return dir;
|
|
502
|
+
const parent = dirname6(dir);
|
|
475
503
|
if (parent === dir) return null;
|
|
476
504
|
dir = parent;
|
|
477
505
|
}
|
|
@@ -479,7 +507,7 @@ function findPackageRoot(startDir) {
|
|
|
479
507
|
function resolveLocalRegistryPath() {
|
|
480
508
|
const packageRoot = findPackageRoot(__dirname2);
|
|
481
509
|
if (!packageRoot) return null;
|
|
482
|
-
return resolveRegistryDir(
|
|
510
|
+
return resolveRegistryDir(join13(packageRoot, "..", ".."));
|
|
483
511
|
}
|
|
484
512
|
var REGISTRY_PATH = process.env.SEEDR_REGISTRY_DIR || resolveLocalRegistryPath();
|
|
485
513
|
var DEFAULT_REGISTRY_URL = "https://raw.githubusercontent.com/danieldeusing/seedr/main/registry";
|
|
@@ -501,7 +529,7 @@ function isValidManifestIndex(value) {
|
|
|
501
529
|
async function loadFile(filename) {
|
|
502
530
|
if (REGISTRY_PATH) {
|
|
503
531
|
try {
|
|
504
|
-
return await readFile3(
|
|
532
|
+
return await readFile3(join13(REGISTRY_PATH, filename), "utf-8");
|
|
505
533
|
} catch {
|
|
506
534
|
}
|
|
507
535
|
}
|
|
@@ -534,7 +562,7 @@ async function loadIndex() {
|
|
|
534
562
|
if (cache.index) return cache.index;
|
|
535
563
|
if (REGISTRY_PATH) {
|
|
536
564
|
try {
|
|
537
|
-
const localContent = await readFile3(
|
|
565
|
+
const localContent = await readFile3(join13(REGISTRY_PATH, "manifest.json"), "utf-8");
|
|
538
566
|
const parsed = JSON.parse(localContent);
|
|
539
567
|
if (isValidManifestIndex(parsed)) {
|
|
540
568
|
cache.index = parsed;
|
|
@@ -605,7 +633,7 @@ function getItemBaseUrl(item) {
|
|
|
605
633
|
assertValidSlug(item.slug);
|
|
606
634
|
const typeDir2 = typeDirName(item.type);
|
|
607
635
|
return {
|
|
608
|
-
local: REGISTRY_PATH ?
|
|
636
|
+
local: REGISTRY_PATH ? join13(REGISTRY_PATH, typeDir2, item.slug) : null,
|
|
609
637
|
remote: `${REGISTRY_URL}/${typeDir2}/${item.slug}`,
|
|
610
638
|
rootUrl: REGISTRY_ROOT_URL,
|
|
611
639
|
revision: null
|
|
@@ -614,23 +642,20 @@ function getItemBaseUrl(item) {
|
|
|
614
642
|
const source = resolveItemSource(item);
|
|
615
643
|
return { local: null, remote: source.baseUrl, rootUrl: source.rootUrl, revision: source.revision };
|
|
616
644
|
}
|
|
617
|
-
function mainFileName(type) {
|
|
618
|
-
return type === "skill" ? "SKILL.md" : `${type}.md`;
|
|
619
|
-
}
|
|
620
645
|
async function getItemContent(item) {
|
|
621
646
|
const { local } = getItemBaseUrl(item);
|
|
622
647
|
const mainFile = mainFileName(item.type);
|
|
623
648
|
if (local) {
|
|
624
649
|
try {
|
|
625
|
-
return await readFile3(
|
|
650
|
+
return await readFile3(join13(local, mainFile), "utf-8");
|
|
626
651
|
} catch {
|
|
627
652
|
}
|
|
628
653
|
}
|
|
629
|
-
const tempRoot = await mkdtemp(
|
|
654
|
+
const tempRoot = await mkdtemp(join13(tmpdir(), "seedr-content-"));
|
|
630
655
|
try {
|
|
631
|
-
const destination =
|
|
656
|
+
const destination = join13(tempRoot, "item");
|
|
632
657
|
await fetchItemToDestination(item, destination);
|
|
633
|
-
return await readFile3(
|
|
658
|
+
return await readFile3(join13(destination, mainFile), "utf-8");
|
|
634
659
|
} finally {
|
|
635
660
|
await rm2(tempRoot, { recursive: true, force: true });
|
|
636
661
|
}
|
|
@@ -641,7 +666,7 @@ async function fetchItemFile(item, relativePath) {
|
|
|
641
666
|
const { local, remote } = getItemBaseUrl(item);
|
|
642
667
|
if (local) {
|
|
643
668
|
try {
|
|
644
|
-
return await readFile3(
|
|
669
|
+
return await readFile3(join13(local, ...segments), "utf-8");
|
|
645
670
|
} catch {
|
|
646
671
|
}
|
|
647
672
|
}
|
|
@@ -656,7 +681,7 @@ function getItemSourcePath(item) {
|
|
|
656
681
|
}
|
|
657
682
|
assertValidSlug(item.slug);
|
|
658
683
|
const typeDir2 = typeDirName(item.type);
|
|
659
|
-
return
|
|
684
|
+
return join13(REGISTRY_PATH, typeDir2, item.slug);
|
|
660
685
|
}
|
|
661
686
|
function integrityError(item, detail) {
|
|
662
687
|
return new Error(`Registry integrity error: ${item.type} "${item.slug}" \u2014 ${detail}`);
|
|
@@ -701,8 +726,8 @@ async function downloadFileSet(location, fileSet, stagingDir) {
|
|
|
701
726
|
for (const segment of segments) assertSafeNodeName(segment);
|
|
702
727
|
const url = fileSet.licenseExtra && relativePath === fileSet.licenseExtra.installAs ? `${location.rootUrl}/${fileSet.licenseExtra.file}` : `${location.remote}/${relativePath}`;
|
|
703
728
|
const content = await fetchRemoteBuffer(url);
|
|
704
|
-
const filePath =
|
|
705
|
-
await mkdir2(
|
|
729
|
+
const filePath = join13(stagingDir, ...segments);
|
|
730
|
+
await mkdir2(dirname6(filePath), { recursive: true });
|
|
706
731
|
await writeFile2(filePath, content);
|
|
707
732
|
}));
|
|
708
733
|
}
|
|
@@ -712,8 +737,8 @@ async function fetchItemToDestination(item, destPath) {
|
|
|
712
737
|
if (fileSet.digest === null && !isFirstParty(item.sourceType)) {
|
|
713
738
|
throw integrityError(item, "the registry entry carries no contentDigest; refusing to install unverifiable content");
|
|
714
739
|
}
|
|
715
|
-
await mkdir2(
|
|
716
|
-
const stagingDir = await mkdtemp(
|
|
740
|
+
await mkdir2(dirname6(destPath), { recursive: true });
|
|
741
|
+
const stagingDir = await mkdtemp(join13(dirname6(destPath), ".seedr-staging-"));
|
|
717
742
|
try {
|
|
718
743
|
await downloadFileSet(location, fileSet, stagingDir);
|
|
719
744
|
if (fileSet.digest !== null) {
|
|
@@ -732,7 +757,7 @@ async function fetchItemToDestination(item, destPath) {
|
|
|
732
757
|
|
|
733
758
|
// src/config/agents.ts
|
|
734
759
|
import { homedir as homedir2 } from "os";
|
|
735
|
-
import { join as
|
|
760
|
+
import { join as join14 } from "path";
|
|
736
761
|
var home = homedir2();
|
|
737
762
|
var SKILL_DIRECTORY = {
|
|
738
763
|
path: "skills"
|
|
@@ -741,7 +766,7 @@ var ANTIGRAVITY = {
|
|
|
741
766
|
name: "Google Antigravity",
|
|
742
767
|
shortName: "antigravity",
|
|
743
768
|
projectRoot: ".agents",
|
|
744
|
-
userRoot:
|
|
769
|
+
userRoot: join14(home, ".agents"),
|
|
745
770
|
contentTypes: { skill: SKILL_DIRECTORY }
|
|
746
771
|
};
|
|
747
772
|
var CODING_AGENTS = {
|
|
@@ -749,7 +774,7 @@ var CODING_AGENTS = {
|
|
|
749
774
|
name: "Claude Code",
|
|
750
775
|
shortName: "claude",
|
|
751
776
|
projectRoot: ".claude",
|
|
752
|
-
userRoot:
|
|
777
|
+
userRoot: join14(home, ".claude"),
|
|
753
778
|
contentTypes: {
|
|
754
779
|
skill: SKILL_DIRECTORY,
|
|
755
780
|
command: {
|
|
@@ -776,7 +801,7 @@ var CODING_AGENTS = {
|
|
|
776
801
|
name: "GitHub Copilot",
|
|
777
802
|
shortName: "copilot",
|
|
778
803
|
projectRoot: ".github",
|
|
779
|
-
userRoot:
|
|
804
|
+
userRoot: join14(home, ".github"),
|
|
780
805
|
contentTypes: { skill: SKILL_DIRECTORY }
|
|
781
806
|
},
|
|
782
807
|
antigravity: ANTIGRAVITY,
|
|
@@ -785,14 +810,14 @@ var CODING_AGENTS = {
|
|
|
785
810
|
name: "OpenAI Codex CLI",
|
|
786
811
|
shortName: "codex",
|
|
787
812
|
projectRoot: ".codex",
|
|
788
|
-
userRoot:
|
|
813
|
+
userRoot: join14(home, ".codex"),
|
|
789
814
|
contentTypes: { skill: SKILL_DIRECTORY }
|
|
790
815
|
},
|
|
791
816
|
opencode: {
|
|
792
817
|
name: "OpenCode",
|
|
793
818
|
shortName: "opencode",
|
|
794
819
|
projectRoot: ".opencode",
|
|
795
|
-
userRoot:
|
|
820
|
+
userRoot: join14(home, ".opencode"),
|
|
796
821
|
contentTypes: { skill: SKILL_DIRECTORY }
|
|
797
822
|
}
|
|
798
823
|
};
|
|
@@ -808,7 +833,7 @@ function getAgentRoot(agent, scope, cwd = process.cwd()) {
|
|
|
808
833
|
switch (scope) {
|
|
809
834
|
case "project":
|
|
810
835
|
case "local":
|
|
811
|
-
return
|
|
836
|
+
return join14(cwd, config.projectRoot);
|
|
812
837
|
case "user":
|
|
813
838
|
return config.userRoot;
|
|
814
839
|
}
|
|
@@ -817,27 +842,27 @@ function getContentPath(agent, type, scope, cwd = process.cwd()) {
|
|
|
817
842
|
const typeConfig = getContentTypeConfig(agent, type);
|
|
818
843
|
if (!typeConfig) return void 0;
|
|
819
844
|
const root = getAgentRoot(agent, scope, cwd);
|
|
820
|
-
return typeConfig.path ?
|
|
845
|
+
return typeConfig.path ? join14(root, typeConfig.path) : root;
|
|
821
846
|
}
|
|
822
847
|
function getSettingsPath(scope, cwd = process.cwd()) {
|
|
823
848
|
switch (scope) {
|
|
824
849
|
case "project":
|
|
825
|
-
return
|
|
850
|
+
return join14(cwd, ".claude/settings.json");
|
|
826
851
|
case "user":
|
|
827
|
-
return
|
|
852
|
+
return join14(home, ".claude/settings.json");
|
|
828
853
|
case "local":
|
|
829
|
-
return
|
|
854
|
+
return join14(cwd, ".claude/settings.local.json");
|
|
830
855
|
}
|
|
831
856
|
}
|
|
832
857
|
function getMcpConfigPath(agent, scope, cwd = process.cwd()) {
|
|
833
858
|
const isUser = scope === "user";
|
|
834
859
|
switch (canonicalAgent(agent) ?? agent) {
|
|
835
860
|
case "claude":
|
|
836
|
-
return isUser ?
|
|
861
|
+
return isUser ? join14(home, ".claude.json") : join14(cwd, ".mcp.json");
|
|
837
862
|
case "codex":
|
|
838
|
-
return isUser ?
|
|
863
|
+
return isUser ? join14(home, ".codex", "config.toml") : join14(cwd, ".codex", "config.toml");
|
|
839
864
|
case "opencode":
|
|
840
|
-
return isUser ?
|
|
865
|
+
return isUser ? join14(home, ".config", "opencode", "opencode.json") : join14(cwd, "opencode.json");
|
|
841
866
|
default:
|
|
842
867
|
throw new Error(`${agent} has no verified MCP configuration format`);
|
|
843
868
|
}
|
|
@@ -1016,7 +1041,7 @@ function error(message) {
|
|
|
1016
1041
|
}
|
|
1017
1042
|
|
|
1018
1043
|
// src/handlers/skill.ts
|
|
1019
|
-
import { relative as
|
|
1044
|
+
import { relative as relative5, dirname as dirname7 } from "path";
|
|
1020
1045
|
import { homedir as homedir3 } from "os";
|
|
1021
1046
|
import { readdir as readdir2, symlink as symlink2 } from "fs/promises";
|
|
1022
1047
|
import chalk2 from "chalk";
|
|
@@ -1027,18 +1052,18 @@ function getScopeRoot(scope, cwd) {
|
|
|
1027
1052
|
return scope === "user" ? homedir3() : cwd;
|
|
1028
1053
|
}
|
|
1029
1054
|
function centralSkillsDir(scope, cwd) {
|
|
1030
|
-
return
|
|
1055
|
+
return dirname7(getAgentsPath("skill", "any-slug", scope, cwd));
|
|
1031
1056
|
}
|
|
1032
1057
|
async function resolveCentralPath(slug, scope, cwd) {
|
|
1033
1058
|
const scopeRoot = getScopeRoot(scope, cwd);
|
|
1034
1059
|
const centralDir = centralSkillsDir(scope, cwd);
|
|
1035
|
-
return resolveContained(scopeRoot,
|
|
1060
|
+
return resolveContained(scopeRoot, relative5(scopeRoot, centralDir), slug);
|
|
1036
1061
|
}
|
|
1037
1062
|
async function resolveAgentSkillPath(agent, slug, scope, cwd) {
|
|
1038
1063
|
const destDir = getContentPath(agent, "skill", scope, cwd);
|
|
1039
1064
|
if (!destDir) return null;
|
|
1040
1065
|
const scopeRoot = getScopeRoot(scope, cwd);
|
|
1041
|
-
return resolveContained(scopeRoot,
|
|
1066
|
+
return resolveContained(scopeRoot, relative5(scopeRoot, destDir), slug);
|
|
1042
1067
|
}
|
|
1043
1068
|
async function installToCentralLocation(item, sourcePath, scope, force, cwd) {
|
|
1044
1069
|
const centralPath = await resolveCentralPath(item.slug, scope, cwd);
|
|
@@ -1052,9 +1077,9 @@ async function installToCentralLocation(item, sourcePath, scope, force, cwd) {
|
|
|
1052
1077
|
return { centralPath, created: !existed };
|
|
1053
1078
|
}
|
|
1054
1079
|
async function createAgentSymlink(centralPath, destPath) {
|
|
1055
|
-
await ensureDir(
|
|
1080
|
+
await ensureDir(dirname7(destPath));
|
|
1056
1081
|
await removePathEntry(destPath);
|
|
1057
|
-
const relPath =
|
|
1082
|
+
const relPath = relative5(dirname7(destPath), centralPath);
|
|
1058
1083
|
await symlink2(relPath, destPath);
|
|
1059
1084
|
}
|
|
1060
1085
|
async function installSkillForAgent(item, agent, scope, method, force, cwd, centralPath) {
|
|
@@ -1183,6 +1208,7 @@ var skillHandler = {
|
|
|
1183
1208
|
};
|
|
1184
1209
|
|
|
1185
1210
|
export {
|
|
1211
|
+
mainFileName,
|
|
1186
1212
|
isLegacyAgent,
|
|
1187
1213
|
canonicalAgent,
|
|
1188
1214
|
canonicalAgents,
|
|
@@ -1212,7 +1238,6 @@ export {
|
|
|
1212
1238
|
getItemsBySlug,
|
|
1213
1239
|
listItems2 as listItems,
|
|
1214
1240
|
searchItems,
|
|
1215
|
-
mainFileName,
|
|
1216
1241
|
getItemContent,
|
|
1217
1242
|
fetchItemFile,
|
|
1218
1243
|
getItemSourcePath,
|
package/dist/cli.js
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
warn,
|
|
58
58
|
writeFileAtomic,
|
|
59
59
|
writeTextFile
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PEGEA2KN.js";
|
|
61
61
|
|
|
62
62
|
// src/cli.ts
|
|
63
63
|
import { Command as Command5 } from "commander";
|
|
@@ -144,7 +144,7 @@ function isTelemetryDisabled(env = process.env) {
|
|
|
144
144
|
return env[TELEMETRY_OPT_OUT_VARIABLE] !== void 0;
|
|
145
145
|
}
|
|
146
146
|
function cliVersion() {
|
|
147
|
-
return true ? "0.1.
|
|
147
|
+
return true ? "0.1.94" : "dev";
|
|
148
148
|
}
|
|
149
149
|
async function sendEvent(event) {
|
|
150
150
|
try {
|
|
@@ -2214,7 +2214,7 @@ var initCommand = new Command4("init").description("Initialize coding agent conf
|
|
|
2214
2214
|
// package.json
|
|
2215
2215
|
var package_default = {
|
|
2216
2216
|
name: "@danieldeusing/seedr",
|
|
2217
|
-
version: "0.1.
|
|
2217
|
+
version: "0.1.94",
|
|
2218
2218
|
description: "Seed your projects with AI configurations",
|
|
2219
2219
|
type: "module",
|
|
2220
2220
|
bin: {
|
package/dist/index.js
CHANGED