@lovelybunch/mcp 1.0.76-alpha.0 → 1.0.76-alpha.2

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.
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Fetch Tool - Enables the AI to retrieve content from URLs
3
+ *
4
+ * Security considerations:
5
+ * - Only HTTP/HTTPS protocols allowed
6
+ * - Blocks private/internal IP ranges
7
+ * - Response size limited to prevent memory issues
8
+ * - Timeout to prevent hanging requests
9
+ */
10
+ export declare const fetchTool: {
11
+ name: string;
12
+ description: string;
13
+ parameters: {
14
+ type: string;
15
+ properties: {
16
+ url: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ method: {
21
+ type: string;
22
+ enum: string[];
23
+ description: string;
24
+ };
25
+ headers: {
26
+ type: string;
27
+ description: string;
28
+ additionalProperties: {
29
+ type: string;
30
+ };
31
+ };
32
+ body: {
33
+ type: string;
34
+ description: string;
35
+ };
36
+ };
37
+ required: string[];
38
+ };
39
+ };
40
+ export declare const FETCH_CONFIG: {
41
+ MAX_RESPONSE_SIZE: number;
42
+ TIMEOUT_MS: number;
43
+ BLOCKED_HOSTNAMES: string[];
44
+ BLOCKED_IP_PREFIXES: string[];
45
+ };
46
+ /**
47
+ * Validate that a URL is safe to fetch
48
+ */
49
+ export declare function validateFetchUrl(url: string): {
50
+ valid: boolean;
51
+ error?: string;
52
+ };
53
+ //# sourceMappingURL=fetch-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-tool.d.ts","sourceRoot":"","sources":["../src/fetch-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BrB,CAAA;AAGD,eAAO,MAAM,YAAY;;;;;CAoBxB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA0BhF"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Fetch Tool - Enables the AI to retrieve content from URLs
3
+ *
4
+ * Security considerations:
5
+ * - Only HTTP/HTTPS protocols allowed
6
+ * - Blocks private/internal IP ranges
7
+ * - Response size limited to prevent memory issues
8
+ * - Timeout to prevent hanging requests
9
+ */
10
+ export const fetchTool = {
11
+ name: 'fetch_url',
12
+ description: 'Fetch content from a URL. Use this to retrieve web pages, API responses, documentation, or any publicly accessible content. Returns the text/HTML/JSON content from the URL.',
13
+ parameters: {
14
+ type: 'object',
15
+ properties: {
16
+ url: {
17
+ type: 'string',
18
+ description: 'The URL to fetch (must be http:// or https://)'
19
+ },
20
+ method: {
21
+ type: 'string',
22
+ enum: ['GET', 'POST'],
23
+ description: 'HTTP method to use. Defaults to GET.'
24
+ },
25
+ headers: {
26
+ type: 'object',
27
+ description: 'Optional HTTP headers to include in the request',
28
+ additionalProperties: { type: 'string' }
29
+ },
30
+ body: {
31
+ type: 'string',
32
+ description: 'Optional request body for POST requests'
33
+ }
34
+ },
35
+ required: ['url']
36
+ }
37
+ };
38
+ // Configuration constants
39
+ export const FETCH_CONFIG = {
40
+ MAX_RESPONSE_SIZE: 100000, // 100KB max response
41
+ TIMEOUT_MS: 30000, // 30 second timeout
42
+ BLOCKED_HOSTNAMES: [
43
+ 'localhost',
44
+ '127.0.0.1',
45
+ '0.0.0.0',
46
+ '::1'
47
+ ],
48
+ BLOCKED_IP_PREFIXES: [
49
+ '10.', // Private class A
50
+ '172.16.', '172.17.', '172.18.', '172.19.', // Private class B
51
+ '172.20.', '172.21.', '172.22.', '172.23.',
52
+ '172.24.', '172.25.', '172.26.', '172.27.',
53
+ '172.28.', '172.29.', '172.30.', '172.31.',
54
+ '192.168.', // Private class C
55
+ '169.254.', // Link-local
56
+ 'fc00:', 'fd00:', // IPv6 private
57
+ 'fe80:' // IPv6 link-local
58
+ ]
59
+ };
60
+ /**
61
+ * Validate that a URL is safe to fetch
62
+ */
63
+ export function validateFetchUrl(url) {
64
+ try {
65
+ const parsed = new URL(url);
66
+ // Only allow HTTP/HTTPS
67
+ if (!['http:', 'https:'].includes(parsed.protocol)) {
68
+ return { valid: false, error: `Protocol '${parsed.protocol}' not allowed. Only http:// and https:// are supported.` };
69
+ }
70
+ // Block localhost and loopback
71
+ const hostname = parsed.hostname.toLowerCase();
72
+ if (FETCH_CONFIG.BLOCKED_HOSTNAMES.includes(hostname)) {
73
+ return { valid: false, error: 'Requests to localhost/loopback addresses are not allowed.' };
74
+ }
75
+ // Block private IP ranges
76
+ for (const prefix of FETCH_CONFIG.BLOCKED_IP_PREFIXES) {
77
+ if (hostname.startsWith(prefix)) {
78
+ return { valid: false, error: 'Requests to private/internal IP addresses are not allowed.' };
79
+ }
80
+ }
81
+ return { valid: true };
82
+ }
83
+ catch (err) {
84
+ return { valid: false, error: `Invalid URL: ${err instanceof Error ? err.message : 'parse error'}` };
85
+ }
86
+ }
87
+ //# sourceMappingURL=fetch-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-tool.js","sourceRoot":"","sources":["../src/fetch-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,8KAA8K;IAC3L,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;gBACrB,WAAW,EAAE,sCAAsC;aACpD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iDAAiD;gBAC9D,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAA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AQ,CAAC,EAAE,CAAC;YACtD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2DAA2D,EAAE,CAAA;QAC7F,CAAC;QAED,0BAA0B;QAC1B,KAAK,MAAM,MAAM,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;YACtD,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,4DAA4D,EAAE,CAAA;YAC9F,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAAE,EAAE,CAAA;IACtG,CAAC;AACH,CAAC"}
@@ -21,11 +21,6 @@ export declare const proposalsTool: MCPTool;
21
21
  * Creating proposals should be done by coding agents (Claude Code, Cursor, etc.) or via the UI.
22
22
  */
23
23
  export declare const proposalsReadOnlyTool: MCPTool;
24
- /**
25
- * Full CRUD proposals tool that includes create and update operations.
26
- * Uses Zod schemas for validation.
27
- */
28
- export declare const proposalsFullTool: MCPTool;
29
24
  export declare function validateProposalData(data: any): Partial<ChangeProposal>;
30
25
  export declare function createToolCall(operation: string, args: any): MCPToolCall;
31
26
  //# sourceMappingURL=proposals-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proposals-tool.d.ts","sourceRoot":"","sources":["../src/proposals-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGxD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE;QACV,IAAI,EAAE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AO,MAAM,iBAAiB,EAAE,OAiC/B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,OA8J3B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,OA+CnC,CAAA;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAkBvE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,WAAW,CAQxE"}
@@ -1,9 +1,3 @@
1
- import { proposalJsonSchemas } from '@lovelybunch/core';
2
- // Use pre-computed JSON schemas from core
3
- const filtersProperties = proposalJsonSchemas.filters;
4
- const createProperties = proposalJsonSchemas.create;
5
- const updateProperties = proposalJsonSchemas.update;
6
- const createRequired = proposalJsonSchemas.createRequired;
7
1
  export const listProposalsTool = {
8
2
  name: "list_proposals",
9
3
  description: "List all change proposals with metadata only (title, ID, status, priority, tags)",
@@ -13,7 +7,27 @@ export const listProposalsTool = {
13
7
  filters: {
14
8
  type: "object",
15
9
  description: "Optional filters for the proposal list",
16
- properties: filtersProperties
10
+ properties: {
11
+ status: {
12
+ type: "string",
13
+ enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
14
+ description: "Filter by proposal status"
15
+ },
16
+ priority: {
17
+ type: "string",
18
+ enum: ["low", "medium", "high", "critical"],
19
+ description: "Filter by priority level"
20
+ },
21
+ tags: {
22
+ type: "array",
23
+ items: { type: "string" },
24
+ description: "Filter by tags"
25
+ },
26
+ search: {
27
+ type: "string",
28
+ description: "Search query for proposal content"
29
+ }
30
+ }
17
31
  }
18
32
  }
19
33
  }
@@ -33,18 +47,145 @@ export const proposalsTool = {
33
47
  type: "string",
34
48
  description: "Proposal ID (required for get, update, delete operations)"
35
49
  },
36
- // Filters for list operation - auto-generated from Zod schema
37
50
  filters: {
38
51
  type: "object",
39
52
  description: "Filters for list operation. Use search to find proposals by keyword - results are filtered server-side for accuracy.",
40
- properties: filtersProperties
53
+ properties: {
54
+ status: {
55
+ type: "string",
56
+ enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
57
+ description: "Filter by proposal status"
58
+ },
59
+ author: {
60
+ type: "string",
61
+ description: "Filter by author name or email"
62
+ },
63
+ priority: {
64
+ type: "string",
65
+ enum: ["low", "medium", "high", "critical"],
66
+ description: "Filter by priority level"
67
+ },
68
+ tags: {
69
+ type: "array",
70
+ items: { type: "string" },
71
+ description: "Filter by tags"
72
+ },
73
+ search: {
74
+ type: "string",
75
+ description: "Search query to filter proposals by intent, content, author, or tags. Always use this when looking for proposals about a specific topic."
76
+ }
77
+ }
41
78
  },
42
- // Proposal data for create operation - auto-generated from Zod schema
43
79
  proposal: {
44
80
  type: "object",
45
- description: "Proposal data for create/update operations. For create: intent and content are required. For update: at least one field is required.",
46
- properties: createProperties,
47
- required: [...createRequired]
81
+ description: "Proposal data for create/update operations",
82
+ properties: {
83
+ intent: {
84
+ type: "string",
85
+ description: "Brief description of what the proposal aims to achieve"
86
+ },
87
+ content: {
88
+ type: "string",
89
+ description: "Detailed content of the proposal"
90
+ },
91
+ author: {
92
+ type: "object",
93
+ description: "Author information",
94
+ properties: {
95
+ id: { type: "string" },
96
+ name: { type: "string" },
97
+ email: { type: "string" },
98
+ role: { type: "string" },
99
+ type: { type: "string", enum: ["human", "agent"] }
100
+ }
101
+ },
102
+ planSteps: {
103
+ type: "array",
104
+ description: "Implementation plan steps. Each item may be a string (description) or an object with fields.",
105
+ items: {
106
+ oneOf: [
107
+ { type: "string", description: "Step description" },
108
+ {
109
+ type: "object",
110
+ properties: {
111
+ id: { type: "string", description: "Step identifier (optional)" },
112
+ description: { type: "string", description: "Human-readable step description" },
113
+ status: { type: "string", enum: ["pending", "in-progress", "completed", "failed"], description: "Execution status" },
114
+ command: { type: "string", description: "Optional command to execute" },
115
+ expectedOutcome: { type: "string", description: "Expected outcome of the step" }
116
+ },
117
+ required: ["description"]
118
+ }
119
+ ]
120
+ }
121
+ },
122
+ evidence: {
123
+ type: "array",
124
+ items: { type: "string" },
125
+ description: "Supporting evidence"
126
+ },
127
+ policies: {
128
+ type: "array",
129
+ items: { type: "string" },
130
+ description: "Related policies"
131
+ },
132
+ featureFlags: {
133
+ type: "array",
134
+ items: { type: "string" },
135
+ description: "Feature flags needed"
136
+ },
137
+ experiments: {
138
+ type: "array",
139
+ items: { type: "string" },
140
+ description: "A/B tests or experiments"
141
+ },
142
+ telemetryContracts: {
143
+ type: "array",
144
+ items: { type: "string" },
145
+ description: "Telemetry contracts"
146
+ },
147
+ releasePlan: {
148
+ type: "object",
149
+ description: "Release strategy",
150
+ properties: {
151
+ strategy: {
152
+ type: "string",
153
+ enum: ["immediate", "gradual", "scheduled", "gated"]
154
+ }
155
+ }
156
+ },
157
+ status: {
158
+ type: "string",
159
+ enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
160
+ description: "Current status of the proposal"
161
+ },
162
+ metadata: {
163
+ type: "object",
164
+ description: "Additional metadata",
165
+ properties: {
166
+ tags: {
167
+ type: "array",
168
+ items: { type: "string" },
169
+ description: "Tags for categorization"
170
+ },
171
+ priority: {
172
+ type: "string",
173
+ enum: ["low", "medium", "high", "critical"],
174
+ description: "Priority level"
175
+ },
176
+ reviewers: {
177
+ type: "array",
178
+ items: { type: "string" },
179
+ description: "List of reviewers"
180
+ }
181
+ }
182
+ },
183
+ productSpecRef: {
184
+ type: "string",
185
+ description: "Reference to related product specification"
186
+ }
187
+ },
188
+ required: ["intent", "content"]
48
189
  }
49
190
  },
50
191
  required: ["operation"]
@@ -70,52 +211,34 @@ export const proposalsReadOnlyTool = {
70
211
  type: "string",
71
212
  description: "Proposal ID (required for get operation)"
72
213
  },
73
- // Filters auto-generated from Zod schema
74
214
  filters: {
75
215
  type: "object",
76
216
  description: "Filters for list operation. Use search to find proposals by keyword.",
77
- properties: filtersProperties
78
- }
79
- },
80
- required: ["operation"]
81
- }
82
- };
83
- /**
84
- * Full CRUD proposals tool that includes create and update operations.
85
- * Uses Zod schemas for validation.
86
- */
87
- export const proposalsFullTool = {
88
- name: "change_proposals",
89
- description: "Full CRUD for change proposals - create, read, update, delete. Use this when you need to create or modify proposals via MCP.",
90
- parameters: {
91
- type: "object",
92
- properties: {
93
- operation: {
94
- type: "string",
95
- enum: ["list", "get", "create", "update", "delete"],
96
- description: "The operation to perform"
97
- },
98
- id: {
99
- type: "string",
100
- description: "Proposal ID (required for get, update, delete operations)"
101
- },
102
- filters: {
103
- type: "object",
104
- description: "Filters for list operation",
105
- properties: filtersProperties
106
- },
107
- // For create - all fields from CreateProposalInputSchema
108
- proposal: {
109
- type: "object",
110
- description: "Proposal data for create operation",
111
- properties: createProperties,
112
- required: [...createRequired]
113
- },
114
- // For update - partial fields from UpdateProposalInputSchema
115
- updates: {
116
- type: "object",
117
- description: "Fields to update (for update operation). At least one field required.",
118
- properties: updateProperties
217
+ properties: {
218
+ status: {
219
+ type: "string",
220
+ enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
221
+ description: "Filter by proposal status"
222
+ },
223
+ author: {
224
+ type: "string",
225
+ description: "Filter by author name or email"
226
+ },
227
+ priority: {
228
+ type: "string",
229
+ enum: ["low", "medium", "high", "critical"],
230
+ description: "Filter by priority level"
231
+ },
232
+ tags: {
233
+ type: "array",
234
+ items: { type: "string" },
235
+ description: "Filter by tags"
236
+ },
237
+ search: {
238
+ type: "string",
239
+ description: "Search query to filter proposals by intent, content, author, or tags"
240
+ }
241
+ }
119
242
  }
120
243
  },
121
244
  required: ["operation"]
@@ -1 +1 @@
1
- {"version":3,"file":"proposals-tool.js","sourceRoot":"","sources":["../src/proposals-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAkBvD,0CAA0C;AAC1C,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,OAAO,CAAA;AACrD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAA;AACnD,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AI,IAAI,CAAC,WAAW;QAAE,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;IAC7D,IAAI,IAAI,CAAC,MAAM;QAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC9C,IAAI,IAAI,CAAC,QAAQ;QAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IACpD,IAAI,IAAI,CAAC,cAAc;QAAE,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;IAEtE,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,IAAS;IACzD,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE;YACT,SAAS;YACT,GAAG,IAAI;SACR;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { MCPTool } from './proposals-tool.js';
2
+ /**
3
+ * Tool for fetching and extracting readable content from web URLs.
4
+ * This is a read-only tool that retrieves web page content for context.
5
+ */
6
+ export declare const urlReaderTool: MCPTool;
7
+ //# sourceMappingURL=url-reader-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-reader-tool.d.ts","sourceRoot":"","sources":["../src/url-reader-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,OAkB3B,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Tool for fetching and extracting readable content from web URLs.
3
+ * This is a read-only tool that retrieves web page content for context.
4
+ */
5
+ export const urlReaderTool = {
6
+ name: 'read_url',
7
+ description: `Fetch and extract readable content from a web URL. Use this when a user shares a URL and wants you to read, summarize, or analyze its content. Returns the page title, main text content, and excerpt.
8
+
9
+ IMPORTANT:
10
+ - Only use this for publicly accessible web pages
11
+ - Content is automatically cleaned and truncated for context limits
12
+ - Some sites may block automated access`,
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ url: {
17
+ type: 'string',
18
+ description: 'The full URL to fetch (must start with http:// or https://)'
19
+ }
20
+ },
21
+ required: ['url']
22
+ }
23
+ };
24
+ //# sourceMappingURL=url-reader-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-reader-tool.js","sourceRoot":"","sources":["../src/url-reader-tool.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE;;;;;wCAKyB;IACtC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6DAA6D;aAC3E;SACF;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC;KAClB;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/mcp",
3
- "version": "1.0.76-alpha.0",
3
+ "version": "1.0.76-alpha.2",
4
4
  "description": "MCP tools for Coconut",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -14,8 +14,8 @@
14
14
  "test:ui": "vitest --ui"
15
15
  },
16
16
  "dependencies": {
17
- "@lovelybunch/core": "^1.0.76-alpha.0",
18
- "@lovelybunch/types": "^1.0.76-alpha.0",
17
+ "@lovelybunch/core": "^1.0.76-alpha.2",
18
+ "@lovelybunch/types": "^1.0.76-alpha.2",
19
19
  "hono": "^4.0.0"
20
20
  },
21
21
  "devDependencies": {
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for events tool
3
- */
4
- export {};
5
- //# sourceMappingURL=events-tool.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events-tool.test.d.ts","sourceRoot":"","sources":["../src/events-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Tests for events tool
3
- */
4
- import { describe, it, expect } from 'vitest';
5
- import { eventsTool } from './events-tool.js';
6
- describe('eventsTool', () => {
7
- it('should have correct name', () => {
8
- expect(eventsTool.name).toBe('activity_events');
9
- });
10
- it('should be read-only with only list operation', () => {
11
- const ops = eventsTool.parameters.properties.operation.enum;
12
- expect(ops).toEqual(['list']);
13
- });
14
- it('should have limit and kind parameters', () => {
15
- expect(eventsTool.parameters.properties.limit).toBeDefined();
16
- expect(eventsTool.parameters.properties.limit.type).toBe('number');
17
- expect(eventsTool.parameters.properties.kind).toBeDefined();
18
- expect(eventsTool.parameters.properties.kind.type).toBe('string');
19
- });
20
- it('should require operation', () => {
21
- expect(eventsTool.parameters.required).toContain('operation');
22
- });
23
- });
24
- //# sourceMappingURL=events-tool.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events-tool.test.js","sourceRoot":"","sources":["../src/events-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7D,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for knowledge tool utilities
3
- */
4
- export {};
5
- //# sourceMappingURL=knowledge-tool.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"knowledge-tool.test.d.ts","sourceRoot":"","sources":["../src/knowledge-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,120 +0,0 @@
1
- /**
2
- * Tests for knowledge tool utilities
3
- */
4
- import { describe, it, expect } from 'vitest';
5
- import { createKnowledgeToolCall, normalizeKnowledgeMetadata, buildKnowledgeActionPayload, knowledgeTool, } from './knowledge-tool.js';
6
- describe('createKnowledgeToolCall', () => {
7
- it('should create tool call with operation and args', () => {
8
- const call = createKnowledgeToolCall('list', { query: 'auth' });
9
- expect(call.name).toBe('knowledge_documents');
10
- expect(call.arguments).toEqual({
11
- operation: 'list',
12
- query: 'auth',
13
- });
14
- });
15
- it('should create tool call for get operation', () => {
16
- const call = createKnowledgeToolCall('get', { filename: 'auth.md' });
17
- expect(call.name).toBe('knowledge_documents');
18
- expect(call.arguments).toEqual({
19
- operation: 'get',
20
- filename: 'auth.md',
21
- });
22
- });
23
- it('should merge operation with spread args', () => {
24
- const call = createKnowledgeToolCall('create', {
25
- title: 'Setup Guide',
26
- content: '# Setup',
27
- });
28
- expect(call.arguments.operation).toBe('create');
29
- expect(call.arguments.title).toBe('Setup Guide');
30
- expect(call.arguments.content).toBe('# Setup');
31
- });
32
- });
33
- describe('normalizeKnowledgeMetadata', () => {
34
- it('should return default structure for null/undefined', () => {
35
- const result = normalizeKnowledgeMetadata();
36
- expect(result.type).toBe('knowledge');
37
- expect(result.updated).toBe('');
38
- expect(result.tags).toEqual([]);
39
- expect(result.sources).toEqual([]);
40
- expect(result.related).toEqual([]);
41
- expect(result.audience).toEqual([]);
42
- });
43
- it('should preserve and clone tags', () => {
44
- const input = { tags: ['api', 'auth'], updated: '2024-01-01' };
45
- const result = normalizeKnowledgeMetadata(input);
46
- expect(result.tags).toEqual(['api', 'auth']);
47
- expect(result.tags).not.toBe(input.tags); // cloned, not same reference
48
- });
49
- it('should preserve sources, related, audience', () => {
50
- const result = normalizeKnowledgeMetadata({
51
- sources: ['https://example.com'],
52
- related: ['other-doc.md'],
53
- audience: ['engineers'],
54
- });
55
- expect(result.sources).toEqual(['https://example.com']);
56
- expect(result.related).toEqual(['other-doc.md']);
57
- expect(result.audience).toEqual(['engineers']);
58
- });
59
- it('should spread additional metadata fields', () => {
60
- const result = normalizeKnowledgeMetadata({
61
- category: 'guides',
62
- status: 'active',
63
- });
64
- expect(result.category).toBe('guides');
65
- expect(result.status).toBe('active');
66
- });
67
- });
68
- describe('buildKnowledgeActionPayload', () => {
69
- it('should normalize metadata when present', () => {
70
- const payload = buildKnowledgeActionPayload({
71
- action: 'create',
72
- title: 'Test Doc',
73
- content: '# Content',
74
- metadata: { tags: ['test'] },
75
- });
76
- expect(payload.action).toBe('create');
77
- expect(payload.title).toBe('Test Doc');
78
- expect(payload.content).toBe('# Content');
79
- expect(payload.metadata?.tags).toEqual(['test']);
80
- expect(payload.metadata?.type).toBe('knowledge');
81
- });
82
- it('should pass through without metadata', () => {
83
- const payload = buildKnowledgeActionPayload({
84
- action: 'update',
85
- title: 'Doc',
86
- content: 'body',
87
- });
88
- expect(payload.metadata).toBeUndefined();
89
- expect(payload.action).toBe('update');
90
- });
91
- it('should preserve all input fields', () => {
92
- const payload = buildKnowledgeActionPayload({
93
- action: 'create',
94
- title: 'T',
95
- content: 'C',
96
- filename: 'custom.md',
97
- summary: 'Summary',
98
- source: 'import',
99
- });
100
- expect(payload.filename).toBe('custom.md');
101
- expect(payload.summary).toBe('Summary');
102
- expect(payload.source).toBe('import');
103
- });
104
- });
105
- describe('knowledgeTool', () => {
106
- it('should have correct name and structure', () => {
107
- expect(knowledgeTool.name).toBe('knowledge_documents');
108
- expect(knowledgeTool.parameters.type).toBe('object');
109
- expect(knowledgeTool.parameters.required).toContain('operation');
110
- });
111
- it('should include list, get, create, update, preview_update operations', () => {
112
- const ops = knowledgeTool.parameters.properties.operation.enum;
113
- expect(ops).toContain('list');
114
- expect(ops).toContain('get');
115
- expect(ops).toContain('create');
116
- expect(ops).toContain('update');
117
- expect(ops).toContain('preview_update');
118
- });
119
- });
120
- //# sourceMappingURL=knowledge-tool.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"knowledge-tool.test.js","sourceRoot":"","sources":["../src/knowledge-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,C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ACrD,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for proposals tool utilities
3
- */
4
- export {};
5
- //# sourceMappingURL=proposals-tool.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposals-tool.test.d.ts","sourceRoot":"","sources":["../src/proposals-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,91 +0,0 @@
1
- /**
2
- * Tests for proposals tool utilities
3
- */
4
- import { describe, it, expect } from 'vitest';
5
- import { validateProposalData, createToolCall, listProposalsTool, proposalsTool, proposalsReadOnlyTool, proposalsFullTool, } from './proposals-tool.js';
6
- describe('validateProposalData', () => {
7
- it('should extract intent and content', () => {
8
- const result = validateProposalData({
9
- intent: 'Add dark mode',
10
- content: 'Implement dark mode toggle',
11
- });
12
- expect(result.intent).toBe('Add dark mode');
13
- expect(result.content).toBe('Implement dark mode toggle');
14
- });
15
- it('should extract all supported fields', () => {
16
- const result = validateProposalData({
17
- intent: 'Test',
18
- content: 'Body',
19
- author: 'engineer',
20
- planSteps: ['step1'],
21
- status: 'draft',
22
- metadata: { foo: 'bar' },
23
- });
24
- expect(result.intent).toBe('Test');
25
- expect(result.content).toBe('Body');
26
- expect(result.author).toBe('engineer');
27
- expect(result.planSteps).toEqual(['step1']);
28
- expect(result.status).toBe('draft');
29
- expect(result.metadata).toEqual({ foo: 'bar' });
30
- });
31
- it('should return empty object for empty input', () => {
32
- const result = validateProposalData({});
33
- expect(result).toEqual({});
34
- });
35
- it('should ignore unknown fields', () => {
36
- const result = validateProposalData({
37
- intent: 'Test',
38
- unknownField: 'ignored',
39
- });
40
- expect(result.intent).toBe('Test');
41
- expect(result.unknownField).toBeUndefined();
42
- });
43
- });
44
- describe('createToolCall', () => {
45
- it('should create tool call with operation and args', () => {
46
- const call = createToolCall('list', { filters: { status: 'draft' } });
47
- expect(call.name).toBe('change_proposals');
48
- expect(call.arguments).toEqual({
49
- operation: 'list',
50
- filters: { status: 'draft' },
51
- });
52
- });
53
- it('should create tool call for get operation', () => {
54
- const call = createToolCall('get', { id: 'cp-123' });
55
- expect(call.name).toBe('change_proposals');
56
- expect(call.arguments).toEqual({
57
- operation: 'get',
58
- id: 'cp-123',
59
- });
60
- });
61
- it('should merge operation with spread args', () => {
62
- const call = createToolCall('create', { proposal: { intent: 'Test' } });
63
- expect(call.arguments.operation).toBe('create');
64
- expect(call.arguments.proposal).toEqual({ intent: 'Test' });
65
- });
66
- });
67
- describe('proposals tools', () => {
68
- it('should have listProposalsTool with correct structure', () => {
69
- expect(listProposalsTool.name).toBe('list_proposals');
70
- expect(listProposalsTool.parameters.type).toBe('object');
71
- expect(listProposalsTool.parameters.properties.filters).toBeDefined();
72
- });
73
- it('should have proposalsTool with list, get, create, update, delete operations', () => {
74
- expect(proposalsTool.name).toBe('change_proposals');
75
- const ops = proposalsTool.parameters.properties.operation.enum;
76
- expect(ops).toContain('list');
77
- expect(ops).toContain('get');
78
- expect(ops).toContain('create');
79
- expect(ops).toContain('update');
80
- expect(ops).toContain('delete');
81
- });
82
- it('should have proposalsReadOnlyTool with only list and get', () => {
83
- const ops = proposalsReadOnlyTool.parameters.properties.operation.enum;
84
- expect(ops).toEqual(['list', 'get']);
85
- });
86
- it('should have proposalsFullTool with create and updates', () => {
87
- expect(proposalsFullTool.parameters.properties.proposal).toBeDefined();
88
- expect(proposalsFullTool.parameters.properties.updates).toBeDefined();
89
- });
90
- });
91
- //# sourceMappingURL=proposals-tool.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposals-tool.test.js","sourceRoot":"","sources":["../src/proposals-tool.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,MAAM,GAAG,oBAAoB,CAAC;YAClC,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,4BAA4B;SACtC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,MAAM,GAAG,oBAAoB,CAAC;YAClC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,MAAM;YACf,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,CAAC,OAAO,CAAC;YACpB,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,EA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