@kywi-software/mcp 0.1.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.
Files changed (119) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +77 -0
  3. package/dist/__tests__/auto-detect.test.d.ts +2 -0
  4. package/dist/__tests__/auto-detect.test.d.ts.map +1 -0
  5. package/dist/__tests__/auto-detect.test.js +134 -0
  6. package/dist/__tests__/auto-detect.test.js.map +1 -0
  7. package/dist/__tests__/config.test.d.ts +2 -0
  8. package/dist/__tests__/config.test.d.ts.map +1 -0
  9. package/dist/__tests__/config.test.js +72 -0
  10. package/dist/__tests__/config.test.js.map +1 -0
  11. package/dist/__tests__/developer-mutation.test.d.ts +2 -0
  12. package/dist/__tests__/developer-mutation.test.d.ts.map +1 -0
  13. package/dist/__tests__/developer-mutation.test.js +511 -0
  14. package/dist/__tests__/developer-mutation.test.js.map +1 -0
  15. package/dist/__tests__/developer-read-only.test.d.ts +2 -0
  16. package/dist/__tests__/developer-read-only.test.d.ts.map +1 -0
  17. package/dist/__tests__/developer-read-only.test.js +192 -0
  18. package/dist/__tests__/developer-read-only.test.js.map +1 -0
  19. package/dist/__tests__/site-content-tools.test.d.ts +2 -0
  20. package/dist/__tests__/site-content-tools.test.d.ts.map +1 -0
  21. package/dist/__tests__/site-content-tools.test.js +446 -0
  22. package/dist/__tests__/site-content-tools.test.js.map +1 -0
  23. package/dist/__tests__/site-layout-tools.test.d.ts +2 -0
  24. package/dist/__tests__/site-layout-tools.test.d.ts.map +1 -0
  25. package/dist/__tests__/site-layout-tools.test.js +316 -0
  26. package/dist/__tests__/site-layout-tools.test.js.map +1 -0
  27. package/dist/__tests__/site-other-tools.test.d.ts +2 -0
  28. package/dist/__tests__/site-other-tools.test.d.ts.map +1 -0
  29. package/dist/__tests__/site-other-tools.test.js +318 -0
  30. package/dist/__tests__/site-other-tools.test.js.map +1 -0
  31. package/dist/config.d.ts +31 -0
  32. package/dist/config.d.ts.map +1 -0
  33. package/dist/config.js +4 -0
  34. package/dist/config.js.map +1 -0
  35. package/dist/developer/auto-detect.d.ts +17 -0
  36. package/dist/developer/auto-detect.d.ts.map +1 -0
  37. package/dist/developer/auto-detect.js +54 -0
  38. package/dist/developer/auto-detect.js.map +1 -0
  39. package/dist/developer/cli.d.ts +3 -0
  40. package/dist/developer/cli.d.ts.map +1 -0
  41. package/dist/developer/cli.js +14 -0
  42. package/dist/developer/cli.js.map +1 -0
  43. package/dist/developer/index.d.ts +4 -0
  44. package/dist/developer/index.d.ts.map +1 -0
  45. package/dist/developer/index.js +9 -0
  46. package/dist/developer/index.js.map +1 -0
  47. package/dist/developer/server.d.ts +4 -0
  48. package/dist/developer/server.d.ts.map +1 -0
  49. package/dist/developer/server.js +29 -0
  50. package/dist/developer/server.js.map +1 -0
  51. package/dist/developer/tools/api-keys.d.ts +48 -0
  52. package/dist/developer/tools/api-keys.d.ts.map +1 -0
  53. package/dist/developer/tools/api-keys.js +51 -0
  54. package/dist/developer/tools/api-keys.js.map +1 -0
  55. package/dist/developer/tools/config-mutation.d.ts +139 -0
  56. package/dist/developer/tools/config-mutation.d.ts.map +1 -0
  57. package/dist/developer/tools/config-mutation.js +277 -0
  58. package/dist/developer/tools/config-mutation.js.map +1 -0
  59. package/dist/developer/tools/content-type-tools.d.ts +32 -0
  60. package/dist/developer/tools/content-type-tools.d.ts.map +1 -0
  61. package/dist/developer/tools/content-type-tools.js +92 -0
  62. package/dist/developer/tools/content-type-tools.js.map +1 -0
  63. package/dist/developer/tools/read-only.d.ts +86 -0
  64. package/dist/developer/tools/read-only.d.ts.map +1 -0
  65. package/dist/developer/tools/read-only.js +235 -0
  66. package/dist/developer/tools/read-only.js.map +1 -0
  67. package/dist/developer/tools/scaffolding.d.ts +67 -0
  68. package/dist/developer/tools/scaffolding.d.ts.map +1 -0
  69. package/dist/developer/tools/scaffolding.js +207 -0
  70. package/dist/developer/tools/scaffolding.js.map +1 -0
  71. package/dist/index.d.ts +7 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +6 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/shared.d.ts +15 -0
  76. package/dist/shared.d.ts.map +1 -0
  77. package/dist/shared.js +7 -0
  78. package/dist/shared.js.map +1 -0
  79. package/dist/site/cli.d.ts +3 -0
  80. package/dist/site/cli.d.ts.map +1 -0
  81. package/dist/site/cli.js +12 -0
  82. package/dist/site/cli.js.map +1 -0
  83. package/dist/site/index.d.ts +4 -0
  84. package/dist/site/index.d.ts.map +1 -0
  85. package/dist/site/index.js +9 -0
  86. package/dist/site/index.js.map +1 -0
  87. package/dist/site/server.d.ts +10 -0
  88. package/dist/site/server.d.ts.map +1 -0
  89. package/dist/site/server.js +73 -0
  90. package/dist/site/server.js.map +1 -0
  91. package/dist/site/tools/content.d.ts +250 -0
  92. package/dist/site/tools/content.d.ts.map +1 -0
  93. package/dist/site/tools/content.js +329 -0
  94. package/dist/site/tools/content.js.map +1 -0
  95. package/dist/site/tools/feeds.d.ts +62 -0
  96. package/dist/site/tools/feeds.d.ts.map +1 -0
  97. package/dist/site/tools/feeds.js +97 -0
  98. package/dist/site/tools/feeds.js.map +1 -0
  99. package/dist/site/tools/layout.d.ts +163 -0
  100. package/dist/site/tools/layout.d.ts.map +1 -0
  101. package/dist/site/tools/layout.js +226 -0
  102. package/dist/site/tools/layout.js.map +1 -0
  103. package/dist/site/tools/media.d.ts +38 -0
  104. package/dist/site/tools/media.d.ts.map +1 -0
  105. package/dist/site/tools/media.js +52 -0
  106. package/dist/site/tools/media.js.map +1 -0
  107. package/dist/site/tools/search.d.ts +40 -0
  108. package/dist/site/tools/search.d.ts.map +1 -0
  109. package/dist/site/tools/search.js +60 -0
  110. package/dist/site/tools/search.js.map +1 -0
  111. package/dist/site/tools/users.d.ts +60 -0
  112. package/dist/site/tools/users.d.ts.map +1 -0
  113. package/dist/site/tools/users.js +71 -0
  114. package/dist/site/tools/users.js.map +1 -0
  115. package/dist/site/tools/webhooks.d.ts +34 -0
  116. package/dist/site/tools/webhooks.d.ts.map +1 -0
  117. package/dist/site/tools/webhooks.js +44 -0
  118. package/dist/site/tools/webhooks.js.map +1 -0
  119. package/package.json +61 -0
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from './config.js';
2
+ export * from './shared.js';
3
+ export { createSiteMcpServer, startSiteMcp } from './site/index.js';
4
+ export { createDeveloperMcpServer, startDeveloperMcp } from './developer/index.js';
5
+ export { detectMode } from './developer/auto-detect.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,15 @@
1
+ export declare function textResult(data: unknown): {
2
+ content: [{
3
+ type: 'text';
4
+ text: string;
5
+ }];
6
+ isError?: undefined;
7
+ };
8
+ export declare function errorResult(message: string): {
9
+ content: [{
10
+ type: 'text';
11
+ text: string;
12
+ }];
13
+ isError: true;
14
+ };
15
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CACxB,IAAI,EAAE,OAAO,GACZ;IAAE,OAAO,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CAEpE;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAE9D"}
package/dist/shared.js ADDED
@@ -0,0 +1,7 @@
1
+ export function textResult(data) {
2
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
3
+ }
4
+ export function errorResult(message) {
5
+ return { content: [{ type: 'text', text: message }], isError: true };
6
+ }
7
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CACxB,IAAa;IAEb,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACtF,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,OAAe;IAEf,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAA;AACxF,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/site/cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createSiteMcpServer } from './server.js';
4
+ const config = {
5
+ enabled: true,
6
+ baseUrl: process.env.KYWI_API_URL ?? 'http://localhost:3000/api/v1',
7
+ apiKey: process.env.KYWI_MCP_API_KEY ?? '',
8
+ };
9
+ const server = createSiteMcpServer(config);
10
+ const transport = new StdioServerTransport();
11
+ await server.connect(transport);
12
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/site/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,8BAA8B;IACnE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;CAC3C,CAAA;AAED,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;AAC1C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { createSiteMcpServer, registerTypeSpecificTools } from './server.js';
2
+ import type { McpSiteConfig } from '../config.js';
3
+ export declare function startSiteMcp(config: McpSiteConfig): Promise<void>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/site/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAI5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAIvE"}
@@ -0,0 +1,9 @@
1
+ export { createSiteMcpServer, registerTypeSpecificTools } from './server.js';
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createSiteMcpServer } from './server.js';
4
+ export async function startSiteMcp(config) {
5
+ const server = createSiteMcpServer(config);
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);
8
+ }
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/site/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGjD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAqB;IACtD,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC1C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACjC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { KywiSdkScope } from '@kywi-software/sdk';
3
+ import type { McpSiteConfig } from '../config.js';
4
+ /**
5
+ * Fetch content types from the API and register type-specific tools
6
+ * (e.g. create_page, list_page, create_blogPost, list_blogPost).
7
+ */
8
+ export declare function registerTypeSpecificTools(server: McpServer, sdk: KywiSdkScope, baseUrl: string): Promise<number>;
9
+ export declare function createSiteMcpServer(config: McpSiteConfig): McpServer;
10
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/site/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AASjD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAwBpE"}
@@ -0,0 +1,73 @@
1
+ import { z } from 'zod';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { createKywiSdk, KywiHttpClient } from '@kywi-software/sdk';
4
+ import { textResult } from '../shared.js';
5
+ import { registerContentTools } from './tools/content.js';
6
+ import { registerLayoutTools } from './tools/layout.js';
7
+ import { registerFeedTools } from './tools/feeds.js';
8
+ import { registerSearchTools } from './tools/search.js';
9
+ import { registerMediaTools } from './tools/media.js';
10
+ import { registerUserTools } from './tools/users.js';
11
+ /**
12
+ * Fetch content types from the API and register type-specific tools
13
+ * (e.g. create_page, list_page, create_blogPost, list_blogPost).
14
+ */
15
+ export async function registerTypeSpecificTools(server, sdk, baseUrl) {
16
+ try {
17
+ const http = new KywiHttpClient({ baseUrl });
18
+ const res = await http.get('/config/content-types');
19
+ if ('error' in res)
20
+ return 0;
21
+ let count = 0;
22
+ for (const ct of res.data) {
23
+ const fieldEntries = {};
24
+ for (const field of ct.fields) {
25
+ fieldEntries[field.name] = field.required
26
+ ? z.string().describe(field.label)
27
+ : z.string().optional().describe(field.label);
28
+ }
29
+ server.registerTool(`create_${ct.name}`, {
30
+ description: `Create a new ${ct.label}`,
31
+ inputSchema: z.object(fieldEntries),
32
+ }, async (args) => {
33
+ const item = await sdk.content.create(ct.name, args);
34
+ return textResult(item);
35
+ });
36
+ server.registerTool(`list_${ct.name}`, {
37
+ description: `List ${ct.label} content`,
38
+ inputSchema: z.object({
39
+ page: z.number().int().optional(),
40
+ limit: z.number().int().optional(),
41
+ status: z.string().optional(),
42
+ }),
43
+ }, async (args) => {
44
+ const result = await sdk.content.list(ct.name, undefined, args);
45
+ return textResult(result);
46
+ });
47
+ count += 2;
48
+ }
49
+ return count;
50
+ }
51
+ catch {
52
+ return 0;
53
+ }
54
+ }
55
+ export function createSiteMcpServer(config) {
56
+ const server = new McpServer({ name: '@kywi-software/mcp/site', version: '0.1.0' }, { capabilities: { tools: {} } });
57
+ const sdk = createKywiSdk({
58
+ baseUrl: config.baseUrl,
59
+ apiKey: config.apiKey,
60
+ });
61
+ registerContentTools(server, sdk, config.baseUrl, config.apiKey);
62
+ registerLayoutTools(server, sdk);
63
+ registerFeedTools(server, sdk);
64
+ registerSearchTools(server, sdk);
65
+ registerMediaTools(server, sdk);
66
+ registerUserTools(server, sdk);
67
+ // Type-specific tools are registered async — call registerTypeSpecificTools separately
68
+ // after server creation if needed:
69
+ // const server = createSiteMcpServer(config)
70
+ // await registerTypeSpecificTools(server, sdk, config.baseUrl)
71
+ return server;
72
+ }
73
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/site/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAiB,EACjB,GAAiB,EACjB,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAA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AAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE9B,uFAAuF;IACvF,mCAAmC;IACnC,+CAA+C;IAC/C,iEAAiE;IAEjE,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,250 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { KywiSdkScope } from '@kywi-software/sdk';
3
+ export declare function handleGetContent(sdk: KywiSdkScope, args: {
4
+ id?: string | undefined;
5
+ slug?: string | undefined;
6
+ }): Promise<{
7
+ content: [{
8
+ type: "text";
9
+ text: string;
10
+ }];
11
+ isError?: undefined;
12
+ } | {
13
+ content: [{
14
+ type: "text";
15
+ text: string;
16
+ }];
17
+ isError: true;
18
+ }>;
19
+ export declare function handleListContent(sdk: KywiSdkScope, args: {
20
+ type: string;
21
+ status?: string | undefined;
22
+ search?: string | undefined;
23
+ page?: number | undefined;
24
+ limit?: number | undefined;
25
+ sort?: string | undefined;
26
+ dir?: 'asc' | 'desc' | undefined;
27
+ }): Promise<{
28
+ content: [{
29
+ type: "text";
30
+ text: string;
31
+ }];
32
+ isError?: undefined;
33
+ }>;
34
+ export declare function handleCreateContent(sdk: KywiSdkScope, args: {
35
+ type: string;
36
+ fields: Record<string, unknown>;
37
+ parentId?: string | undefined;
38
+ isNav?: boolean | undefined;
39
+ sortOrder?: number | undefined;
40
+ }): Promise<{
41
+ content: [{
42
+ type: "text";
43
+ text: string;
44
+ }];
45
+ isError?: undefined;
46
+ }>;
47
+ export declare function handleUpdateContent(sdk: KywiSdkScope, args: {
48
+ type: string;
49
+ id: string;
50
+ fields: Record<string, unknown>;
51
+ }): Promise<{
52
+ content: [{
53
+ type: "text";
54
+ text: string;
55
+ }];
56
+ isError?: undefined;
57
+ } | {
58
+ content: [{
59
+ type: "text";
60
+ text: string;
61
+ }];
62
+ isError: true;
63
+ }>;
64
+ export declare function handleDeleteContent(sdk: KywiSdkScope, args: {
65
+ type: string;
66
+ id: string;
67
+ }): Promise<{
68
+ content: [{
69
+ type: "text";
70
+ text: string;
71
+ }];
72
+ isError?: undefined;
73
+ } | {
74
+ content: [{
75
+ type: "text";
76
+ text: string;
77
+ }];
78
+ isError: true;
79
+ }>;
80
+ export declare function handlePublishContent(sdk: KywiSdkScope, args: {
81
+ type: string;
82
+ id: string;
83
+ }): Promise<{
84
+ content: [{
85
+ type: "text";
86
+ text: string;
87
+ }];
88
+ isError?: undefined;
89
+ } | {
90
+ content: [{
91
+ type: "text";
92
+ text: string;
93
+ }];
94
+ isError: true;
95
+ }>;
96
+ export declare function handleUnpublishContent(sdk: KywiSdkScope, args: {
97
+ type: string;
98
+ id: string;
99
+ }): Promise<{
100
+ content: [{
101
+ type: "text";
102
+ text: string;
103
+ }];
104
+ isError?: undefined;
105
+ } | {
106
+ content: [{
107
+ type: "text";
108
+ text: string;
109
+ }];
110
+ isError: true;
111
+ }>;
112
+ export declare function handleSubmitForReview(sdk: KywiSdkScope, args: {
113
+ type: string;
114
+ id: string;
115
+ }): Promise<{
116
+ content: [{
117
+ type: "text";
118
+ text: string;
119
+ }];
120
+ isError?: undefined;
121
+ } | {
122
+ content: [{
123
+ type: "text";
124
+ text: string;
125
+ }];
126
+ isError: true;
127
+ }>;
128
+ export declare function handleApproveContent(sdk: KywiSdkScope, args: {
129
+ type: string;
130
+ id: string;
131
+ }): Promise<{
132
+ content: [{
133
+ type: "text";
134
+ text: string;
135
+ }];
136
+ isError?: undefined;
137
+ } | {
138
+ content: [{
139
+ type: "text";
140
+ text: string;
141
+ }];
142
+ isError: true;
143
+ }>;
144
+ export declare function handleRejectContent(sdk: KywiSdkScope, args: {
145
+ type: string;
146
+ id: string;
147
+ reason: string;
148
+ }): Promise<{
149
+ content: [{
150
+ type: "text";
151
+ text: string;
152
+ }];
153
+ isError?: undefined;
154
+ } | {
155
+ content: [{
156
+ type: "text";
157
+ text: string;
158
+ }];
159
+ isError: true;
160
+ }>;
161
+ export declare function handleRestoreVersion(sdk: KywiSdkScope, args: {
162
+ type: string;
163
+ id: string;
164
+ versionId: string;
165
+ }): Promise<{
166
+ content: [{
167
+ type: "text";
168
+ text: string;
169
+ }];
170
+ isError?: undefined;
171
+ } | {
172
+ content: [{
173
+ type: "text";
174
+ text: string;
175
+ }];
176
+ isError: true;
177
+ }>;
178
+ export declare function handleMoveContent(sdk: KywiSdkScope, args: {
179
+ type: string;
180
+ id: string;
181
+ parentId: string;
182
+ sortOrder?: number | undefined;
183
+ }): Promise<{
184
+ content: [{
185
+ type: "text";
186
+ text: string;
187
+ }];
188
+ isError?: undefined;
189
+ } | {
190
+ content: [{
191
+ type: "text";
192
+ text: string;
193
+ }];
194
+ isError: true;
195
+ }>;
196
+ export declare function handleCopyContent(sdk: KywiSdkScope, args: {
197
+ type: string;
198
+ id: string;
199
+ parentId: string;
200
+ deep?: boolean | undefined;
201
+ }): Promise<{
202
+ content: [{
203
+ type: "text";
204
+ text: string;
205
+ }];
206
+ isError?: undefined;
207
+ } | {
208
+ content: [{
209
+ type: "text";
210
+ text: string;
211
+ }];
212
+ isError: true;
213
+ }>;
214
+ export declare function handleBulkCreate(sdk: KywiSdkScope, args: {
215
+ type: string;
216
+ items: Record<string, unknown>[];
217
+ }): Promise<{
218
+ content: [{
219
+ type: "text";
220
+ text: string;
221
+ }];
222
+ isError?: undefined;
223
+ }>;
224
+ export declare function handleBulkPublish(sdk: KywiSdkScope, args: {
225
+ type: string;
226
+ ids: string[];
227
+ }): Promise<{
228
+ content: [{
229
+ type: "text";
230
+ text: string;
231
+ }];
232
+ isError?: undefined;
233
+ }>;
234
+ export declare function handleListPendingContent(sdk: KywiSdkScope, args: {
235
+ siteId?: string | undefined;
236
+ }): Promise<{
237
+ content: [{
238
+ type: "text";
239
+ text: string;
240
+ }];
241
+ isError?: undefined;
242
+ }>;
243
+ export declare function getBuiltInContentTypes(): {
244
+ name: string;
245
+ label: string;
246
+ isDefault: boolean;
247
+ fields: readonly [];
248
+ }[];
249
+ export declare function registerContentTools(server: McpServer, sdk: KywiSdkScope, baseUrl?: string, apiKey?: string): void;
250
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/site/tools/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKtD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE;;;;;;;;;;;;GAW7D;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;CACjC;;;;;;GAKF;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE;;;;;;GAQpJ;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,YAAY,EACjB,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