kradle 0.6.11 → 0.6.13
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 +2 -0
- package/dist/commands/agent/list.js +10 -2
- package/dist/commands/ai-docs/sync.js +9 -4
- package/dist/commands/init.js +4 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/static/ai_docs/LLM_CLI_REFERENCE.md +4 -2
- package/static/project_template/CLAUDE.md +0 -1
package/README.md
CHANGED
|
@@ -411,6 +411,8 @@ List all agents registered in the system with their model and pricing informatio
|
|
|
411
411
|
kradle agent list
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
+
Agents whose model is no longer listed on OpenRouter are considered unavailable and hidden from the table.
|
|
415
|
+
|
|
414
416
|
## AI Docs Commands
|
|
415
417
|
|
|
416
418
|
Output LLM-focused documentation to stdout, or sync local AI docs with the latest version from the CLI.
|
|
@@ -57,8 +57,16 @@ export default class List extends Command {
|
|
|
57
57
|
this.log(pc.blue(">> Loading agents..."));
|
|
58
58
|
const [agents, pricing] = await Promise.all([api.listKradleAgents(), fetchOpenRouterPricing()]);
|
|
59
59
|
agents.sort((a, b) => a.username?.localeCompare(b.username || "") || 0);
|
|
60
|
+
// Drop agents whose model is no longer listed on OpenRouter. Skip filtering if the
|
|
61
|
+
// pricing fetch failed (empty map) so a transient outage doesn't hide everything.
|
|
62
|
+
const visibleAgents = pricing.size === 0
|
|
63
|
+
? agents
|
|
64
|
+
: agents.filter((agent) => {
|
|
65
|
+
const model = agent.agentConfig && "model" in agent.agentConfig ? agent.agentConfig.model : "";
|
|
66
|
+
return !model || pricing.has(model);
|
|
67
|
+
});
|
|
60
68
|
// Calculate column widths
|
|
61
|
-
const rows =
|
|
69
|
+
const rows = visibleAgents.map((agent) => {
|
|
62
70
|
const username = agent.username || "";
|
|
63
71
|
const model = agent.agentConfig && "model" in agent.agentConfig ? agent.agentConfig.model : "";
|
|
64
72
|
const costs = model ? pricing.get(model) : undefined;
|
|
@@ -72,7 +80,7 @@ export default class List extends Command {
|
|
|
72
80
|
const modelWidth = Math.max("Model".length, ...rows.map((r) => r.model.length));
|
|
73
81
|
const inputWidth = Math.max("Input/MTok".length, ...rows.map((r) => r.inputRaw.length));
|
|
74
82
|
const outputWidth = Math.max("Output/MTok".length, ...rows.map((r) => r.outputRaw.length));
|
|
75
|
-
this.log(pc.bold(`\nFound ${
|
|
83
|
+
this.log(pc.bold(`\nFound ${visibleAgents.length} agents:\n`));
|
|
76
84
|
// Header
|
|
77
85
|
const header = ` ${pc.bold("Agent".padEnd(nameWidth))} ${pc.bold("Model".padEnd(modelWidth))} ${pc.bold("Input/MTok".padEnd(inputWidth))} ${pc.bold("Output/MTok".padEnd(outputWidth))}`;
|
|
78
86
|
this.log(header);
|
|
@@ -4,8 +4,13 @@ import { Command, Flags } from "@oclif/core";
|
|
|
4
4
|
import enquirer from "enquirer";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { getStaticResourcePath } from "../../lib/utils.js";
|
|
7
|
-
// Files that should be synced on update (documentation files only)
|
|
8
|
-
|
|
7
|
+
// Files that should be synced on update (documentation files only).
|
|
8
|
+
// CLAUDE.md is a verbatim copy of AGENTS.md — the template lives only at
|
|
9
|
+
// project_template/AGENTS.md and we mirror it into CLAUDE.md in the target.
|
|
10
|
+
const SYNC_FILES = [
|
|
11
|
+
{ filename: "AGENTS.md", templateFilename: "AGENTS.md" },
|
|
12
|
+
{ filename: "CLAUDE.md", templateFilename: "AGENTS.md" },
|
|
13
|
+
];
|
|
9
14
|
export default class Sync extends Command {
|
|
10
15
|
static description = "Sync project AI docs (AGENTS.md, CLAUDE.md) to the latest version from the CLI";
|
|
11
16
|
static examples = [
|
|
@@ -32,8 +37,8 @@ export default class Sync extends Command {
|
|
|
32
37
|
const templateDir = getStaticResourcePath("project_template");
|
|
33
38
|
const cwd = process.cwd();
|
|
34
39
|
const comparisons = [];
|
|
35
|
-
for (const filename of SYNC_FILES) {
|
|
36
|
-
const templatePath = path.join(templateDir,
|
|
40
|
+
for (const { filename, templateFilename } of SYNC_FILES) {
|
|
41
|
+
const templatePath = path.join(templateDir, templateFilename);
|
|
37
42
|
const localPath = path.join(cwd, filename);
|
|
38
43
|
let templateContent;
|
|
39
44
|
let localContent = null;
|
package/dist/commands/init.js
CHANGED
|
@@ -120,6 +120,10 @@ export default class Init extends Command {
|
|
|
120
120
|
const sourceEnvContent = await fs.readFile(sourceEnvPath, "utf-8");
|
|
121
121
|
const updatedEnvContent = `${sourceEnvContent}\nKRADLE_API_KEY=${apiKey}`;
|
|
122
122
|
await fs.writeFile(destEnvPath, updatedEnvContent);
|
|
123
|
+
// CLAUDE.md is a verbatim copy of AGENTS.md — Claude Code no longer
|
|
124
|
+
// follows @AGENTS.md imports reliably, so we duplicate the content.
|
|
125
|
+
const agentsContent = await fs.readFile(path.join(templateDir, "AGENTS.md"), "utf-8");
|
|
126
|
+
await fs.writeFile(path.join(targetDir, "CLAUDE.md"), agentsContent);
|
|
123
127
|
},
|
|
124
128
|
},
|
|
125
129
|
{
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1137,10 +1137,12 @@ export const config = {
|
|
|
1137
1137
|
|
|
1138
1138
|
### `kradle agent list`
|
|
1139
1139
|
|
|
1140
|
-
Lists
|
|
1140
|
+
Lists agents registered in the Kradle system with their model and pricing information.
|
|
1141
1141
|
|
|
1142
1142
|
Pricing (input/output cost per million tokens) is fetched from the OpenRouter API. Models without pricing data show `-`.
|
|
1143
1143
|
|
|
1144
|
+
Agents whose model is no longer listed on OpenRouter (deprecated/unavailable) are hidden from the table. If the OpenRouter pricing fetch fails entirely, this filtering is skipped so the command still shows the full list during transient outages.
|
|
1145
|
+
|
|
1144
1146
|
**Usage:**
|
|
1145
1147
|
```bash
|
|
1146
1148
|
kradle agent list
|
|
@@ -1148,7 +1150,7 @@ kradle agent list
|
|
|
1148
1150
|
|
|
1149
1151
|
**Output format:**
|
|
1150
1152
|
```
|
|
1151
|
-
Found
|
|
1153
|
+
Found 430 agents:
|
|
1152
1154
|
|
|
1153
1155
|
Agent Model Input/MTok Output/MTok
|
|
1154
1156
|
───────────────────────────── ─────────────────────────── ────────── ───────────
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@AGENTS.md
|