@funny-booth/langley-video-mcp 0.3.0 → 0.5.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.
package/dist/client.js CHANGED
@@ -43,14 +43,21 @@ export async function productions(token, f = fetch) {
43
43
  const res = await call("/productions", token, {}, f);
44
44
  return (await res.json()).productions;
45
45
  }
46
- export async function request(token, sku, appeal, count, f = fetch) {
46
+ /** 制作を依頼する。決まり(訴求軸は必須・訴求要素は CR 1本ずつ必須・合計5本まで)を確かめるのはサーバー側 */
47
+ /** test: 試験の依頼(知らせに【試験】が付き、答え合わせに使われない)。true のときだけ送る */
48
+ export async function request(token, sku, items, f = fetch, test = false) {
47
49
  const res = await call("/request", token, {
48
50
  method: "POST",
49
51
  headers: { "Content-Type": "application/json" },
50
- body: JSON.stringify({ sku, appeal, count }),
52
+ body: JSON.stringify(test ? { sku, items, test: true } : { sku, items }),
51
53
  }, f);
52
54
  return (await res.json());
53
55
  }
56
+ /** 選べる訴求軸と説明・過去の動画がその軸で訴えていたこと(訴求要素を考えるときの例) */
57
+ export async function appeals(token, sku, f = fetch) {
58
+ const res = await call(`/appeals?sku=${encodeURIComponent(sku)}`, token, {}, f);
59
+ return (await res.json());
60
+ }
54
61
  export const CHANGE_AREAS = ["storyboard", "approval_page", "slack", "video", "materials", "agent", "other"];
55
62
  export const CHANGE_URGENCIES = ["today", "this_week", "whenever"];
56
63
  /** 仕組みの改修を依頼する(受け付けて記録するだけ。仕組みはすぐには変わらない) */
package/dist/index.js CHANGED
@@ -5,14 +5,14 @@
5
5
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
7
  import { z } from "zod";
8
- import { AgentError, CHANGE_AREAS, CHANGE_URGENCIES, delivery, myRequests, productions, request, requestChange } from "./client.js";
8
+ import { AgentError, CHANGE_AREAS, CHANGE_URGENCIES, appeals, delivery, myRequests, productions, request, requestChange } from "./client.js";
9
9
  const token = () => process.env.TOOL_TOKEN;
10
10
  const text = (t) => ({ content: [{ type: "text", text: t }] });
11
11
  const fail = (e) => ({
12
12
  content: [{ type: "text", text: e instanceof AgentError ? e.message : `動画の受け口につながりません: ${String(e)}` }],
13
13
  isError: true,
14
14
  });
15
- const server = new McpServer({ name: "langley-video", version: "0.3.0" });
15
+ const server = new McpServer({ name: "langley-video", version: "0.5.0" });
16
16
  server.registerTool("video_productions", {
17
17
  description: "ラングレー動画の制作の一覧(新しい順)。どの動画がどの段階か(絵コンテ承認待ち・最終確認待ち・納品できる)と、承認画面のリンクを返す",
18
18
  inputSchema: {},
@@ -21,23 +21,44 @@ server.registerTool("video_productions", {
21
21
  const list = await productions(token());
22
22
  if (!list.length)
23
23
  return text("制作はまだありません");
24
- return text(list.map((p) => `${p.test ? "【試験】" : ""}${p.title || p.name}(${p.sku}・${p.appeal}): ${p.stage}\n 制作名: ${p.name}\n 画面: ${p.page}`).join("\n"));
24
+ return text(list.map((p) => `${p.test ? "【試験】" : ""}${p.title || p.name}(${p.sku}・${p.appeal}${p.appeal_element ? `・${p.appeal_element}` : ""}): ${p.stage}\n 制作名: ${p.name}\n 画面: ${p.page}`).join("\n"));
25
+ }
26
+ catch (e) {
27
+ return fail(e);
28
+ }
29
+ });
30
+ server.registerTool("video_appeals", {
31
+ description: "商品ごとに、選べる訴求軸(大分類)と説明、過去の動画がその軸で訴えていたこと(訴求要素を考えるときの例)を返す。" +
32
+ "制作を依頼する前に、訴求軸を選んでもらい、CR 1本ずつの訴求要素を聞くときに見せる",
33
+ inputSchema: { sku: z.string().describe("商品の名前(例: ブラトップ・ヒートインナー)") },
34
+ }, async ({ sku }) => {
35
+ try {
36
+ const r = await appeals(token(), sku);
37
+ return text([`${r.sku} の訴求軸`, ...r.axes.map((a) => `・${a.appeal}: ${a.definition}${a.examples.length ? `\n 過去の例: ${a.examples.join(" / ")}` : ""}`),
38
+ `・おまかせ: ${r.omakase}`].join("\n"));
25
39
  }
26
40
  catch (e) {
27
41
  return fail(e);
28
42
  }
29
43
  });
30
44
  server.registerTool("video_request", {
31
- description: "ラングレー動画の制作を依頼する。商品(例: ブラトップ・ヒートインナー)と訴求(AI 分類の区分名。おまかせも可)と本数を指定する。" +
45
+ description: "ラングレー動画の制作を依頼する。商品と、訴求軸ごとの訴求要素(CR 1本ずつ・その CR で一番伝えたいこと)を渡す。" +
46
+ "訴求軸は video_appeals の区分名か「おまかせ」。訴求要素は依頼した人に必ず聞いて、その言葉のまま入れる(作らない)。" +
47
+ "「おまかせ」だけは訴求要素の代わりに本数(count)を渡し、AI が軸も要素も決める。1回で複数の訴求軸を渡せる(合計5本まで)。" +
32
48
  "制作は VPS で1本ずつ順番に始まり、絵コンテ(ゲート①)ができたら Slack で知らせる。ここではクレジットを使わない",
33
49
  inputSchema: {
34
50
  sku: z.string().describe("商品の名前(ブレインの商品の一覧にあるもの)"),
35
- appeal: z.string().describe("訴求の区分名(例: 服の着映え・一枚で完結)か「おまかせ」"),
36
- count: z.number().int().min(1).max(5).default(1).describe("本数(1〜5)"),
51
+ items: z.array(z.object({
52
+ appeal: z.string().describe("訴求軸の区分名(例: 持ち上げ・垂れ対策)か「おまかせ」"),
53
+ elements: z.array(z.string().min(1).max(200)).optional().describe("CR 1本ずつの訴求要素(例: 洗濯しても伸びにくい)。数が本数になる。おまかせ以外は必須"),
54
+ count: z.number().int().min(1).max(5).optional().describe("「おまかせ」のときの本数"),
55
+ })).min(1).describe("訴求軸ごとの依頼(同じ訴求軸は1つにまとめる)"),
56
+ test: z.boolean().optional().describe("動作確認の試験の依頼のときだけ true(依頼した人が「試験」「動作確認」と言ったとき)。" +
57
+ "知らせに【試験】が付き、成績の答え合わせに使われない。ふだんの依頼では渡さない"),
37
58
  },
38
- }, async ({ sku, appeal, count }) => {
59
+ }, async ({ sku, items, test }) => {
39
60
  try {
40
- const r = await request(token(), sku, appeal, count);
61
+ const r = await request(token(), sku, items, fetch, test === true);
41
62
  return text(`${r.message}\n制作名: ${r.productions.join("、")}`);
42
63
  }
43
64
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funny-booth/langley-video-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "ラングレー動画の制作の状況・制作の依頼・納品セットの取得(Langley-AgentOS の「WEBマーケクリエイティブ」から使う MCP・stdio)",
6
6
  "publishConfig": {