@botdocs/cli 0.8.0 → 0.8.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/commands/ingest.js
CHANGED
|
@@ -471,17 +471,9 @@ async function uploadSkills(skills, options) {
|
|
|
471
471
|
* sees as a checkbox row in the TUI / a bullet in plain-text output. Adjacent
|
|
472
472
|
* files (scripts/, templates/, etc.) ride along with the root's selection. */
|
|
473
473
|
function isRoot(file) {
|
|
474
|
-
|
|
475
|
-
//
|
|
476
|
-
|
|
477
|
-
return true;
|
|
478
|
-
// Flat ecosystems have no adjacent sweep today, so every file IS a root.
|
|
479
|
-
// Detect by checking that the canonical filename matches the simple
|
|
480
|
-
// `<prefix>/<slug>.<ext>` shape with no extra path segment.
|
|
481
|
-
// (A claude-code-agents single-file would also match here — but we only
|
|
482
|
-
// produce AGENT.md as the root for nested layouts, so flat .md under
|
|
483
|
-
// claude-code/agents/ is treated as a root.)
|
|
484
|
-
return !cf.includes('/scripts/') && !cf.includes('/templates/') && !cf.includes('/reference/');
|
|
474
|
+
// `isRoot` is set authoritatively at discovery time (rootFile = true,
|
|
475
|
+
// swept adjacent files = false), so there's no filename guessing here.
|
|
476
|
+
return file.isRoot;
|
|
485
477
|
}
|
|
486
478
|
/** Filter a discovery file list down to the set the `--auto` / stub filter
|
|
487
479
|
* would actually upload: only ROOT files smaller than the stub threshold are
|
|
@@ -3,27 +3,13 @@ import { useMemo, useState } from 'react';
|
|
|
3
3
|
import { Box, Text, useApp, useInput } from 'ink';
|
|
4
4
|
import { theme } from './theme.js';
|
|
5
5
|
import { ecosystemLabel, formatBytes, STUB_BYTE_THRESHOLD, summaryKey, } from '../../lib/ingest-discover.js';
|
|
6
|
-
/** A file is a "root" — selectable at the skill level —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
/** A file is a "root" — selectable at the skill level — when discovery marked
|
|
7
|
+
* it as the skill's primary file. Root files are the only ones surfaced in the
|
|
8
|
+
* TUI; adjacent files (scripts/, templates/) ride along when their skill is
|
|
9
|
+
* toggled. The `isRoot` flag is set authoritatively in `discoverSkills`, so
|
|
10
|
+
* the renderer never has to guess from the filename. */
|
|
10
11
|
function isRootFile(file) {
|
|
11
|
-
|
|
12
|
-
// claude/<slug>/SKILL.md or claude-code/agents/<slug>/AGENT.md are nested
|
|
13
|
-
// root files; everything else is flat (filename matches canonical exactly
|
|
14
|
-
// and ends with the ecosystem's primary extension).
|
|
15
|
-
if (cf.endsWith('/SKILL.md'))
|
|
16
|
-
return true;
|
|
17
|
-
if (cf.endsWith('/AGENT.md'))
|
|
18
|
-
return true;
|
|
19
|
-
// For flat ecosystems (claude-code commands, cursor rules, etc.) there's
|
|
20
|
-
// no adjacent sweep today, so every discovered file IS a root.
|
|
21
|
-
if (!cf.endsWith('/SKILL.md') && !cf.endsWith('/AGENT.md')) {
|
|
22
|
-
// Heuristic: if this file's slug + scope appears exactly once in the
|
|
23
|
-
// discovery, treat it as the root.
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
12
|
+
return file.isRoot;
|
|
27
13
|
}
|
|
28
14
|
/** Group files by ecosystem (preserving order) and emit a flat row list with
|
|
29
15
|
* one section header per ecosystem followed by its skill rows. Empty
|
|
@@ -36,6 +36,13 @@ export interface DiscoveredSkillFile {
|
|
|
36
36
|
/** Canonical filename for the upload payload — e.g.
|
|
37
37
|
* `claude-code/commands/foo.md`, `claude/<slug>/SKILL.md`, etc. */
|
|
38
38
|
canonicalFilename: string;
|
|
39
|
+
/** True for the skill's primary file (SKILL.md / AGENT.md / a flat .md),
|
|
40
|
+
* false for adjacent files swept in from the skill directory
|
|
41
|
+
* (scripts/, templates/, etc.). Set authoritatively at discovery time —
|
|
42
|
+
* the TUI and plain-text renderers list ONE row per skill by filtering to
|
|
43
|
+
* `isRoot`, and adjacent files ride along when their root is selected.
|
|
44
|
+
* Marking it here avoids fragile filename-suffix guessing downstream. */
|
|
45
|
+
isRoot: boolean;
|
|
39
46
|
}
|
|
40
47
|
/** Per-skill aggregate stats produced by discovery — surfaced in the TUI and
|
|
41
48
|
* the plain-text fallback so the user can see how big a skill is before
|
|
@@ -171,6 +171,7 @@ export function discoverSkills(options = {}) {
|
|
|
171
171
|
content,
|
|
172
172
|
mode: safeMode(abs),
|
|
173
173
|
canonicalFilename: detector.canonicalFilename(slug),
|
|
174
|
+
isRoot: true,
|
|
174
175
|
};
|
|
175
176
|
files.push(rootFile);
|
|
176
177
|
// Per-skill summary aggregates the root file + any adjacent sweep
|
|
@@ -205,6 +206,7 @@ export function discoverSkills(options = {}) {
|
|
|
205
206
|
content: adj.content,
|
|
206
207
|
mode: adj.mode,
|
|
207
208
|
canonicalFilename: detector.canonicalAdjacentFilename(slug, adj.relPath),
|
|
209
|
+
isRoot: false,
|
|
208
210
|
});
|
|
209
211
|
summary.totalFiles += 1;
|
|
210
212
|
summary.totalBytes += adj.sizeBytes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botdocs/cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "CLI for BotDocs — author, publish, install, and sync agent skills across Claude, Claude Code, Cursor, Codex, ChatGPT, Windsurf, Copilot, Gemini, Antigravity, and OpenCode.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"botdocs",
|