@funny-booth/langley-video-mcp 0.12.0 → 0.13.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
@@ -54,6 +54,22 @@ async function call(path, token, init = {}, f = fetch) {
54
54
  }
55
55
  return res;
56
56
  }
57
+ const REVISE_STATE = { queued: "順番待ち(ほかの制作が終わってから始まる)", running: "作っている", stopped: "止まった(担当が調べている)" };
58
+ const hm = (iso) => `${iso.slice(5, 10).replace("-", "/")} ${iso.slice(11, 16)}`;
59
+ /** 一覧の1件を、AI エージェントが読んで答えられる文にする(11/20 受付箱 8495912c・294573ed・c1982030) */
60
+ export function productionText(p) {
61
+ const lines = [`${p.test ? "【試験】" : ""}${p.title || p.name}(${p.sku}・${p.appeal}${p.appeal_element ? `・${p.appeal_element}` : ""}): ${p.stage}`,
62
+ ` 制作名: ${p.name}`, ` 画面: ${p.page}`];
63
+ if (p.revise) {
64
+ const est = p.revise.estimate_min;
65
+ lines.push(` 直し: ${REVISE_STATE[p.revise.state] ?? p.revise.state}・頼んだ時刻 ${hm(p.revise.since)}` +
66
+ (est ? `・目安 ${est[0] === est[1] ? `${est[1]}分ほど` : `${est[0]}〜${est[1]}分`}(これまでの直しの実績)` : ""));
67
+ }
68
+ if (p.history?.length) {
69
+ lines.push(" 経過:", ...p.history.map((h) => ` ${hm(h.at)} ${h.event}${h.minutes != null ? `(頼まれてから${h.minutes}分)` : ""}`));
70
+ }
71
+ return lines.join("\n");
72
+ }
57
73
  export async function productions(token, f = fetch) {
58
74
  const res = await call("/productions", token, {}, f);
59
75
  return (await res.json()).productions;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
8
8
  import { z } from "zod";
9
- import { withdrawChange, AgentError, CHANGE_AREAS, CHANGE_URGENCIES, appeals, delivery, myRequests, planAct, planStart, planStatus, productions, request, requestChange } from "./client.js";
9
+ import { withdrawChange, AgentError, CHANGE_AREAS, CHANGE_URGENCIES, appeals, delivery, myRequests, planAct, planStart, planStatus, productions, request, requestChange, productionText } from "./client.js";
10
10
  // agent-core は CommonJS なので、名前つきの import では起動のときに落ちる(default から取る)
11
11
  import portalClient from "@funny-booth/agent-core/dist/portalClient.js";
12
12
  const portal = portalClient.portalClientFromEnv(); // PORTAL_URL・TOOL_TOKEN が無ければ null
@@ -16,16 +16,19 @@ const fail = (e) => ({
16
16
  content: [{ type: "text", text: e instanceof AgentError ? e.message : `動画の受け口につながりません: ${String(e)}` }],
17
17
  isError: true,
18
18
  });
19
- const server = new McpServer({ name: "langley-video", version: "0.11.0" });
19
+ const server = new McpServer({ name: "langley-video", version: "0.13.0" });
20
20
  server.registerTool("video_productions", {
21
- description: "ラングレー動画の制作の一覧(新しい順)。どの動画がどの段階か(絵コンテ承認待ち・最終確認待ち・納品できる)と、承認画面のリンクを返す",
21
+ description: "ラングレー動画の制作の一覧(新しい順)。どの動画がどの段階か(絵コンテ承認待ち・直した絵コンテを作っている・最終確認待ち・納品できる など)と、承認画面のリンクを返す。" +
22
+ "絵コンテの直しを頼んだ後は、順番待ち/作っている/止まった・頼んだ時刻・できあがりの目安(分)も返す。" +
23
+ "「経過」に段階ごとの時刻(依頼・直しの依頼・絵コンテができた・承認・完成など)を古い順に返す。" +
24
+ "「直した絵コンテができるまでどのくらいかかったか」は、経過の「直した絵コンテができた(頼まれてから◯分)」で答える",
22
25
  inputSchema: {},
23
26
  }, async () => {
24
27
  try {
25
28
  const list = await productions(token());
26
29
  if (!list.length)
27
30
  return text("制作はまだありません");
28
- 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"));
31
+ return text(list.map(productionText).join("\n"));
29
32
  }
30
33
  catch (e) {
31
34
  return fail(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funny-booth/langley-video-mcp",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "ラングレー動画の制作の状況・制作の依頼・納品セットの取得(Langley-AgentOS の「WEBマーケクリエイティブ」から使う MCP・stdio)",
6
6
  "publishConfig": {