@thenavidm/midjourney-mcp-cli 1.3.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +1,31 @@
1
1
  /**
2
- * Shared plumbing every tool uses.
2
+ * Shared plumbing every tool uses, now on Slipway.
3
3
  *
4
- * Registering tools by hand is one chance per tool to forget an annotation,
5
- * leak a stack trace, or return a shape the model cannot read. This wraps all
6
- * of it once so a tool module only describes what it actually does.
4
+ * Tool modules keep describing themselves with a Zod shape, a risk and a
5
+ * handler. This adapter turns each into a Slipway tool, so the MCP server, the
6
+ * CLI, the write guard, annotations and errors all come from the framework
7
+ * instead of a copy kept in this repo.
7
8
  */
8
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
- import { z, type ZodRawShape } from "zod";
9
+ import { SlipwayError, z, type Risk as SlipwayRisk, type Tool } from "@thenavidm/slipway";
10
10
  import type { MidjourneyClient } from "../api/client.js";
11
11
  import type { Config } from "../config.js";
12
- import { needsConfirm, type Risk, type WriteGuard } from "../safety.js";
12
+ import { MidjourneyError } from "../api/errors.js";
13
+ /**
14
+ * Four levels, one more than Slipway names: `spend` costs GPU time from the
15
+ * plan. It reaches Slipway as a write that spends, so it needs confirming and
16
+ * MIDJOURNEY_ALLOW_DESTRUCTIVE=0 refuses it, while clients still see a write.
17
+ */
18
+ export type Risk = SlipwayRisk | "spend";
13
19
  export type ToolContext = {
14
20
  client: MidjourneyClient;
15
21
  config: Config;
16
- guard: WriteGuard;
17
- };
18
- export type ToolResult = {
19
- content: {
20
- type: "text";
21
- text: string;
22
- }[];
23
- isError?: boolean;
24
- };
25
- /**
26
- * Handlers return data, never pre-rendered text.
27
- *
28
- * The sibling Bluesky server got this wrong: its read handlers returned a
29
- * formatted string, so `--json` handed back that string as a JSON value and
30
- * `jq` had no fields to reach, while its writes returned objects. Two halves
31
- * that disagree, and nothing on the page lets a reader predict which is which.
32
- * Formatting is a presentation decision made here, at the edge, from data.
33
- */
34
- export declare function ok(data: unknown): ToolResult;
35
- /**
36
- * Errors come back as a normal result with `isError`, not a thrown exception.
37
- *
38
- * A thrown MCP error reaches the model as a protocol failure with no structure.
39
- * A result it can read says what went wrong and usually how to fix it, which is
40
- * the difference between a correct retry and a give-up.
41
- */
42
- export declare function fail(error: unknown): ToolResult;
43
- /** Required by every tool that spends money or cannot be undone. */
44
- export declare const confirmArg: {
45
- confirm: z.ZodOptional<z.ZodBoolean>;
46
22
  };
47
23
  /** Paging, on every tool that returns a list. */
48
24
  export declare const pageArgs: {
49
25
  limit: z.ZodOptional<z.ZodNumber>;
50
26
  cursor: z.ZodOptional<z.ZodString>;
51
27
  };
52
- export type ToolSpec<S extends ZodRawShape> = {
28
+ export type ToolSpec<S extends Shape> = {
53
29
  name: string;
54
30
  /** One line, imperative. Shown in tool pickers. */
55
31
  title: string;
@@ -62,23 +38,18 @@ export type ToolSpec<S extends ZodRawShape> = {
62
38
  /** One line for the audit log and the confirm message, when this changes something. */
63
39
  summary?: (args: z.infer<z.ZodObject<S>>) => string;
64
40
  };
65
- export declare function defineTool<S extends ZodRawShape>(spec: ToolSpec<S>): ToolSpec<S>;
41
+ export type AnyToolSpec = Tool<ToolContext>;
42
+ export declare function makeContext(client: MidjourneyClient, config: Config): ToolContext;
43
+ /** Clamp a caller-supplied limit into something the app will accept. */
44
+ export declare function clamp(value: number | undefined, fallback: number, max?: number): number;
66
45
  /**
67
- * A tool of any shape, for the one place tools are held together in a list.
68
- *
69
- * `ToolSpec` is generic over its schema, so a list of tools with different
70
- * schemas has no single type: each handler takes a different argument shape and
71
- * function parameters are contravariant. The type safety that matters lives
72
- * inside each `defineTool` call, where schema and handler are checked against
73
- * each other. This only loosens the seam where they are collected.
46
+ * Kept so tool modules read the same, but never sent: Slipway adds `confirm`
47
+ * to every irreversible tool itself, with one description everywhere.
74
48
  */
75
- export type AnyToolSpec = Omit<ToolSpec<ZodRawShape>, "handler" | "summary"> & {
76
- handler: (args: never, ctx: ToolContext) => Promise<unknown>;
77
- summary?: (args: never) => string;
49
+ export declare const confirmArg: {
50
+ confirm: z.ZodOptional<z.ZodBoolean>;
78
51
  };
79
- /** Register one tool against the server, with guarding and error handling applied. */
80
- export declare function register(server: McpServer, contextFor: (extra: unknown) => ToolContext, spec: AnyToolSpec): void;
81
- export declare function makeContext(client: MidjourneyClient, config: Config, guard: WriteGuard): ToolContext;
82
- /** Clamp a caller-supplied limit into something the app will accept. */
83
- export declare function clamp(value: number | undefined, fallback: number, max?: number): number;
84
- export { needsConfirm };
52
+ type Shape = Record<string, z.ZodType>;
53
+ export declare function toSlipway(error: MidjourneyError): SlipwayError;
54
+ export declare function defineTool<S extends Shape>(spec: ToolSpec<S>): Tool<ToolContext>;
55
+ export {};
package/dist/tools/kit.js CHANGED
@@ -1,49 +1,14 @@
1
1
  /**
2
- * Shared plumbing every tool uses.
2
+ * Shared plumbing every tool uses, now on Slipway.
3
3
  *
4
- * Registering tools by hand is one chance per tool to forget an annotation,
5
- * leak a stack trace, or return a shape the model cannot read. This wraps all
6
- * of it once so a tool module only describes what it actually does.
4
+ * Tool modules keep describing themselves with a Zod shape, a risk and a
5
+ * handler. This adapter turns each into a Slipway tool, so the MCP server, the
6
+ * CLI, the write guard, annotations and errors all come from the framework
7
+ * instead of a copy kept in this repo.
7
8
  */
8
- import { z } from "zod";
9
+ import { EXIT, SlipwayError, toolkit, z } from "@thenavidm/slipway";
9
10
  import { MidjourneyError } from "../api/errors.js";
10
- import { annotationsFor, needsConfirm } from "../safety.js";
11
- /**
12
- * Handlers return data, never pre-rendered text.
13
- *
14
- * The sibling Bluesky server got this wrong: its read handlers returned a
15
- * formatted string, so `--json` handed back that string as a JSON value and
16
- * `jq` had no fields to reach, while its writes returned objects. Two halves
17
- * that disagree, and nothing on the page lets a reader predict which is which.
18
- * Formatting is a presentation decision made here, at the edge, from data.
19
- */
20
- export function ok(data) {
21
- const text = typeof data === "string" ? data : JSON.stringify(data, null, 2);
22
- return { content: [{ type: "text", text }] };
23
- }
24
- /**
25
- * Errors come back as a normal result with `isError`, not a thrown exception.
26
- *
27
- * A thrown MCP error reaches the model as a protocol failure with no structure.
28
- * A result it can read says what went wrong and usually how to fix it, which is
29
- * the difference between a correct retry and a give-up.
30
- */
31
- export function fail(error) {
32
- const payload = error instanceof MidjourneyError
33
- ? error.toJSON()
34
- : { error: error?.message ?? String(error) };
35
- return {
36
- content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
37
- isError: true,
38
- };
39
- }
40
- /** Required by every tool that spends money or cannot be undone. */
41
- export const confirmArg = {
42
- confirm: z
43
- .boolean()
44
- .optional()
45
- .describe("Must be true for this to run. This call spends GPU time from the Midjourney plan, or cannot be undone, so it is refused without an explicit confirmation."),
46
- };
11
+ const kit = toolkit();
47
12
  /** Paging, on every tool that returns a list. */
48
13
  export const pageArgs = {
49
14
  limit: z
@@ -58,41 +23,8 @@ export const pageArgs = {
58
23
  .optional()
59
24
  .describe("Continue from a previous page. Pass the `cursor` from the last result."),
60
25
  };
61
- export function defineTool(spec) {
62
- return spec;
63
- }
64
- /** Register one tool against the server, with guarding and error handling applied. */
65
- export function register(server, contextFor, spec) {
66
- server.registerTool(spec.name, {
67
- title: spec.title,
68
- description: spec.description,
69
- inputSchema: spec.schema,
70
- annotations: {
71
- title: spec.title,
72
- ...annotationsFor(spec.risk, { idempotent: spec.idempotent }),
73
- },
74
- },
75
- // The SDK derives its callback type from the schema generic. This wrapper is
76
- // generic over the same shape, but TypeScript cannot prove the two are equal
77
- // through the indirection, so the cast lives at this single boundary rather
78
- // than in every tool definition.
79
- (async (args, extra) => {
80
- try {
81
- const ctx = contextFor(extra);
82
- if (spec.risk !== "read") {
83
- const summary = spec.summary?.(args) ?? spec.name;
84
- const confirm = args.confirm;
85
- ctx.guard.check(spec.name, spec.risk, confirm, summary);
86
- }
87
- return ok(await spec.handler(args, ctx));
88
- }
89
- catch (error) {
90
- return fail(error);
91
- }
92
- }));
93
- }
94
- export function makeContext(client, config, guard) {
95
- return { client, config, guard };
26
+ export function makeContext(client, config) {
27
+ return { client, config };
96
28
  }
97
29
  /** Clamp a caller-supplied limit into something the app will accept. */
98
30
  export function clamp(value, fallback, max = 100) {
@@ -100,5 +32,72 @@ export function clamp(value, fallback, max = 100) {
100
32
  return fallback;
101
33
  return Math.min(Math.max(Math.trunc(value), 1), max);
102
34
  }
103
- export { needsConfirm };
35
+ /**
36
+ * Kept so tool modules read the same, but never sent: Slipway adds `confirm`
37
+ * to every irreversible tool itself, with one description everywhere.
38
+ */
39
+ export const confirmArg = {
40
+ confirm: z.boolean().optional(),
41
+ };
42
+ /**
43
+ * The class decides the exit code, never the status: a Cloudflare challenge and
44
+ * a missing permission both arrive as 403, and only one is fixed by signing in.
45
+ * `api/errors.ts` already sorts every failure, as 1.3's CLI relied on. What
46
+ * else the error knew, the endpoint or the job id, rides along in `details`.
47
+ */
48
+ function classify(error) {
49
+ switch (error.name) {
50
+ case "ValidationError":
51
+ return { code: "usage", exitCode: EXIT.usage };
52
+ case "WriteBlockedError":
53
+ return { code: "refused", exitCode: EXIT.usage };
54
+ case "NotFoundError":
55
+ return { code: "not_found", exitCode: EXIT.notFound };
56
+ // Both need a person in the browser window: sign in, or let the check finish.
57
+ case "NotSignedInError":
58
+ case "ChallengeError":
59
+ return { code: "auth", exitCode: EXIT.auth };
60
+ case "RateLimitError":
61
+ return { code: "rate_limited", exitCode: EXIT.rateLimited };
62
+ case "TimeoutError":
63
+ case "JobTimeoutError":
64
+ return { code: "timeout", exitCode: EXIT.api };
65
+ default:
66
+ return { code: "api", exitCode: EXIT.api };
67
+ }
68
+ }
69
+ export function toSlipway(error) {
70
+ const { code, exitCode } = classify(error);
71
+ const { error: _message, type: _type, status: _status, ...rest } = error.toJSON();
72
+ const details = Object.fromEntries(Object.entries(rest).filter(([, value]) => value !== undefined && value !== ""));
73
+ return new SlipwayError(error.message, code, exitCode, {
74
+ ...(error.status ? { status: error.status } : {}),
75
+ ...(Object.keys(details).length ? { details } : {}),
76
+ cause: error,
77
+ });
78
+ }
79
+ export function defineTool(spec) {
80
+ const { confirm: _confirm, ...shape } = spec.schema;
81
+ const handler = spec.handler;
82
+ return kit.defineTool({
83
+ name: spec.name,
84
+ title: spec.title,
85
+ description: spec.description,
86
+ input: z.object(shape),
87
+ risk: spec.risk === "spend" ? "write" : spec.risk,
88
+ // 1.3's refusals said these, and "is public" is wrong for a private image.
89
+ ...(spec.risk === "spend" ? { spends: true, consequence: "spends GPU time off the Midjourney plan and cannot be refunded" } : {}),
90
+ ...(spec.risk === "destructive" ? { consequence: "cannot be undone" } : {}),
91
+ ...(spec.idempotent !== undefined ? { idempotent: spec.idempotent } : {}),
92
+ ...(spec.summary ? { summary: spec.summary } : {}),
93
+ handler: async (args, ctx) => {
94
+ try {
95
+ return await handler(args, ctx);
96
+ }
97
+ catch (error) {
98
+ throw error instanceof MidjourneyError ? toSlipway(error) : error;
99
+ }
100
+ },
101
+ });
102
+ }
104
103
  //# sourceMappingURL=kit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit.js","sourceRoot":"","sources":["../../src/tools/kit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAoB,MAAM,KAAK,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAA8B,MAAM,cAAc,CAAC;AAaxF;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,IAAa;IAC9B,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAA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I,EAAE,WAAW,EAAE,gEAAgE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjI,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAoD,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YAC3B,IAAI,CAAC;gBACH,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,YAAY,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACpE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,22 +1,2 @@
1
1
  /** The account's own organised work: folders, moodboards, storage. */
2
- import { z } from "zod";
3
- export declare const libraryTools: (import("./kit.js").ToolSpec<{}> | import("./kit.js").ToolSpec<{
4
- with_images: z.ZodOptional<z.ZodBoolean>;
5
- }> | import("./kit.js").ToolSpec<{
6
- moodboard: z.ZodString;
7
- references: z.ZodOptional<z.ZodNumber>;
8
- }> | import("./kit.js").ToolSpec<{
9
- title: z.ZodString;
10
- }> | import("./kit.js").ToolSpec<{
11
- moodboard: z.ZodString;
12
- job_id: z.ZodOptional<z.ZodString>;
13
- indexes: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
14
- urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
- }> | import("./kit.js").ToolSpec<{
16
- confirm: z.ZodOptional<z.ZodBoolean>;
17
- moodboard: z.ZodString;
18
- urls: z.ZodArray<z.ZodString, "many">;
19
- }> | import("./kit.js").ToolSpec<{
20
- path: z.ZodString;
21
- query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
22
- }>)[];
2
+ export declare const libraryTools: import("@thenavidm/slipway").Tool<import("./kit.js").ToolContext>[];
@@ -168,7 +168,7 @@ export const libraryTools = [
168
168
  schema: {
169
169
  path: z.string().describe("Path starting with /api/, for example '/api/folders'."),
170
170
  query: z
171
- .record(z.union([z.string(), z.number(), z.boolean()]))
171
+ .record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
172
172
  .optional()
173
173
  .describe("Query parameters to append."),
174
174
  },
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/tools/library.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,CAAC;QACT,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EACT,oGAAoG;QACtG,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO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and the personalisation attached to it. */
2
- export declare const profileTools: import("./kit.js").ToolSpec<{}>[];
2
+ export declare const profileTools: import("@thenavidm/slipway").Tool<import("./kit.js").ToolContext>[];
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Midjourney's own words, given to Slipway: the flag spellings its prompt
3
+ * syntax uses, and the words people type when they look for a command. Moved
4
+ * verbatim from 1.3's CLI.
5
+ */
6
+ /**
7
+ * Midjourney's own parameter spellings, accepted as flags.
8
+ *
9
+ * The schema names things in full because a tool description is read by a model
10
+ * that has never seen a Midjourney prompt. A person at a terminal has, and they
11
+ * will type `--ar 16:9`, because that is what the parameter is called
12
+ * everywhere Midjourney documents it. Refusing the name the whole ecosystem
13
+ * uses, to protect a naming convention nobody outside this repo can see, would
14
+ * be the wrong trade.
15
+ */
16
+ export declare const FLAG_ALIASES: Record<string, string>;
17
+ /**
18
+ * Words people use mapped onto words the tools use.
19
+ *
20
+ * Without this, "make a picture" matches nothing, because every tool says
21
+ * "generate" and "image". A lookup that only works when you already know the
22
+ * vocabulary is not a lookup.
23
+ */
24
+ export declare const SYNONYMS: Record<string, string[]>;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Midjourney's own words, given to Slipway: the flag spellings its prompt
3
+ * syntax uses, and the words people type when they look for a command. Moved
4
+ * verbatim from 1.3's CLI.
5
+ */
6
+ /**
7
+ * Midjourney's own parameter spellings, accepted as flags.
8
+ *
9
+ * The schema names things in full because a tool description is read by a model
10
+ * that has never seen a Midjourney prompt. A person at a terminal has, and they
11
+ * will type `--ar 16:9`, because that is what the parameter is called
12
+ * everywhere Midjourney documents it. Refusing the name the whole ecosystem
13
+ * uses, to protect a naming convention nobody outside this repo can see, would
14
+ * be the wrong trade.
15
+ */
16
+ export const FLAG_ALIASES = {
17
+ ar: "aspect",
18
+ v: "version",
19
+ s: "stylize",
20
+ c: "chaos",
21
+ sref: "style_refs",
22
+ sw: "style_weight",
23
+ oref: "omni_refs",
24
+ ow: "omni_weight",
25
+ iw: "image_weight",
26
+ q: "quality",
27
+ no: "negative",
28
+ p: "profile",
29
+ r: "repeat",
30
+ id: "job_id",
31
+ job: "job_id",
32
+ };
33
+ /**
34
+ * Words people use mapped onto words the tools use.
35
+ *
36
+ * Without this, "make a picture" matches nothing, because every tool says
37
+ * "generate" and "image". A lookup that only works when you already know the
38
+ * vocabulary is not a lookup.
39
+ */
40
+ export const SYNONYMS = {
41
+ picture: ["image"],
42
+ pictures: ["image"],
43
+ photo: ["image"],
44
+ photos: ["image"],
45
+ pic: ["image"],
46
+ pics: ["image"],
47
+ art: ["image"],
48
+ artwork: ["image"],
49
+ render: ["generate", "imagine"],
50
+ renders: ["image"],
51
+ make: ["generate", "imagine"],
52
+ create: ["generate", "imagine"],
53
+ draw: ["generate", "imagine"],
54
+ generation: ["generate"],
55
+ imagining: ["imagine"],
56
+ save: ["download"],
57
+ saving: ["download"],
58
+ fetch: ["download"],
59
+ grab: ["download"],
60
+ disk: ["download"],
61
+ history: ["jobs"],
62
+ past: ["jobs"],
63
+ previous: ["jobs"],
64
+ recent: ["jobs"],
65
+ running: ["queue"],
66
+ rendering: ["queue"],
67
+ pending: ["queue"],
68
+ progress: ["queue"],
69
+ redo: ["rerun"],
70
+ again: ["rerun"],
71
+ reroll: ["rerun"],
72
+ retry: ["rerun"],
73
+ account: ["whoami"],
74
+ login: ["whoami"],
75
+ logged: ["whoami"],
76
+ signed: ["whoami"],
77
+ auth: ["whoami"],
78
+ session: ["whoami"],
79
+ who: ["whoami"],
80
+ style: ["explore"],
81
+ styles: ["explore"],
82
+ inspiration: ["explore"],
83
+ browse: ["explore"],
84
+ folder: ["folders"],
85
+ moodboard: ["moodboards"],
86
+ quota: ["storage"],
87
+ space: ["storage"],
88
+ };
89
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAA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O,EAAE,CAAC,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,SAAS,EAAE,CAAC,OAAO,CAAC;IACpB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,MAAM,EAAE,CAAC,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,KAAK,EAAE,CAAC,QAAQ,CAAC;IACjB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,GAAG,EAAE,CAAC,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,MAAM,EAAE,CAAC,SAAS,CAAC;IACnB,WAAW,EAAE,CAAC,SAAS,CAAC;IACxB,MAAM,EAAE,CAAC,SAAS,CAAC;IACnB,MAAM,EAAE,CAAC,SAAS,CAAC;IACnB,SAAS,EAAE,CAAC,YAAY,CAAC;IACzB,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,KAAK,EAAE,CAAC,SAAS,CAAC;CACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thenavidm/midjourney-mcp-cli",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
4
4
  "description": "Midjourney MCP server and CLI for Claude Code and AI agents. 32 tools for generating images, following jobs to completion, downloading the real files, and building moodboards that make a style reusable.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,11 +23,12 @@
23
23
  "build:mcpb": "bash desktop-extension/build.sh"
24
24
  },
25
25
  "dependencies": {
26
- "@modelcontextprotocol/sdk": "^1.18.0",
27
- "zod": "^3.23.8"
26
+ "@thenavidm/slipway": "^0.1.8",
27
+ "zod": "^4.2.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^22.10.0",
31
+ "ajv": "^8.20.0",
31
32
  "typescript": "^5.7.0",
32
33
  "vitest": "^2.1.0"
33
34
  },
@@ -59,7 +60,8 @@
59
60
  "model-context-protocol",
60
61
  "text-to-image",
61
62
  "typescript",
62
- "windsurf"
63
+ "windsurf",
64
+ "slipway"
63
65
  ],
64
66
  "files": [
65
67
  "dist",
package/dist/cli.d.ts DELETED
@@ -1,112 +0,0 @@
1
- /**
2
- * The CLI adapter.
3
- *
4
- * `register()` in tools/kit.ts turns a `ToolSpec` into an MCP tool. This turns
5
- * the same spec into a shell command, from the same `ALL_TOOLS` array, through
6
- * the same handler and the same `WriteGuard`. Nothing is described twice, so a
7
- * tool added tomorrow is a command tomorrow and the two surfaces cannot drift.
8
- *
9
- * The command IS the tool name. `submit_imagine` runs as `submit-imagine`, and
10
- * the underscore form works too. Inventing a prettier command tree would mean a
11
- * hand-written mapping, which is exactly the drift this avoids, and it would
12
- * force anyone reading the SKILL.md to learn two vocabularies for one action.
13
- *
14
- * Zod is the only schema: every flag, its placeholder, its help text and its
15
- * validation come from the shape the MCP tool already declares.
16
- */
17
- import { type ZodRawShape } from "zod";
18
- import { type AnyToolSpec } from "./tools/kit.js";
19
- /** How a value reaches the parser, once the Zod wrappers are peeled off. */
20
- type FlagKind = "string" | "number" | "boolean" | "enum" | "json";
21
- type Flag = {
22
- key: string;
23
- flag: string;
24
- kind: FlagKind;
25
- required: boolean;
26
- repeatable: boolean;
27
- choices?: string[];
28
- help: string;
29
- };
30
- export declare function flagsFor(shape: ZodRawShape): Flag[];
31
- /**
32
- * Midjourney's own parameter spellings, accepted as flags.
33
- *
34
- * The schema names things in full because a tool description is read by a model
35
- * that has never seen a Midjourney prompt. A person at a terminal has, and they
36
- * will type `--ar 16:9`, because that is what the parameter is called
37
- * everywhere Midjourney documents it. Refusing the name the whole ecosystem
38
- * uses, to protect a naming convention nobody outside this repo can see, would
39
- * be the wrong trade.
40
- */
41
- export declare const FLAG_ALIASES: Record<string, string>;
42
- /**
43
- * Parse argv against a tool's flags.
44
- *
45
- * Zod does the real validation afterwards, so this only has to get values into
46
- * the right JavaScript types and catch the mistakes Zod would otherwise report
47
- * in terms of a schema the person at the terminal never sees.
48
- */
49
- export declare function parseArgs(argv: string[], flags: Flag[]): Record<string, unknown>;
50
- /**
51
- * Keep only the named fields.
52
- *
53
- * These endpoints are verbose: one explore page is tens of kilobytes of JSON,
54
- * most of it layout hints. An agent piping that into its own context pays for
55
- * every byte. `--select id,status,images` cuts it to what was asked for.
56
- * Dotted paths descend, and arrays are traversed element-wise.
57
- */
58
- export declare function selectFields(data: unknown, paths: string[]): unknown;
59
- /** Errors are JSON on stderr, always, so a caller parses one shape. */
60
- export declare function emitError(error: unknown): void;
61
- /**
62
- * The name this was invoked as, so examples are copy-pasteable.
63
- *
64
- * The package puts two binaries on the same file. Printing `midjourney-mcp` at
65
- * someone who typed `midjourney-cli` hands them a command that works but is not
66
- * the one in their fingers.
67
- */
68
- export declare function binName(): string;
69
- /**
70
- * Words people use mapped onto words the tools use.
71
- *
72
- * Without this, "make a picture" matches nothing, because every tool says
73
- * "generate" and "image". A lookup that only works when you already know the
74
- * vocabulary is not a lookup.
75
- */
76
- export declare const SYNONYMS: Record<string, string[]>;
77
- /**
78
- * Resolve a capability described in words to the command that does it.
79
- *
80
- * An agent that knows what it wants but not what this tool calls it would
81
- * otherwise read the full tool list to find out, which is the cost the CLI
82
- * exists to avoid. Scoring is deliberately dumb: name and title carry the most
83
- * weight, because a tool called `download_job` should win "download my images"
84
- * without any cleverness.
85
- */
86
- export declare function whichCommand(query: string): {
87
- tool: AnyToolSpec;
88
- score: number;
89
- }[];
90
- /**
91
- * The house contract, so a script branches on the number the same way for
92
- * every one of these CLIs: 0 ok, 2 usage or a refused write, 3 not found,
93
- * 4 auth, 5 API, 7 rate limited, 10 nothing configured.
94
- */
95
- export declare const EXIT: {
96
- readonly ok: 0;
97
- readonly usage: 2;
98
- readonly notFound: 3;
99
- readonly auth: 4;
100
- readonly api: 5;
101
- readonly rateLimited: 7;
102
- readonly config: 10;
103
- };
104
- /**
105
- * Midjourney has no error contract of its own, so api/errors.ts already sorts
106
- * every failure into a class. The class decides, never the status: a
107
- * Cloudflare challenge and a real permission failure are both a 403.
108
- */
109
- export declare function exitCodeFor(error: unknown): number;
110
- export declare function isCliCommand(argv: string[]): boolean;
111
- export declare function runCli(argv: string[]): Promise<number>;
112
- export {};