@lovelybunch/mcp 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/proposals-tool.d.ts +18 -0
- package/dist/proposals-tool.js +216 -0
- package/package.json +21 -0
- package/src/index.ts +2 -0
- package/src/proposals-tool.ts +225 -0
- package/tsconfig.json +18 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { proposalsTool, listProposalsTool, validateProposalData, createToolCall } from './proposals-tool.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChangeProposal } from '@lovelybunch/types';
|
|
2
|
+
export interface MCPTool {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: 'object';
|
|
7
|
+
properties: Record<string, any>;
|
|
8
|
+
required?: string[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface MCPToolCall {
|
|
12
|
+
name: string;
|
|
13
|
+
arguments: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare const listProposalsTool: MCPTool;
|
|
16
|
+
export declare const proposalsTool: MCPTool;
|
|
17
|
+
export declare function validateProposalData(data: any): Partial<ChangeProposal>;
|
|
18
|
+
export declare function createToolCall(operation: string, args: any): MCPToolCall;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export const listProposalsTool = {
|
|
2
|
+
name: "list_proposals",
|
|
3
|
+
description: "List all change proposals with metadata only (title, ID, status, priority, tags)",
|
|
4
|
+
parameters: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
filters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
description: "Optional filters for the proposal list",
|
|
10
|
+
properties: {
|
|
11
|
+
status: {
|
|
12
|
+
type: "string",
|
|
13
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
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
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const proposalsTool = {
|
|
36
|
+
name: "change_proposals",
|
|
37
|
+
description: "Manage change proposals - create, read, update, delete proposals",
|
|
38
|
+
parameters: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
operation: {
|
|
42
|
+
type: "string",
|
|
43
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
44
|
+
description: "The operation to perform on proposals"
|
|
45
|
+
},
|
|
46
|
+
id: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Proposal ID (required for get, update, delete operations)"
|
|
49
|
+
},
|
|
50
|
+
filters: {
|
|
51
|
+
type: "object",
|
|
52
|
+
description: "Filters for list operation",
|
|
53
|
+
properties: {
|
|
54
|
+
status: {
|
|
55
|
+
type: "string",
|
|
56
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
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 for proposal content"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
proposal: {
|
|
80
|
+
type: "object",
|
|
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", "ai"] }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
planSteps: {
|
|
103
|
+
type: "array",
|
|
104
|
+
items: { type: "string" },
|
|
105
|
+
description: "Implementation plan steps"
|
|
106
|
+
},
|
|
107
|
+
evidence: {
|
|
108
|
+
type: "array",
|
|
109
|
+
items: { type: "string" },
|
|
110
|
+
description: "Supporting evidence"
|
|
111
|
+
},
|
|
112
|
+
policies: {
|
|
113
|
+
type: "array",
|
|
114
|
+
items: { type: "string" },
|
|
115
|
+
description: "Related policies"
|
|
116
|
+
},
|
|
117
|
+
featureFlags: {
|
|
118
|
+
type: "array",
|
|
119
|
+
items: { type: "string" },
|
|
120
|
+
description: "Feature flags needed"
|
|
121
|
+
},
|
|
122
|
+
experiments: {
|
|
123
|
+
type: "array",
|
|
124
|
+
items: { type: "string" },
|
|
125
|
+
description: "A/B tests or experiments"
|
|
126
|
+
},
|
|
127
|
+
telemetryContracts: {
|
|
128
|
+
type: "array",
|
|
129
|
+
items: { type: "string" },
|
|
130
|
+
description: "Telemetry contracts"
|
|
131
|
+
},
|
|
132
|
+
releasePlan: {
|
|
133
|
+
type: "object",
|
|
134
|
+
description: "Release strategy",
|
|
135
|
+
properties: {
|
|
136
|
+
strategy: {
|
|
137
|
+
type: "string",
|
|
138
|
+
enum: ["immediate", "gradual", "canary", "feature-flag"]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
status: {
|
|
143
|
+
type: "string",
|
|
144
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
145
|
+
description: "Current status of the proposal"
|
|
146
|
+
},
|
|
147
|
+
metadata: {
|
|
148
|
+
type: "object",
|
|
149
|
+
description: "Additional metadata",
|
|
150
|
+
properties: {
|
|
151
|
+
tags: {
|
|
152
|
+
type: "array",
|
|
153
|
+
items: { type: "string" },
|
|
154
|
+
description: "Tags for categorization"
|
|
155
|
+
},
|
|
156
|
+
priority: {
|
|
157
|
+
type: "string",
|
|
158
|
+
enum: ["low", "medium", "high", "critical"],
|
|
159
|
+
description: "Priority level"
|
|
160
|
+
},
|
|
161
|
+
reviewers: {
|
|
162
|
+
type: "array",
|
|
163
|
+
items: { type: "string" },
|
|
164
|
+
description: "List of reviewers"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
productSpecRef: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: "Reference to related product specification"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
required: ["operation"]
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
export function validateProposalData(data) {
|
|
179
|
+
const proposal = {};
|
|
180
|
+
if (data.intent)
|
|
181
|
+
proposal.intent = data.intent;
|
|
182
|
+
if (data.content)
|
|
183
|
+
proposal.content = data.content;
|
|
184
|
+
if (data.author)
|
|
185
|
+
proposal.author = data.author;
|
|
186
|
+
if (data.planSteps)
|
|
187
|
+
proposal.planSteps = data.planSteps;
|
|
188
|
+
if (data.evidence)
|
|
189
|
+
proposal.evidence = data.evidence;
|
|
190
|
+
if (data.policies)
|
|
191
|
+
proposal.policies = data.policies;
|
|
192
|
+
if (data.featureFlags)
|
|
193
|
+
proposal.featureFlags = data.featureFlags;
|
|
194
|
+
if (data.experiments)
|
|
195
|
+
proposal.experiments = data.experiments;
|
|
196
|
+
if (data.telemetryContracts)
|
|
197
|
+
proposal.telemetryContracts = data.telemetryContracts;
|
|
198
|
+
if (data.releasePlan)
|
|
199
|
+
proposal.releasePlan = data.releasePlan;
|
|
200
|
+
if (data.status)
|
|
201
|
+
proposal.status = data.status;
|
|
202
|
+
if (data.metadata)
|
|
203
|
+
proposal.metadata = data.metadata;
|
|
204
|
+
if (data.productSpecRef)
|
|
205
|
+
proposal.productSpecRef = data.productSpecRef;
|
|
206
|
+
return proposal;
|
|
207
|
+
}
|
|
208
|
+
export function createToolCall(operation, args) {
|
|
209
|
+
return {
|
|
210
|
+
name: "change_proposals",
|
|
211
|
+
arguments: {
|
|
212
|
+
operation,
|
|
213
|
+
...args
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lovelybunch/mcp",
|
|
3
|
+
"version": "1.0.40",
|
|
4
|
+
"description": "MCP tools for Coconut",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@lovelybunch/types": "1.0.40",
|
|
13
|
+
"hono": "^4.0.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^5.0.0"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { ChangeProposal } from '@lovelybunch/types'
|
|
2
|
+
|
|
3
|
+
export interface MCPTool {
|
|
4
|
+
name: string
|
|
5
|
+
description: string
|
|
6
|
+
parameters: {
|
|
7
|
+
type: 'object'
|
|
8
|
+
properties: Record<string, any>
|
|
9
|
+
required?: string[]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MCPToolCall {
|
|
14
|
+
name: string
|
|
15
|
+
arguments: Record<string, any>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const listProposalsTool: MCPTool = {
|
|
19
|
+
name: "list_proposals",
|
|
20
|
+
description: "List all change proposals with metadata only (title, ID, status, priority, tags)",
|
|
21
|
+
parameters: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
filters: {
|
|
25
|
+
type: "object",
|
|
26
|
+
description: "Optional filters for the proposal list",
|
|
27
|
+
properties: {
|
|
28
|
+
status: {
|
|
29
|
+
type: "string",
|
|
30
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
31
|
+
description: "Filter by proposal status"
|
|
32
|
+
},
|
|
33
|
+
priority: {
|
|
34
|
+
type: "string",
|
|
35
|
+
enum: ["low", "medium", "high", "critical"],
|
|
36
|
+
description: "Filter by priority level"
|
|
37
|
+
},
|
|
38
|
+
tags: {
|
|
39
|
+
type: "array",
|
|
40
|
+
items: { type: "string" },
|
|
41
|
+
description: "Filter by tags"
|
|
42
|
+
},
|
|
43
|
+
search: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Search query for proposal content"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const proposalsTool: MCPTool = {
|
|
54
|
+
name: "change_proposals",
|
|
55
|
+
description: "Manage change proposals - create, read, update, delete proposals",
|
|
56
|
+
parameters: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
operation: {
|
|
60
|
+
type: "string",
|
|
61
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
62
|
+
description: "The operation to perform on proposals"
|
|
63
|
+
},
|
|
64
|
+
id: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Proposal ID (required for get, update, delete operations)"
|
|
67
|
+
},
|
|
68
|
+
filters: {
|
|
69
|
+
type: "object",
|
|
70
|
+
description: "Filters for list operation",
|
|
71
|
+
properties: {
|
|
72
|
+
status: {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
75
|
+
description: "Filter by proposal status"
|
|
76
|
+
},
|
|
77
|
+
author: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Filter by author name or email"
|
|
80
|
+
},
|
|
81
|
+
priority: {
|
|
82
|
+
type: "string",
|
|
83
|
+
enum: ["low", "medium", "high", "critical"],
|
|
84
|
+
description: "Filter by priority level"
|
|
85
|
+
},
|
|
86
|
+
tags: {
|
|
87
|
+
type: "array",
|
|
88
|
+
items: { type: "string" },
|
|
89
|
+
description: "Filter by tags"
|
|
90
|
+
},
|
|
91
|
+
search: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Search query for proposal content"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
proposal: {
|
|
98
|
+
type: "object",
|
|
99
|
+
description: "Proposal data for create/update operations",
|
|
100
|
+
properties: {
|
|
101
|
+
intent: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "Brief description of what the proposal aims to achieve"
|
|
104
|
+
},
|
|
105
|
+
content: {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "Detailed content of the proposal"
|
|
108
|
+
},
|
|
109
|
+
author: {
|
|
110
|
+
type: "object",
|
|
111
|
+
description: "Author information",
|
|
112
|
+
properties: {
|
|
113
|
+
id: { type: "string" },
|
|
114
|
+
name: { type: "string" },
|
|
115
|
+
email: { type: "string" },
|
|
116
|
+
role: { type: "string" },
|
|
117
|
+
type: { type: "string", enum: ["human", "ai"] }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
planSteps: {
|
|
121
|
+
type: "array",
|
|
122
|
+
items: { type: "string" },
|
|
123
|
+
description: "Implementation plan steps"
|
|
124
|
+
},
|
|
125
|
+
evidence: {
|
|
126
|
+
type: "array",
|
|
127
|
+
items: { type: "string" },
|
|
128
|
+
description: "Supporting evidence"
|
|
129
|
+
},
|
|
130
|
+
policies: {
|
|
131
|
+
type: "array",
|
|
132
|
+
items: { type: "string" },
|
|
133
|
+
description: "Related policies"
|
|
134
|
+
},
|
|
135
|
+
featureFlags: {
|
|
136
|
+
type: "array",
|
|
137
|
+
items: { type: "string" },
|
|
138
|
+
description: "Feature flags needed"
|
|
139
|
+
},
|
|
140
|
+
experiments: {
|
|
141
|
+
type: "array",
|
|
142
|
+
items: { type: "string" },
|
|
143
|
+
description: "A/B tests or experiments"
|
|
144
|
+
},
|
|
145
|
+
telemetryContracts: {
|
|
146
|
+
type: "array",
|
|
147
|
+
items: { type: "string" },
|
|
148
|
+
description: "Telemetry contracts"
|
|
149
|
+
},
|
|
150
|
+
releasePlan: {
|
|
151
|
+
type: "object",
|
|
152
|
+
description: "Release strategy",
|
|
153
|
+
properties: {
|
|
154
|
+
strategy: {
|
|
155
|
+
type: "string",
|
|
156
|
+
enum: ["immediate", "gradual", "canary", "feature-flag"]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
status: {
|
|
161
|
+
type: "string",
|
|
162
|
+
enum: ["draft", "review", "approved", "rejected", "implemented"],
|
|
163
|
+
description: "Current status of the proposal"
|
|
164
|
+
},
|
|
165
|
+
metadata: {
|
|
166
|
+
type: "object",
|
|
167
|
+
description: "Additional metadata",
|
|
168
|
+
properties: {
|
|
169
|
+
tags: {
|
|
170
|
+
type: "array",
|
|
171
|
+
items: { type: "string" },
|
|
172
|
+
description: "Tags for categorization"
|
|
173
|
+
},
|
|
174
|
+
priority: {
|
|
175
|
+
type: "string",
|
|
176
|
+
enum: ["low", "medium", "high", "critical"],
|
|
177
|
+
description: "Priority level"
|
|
178
|
+
},
|
|
179
|
+
reviewers: {
|
|
180
|
+
type: "array",
|
|
181
|
+
items: { type: "string" },
|
|
182
|
+
description: "List of reviewers"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
productSpecRef: {
|
|
187
|
+
type: "string",
|
|
188
|
+
description: "Reference to related product specification"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
required: ["operation"]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function validateProposalData(data: any): Partial<ChangeProposal> {
|
|
198
|
+
const proposal: Partial<ChangeProposal> = {}
|
|
199
|
+
|
|
200
|
+
if (data.intent) proposal.intent = data.intent
|
|
201
|
+
if (data.content) proposal.content = data.content
|
|
202
|
+
if (data.author) proposal.author = data.author
|
|
203
|
+
if (data.planSteps) proposal.planSteps = data.planSteps
|
|
204
|
+
if (data.evidence) proposal.evidence = data.evidence
|
|
205
|
+
if (data.policies) proposal.policies = data.policies
|
|
206
|
+
if (data.featureFlags) proposal.featureFlags = data.featureFlags
|
|
207
|
+
if (data.experiments) proposal.experiments = data.experiments
|
|
208
|
+
if (data.telemetryContracts) proposal.telemetryContracts = data.telemetryContracts
|
|
209
|
+
if (data.releasePlan) proposal.releasePlan = data.releasePlan
|
|
210
|
+
if (data.status) proposal.status = data.status
|
|
211
|
+
if (data.metadata) proposal.metadata = data.metadata
|
|
212
|
+
if (data.productSpecRef) proposal.productSpecRef = data.productSpecRef
|
|
213
|
+
|
|
214
|
+
return proposal
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function createToolCall(operation: string, args: any): MCPToolCall {
|
|
218
|
+
return {
|
|
219
|
+
name: "change_proposals",
|
|
220
|
+
arguments: {
|
|
221
|
+
operation,
|
|
222
|
+
...args
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"outDir": "./dist",
|
|
14
|
+
"rootDir": "./src"
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"]
|
|
18
|
+
}
|