@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.
- package/README.md +310 -117
- package/app-client.js +95 -9
- package/package.json +2 -2
- package/src/api.js +154 -15
- package/src/authoring-skills.js +2 -6
- package/src/commands/app-init.js +1 -1
- package/src/commands/approval-wait.js +215 -0
- package/src/commands/flow-init.js +1 -1
- package/src/commands/init.js +1 -1
- package/src/commands/permissions.js +47 -0
- package/src/commands/run-follow.js +68 -0
- package/src/commands/session-approve.js +22 -3
- package/src/commands/session.js +103 -0
- package/src/commands/skill.js +28 -19
- package/src/commands/{job-run.js → task-run.js} +36 -31
- package/src/commands/tool.js +23 -5
- package/src/commands/whoami.js +38 -0
- package/src/exit.js +6 -2
- package/src/help.js +143 -22
- package/src/index.js +127 -60
- package/src/prompt.js +9 -0
- package/src/verbs.js +6 -1
- package/verbs.json +435 -13
- package/src/commands/agent-skill-install.js +0 -64
- package/src/installed-skill.js +0 -55
package/src/installed-skill.js
DELETED
|
@@ -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
|
-
}
|