@qikdev/mcp 6.7.1 ā 6.7.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.
- package/build/src/tools/campaign.d.ts.map +1 -1
- package/build/src/tools/campaign.js +9 -76
- package/build/src/tools/campaign.js.map +1 -1
- package/build/src/tools/checkin.d.ts.map +1 -1
- package/build/src/tools/checkin.js +6 -34
- package/build/src/tools/checkin.js.map +1 -1
- package/build/src/tools/create.js +82 -154
- package/build/src/tools/create.js.map +1 -1
- package/build/src/tools/filters.d.ts.map +1 -1
- package/build/src/tools/filters.js +5 -29
- package/build/src/tools/filters.js.map +1 -1
- package/build/src/tools/glossary.d.ts.map +1 -1
- package/build/src/tools/glossary.js +7 -161
- package/build/src/tools/glossary.js.map +1 -1
- package/build/src/tools/list.js +2 -53
- package/build/src/tools/list.js.map +1 -1
- package/build/src/tools/profile.d.ts.map +1 -1
- package/build/src/tools/profile.js +2 -41
- package/build/src/tools/profile.js.map +1 -1
- package/build/src/tools/relationships.d.ts.map +1 -1
- package/build/src/tools/relationships.js +3 -61
- package/build/src/tools/relationships.js.map +1 -1
- package/build/src/tools/reporting.d.ts.map +1 -1
- package/build/src/tools/reporting.js +10 -63
- package/build/src/tools/reporting.js.map +1 -1
- package/build/src/tools/sms.d.ts.map +1 -1
- package/build/src/tools/sms.js +4 -35
- package/build/src/tools/sms.js.map +1 -1
- package/build/src/tools/update.js +35 -60
- package/build/src/tools/update.js.map +1 -1
- package/build/src/tools/user.js +1 -1
- package/build/src/tools/user.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaign.d.ts","sourceRoot":"","sources":["../../../src/tools/campaign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI1D,eAAO,MAAM,yBAAyB,EAAE,IAmBvC,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,IAoBtC,CAAC;A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K,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA6CzJ;AAGD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAyDhL"}
|
|
@@ -117,43 +117,10 @@ export async function handleGetCampaignRecipients(args) {
|
|
|
117
117
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
118
118
|
}
|
|
119
119
|
const data = await response.json();
|
|
120
|
-
const { recipients } = data;
|
|
121
|
-
let resultText = `# Campaign Recipients Preview\n\n`;
|
|
122
|
-
resultText += `## Summary\n`;
|
|
123
|
-
resultText += `- **Valid recipients**: ${recipients.valid.total}\n`;
|
|
124
|
-
resultText += `- **Invalid recipients**: ${recipients.invalid.total}\n\n`;
|
|
125
|
-
if (recipients.valid.total > 0) {
|
|
126
|
-
resultText += `## Valid Recipients (first 10)\n\n`;
|
|
127
|
-
const validSample = recipients.valid.profiles.slice(0, 10);
|
|
128
|
-
for (const profile of validSample) {
|
|
129
|
-
const name = [profile.firstName, profile.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
130
|
-
const email = profile.emails?.[0] || 'No email';
|
|
131
|
-
resultText += `- ${name} (${email})\n`;
|
|
132
|
-
}
|
|
133
|
-
if (recipients.valid.total > 10) {
|
|
134
|
-
resultText += `- ... and ${recipients.valid.total - 10} more\n`;
|
|
135
|
-
}
|
|
136
|
-
resultText += '\n';
|
|
137
|
-
}
|
|
138
|
-
if (recipients.invalid.total > 0) {
|
|
139
|
-
resultText += `## Invalid Recipients (first 10)\n\n`;
|
|
140
|
-
const invalidSample = recipients.invalid.profiles.slice(0, 10);
|
|
141
|
-
for (const item of invalidSample) {
|
|
142
|
-
const profile = item.profile;
|
|
143
|
-
const name = [profile.firstName, profile.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
144
|
-
resultText += `- ${name}: ${item.message}\n`;
|
|
145
|
-
}
|
|
146
|
-
if (recipients.invalid.total > 10) {
|
|
147
|
-
resultText += `- ... and ${recipients.invalid.total - 10} more\n`;
|
|
148
|
-
}
|
|
149
|
-
resultText += '\n';
|
|
150
|
-
}
|
|
151
|
-
resultText += `---\n`;
|
|
152
|
-
resultText += `š” Use \`send_campaign\` to publish, or \`send_test_campaign\` to preview first.`;
|
|
153
120
|
return {
|
|
154
121
|
content: [{
|
|
155
122
|
type: "text",
|
|
156
|
-
text:
|
|
123
|
+
text: JSON.stringify(data, null, 2)
|
|
157
124
|
}]
|
|
158
125
|
};
|
|
159
126
|
}
|
|
@@ -161,7 +128,7 @@ export async function handleGetCampaignRecipients(args) {
|
|
|
161
128
|
return {
|
|
162
129
|
content: [{
|
|
163
130
|
type: "text",
|
|
164
|
-
text:
|
|
131
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
165
132
|
}]
|
|
166
133
|
};
|
|
167
134
|
}
|
|
@@ -185,21 +152,10 @@ export async function handleGetCampaignAnalytics(args) {
|
|
|
185
152
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
186
153
|
}
|
|
187
154
|
const data = await response.json();
|
|
188
|
-
const { total, opened, clicked } = data;
|
|
189
|
-
const openRate = total > 0 ? ((opened / total) * 100).toFixed(1) : '0';
|
|
190
|
-
const clickRate = total > 0 ? ((clicked / total) * 100).toFixed(1) : '0';
|
|
191
|
-
let resultText = `# Campaign Analytics\n\n`;
|
|
192
|
-
resultText += `## Metrics\n`;
|
|
193
|
-
resultText += `- **Total sent**: ${total}\n`;
|
|
194
|
-
resultText += `- **Opened**: ${opened} (${openRate}%)\n`;
|
|
195
|
-
resultText += `- **Clicked**: ${clicked} (${clickRate}%)\n\n`;
|
|
196
|
-
if (total === 0) {
|
|
197
|
-
resultText += `ā ļø No emails have been sent yet. Campaign may still be in draft state.`;
|
|
198
|
-
}
|
|
199
155
|
return {
|
|
200
156
|
content: [{
|
|
201
157
|
type: "text",
|
|
202
|
-
text:
|
|
158
|
+
text: JSON.stringify(data, null, 2)
|
|
203
159
|
}]
|
|
204
160
|
};
|
|
205
161
|
}
|
|
@@ -207,7 +163,7 @@ export async function handleGetCampaignAnalytics(args) {
|
|
|
207
163
|
return {
|
|
208
164
|
content: [{
|
|
209
165
|
type: "text",
|
|
210
|
-
text:
|
|
166
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
211
167
|
}]
|
|
212
168
|
};
|
|
213
169
|
}
|
|
@@ -237,18 +193,10 @@ export async function handleSendCampaign(args) {
|
|
|
237
193
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
238
194
|
}
|
|
239
195
|
const campaign = await response.json();
|
|
240
|
-
let resultText = `# Campaign Published\n\n`;
|
|
241
|
-
resultText += `ā
Campaign "${campaign.title}" has been ${args.scheduleDate ? 'scheduled' : 'published'}.\n\n`;
|
|
242
|
-
resultText += `- **ID**: ${campaign._id}\n`;
|
|
243
|
-
resultText += `- **Status**: ${campaign.state || 'processing'}\n`;
|
|
244
|
-
if (args.scheduleDate) {
|
|
245
|
-
resultText += `- **Scheduled for**: ${args.scheduleDate}\n`;
|
|
246
|
-
}
|
|
247
|
-
resultText += `\nš” Use \`get_campaign_analytics\` to track performance.`;
|
|
248
196
|
return {
|
|
249
197
|
content: [{
|
|
250
198
|
type: "text",
|
|
251
|
-
text:
|
|
199
|
+
text: JSON.stringify(campaign, null, 2)
|
|
252
200
|
}]
|
|
253
201
|
};
|
|
254
202
|
}
|
|
@@ -256,7 +204,7 @@ export async function handleSendCampaign(args) {
|
|
|
256
204
|
return {
|
|
257
205
|
content: [{
|
|
258
206
|
type: "text",
|
|
259
|
-
text:
|
|
207
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
260
208
|
}]
|
|
261
209
|
};
|
|
262
210
|
}
|
|
@@ -273,7 +221,7 @@ export async function handleSendTestCampaign(args) {
|
|
|
273
221
|
return {
|
|
274
222
|
content: [{
|
|
275
223
|
type: "text",
|
|
276
|
-
text:
|
|
224
|
+
text: JSON.stringify({ error: 'Please provide either profileIds or emails to send test to' }, null, 2)
|
|
277
225
|
}]
|
|
278
226
|
};
|
|
279
227
|
}
|
|
@@ -297,25 +245,10 @@ export async function handleSendTestCampaign(args) {
|
|
|
297
245
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
298
246
|
}
|
|
299
247
|
const result = await response.json();
|
|
300
|
-
let resultText = `# Test Email Sent\n\n`;
|
|
301
|
-
resultText += `ā
Test email(s) sent successfully.\n\n`;
|
|
302
|
-
if (args.emails?.length) {
|
|
303
|
-
resultText += `**Sent to emails:**\n`;
|
|
304
|
-
for (const email of args.emails) {
|
|
305
|
-
resultText += `- ${email}\n`;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
if (args.profileIds?.length) {
|
|
309
|
-
resultText += `**Sent to profile IDs:**\n`;
|
|
310
|
-
for (const id of args.profileIds) {
|
|
311
|
-
resultText += `- ${id}\n`;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
resultText += `\nš” Check your inbox. Test emails have [TEST] prefix in subject.`;
|
|
315
248
|
return {
|
|
316
249
|
content: [{
|
|
317
250
|
type: "text",
|
|
318
|
-
text:
|
|
251
|
+
text: JSON.stringify(result, null, 2)
|
|
319
252
|
}]
|
|
320
253
|
};
|
|
321
254
|
}
|
|
@@ -323,7 +256,7 @@ export async function handleSendTestCampaign(args) {
|
|
|
323
256
|
return {
|
|
324
257
|
content: [{
|
|
325
258
|
type: "text",
|
|
326
|
-
text:
|
|
259
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
327
260
|
}]
|
|
328
261
|
};
|
|
329
262
|
}
|
|
@@ -1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,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../../src/tools/checkin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,iBAAiB,EAAE,IAiC/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IA4B1B,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../../src/tools/checkin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,iBAAiB,EAAE,IAiC/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IA4B1B,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA6D9D;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA6D9D"}
|
|
@@ -73,7 +73,7 @@ export async function handleCreateCheckin(args) {
|
|
|
73
73
|
return {
|
|
74
74
|
content: [{
|
|
75
75
|
type: "text",
|
|
76
|
-
text:
|
|
76
|
+
text: JSON.stringify({ error: 'No profile IDs provided. Please provide an array of profile IDs to check in.' }, null, 2)
|
|
77
77
|
}]
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -99,25 +99,10 @@ export async function handleCreateCheckin(args) {
|
|
|
99
99
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
100
100
|
}
|
|
101
101
|
const result = await response.json();
|
|
102
|
-
const checkins = Array.isArray(result) ? result : [result];
|
|
103
|
-
let resultText = `# Checkin Result\n\n`;
|
|
104
|
-
resultText += `ā
Checked in ${checkins.length} profile(s) to event.\n\n`;
|
|
105
|
-
if (checkins.length > 0) {
|
|
106
|
-
resultText += `## Checkins Created\n`;
|
|
107
|
-
for (const checkin of checkins.slice(0, 10)) {
|
|
108
|
-
const name = [checkin.firstName, checkin.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
109
|
-
const status = args.absent ? 'ā Marked absent' : 'ā
Checked in';
|
|
110
|
-
resultText += `- ${name} (ID: ${checkin._id}) ${status}\n`;
|
|
111
|
-
}
|
|
112
|
-
if (checkins.length > 10) {
|
|
113
|
-
resultText += `- ... and ${checkins.length - 10} more\n`;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
resultText += `\nš” Use \`get_event_attendance\` to see full attendance stats.`;
|
|
117
102
|
return {
|
|
118
103
|
content: [{
|
|
119
104
|
type: "text",
|
|
120
|
-
text:
|
|
105
|
+
text: JSON.stringify(result, null, 2)
|
|
121
106
|
}]
|
|
122
107
|
};
|
|
123
108
|
}
|
|
@@ -125,7 +110,7 @@ export async function handleCreateCheckin(args) {
|
|
|
125
110
|
return {
|
|
126
111
|
content: [{
|
|
127
112
|
type: "text",
|
|
128
|
-
text:
|
|
113
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
129
114
|
}]
|
|
130
115
|
};
|
|
131
116
|
}
|
|
@@ -141,7 +126,7 @@ export async function handleCheckout(args) {
|
|
|
141
126
|
return {
|
|
142
127
|
content: [{
|
|
143
128
|
type: "text",
|
|
144
|
-
text:
|
|
129
|
+
text: JSON.stringify({ error: 'No checkin IDs provided. Please provide an array of checkin record IDs to check out.' }, null, 2)
|
|
145
130
|
}]
|
|
146
131
|
};
|
|
147
132
|
}
|
|
@@ -167,23 +152,10 @@ export async function handleCheckout(args) {
|
|
|
167
152
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
168
153
|
}
|
|
169
154
|
const result = await response.json();
|
|
170
|
-
const checkedOut = Array.isArray(result) ? result : [result];
|
|
171
|
-
let resultText = `# Checkout Result\n\n`;
|
|
172
|
-
resultText += `ā
Checked out ${checkedOut.length} record(s).\n\n`;
|
|
173
|
-
if (checkedOut.length > 0) {
|
|
174
|
-
resultText += `## Checked Out\n`;
|
|
175
|
-
for (const checkin of checkedOut.slice(0, 10)) {
|
|
176
|
-
const name = [checkin.firstName, checkin.lastName].filter(Boolean).join(' ') || 'Unknown';
|
|
177
|
-
resultText += `- ${name} ā©ļø Checked out\n`;
|
|
178
|
-
}
|
|
179
|
-
if (checkedOut.length > 10) {
|
|
180
|
-
resultText += `- ... and ${checkedOut.length - 10} more\n`;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
155
|
return {
|
|
184
156
|
content: [{
|
|
185
157
|
type: "text",
|
|
186
|
-
text:
|
|
158
|
+
text: JSON.stringify(result, null, 2)
|
|
187
159
|
}]
|
|
188
160
|
};
|
|
189
161
|
}
|
|
@@ -191,7 +163,7 @@ export async function handleCheckout(args) {
|
|
|
191
163
|
return {
|
|
192
164
|
content: [{
|
|
193
165
|
type: "text",
|
|
194
|
-
text:
|
|
166
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
195
167
|
}]
|
|
196
168
|
};
|
|
197
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../../src/tools/checkin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;wFAOyE;IACtF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;aAC1C;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,yBAAyB;aACvC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,gEAAgE;aAC9E;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;KACpC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE;;;;;;wDAMyC;IACtD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WA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AQ,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAErC,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC,CAAC;SACH,CAAC;IAEJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -330,125 +330,74 @@ function createErrorResponse(message) {
|
|
|
330
330
|
return {
|
|
331
331
|
content: [{
|
|
332
332
|
type: "text",
|
|
333
|
-
text:
|
|
333
|
+
text: JSON.stringify({ error: message }, null, 2)
|
|
334
334
|
}]
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
function createScopeSelectionPrompt(contentTitle, availableScopes, userSession, naturalLanguage) {
|
|
338
|
-
const scopeOptions = availableScopes.map(scopeId => {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
})
|
|
338
|
+
const scopeOptions = availableScopes.map(scopeId => ({
|
|
339
|
+
id: scopeId,
|
|
340
|
+
title: getScopeTitle(userSession, scopeId)
|
|
341
|
+
}));
|
|
342
342
|
return {
|
|
343
343
|
content: [{
|
|
344
344
|
type: "text",
|
|
345
|
-
text:
|
|
345
|
+
text: JSON.stringify({
|
|
346
|
+
needsScopeSelection: true,
|
|
347
|
+
contentTitle,
|
|
348
|
+
availableScopes: scopeOptions,
|
|
349
|
+
typeKey: naturalLanguage
|
|
350
|
+
}, null, 2)
|
|
346
351
|
}]
|
|
347
352
|
};
|
|
348
353
|
}
|
|
349
354
|
function createFieldCollectionPrompt(contentTitle, missingFields, examplePayload, scopeId, naturalLanguage) {
|
|
350
|
-
const fieldPrompts = missingFields.map(field => {
|
|
351
|
-
let prompt = `**${field.path}**`;
|
|
352
|
-
if (field.title && field.title !== field.path) {
|
|
353
|
-
prompt += ` (${field.title})`;
|
|
354
|
-
}
|
|
355
|
-
if (field.description) {
|
|
356
|
-
prompt += `: ${field.description}`;
|
|
357
|
-
}
|
|
358
|
-
if (field.type) {
|
|
359
|
-
prompt += ` [${field.type}]`;
|
|
360
|
-
}
|
|
361
|
-
if (field.type === 'reference' && field.referenceType) {
|
|
362
|
-
prompt += ` - References: ${field.referenceType}`;
|
|
363
|
-
}
|
|
364
|
-
if (field.options && Array.isArray(field.options)) {
|
|
365
|
-
const optionsList = field.options.map((opt) => opt.value || opt.title).join(', ');
|
|
366
|
-
prompt += ` - Options: ${optionsList}`;
|
|
367
|
-
}
|
|
368
|
-
return `⢠${prompt}`;
|
|
369
|
-
}).join('\n');
|
|
370
|
-
const exampleFields = {
|
|
371
|
-
typeKey: naturalLanguage || contentTitle.toLowerCase(),
|
|
372
|
-
...getExampleFieldValues(missingFields)
|
|
373
|
-
};
|
|
374
|
-
// Include scope if provided
|
|
375
|
-
if (scopeId) {
|
|
376
|
-
exampleFields.scope = scopeId;
|
|
377
|
-
}
|
|
378
|
-
let exampleJson = '';
|
|
379
|
-
try {
|
|
380
|
-
exampleJson = JSON.stringify(exampleFields, null, 2);
|
|
381
|
-
}
|
|
382
|
-
catch (error) {
|
|
383
|
-
exampleJson = '{\n "typeKey": "' + (naturalLanguage || contentTitle.toLowerCase()) + '",\n "field1": "value1",\n "field2": "value2"\n}';
|
|
384
|
-
}
|
|
385
355
|
return {
|
|
386
356
|
content: [{
|
|
387
357
|
type: "text",
|
|
388
|
-
text:
|
|
358
|
+
text: JSON.stringify({
|
|
359
|
+
needsFields: true,
|
|
360
|
+
contentTitle,
|
|
361
|
+
missingFields: missingFields.map(field => ({
|
|
362
|
+
path: field.path,
|
|
363
|
+
title: field.title,
|
|
364
|
+
type: field.type,
|
|
365
|
+
description: field.description,
|
|
366
|
+
referenceType: field.referenceType,
|
|
367
|
+
options: field.options
|
|
368
|
+
})),
|
|
369
|
+
typeKey: naturalLanguage || contentTitle.toLowerCase(),
|
|
370
|
+
scope: scopeId
|
|
371
|
+
}, null, 2)
|
|
389
372
|
}]
|
|
390
373
|
};
|
|
391
374
|
}
|
|
392
375
|
function createReferenceFieldPrompt(contentTitle, referenceFields, allMissingFields, scopeId, naturalLanguage) {
|
|
393
|
-
const referencePrompts = referenceFields.map(field => {
|
|
394
|
-
let prompt = `**${field.path}**`;
|
|
395
|
-
if (field.title && field.title !== field.path) {
|
|
396
|
-
prompt += ` (${field.title})`;
|
|
397
|
-
}
|
|
398
|
-
if (field.description) {
|
|
399
|
-
prompt += `: ${field.description}`;
|
|
400
|
-
}
|
|
401
|
-
if (field.referenceType) {
|
|
402
|
-
prompt += ` - References: ${field.referenceType}`;
|
|
403
|
-
}
|
|
404
|
-
return `⢠${prompt}`;
|
|
405
|
-
}).join('\n');
|
|
406
376
|
const nonReferenceFields = allMissingFields.filter(field => field.type !== 'reference');
|
|
407
|
-
let otherFieldsText = '';
|
|
408
|
-
if (nonReferenceFields.length > 0) {
|
|
409
|
-
const otherPrompts = nonReferenceFields.map(field => {
|
|
410
|
-
let prompt = `**${field.path}**`;
|
|
411
|
-
if (field.title && field.title !== field.path) {
|
|
412
|
-
prompt += ` (${field.title})`;
|
|
413
|
-
}
|
|
414
|
-
if (field.description) {
|
|
415
|
-
prompt += `: ${field.description}`;
|
|
416
|
-
}
|
|
417
|
-
if (field.type) {
|
|
418
|
-
prompt += ` [${field.type}]`;
|
|
419
|
-
}
|
|
420
|
-
return `⢠${prompt}`;
|
|
421
|
-
}).join('\n');
|
|
422
|
-
otherFieldsText = `\n\n**Other Required Fields:**\n${otherPrompts}`;
|
|
423
|
-
}
|
|
424
377
|
return {
|
|
425
378
|
content: [{
|
|
426
379
|
type: "text",
|
|
427
|
-
text:
|
|
380
|
+
text: JSON.stringify({
|
|
381
|
+
needsReferenceFields: true,
|
|
382
|
+
contentTitle,
|
|
383
|
+
referenceFields: referenceFields.map(field => ({
|
|
384
|
+
path: field.path,
|
|
385
|
+
title: field.title,
|
|
386
|
+
description: field.description,
|
|
387
|
+
referenceType: field.referenceType
|
|
388
|
+
})),
|
|
389
|
+
otherMissingFields: nonReferenceFields.map(field => ({
|
|
390
|
+
path: field.path,
|
|
391
|
+
title: field.title,
|
|
392
|
+
type: field.type,
|
|
393
|
+
description: field.description
|
|
394
|
+
})),
|
|
395
|
+
typeKey: naturalLanguage || contentTitle.toLowerCase(),
|
|
396
|
+
scope: scopeId
|
|
397
|
+
}, null, 2)
|
|
428
398
|
}]
|
|
429
399
|
};
|
|
430
400
|
}
|
|
431
|
-
function getExampleFieldValues(fields) {
|
|
432
|
-
const example = {};
|
|
433
|
-
fields.forEach(field => {
|
|
434
|
-
if (field.type === 'reference') {
|
|
435
|
-
example[field.path] = `search for: ${field.referenceType || 'item'} name or description`;
|
|
436
|
-
}
|
|
437
|
-
else if (field.type === 'string') {
|
|
438
|
-
example[field.path] = `Your ${field.title || field.path} here`;
|
|
439
|
-
}
|
|
440
|
-
else if (field.type === 'number') {
|
|
441
|
-
example[field.path] = 123;
|
|
442
|
-
}
|
|
443
|
-
else if (field.type === 'boolean') {
|
|
444
|
-
example[field.path] = true;
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
example[field.path] = `Your ${field.title || field.path} here`;
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
return example;
|
|
451
|
-
}
|
|
452
401
|
// Handle reference field search and selection
|
|
453
402
|
async function handleReferenceFieldSearch(field, searchTerm, contentTitle, scopeId, naturalLanguage) {
|
|
454
403
|
try {
|
|
@@ -456,7 +405,7 @@ async function handleReferenceFieldSearch(field, searchTerm, contentTitle, scope
|
|
|
456
405
|
return {
|
|
457
406
|
content: [{
|
|
458
407
|
type: "text",
|
|
459
|
-
text:
|
|
408
|
+
text: JSON.stringify({ error: `Cannot search for ${field.path} references - no reference type specified in field definition.` }, null, 2)
|
|
460
409
|
}]
|
|
461
410
|
};
|
|
462
411
|
}
|
|
@@ -467,21 +416,19 @@ async function handleReferenceFieldSearch(field, searchTerm, contentTitle, scope
|
|
|
467
416
|
page: { size: 10, index: 1 }
|
|
468
417
|
};
|
|
469
418
|
const searchResults = await handleListContent(listArgs);
|
|
470
|
-
const resultsText = searchResults.content[0]?.text || '';
|
|
471
|
-
// Check if no results found
|
|
472
|
-
if (resultsText.includes('No ') && resultsText.includes('found matching')) {
|
|
473
|
-
return {
|
|
474
|
-
content: [{
|
|
475
|
-
type: "text",
|
|
476
|
-
text: `š No ${field.referenceType} found matching "${searchTerm}" for field ${field.path}.\n\nPlease try a different search term or provide the exact ID if you know it:\n\n\`\`\`json\n{\n "typeKey": "${naturalLanguage}",\n "${field.path}": "exact_id_here"\n}\n\`\`\`\n\nOr search with different terms:\n\n\`\`\`json\n{\n "typeKey": "${naturalLanguage}",\n "${field.path}": "search for: different search terms"\n}\n\`\`\``
|
|
477
|
-
}]
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
// Return the search results with instructions on how to select
|
|
481
419
|
return {
|
|
482
420
|
content: [{
|
|
483
421
|
type: "text",
|
|
484
|
-
text:
|
|
422
|
+
text: JSON.stringify({
|
|
423
|
+
referenceSearch: true,
|
|
424
|
+
field: field.path,
|
|
425
|
+
fieldTitle: field.title,
|
|
426
|
+
referenceType: field.referenceType,
|
|
427
|
+
searchTerm,
|
|
428
|
+
results: JSON.parse(searchResults.content[0]?.text || '{}'),
|
|
429
|
+
typeKey: naturalLanguage,
|
|
430
|
+
scope: scopeId
|
|
431
|
+
}, null, 2)
|
|
485
432
|
}]
|
|
486
433
|
};
|
|
487
434
|
}
|
|
@@ -489,7 +436,7 @@ async function handleReferenceFieldSearch(field, searchTerm, contentTitle, scope
|
|
|
489
436
|
return {
|
|
490
437
|
content: [{
|
|
491
438
|
type: "text",
|
|
492
|
-
text:
|
|
439
|
+
text: JSON.stringify({ error: `Failed to search for ${field.path} references: ${error.message}` }, null, 2)
|
|
493
440
|
}]
|
|
494
441
|
};
|
|
495
442
|
}
|
|
@@ -527,18 +474,10 @@ async function createUICreationSuggestion(naturalLanguage, userArgs = {}) {
|
|
|
527
474
|
return createErrorResponse('Invalid interface creation state. Please start the process again.');
|
|
528
475
|
}
|
|
529
476
|
function createSuccessResponse(contentTitle, createdContent, scopeTitle) {
|
|
530
|
-
const scopeInfo = scopeTitle ? ` in scope "${scopeTitle}"` : '';
|
|
531
|
-
let contentJson = '';
|
|
532
|
-
try {
|
|
533
|
-
contentJson = JSON.stringify(createdContent, null, 2);
|
|
534
|
-
}
|
|
535
|
-
catch (error) {
|
|
536
|
-
contentJson = 'Unable to display content details due to JSON serialization error';
|
|
537
|
-
}
|
|
538
477
|
return {
|
|
539
478
|
content: [{
|
|
540
479
|
type: "text",
|
|
541
|
-
text:
|
|
480
|
+
text: JSON.stringify(createdContent, null, 2)
|
|
542
481
|
}]
|
|
543
482
|
};
|
|
544
483
|
}
|
|
@@ -547,22 +486,14 @@ function createInterfaceQuestionPrompt(description, interfaceType, naturalLangua
|
|
|
547
486
|
return {
|
|
548
487
|
content: [{
|
|
549
488
|
type: "text",
|
|
550
|
-
text:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
` "interfaceType": "${interfaceType}"\n` +
|
|
559
|
-
`}\n\`\`\`\n\n` +
|
|
560
|
-
`**Options:**\n` +
|
|
561
|
-
`⢠**interfaceTitle**: The name of your interface\n` +
|
|
562
|
-
`⢠**pageCount**: Number of pages (default: 3)\n` +
|
|
563
|
-
`⢠**pages**: Array of page names (optional, will generate based on type)\n` +
|
|
564
|
-
`⢠**primaryColor**: Hex color code (default: #3570c9)\n` +
|
|
565
|
-
`⢠**interfaceType**: "${interfaceType}" (auto-detected)`
|
|
489
|
+
text: JSON.stringify({
|
|
490
|
+
needsInterfaceDetails: true,
|
|
491
|
+
description,
|
|
492
|
+
interfaceType,
|
|
493
|
+
typeKey: naturalLanguage,
|
|
494
|
+
requiredFields: ['interfaceTitle'],
|
|
495
|
+
optionalFields: ['pageCount', 'pages', 'primaryColor']
|
|
496
|
+
}, null, 2)
|
|
566
497
|
}]
|
|
567
498
|
};
|
|
568
499
|
}
|
|
@@ -673,30 +604,27 @@ function generateDefaultPages(interfaceType, pageCount) {
|
|
|
673
604
|
return template.slice(0, Math.max(pageCount, 1));
|
|
674
605
|
}
|
|
675
606
|
function createPayloadReviewPrompt(payload, naturalLanguage, userArgs) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
items: menu.items.map((item) => item.title)
|
|
689
|
-
}))
|
|
690
|
-
};
|
|
691
|
-
payloadPreview = JSON.stringify(preview, null, 2);
|
|
692
|
-
}
|
|
693
|
-
catch (error) {
|
|
694
|
-
payloadPreview = 'Unable to generate payload preview';
|
|
695
|
-
}
|
|
607
|
+
const preview = {
|
|
608
|
+
title: payload.title,
|
|
609
|
+
pages: payload.routes.map((route) => ({
|
|
610
|
+
title: route.title,
|
|
611
|
+
path: route.path
|
|
612
|
+
})),
|
|
613
|
+
primaryColor: payload.styles?.pre?.match(/--primary:\s*([^;]+)/)?.[1] || '#3570c9',
|
|
614
|
+
menus: payload.menus.map((menu) => ({
|
|
615
|
+
name: menu.name,
|
|
616
|
+
items: menu.items.map((item) => item.title)
|
|
617
|
+
}))
|
|
618
|
+
};
|
|
696
619
|
return {
|
|
697
620
|
content: [{
|
|
698
621
|
type: "text",
|
|
699
|
-
text:
|
|
622
|
+
text: JSON.stringify({
|
|
623
|
+
needsConfirmation: true,
|
|
624
|
+
preview,
|
|
625
|
+
typeKey: naturalLanguage,
|
|
626
|
+
interfaceTitle: userArgs.interfaceTitle
|
|
627
|
+
}, null, 2)
|
|
700
628
|
}]
|
|
701
629
|
};
|
|
702
630
|
}
|