mcp-server-peecai 0.2.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/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/api-client.d.ts +21 -0
- package/dist/api-client.js +83 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +3 -0
- package/dist/prompts.js +100 -0
- package/dist/prompts.js.map +1 -0
- package/dist/tools/brands.d.ts +4 -0
- package/dist/tools/brands.js +25 -0
- package/dist/tools/brands.js.map +1 -0
- package/dist/tools/chat-content.d.ts +4 -0
- package/dist/tools/chat-content.js +23 -0
- package/dist/tools/chat-content.js.map +1 -0
- package/dist/tools/chats.d.ts +4 -0
- package/dist/tools/chats.js +30 -0
- package/dist/tools/chats.js.map +1 -0
- package/dist/tools/models.d.ts +4 -0
- package/dist/tools/models.js +25 -0
- package/dist/tools/models.js.map +1 -0
- package/dist/tools/projects.d.ts +4 -0
- package/dist/tools/projects.js +20 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/prompts.d.ts +4 -0
- package/dist/tools/prompts.js +25 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/report-brands.d.ts +4 -0
- package/dist/tools/report-brands.js +47 -0
- package/dist/tools/report-brands.js.map +1 -0
- package/dist/tools/report-domains.d.ts +4 -0
- package/dist/tools/report-domains.js +47 -0
- package/dist/tools/report-domains.js.map +1 -0
- package/dist/tools/report-urls.d.ts +4 -0
- package/dist/tools/report-urls.js +47 -0
- package/dist/tools/report-urls.js.map +1 -0
- package/dist/tools/tags.d.ts +4 -0
- package/dist/tools/tags.js +25 -0
- package/dist/tools/tags.js.map +1 -0
- package/dist/tools/topics.d.ts +4 -0
- package/dist/tools/topics.js +25 -0
- package/dist/tools/topics.js.map +1 -0
- package/dist/types.d.ts +149 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +89 -0
- package/dist/util.js +152 -0
- package/dist/util.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the get_chat_content tool for retrieving full chat details. */
|
|
6
|
+
export function registerChatContentTool(server, client) {
|
|
7
|
+
server.tool("get_chat_content", "Get full content of a specific AI chat. Returns sources, brands mentioned, messages, queries, and products.", {
|
|
8
|
+
chat_id: z.string().regex(/^[\w-]+$/, "Invalid chat_id format").describe("Chat ID to retrieve"),
|
|
9
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
10
|
+
}, async ({ chat_id, project_id }) => {
|
|
11
|
+
try {
|
|
12
|
+
const data = await client.getRaw(`/chats/${chat_id}/content`, {
|
|
13
|
+
project_id: requireProjectId(project_id),
|
|
14
|
+
});
|
|
15
|
+
const _summary = `Chat ${chat_id}: ${data.messages.length} messages, ${data.sources.length} sources, ${data.brands_mentioned.length} brands`;
|
|
16
|
+
return toolResult({ _summary, chat: data });
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
return toolError(e);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=chat-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-content.js","sourceRoot":"","sources":["../../src/tools/chat-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrE,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,MAAqB;IAC9E,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,6GAA6G,EAC7G;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAC/F,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC,CAAC,QAAQ,EAAE;KAClI,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;QAChC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAc,UAAU,OAAO,UAAU,EAAE;gBACzE,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;aACzC,CAAC,CAAC;YACH,MAAM,QAAQ,GAAG,QAAQ,OAAO,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM,cAAc,IAAI,CAAC,OAAO,CAAC,MAAM,aAAa,IAAI,CAAC,gBAAgB,CAAC,MAAM,SAAS,CAAC;YAC7I,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_chats tool for retrieving AI chat interactions with optional date filtering. */
|
|
4
|
+
export declare function registerChatsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, dateSchema, validateDateRange, summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_chats tool for retrieving AI chat interactions with optional date filtering. */
|
|
6
|
+
export function registerChatsTool(server, client) {
|
|
7
|
+
server.tool("list_chats", "List AI chat interactions tracked by Peec.ai. Returns up to limit results (default: 100). Always use date filters to scope results. Returns chat IDs, prompt/model refs, and dates. Without date filters, returns all chats.", {
|
|
8
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
9
|
+
start_date: dateSchema.describe("Start date filter (YYYY-MM-DD). Omit for no lower bound.").optional(),
|
|
10
|
+
end_date: dateSchema.describe("End date filter (YYYY-MM-DD). Omit for no upper bound.").optional(),
|
|
11
|
+
limit: z.number().min(1).max(10000).default(100).describe("Max results (1-10000, default: 100)").optional(),
|
|
12
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
13
|
+
}, async ({ project_id, start_date, end_date, limit, offset }) => {
|
|
14
|
+
try {
|
|
15
|
+
const dates = validateDateRange(start_date, end_date);
|
|
16
|
+
const data = await client.get("/chats", {
|
|
17
|
+
project_id: requireProjectId(project_id),
|
|
18
|
+
start_date: dates.start_date,
|
|
19
|
+
end_date: dates.end_date,
|
|
20
|
+
limit,
|
|
21
|
+
offset,
|
|
22
|
+
});
|
|
23
|
+
return toolResult({ _summary: summaryForList("chats", data), chats: data });
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
return toolError(e);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=chats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/tools/ch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GAAG,CAAS,QAAQ,EAAE;gBAC9C,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;gBACxC,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YACH,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_models tool for retrieving tracked AI models. */
|
|
4
|
+
export declare function registerModelsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_models tool for retrieving tracked AI models. */
|
|
6
|
+
export function registerModelsTool(server, client) {
|
|
7
|
+
server.tool("list_models", "List AI models tracked by Peec.ai (ChatGPT, Perplexity, etc.). Returns model IDs and active status.", {
|
|
8
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
9
|
+
limit: z.number().min(1).max(10000).default(1000).describe("Max results (1-10000)").optional(),
|
|
10
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
11
|
+
}, async ({ project_id, limit, offset }) => {
|
|
12
|
+
try {
|
|
13
|
+
const data = await client.get("/models", {
|
|
14
|
+
project_id: requireProjectId(project_id),
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
});
|
|
18
|
+
return toolResult({ _summary: summaryForList("models", data), models: data });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return toolError(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/tools/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrF,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAqB;IACzE,MAAM,CAAC,IAAI,CACT,aAAa,EACb,qGAAqG,EACrG;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC,CAAC,QAAQ,EAAE;QACjI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;QAC9F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;KAC5E,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAU,SAAS,EAAE;gBAChD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;gBACxC,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YACH,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_projects tool for retrieving all company projects. */
|
|
4
|
+
export declare function registerProjectsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_projects tool for retrieving all company projects. */
|
|
6
|
+
export function registerProjectsTool(server, client) {
|
|
7
|
+
server.tool("list_projects", "List all Peec.ai projects for the company. Returns project IDs, names, and statuses. Status values: CUSTOMER (active, ongoing monitoring), CUSTOMER_ENDED, PITCH (active demo), PITCH_ENDED (completed demo), TRIAL, TRIAL_ENDED, ONBOARDING, DELETED. Use CUSTOMER projects for current data.", {
|
|
8
|
+
limit: z.number().min(1).max(10000).default(1000).describe("Max results to return (1-10000)").optional(),
|
|
9
|
+
offset: z.number().min(0).default(0).describe("Number of results to skip").optional(),
|
|
10
|
+
}, async ({ limit, offset }) => {
|
|
11
|
+
try {
|
|
12
|
+
const data = await client.get("/projects", { limit, offset });
|
|
13
|
+
return toolResult({ _summary: summaryForList("projects", data), projects: data });
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
return toolError(e);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnE,4EAA4E;AAC5E,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAqB;IAC3E,MAAM,CAAC,IAAI,CACT,eAAe,EACf,gSAAgS,EAChS;QACE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;QACxG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE;KACtF,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QAC1B,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAY,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACzE,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACpF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_prompts tool for retrieving search prompts with metadata. */
|
|
4
|
+
export declare function registerPromptsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_prompts tool for retrieving search prompts with metadata. */
|
|
6
|
+
export function registerPromptsTool(server, client) {
|
|
7
|
+
server.tool("list_prompts", "List search prompts for a Peec.ai project. Returns prompt IDs, messages, tags, topics, locations, and search volume.", {
|
|
8
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
9
|
+
limit: z.number().min(1).max(10000).default(1000).describe("Max results (1-10000)").optional(),
|
|
10
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
11
|
+
}, async ({ project_id, limit, offset }) => {
|
|
12
|
+
try {
|
|
13
|
+
const data = await client.get("/prompts", {
|
|
14
|
+
project_id: requireProjectId(project_id),
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
});
|
|
18
|
+
return toolResult({ _summary: summaryForList("prompts", data), prompts: data });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return toolError(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/tools/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrF,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACT,cAAc,EACd,sHAAsH,EACtH;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC,CAAC,QAAQ,EAAE;QACjI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;QAC9F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;KAC5E,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAW,UAAU,EAAE;gBAClD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;gBACxC,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YACH,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the get_brands_report tool for brand visibility, sentiment, and position analytics. */
|
|
4
|
+
export declare function registerBrandsReportTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, dateSchema, dimensionsSchema, filterSchema, mergeFilters, validateDateRange, slimReportRows, summaryForBrandsReport, toolResult, toolError } from "../util.js";
|
|
5
|
+
const BRANDS_FILTER_FIELDS = ["model_id", "tag_id", "topic_id", "prompt_id", "brand_id"];
|
|
6
|
+
/** Registers the get_brands_report tool for brand visibility, sentiment, and position analytics. */
|
|
7
|
+
export function registerBrandsReportTool(server, client) {
|
|
8
|
+
server.tool("get_brands_report", "Get brand analytics report per brand. Metrics: visibility (visibility_count/visibility_total), share_of_voice (0-1), mention_count, sentiment (0-100 scale, 50=neutral), position (avg rank when mentioned, lower=better). Returns up to limit results (default: 100). Use brand_id shortcut or filters array for server-side filtering. Supports date filtering and dimensional breakdowns. Without date filters, returns data across all available dates.", {
|
|
9
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
10
|
+
start_date: dateSchema.describe("Start date (YYYY-MM-DD). Omit for no lower bound.").optional(),
|
|
11
|
+
end_date: dateSchema.describe("End date (YYYY-MM-DD). Omit for no upper bound.").optional(),
|
|
12
|
+
dimensions: dimensionsSchema.optional(),
|
|
13
|
+
brand_id: z.string()
|
|
14
|
+
.describe("Convenience filter for a single brand (converted to server-side filter). Use list_brands to find IDs.")
|
|
15
|
+
.optional(),
|
|
16
|
+
filters: filterSchema(BRANDS_FILTER_FIELDS).optional(),
|
|
17
|
+
limit: z.number().min(1).max(10000).default(100).describe("Max results (1-10000, default: 100)").optional(),
|
|
18
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
19
|
+
}, async ({ project_id, start_date, end_date, dimensions, brand_id, filters, limit, offset }) => {
|
|
20
|
+
try {
|
|
21
|
+
const dates = validateDateRange(start_date, end_date);
|
|
22
|
+
const body = {
|
|
23
|
+
project_id: requireProjectId(project_id),
|
|
24
|
+
};
|
|
25
|
+
if (dates.start_date)
|
|
26
|
+
body.start_date = dates.start_date;
|
|
27
|
+
if (dates.end_date)
|
|
28
|
+
body.end_date = dates.end_date;
|
|
29
|
+
if (dimensions)
|
|
30
|
+
body.dimensions = dimensions;
|
|
31
|
+
if (limit !== undefined)
|
|
32
|
+
body.limit = limit;
|
|
33
|
+
if (offset !== undefined)
|
|
34
|
+
body.offset = offset;
|
|
35
|
+
const merged = mergeFilters(filters, { field: "brand_id", value: brand_id });
|
|
36
|
+
if (merged)
|
|
37
|
+
body.filters = merged;
|
|
38
|
+
const data = await client.post("/reports/brands", body);
|
|
39
|
+
const rows = slimReportRows(data);
|
|
40
|
+
return toolResult({ _summary: summaryForBrandsReport(rows), rows });
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
return toolError(e);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=report-brands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-brands.js","sourceRoot":"","sources":["../../src/tools/report-brands.ts"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AC,CAAC;QACtE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the get_domains_report tool for domain classification, usage, and citation analytics. */
|
|
4
|
+
export declare function registerDomainsReportTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, dateSchema, dimensionsSchema, filterSchema, mergeFilters, validateDateRange, slimReportRows, summaryForDomainsReport, toolResult, toolError } from "../util.js";
|
|
5
|
+
const DOMAINS_FILTER_FIELDS = ["model_id", "tag_id", "topic_id", "prompt_id", "domain", "url"];
|
|
6
|
+
/** Registers the get_domains_report tool for domain classification, usage, and citation analytics. */
|
|
7
|
+
export function registerDomainsReportTool(server, client) {
|
|
8
|
+
server.tool("get_domains_report", "Get domain analytics report: usage_rate (0-1, share of chats citing this domain) and citation_avg (avg citations per chat). Classification values: OWN, CORPORATE, COMPETITOR, EDITORIAL, REFERENCE, INSTITUTIONAL, UGC, OTHER. Returns up to limit results (default: 100). Use classification shortcut or filters array for server-side filtering. Without date filters, returns data across all available dates.", {
|
|
9
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
10
|
+
start_date: dateSchema.describe("Start date (YYYY-MM-DD). Omit for no lower bound.").optional(),
|
|
11
|
+
end_date: dateSchema.describe("End date (YYYY-MM-DD). Omit for no upper bound.").optional(),
|
|
12
|
+
dimensions: dimensionsSchema.optional(),
|
|
13
|
+
classification: z.enum(["OWN", "CORPORATE", "COMPETITOR", "EDITORIAL", "REFERENCE", "INSTITUTIONAL", "UGC", "OTHER"])
|
|
14
|
+
.describe("Convenience filter by domain classification (converted to server-side filter).")
|
|
15
|
+
.optional(),
|
|
16
|
+
filters: filterSchema(DOMAINS_FILTER_FIELDS).optional(),
|
|
17
|
+
limit: z.number().min(1).max(10000).default(100).describe("Max results (1-10000, default: 100)").optional(),
|
|
18
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
19
|
+
}, async ({ project_id, start_date, end_date, dimensions, classification, filters, limit, offset }) => {
|
|
20
|
+
try {
|
|
21
|
+
const dates = validateDateRange(start_date, end_date);
|
|
22
|
+
const body = {
|
|
23
|
+
project_id: requireProjectId(project_id),
|
|
24
|
+
};
|
|
25
|
+
if (dates.start_date)
|
|
26
|
+
body.start_date = dates.start_date;
|
|
27
|
+
if (dates.end_date)
|
|
28
|
+
body.end_date = dates.end_date;
|
|
29
|
+
if (dimensions)
|
|
30
|
+
body.dimensions = dimensions;
|
|
31
|
+
if (limit !== undefined)
|
|
32
|
+
body.limit = limit;
|
|
33
|
+
if (offset !== undefined)
|
|
34
|
+
body.offset = offset;
|
|
35
|
+
const merged = mergeFilters(filters, { field: "classification", value: classification });
|
|
36
|
+
if (merged)
|
|
37
|
+
body.filters = merged;
|
|
38
|
+
const data = await client.post("/reports/domains", body);
|
|
39
|
+
const rows = slimReportRows(data);
|
|
40
|
+
return toolResult({ _summary: summaryForDomainsReport(rows), rows });
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
return toolError(e);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=report-domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-domains.js","sourceRoot":"","sources":["../../src/tools/report-domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACp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AE,uBAAuB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the get_urls_report tool for URL classification, usage, and citation analytics. */
|
|
4
|
+
export declare function registerUrlsReportTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, dateSchema, dimensionsSchema, filterSchema, mergeFilters, validateDateRange, slimReportRows, summaryForUrlsReport, toolResult, toolError } from "../util.js";
|
|
5
|
+
const URLS_FILTER_FIELDS = ["model_id", "tag_id", "topic_id", "prompt_id", "domain", "url"];
|
|
6
|
+
/** Registers the get_urls_report tool for URL classification, usage, and citation analytics. */
|
|
7
|
+
export function registerUrlsReportTool(server, client) {
|
|
8
|
+
server.tool("get_urls_report", "Get URL analytics report: usage_count (chats citing this URL), citation_count (total citations), citation_avg (avg citations per chat). Classification values: HOMEPAGE, CATEGORY_PAGE, PRODUCT_PAGE, LISTICLE, COMPARISON, PROFILE, ALTERNATIVE, DISCUSSION, HOW_TO_GUIDE, ARTICLE, OTHER. Returns up to limit results (default: 100). Use classification shortcut or filters array for server-side filtering. Without date filters, returns data across all available dates.", {
|
|
9
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
10
|
+
start_date: dateSchema.describe("Start date (YYYY-MM-DD). Omit for no lower bound.").optional(),
|
|
11
|
+
end_date: dateSchema.describe("End date (YYYY-MM-DD). Omit for no upper bound.").optional(),
|
|
12
|
+
dimensions: dimensionsSchema.optional(),
|
|
13
|
+
classification: z.enum(["HOMEPAGE", "CATEGORY_PAGE", "PRODUCT_PAGE", "LISTICLE", "COMPARISON", "PROFILE", "ALTERNATIVE", "DISCUSSION", "HOW_TO_GUIDE", "ARTICLE", "OTHER"])
|
|
14
|
+
.describe("Convenience filter by URL classification (converted to server-side filter).")
|
|
15
|
+
.optional(),
|
|
16
|
+
filters: filterSchema(URLS_FILTER_FIELDS).optional(),
|
|
17
|
+
limit: z.number().min(1).max(10000).default(100).describe("Max results (1-10000, default: 100)").optional(),
|
|
18
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
19
|
+
}, async ({ project_id, start_date, end_date, dimensions, classification, filters, limit, offset }) => {
|
|
20
|
+
try {
|
|
21
|
+
const dates = validateDateRange(start_date, end_date);
|
|
22
|
+
const body = {
|
|
23
|
+
project_id: requireProjectId(project_id),
|
|
24
|
+
};
|
|
25
|
+
if (dates.start_date)
|
|
26
|
+
body.start_date = dates.start_date;
|
|
27
|
+
if (dates.end_date)
|
|
28
|
+
body.end_date = dates.end_date;
|
|
29
|
+
if (dimensions)
|
|
30
|
+
body.dimensions = dimensions;
|
|
31
|
+
if (limit !== undefined)
|
|
32
|
+
body.limit = limit;
|
|
33
|
+
if (offset !== undefined)
|
|
34
|
+
body.offset = offset;
|
|
35
|
+
const merged = mergeFilters(filters, { field: "classification", value: classification });
|
|
36
|
+
if (merged)
|
|
37
|
+
body.filters = merged;
|
|
38
|
+
const data = await client.post("/reports/urls", body);
|
|
39
|
+
const rows = slimReportRows(data);
|
|
40
|
+
return toolResult({ _summary: summaryForUrlsReport(rows), rows });
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
return toolError(e);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=report-urls.js.map
|
|
@@ -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YAElC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAiB,eAAe,EAAE,IAAI,CAAC,CAAC;YACtE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YAClC,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_tags tool for retrieving category tags. */
|
|
4
|
+
export declare function registerTagsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_tags tool for retrieving category tags. */
|
|
6
|
+
export function registerTagsTool(server, client) {
|
|
7
|
+
server.tool("list_tags", "List category tags for a Peec.ai project. Returns tag IDs and names.", {
|
|
8
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
9
|
+
limit: z.number().min(1).max(10000).default(1000).describe("Max results (1-10000)").optional(),
|
|
10
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
11
|
+
}, async ({ project_id, limit, offset }) => {
|
|
12
|
+
try {
|
|
13
|
+
const data = await client.get("/tags", {
|
|
14
|
+
project_id: requireProjectId(project_id),
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
});
|
|
18
|
+
return toolResult({ _summary: summaryForList("tags", data), tags: data });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return toolError(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/tools/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrF,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAqB;IACvE,MAAM,CAAC,IAAI,CACT,WAAW,EACX,sEAAsE,EACtE;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC,CAAC,QAAQ,EAAE;QACjI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;QAC9F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;KAC5E,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAQ,OAAO,EAAE;gBAC5C,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;gBACxC,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YACH,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { PeecApiClient } from "../api-client.js";
|
|
3
|
+
/** Registers the list_topics tool for retrieving topic groupings. */
|
|
4
|
+
export declare function registerTopicsTool(server: McpServer, client: PeecApiClient): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { PeecApiClient } from "../api-client.js";
|
|
4
|
+
import { requireProjectId, summaryForList, toolResult, toolError } from "../util.js";
|
|
5
|
+
/** Registers the list_topics tool for retrieving topic groupings. */
|
|
6
|
+
export function registerTopicsTool(server, client) {
|
|
7
|
+
server.tool("list_topics", "List topic groupings for a Peec.ai project. Returns topic IDs and names.", {
|
|
8
|
+
project_id: z.string().describe("Project ID (uses PEECAI_PROJECT_ID env if omitted). Call list_projects to find IDs.").optional(),
|
|
9
|
+
limit: z.number().min(1).max(10000).default(1000).describe("Max results (1-10000)").optional(),
|
|
10
|
+
offset: z.number().min(0).default(0).describe("Results to skip").optional(),
|
|
11
|
+
}, async ({ project_id, limit, offset }) => {
|
|
12
|
+
try {
|
|
13
|
+
const data = await client.get("/topics", {
|
|
14
|
+
project_id: requireProjectId(project_id),
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
});
|
|
18
|
+
return toolResult({ _summary: summaryForList("topics", data), topics: data });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return toolError(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=topics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topics.js","sourceRoot":"","sources":["../../src/tools/topics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrF,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAqB;IACzE,MAAM,CAAC,IAAI,CACT,aAAa,EACb,0EAA0E,EAC1E;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC,CAAC,QAAQ,EAAE;QACjI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;QAC9F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;KAC5E,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAU,SAAS,EAAE;gBAChD,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;gBACxC,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YACH,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/** Standard Peec.ai API envelope — most list/report endpoints wrap results in `{ data: T }`. */
|
|
2
|
+
export interface ApiResponse<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
}
|
|
5
|
+
/** A Peec.ai project representing a tracked brand or campaign. */
|
|
6
|
+
export interface Project {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
status: ProjectStatus;
|
|
10
|
+
}
|
|
11
|
+
export type ProjectStatus = "CUSTOMER" | "CUSTOMER_ENDED" | "PITCH" | "PITCH_ENDED" | "TRIAL" | "TRIAL_ENDED" | "ONBOARDING" | "DELETED";
|
|
12
|
+
/** A brand being tracked within a project, with its associated domains. */
|
|
13
|
+
export interface Brand {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
domains?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface PromptMessage {
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
/** A search prompt that Peec.ai monitors across AI models. */
|
|
22
|
+
export interface Prompt {
|
|
23
|
+
id: string;
|
|
24
|
+
messages: PromptMessage[];
|
|
25
|
+
tags: DimensionRef[];
|
|
26
|
+
topic: DimensionRef | null;
|
|
27
|
+
user_location: {
|
|
28
|
+
country: string;
|
|
29
|
+
};
|
|
30
|
+
/** Estimated monthly search volume. */
|
|
31
|
+
volume?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface Tag {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Topic {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
/** An AI model tracked by Peec.ai (e.g. ChatGPT, Perplexity). */
|
|
42
|
+
export interface Model {
|
|
43
|
+
id: string;
|
|
44
|
+
is_active: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** Summary of a single AI chat interaction. */
|
|
47
|
+
export interface Chat {
|
|
48
|
+
id: string;
|
|
49
|
+
prompt: DimensionRef;
|
|
50
|
+
model: DimensionRef;
|
|
51
|
+
date: string;
|
|
52
|
+
}
|
|
53
|
+
/** A source URL cited in an AI chat response. */
|
|
54
|
+
export interface ChatSource {
|
|
55
|
+
url: string;
|
|
56
|
+
/** Normalized URL for deduplication; null if normalization was not possible. */
|
|
57
|
+
urlNormalized: string | null;
|
|
58
|
+
domain: string;
|
|
59
|
+
citationCount: number;
|
|
60
|
+
/** Position of this citation in the response (1-based). */
|
|
61
|
+
citationPosition: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ChatBrandMentioned {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
/** Position of this brand mention in the response (1-based). */
|
|
67
|
+
position: number;
|
|
68
|
+
}
|
|
69
|
+
export interface ChatMessage {
|
|
70
|
+
role: "user" | "assistant";
|
|
71
|
+
content: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ChatProduct {
|
|
74
|
+
name: string;
|
|
75
|
+
queries: string[];
|
|
76
|
+
}
|
|
77
|
+
/** Full content of an AI chat including sources, brands, messages, and extracted products. */
|
|
78
|
+
export interface ChatContent {
|
|
79
|
+
id: string;
|
|
80
|
+
prompt: DimensionRef;
|
|
81
|
+
model: DimensionRef;
|
|
82
|
+
sources: ChatSource[];
|
|
83
|
+
brands_mentioned: ChatBrandMentioned[];
|
|
84
|
+
messages: ChatMessage[];
|
|
85
|
+
queries: string[];
|
|
86
|
+
products: ChatProduct[];
|
|
87
|
+
}
|
|
88
|
+
/** Lightweight reference to a dimension entity (prompt, model, tag, or topic) by ID. */
|
|
89
|
+
export interface DimensionRef {
|
|
90
|
+
id: string;
|
|
91
|
+
}
|
|
92
|
+
/** Brand analytics row from the /reports/brands endpoint. */
|
|
93
|
+
export interface BrandReportRow {
|
|
94
|
+
brand: {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
98
|
+
prompt?: DimensionRef;
|
|
99
|
+
model?: DimensionRef;
|
|
100
|
+
tag?: DimensionRef;
|
|
101
|
+
topic?: DimensionRef;
|
|
102
|
+
/** Ratio 0–1: visibility_count / visibility_total. */
|
|
103
|
+
visibility: number;
|
|
104
|
+
visibility_count: number;
|
|
105
|
+
visibility_total: number;
|
|
106
|
+
/** Share of voice 0–1: proportion of total brand mentions. */
|
|
107
|
+
share_of_voice: number;
|
|
108
|
+
/** Number of times this brand was mentioned. */
|
|
109
|
+
mention_count: number;
|
|
110
|
+
/** Sentiment score 0–100 (50 = neutral). Absent when no sentiment data. */
|
|
111
|
+
sentiment?: number;
|
|
112
|
+
sentiment_sum?: number;
|
|
113
|
+
sentiment_count?: number;
|
|
114
|
+
/** Average position when mentioned (lower = better). Absent when no position data. */
|
|
115
|
+
position?: number;
|
|
116
|
+
position_sum?: number;
|
|
117
|
+
position_count?: number;
|
|
118
|
+
}
|
|
119
|
+
export type DomainClassification = "UGC" | "CORPORATE" | "EDITORIAL" | "INSTITUTIONAL" | "OTHER" | "REFERENCE" | "COMPETITOR" | "OWN";
|
|
120
|
+
export type UrlClassification = "HOMEPAGE" | "CATEGORY_PAGE" | "PRODUCT_PAGE" | "LISTICLE" | "COMPARISON" | "PROFILE" | "ALTERNATIVE" | "DISCUSSION" | "HOW_TO_GUIDE" | "ARTICLE" | "OTHER";
|
|
121
|
+
/** Domain analytics row from the /reports/domains endpoint. */
|
|
122
|
+
export interface DomainReportRow {
|
|
123
|
+
domain: string;
|
|
124
|
+
classification: DomainClassification | null;
|
|
125
|
+
prompt?: DimensionRef;
|
|
126
|
+
model?: DimensionRef;
|
|
127
|
+
tag?: DimensionRef;
|
|
128
|
+
topic?: DimensionRef;
|
|
129
|
+
/** Share of chats citing this domain (0–1). */
|
|
130
|
+
usage_rate?: number;
|
|
131
|
+
/** Average number of citations per chat. */
|
|
132
|
+
citation_avg: number;
|
|
133
|
+
}
|
|
134
|
+
/** URL analytics row from the /reports/urls endpoint. */
|
|
135
|
+
export interface UrlReportRow {
|
|
136
|
+
url: string;
|
|
137
|
+
classification: UrlClassification;
|
|
138
|
+
title: string | null;
|
|
139
|
+
prompt?: DimensionRef;
|
|
140
|
+
model?: DimensionRef;
|
|
141
|
+
tag?: DimensionRef;
|
|
142
|
+
topic?: DimensionRef;
|
|
143
|
+
/** Number of chats citing this URL. */
|
|
144
|
+
usage_count: number;
|
|
145
|
+
/** Total citation count across all chats. */
|
|
146
|
+
citation_count: number;
|
|
147
|
+
/** Average citations per chat. */
|
|
148
|
+
citation_avg: number;
|
|
149
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|