@junoflow/cli 0.14.0 → 0.17.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.
@@ -1,55 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { homedir } from 'node:os';
3
- import { dirname, join, resolve } from 'node:path';
4
-
5
- /** Where `juno agent-skill install` writes the skill, relative to a root. */
6
- export const SKILL_DIR = join('.claude', 'skills', 'juno');
7
-
8
- const VERSION_LINE = /^\s*(?:<!--\s*)?juno-skill-version:\s*"?([^"\s]+)"?/m;
9
-
10
- /**
11
- * installedSkill finds the Juno skill a harness would load: SKILL.md under
12
- * `.claude/skills/juno` in the current directory or the nearest parent that
13
- * has one, then in the home directory. It answers the first file found and the
14
- * version it records (null when it records none), or null when there is no
15
- * file. A file that cannot be read counts as absent: the check it serves is a
16
- * courtesy, never a failure.
17
- */
18
- export async function installedSkill(cwd, env = process.env) {
19
- const candidates = [];
20
- let dir = resolve(cwd);
21
- for (;;) {
22
- candidates.push(join(dir, SKILL_DIR, 'SKILL.md'));
23
- const parent = dirname(dir);
24
- if (parent === dir) break;
25
- dir = parent;
26
- }
27
- candidates.push(join(env.HOME || homedir(), SKILL_DIR, 'SKILL.md'));
28
-
29
- for (const path of candidates) {
30
- let text;
31
- try {
32
- text = await readFile(path, 'utf8');
33
- } catch {
34
- continue;
35
- }
36
- return { path, version: VERSION_LINE.exec(text)?.[1] ?? null };
37
- }
38
- return null;
39
- }
40
-
41
- /**
42
- * warnIfStale says on stderr when the installed skill records a version other
43
- * than the one the instance serves (`agent_skill_version` on GET /api/skills).
44
- * Silent when either side has none.
45
- */
46
- export async function warnIfStale(index, target, io) {
47
- const served = index?.agent_skill_version;
48
- if (!served) return;
49
- const installed = await installedSkill(io.cwd, io.env);
50
- if (!installed?.version || installed.version === served) return;
51
- io.warn(
52
- `the installed Juno skill (${installed.path}) is version ${installed.version}; ` +
53
- `${target} serves ${served} — run \`juno agent-skill install\` to update it`
54
- );
55
- }