@themoltnet/legreffier 0.26.0 → 0.26.1

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.
Files changed (2) hide show
  1. package/dist/index.js +45 -20
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { parseArgs } from "node:util";
4
4
  import { useInput, Box, Text, useApp, render } from "ink";
5
5
  import { execFileSync } from "node:child_process";
6
- import { join } from "node:path";
6
+ import { join, dirname } from "node:path";
7
7
  import { useState, useEffect, useReducer, useRef } from "react";
8
8
  import figlet from "figlet";
9
9
  import { randomBytes as randomBytes$2, createHash } from "crypto";
@@ -5381,32 +5381,53 @@ async function pollUntil(baseUrl, workflowId, targetStatuses, onTick) {
5381
5381
  }
5382
5382
  const SKILL_VERSION = "legreffier-v0.1.0";
5383
5383
  const SKILL_FALLBACK = "main";
5384
- const SKILL_NAMES = ["legreffier", "legreffier-scan", "legreffier-explore"];
5385
- function skillUrl(name2, ref) {
5386
- return `https://raw.githubusercontent.com/getlarge/themoltnet/${ref}/.claude/skills/${name2}/SKILL.md`;
5384
+ function skillFileUrl(name2, ref, file) {
5385
+ return `https://raw.githubusercontent.com/getlarge/themoltnet/${ref}/.claude/skills/${name2}/${file}`;
5387
5386
  }
5388
- const SKILLS = SKILL_NAMES.map(
5389
- (name2) => ({
5390
- name: name2,
5391
- urls: [skillUrl(name2, SKILL_VERSION), skillUrl(name2, SKILL_FALLBACK)]
5392
- })
5393
- );
5394
- async function downloadSkills(repoDir, skillDir) {
5395
- for (const skill of SKILLS) {
5396
- let content = null;
5397
- for (const url of skill.urls) {
5387
+ const SKILLS = [
5388
+ { name: "legreffier", files: ["SKILL.md"] },
5389
+ {
5390
+ name: "legreffier-scan",
5391
+ files: [
5392
+ "SKILL.md",
5393
+ "references/scan-flows.md",
5394
+ "references/path-discovery.md",
5395
+ "references/content-templates.md"
5396
+ ]
5397
+ },
5398
+ {
5399
+ name: "legreffier-explore",
5400
+ files: ["SKILL.md", "references/exploration-pack-plan.yaml"]
5401
+ }
5402
+ ];
5403
+ async function downloadSkillFiles(skill) {
5404
+ for (const ref of [SKILL_VERSION, SKILL_FALLBACK]) {
5405
+ const files = /* @__PURE__ */ new Map();
5406
+ let ok = true;
5407
+ for (const file of skill.files) {
5398
5408
  let res;
5399
5409
  try {
5400
- res = await fetch(url);
5410
+ res = await fetch(skillFileUrl(skill.name, ref, file));
5401
5411
  } catch {
5402
- continue;
5412
+ ok = false;
5413
+ break;
5403
5414
  }
5404
- if (res.ok) {
5405
- content = await res.text();
5415
+ if (!res.ok) {
5416
+ ok = false;
5406
5417
  break;
5407
5418
  }
5419
+ files.set(file, await res.text());
5420
+ }
5421
+ if (ok) {
5422
+ return files;
5408
5423
  }
5409
- if (!content) {
5424
+ }
5425
+ return null;
5426
+ }
5427
+ async function downloadSkills(repoDir, skillDir) {
5428
+ for (const skill of SKILLS) {
5429
+ const files = await downloadSkillFiles(skill);
5430
+ if (!files) {
5410
5431
  process.stderr.write(
5411
5432
  `Warning: could not download skill "${skill.name}", skipping.
5412
5433
  `
@@ -5415,7 +5436,11 @@ async function downloadSkills(repoDir, skillDir) {
5415
5436
  }
5416
5437
  const destDir = join(repoDir, skillDir, skill.name);
5417
5438
  await mkdir(destDir, { recursive: true });
5418
- await writeFile(join(destDir, "SKILL.md"), content, "utf-8");
5439
+ for (const [file, content] of files) {
5440
+ const filePath = join(destDir, file);
5441
+ await mkdir(dirname(filePath), { recursive: true });
5442
+ await writeFile(filePath, content, "utf-8");
5443
+ }
5419
5444
  }
5420
5445
  }
5421
5446
  function buildGhTokenRule(agentName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/legreffier",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "LeGreffier — one-command accountable AI agent setup",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -33,9 +33,9 @@
33
33
  "typescript": "^5.3.3",
34
34
  "vite": "^6.0.0",
35
35
  "vitest": "^3.0.0",
36
- "@moltnet/crypto-service": "0.1.0",
37
36
  "@moltnet/api-client": "0.1.0",
38
37
  "@themoltnet/design-system": "0.3.0",
38
+ "@moltnet/crypto-service": "0.1.0",
39
39
  "@themoltnet/sdk": "0.79.0"
40
40
  },
41
41
  "scripts": {