@zebralabs/context-cli 0.1.2 → 0.1.3
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/package.json +1 -1
- package/src/context.js +10 -9
package/package.json
CHANGED
package/src/context.js
CHANGED
|
@@ -34,14 +34,14 @@ Examples (registry download):
|
|
|
34
34
|
|
|
35
35
|
Notes:
|
|
36
36
|
- Zip must contain: practices-and-standards/install.ps1
|
|
37
|
-
- Installer merges into <repo-root>/practices-and-standards/
|
|
37
|
+
- Installer merges into <repo-root>/docs/practices-and-standards/
|
|
38
38
|
`.trim() + "\n");
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function findRepoContextRoot(startDir) {
|
|
42
42
|
let dir = startDir;
|
|
43
43
|
while (true) {
|
|
44
|
-
const candidate = path.join(dir, "practices-and-standards", "context.yaml");
|
|
44
|
+
const candidate = path.join(dir, "docs", "practices-and-standards", "context.yaml");
|
|
45
45
|
if (fs.existsSync(candidate)) return dir;
|
|
46
46
|
const parent = path.dirname(dir);
|
|
47
47
|
if (parent === dir) return null;
|
|
@@ -199,7 +199,8 @@ function cmdValidate(repoRoot, ctx) {
|
|
|
199
199
|
|
|
200
200
|
function cmdCompile(repoRoot, ctx) {
|
|
201
201
|
const installed = orderInstalledPacks(ctx.installed_packs ?? [], ctx.precedence ?? []);
|
|
202
|
-
const
|
|
202
|
+
const psRoot = path.join(repoRoot, "docs", "practices-and-standards");
|
|
203
|
+
const outDir = path.join(psRoot, ".compiled");
|
|
203
204
|
fs.mkdirSync(outDir, { recursive: true });
|
|
204
205
|
|
|
205
206
|
const promptPath = path.join(outDir, "system-prompt.md");
|
|
@@ -351,7 +352,7 @@ async function fetchJson(url, token) {
|
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
function ensureContextInitialized(repoRoot, registryUrlMaybe) {
|
|
354
|
-
const psRoot = path.join(repoRoot, "practices-and-standards");
|
|
355
|
+
const psRoot = path.join(repoRoot, "docs", "practices-and-standards");
|
|
355
356
|
ensureDir(psRoot);
|
|
356
357
|
|
|
357
358
|
const ctxPath = path.join(psRoot, "context.yaml");
|
|
@@ -395,7 +396,7 @@ function upsertInstalledPack(ctxObj, packId, version) {
|
|
|
395
396
|
if (!Array.isArray(ctxObj.installed_packs)) ctxObj.installed_packs = [];
|
|
396
397
|
if (!Array.isArray(ctxObj.precedence)) ctxObj.precedence = [];
|
|
397
398
|
|
|
398
|
-
const manifest = `practices-and-standards/packs/${packId}/pack.yaml`;
|
|
399
|
+
const manifest = `docs/practices-and-standards/packs/${packId}/pack.yaml`;
|
|
399
400
|
const existing = ctxObj.installed_packs.find(p => p.id === packId);
|
|
400
401
|
|
|
401
402
|
if (existing) {
|
|
@@ -436,7 +437,7 @@ async function cmdPackInstall(repoRoot, packId, opts) {
|
|
|
436
437
|
if (!token) die("Missing required --token for registry install.");
|
|
437
438
|
|
|
438
439
|
const registry = opts.registry || ctx.registry;
|
|
439
|
-
if (!registry) die("No registry configured. Provide --registry <url> or set registry: in practices-and-standards/context.yaml");
|
|
440
|
+
if (!registry) die("No registry configured. Provide --registry <url> or set registry: in docs/practices-and-standards/context.yaml");
|
|
440
441
|
|
|
441
442
|
if (!version) {
|
|
442
443
|
const latestUrl = `${registry.replace(/\/$/, "")}/packs/${encodeURIComponent(packId)}/latest`;
|
|
@@ -538,7 +539,7 @@ async function main() {
|
|
|
538
539
|
|
|
539
540
|
if (cmd === "--version" || cmd === "-v" || cmd === "version") {
|
|
540
541
|
// Make sure package.json has version (or hardcode a constant)
|
|
541
|
-
console.log("0.1.
|
|
542
|
+
console.log("0.1.3");
|
|
542
543
|
return;
|
|
543
544
|
}
|
|
544
545
|
|
|
@@ -565,9 +566,9 @@ async function main() {
|
|
|
565
566
|
|
|
566
567
|
// Existing behavior: these require an existing context.yaml
|
|
567
568
|
const repoRoot = findRepoContextRoot(process.cwd());
|
|
568
|
-
if (!repoRoot) die("Could not find practices-and-standards/context.yaml in this directory or any parent.");
|
|
569
|
+
if (!repoRoot) die("Could not find docs/practices-and-standards/context.yaml in this directory or any parent.");
|
|
569
570
|
|
|
570
|
-
const contextPath = path.join(repoRoot, "practices-and-standards", "context.yaml");
|
|
571
|
+
const contextPath = path.join(repoRoot, "docs", "practices-and-standards", "context.yaml");
|
|
571
572
|
const ctx = readYamlFile(contextPath);
|
|
572
573
|
|
|
573
574
|
if (!ctx?.schema || ctx.schema !== "context-install/v1") {
|