@infimind-next/ai-hive-mcp 0.1.0 → 0.1.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/schemas.d.ts CHANGED
@@ -74,7 +74,6 @@ export declare const chatTextShape: {
74
74
  mediaIds?: string[] | undefined;
75
75
  }>, "many">;
76
76
  thinkingEnabled: z.ZodOptional<z.ZodBoolean>;
77
- attachmentIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
78
77
  pricingSnapshot: z.ZodRecord<z.ZodString, z.ZodUnknown>;
79
78
  };
80
79
  export declare const generateImageShape: {
package/dist/schemas.js CHANGED
@@ -50,7 +50,6 @@ export const chatTextShape = {
50
50
  routingMode: routingModeSchema,
51
51
  messages: z.array(messageSchema).min(1),
52
52
  thinkingEnabled: z.boolean().optional(),
53
- attachmentIds: z.array(z.string().min(1)).default([]),
54
53
  pricingSnapshot: pricingSnapshotSchema,
55
54
  };
56
55
  export const generateImageShape = {
package/dist/server.js CHANGED
@@ -4,6 +4,8 @@ import { chatTextShape, generateImageShape, generateVideoShape, getGenerationTas
4
4
  import { z } from "zod";
5
5
  import { AiHiveApiClient } from "./api-client.js";
6
6
  import { uploadMediaFromPath } from "./local-media.js";
7
+ const SERVER_VERSION = "0.1.1";
8
+ const DEPRECATED_ATTACHMENT_IDS_MESSAGE = "attachmentIds 已废弃,请使用 messages[].mediaIds";
7
9
  function requireKey(key) {
8
10
  if (!key) {
9
11
  throw new Error("MCP API Key 未配置,请在配置中传入 --key 或 AI_HIVE_MCP_KEY");
@@ -15,6 +17,11 @@ function content(value) {
15
17
  content: [{ type: "text", text: JSON.stringify(value) }],
16
18
  };
17
19
  }
20
+ function rejectDeprecatedAttachmentIds(args) {
21
+ if (Object.prototype.hasOwnProperty.call(args, "attachmentIds")) {
22
+ throw new Error(DEPRECATED_ATTACHMENT_IDS_MESSAGE);
23
+ }
24
+ }
18
25
  export function createToolDefinitions(client) {
19
26
  return [
20
27
  {
@@ -39,7 +46,10 @@ export function createToolDefinitions(client) {
39
46
  {
40
47
  name: "chat_text",
41
48
  schema: chatTextShape,
42
- handler: async (args) => content(await client().chatText(args)),
49
+ handler: async (args) => {
50
+ rejectDeprecatedAttachmentIds(args);
51
+ return content(await client().chatText(args));
52
+ },
43
53
  },
44
54
  {
45
55
  name: "generate_image",
@@ -61,7 +71,7 @@ export function createToolDefinitions(client) {
61
71
  ];
62
72
  }
63
73
  export function createServer(input) {
64
- const server = new McpServer({ name: "ai-hive", version: "0.1.0" });
74
+ const server = new McpServer({ name: "ai-hive", version: SERVER_VERSION });
65
75
  const client = () => new AiHiveApiClient({
66
76
  endpoint: input.endpoint,
67
77
  key: requireKey(input.key),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infimind-next/ai-hive-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "build": "tsc -p tsconfig.json",
14
+ "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
14
15
  "lint": "eslint \"src/**/*.ts\"",
15
16
  "prepack": "pnpm run build",
16
17
  "test": "vitest run"