@imgly/codesign-mcp 0.3.4-next.20260916160458.g631cee6 → 0.3.4

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,4 +1,4 @@
1
1
  export declare const RELEASE_BUILD = true;
2
- export declare const CHANNEL = "next";
2
+ export declare const CHANNEL = "stable";
3
3
  export declare const DEV_ENV_HELP = "";
4
4
  //# sourceMappingURL=release-flags.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.generated.d.ts","sourceRoot":"","sources":["../../src/cli/release-flags.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,SAAS,CAAC;AAG9B,eAAO,MAAM,YAAY,KAAK,CAAC"}
1
+ {"version":3,"file":"release-flags.generated.d.ts","sourceRoot":"","sources":["../../src/cli/release-flags.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,WAAW,CAAC;AAGhC,eAAO,MAAM,YAAY,KAAK,CAAC"}
@@ -2,7 +2,7 @@
2
2
  // True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.
3
3
  export const RELEASE_BUILD = true;
4
4
  // Build profile: stable | next | canary. See src/flags/manifest.ts.
5
- export const CHANNEL = 'next';
5
+ export const CHANNEL = 'stable';
6
6
  // The frozen-knob --help section. Empty in a release build, so the names
7
7
  // are absent from the published dist, not just unprinted.
8
8
  export const DEV_ENV_HELP = "";
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.generated.js","sourceRoot":"","sources":["../../src/cli/release-flags.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,oEAAoE;AACpE,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAC9B,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-flags.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// Build profile: stable | next | canary. See src/flags/manifest.ts.\nexport const CHANNEL = 'next';\n// The frozen-knob --help section. Empty in a release build, so the names\n// are absent from the published dist, not just unprinted.\nexport const DEV_ENV_HELP = \"\";\n"]}
1
+ {"version":3,"file":"release-flags.generated.js","sourceRoot":"","sources":["../../src/cli/release-flags.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,oEAAoE;AACpE,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-flags.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// Build profile: stable | next | canary. See src/flags/manifest.ts.\nexport const CHANNEL = 'stable';\n// The frozen-knob --help section. Empty in a release build, so the names\n// are absent from the published dist, not just unprinted.\nexport const DEV_ENV_HELP = \"\";\n"]}
@@ -1,6 +1,9 @@
1
+ export type SystemPromptFormat = 'prompt' | 'agent';
2
+ export declare const FORMATS: readonly SystemPromptFormat[];
1
3
  export declare function buildSystemPrompt(assets: Record<string, string>, opts: {
2
4
  replace: boolean;
3
5
  videoEnabled: boolean;
6
+ format?: SystemPromptFormat;
4
7
  }): string;
5
8
  export declare function runSystemPrompt(argv: string[]): void;
6
9
  //# sourceMappingURL=system-prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/cli/system-prompt.ts"],"names":[],"mappings":"AAuCA,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,GAChD,MAAM,CAMR;AAoBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA+BpD"}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/cli/system-prompt.ts"],"names":[],"mappings":"AA8CA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,SAAS,kBAAkB,EAAwB,CAAC;AAE1E,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAAE,GAC7E,MAAM,CAOR;AA6BD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA0CpD"}
@@ -31,16 +31,30 @@ const REPLACE_PREAMBLE = '# You are a design agent\n\n' +
31
31
  'you decided. Your final message is short and factual: what you made, ' +
32
32
  'where the export is, what you would change next. Never report a design ' +
33
33
  'done before the judge loop has passed.\n\n---\n\n';
34
+ const FRONTMATTER = '---\n' +
35
+ 'name: codesign\n' +
36
+ 'description: IMG.LY CoDesign design agent — the full design context is ' +
37
+ 'preloaded, so it designs without reading reference docs first.\n' +
38
+ '---\n\n';
39
+ export const FORMATS = ['prompt', 'agent'];
34
40
  export function buildSystemPrompt(assets, opts) {
35
41
  const bundle = buildCodesignBundle(applyFeatureGates(assets, { videoEnabled: opts.videoEnabled }), { videoEnabled: opts.videoEnabled, header: FRAME });
36
- return (opts.replace ? REPLACE_PREAMBLE + bundle : bundle) + '\n';
42
+ const body = (opts.replace ? REPLACE_PREAMBLE + bundle : bundle) + '\n';
43
+ return opts.format === 'agent' ? FRONTMATTER + body : body;
37
44
  }
38
- const USAGE = `Usage: codesign-mcp system-prompt [--replace] [-o <file>]
45
+ const USAGE = `Usage: codesign-mcp system-prompt [--format <prompt|agent>] [--replace] [-o <file>]
39
46
 
40
47
  Writes the \`/codesign\` context — handbook, design rules, the edit-code API
41
48
  surface, judge, copy rules, quirks, fonts — as ONE system prompt, so a headless
42
49
  run needs no reference reads before its first \`edit\`.
43
50
 
51
+ --format FMT prompt (default) — a bare system prompt for
52
+ \`--append-system-prompt-file\` / \`--system-prompt-file\`.
53
+ agent — the same, with the \`name\`/\`description\`
54
+ frontmatter an agent definition needs, and \`--replace\`
55
+ implied: a Claude Code subagent (.claude/agents/<name>.md) or
56
+ an Antigravity custom agent
57
+ (~/.gemini/config/agents/<name>/agent.md).
44
58
  --replace for \`--system-prompt\`, which replaces the host's own prompt:
45
59
  adds a short agent preamble. The default output assumes the
46
60
  host prompt is still there (\`--append-system-prompt\`).
@@ -51,15 +65,25 @@ run needs no reference reads before its first \`edit\`.
51
65
  claude -p "an A4 recruiting poster for a bakery" \\
52
66
  --append-system-prompt-file codesign.md --mcp-config mcp.json
53
67
 
54
- Honours IMGLY_FEATURE_VIDEO: the video surface is described only when it is on.`;
68
+ codesign-mcp system-prompt --format agent -o .claude/agents/codesign.md
69
+
70
+ Honours IMGLY_FEATURE_VIDEO: the video surface is described only when it is on.
71
+ `;
55
72
  export function runSystemPrompt(argv) {
56
73
  let replace = false;
57
74
  let out;
75
+ let format = 'prompt';
58
76
  for (let i = 0; i < argv.length; i++) {
59
77
  const arg = argv[i];
60
78
  if (arg === '--replace') {
61
79
  replace = true;
62
80
  }
81
+ else if (arg === '--format') {
82
+ const value = argv[++i];
83
+ if (value === undefined || !FORMATS.includes(value))
84
+ throw new Error(`--format needs one of: ${FORMATS.join(', ')}\n\n${USAGE}`);
85
+ format = value;
86
+ }
63
87
  else if (arg === '-o' || arg === '--out') {
64
88
  out = argv[++i];
65
89
  if (out === undefined)
@@ -74,8 +98,9 @@ export function runSystemPrompt(argv) {
74
98
  }
75
99
  }
76
100
  const prompt = buildSystemPrompt(loadNodeAssets(), {
77
- replace,
78
- videoEnabled: videoEnabled(process.env)
101
+ replace: replace || format === 'agent',
102
+ videoEnabled: videoEnabled(process.env),
103
+ format
79
104
  });
80
105
  if (out === undefined) {
81
106
  process.stdout.write(prompt);
@@ -84,6 +109,8 @@ export function runSystemPrompt(argv) {
84
109
  writeFileSync(out, prompt, 'utf8');
85
110
  const flag = replace ? '--system-prompt-file' : '--append-system-prompt-file';
86
111
  process.stderr.write(`codesign-mcp: wrote ${prompt.length} characters to ${out}\n` +
87
- ` claude -p "<your brief>" ${flag} ${out} --mcp-config <mcp.json>\n`);
112
+ (format === 'agent'
113
+ ? ` an agent definition: put it where your host reads them, then select it by name.\n`
114
+ : ` claude -p "<your brief>" ${flag} ${out} --mcp-config <mcp.json>\n`));
88
115
  }
89
116
  //# sourceMappingURL=system-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/cli/system-prompt.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,mDAAmD;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,KAAK,GACT,qDAAqD;IACrD,wEAAwE;IACxE,uEAAuE;IACvE,6EAA6E;IAC7E,sEAAsE;IACtE,sEAAsE;IACtE,0EAA0E;IAC1E,6EAA6E;IAC7E,0EAA0E;IAC1E,2EAA2E;IAC3E,6DAA6D;IAC7D,4EAA4E;IAC5E,0EAA0E;IAC1E,2EAA2E;IAC3E,qEAAqE;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KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;YACnC,OAAO;QACT,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,QAAQ,KAAK,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,cAAc,EAAE,EAAE;QACjD,OAAO;QACP,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;KACxC,CAAC,CAAC;IACH,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uBAAuB,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI;QAC3D,8BAA8B,IAAI,IAAI,GAAG,4BAA4B,CACxE,CAAC;AACJ,CAAC","sourcesContent":["// `codesign-mcp system-prompt`: the /codesign bundle as a system prompt, for\n// headless hosts that cannot invoke an MCP prompt.\n\nimport { writeFileSync } from 'node:fs';\nimport { loadNodeAssets } from '../assets/load-node.js';\nimport { buildCodesignBundle } from '../codesign-prompt.js';\nimport { applyFeatureGates, videoEnabled } from '../features.js';\n\n/** Replaces the `/codesign` header: same documents, different delivery. */\nconst FRAME =\n '# CoDesign — the full design context, preloaded\\n\\n' +\n 'You have the IMG.LY CoDesign MCP server connected (`edit`, `preview`, ' +\n '`export`, `list`, `history`, `changes`, `inspect`, `rename`, `view`, ' +\n '`asset_search`, `scorecard`, `skill`). Everything that server tells you to ' +\n 'read before your first `edit` is ALREADY IN THIS SYSTEM PROMPT: the ' +\n 'handbook, the §6 design rules, the edit-code API surface, the judge ' +\n 'contract with the copy rules, the runtime quirks and the font guide.\\n\\n' +\n '**Where this and the server disagree, this wins.** When its instructions — ' +\n 'or the documents below, or a tool result — tell you to call `skill` for ' +\n '`handbook`, `judge` or `api` with no path, that read is already done: do ' +\n 'NOT spend a call repeating it. Go straight to the loop.\\n\\n' +\n '`skill` is still how you reach what is NOT here: the upstream CE.SDK core ' +\n \"(`skill({ name: 'api', path: 'signatures.d.ts' })`, paged), the `guide` \" +\n 'prose docs, `models` (read it before any `asset_generate` call), and the ' +\n 'task skills — `create`, `brand`, `layerize`, `localize`, `resize`, ' +\n '`formats`, `onboard` — when the brief calls for one.';\n\n/** Prepended for `--system-prompt`, which replaces the host's own prompt. */\nconst REPLACE_PREAMBLE =\n '# You are a design agent\\n\\n' +\n 'You run non-interactively: you are given a brief and you produce a ' +\n 'finished design with the tools you have, rather than explaining how ' +\n 'someone could make one. Do the work in the tools — never hand back code ' +\n 'for the user to run. Ask at most one round of questions, and only for a ' +\n 'design-defining choice you cannot infer; otherwise decide, and say what ' +\n 'you decided. Your final message is short and factual: what you made, ' +\n 'where the export is, what you would change next. Never report a design ' +\n 'done before the judge loop has passed.\\n\\n---\\n\\n';\n\nexport function buildSystemPrompt(\n assets: Record<string, string>,\n opts: { replace: boolean; videoEnabled: boolean }\n): string {\n const bundle = buildCodesignBundle(\n applyFeatureGates(assets, { videoEnabled: opts.videoEnabled }),\n { videoEnabled: opts.videoEnabled, header: FRAME }\n );\n return (opts.replace ? REPLACE_PREAMBLE + bundle : bundle) + '\\n';\n}\n\nconst USAGE = `Usage: codesign-mcp system-prompt [--replace] [-o <file>]\n\nWrites the \\`/codesign\\` context — handbook, design rules, the edit-code API\nsurface, judge, copy rules, quirks, fonts — as ONE system prompt, so a headless\nrun needs no reference reads before its first \\`edit\\`.\n\n --replace for \\`--system-prompt\\`, which replaces the host's own prompt:\n adds a short agent preamble. The default output assumes the\n host prompt is still there (\\`--append-system-prompt\\`).\n -o, --out FILE write to FILE instead of stdout. Use it — the bundle is\n bigger than a single shell argument is allowed to be.\n\n codesign-mcp system-prompt -o codesign.md\n claude -p \"an A4 recruiting poster for a bakery\" \\\\\n --append-system-prompt-file codesign.md --mcp-config mcp.json\n\nHonours IMGLY_FEATURE_VIDEO: the video surface is described only when it is on.`;\n\nexport function runSystemPrompt(argv: string[]): void {\n let replace = false;\n let out: string | undefined;\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === '--replace') {\n replace = true;\n } else if (arg === '-o' || arg === '--out') {\n out = argv[++i];\n if (out === undefined) throw new Error(`${arg} needs a file path`);\n } else if (arg === '-h' || arg === '--help') {\n process.stdout.write(`${USAGE}\\n`);\n return;\n } else {\n throw new Error(`unknown option \"${arg}\"\\n\\n${USAGE}`);\n }\n }\n const prompt = buildSystemPrompt(loadNodeAssets(), {\n replace,\n videoEnabled: videoEnabled(process.env)\n });\n if (out === undefined) {\n process.stdout.write(prompt);\n return;\n }\n writeFileSync(out, prompt, 'utf8');\n const flag = replace ? '--system-prompt-file' : '--append-system-prompt-file';\n process.stderr.write(\n `codesign-mcp: wrote ${prompt.length} characters to ${out}\\n` +\n ` claude -p \"<your brief>\" ${flag} ${out} --mcp-config <mcp.json>\\n`\n );\n}\n"]}
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/cli/system-prompt.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,mDAAmD;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,KAAK,GACT,qDAAqD;IACrD,wEAAwE;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YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;QACvC,MAAM;KACP,CAAC,CAAC;IACH,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uBAAuB,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI;QAC3D,CAAC,MAAM,KAAK,OAAO;YACjB,CAAC,CAAC,qFAAqF;YACvF,CAAC,CAAC,8BAA8B,IAAI,IAAI,GAAG,4BAA4B,CAAC,CAC7E,CAAC;AACJ,CAAC","sourcesContent":["// `codesign-mcp system-prompt`: the /codesign bundle as a system prompt, for\n// headless hosts that cannot invoke an MCP prompt.\n\nimport { writeFileSync } from 'node:fs';\nimport { loadNodeAssets } from '../assets/load-node.js';\nimport { buildCodesignBundle } from '../codesign-prompt.js';\nimport { applyFeatureGates, videoEnabled } from '../features.js';\n\n/** Replaces the `/codesign` header: same documents, different delivery. */\nconst FRAME =\n '# CoDesign — the full design context, preloaded\\n\\n' +\n 'You have the IMG.LY CoDesign MCP server connected (`edit`, `preview`, ' +\n '`export`, `list`, `history`, `changes`, `inspect`, `rename`, `view`, ' +\n '`asset_search`, `scorecard`, `skill`). Everything that server tells you to ' +\n 'read before your first `edit` is ALREADY IN THIS SYSTEM PROMPT: the ' +\n 'handbook, the §6 design rules, the edit-code API surface, the judge ' +\n 'contract with the copy rules, the runtime quirks and the font guide.\\n\\n' +\n '**Where this and the server disagree, this wins.** When its instructions — ' +\n 'or the documents below, or a tool result — tell you to call `skill` for ' +\n '`handbook`, `judge` or `api` with no path, that read is already done: do ' +\n 'NOT spend a call repeating it. Go straight to the loop.\\n\\n' +\n '`skill` is still how you reach what is NOT here: the upstream CE.SDK core ' +\n \"(`skill({ name: 'api', path: 'signatures.d.ts' })`, paged), the `guide` \" +\n 'prose docs, `models` (read it before any `asset_generate` call), and the ' +\n 'task skills — `create`, `brand`, `layerize`, `localize`, `resize`, ' +\n '`formats`, `onboard` — when the brief calls for one.';\n\n/** Prepended for `--system-prompt`, which replaces the host's own prompt. */\nconst REPLACE_PREAMBLE =\n '# You are a design agent\\n\\n' +\n 'You run non-interactively: you are given a brief and you produce a ' +\n 'finished design with the tools you have, rather than explaining how ' +\n 'someone could make one. Do the work in the tools — never hand back code ' +\n 'for the user to run. Ask at most one round of questions, and only for a ' +\n 'design-defining choice you cannot infer; otherwise decide, and say what ' +\n 'you decided. Your final message is short and factual: what you made, ' +\n 'where the export is, what you would change next. Never report a design ' +\n 'done before the judge loop has passed.\\n\\n---\\n\\n';\n\nconst FRONTMATTER =\n '---\\n' +\n 'name: codesign\\n' +\n 'description: IMG.LY CoDesign design agent — the full design context is ' +\n 'preloaded, so it designs without reading reference docs first.\\n' +\n '---\\n\\n';\n\nexport type SystemPromptFormat = 'prompt' | 'agent';\n\nexport const FORMATS: readonly SystemPromptFormat[] = ['prompt', 'agent'];\n\nexport function buildSystemPrompt(\n assets: Record<string, string>,\n opts: { replace: boolean; videoEnabled: boolean; format?: SystemPromptFormat }\n): string {\n const bundle = buildCodesignBundle(\n applyFeatureGates(assets, { videoEnabled: opts.videoEnabled }),\n { videoEnabled: opts.videoEnabled, header: FRAME }\n );\n const body = (opts.replace ? REPLACE_PREAMBLE + bundle : bundle) + '\\n';\n return opts.format === 'agent' ? FRONTMATTER + body : body;\n}\n\nconst USAGE = `Usage: codesign-mcp system-prompt [--format <prompt|agent>] [--replace] [-o <file>]\n\nWrites the \\`/codesign\\` context — handbook, design rules, the edit-code API\nsurface, judge, copy rules, quirks, fonts — as ONE system prompt, so a headless\nrun needs no reference reads before its first \\`edit\\`.\n\n --format FMT prompt (default) — a bare system prompt for\n \\`--append-system-prompt-file\\` / \\`--system-prompt-file\\`.\n agent — the same, with the \\`name\\`/\\`description\\`\n frontmatter an agent definition needs, and \\`--replace\\`\n implied: a Claude Code subagent (.claude/agents/<name>.md) or\n an Antigravity custom agent\n (~/.gemini/config/agents/<name>/agent.md).\n --replace for \\`--system-prompt\\`, which replaces the host's own prompt:\n adds a short agent preamble. The default output assumes the\n host prompt is still there (\\`--append-system-prompt\\`).\n -o, --out FILE write to FILE instead of stdout. Use it — the bundle is\n bigger than a single shell argument is allowed to be.\n\n codesign-mcp system-prompt -o codesign.md\n claude -p \"an A4 recruiting poster for a bakery\" \\\\\n --append-system-prompt-file codesign.md --mcp-config mcp.json\n\n codesign-mcp system-prompt --format agent -o .claude/agents/codesign.md\n\nHonours IMGLY_FEATURE_VIDEO: the video surface is described only when it is on.\n`;\nexport function runSystemPrompt(argv: string[]): void {\n let replace = false;\n let out: string | undefined;\n let format: SystemPromptFormat = 'prompt';\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === '--replace') {\n replace = true;\n } else if (arg === '--format') {\n const value = argv[++i];\n if (value === undefined || !FORMATS.includes(value as SystemPromptFormat))\n throw new Error(\n `--format needs one of: ${FORMATS.join(', ')}\\n\\n${USAGE}`\n );\n format = value as SystemPromptFormat;\n } else if (arg === '-o' || arg === '--out') {\n out = argv[++i];\n if (out === undefined) throw new Error(`${arg} needs a file path`);\n } else if (arg === '-h' || arg === '--help') {\n process.stdout.write(`${USAGE}\\n`);\n return;\n } else {\n throw new Error(`unknown option \"${arg}\"\\n\\n${USAGE}`);\n }\n }\n const prompt = buildSystemPrompt(loadNodeAssets(), {\n replace: replace || format === 'agent',\n videoEnabled: videoEnabled(process.env),\n format\n });\n if (out === undefined) {\n process.stdout.write(prompt);\n return;\n }\n writeFileSync(out, prompt, 'utf8');\n const flag = replace ? '--system-prompt-file' : '--append-system-prompt-file';\n process.stderr.write(\n `codesign-mcp: wrote ${prompt.length} characters to ${out}\\n` +\n (format === 'agent'\n ? ` an agent definition: put it where your host reads them, then select it by name.\\n`\n : ` claude -p \"<your brief>\" ${flag} ${out} --mcp-config <mcp.json>\\n`)\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const TRIAL_CESDK_LICENSE = "Weye1tFge82_mgEGZk6RVrtbJeCPAJrSshyYvJFacyciMQ5l3EE1wjKIJWemTHno";
1
+ export declare const TRIAL_CESDK_LICENSE = "qoYeyztMX7-NzE7L5LgunbF53i16SiVx3L9fC1UshbPPkJrmmR_EYtva__EsQiGS";
2
2
  //# sourceMappingURL=trial-license.generated.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // AUTO-GENERATED by scripts/generate-trial-license.mjs — do not edit.
2
2
  // Empty unless IMGLY_TRIAL_CESDK_LICENSE was set at build/publish time.
3
- export const TRIAL_CESDK_LICENSE = "Weye1tFge82_mgEGZk6RVrtbJeCPAJrSshyYvJFacyciMQ5l3EE1wjKIJWemTHno";
3
+ export const TRIAL_CESDK_LICENSE = "qoYeyztMX7-NzE7L5LgunbF53i16SiVx3L9fC1UshbPPkJrmmR_EYtva__EsQiGS";
4
4
  //# sourceMappingURL=trial-license.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trial-license.generated.js","sourceRoot":"","sources":["../../src/cli/trial-license.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,kEAAkE,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-trial-license.mjs — do not edit.\n// Empty unless IMGLY_TRIAL_CESDK_LICENSE was set at build/publish time.\nexport const TRIAL_CESDK_LICENSE = \"Weye1tFge82_mgEGZk6RVrtbJeCPAJrSshyYvJFacyciMQ5l3EE1wjKIJWemTHno\";\n"]}
1
+ {"version":3,"file":"trial-license.generated.js","sourceRoot":"","sources":["../../src/cli/trial-license.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,kEAAkE,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-trial-license.mjs — do not edit.\n// Empty unless IMGLY_TRIAL_CESDK_LICENSE was set at build/publish time.\nexport const TRIAL_CESDK_LICENSE = \"qoYeyztMX7-NzE7L5LgunbF53i16SiVx3L9fC1UshbPPkJrmmR_EYtva__EsQiGS\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/codesign-mcp",
3
- "version": "0.3.4-next.20260916160458.g631cee6",
3
+ "version": "0.3.4",
4
4
  "description": "A real design engine for your AI agent: generate designs and print-ready PDFs, over MCP.",
5
5
  "keywords": [
6
6
  "mcp",