@mnemom/mnemom 0.15.1 → 0.16.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/skills.d.ts +17 -0
- package/dist/commands/skills.js +61 -0
- package/dist/index.js +39 -0
- package/dist/lib/skills.d.ts +47 -0
- package/dist/lib/skills.js +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mnemom skills` (MNE-1324) — discover the CLI's skill surface.
|
|
3
|
+
*
|
|
4
|
+
* mnemom skills list available + planned skills (default)
|
|
5
|
+
* mnemom skills list (same)
|
|
6
|
+
* mnemom skills describe <name> usage + details for one skill
|
|
7
|
+
*
|
|
8
|
+
* Reads the registry (`lib/skills.ts`) — the single source of truth — so the
|
|
9
|
+
* discoverable surface never drifts from the actual commands. Both subcommands
|
|
10
|
+
* support `--json`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function skillsListCommand(opts: {
|
|
13
|
+
json?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
export declare function skillsDescribeCommand(name: string, opts: {
|
|
16
|
+
json?: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mnemom skills` (MNE-1324) — discover the CLI's skill surface.
|
|
3
|
+
*
|
|
4
|
+
* mnemom skills list available + planned skills (default)
|
|
5
|
+
* mnemom skills list (same)
|
|
6
|
+
* mnemom skills describe <name> usage + details for one skill
|
|
7
|
+
*
|
|
8
|
+
* Reads the registry (`lib/skills.ts`) — the single source of truth — so the
|
|
9
|
+
* discoverable surface never drifts from the actual commands. Both subcommands
|
|
10
|
+
* support `--json`.
|
|
11
|
+
*/
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
import { fmt } from "../lib/format.js";
|
|
14
|
+
import { listSkills, getSkill } from "../lib/skills.js";
|
|
15
|
+
function statusBadge(s) {
|
|
16
|
+
return s.status === "available"
|
|
17
|
+
? fmt.badge("available", "green")
|
|
18
|
+
: fmt.badge("planned", "yellow");
|
|
19
|
+
}
|
|
20
|
+
export async function skillsListCommand(opts) {
|
|
21
|
+
const skills = listSkills();
|
|
22
|
+
if (opts.json) {
|
|
23
|
+
// Plain JSON — machine-readable regardless of TTY (fmt.json is colorized).
|
|
24
|
+
console.log(JSON.stringify({ skills }, null, 2));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log(fmt.header("Mnemom CLI skills"));
|
|
28
|
+
console.log(fmt.dim(" Zero-install — run any skill with: npx @mnemom/mnemom@latest <skill>\n"));
|
|
29
|
+
for (const s of skills) {
|
|
30
|
+
console.log(` ${chalk.bold(s.name)} ${statusBadge(s)}`);
|
|
31
|
+
console.log(` ${s.summary}`);
|
|
32
|
+
}
|
|
33
|
+
console.log(`\n${fmt.dim(" Details: mnemom skills describe <name>")}`);
|
|
34
|
+
}
|
|
35
|
+
export async function skillsDescribeCommand(name, opts) {
|
|
36
|
+
const skill = getSkill(name);
|
|
37
|
+
if (!skill) {
|
|
38
|
+
// Throw — index.ts's action wrapper prints "Error: …" and exits 1. Keeps the
|
|
39
|
+
// handler pure/testable (no process.exit) and gives a discoverable hint.
|
|
40
|
+
const known = listSkills()
|
|
41
|
+
.map((s) => s.name)
|
|
42
|
+
.join(", ");
|
|
43
|
+
throw new Error(`Unknown skill "${name}". Run \`mnemom skills list\` — known skills: ${known}.`);
|
|
44
|
+
}
|
|
45
|
+
if (opts.json) {
|
|
46
|
+
console.log(JSON.stringify(skill, null, 2));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
console.log(fmt.header(`${skill.name} ${skill.status === "available" ? "(available)" : "(planned)"}`));
|
|
50
|
+
console.log(` ${skill.summary}\n`);
|
|
51
|
+
console.log(fmt.label(" Usage:", skill.usage));
|
|
52
|
+
console.log(`\n ${skill.description.replace(/\n/g, "\n ")}`);
|
|
53
|
+
if (skill.examples && skill.examples.length > 0) {
|
|
54
|
+
console.log(fmt.section(" Examples"));
|
|
55
|
+
for (const ex of skill.examples)
|
|
56
|
+
console.log(` ${chalk.cyan(ex)}`);
|
|
57
|
+
}
|
|
58
|
+
if (skill.status === "planned" && skill.ref) {
|
|
59
|
+
console.log(`\n${fmt.dim(` Planned — tracked as ${skill.ref}.`)}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { apiKeyListCommand, apiKeyCreateCommand, apiKeyRotateCommand, apiKeyRevo
|
|
|
20
20
|
import { webhooksListCommand, webhooksGetCommand, webhooksCreateCommand, webhooksUpdateCommand, webhooksDeleteCommand, webhooksRotateSecretCommand, webhooksTriggerCommand, webhooksListDeliveriesCommand, webhooksRedeliverCommand, webhooksReplayCommand, } from "./commands/webhooks.js";
|
|
21
21
|
import { listenCommand } from "./commands/listen.js";
|
|
22
22
|
import { tryMeCommand } from "./commands/try-me.js";
|
|
23
|
+
import { skillsListCommand, skillsDescribeCommand } from "./commands/skills.js";
|
|
23
24
|
program
|
|
24
25
|
.name("mnemom")
|
|
25
26
|
.description("Transparent AI agent tracing")
|
|
@@ -70,6 +71,44 @@ program
|
|
|
70
71
|
process.exit(1);
|
|
71
72
|
}
|
|
72
73
|
});
|
|
74
|
+
// ── skills (MNE-1324) — discover the zero-install skill surface ──────────────
|
|
75
|
+
const skills = program
|
|
76
|
+
.command("skills")
|
|
77
|
+
.description("List and describe the Mnemom CLI skills (npx @mnemom/mnemom@latest <skill>)");
|
|
78
|
+
// `list` is the default subcommand so bare `mnemom skills` lists. `--json` lives
|
|
79
|
+
// ONLY on the subcommands (NOT the parent): a parent-level `--json` shadows the
|
|
80
|
+
// subcommand option under commander@12 (the MNE-238 class), which silently broke
|
|
81
|
+
// `skills list --json` / `skills describe --json` in 0.16.0. `allowExcessArguments
|
|
82
|
+
// (false)` keeps the F1 fix — `skills bogus` / `skills list foo` error (exit 1)
|
|
83
|
+
// instead of silently listing.
|
|
84
|
+
skills
|
|
85
|
+
.command("list", { isDefault: true })
|
|
86
|
+
.description("List available + planned skills")
|
|
87
|
+
.option("--json", "Emit the registry as JSON")
|
|
88
|
+
.allowExcessArguments(false)
|
|
89
|
+
.action(async (opts) => {
|
|
90
|
+
try {
|
|
91
|
+
await skillsListCommand(opts);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error("Error:", error instanceof Error ? error.message : error);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
skills
|
|
99
|
+
.command("describe <name>")
|
|
100
|
+
.description("Show a skill's usage + details")
|
|
101
|
+
.option("--json", "Emit the skill as JSON")
|
|
102
|
+
.allowExcessArguments(false)
|
|
103
|
+
.action(async (name, opts) => {
|
|
104
|
+
try {
|
|
105
|
+
await skillsDescribeCommand(name, opts);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
console.error("Error:", error instanceof Error ? error.message : error);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
73
112
|
program
|
|
74
113
|
.command("status")
|
|
75
114
|
.description("Show agent status and connection info")
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill registry (MNE-1324) — the contract behind `npx @mnemom/mnemom <skill>`.
|
|
3
|
+
*
|
|
4
|
+
* A "skill" is a named, self-contained capability the CLI exposes as a verb
|
|
5
|
+
* (the Microsoft-Agent-365-style "get the thing, then call a skill" model). The
|
|
6
|
+
* registry is the single source of truth that `mnemom skills list/describe`
|
|
7
|
+
* reads, so the discoverable surface and the actual commands never drift.
|
|
8
|
+
*
|
|
9
|
+
* This is metadata only — the runnable logic for each available skill lives in
|
|
10
|
+
* its existing command (e.g. `commands/try-me.ts`); the registry just describes
|
|
11
|
+
* it and is reused, not re-implemented. `planned` entries advertise the lane's
|
|
12
|
+
* roadmap (A2 `onboard`, A4 `wrap`) without pretending to run.
|
|
13
|
+
*
|
|
14
|
+
* Drift note: the skill NAMES here are the source of truth for `skills
|
|
15
|
+
* list`/`describe`; the `usage`/`description` strings are hand-written
|
|
16
|
+
* illustrative prose (not derived from the command's option parser), so treat
|
|
17
|
+
* them as a summary, not an exhaustive flag reference — `mnemom <skill> --help`
|
|
18
|
+
* is always authoritative for the full option set.
|
|
19
|
+
*/
|
|
20
|
+
export type SkillStatus = "available" | "planned";
|
|
21
|
+
export interface Skill {
|
|
22
|
+
/** The verb: `mnemom <name>` (and `npx @mnemom/mnemom@latest <name>`). */
|
|
23
|
+
name: string;
|
|
24
|
+
/** One-line summary for `skills list`. */
|
|
25
|
+
summary: string;
|
|
26
|
+
/** Canonical invocation shown in `skills describe`. */
|
|
27
|
+
usage: string;
|
|
28
|
+
/** Longer, multi-line description for `skills describe`. */
|
|
29
|
+
description: string;
|
|
30
|
+
/** `available` = runnable today; `planned` = on the roadmap, not yet shipped. */
|
|
31
|
+
status: SkillStatus;
|
|
32
|
+
/** Copy-pasteable examples. */
|
|
33
|
+
examples?: string[];
|
|
34
|
+
/** Tracking reference (Linear id) for a planned skill. */
|
|
35
|
+
ref?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The registry. `try-me` is the first registered skill (MNE-934, shipped); it is
|
|
39
|
+
* NOT re-implemented here — `mnemom try-me <token>` keeps working exactly as
|
|
40
|
+
* before, and this entry simply makes it discoverable. `onboard`/`wrap` are the
|
|
41
|
+
* planned next skills (MNE-933 / MNE-935).
|
|
42
|
+
*/
|
|
43
|
+
export declare const SKILLS: readonly Skill[];
|
|
44
|
+
/** All registered skills, in registry order. */
|
|
45
|
+
export declare function listSkills(): readonly Skill[];
|
|
46
|
+
/** Look up a skill by its exact verb name; undefined if unknown. */
|
|
47
|
+
export declare function getSkill(name: string): Skill | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill registry (MNE-1324) — the contract behind `npx @mnemom/mnemom <skill>`.
|
|
3
|
+
*
|
|
4
|
+
* A "skill" is a named, self-contained capability the CLI exposes as a verb
|
|
5
|
+
* (the Microsoft-Agent-365-style "get the thing, then call a skill" model). The
|
|
6
|
+
* registry is the single source of truth that `mnemom skills list/describe`
|
|
7
|
+
* reads, so the discoverable surface and the actual commands never drift.
|
|
8
|
+
*
|
|
9
|
+
* This is metadata only — the runnable logic for each available skill lives in
|
|
10
|
+
* its existing command (e.g. `commands/try-me.ts`); the registry just describes
|
|
11
|
+
* it and is reused, not re-implemented. `planned` entries advertise the lane's
|
|
12
|
+
* roadmap (A2 `onboard`, A4 `wrap`) without pretending to run.
|
|
13
|
+
*
|
|
14
|
+
* Drift note: the skill NAMES here are the source of truth for `skills
|
|
15
|
+
* list`/`describe`; the `usage`/`description` strings are hand-written
|
|
16
|
+
* illustrative prose (not derived from the command's option parser), so treat
|
|
17
|
+
* them as a summary, not an exhaustive flag reference — `mnemom <skill> --help`
|
|
18
|
+
* is always authoritative for the full option set.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The registry. `try-me` is the first registered skill (MNE-934, shipped); it is
|
|
22
|
+
* NOT re-implemented here — `mnemom try-me <token>` keeps working exactly as
|
|
23
|
+
* before, and this entry simply makes it discoverable. `onboard`/`wrap` are the
|
|
24
|
+
* planned next skills (MNE-933 / MNE-935).
|
|
25
|
+
*/
|
|
26
|
+
export const SKILLS = [
|
|
27
|
+
{
|
|
28
|
+
name: "try-me",
|
|
29
|
+
status: "available",
|
|
30
|
+
summary: "Run the Mnemom Dojo onboarding for a /try-me invite token.",
|
|
31
|
+
usage: "mnemom try-me <token> [--api <url>] [--name <name>] [--resume <agent_id>] " +
|
|
32
|
+
"[--yes] [--json] [--dry-run] [--no-open] [--poll-timeout <s>]",
|
|
33
|
+
description: "Zero-install onboarding for the Mnemom Dojo: resolve a /try-me invite token, " +
|
|
34
|
+
"birth an agent identity, claim it, declare its starter alignment + protection " +
|
|
35
|
+
"cards, and report ready for the sparring sim — born → claim → declare → spar. " +
|
|
36
|
+
"Drives the dojo's HTTPS surface directly (no MCP setup required), so it runs the " +
|
|
37
|
+
"same way on any fresh machine.",
|
|
38
|
+
examples: [
|
|
39
|
+
"npx @mnemom/mnemom@latest try-me tryme_xxxxxxxxxxxx",
|
|
40
|
+
"mnemom try-me tryme_xxxxxxxxxxxx --name Atlas",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "onboard",
|
|
45
|
+
status: "planned",
|
|
46
|
+
ref: "MNE-933",
|
|
47
|
+
summary: "Self-onboard the calling agent end-to-end (scan → claim → declare → badge).",
|
|
48
|
+
usage: "mnemom onboard",
|
|
49
|
+
description: "Runs the sovereignty path for the calling agent itself: scan its trust posture, " +
|
|
50
|
+
"claim its identity, declare an alignment card, and earn a verifiable Trust Rating — " +
|
|
51
|
+
"one command, no manifest. Planned (MNE-933).",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "wrap",
|
|
55
|
+
status: "planned",
|
|
56
|
+
ref: "MNE-935",
|
|
57
|
+
summary: "Instrument an existing production agent through the Mnemom gateway.",
|
|
58
|
+
usage: "mnemom wrap",
|
|
59
|
+
description: "Points an existing agent's provider calls at the Mnemom gateway, claims/births its " +
|
|
60
|
+
"identity, and seeds starter alignment + protection cards — bring-your-own-agent " +
|
|
61
|
+
"onboarding. Planned (MNE-935).",
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
/** All registered skills, in registry order. */
|
|
65
|
+
export function listSkills() {
|
|
66
|
+
return SKILLS;
|
|
67
|
+
}
|
|
68
|
+
/** Look up a skill by its exact verb name; undefined if unknown. */
|
|
69
|
+
export function getSkill(name) {
|
|
70
|
+
return SKILLS.find((s) => s.name === name);
|
|
71
|
+
}
|