@jaypie/mcp 0.7.45 → 0.8.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 (43) hide show
  1. package/dist/suite.d.ts +1 -3
  2. package/dist/suite.js +1 -9
  3. package/dist/suite.js.map +1 -1
  4. package/dist/suites/docs/index.js +2 -9
  5. package/dist/suites/docs/index.js.map +1 -1
  6. package/package.json +1 -2
  7. package/release-notes/aws/1.2.7.md +13 -0
  8. package/release-notes/constructs/1.2.36.md +9 -0
  9. package/release-notes/jaypie/1.2.24.md +11 -0
  10. package/release-notes/llm/1.2.19.md +11 -0
  11. package/release-notes/mcp/0.8.0.md +21 -0
  12. package/skills/agents.md +4 -3
  13. package/skills/aws.md +1 -6
  14. package/skills/contents.md +1 -1
  15. package/skills/datadog.md +3 -3
  16. package/skills/dynamodb.md +1 -6
  17. package/skills/fabric.md +1 -1
  18. package/skills/llm.md +1 -0
  19. package/skills/{tools-datadog.md → mcp-datadog.md} +4 -4
  20. package/skills/mcp.md +63 -0
  21. package/skills/meta.md +3 -3
  22. package/skills/practice.md +10 -0
  23. package/skills/skills.md +2 -2
  24. package/skills/tildeskill.md +1 -1
  25. package/skills/tools.md +170 -85
  26. package/dist/suites/aws/aws.d.ts +0 -207
  27. package/dist/suites/aws/aws.js +0 -369
  28. package/dist/suites/aws/aws.js.map +0 -1
  29. package/dist/suites/aws/help.md +0 -87
  30. package/dist/suites/aws/index.d.ts +0 -68
  31. package/dist/suites/aws/index.js +0 -397
  32. package/dist/suites/aws/index.js.map +0 -1
  33. package/dist/suites/llm/help.md +0 -58
  34. package/dist/suites/llm/index.d.ts +0 -2
  35. package/dist/suites/llm/index.js +0 -77
  36. package/dist/suites/llm/index.js.map +0 -1
  37. package/dist/suites/llm/llm.d.ts +0 -53
  38. package/dist/suites/llm/llm.js +0 -111
  39. package/dist/suites/llm/llm.js.map +0 -1
  40. package/skills/index.md +0 -18
  41. package/skills/tools-aws.md +0 -208
  42. package/skills/tools-dynamodb.md +0 -179
  43. package/skills/tools-llm.md +0 -109
@@ -1,397 +0,0 @@
1
- import { fabricService } from '@jaypie/fabric';
2
- import * as fs from 'node:fs/promises';
3
- import * as path from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import { purgeSQSQueue, receiveSQSMessage, getSQSQueueAttributes, listSQSQueues, getDynamoDBItem, queryDynamoDB, scanDynamoDB, describeDynamoDBTable, describeStack, listS3Objects, filterLogEvents, stopStepFunctionExecution, listStepFunctionExecutions, getLambdaFunction, listLambdaFunctions, listAwsProfiles, validateAwsSetup } from './aws.js';
6
- export { executeAwsCommand } from './aws.js';
7
-
8
- /**
9
- * AWS Suite - Unified AWS CLI access
10
- */
11
- const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
12
- // Silent logger for direct execution
13
- const log = {
14
- error: () => { },
15
- info: () => { },
16
- };
17
- async function getHelp() {
18
- return fs.readFile(path.join(__dirname$1, "help.md"), "utf-8");
19
- }
20
- const awsService = fabricService({
21
- alias: "aws",
22
- description: "Access AWS services via CLI. Commands: list_profiles, lambda_*, stepfunctions_*, logs_*, s3_*, cloudformation_*, dynamodb_*, sqs_*. Call with no args for help.",
23
- input: {
24
- bucket: {
25
- description: "S3 bucket name",
26
- required: false,
27
- type: String,
28
- },
29
- cause: {
30
- description: "Cause for stopping Step Functions execution",
31
- required: false,
32
- type: String,
33
- },
34
- command: {
35
- description: "Command to execute (omit for help)",
36
- required: false,
37
- type: String,
38
- },
39
- endTime: {
40
- description: "End time for log filtering (e.g., now)",
41
- required: false,
42
- type: String,
43
- },
44
- executionArn: {
45
- description: "Step Functions execution ARN",
46
- required: false,
47
- type: String,
48
- },
49
- expressionAttributeValues: {
50
- description: "DynamoDB expression attribute values (JSON string)",
51
- required: false,
52
- type: String,
53
- },
54
- filterExpression: {
55
- description: "DynamoDB filter expression",
56
- required: false,
57
- type: String,
58
- },
59
- filterPattern: {
60
- description: "CloudWatch Logs filter pattern",
61
- required: false,
62
- type: String,
63
- },
64
- functionName: {
65
- description: "Lambda function name",
66
- required: false,
67
- type: String,
68
- },
69
- functionNamePrefix: {
70
- description: "Lambda function name prefix filter",
71
- required: false,
72
- type: String,
73
- },
74
- indexName: {
75
- description: "DynamoDB index name",
76
- required: false,
77
- type: String,
78
- },
79
- key: {
80
- description: "DynamoDB item key (JSON string)",
81
- required: false,
82
- type: String,
83
- },
84
- keyConditionExpression: {
85
- description: "DynamoDB key condition expression",
86
- required: false,
87
- type: String,
88
- },
89
- limit: {
90
- description: "Maximum number of results",
91
- required: false,
92
- type: Number,
93
- },
94
- logGroupName: {
95
- description: "CloudWatch Logs group name",
96
- required: false,
97
- type: String,
98
- },
99
- maxNumberOfMessages: {
100
- description: "SQS max messages to receive",
101
- required: false,
102
- type: Number,
103
- },
104
- maxResults: {
105
- description: "Maximum number of results",
106
- required: false,
107
- type: Number,
108
- },
109
- prefix: {
110
- description: "S3 object prefix filter",
111
- required: false,
112
- type: String,
113
- },
114
- profile: {
115
- description: "AWS profile name",
116
- required: false,
117
- type: String,
118
- },
119
- queueNamePrefix: {
120
- description: "SQS queue name prefix filter",
121
- required: false,
122
- type: String,
123
- },
124
- queueUrl: {
125
- description: "SQS queue URL",
126
- required: false,
127
- type: String,
128
- },
129
- region: {
130
- description: "AWS region (e.g., us-east-1)",
131
- required: false,
132
- type: String,
133
- },
134
- scanIndexForward: {
135
- description: "DynamoDB scan direction (true=ascending)",
136
- required: false,
137
- type: Boolean,
138
- },
139
- stackName: {
140
- description: "CloudFormation stack name",
141
- required: false,
142
- type: String,
143
- },
144
- startTime: {
145
- description: "Start time for log filtering (e.g., now-15m)",
146
- required: false,
147
- type: String,
148
- },
149
- stateMachineArn: {
150
- description: "Step Functions state machine ARN",
151
- required: false,
152
- type: String,
153
- },
154
- statusFilter: {
155
- description: "Step Functions status filter: RUNNING, SUCCEEDED, FAILED, TIMED_OUT, ABORTED, PENDING_REDRIVE",
156
- required: false,
157
- type: String,
158
- },
159
- tableName: {
160
- description: "DynamoDB table name",
161
- required: false,
162
- type: String,
163
- },
164
- visibilityTimeout: {
165
- description: "SQS message visibility timeout in seconds",
166
- required: false,
167
- type: Number,
168
- },
169
- },
170
- service: async (params) => {
171
- const { command } = params;
172
- if (!command || command === "help") {
173
- return getHelp();
174
- }
175
- const p = params;
176
- switch (command) {
177
- case "validate": {
178
- return validateAwsSetup();
179
- }
180
- case "list_profiles": {
181
- const result = await listAwsProfiles(log);
182
- if (!result.success)
183
- throw new Error(result.error);
184
- return result.data;
185
- }
186
- case "lambda_list_functions": {
187
- const result = await listLambdaFunctions({
188
- functionNamePrefix: p.functionNamePrefix,
189
- maxResults: p.maxResults,
190
- profile: p.profile,
191
- region: p.region,
192
- }, log);
193
- if (!result.success)
194
- throw new Error(result.error);
195
- return result.data;
196
- }
197
- case "lambda_get_function": {
198
- if (!p.functionName)
199
- throw new Error("functionName is required");
200
- const result = await getLambdaFunction({
201
- functionName: p.functionName,
202
- profile: p.profile,
203
- region: p.region,
204
- }, log);
205
- if (!result.success)
206
- throw new Error(result.error);
207
- return result.data;
208
- }
209
- case "stepfunctions_list_executions": {
210
- if (!p.stateMachineArn)
211
- throw new Error("stateMachineArn is required");
212
- const result = await listStepFunctionExecutions({
213
- maxResults: p.maxResults,
214
- profile: p.profile,
215
- region: p.region,
216
- stateMachineArn: p.stateMachineArn,
217
- statusFilter: p.statusFilter,
218
- }, log);
219
- if (!result.success)
220
- throw new Error(result.error);
221
- return result.data;
222
- }
223
- case "stepfunctions_stop_execution": {
224
- if (!p.executionArn)
225
- throw new Error("executionArn is required");
226
- const result = await stopStepFunctionExecution({
227
- cause: p.cause,
228
- executionArn: p.executionArn,
229
- profile: p.profile,
230
- region: p.region,
231
- }, log);
232
- if (!result.success)
233
- throw new Error(result.error);
234
- return result.data;
235
- }
236
- case "logs_filter_log_events": {
237
- if (!p.logGroupName)
238
- throw new Error("logGroupName is required");
239
- const result = await filterLogEvents({
240
- endTime: p.endTime || "now",
241
- filterPattern: p.filterPattern,
242
- limit: p.limit || 100,
243
- logGroupName: p.logGroupName,
244
- profile: p.profile,
245
- region: p.region,
246
- startTime: p.startTime || "now-15m",
247
- }, log);
248
- if (!result.success)
249
- throw new Error(result.error);
250
- return result.data;
251
- }
252
- case "s3_list_objects": {
253
- if (!p.bucket)
254
- throw new Error("bucket is required");
255
- const result = await listS3Objects({
256
- bucket: p.bucket,
257
- maxResults: p.maxResults,
258
- prefix: p.prefix,
259
- profile: p.profile,
260
- region: p.region,
261
- }, log);
262
- if (!result.success)
263
- throw new Error(result.error);
264
- return result.data;
265
- }
266
- case "cloudformation_describe_stack": {
267
- if (!p.stackName)
268
- throw new Error("stackName is required");
269
- const result = await describeStack({
270
- profile: p.profile,
271
- region: p.region,
272
- stackName: p.stackName,
273
- }, log);
274
- if (!result.success)
275
- throw new Error(result.error);
276
- return result.data;
277
- }
278
- case "dynamodb_describe_table": {
279
- if (!p.tableName)
280
- throw new Error("tableName is required");
281
- const result = await describeDynamoDBTable({
282
- profile: p.profile,
283
- region: p.region,
284
- tableName: p.tableName,
285
- }, log);
286
- if (!result.success)
287
- throw new Error(result.error);
288
- return result.data;
289
- }
290
- case "dynamodb_scan": {
291
- if (!p.tableName)
292
- throw new Error("tableName is required");
293
- const result = await scanDynamoDB({
294
- expressionAttributeValues: p.expressionAttributeValues,
295
- filterExpression: p.filterExpression,
296
- limit: p.limit || 25,
297
- profile: p.profile,
298
- region: p.region,
299
- tableName: p.tableName,
300
- }, log);
301
- if (!result.success)
302
- throw new Error(result.error);
303
- return result.data;
304
- }
305
- case "dynamodb_query": {
306
- if (!p.tableName)
307
- throw new Error("tableName is required");
308
- if (!p.keyConditionExpression)
309
- throw new Error("keyConditionExpression is required");
310
- if (!p.expressionAttributeValues)
311
- throw new Error("expressionAttributeValues is required");
312
- const result = await queryDynamoDB({
313
- expressionAttributeValues: p.expressionAttributeValues,
314
- filterExpression: p.filterExpression,
315
- indexName: p.indexName,
316
- keyConditionExpression: p.keyConditionExpression,
317
- limit: p.limit,
318
- profile: p.profile,
319
- region: p.region,
320
- scanIndexForward: p.scanIndexForward,
321
- tableName: p.tableName,
322
- }, log);
323
- if (!result.success)
324
- throw new Error(result.error);
325
- return result.data;
326
- }
327
- case "dynamodb_get_item": {
328
- if (!p.tableName)
329
- throw new Error("tableName is required");
330
- if (!p.key)
331
- throw new Error("key is required");
332
- const result = await getDynamoDBItem({
333
- key: p.key,
334
- profile: p.profile,
335
- region: p.region,
336
- tableName: p.tableName,
337
- }, log);
338
- if (!result.success)
339
- throw new Error(result.error);
340
- return result.data;
341
- }
342
- case "sqs_list_queues": {
343
- const result = await listSQSQueues({
344
- profile: p.profile,
345
- queueNamePrefix: p.queueNamePrefix,
346
- region: p.region,
347
- }, log);
348
- if (!result.success)
349
- throw new Error(result.error);
350
- return result.data;
351
- }
352
- case "sqs_get_queue_attributes": {
353
- if (!p.queueUrl)
354
- throw new Error("queueUrl is required");
355
- const result = await getSQSQueueAttributes({
356
- profile: p.profile,
357
- queueUrl: p.queueUrl,
358
- region: p.region,
359
- }, log);
360
- if (!result.success)
361
- throw new Error(result.error);
362
- return result.data;
363
- }
364
- case "sqs_receive_message": {
365
- if (!p.queueUrl)
366
- throw new Error("queueUrl is required");
367
- const result = await receiveSQSMessage({
368
- maxNumberOfMessages: p.maxNumberOfMessages || 1,
369
- profile: p.profile,
370
- queueUrl: p.queueUrl,
371
- region: p.region,
372
- visibilityTimeout: p.visibilityTimeout || 30,
373
- }, log);
374
- if (!result.success)
375
- throw new Error(result.error);
376
- return result.data;
377
- }
378
- case "sqs_purge_queue": {
379
- if (!p.queueUrl)
380
- throw new Error("queueUrl is required");
381
- const result = await purgeSQSQueue({
382
- profile: p.profile,
383
- queueUrl: p.queueUrl,
384
- region: p.region,
385
- }, log);
386
- if (!result.success)
387
- throw new Error(result.error);
388
- return { success: true };
389
- }
390
- default:
391
- throw new Error(`Unknown command: ${command}. Use aws() for help.`);
392
- }
393
- },
394
- });
395
-
396
- export { awsService, describeDynamoDBTable, describeStack, filterLogEvents, getDynamoDBItem, getLambdaFunction, getSQSQueueAttributes, listAwsProfiles, listLambdaFunctions, listS3Objects, listSQSQueues, listStepFunctionExecutions, purgeSQSQueue, queryDynamoDB, receiveSQSMessage, scanDynamoDB, stopStepFunctionExecution, validateAwsSetup };
397
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/suites/aws/index.ts"],"sourcesContent":["/**\n * AWS Suite - Unified AWS CLI access\n */\nimport { fabricService } from \"@jaypie/fabric\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport {\n describeDynamoDBTable,\n describeStack,\n filterLogEvents,\n getDynamoDBItem,\n getLambdaFunction,\n getSQSQueueAttributes,\n listAwsProfiles,\n listLambdaFunctions,\n listS3Objects,\n listSQSQueues,\n listStepFunctionExecutions,\n purgeSQSQueue,\n queryDynamoDB,\n receiveSQSMessage,\n scanDynamoDB,\n stopStepFunctionExecution,\n validateAwsSetup,\n} from \"./aws.js\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Silent logger for direct execution\nconst log = {\n error: () => {},\n info: () => {},\n};\n\nasync function getHelp(): Promise<string> {\n return fs.readFile(path.join(__dirname, \"help.md\"), \"utf-8\");\n}\n\n// Flattened input type for the unified AWS service\ninterface AwsInput {\n bucket?: string;\n cause?: string;\n command?: string;\n endTime?: string;\n executionArn?: string;\n expressionAttributeValues?: string;\n filterExpression?: string;\n filterPattern?: string;\n functionName?: string;\n functionNamePrefix?: string;\n indexName?: string;\n key?: string;\n keyConditionExpression?: string;\n limit?: number;\n logGroupName?: string;\n maxNumberOfMessages?: number;\n maxResults?: number;\n prefix?: string;\n profile?: string;\n queueNamePrefix?: string;\n queueUrl?: string;\n region?: string;\n scanIndexForward?: boolean;\n stackName?: string;\n startTime?: string;\n stateMachineArn?: string;\n statusFilter?: string;\n tableName?: string;\n visibilityTimeout?: number;\n}\n\nexport const awsService = fabricService({\n alias: \"aws\",\n description:\n \"Access AWS services via CLI. Commands: list_profiles, lambda_*, stepfunctions_*, logs_*, s3_*, cloudformation_*, dynamodb_*, sqs_*. Call with no args for help.\",\n input: {\n bucket: {\n description: \"S3 bucket name\",\n required: false,\n type: String,\n },\n cause: {\n description: \"Cause for stopping Step Functions execution\",\n required: false,\n type: String,\n },\n command: {\n description: \"Command to execute (omit for help)\",\n required: false,\n type: String,\n },\n endTime: {\n description: \"End time for log filtering (e.g., now)\",\n required: false,\n type: String,\n },\n executionArn: {\n description: \"Step Functions execution ARN\",\n required: false,\n type: String,\n },\n expressionAttributeValues: {\n description: \"DynamoDB expression attribute values (JSON string)\",\n required: false,\n type: String,\n },\n filterExpression: {\n description: \"DynamoDB filter expression\",\n required: false,\n type: String,\n },\n filterPattern: {\n description: \"CloudWatch Logs filter pattern\",\n required: false,\n type: String,\n },\n functionName: {\n description: \"Lambda function name\",\n required: false,\n type: String,\n },\n functionNamePrefix: {\n description: \"Lambda function name prefix filter\",\n required: false,\n type: String,\n },\n indexName: {\n description: \"DynamoDB index name\",\n required: false,\n type: String,\n },\n key: {\n description: \"DynamoDB item key (JSON string)\",\n required: false,\n type: String,\n },\n keyConditionExpression: {\n description: \"DynamoDB key condition expression\",\n required: false,\n type: String,\n },\n limit: {\n description: \"Maximum number of results\",\n required: false,\n type: Number,\n },\n logGroupName: {\n description: \"CloudWatch Logs group name\",\n required: false,\n type: String,\n },\n maxNumberOfMessages: {\n description: \"SQS max messages to receive\",\n required: false,\n type: Number,\n },\n maxResults: {\n description: \"Maximum number of results\",\n required: false,\n type: Number,\n },\n prefix: {\n description: \"S3 object prefix filter\",\n required: false,\n type: String,\n },\n profile: {\n description: \"AWS profile name\",\n required: false,\n type: String,\n },\n queueNamePrefix: {\n description: \"SQS queue name prefix filter\",\n required: false,\n type: String,\n },\n queueUrl: {\n description: \"SQS queue URL\",\n required: false,\n type: String,\n },\n region: {\n description: \"AWS region (e.g., us-east-1)\",\n required: false,\n type: String,\n },\n scanIndexForward: {\n description: \"DynamoDB scan direction (true=ascending)\",\n required: false,\n type: Boolean,\n },\n stackName: {\n description: \"CloudFormation stack name\",\n required: false,\n type: String,\n },\n startTime: {\n description: \"Start time for log filtering (e.g., now-15m)\",\n required: false,\n type: String,\n },\n stateMachineArn: {\n description: \"Step Functions state machine ARN\",\n required: false,\n type: String,\n },\n statusFilter: {\n description:\n \"Step Functions status filter: RUNNING, SUCCEEDED, FAILED, TIMED_OUT, ABORTED, PENDING_REDRIVE\",\n required: false,\n type: String,\n },\n tableName: {\n description: \"DynamoDB table name\",\n required: false,\n type: String,\n },\n visibilityTimeout: {\n description: \"SQS message visibility timeout in seconds\",\n required: false,\n type: Number,\n },\n },\n service: async (params: AwsInput) => {\n const { command } = params;\n\n if (!command || command === \"help\") {\n return getHelp();\n }\n\n const p = params;\n\n switch (command) {\n case \"validate\": {\n return validateAwsSetup();\n }\n\n case \"list_profiles\": {\n const result = await listAwsProfiles(log);\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"lambda_list_functions\": {\n const result = await listLambdaFunctions(\n {\n functionNamePrefix: p.functionNamePrefix,\n maxResults: p.maxResults,\n profile: p.profile,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"lambda_get_function\": {\n if (!p.functionName) throw new Error(\"functionName is required\");\n const result = await getLambdaFunction(\n {\n functionName: p.functionName,\n profile: p.profile,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"stepfunctions_list_executions\": {\n if (!p.stateMachineArn) throw new Error(\"stateMachineArn is required\");\n const result = await listStepFunctionExecutions(\n {\n maxResults: p.maxResults,\n profile: p.profile,\n region: p.region,\n stateMachineArn: p.stateMachineArn,\n statusFilter: p.statusFilter as\n | \"RUNNING\"\n | \"SUCCEEDED\"\n | \"FAILED\"\n | \"TIMED_OUT\"\n | \"ABORTED\"\n | \"PENDING_REDRIVE\"\n | undefined,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"stepfunctions_stop_execution\": {\n if (!p.executionArn) throw new Error(\"executionArn is required\");\n const result = await stopStepFunctionExecution(\n {\n cause: p.cause,\n executionArn: p.executionArn,\n profile: p.profile,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"logs_filter_log_events\": {\n if (!p.logGroupName) throw new Error(\"logGroupName is required\");\n const result = await filterLogEvents(\n {\n endTime: p.endTime || \"now\",\n filterPattern: p.filterPattern,\n limit: p.limit || 100,\n logGroupName: p.logGroupName,\n profile: p.profile,\n region: p.region,\n startTime: p.startTime || \"now-15m\",\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"s3_list_objects\": {\n if (!p.bucket) throw new Error(\"bucket is required\");\n const result = await listS3Objects(\n {\n bucket: p.bucket,\n maxResults: p.maxResults,\n prefix: p.prefix,\n profile: p.profile,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"cloudformation_describe_stack\": {\n if (!p.stackName) throw new Error(\"stackName is required\");\n const result = await describeStack(\n {\n profile: p.profile,\n region: p.region,\n stackName: p.stackName,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"dynamodb_describe_table\": {\n if (!p.tableName) throw new Error(\"tableName is required\");\n const result = await describeDynamoDBTable(\n {\n profile: p.profile,\n region: p.region,\n tableName: p.tableName,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"dynamodb_scan\": {\n if (!p.tableName) throw new Error(\"tableName is required\");\n const result = await scanDynamoDB(\n {\n expressionAttributeValues: p.expressionAttributeValues,\n filterExpression: p.filterExpression,\n limit: p.limit || 25,\n profile: p.profile,\n region: p.region,\n tableName: p.tableName,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"dynamodb_query\": {\n if (!p.tableName) throw new Error(\"tableName is required\");\n if (!p.keyConditionExpression)\n throw new Error(\"keyConditionExpression is required\");\n if (!p.expressionAttributeValues)\n throw new Error(\"expressionAttributeValues is required\");\n const result = await queryDynamoDB(\n {\n expressionAttributeValues: p.expressionAttributeValues,\n filterExpression: p.filterExpression,\n indexName: p.indexName,\n keyConditionExpression: p.keyConditionExpression,\n limit: p.limit,\n profile: p.profile,\n region: p.region,\n scanIndexForward: p.scanIndexForward,\n tableName: p.tableName,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"dynamodb_get_item\": {\n if (!p.tableName) throw new Error(\"tableName is required\");\n if (!p.key) throw new Error(\"key is required\");\n const result = await getDynamoDBItem(\n {\n key: p.key,\n profile: p.profile,\n region: p.region,\n tableName: p.tableName,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"sqs_list_queues\": {\n const result = await listSQSQueues(\n {\n profile: p.profile,\n queueNamePrefix: p.queueNamePrefix,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"sqs_get_queue_attributes\": {\n if (!p.queueUrl) throw new Error(\"queueUrl is required\");\n const result = await getSQSQueueAttributes(\n {\n profile: p.profile,\n queueUrl: p.queueUrl,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"sqs_receive_message\": {\n if (!p.queueUrl) throw new Error(\"queueUrl is required\");\n const result = await receiveSQSMessage(\n {\n maxNumberOfMessages: p.maxNumberOfMessages || 1,\n profile: p.profile,\n queueUrl: p.queueUrl,\n region: p.region,\n visibilityTimeout: p.visibilityTimeout || 30,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result.data;\n }\n\n case \"sqs_purge_queue\": {\n if (!p.queueUrl) throw new Error(\"queueUrl is required\");\n const result = await purgeSQSQueue(\n {\n profile: p.profile,\n queueUrl: p.queueUrl,\n region: p.region,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return { success: true };\n }\n\n default:\n throw new Error(`Unknown command: ${command}. Use aws() for help.`);\n }\n },\n});\n\n// Re-export types and functions for testing\nexport * from \"./aws.js\";\n"],"names":["__dirname"],"mappings":";;;;;;;AAAA;;AAEG;AA0BH,MAAMA,WAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE9D;AACA,MAAM,GAAG,GAAG;AACV,IAAA,KAAK,EAAE,MAAK,EAAE,CAAC;AACf,IAAA,IAAI,EAAE,MAAK,EAAE,CAAC;CACf;AAED,eAAe,OAAO,GAAA;AACpB,IAAA,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAACA,WAAS,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC;AAC9D;AAmCO,MAAM,UAAU,GAAG,aAAa,CAAC;AACtC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,WAAW,EACT,iKAAiK;AACnK,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE;AACN,YAAA,WAAW,EAAE,gBAAgB;AAC7B,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,WAAW,EAAE,6CAA6C;AAC1D,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,WAAW,EAAE,oCAAoC;AACjD,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,WAAW,EAAE,wCAAwC;AACrD,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA,YAAY,EAAE;AACZ,YAAA,WAAW,EAAE,8BAA8B;AAC3C,YAAA,QAAQ,EAAE,KA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,GAAG,CACJ;gBACD,IAAI,CAAC,MAAM,CAAC,OAAO;AAAE,oBAAA,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAClD,gBAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;YAC1B;AAEA,YAAA;AACE,gBAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,CAAA,qBAAA,CAAuB,CAAC;;IAEzE,CAAC;AACF,CAAA;;;;"}
@@ -1,58 +0,0 @@
1
- # LLM Tools
2
-
3
- Debug and inspect LLM provider responses. Useful for understanding how providers format responses.
4
-
5
- ## Commands
6
-
7
- | Command | Description | Required Parameters |
8
- |---------|-------------|---------------------|
9
- | `validate` | Validate LLM setup (check API keys) | - |
10
- | `debug_call` | Make a debug call and inspect response | `provider`, `message` |
11
-
12
- ## Parameters
13
-
14
- All parameters are passed at the top level (flat structure):
15
-
16
- | Parameter | Type | Description |
17
- |-----------|------|-------------|
18
- | `command` | string | Command to execute (omit for help) |
19
- | `provider` | string | LLM provider: anthropic, google, openai, openrouter, xai |
20
- | `message` | string | Message to send to the LLM provider |
21
- | `model` | string | Model to use (provider-specific, e.g., gpt-4, claude-3-sonnet) |
22
-
23
- ## Providers
24
-
25
- Supported providers: `anthropic`, `gemini`, `openai`, `openrouter`, `xai`
26
-
27
- ## Environment Variables
28
-
29
- | Variable | Description |
30
- |----------|-------------|
31
- | `OPENAI_API_KEY` | OpenAI API key |
32
- | `ANTHROPIC_API_KEY` | Anthropic API key |
33
- | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | Google/Gemini API key |
34
- | `OPENROUTER_API_KEY` | OpenRouter API key |
35
- | `XAI_API_KEY` | xAI (Grok) API key |
36
-
37
- ## Examples
38
-
39
- ```
40
- # Debug OpenAI call
41
- llm({ command: "debug_call", provider: "openai", message: "Hello, world!" })
42
-
43
- # Debug with specific model
44
- llm({ command: "debug_call", provider: "openai", model: "o3-mini", message: "What is 15 * 17? Think step by step." })
45
-
46
- # Debug Anthropic call
47
- llm({ command: "debug_call", provider: "anthropic", message: "Explain quantum computing" })
48
- ```
49
-
50
- ## Response Fields
51
-
52
- The `debug_call` command returns:
53
- - `content` - The response text
54
- - `reasoning` - Extracted reasoning/thinking content (if available)
55
- - `reasoningTokens` - Count of reasoning tokens used
56
- - `history` - Full conversation history
57
- - `rawResponses` - Raw API responses
58
- - `usage` - Token usage statistics
@@ -1,2 +0,0 @@
1
- export declare const llmService: import("@jaypie/fabric").Service<Record<string, unknown>, string | import("./llm.js").LlmDebugCallResult | import("./llm.js").LlmValidationResult, string | import("./llm.js").LlmDebugCallResult | import("./llm.js").LlmValidationResult>;
2
- export * from "./llm.js";
@@ -1,77 +0,0 @@
1
- import { fabricService } from '@jaypie/fabric';
2
- import * as fs from 'node:fs/promises';
3
- import * as path from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import { inferProvider, debugLlmCall, validateLlmSetup } from './llm.js';
6
-
7
- /**
8
- * LLM Suite - Unified LLM debugging and inspection
9
- */
10
- const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
11
- // Silent logger for direct execution
12
- const log = {
13
- error: () => { },
14
- info: () => { },
15
- };
16
- async function getHelp() {
17
- return fs.readFile(path.join(__dirname$1, "help.md"), "utf-8");
18
- }
19
- const llmService = fabricService({
20
- alias: "llm",
21
- description: "Debug LLM provider responses. Commands: debug_call. Call with no args for help.",
22
- input: {
23
- command: {
24
- description: "Command to execute (omit for help)",
25
- required: false,
26
- type: String,
27
- },
28
- message: {
29
- description: "Message to send to the LLM provider",
30
- required: false,
31
- type: String,
32
- },
33
- model: {
34
- description: "Model to use (provider-specific, e.g., gpt-4, claude-3-sonnet)",
35
- required: false,
36
- type: String,
37
- },
38
- provider: {
39
- description: "LLM provider: anthropic, openai, google, openrouter",
40
- required: false,
41
- type: String,
42
- },
43
- },
44
- service: async (params) => {
45
- const { command } = params;
46
- if (!command || command === "help") {
47
- return getHelp();
48
- }
49
- const p = params;
50
- switch (command) {
51
- case "validate": {
52
- return validateLlmSetup();
53
- }
54
- case "debug_call": {
55
- const provider = p.provider ||
56
- (p.model ? inferProvider(p.model) : undefined);
57
- if (!provider)
58
- throw new Error("provider is required (or use a model name that starts with claude-, gemini-, gpt-, o1-, o3-, o4-, or chatgpt-)");
59
- if (!p.message)
60
- throw new Error("message is required");
61
- const result = await debugLlmCall({
62
- message: p.message,
63
- model: p.model,
64
- provider,
65
- }, log);
66
- if (!result.success)
67
- throw new Error(result.error);
68
- return result;
69
- }
70
- default:
71
- throw new Error(`Unknown command: ${command}. Use llm() for help.`);
72
- }
73
- },
74
- });
75
-
76
- export { debugLlmCall, inferProvider, llmService, validateLlmSetup };
77
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/suites/llm/index.ts"],"sourcesContent":["/**\n * LLM Suite - Unified LLM debugging and inspection\n */\nimport { fabricService } from \"@jaypie/fabric\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport {\n debugLlmCall,\n inferProvider,\n validateLlmSetup,\n type LlmProvider,\n} from \"./llm.js\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Silent logger for direct execution\nconst log = {\n error: () => {},\n info: () => {},\n};\n\nasync function getHelp(): Promise<string> {\n return fs.readFile(path.join(__dirname, \"help.md\"), \"utf-8\");\n}\n\n// Flattened input type for the unified LLM service\ninterface LlmInput {\n command?: string;\n message?: string;\n model?: string;\n provider?: string;\n}\n\nexport const llmService = fabricService({\n alias: \"llm\",\n description:\n \"Debug LLM provider responses. Commands: debug_call. Call with no args for help.\",\n input: {\n command: {\n description: \"Command to execute (omit for help)\",\n required: false,\n type: String,\n },\n message: {\n description: \"Message to send to the LLM provider\",\n required: false,\n type: String,\n },\n model: {\n description:\n \"Model to use (provider-specific, e.g., gpt-4, claude-3-sonnet)\",\n required: false,\n type: String,\n },\n provider: {\n description: \"LLM provider: anthropic, openai, google, openrouter\",\n required: false,\n type: String,\n },\n },\n service: async (params: LlmInput) => {\n const { command } = params;\n\n if (!command || command === \"help\") {\n return getHelp();\n }\n\n const p = params;\n\n switch (command) {\n case \"validate\": {\n return validateLlmSetup();\n }\n\n case \"debug_call\": {\n const provider =\n (p.provider as LlmProvider) ||\n (p.model ? inferProvider(p.model) : undefined);\n if (!provider)\n throw new Error(\n \"provider is required (or use a model name that starts with claude-, gemini-, gpt-, o1-, o3-, o4-, or chatgpt-)\",\n );\n if (!p.message) throw new Error(\"message is required\");\n const result = await debugLlmCall(\n {\n message: p.message,\n model: p.model,\n provider,\n },\n log,\n );\n if (!result.success) throw new Error(result.error);\n return result;\n }\n\n default:\n throw new Error(`Unknown command: ${command}. Use llm() for help.`);\n }\n },\n});\n\n// Re-export types and functions for testing\nexport * from \"./llm.js\";\n"],"names":["__dirname"],"mappings":";;;;;;AAAA;;AAEG;AAaH,MAAMA,WAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE9D;AACA,MAAM,GAAG,GAAG;AACV,IAAA,KAAK,EAAE,MAAK,EAAE,CAAC;AACf,IAAA,IAAI,EAAE,MAAK,EAAE,CAAC;CACf;AAED,eAAe,OAAO,GAAA;AACpB,IAAA,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAACA,WAAS,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC;AAC9D;AAUO,MAAM,UAAU,GAAG,aAAa,CAAC;AACtC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,WAAW,EACT,iFAAiF;AACnF,IAAA,KAAK,EAAE;AACL,QAAA,OAAO,EAAE;AACP,YAAA,WAAW,EAAE,oCAAoC;AACjD,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,WAAW,EAAE,qCAAqC;AAClD,YAAA,QAAQ,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YAAA;AACE,gBAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,CAAA,qBAAA,CAAuB,CAAC;;IAEzE,CAAC;AACF,CAAA;;;;"}
@@ -1,53 +0,0 @@
1
- /**
2
- * LLM debugging utilities for inspecting raw provider responses
3
- */
4
- export type LlmProvider = "anthropic" | "google" | "openai" | "openrouter" | "xai";
5
- export interface LlmDebugCallParams {
6
- provider: LlmProvider;
7
- model?: string;
8
- message: string;
9
- }
10
- export interface LlmDebugCallResult {
11
- success: boolean;
12
- provider: string;
13
- model: string;
14
- content?: string;
15
- reasoning?: string[];
16
- reasoningTokens?: number;
17
- history?: unknown[];
18
- rawResponses?: unknown[];
19
- usage?: unknown[];
20
- error?: string;
21
- }
22
- export interface LlmProviderStatus {
23
- available: boolean;
24
- }
25
- export interface LlmValidationResult {
26
- success: boolean;
27
- providers: {
28
- anthropic: LlmProviderStatus;
29
- google: LlmProviderStatus;
30
- openai: LlmProviderStatus;
31
- openrouter: LlmProviderStatus;
32
- xai: LlmProviderStatus;
33
- };
34
- availableCount: number;
35
- totalProviders: number;
36
- }
37
- interface Logger {
38
- info: (message: string, ...args: unknown[]) => void;
39
- error: (message: string, ...args: unknown[]) => void;
40
- }
41
- /**
42
- * Infer provider from model string prefix
43
- */
44
- export declare function inferProvider(model: string): LlmProvider | undefined;
45
- /**
46
- * Validate LLM setup without making API calls
47
- */
48
- export declare function validateLlmSetup(): LlmValidationResult;
49
- /**
50
- * Make a debug LLM call and return the raw response data for inspection
51
- */
52
- export declare function debugLlmCall(params: LlmDebugCallParams, log: Logger): Promise<LlmDebugCallResult>;
53
- export {};