@mostra/cli 0.14.0 → 0.15.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/bin.js +2 -2
- package/dist/{bootstrap-3_Tdfdg7.js → bootstrap-CYgyuZFk.js} +8 -4
- package/dist/bootstrap-CYgyuZFk.js.map +1 -0
- package/dist/bootstrap-DHnt5zU_.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/reference/cli.md +147 -5
- package/dist/reference/diagnostics.json +234 -0
- package/dist/reference/errors/MOSTRA_LICENSE_ACCEPT_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_LICENSE_MISMATCH.md +23 -0
- package/dist/reference/errors/MOSTRA_LICENSE_UNACCEPTED.md +23 -0
- package/dist/reference/errors/MOSTRA_LICENSE_UNDECLARED.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_ADDRESS_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_CSS_UNIMPORTED.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_FETCH_FAILED.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_FILE_EXISTS.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_ITEM_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_ITEM_NOT_FOUND.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_NOT_APPLIED.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_OFFLINE.md +23 -0
- package/dist/reference/errors/MOSTRA_PACK_TARGET_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_CONFLICT.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_CONTRACT_UNSUPPORTED.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_ENTRY_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_EXPORTER_UNKNOWN.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_FAILED.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_MANIFEST_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_MANIFEST_WARNING.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_NOT_A_PLUGIN.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_NOT_INSTALLED.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_OPTIONS_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_PLATFORM_UNSUPPORTED.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_SCOPE_INVALID.md +23 -0
- package/dist/reference/errors/MOSTRA_PLUGIN_SHADOWED.md +23 -0
- package/dist/{run-CtR0PFMj.js → run-BsUzIBQj.js} +437 -29
- package/dist/run-BsUzIBQj.js.map +1 -0
- package/dist/run-c8U3GkBy.js +1 -0
- package/dist/skill/SKILL.md +4 -2
- package/dist/skill/references/mcp.md +2 -2
- package/dist/skill/references/plugins.md +51 -0
- package/package.json +7 -5
- package/src/command.ts +2 -0
- package/src/commands/authoring.ts +129 -18
- package/src/commands/index.ts +14 -3
- package/src/commands/plugins.ts +219 -0
- package/src/exit.ts +7 -0
- package/src/plugin-commands.ts +170 -0
- package/src/run.ts +64 -4
- package/dist/bootstrap-3_Tdfdg7.js.map +0 -1
- package/dist/bootstrap-C9a2gSWf.js +0 -1
- package/dist/run-CtR0PFMj.js.map +0 -1
- package/dist/run-NWeQcyh9.js +0 -1
package/dist/bin.js
CHANGED
|
@@ -42,7 +42,7 @@ async function refuseOldNode() {
|
|
|
42
42
|
}
|
|
43
43
|
const code = nodeTooOld(process.versions.node) ? await refuseOldNode() : await start();
|
|
44
44
|
async function start() {
|
|
45
|
-
const { bootstrap } = await import("./bootstrap-
|
|
45
|
+
const { bootstrap } = await import("./bootstrap-DHnt5zU_.js");
|
|
46
46
|
return await bootstrap({
|
|
47
47
|
argv: process.argv.slice(2),
|
|
48
48
|
env: process.env,
|
|
@@ -54,7 +54,7 @@ async function start() {
|
|
|
54
54
|
},
|
|
55
55
|
stderrTty: process.stderr.isTTY === true,
|
|
56
56
|
terminal: process.stdin.isTTY === true || process.stdout.isTTY === true || process.stderr.isTTY === true
|
|
57
|
-
}) ?? await (await import("./run-
|
|
57
|
+
}) ?? await (await import("./run-c8U3GkBy.js")).run({
|
|
58
58
|
argv: process.argv.slice(2),
|
|
59
59
|
env: process.env,
|
|
60
60
|
cwd: process.cwd(),
|
|
@@ -64,7 +64,10 @@ const BY_AREA = {
|
|
|
64
64
|
ARTIFACT: EXIT.failure,
|
|
65
65
|
CLI: EXIT.usage,
|
|
66
66
|
REMOTE: EXIT.environment,
|
|
67
|
-
TEAM: EXIT.failure
|
|
67
|
+
TEAM: EXIT.failure,
|
|
68
|
+
PLUGIN: EXIT.failure,
|
|
69
|
+
PACK: EXIT.failure,
|
|
70
|
+
LICENSE: EXIT.failure
|
|
68
71
|
};
|
|
69
72
|
/** Codes whose exit code isn't their area's. */
|
|
70
73
|
const BY_CODE = {
|
|
@@ -81,7 +84,8 @@ const BY_CODE = {
|
|
|
81
84
|
MOSTRA_PUBLISH_ID_CONFLICT: EXIT.failure,
|
|
82
85
|
MOSTRA_HOME_INTEGRITY: EXIT.failure,
|
|
83
86
|
MOSTRA_HOME_NOT_ALWAYS_ON: EXIT.ok,
|
|
84
|
-
MOSTRA_VERIFY_CRASHED: EXIT.environment
|
|
87
|
+
MOSTRA_VERIFY_CRASHED: EXIT.environment,
|
|
88
|
+
MOSTRA_LICENSE_ACCEPT_INVALID: EXIT.usage
|
|
85
89
|
};
|
|
86
90
|
/** The exit code a diagnostic ends a command with. An unknown area is an environment error. */
|
|
87
91
|
function exitCodeFor(code) {
|
|
@@ -419,6 +423,6 @@ async function runInBundle(io) {
|
|
|
419
423
|
});
|
|
420
424
|
}
|
|
421
425
|
//#endregion
|
|
422
|
-
export { GLOBAL_FLAGS as a,
|
|
426
|
+
export { GLOBAL_FLAGS as a, globalFlags as c, usage as d, EXIT as f, defineCommand as h, servesBeforeBundle as i, parseCommandLine as l, commandName as m, needsBootstrap as n, commandWords as o, exitCodeFor as p, progressReporter as r, durationMs as s, bootstrap as t, topWords as u };
|
|
423
427
|
|
|
424
|
-
//# sourceMappingURL=bootstrap-
|
|
428
|
+
//# sourceMappingURL=bootstrap-CYgyuZFk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-CYgyuZFk.js","names":[],"sources":["../src/command.ts","../src/exit.ts","../src/parse.ts","../src/bootstrap.ts"],"sourcesContent":["/**\n * What a command is (D140 items 13, 16): a definition the parser, the help, the reference page,\n * `--help --json`, telemetry's command names and the contract tests all read. Commands never\n * print or exit on their own; they return a result (or throw a diagnostic) and the runner decides\n * the envelope, the human text and the exit code.\n */\nimport type { Diagnostic, MethodDefinition } from \"@mostra/protocol\";\nimport type { InstanceConnection } from \"./client.ts\";\n\n/** A flag's value kind. Every flag is `--long`; booleans take no value. */\nexport type FlagKind = \"boolean\" | \"string\" | \"number\" | \"duration\" | \"list\";\n\n/** One flag of a command. */\nexport interface FlagDef {\n /** The flag's name, without the dashes. */\n readonly name: string;\n /** What it takes. */\n readonly kind: FlagKind;\n /** One line for help: what it does. */\n readonly summary: string;\n /** The placeholder in usage and help: `<path>`, `<d>` … */\n readonly value?: string;\n /** The allowed values, for a closed set. */\n readonly choices?: readonly string[];\n /** The default, as help shows it. */\n readonly default?: string;\n}\n\n/** One positional argument. */\nexport interface ArgDef {\n /** The argument's name, as help shows it. */\n readonly name: string;\n /** One line for help: what it is. */\n readonly summary: string;\n /** Whether it may be left out. */\n readonly optional?: boolean;\n /** Whether it takes every remaining word (`<package…>`). */\n readonly variadic?: boolean;\n}\n\n/** What the runner gives a command. */\nexport interface CommandContext {\n /** The positional arguments, after the command path, by name. */\n readonly args: Readonly<Record<string, string | readonly string[] | undefined>>;\n /** The command's flags, parsed by kind (durations in milliseconds, lists as arrays). */\n readonly flags: Readonly<\n Record<string, string | number | boolean | readonly string[] | undefined>\n >;\n /** The working directory relative paths resolve from (`--cwd`, else the process's). */\n readonly cwd: string;\n /** Whether `--json` was given. */\n readonly json: boolean;\n /** The request timeout from `--timeout`, in milliseconds. */\n readonly timeoutMs: number | undefined;\n /** Calls a host protocol method on the home's instance, starting its daemon when needed. */\n call<P, R>(method: MethodDefinition<P, R>, params: P): Promise<R>;\n /** Reads the whole of stdin, for commands that take a value there. */\n readStdin(): Promise<string>;\n /** Writes one line of progress or a log line to stderr (never stdout). */\n log(line: string): void;\n /** Emits one event of a streaming command (an NDJSON line in `--json` mode). */\n emit(event: unknown, human?: string): void;\n /** Adds a warning to the envelope (and stderr). */\n warn(diagnostic: Diagnostic): void;\n /** The environment the CLI runs in. */\n readonly env: Readonly<Record<string, string | undefined>>;\n /** Whether stdout and stdin are terminals. */\n readonly tty: { readonly stdin: boolean; readonly stdout: boolean; readonly stderr: boolean };\n /** The resolved home and the CLI's own facts, for commands that report them. */\n readonly home: string;\n /** Records a telemetry event of this command (D140 item 8), when telemetry allows it. */\n record(event: TelemetryEventInput): void;\n /**\n * Queues the events recorded so far, for a command that runs until it is stopped (`mcp`);\n * `hostInstance` says whether the instance it reached was host-spawned (then nothing is sent).\n */\n checkpoint(hostInstance: boolean): void;\n /**\n * The session with the home's instance, starting its daemon unless `autostart` is false; then\n * `undefined` when none runs. `call` uses the same session.\n */\n connection(autostart?: boolean): Promise<InstanceConnection | undefined>;\n /** Runs the runtime binary (`mostra-runtime …`) and returns its exit code and stdout. */\n runtime(\n args: readonly string[],\n stdio?: \"pipe\" | \"inherit\",\n ): Promise<{ code: number; stdout: string }>;\n /** The CLI's config directory (D140 item 5). */\n readonly configDir: string;\n /** Writes to stderr. */\n readonly stderr: (text: string) => void;\n /** Writes to stdout as the command runs (`host`, `dev`'s stream without `--json`). */\n readonly stdout: (text: string) => void;\n}\n\n/** A command-specific telemetry event: its name and its own fields. */\nexport interface TelemetryEventInput {\n /** The event's name. */\n readonly event: \"verify.result\" | \"publish.done\" | \"share.done\" | \"mcp.session\";\n /** Its own fields; the schema keeps only the published ones. */\n readonly fields: Readonly<Record<string, unknown>>;\n}\n\n/** What a command's run returns. */\nexport interface CommandOutcome {\n /** The `result` of the envelope. */\n readonly result: unknown;\n /** The text for people (stdout); default: the result as indented JSON. */\n readonly human?: string;\n /** The exit code when it isn't 0: a failing verdict (1), `still_waiting` (5), conflicts (6). */\n readonly exit?: number;\n /** The command wrote its own stdout (`host`): the runner prints no envelope and no text. */\n readonly raw?: boolean;\n /** The instance the command reached on a session of its own was host-spawned (`mcp`). */\n readonly hostInstance?: boolean;\n}\n\n/** One command. */\nexport interface CommandDef {\n /** Its words after `mostra`: `[\"daemon\", \"install\"]`. */\n readonly path: readonly string[];\n /** One line: what it does. */\n readonly summary: string;\n /** Its positional arguments, in order. */\n readonly args?: readonly ArgDef[];\n /** Its own flags, besides the global ones. */\n readonly flags?: readonly FlagDef[];\n /** The result type `--json` puts in `result`, and its `mostra docs` topic. */\n readonly output: { readonly type: string; readonly topic: string };\n /** The exit codes it can end with, besides 2 and 3, which every command can. */\n readonly exits: readonly number[];\n /** One example invocation, without `mostra`. */\n readonly example: string;\n /** It reads stdin, so telemetry's question is never asked before it (D140 item 11). */\n readonly readsStdin?: boolean | ((flags: CommandContext[\"flags\"]) => boolean);\n /** It never reaches an instance (`docs`, `telemetry`): no `instance` in its envelope. */\n readonly local?: boolean;\n /** It writes a stream of events before its result (NDJSON in `--json` mode). */\n readonly streams?: boolean;\n /**\n * Telemetry and its question leave it alone (`telemetry`, `docs`, D140 item 11), or, as a\n * function of its flags, when it runs on someone's behalf (`mcp --embedded`, D148).\n */\n readonly quiet?: boolean | ((flags: CommandContext[\"flags\"]) => boolean);\n /** The name telemetry records for it, when not its words: `plugin` for a plugin's command. */\n readonly telemetryName?: string;\n /** Does the command's work. */\n run(context: CommandContext): Promise<CommandOutcome>;\n}\n\n/** Defines a command; the identity function, for types. */\nexport function defineCommand(command: CommandDef): CommandDef {\n return command;\n}\n\n/** The command path as one string: `daemon install`. */\nexport function commandName(command: Pick<CommandDef, \"path\">): string {\n return command.path.join(\" \");\n}\n","/**\n * The exit codes (INTERFACES §9, D140 item 16): one table keyed by diagnostic code, so every\n * command ends the same way for the same failure. Each area has a code, and a few codes differ\n * from their area; the table is total over the catalog by construction, and a test checks every\n * catalog code against it.\n */\nimport type { DiagnosticArea } from \"@mostra/protocol\";\n\n/** The exit codes of INTERFACES §9. */\nexport const EXIT = {\n /** Success, or `verify` passed. */\n ok: 0,\n /** Artifact failure: verify failed, publish refused, a request the artifact's state refused. */\n failure: 1,\n /** Usage error. */\n usage: 2,\n /** Environment error: no runtime, browser or socket; the home; an unsupported platform. */\n environment: 3,\n /** Timeout: `--timeout` passed before the instance answered. */\n timeout: 4,\n /** `wait` ended `still_waiting`: not an error, the status is in the result. */\n stillWaiting: 5,\n /** Conflict: `once` already submitted, a compare-and-set mismatch, a reused request ID. */\n conflict: 6,\n} as const;\n\n/** One of {@link EXIT}'s codes. */\nexport type ExitCode = (typeof EXIT)[keyof typeof EXIT];\n\n/** Each area's exit code. Every area is here: a new one fails the type check until it is. */\nconst BY_AREA: Readonly<Record<DiagnosticArea, ExitCode>> = {\n MANIFEST: EXIT.failure,\n BUILD: EXIT.failure,\n TYPE: EXIT.failure,\n LINT: EXIT.failure,\n DEP: EXIT.failure,\n KIT: EXIT.failure,\n FIELD: EXIT.failure,\n ACTION: EXIT.failure,\n LIVE: EXIT.failure,\n RUNTIME: EXIT.failure,\n CONSOLE: EXIT.failure,\n NETWORK: EXIT.failure,\n A11Y: EXIT.failure,\n VISUAL: EXIT.failure,\n SMOKE: EXIT.failure,\n REGRESSION: EXIT.failure,\n TERM: EXIT.failure,\n PUBLISH: EXIT.failure,\n SUBMIT: EXIT.failure,\n HOST: EXIT.environment,\n HOME: EXIT.environment,\n HYGIENE: EXIT.failure,\n SECRET: EXIT.failure,\n SHARE: EXIT.environment,\n VERIFY: EXIT.failure,\n TARGET: EXIT.failure,\n ENV: EXIT.environment,\n PLATFORM: EXIT.environment,\n ARTIFACT: EXIT.failure,\n CLI: EXIT.usage,\n // A remote server or the link to one: the environment, like a share's tunnel (D165).\n REMOTE: EXIT.environment,\n // A roster or a team wait the artifact can't take (D168): the artifact's, like a refused submit.\n TEAM: EXIT.failure,\n // A plugin, a source pack or a license an install brings (D30, D31): the artifact's, like a\n // package `mostra add` can't add.\n PLUGIN: EXIT.failure,\n PACK: EXIT.failure,\n LICENSE: EXIT.failure,\n};\n\n/** Codes whose exit code isn't their area's. */\nconst BY_CODE: Readonly<Record<string, ExitCode>> = {\n MOSTRA_HOST_TIMEOUT: EXIT.timeout,\n // The CLI can't record a choice: its environment, not its command line.\n MOSTRA_CLI_CONFIG_UNWRITABLE: EXIT.environment,\n MOSTRA_HOST_INVALID_PARAMS: EXIT.usage,\n MOSTRA_HOST_REQUEST_ID_REUSED: EXIT.conflict,\n MOSTRA_HOST_CURSOR_COMPACTED: EXIT.failure,\n MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: EXIT.usage,\n MOSTRA_SUBMIT_ALREADY: EXIT.conflict,\n MOSTRA_SUBMIT_REVISION_MOVED: EXIT.conflict,\n MOSTRA_FIELD_CONFLICT: EXIT.conflict,\n MOSTRA_FIELD_MUTATION_ID_REUSED: EXIT.conflict,\n MOSTRA_PUBLISH_ID_CONFLICT: EXIT.failure,\n MOSTRA_HOME_INTEGRITY: EXIT.failure,\n MOSTRA_HOME_NOT_ALWAYS_ON: EXIT.ok,\n MOSTRA_VERIFY_CRASHED: EXIT.environment,\n // `--accept-license` given something that isn't a license: the command line.\n MOSTRA_LICENSE_ACCEPT_INVALID: EXIT.usage,\n};\n\n/** The exit code a diagnostic ends a command with. An unknown area is an environment error. */\nexport function exitCodeFor(code: string): ExitCode {\n const exact = BY_CODE[code];\n if (exact !== undefined) return exact;\n const area = /^MOSTRA_([A-Z0-9]+)_/.exec(code)?.[1];\n return (area !== undefined ? BY_AREA[area as DiagnosticArea] : undefined) ?? EXIT.environment;\n}\n","/**\n * The command line, read against the command definitions (D140 item 13): the global flags, the\n * command path, its arguments and flags. Every failure is `MOSTRA_CLI_USAGE` or\n * `MOSTRA_CLI_UNKNOWN_COMMAND`, so `--json` mode reports it like any other error.\n */\nimport { parseArgs } from \"node:util\";\nimport { createDiagnostic, RpcError } from \"@mostra/protocol\";\nimport { type CommandDef, commandName, type FlagDef } from \"./command.ts\";\n\n/** The flags every command takes (INTERFACES §9). */\nexport const GLOBAL_FLAGS: readonly FlagDef[] = [\n {\n name: \"json\",\n kind: \"boolean\",\n summary: \"Print one JSON envelope on stdout (NDJSON for streams).\",\n },\n {\n name: \"home\",\n kind: \"string\",\n value: \"<dir>\",\n summary: \"Use this Mostra home instead of MOSTRA_HOME or the default.\",\n },\n {\n name: \"cwd\",\n kind: \"string\",\n value: \"<dir>\",\n summary: \"Resolve relative paths from this directory.\",\n },\n {\n name: \"timeout\",\n kind: \"duration\",\n value: \"<d>\",\n summary: \"Give up on the instance after this long (exit 4), such as 30s or 5m.\",\n },\n {\n name: \"help\",\n kind: \"boolean\",\n summary: \"Show this command's help; with --json, its definition.\",\n },\n];\n\n/** What the command line asks for. */\nexport type Parsed =\n | { readonly kind: \"version\" }\n | { readonly kind: \"help\"; readonly command?: CommandDef; readonly group?: string }\n | {\n readonly kind: \"run\";\n readonly command: CommandDef;\n readonly args: Record<string, string | readonly string[] | undefined>;\n readonly flags: Record<string, string | number | boolean | readonly string[] | undefined>;\n };\n\n/** The global flags' values, read before anything else so a usage error still honors them. */\nexport interface GlobalFlags {\n readonly json: boolean;\n readonly home?: string;\n readonly cwd?: string;\n readonly timeoutMs?: number;\n}\n\n/** A usage error. */\nexport function usage(message: string): RpcError {\n return new RpcError(createDiagnostic(\"MOSTRA_CLI_USAGE\", { message }));\n}\n\nconst DURATION = /^([1-9][0-9]*)(ms|s|m|h|d)$/;\nconst UNIT_MS: Readonly<Record<string, number>> = {\n ms: 1,\n s: 1000,\n m: 60_000,\n h: 3_600_000,\n d: 86_400_000,\n};\n\n/** A duration flag's milliseconds: `30s`, `5m`, `2h`, `7d`, `500ms`. */\nexport function durationMs(value: string): number {\n const match = DURATION.exec(value);\n if (!match)\n throw usage(`\"${value}\" isn't a duration; use a number with ms, s, m, h or d, such as 30s.`);\n return Number(match[1]) * (UNIT_MS[match[2] as string] as number);\n}\n\n/**\n * Reads the global flags wherever they stand, before the command is known: `--json` anywhere\n * before `--` makes even a usage error a JSON envelope (D140 item 16).\n */\nexport function globalFlags(argv: readonly string[]): GlobalFlags {\n const end = argv.indexOf(\"--\");\n const words = end === -1 ? argv : argv.slice(0, end);\n const value = (name: string): string | undefined => {\n for (let index = 0; index < words.length; index += 1) {\n const word = words[index] as string;\n if (word === `--${name}`) return words[index + 1];\n if (word.startsWith(`--${name}=`)) return word.slice(name.length + 3);\n }\n return undefined;\n };\n const timeout = value(\"timeout\");\n let timeoutMs: number | undefined;\n try {\n timeoutMs = timeout === undefined ? undefined : durationMs(timeout);\n } catch {\n timeoutMs = undefined;\n }\n const home = value(\"home\");\n const cwd = value(\"cwd\");\n return {\n json: words.includes(\"--json\"),\n ...(home !== undefined ? { home } : {}),\n ...(cwd !== undefined ? { cwd } : {}),\n ...(timeoutMs !== undefined ? { timeoutMs } : {}),\n };\n}\n\n/** The command that names `words`' longest prefix. */\nfunction findCommand(\n commands: readonly CommandDef[],\n words: readonly string[],\n): { command: CommandDef; used: number } | undefined {\n let best: { command: CommandDef; used: number } | undefined;\n for (const command of commands) {\n const { path } = command;\n if (path.length <= words.length && path.every((word, index) => words[index] === word)) {\n if (!best || path.length > best.used) best = { command, used: path.length };\n }\n }\n return best;\n}\n\n/** The first words of every command: the groups and the single-word commands. */\nexport function topWords(commands: readonly CommandDef[]): string[] {\n return [...new Set(commands.map((command) => command.path[0] as string))].sort();\n}\n\n/**\n * The command path's candidates: the leading words that aren't flags, with the global flags (and\n * their values) that may stand before them skipped, and where each stands in `argv`.\n */\nfunction leadingWords(argv: readonly string[]): { words: string[]; pathAt: number[] } {\n const words: string[] = [];\n const pathAt: number[] = [];\n for (let index = 0; index < argv.length; index += 1) {\n const word = argv[index] as string;\n if (word === \"--json\" || word === \"--help\" || word === \"-h\") continue;\n if (word === \"--home\" || word === \"--cwd\" || word === \"--timeout\") {\n index += 1;\n continue;\n }\n if (/^--(home|cwd|timeout)=/.test(word)) continue;\n if (word.startsWith(\"-\")) break;\n words.push(word);\n pathAt.push(index);\n }\n return { words, pathAt };\n}\n\n/** The words a command line starts its command with (`[\"mcp\"]`, `[\"share\", \"stop\", …]`). */\nexport function commandWords(argv: readonly string[]): string[] {\n return leadingWords(argv).words;\n}\n\n/** Parses the command line against the definitions. Throws a usage diagnostic. */\nexport function parseCommandLine(commands: readonly CommandDef[], argv: readonly string[]): Parsed {\n const bare = argv.filter((word) => word !== \"--json\");\n if (bare.length === 1 && (bare[0] === \"--version\" || bare[0] === \"-v\"))\n return { kind: \"version\" };\n // The command path is the leading words that aren't flags; global flags may stand before it.\n const { words, pathAt } = leadingWords(argv);\n const helpAsked = argv.includes(\"--help\") || argv.includes(\"-h\");\n if (words.length === 0) {\n if (helpAsked || argv.every((word) => word === \"--json\")) return { kind: \"help\" };\n throw usage(`Name a command first; ${argv[0]} isn't one.`);\n }\n const found = findCommand(commands, words);\n if (!found) {\n const group = commands.filter((command) => command.path[0] === words[0]);\n if (group.length > 0) {\n if (helpAsked) return { kind: \"help\", group: words[0] as string };\n throw usage(\n `\"mostra ${words[0]}\" needs one of: ${group.map((command) => command.path.slice(1).join(\" \")).join(\", \")}.`,\n );\n }\n throw new RpcError(\n createDiagnostic(\"MOSTRA_CLI_UNKNOWN_COMMAND\", {\n message: `\"${words[0]}\" isn't a mostra command. The commands are: ${topWords(commands).join(\", \")}.`,\n }),\n );\n }\n const { command } = found;\n if (helpAsked) return { kind: \"help\", command };\n const used = new Set(pathAt.slice(0, found.used));\n const rest = argv.filter((_, index) => !used.has(index));\n const flagDefs = [...GLOBAL_FLAGS, ...(command.flags ?? [])];\n let parsed: ReturnType<typeof parseArgs>;\n try {\n parsed = parseArgs({\n args: [...rest],\n allowPositionals: true,\n strict: true,\n options: Object.fromEntries(\n flagDefs.map((flag) => [\n flag.name,\n { type: flag.kind === \"boolean\" ? \"boolean\" : \"string\" },\n ]),\n ) as Parameters<typeof parseArgs>[0] extends { options?: infer O } ? NonNullable<O> : never,\n });\n } catch (error) {\n throw usage(\n `${(error as Error).message.split(\". To specify\")[0]}. Run \"mostra ${commandName(command)} --help\".`,\n );\n }\n const flags: Record<string, string | number | boolean | readonly string[] | undefined> = {};\n for (const flag of command.flags ?? []) {\n const raw = parsed.values[flag.name];\n if (raw === undefined) continue;\n if (flag.kind === \"boolean\") {\n flags[flag.name] = raw === true;\n continue;\n }\n const text = String(raw);\n if (flag.choices && !flag.choices.includes(text)) {\n throw usage(`--${flag.name} takes one of ${flag.choices.join(\", \")}; \"${text}\" isn't one.`);\n }\n if (flag.kind === \"number\") {\n const number = Number(text);\n if (!Number.isInteger(number) || number < 0)\n throw usage(`--${flag.name} takes a whole number; \"${text}\" isn't one.`);\n flags[flag.name] = number;\n } else if (flag.kind === \"duration\") {\n durationMs(text);\n flags[flag.name] = text;\n } else if (flag.kind === \"list\") {\n flags[flag.name] = text\n .split(\",\")\n .map((item) => item.trim())\n .filter((item) => item.length > 0);\n } else flags[flag.name] = text;\n }\n const positionals = [...parsed.positionals];\n const args: Record<string, string | readonly string[] | undefined> = {};\n for (const arg of command.args ?? []) {\n if (arg.variadic) {\n if (positionals.length === 0 && !arg.optional)\n throw usage(`\"mostra ${commandName(command)}\" needs <${arg.name}…>.`);\n args[arg.name] = positionals.splice(0);\n continue;\n }\n const value = positionals.shift();\n if (value === undefined && !arg.optional)\n throw usage(`\"mostra ${commandName(command)}\" needs <${arg.name}>.`);\n args[arg.name] = value;\n }\n if (positionals.length > 0) {\n throw usage(\n `\"mostra ${commandName(command)}\" takes no argument \"${positionals[0]}\". Run \"mostra ${commandName(command)} --help\".`,\n );\n }\n if (typeof parsed.values[\"timeout\"] === \"string\") durationMs(parsed.values[\"timeout\"]);\n return { kind: \"run\", command, args, flags };\n}\n","/**\n * The npm bootstrap (RT-01, D142): a `mostra` installed from npm runs on whatever Node.js the\n * system has, so before anything else it finds the runtime bundle its release pins (from the\n * cache, or downloaded once, with progress on stderr) and runs the bundle's own `mostra` with the\n * same arguments on the bundle's private Node.js. Every command, telemetry included, then runs in\n * the bundle, and this process only waits and passes the exit code on.\n *\n * Inside a bundle, in a development checkout, or with `MOSTRA_BUNDLE`/`MOSTRA_RUNTIME_BIN` set,\n * there is nothing to bootstrap and the CLI runs in this process.\n *\n * This module runs on the system's Node.js, so it uses nothing newer than Node.js 22.19 and loads\n * none of the CLI's commands.\n */\nimport { spawn } from \"node:child_process\";\nimport { constants } from \"node:os\";\nimport { createDiagnostic, type Diagnostic, RpcError } from \"@mostra/protocol\";\nimport { enclosingBundle, type InstallProgress, readPins, resolveRuntime } from \"@mostra/sdk\";\nimport { exitCodeFor } from \"./exit.ts\";\nimport type { Environment } from \"./home.ts\";\nimport { commandWords } from \"./parse.ts\";\n\n/** How the bootstrap talks to the terminal. */\nexport interface BootstrapIo {\n readonly argv: readonly string[];\n readonly env: Environment;\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n /** Whether stderr is a terminal: progress then rewrites one line. */\n readonly stderrTty: boolean;\n /**\n * Whether a terminal is attached (stdin, stdout or stderr is one). Ctrl-C there signals the\n * whole foreground process group, the bundle's `mostra` included, so SIGINT isn't forwarded:\n * a second one would cut short a command that stops gracefully on the first (`mostra dev`).\n */\n readonly terminal: boolean;\n}\n\n/** Whether this CLI should move into its pinned bundle before running a command. */\nexport function needsBootstrap(env: Environment): boolean {\n if (env[\"MOSTRA_BUNDLE\"] || env[\"MOSTRA_RUNTIME_BIN\"]) return false;\n if (enclosingBundle() !== undefined) return false;\n return readPins(env) !== undefined;\n}\n\n/**\n * Whether the command serves in this process instead of in the bundle (D164 item 7): `mostra mcp`\n * answers its client at once and installs the bundle in the background, since a client gives a\n * server only seconds to start (Codex 10 s) and a first install takes minutes.\n */\nexport function servesBeforeBundle(argv: readonly string[]): boolean {\n return commandWords(argv)[0] === \"mcp\";\n}\n\n/** Progress lines for a person waiting on the first download. */\nexport function progressReporter(\n io: Pick<BootstrapIo, \"stderr\" | \"stderrTty\">,\n): (progress: InstallProgress) => void {\n let lastPercent = -1;\n let lastStep = \"\";\n return (progress) => {\n if (progress.step === \"download\") {\n const percent = Math.floor((progress.received / progress.total) * 100);\n const mb = (bytes: number): string => `${Math.round(bytes / 1e6)} MB`;\n if (io.stderrTty) {\n if (percent !== lastPercent)\n io.stderr(\n `\\rmostra: downloading the Mostra runtime, ${mb(progress.received)} of ${mb(progress.total)} (${percent}%)`,\n );\n } else if (\n lastStep !== \"download\" ||\n Math.floor(percent / 25) > Math.floor(lastPercent / 25)\n ) {\n io.stderr(`mostra: downloading the Mostra runtime (${mb(progress.total)}): ${percent}%\\n`);\n }\n lastPercent = percent;\n lastStep = \"download\";\n return;\n }\n if (progress.step === lastStep) return;\n if (lastStep === \"download\" && io.stderrTty) io.stderr(\"\\n\");\n lastStep = progress.step;\n const words: Partial<Record<InstallProgress[\"step\"], string>> = {\n files: \"checking the runtime's files\",\n browser: \"fetching the browser verify uses\",\n };\n const said = words[progress.step];\n if (said !== undefined) io.stderr(`mostra: ${said}…\\n`);\n };\n}\n\n/** The envelope `--json` promises, for a bootstrap that fails before any command runs. */\nfunction failed(io: BootstrapIo, diagnostic: Diagnostic): number {\n io.stderr(`mostra: ${diagnostic.message}\\n`);\n if (diagnostic.hint) io.stderr(`mostra: ${diagnostic.hint}\\n`);\n if (io.argv.includes(\"--json\")) {\n io.stdout(`${JSON.stringify({ ok: false, error: diagnostic, warnings: [] })}\\n`);\n }\n return exitCodeFor(diagnostic.code);\n}\n\n/**\n * When this copy needs the bundle its release pins (`needsBootstrap`), runs the bundle's\n * `mostra` with `io.argv` and resolves with its exit code; otherwise, or for `mostra mcp`, which\n * installs the bundle itself while it serves (`servesBeforeBundle`), resolves `undefined`, and the\n * caller runs the command itself. Any failure, deciding included, is a diagnostic (one envelope\n * with `--json`) and its exit code. Signals this process gets are passed on to the child.\n */\nexport async function bootstrap(io: BootstrapIo): Promise<number | undefined> {\n try {\n // Deciding is inside the boundary too: pins that can't be read are a diagnostic, never a\n // stack trace (GPT review finding 3).\n if (!needsBootstrap(io.env) || servesBeforeBundle(io.argv)) return undefined;\n return await runInBundle(io);\n } catch (error) {\n // Whatever goes wrong, `--json` still gets exactly one envelope (D140 item 16).\n if (error instanceof RpcError) return failed(io, error.diagnostic);\n return failed(\n io,\n createDiagnostic(\"MOSTRA_HOST_INTERNAL_ERROR\", {\n message: `The npm bootstrap failed: ${error instanceof Error ? error.message : String(error)}`,\n }),\n );\n }\n}\n\nasync function runInBundle(io: BootstrapIo): Promise<number> {\n const runtime = await resolveRuntime({ env: io.env, onProgress: progressReporter(io) });\n if (runtime.cliEntry === undefined) {\n throw new RpcError(\n createDiagnostic(\"MOSTRA_ENV_RUNTIME_MISSING\", {\n message: \"The runtime the bootstrap found has no CLI entry.\",\n }),\n );\n }\n const cli = runtime.cliEntry;\n return new Promise((resolve) => {\n const child = spawn(runtime.node, [cli, ...io.argv], {\n stdio: \"inherit\",\n env: io.env as NodeJS.ProcessEnv,\n });\n const forward = (signal: NodeJS.Signals): void => {\n if (signal === \"SIGINT\" && io.terminal) return; // the child got the terminal's own\n child.kill(signal);\n };\n const signals: NodeJS.Signals[] = [\"SIGINT\", \"SIGTERM\", \"SIGHUP\"];\n for (const signal of signals) process.on(signal, forward);\n let settled = false;\n const settle = (code: number): void => {\n if (settled) return;\n settled = true;\n for (const signal of signals) process.off(signal, forward);\n resolve(code);\n };\n child.on(\"error\", (error) =>\n settle(\n failed(\n io,\n createDiagnostic(\"MOSTRA_ENV_RUNTIME_MISSING\", {\n message: `The runtime bundle's CLI couldn't be started (${runtime.node}): ${error.message}`,\n }),\n ),\n ),\n );\n // A child ended by a signal exits as a shell reports it: 128 plus the signal's number.\n child.on(\"exit\", (code, signal) =>\n settle(code ?? 128 + (signal ? (constants.signals[signal] ?? 0) : 0)),\n );\n });\n}\n"],"mappings":";;;;;;;AAuJA,SAAgB,cAAc,SAAiC;CAC7D,OAAO;AACT;;AAGA,SAAgB,YAAY,SAA2C;CACrE,OAAO,QAAQ,KAAK,KAAK,GAAG;AAC9B;;;;ACrJA,MAAa,OAAO;;CAElB,IAAI;;CAEJ,SAAS;;CAET,OAAO;;CAEP,aAAa;;CAEb,SAAS;;CAET,cAAc;;CAEd,UAAU;AACZ;;AAMA,MAAM,UAAsD;CAC1D,UAAU,KAAK;CACf,OAAO,KAAK;CACZ,MAAM,KAAK;CACX,MAAM,KAAK;CACX,KAAK,KAAK;CACV,KAAK,KAAK;CACV,OAAO,KAAK;CACZ,QAAQ,KAAK;CACb,MAAM,KAAK;CACX,SAAS,KAAK;CACd,SAAS,KAAK;CACd,SAAS,KAAK;CACd,MAAM,KAAK;CACX,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,YAAY,KAAK;CACjB,MAAM,KAAK;CACX,SAAS,KAAK;CACd,QAAQ,KAAK;CACb,MAAM,KAAK;CACX,MAAM,KAAK;CACX,SAAS,KAAK;CACd,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,QAAQ,KAAK;CACb,QAAQ,KAAK;CACb,KAAK,KAAK;CACV,UAAU,KAAK;CACf,UAAU,KAAK;CACf,KAAK,KAAK;CAEV,QAAQ,KAAK;CAEb,MAAM,KAAK;CAGX,QAAQ,KAAK;CACb,MAAM,KAAK;CACX,SAAS,KAAK;AAChB;;AAGA,MAAM,UAA8C;CAClD,qBAAqB,KAAK;CAE1B,8BAA8B,KAAK;CACnC,4BAA4B,KAAK;CACjC,+BAA+B,KAAK;CACpC,8BAA8B,KAAK;CACnC,kCAAkC,KAAK;CACvC,uBAAuB,KAAK;CAC5B,8BAA8B,KAAK;CACnC,uBAAuB,KAAK;CAC5B,iCAAiC,KAAK;CACtC,4BAA4B,KAA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-0,0 +1 @@
|
|
|
1
|
+
export { t as bootstrap } from "./bootstrap-CYgyuZFk.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ interface CommandDef {
|
|
|
171
171
|
* function of its flags, when it runs on someone's behalf (`mcp --embedded`, D148).
|
|
172
172
|
*/
|
|
173
173
|
readonly quiet?: boolean | ((flags: CommandContext["flags"]) => boolean);
|
|
174
|
+
/** The name telemetry records for it, when not its words: `plugin` for a plugin's command. */
|
|
175
|
+
readonly telemetryName?: string;
|
|
174
176
|
/** Does the command's work. */
|
|
175
177
|
run(context: CommandContext): Promise<CommandOutcome>;
|
|
176
178
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/home.ts","../src/client.ts","../src/command.ts","../src/commands/index.ts","../src/exit.ts","../src/help.ts","../src/run.ts"],"mappings":";;;;KAWY,cAAc,SAAS;;;;UCoBlB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN,SAAS;;WAET,mBAAmB;;EAE5B,KAAK,GAAG,GAAG,QAAQ,iBAAiB,GAAG,IAAI,QAAQ,GAAG,qBAAqB,QAAQ;;EAEnF,eAAe,gBAAgB,UAAU;;WAEhC,QAAQ;;EAEjB;;;;;KCjDU;;UAGK;;WAEN;;WAEA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN,MAAM,SAAS;;WAEf,OAAO,SACd;;WAGO;;WAEA;;WAEA;;EAET,KAAK,GAAG,GAAG,QAAQ,iBAAiB,GAAG,IAAI,QAAQ,IAAI,QAAQ;;EAE/D,aAAa;;EAEb,IAAI;;EAEJ,KAAK,gBAAgB;;EAErB,KAAK,YAAY;;WAER,KAAK,SAAS;;WAEd;aAAgB;aAAyB;aAA0B;;;WAEnE;;EAET,OAAO,OAAO;;;;;EAKd,WAAW;;;;;EAKX,WAAW,sBAAsB,QAAQ;;EAEzC,QACE,yBACA,6BACC;IAAU;IAAc;;;WAElB;;WAEA,SAAS;;WAET,SAAS;;;UAIH;;WAEN;;WAEA,QAAQ,SAAS;;;UAIX;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA,gBAAgB;;WAEhB,iBAAiB;;WAEjB;aAAmB;aAAuB;;;WAE1C;;WAEA;;WAEA,yBAAyB,OAAO;;WAEhC;;WAEA;;;;;WAKA,oBAAoB,OAAO;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/home.ts","../src/client.ts","../src/command.ts","../src/commands/index.ts","../src/exit.ts","../src/help.ts","../src/run.ts"],"mappings":";;;;KAWY,cAAc,SAAS;;;;UCoBlB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN,SAAS;;WAET,mBAAmB;;EAE5B,KAAK,GAAG,GAAG,QAAQ,iBAAiB,GAAG,IAAI,QAAQ,GAAG,qBAAqB,QAAQ;;EAEnF,eAAe,gBAAgB,UAAU;;WAEhC,QAAQ;;EAEjB;;;;;KCjDU;;UAGK;;WAEN;;WAEA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN,MAAM,SAAS;;WAEf,OAAO,SACd;;WAGO;;WAEA;;WAEA;;EAET,KAAK,GAAG,GAAG,QAAQ,iBAAiB,GAAG,IAAI,QAAQ,IAAI,QAAQ;;EAE/D,aAAa;;EAEb,IAAI;;EAEJ,KAAK,gBAAgB;;EAErB,KAAK,YAAY;;WAER,KAAK,SAAS;;WAEd;aAAgB;aAAyB;aAA0B;;;WAEnE;;EAET,OAAO,OAAO;;;;;EAKd,WAAW;;;;;EAKX,WAAW,sBAAsB,QAAQ;;EAEzC,QACE,yBACA,6BACC;IAAU;IAAc;;;WAElB;;WAEA,SAAS;;WAET,SAAS;;;UAIH;;WAEN;;WAEA,QAAQ,SAAS;;;UAIX;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA,gBAAgB;;WAEhB,iBAAiB;;WAEjB;aAAmB;aAAuB;;;WAE1C;;WAEA;;WAEA,yBAAyB,OAAO;;WAEhC;;WAEA;;;;;WAKA,oBAAoB,OAAO;;WAE3B;;EAET,IAAI,SAAS,iBAAiB,QAAQ;;;;;qBCzF3B,mBAAmB;;;;qBCjDnB;;WAEX;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;KAIU,mBAAmB,mBAAmB;;wBAmElC,YAAY,eAAe;;;;wBCxB3B,YAAY,SAAS;;wBAqDrB,kBAAkB,SAAS,aAAa;;wBA4BxC,kBAAkB,mBAAmB;;;;UC5GpC;;WAEN;;WAEA,KAAK;;WAEL;;WAEA,SAAS;;WAET,SAAS;;WAET,OAAO,OAAO;;WAEd;aAAgB;aAAyB;aAA0B;;;WAEnE;;WAEA;;;wBA+DW,IAAI,IAAI,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as COMMANDS, i as referenceMarkdown, n as commandDefinition, r as commandHelp, t as run } from "./run-
|
|
1
|
+
import { f as EXIT, p as exitCodeFor } from "./bootstrap-CYgyuZFk.js";
|
|
2
|
+
import { a as COMMANDS, i as referenceMarkdown, n as commandDefinition, r as commandHelp, t as run } from "./run-BsUzIBQj.js";
|
|
3
3
|
export { COMMANDS, EXIT, commandDefinition, commandHelp, exitCodeFor, referenceMarkdown, run };
|
package/dist/reference/cli.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Every command takes `--json`, which prints one envelope on stdout: `{ "ok": true, "result", "instance", "warnings" }` or `{ "ok": false, "error", "warnings" }`. Streaming commands print one envelope per line, the last one carrying `result` or `error`. Logs and progress go to stderr. Without a terminal, or with `--json`, no command asks a question.
|
|
6
6
|
|
|
7
|
-
Commands: `add`, `daemon`, `dev`, `docs`, `doctor`, `export`, `gc`, `host`, `list`, `login`, `logout`, `mcp`, `new`, `open`, `pause`, `publish`, `push`, `results`, `resume`, `roster`, `run`, `secret`, `share`, `state`, `status`, `telemetry`, `verify`, `wait`.
|
|
7
|
+
Commands: `add`, `daemon`, `dev`, `docs`, `doctor`, `export`, `gc`, `host`, `list`, `login`, `logout`, `mcp`, `new`, `open`, `pause`, `plugin`, `publish`, `push`, `results`, `resume`, `roster`, `run`, `secret`, `share`, `state`, `status`, `telemetry`, `verify`, `wait`.
|
|
8
8
|
|
|
9
9
|
## mostra new
|
|
10
10
|
|
|
@@ -764,16 +764,18 @@ Example:
|
|
|
764
764
|
## mostra add
|
|
765
765
|
|
|
766
766
|
```text
|
|
767
|
-
Add npm packages to an artifact's lockfile
|
|
767
|
+
Add npm packages to an artifact's lockfile, or copy source-pack items (shadcn registry items) into it.
|
|
768
768
|
|
|
769
769
|
Usage:
|
|
770
770
|
mostra add <package…> [flags]
|
|
771
771
|
|
|
772
772
|
Arguments:
|
|
773
|
-
<package> npm specs
|
|
773
|
+
<package> npm specs (name, name@version, name@range, name@tag), or items: a URL, a local .json, owner/repo/item on GitHub, @namespace/item, plugin:<package>/<item>.
|
|
774
774
|
|
|
775
775
|
Flags:
|
|
776
776
|
--artifact <path|id> The artifact. Default: the one in the current directory.
|
|
777
|
+
--overwrite Replace files of the artifact that an item writes with other content.
|
|
778
|
+
--accept-license <id> Acknowledge a license the items' packages bring (LicenseRef-…), recorded in the lockfile.
|
|
777
779
|
--request-id <id> Make a retry return the first attempt's result.
|
|
778
780
|
|
|
779
781
|
Global flags:
|
|
@@ -783,7 +785,7 @@ Global flags:
|
|
|
783
785
|
--timeout <d> Give up on the instance after this long (exit 4), such as 30s or 5m.
|
|
784
786
|
--help Show this command's help; with --json, its definition.
|
|
785
787
|
|
|
786
|
-
Output: DepsAddResult (mostra docs cli)
|
|
788
|
+
Output: DepsAddResult | PackAddResult (mostra docs cli)
|
|
787
789
|
|
|
788
790
|
Exit codes:
|
|
789
791
|
0 success
|
|
@@ -796,6 +798,145 @@ Example:
|
|
|
796
798
|
mostra add recharts@3 --artifact ./dashboard
|
|
797
799
|
```
|
|
798
800
|
|
|
801
|
+
## mostra plugin add
|
|
802
|
+
|
|
803
|
+
```text
|
|
804
|
+
Install plugins for an artifact or the home, checking their contracts, conflicts and licenses first.
|
|
805
|
+
|
|
806
|
+
Usage:
|
|
807
|
+
mostra plugin add <package…> [flags]
|
|
808
|
+
|
|
809
|
+
Arguments:
|
|
810
|
+
<package> npm specs of the plugins: name, name@version or name@range.
|
|
811
|
+
|
|
812
|
+
Flags:
|
|
813
|
+
--artifact <path|id> The artifact whose lockfile records the plugins. Default: the one in the current directory.
|
|
814
|
+
--global The home's own plugins instead, for every artifact of the home (exporters and CLI commands only).
|
|
815
|
+
--accept-license <id> Acknowledge a license the install brings (LicenseRef-Remotion), recorded in the lockfile. Repeat or comma-separate.
|
|
816
|
+
--request-id <id> Make a retry return the first attempt's result.
|
|
817
|
+
|
|
818
|
+
Global flags:
|
|
819
|
+
--json Print one JSON envelope on stdout (NDJSON for streams).
|
|
820
|
+
--home <dir> Use this Mostra home instead of MOSTRA_HOME or the default.
|
|
821
|
+
--cwd <dir> Resolve relative paths from this directory.
|
|
822
|
+
--timeout <d> Give up on the instance after this long (exit 4), such as 30s or 5m.
|
|
823
|
+
--help Show this command's help; with --json, its definition.
|
|
824
|
+
|
|
825
|
+
Output: PluginAddResult (mostra docs cli)
|
|
826
|
+
|
|
827
|
+
Exit codes:
|
|
828
|
+
0 success
|
|
829
|
+
1 artifact failure (verify failed, publish refused, the artifact's state refused the request)
|
|
830
|
+
2 usage error
|
|
831
|
+
3 environment error (no runtime, browser or socket; the home; an unsupported platform)
|
|
832
|
+
4 timeout (--timeout passed)
|
|
833
|
+
|
|
834
|
+
Example:
|
|
835
|
+
mostra plugin add mostra-plugin-pdf --artifact ./report
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
## mostra plugin list
|
|
839
|
+
|
|
840
|
+
```text
|
|
841
|
+
List an artifact's plugins, or the home's, in load order, as verify and publish load them now.
|
|
842
|
+
|
|
843
|
+
Usage:
|
|
844
|
+
mostra plugin list [flags]
|
|
845
|
+
|
|
846
|
+
Flags:
|
|
847
|
+
--artifact <path|id> The artifact whose lockfile records the plugins. Default: the one in the current directory.
|
|
848
|
+
--global The home's own plugins instead, for every artifact of the home (exporters and CLI commands only).
|
|
849
|
+
|
|
850
|
+
Global flags:
|
|
851
|
+
--json Print one JSON envelope on stdout (NDJSON for streams).
|
|
852
|
+
--home <dir> Use this Mostra home instead of MOSTRA_HOME or the default.
|
|
853
|
+
--cwd <dir> Resolve relative paths from this directory.
|
|
854
|
+
--timeout <d> Give up on the instance after this long (exit 4), such as 30s or 5m.
|
|
855
|
+
--help Show this command's help; with --json, its definition.
|
|
856
|
+
|
|
857
|
+
Output: PluginListResult (mostra docs cli)
|
|
858
|
+
|
|
859
|
+
Exit codes:
|
|
860
|
+
0 success
|
|
861
|
+
1 artifact failure (verify failed, publish refused, the artifact's state refused the request)
|
|
862
|
+
2 usage error
|
|
863
|
+
3 environment error (no runtime, browser or socket; the home; an unsupported platform)
|
|
864
|
+
4 timeout (--timeout passed)
|
|
865
|
+
|
|
866
|
+
Example:
|
|
867
|
+
mostra plugin list --artifact ./report
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
## mostra plugin remove
|
|
871
|
+
|
|
872
|
+
```text
|
|
873
|
+
Take plugins out of an artifact's lockfile, or the home's.
|
|
874
|
+
|
|
875
|
+
Usage:
|
|
876
|
+
mostra plugin remove <package…> [flags]
|
|
877
|
+
|
|
878
|
+
Arguments:
|
|
879
|
+
<package> The plugins' package names.
|
|
880
|
+
|
|
881
|
+
Flags:
|
|
882
|
+
--artifact <path|id> The artifact whose lockfile records the plugins. Default: the one in the current directory.
|
|
883
|
+
--global The home's own plugins instead, for every artifact of the home (exporters and CLI commands only).
|
|
884
|
+
--request-id <id> Make a retry return the first attempt's result.
|
|
885
|
+
|
|
886
|
+
Global flags:
|
|
887
|
+
--json Print one JSON envelope on stdout (NDJSON for streams).
|
|
888
|
+
--home <dir> Use this Mostra home instead of MOSTRA_HOME or the default.
|
|
889
|
+
--cwd <dir> Resolve relative paths from this directory.
|
|
890
|
+
--timeout <d> Give up on the instance after this long (exit 4), such as 30s or 5m.
|
|
891
|
+
--help Show this command's help; with --json, its definition.
|
|
892
|
+
|
|
893
|
+
Output: PluginRemoveResult (mostra docs cli)
|
|
894
|
+
|
|
895
|
+
Exit codes:
|
|
896
|
+
0 success
|
|
897
|
+
1 artifact failure (verify failed, publish refused, the artifact's state refused the request)
|
|
898
|
+
2 usage error
|
|
899
|
+
3 environment error (no runtime, browser or socket; the home; an unsupported platform)
|
|
900
|
+
4 timeout (--timeout passed)
|
|
901
|
+
|
|
902
|
+
Example:
|
|
903
|
+
mostra plugin remove mostra-plugin-pdf --artifact ./report
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
## mostra plugin validate
|
|
907
|
+
|
|
908
|
+
```text
|
|
909
|
+
Check a plugin package as Mostra would load it: its manifest, contract ranges, entries and licenses.
|
|
910
|
+
|
|
911
|
+
Usage:
|
|
912
|
+
mostra plugin validate [<dir>] [flags]
|
|
913
|
+
|
|
914
|
+
Arguments:
|
|
915
|
+
<dir> The plugin's package directory. Default: the current directory.
|
|
916
|
+
|
|
917
|
+
Flags:
|
|
918
|
+
--accept-license <id> Acknowledge a license the install brings (LicenseRef-Remotion), recorded in the lockfile. Repeat or comma-separate.
|
|
919
|
+
|
|
920
|
+
Global flags:
|
|
921
|
+
--json Print one JSON envelope on stdout (NDJSON for streams).
|
|
922
|
+
--home <dir> Use this Mostra home instead of MOSTRA_HOME or the default.
|
|
923
|
+
--cwd <dir> Resolve relative paths from this directory.
|
|
924
|
+
--timeout <d> Give up on the instance after this long (exit 4), such as 30s or 5m.
|
|
925
|
+
--help Show this command's help; with --json, its definition.
|
|
926
|
+
|
|
927
|
+
Output: PluginValidateResult (mostra docs cli)
|
|
928
|
+
|
|
929
|
+
Exit codes:
|
|
930
|
+
0 success
|
|
931
|
+
1 artifact failure (verify failed, publish refused, the artifact's state refused the request)
|
|
932
|
+
2 usage error
|
|
933
|
+
3 environment error (no runtime, browser or socket; the home; an unsupported platform)
|
|
934
|
+
4 timeout (--timeout passed)
|
|
935
|
+
|
|
936
|
+
Example:
|
|
937
|
+
mostra plugin validate ./my-plugin
|
|
938
|
+
```
|
|
939
|
+
|
|
799
940
|
## mostra export
|
|
800
941
|
|
|
801
942
|
```text
|
|
@@ -808,7 +949,8 @@ Arguments:
|
|
|
808
949
|
<artifact> The artifact: its source path or its ID.
|
|
809
950
|
|
|
810
951
|
Flags:
|
|
811
|
-
--as <
|
|
952
|
+
--as <exporter> What to write: `bundle`, the version's builds, manifest, lockfile and source; or the ID of an exporter a plugin of the artifact or the home contributes. Default: bundle.
|
|
953
|
+
--option <name=value> An option for a plugin's exporter; its value is read as JSON when it parses.
|
|
812
954
|
--out <path> Where: a new directory, or one archive when it ends in .tar.zst.
|
|
813
955
|
--version <number|id> The version. Default: the latest.
|
|
814
956
|
|
|
@@ -945,6 +945,42 @@
|
|
|
945
945
|
"explanation": "The capability link was revoked (`view/revoke`), replaced (`view/rotate`), or reached the end of its `ttl`. Every session started from it ends too. The gateway answers 410. Local links have no expiry unless one was asked for.",
|
|
946
946
|
"fix": "Get a new link from whoever shared this one. An agent mints it with `view/url`, or rotates the old one with `view/rotate`, and shares the new URL."
|
|
947
947
|
},
|
|
948
|
+
{
|
|
949
|
+
"code": "MOSTRA_LICENSE_ACCEPT_INVALID",
|
|
950
|
+
"severity": "error",
|
|
951
|
+
"phase": "host",
|
|
952
|
+
"title": "Accepted license not understood",
|
|
953
|
+
"hint": "Pass a license ID such as LicenseRef-Remotion, or * for every license.",
|
|
954
|
+
"explanation": "A value of `--accept-license` (or of the host's `licenses.accept`) is neither an SPDX license ID, nor a `LicenseRef-` reference, nor `*`.",
|
|
955
|
+
"fix": "Copy the ID from the `MOSTRA_LICENSE_UNACCEPTED` diagnostic that asked for it."
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"code": "MOSTRA_LICENSE_MISMATCH",
|
|
959
|
+
"severity": "warning",
|
|
960
|
+
"phase": "manifest",
|
|
961
|
+
"title": "Declared license differs",
|
|
962
|
+
"hint": "Make the manifest's declaration match the package's own license field.",
|
|
963
|
+
"explanation": "The manifest declares a license for a package (in `bundledLicenses`, or its own `license`) that differs from the license field the package itself carries. Mostra discloses the package's own field, which it can read, and uses a declaration only where the field can't be read.",
|
|
964
|
+
"fix": "Correct the declaration, or the package's license field if the declaration is right."
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"code": "MOSTRA_LICENSE_UNACCEPTED",
|
|
968
|
+
"severity": "error",
|
|
969
|
+
"phase": "contract",
|
|
970
|
+
"title": "License needs acknowledgment",
|
|
971
|
+
"hint": "Read the license the message names, then run the command in this diagnostic's fix to accept it.",
|
|
972
|
+
"explanation": "The install brings a license that isn't OSI-approved and isn't a public-domain dedication or another free license: a source-available or proprietary license, or one Mostra can't read. Such a license is accepted once per artifact (or for the home), by `--accept-license <id>` or by the host's policy, and the lockfile records it (D31). This is disclosure, not a limit: anyone may accept, and nothing was installed or recorded before they do. The message names each license, its class and the packages under it.",
|
|
973
|
+
"fix": "Read the license's terms (the message gives its summary and URL when the plugin declares them), then add the plugin again with `--accept-license <id>` for each ID, as the fix shows."
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
"code": "MOSTRA_LICENSE_UNDECLARED",
|
|
977
|
+
"severity": "warning",
|
|
978
|
+
"phase": "manifest",
|
|
979
|
+
"title": "Dependency license not declared",
|
|
980
|
+
"hint": "Declare the license in the plugin manifest's bundledLicenses, with a summary and a URL.",
|
|
981
|
+
"explanation": "A package the plugin brings has a license that needs an acknowledgment, and the manifest's `bundledLicenses` doesn't declare it, so the person installing sees only the package's own license field. Mostra still finds and discloses it from the installed packages.",
|
|
982
|
+
"fix": "Add `{ \"package\": \"<name>\", \"license\": \"<expression>\", \"summary\": \"…\", \"url\": \"…\" }` to `bundledLicenses`."
|
|
983
|
+
},
|
|
948
984
|
{
|
|
949
985
|
"code": "MOSTRA_LIVE_SOURCE_FAILED",
|
|
950
986
|
"severity": "error",
|
|
@@ -1008,6 +1044,87 @@
|
|
|
1008
1044
|
"explanation": "A resource the page loaded from the artifact's own origin (the document, a script, a style, an image, a font, or a fetch by artifact code) failed or answered 4xx or 5xx. Requests the browser makes on its own, such as `/favicon.ico`, and Mostra's own protocol aren't counted.",
|
|
1009
1045
|
"fix": "Put the file in `public/` (served at the root) or import it from the code so the build includes it, and check the path's spelling."
|
|
1010
1046
|
},
|
|
1047
|
+
{
|
|
1048
|
+
"code": "MOSTRA_PACK_ADDRESS_INVALID",
|
|
1049
|
+
"severity": "error",
|
|
1050
|
+
"phase": "host",
|
|
1051
|
+
"title": "Item address not understood",
|
|
1052
|
+
"hint": "Use an item URL, a local .json item, owner/repo/item for GitHub, or an @namespace/item your components.json registers.",
|
|
1053
|
+
"explanation": "`mostra add` reads an item address in shadcn's forms: an `https:` URL of an item's JSON, a path to a local `.json` item, a GitHub item (`owner/repo/item[#ref]`), or `@namespace/item` resolved through the `registries` of the artifact's `components.json`. A bare name in an item's `registryDependencies` means shadcn's own registry. This address is none of those, or names a namespace the artifact doesn't register, or a plain `http:` URL to another machine.",
|
|
1054
|
+
"fix": "Correct the address, or add the namespace to `registries` in the artifact's `components.json` (`\"@acme\": \"https://registry.acme.com/r/{name}.json\"`)."
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
"code": "MOSTRA_PACK_CSS_UNIMPORTED",
|
|
1058
|
+
"severity": "warning",
|
|
1059
|
+
"phase": "compile",
|
|
1060
|
+
"title": "Item CSS not imported",
|
|
1061
|
+
"hint": "Import the stylesheet this diagnostic names from the artifact's entry.",
|
|
1062
|
+
"explanation": "The item brings CSS variables or rules, which Mostra wrote into a stylesheet of the artifact, but the artifact's entry doesn't import that stylesheet, so the page doesn't load them yet. Mostra writes into the stylesheet the entry imports when there is one (or the one `components.json` names), and creates `styles.css` otherwise.",
|
|
1063
|
+
"fix": "Add `import \"./styles.css\";` (the path the message names) to the artifact's entry, after any other stylesheet."
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"code": "MOSTRA_PACK_FETCH_FAILED",
|
|
1067
|
+
"severity": "error",
|
|
1068
|
+
"phase": "network",
|
|
1069
|
+
"title": "Registry item couldn't be read",
|
|
1070
|
+
"hint": "Check the network and the registry, then run the command again.",
|
|
1071
|
+
"explanation": "Reading the item failed: the registry couldn't be reached, answered an error other than 404, sent more than 8 MiB, took longer than 30 s, or redirected to an address Mostra doesn't follow. Nothing was written.",
|
|
1072
|
+
"fix": "Run the command again once the registry answers. Behind a proxy, set `HTTPS_PROXY` for the Mostra daemon."
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"code": "MOSTRA_PACK_FILE_EXISTS",
|
|
1076
|
+
"severity": "error",
|
|
1077
|
+
"phase": "host",
|
|
1078
|
+
"title": "File already exists",
|
|
1079
|
+
"hint": "Run the command again with `--overwrite` to replace the files the message lists, or move them first.",
|
|
1080
|
+
"explanation": "The artifact already has files where the item writes, with other content. Mostra never replaces an artifact's file without being asked, as shadcn asks before it overwrites; nothing was written.",
|
|
1081
|
+
"fix": "Add `--overwrite` to replace them (`mostra add <item> --artifact <path> --overwrite`), or rename your files and add the item again."
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"code": "MOSTRA_PACK_ITEM_INVALID",
|
|
1085
|
+
"severity": "error",
|
|
1086
|
+
"phase": "manifest",
|
|
1087
|
+
"title": "Registry item invalid",
|
|
1088
|
+
"hint": "Fix the field this diagnostic names in the item's JSON.",
|
|
1089
|
+
"explanation": "The item isn't a shadcn registry item Mostra can install: it isn't JSON, misses `name` or `type`, a file has no `path`, a `registry:file` or `registry:page` has no `target`, a file has neither `content` nor a path its registry holds, or the `mostra` block has a wrong value. Every field shadcn's schema allows is accepted, and unknown keys are kept.",
|
|
1090
|
+
"fix": "Correct the item (its JSON Schema is `https://ui.shadcn.com/schema/registry-item.json`, plus the `mostra` block in `@mostra/protocol/schemas/plugin-manifest.schema.json`)."
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
"code": "MOSTRA_PACK_ITEM_NOT_FOUND",
|
|
1094
|
+
"severity": "error",
|
|
1095
|
+
"phase": "network",
|
|
1096
|
+
"title": "Registry item not found",
|
|
1097
|
+
"hint": "Check the address; for a GitHub item, check the repository's registry.json and the ref.",
|
|
1098
|
+
"explanation": "The registry answered that the item doesn't exist (HTTP 404), the local file isn't there, or a GitHub repository's root `registry.json` has no item by that name. The message names the address and where Mostra looked.",
|
|
1099
|
+
"fix": "Correct the address. For a GitHub item, `owner/repo/item` names an item of the repository's root `registry.json`, at its default branch unless `#ref` says otherwise."
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"code": "MOSTRA_PACK_NOT_APPLIED",
|
|
1103
|
+
"severity": "hint",
|
|
1104
|
+
"phase": "host",
|
|
1105
|
+
"title": "Item part not applied",
|
|
1106
|
+
"hint": "Read what the item asked for and apply it yourself if the artifact needs it.",
|
|
1107
|
+
"explanation": "The item asks for something an artifact doesn't have: environment variables (`envVars`; server code reads secrets with `secret()`, set by `mostra secret set`), a Tailwind 3 configuration (`tailwind.config`; Tailwind 4 reads `cssVars.theme`), a font through `next/font`, or a design-system configuration (`registry:base`, `registry:style`). Mostra installs the rest and lists these.",
|
|
1108
|
+
"fix": "Set the secrets the item's server code needs with `mostra secret set NAME`, and move any Tailwind 3 theme into the item's `cssVars.theme` or your stylesheet's `@theme`."
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"code": "MOSTRA_PACK_OFFLINE",
|
|
1112
|
+
"severity": "error",
|
|
1113
|
+
"phase": "network",
|
|
1114
|
+
"title": "Registry item unavailable offline",
|
|
1115
|
+
"hint": "Connect to the network, or add the item from a local .json file.",
|
|
1116
|
+
"explanation": "Mostra is offline (`MOSTRA_OFFLINE` is set, or no network interface is up), and the item, or one of its registry dependencies, is on a remote registry. Nothing was written.",
|
|
1117
|
+
"fix": "Run the command again with the network up, or download the item and add it from its file: `mostra add ./item.json --artifact <path>`."
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
"code": "MOSTRA_PACK_TARGET_INVALID",
|
|
1121
|
+
"severity": "error",
|
|
1122
|
+
"phase": "host",
|
|
1123
|
+
"title": "Item file outside the artifact",
|
|
1124
|
+
"hint": "Ask the item's author to fix its target; Mostra writes an item's files only inside the artifact.",
|
|
1125
|
+
"explanation": "A file of the item would land outside the artifact's directory (`../`, an absolute path), on a name not every system can hold (`<>:\"|?*`, a Windows device name, a trailing dot or space), on Mostra's own files, or on two names that differ only in case. Nothing was written.",
|
|
1126
|
+
"fix": "Use a corrected item, or copy the files you need into the artifact yourself."
|
|
1127
|
+
},
|
|
1011
1128
|
{
|
|
1012
1129
|
"code": "MOSTRA_PLATFORM_UNSUPPORTED",
|
|
1013
1130
|
"severity": "error",
|
|
@@ -1017,6 +1134,123 @@
|
|
|
1017
1134
|
"explanation": "Mostra runs on macOS, Linux with glibc and Windows, each on x64 and arm64. On any other operating system or architecture (32-bit Windows, musl-based Linux such as Alpine, BSDs) every entry point stops with this code before it creates or changes anything, because the process model, the control endpoint, storage and the runtime bundle are built and tested only on those platforms. The message names the platform that was detected.",
|
|
1018
1135
|
"fix": "Run Mostra on macOS, a glibc-based Linux or Windows, with an x64 or arm64 processor. On Alpine Linux, use a glibc-based image instead."
|
|
1019
1136
|
},
|
|
1137
|
+
{
|
|
1138
|
+
"code": "MOSTRA_PLUGIN_CONFLICT",
|
|
1139
|
+
"severity": "error",
|
|
1140
|
+
"phase": "contract",
|
|
1141
|
+
"title": "Plugins contribute the same ID",
|
|
1142
|
+
"hint": "Remove one of the two plugins the message names, or use releases whose IDs differ.",
|
|
1143
|
+
"explanation": "Two plugins of one artifact, or one of the artifact's and one of the home's, contribute the same ID to the same contract (two exporters `pdf`, two commands `term record`), or a plugin takes an ID Mostra builds in (the exporters `static`, `html`, `bundle` and `snapshot`). Nothing is overridden silently (ROUND-3 §6.4): the message names both sides.",
|
|
1144
|
+
"fix": "Remove one plugin with `mostra plugin remove <package> --artifact <path>` (or `--global`), then add the other again if needed."
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
"code": "MOSTRA_PLUGIN_CONTRACT_UNSUPPORTED",
|
|
1148
|
+
"severity": "error",
|
|
1149
|
+
"phase": "contract",
|
|
1150
|
+
"title": "Contract version not implemented",
|
|
1151
|
+
"hint": "Install a version of the plugin built for this Mostra's contracts, or update Mostra.",
|
|
1152
|
+
"explanation": "The plugin declares a contract range, or carries a definition stamped with a contract version, that this Mostra release doesn't serve. Each extension contract is its own package with its own version (D30): within a line changes are additive, so Mostra serves stamps of its line up to the version it implements, and a range must admit that version. The message names the contract, the plugin's range or stamp, and the version this release implements. Mostra reports it when the plugin is added, and when `verify` or `publish` loads it, so an artifact whose plugin a newer runtime no longer serves is told before it is published.",
|
|
1153
|
+
"fix": "Add a release of the plugin whose range admits the version the message names (`mostra plugin add <package>@<version> --artifact <path>`), or run a Mostra release that implements the plugin's contract version, or remove the plugin with `mostra plugin remove`."
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
"code": "MOSTRA_PLUGIN_ENTRY_INVALID",
|
|
1157
|
+
"severity": "error",
|
|
1158
|
+
"phase": "contract",
|
|
1159
|
+
"title": "Plugin entry doesn't load",
|
|
1160
|
+
"hint": "Fix the module the message names so it exports the definition its contract's define function returns.",
|
|
1161
|
+
"explanation": "A contribution's `entry` module is missing from the package, leaves it, failed to load, or doesn't export (at `export`, `default` when absent) a definition stamped by the contract's blueprint (`defineExporter`, `defineCliCommand` …) with the ID the manifest gives. Mostra reads the stamp from the loaded object itself, in a child process of the instance, so a manifest alone can't claim a contract. Contributions that run in the page (embed engines, anchor providers) are checked when the page uses them.",
|
|
1162
|
+
"fix": "Build the plugin so the module exists, export the value its `define*` function returns, and keep the manifest's ID equal to the definition's. Then run `mostra plugin validate <dir>`."
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"code": "MOSTRA_PLUGIN_EXPORTER_UNKNOWN",
|
|
1166
|
+
"severity": "error",
|
|
1167
|
+
"phase": "host",
|
|
1168
|
+
"title": "No such exporter",
|
|
1169
|
+
"hint": "Use one of the exporters the message lists, or add a plugin that contributes this one.",
|
|
1170
|
+
"explanation": "`mostra export <artifact> --as <id> --out <path>` names an exporter that neither Mostra builds in nor any plugin of the artifact or the home contributes. The message lists every exporter available for the artifact.",
|
|
1171
|
+
"fix": "Pick an exporter from the list, or install a plugin that contributes it: `mostra plugin add <package> --artifact <path>`."
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
"code": "MOSTRA_PLUGIN_FAILED",
|
|
1175
|
+
"severity": "error",
|
|
1176
|
+
"phase": "runtime",
|
|
1177
|
+
"title": "Plugin failed",
|
|
1178
|
+
"hint": "Read the plugin's error in the message and report it to the plugin's author if it isn't yours to fix.",
|
|
1179
|
+
"explanation": "A plugin's contribution threw, returned something its contract doesn't allow (a file outside the export, a result that isn't JSON), or ran past its time limit while Mostra ran it. It runs in a child process of the instance, so the instance and other artifacts are unaffected; nothing it returned was kept.",
|
|
1180
|
+
"fix": "Fix the contribution if it is your plugin; otherwise update or remove it (`mostra plugin remove`)."
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
"code": "MOSTRA_PLUGIN_MANIFEST_INVALID",
|
|
1184
|
+
"severity": "error",
|
|
1185
|
+
"phase": "manifest",
|
|
1186
|
+
"title": "Plugin manifest invalid",
|
|
1187
|
+
"hint": "Fix the field this diagnostic names in the plugin's package.json, then run `mostra plugin validate` again.",
|
|
1188
|
+
"explanation": "A field of the plugin's manifest, the `\"mostra\"` key of its `package.json`, isn't one Mostra can load: a required field is missing, a value has the wrong form, a contribution kind has no contract range, an ID is contributed twice, a command would take one of `mostra`'s own words, or a license isn't an SPDX expression. The location points at the field, and `mostra plugin validate` reports every one at once.",
|
|
1189
|
+
"fix": "Correct the field (the message says what it expects) and validate again. The manifest's shape is published as JSON Schema in `@mostra/protocol/schemas/plugin-manifest.schema.json`."
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"code": "MOSTRA_PLUGIN_MANIFEST_WARNING",
|
|
1193
|
+
"severity": "warning",
|
|
1194
|
+
"phase": "manifest",
|
|
1195
|
+
"title": "Plugin manifest questionable",
|
|
1196
|
+
"hint": "Check the field this diagnostic names; Mostra loads the plugin and ignores what it doesn't know.",
|
|
1197
|
+
"explanation": "The plugin's manifest has something this Mostra release loads around: a key it doesn't know, an effect or a system it doesn't know, or a contract declared with nothing contributed to it. Manifests grow additively, so a newer plugin may carry keys an older Mostra skips; a misspelled key is skipped the same way, which can leave a contribution or a license undeclared.",
|
|
1198
|
+
"fix": "Correct the field if it is a mistake. If it is something a newer Mostra reads, nothing is needed."
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
"code": "MOSTRA_PLUGIN_NOT_A_PLUGIN",
|
|
1202
|
+
"severity": "error",
|
|
1203
|
+
"phase": "manifest",
|
|
1204
|
+
"title": "Not a Mostra plugin",
|
|
1205
|
+
"hint": "Add the package with `mostra add` if it is an ordinary package, or give it a \"mostra\" manifest if it is a plugin.",
|
|
1206
|
+
"explanation": "The package has no `\"mostra\"` key in its `package.json`, so it contributes nothing Mostra could load. `mostra plugin add` installs only plugins; ordinary npm packages go through `mostra add`.",
|
|
1207
|
+
"fix": "Run `mostra add <package> --artifact <path>` for an ordinary package. For a plugin you write, add the manifest (`mostra docs guide/plugins`) and run `mostra plugin validate`."
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
"code": "MOSTRA_PLUGIN_NOT_INSTALLED",
|
|
1211
|
+
"severity": "error",
|
|
1212
|
+
"phase": "host",
|
|
1213
|
+
"title": "Plugin not installed",
|
|
1214
|
+
"hint": "Check the package name against `mostra plugin list`.",
|
|
1215
|
+
"explanation": "The package isn't one of the plugins of the artifact (or of the home) the call names, so there is nothing to remove.",
|
|
1216
|
+
"fix": "List the scope's plugins with `mostra plugin list --artifact <path>` (or `--global`) and use a name from it."
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"code": "MOSTRA_PLUGIN_OPTIONS_INVALID",
|
|
1220
|
+
"severity": "error",
|
|
1221
|
+
"phase": "contract",
|
|
1222
|
+
"title": "Exporter options invalid",
|
|
1223
|
+
"hint": "Give the options the exporter's schema asks for, each as `--option name=value`.",
|
|
1224
|
+
"explanation": "The options given to a plugin's exporter don't fit the JSON Schema its definition declares (`options`), or it declares none and was given some. Mostra checks them in the plugin's child before the exporter runs, so nothing was exported.",
|
|
1225
|
+
"fix": "Read the exporter's options in its plugin's documentation (`mostra plugin list` names the plugin), and run `mostra export <artifact> --as <exporter> --out <path> --option name=value` with them. A value that reads as JSON (`3`, `true`, `[\"a\"]`) is passed as that value, anything else as text."
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
"code": "MOSTRA_PLUGIN_PLATFORM_UNSUPPORTED",
|
|
1229
|
+
"severity": "warning",
|
|
1230
|
+
"phase": "platform",
|
|
1231
|
+
"title": "Plugin doesn't name this system",
|
|
1232
|
+
"hint": "Expect the plugin's Node.js parts to fail here, or use a plugin that supports this system.",
|
|
1233
|
+
"explanation": "The plugin's manifest lists the systems it runs on (`platforms`), and this one isn't among them. Mostra installs it anyway (it adds no capability limits), and says so, since its exporters, checks, connectors or commands may fail here.",
|
|
1234
|
+
"fix": "Use the plugin on a system it lists, or ask its author to support this one."
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
"code": "MOSTRA_PLUGIN_SCOPE_INVALID",
|
|
1238
|
+
"severity": "error",
|
|
1239
|
+
"phase": "contract",
|
|
1240
|
+
"title": "Plugin can't be installed there",
|
|
1241
|
+
"hint": "Install the plugin for an artifact with `--artifact`, or pass exactly one of `--artifact` and `--global`.",
|
|
1242
|
+
"explanation": "Plugins are installed for one artifact (recorded in its lockfile, part of its versions) or, when they contribute only exporters and CLI commands, for the whole home (ROUND-3 §6.4). This plugin contributes something that changes what an artifact's version is (an embed engine, a verify check, an anchor provider, a connector or a pack), so it can't be installed for the home; or the call named both scopes or neither.",
|
|
1243
|
+
"fix": "Run `mostra plugin add <package> --artifact <path>` for each artifact that uses it."
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"code": "MOSTRA_PLUGIN_SHADOWED",
|
|
1247
|
+
"severity": "warning",
|
|
1248
|
+
"phase": "contract",
|
|
1249
|
+
"title": "Plugin contribution shadowed",
|
|
1250
|
+
"hint": "Remove one of the two plugins if the artifact should use the other's contribution.",
|
|
1251
|
+
"explanation": "An artifact's plugin and one of the home's (`--global`) contribute the same exporter or CLI command. Nothing is refused: in this artifact its own plugin's contribution is used, and the home's everywhere else. A home install never breaks an artifact that worked.",
|
|
1252
|
+
"fix": "Nothing is needed when the artifact's own contribution is the one it should use. Otherwise remove it from the artifact (`mostra plugin remove <package> --artifact <path>`), and the home's is used."
|
|
1253
|
+
},
|
|
1020
1254
|
{
|
|
1021
1255
|
"code": "MOSTRA_PUBLISH_ID_CONFLICT",
|
|
1022
1256
|
"severity": "error",
|