@themoltnet/legreffier 0.25.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.
- package/dist/index.js +45 -20
- package/package.json +3 -3
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
|
-
|
|
5385
|
-
|
|
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 =
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
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(
|
|
5410
|
+
res = await fetch(skillFileUrl(skill.name, ref, file));
|
|
5401
5411
|
} catch {
|
|
5402
|
-
|
|
5412
|
+
ok = false;
|
|
5413
|
+
break;
|
|
5403
5414
|
}
|
|
5404
|
-
if (res.ok) {
|
|
5405
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"vitest": "^3.0.0",
|
|
36
36
|
"@moltnet/api-client": "0.1.0",
|
|
37
37
|
"@themoltnet/design-system": "0.3.0",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@moltnet/crypto-service": "0.1.0",
|
|
39
|
+
"@themoltnet/sdk": "0.79.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "vite build --watch",
|