@insforge/mcp 1.2.1 → 1.2.2-dev.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/README.md +4 -0
- package/dist/{chunk-MRGODXOM.js → chunk-FCDI74JO.js} +537 -238
- package/dist/http-server.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/LICENSE.md +0 -201
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
Model Context Protocol server for [Insforge](https://github.com/InsForge/insforge).
|
|
16
16
|
|
|
17
|
+
<a href="https://glama.ai/mcp/servers/@InsForge/insforge-mcp">
|
|
18
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@InsForge/insforge-mcp/badge" alt="Insforge Server MCP server" />
|
|
19
|
+
</a>
|
|
20
|
+
|
|
17
21
|
## 📖 Documentation
|
|
18
22
|
|
|
19
23
|
Please visit the [main Insforge repository](https://github.com/InsForge/insforge) for:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/shared/tools.ts
|
|
4
|
-
import { z as
|
|
4
|
+
import { z as z18 } from "zod";
|
|
5
5
|
import fetch2 from "node-fetch";
|
|
6
6
|
import { promises as fs } from "fs";
|
|
7
7
|
import { exec } from "child_process";
|
|
@@ -112,7 +112,7 @@ var columnSchema = z.object({
|
|
|
112
112
|
var tableSchema = z.object({
|
|
113
113
|
tableName: z.string().min(1, "Table name cannot be empty").max(64, "Table name must be less than 64 characters"),
|
|
114
114
|
columns: z.array(columnSchema).min(1, "At least one column is required"),
|
|
115
|
-
recordCount: z.number().
|
|
115
|
+
recordCount: z.number().optional(),
|
|
116
116
|
createdAt: z.string().optional(),
|
|
117
117
|
updatedAt: z.string().optional()
|
|
118
118
|
});
|
|
@@ -165,7 +165,6 @@ var deleteTableResponse = z2.object({
|
|
|
165
165
|
var rawSQLRequestSchema = z2.object({
|
|
166
166
|
query: z2.string().min(1, "Query is required"),
|
|
167
167
|
params: z2.array(z2.unknown()).optional()
|
|
168
|
-
// z.unknown() generates JSON Schema with items: {}
|
|
169
168
|
});
|
|
170
169
|
var rawSQLResponseSchema = z2.object({
|
|
171
170
|
rows: z2.array(z2.record(z2.string(), z2.unknown())),
|
|
@@ -352,9 +351,10 @@ var confirmUploadRequestSchema = z4.object({
|
|
|
352
351
|
import { z as z5 } from "zod";
|
|
353
352
|
var userIdSchema = z5.string().uuid("Invalid user ID format");
|
|
354
353
|
var emailSchema = z5.string().email("Invalid email format").toLowerCase().trim();
|
|
355
|
-
var passwordSchema = z5.string()
|
|
354
|
+
var passwordSchema = z5.string();
|
|
356
355
|
var nameSchema = z5.string().min(1, "Name is required").max(100, "Name must be less than 100 characters").trim();
|
|
357
|
-
var roleSchema = z5.enum(["authenticated", "project_admin"]);
|
|
356
|
+
var roleSchema = z5.enum(["anon", "authenticated", "project_admin"]);
|
|
357
|
+
var verificationMethodSchema = z5.enum(["code", "link"]);
|
|
358
358
|
var userSchema = z5.object({
|
|
359
359
|
id: userIdSchema,
|
|
360
360
|
email: emailSchema,
|
|
@@ -387,11 +387,32 @@ var oAuthStateSchema = z5.object({
|
|
|
387
387
|
redirectUri: z5.string().url().optional()
|
|
388
388
|
});
|
|
389
389
|
var oAuthConfigSchema = z5.object({
|
|
390
|
-
|
|
390
|
+
id: z5.string().uuid(),
|
|
391
|
+
provider: oAuthProvidersSchema,
|
|
391
392
|
clientId: z5.string().optional(),
|
|
392
393
|
scopes: z5.array(z5.string()).optional(),
|
|
393
394
|
redirectUri: z5.string().optional(),
|
|
394
|
-
useSharedKey: z5.boolean()
|
|
395
|
+
useSharedKey: z5.boolean(),
|
|
396
|
+
createdAt: z5.string(),
|
|
397
|
+
// PostgreSQL timestamp
|
|
398
|
+
updatedAt: z5.string()
|
|
399
|
+
// PostgreSQL timestamp
|
|
400
|
+
});
|
|
401
|
+
var authConfigSchema = z5.object({
|
|
402
|
+
id: z5.string().uuid(),
|
|
403
|
+
requireEmailVerification: z5.boolean(),
|
|
404
|
+
passwordMinLength: z5.number().min(4).max(128),
|
|
405
|
+
requireNumber: z5.boolean(),
|
|
406
|
+
requireLowercase: z5.boolean(),
|
|
407
|
+
requireUppercase: z5.boolean(),
|
|
408
|
+
requireSpecialChar: z5.boolean(),
|
|
409
|
+
verifyEmailMethod: verificationMethodSchema,
|
|
410
|
+
resetPasswordMethod: verificationMethodSchema,
|
|
411
|
+
signInRedirectTo: z5.union([z5.string().url(), z5.literal(""), z5.null()]).optional().transform((val) => val === "" ? null : val),
|
|
412
|
+
createdAt: z5.string(),
|
|
413
|
+
// PostgreSQL timestamp
|
|
414
|
+
updatedAt: z5.string()
|
|
415
|
+
// PostgreSQL timestamp
|
|
395
416
|
});
|
|
396
417
|
var tokenPayloadSchema = z5.object({
|
|
397
418
|
sub: userIdSchema,
|
|
@@ -428,9 +449,48 @@ var listUsersRequestSchema = paginationSchema.extend({
|
|
|
428
449
|
var deleteUsersRequestSchema = z6.object({
|
|
429
450
|
userIds: z6.array(userIdSchema).min(1, "At least one user ID is required")
|
|
430
451
|
});
|
|
452
|
+
var sendVerificationEmailRequestSchema = z6.object({
|
|
453
|
+
email: emailSchema
|
|
454
|
+
});
|
|
455
|
+
var verifyEmailRequestSchema = z6.object({
|
|
456
|
+
email: emailSchema.optional(),
|
|
457
|
+
otp: z6.string().min(1)
|
|
458
|
+
}).refine((data) => data.email || data.otp, {
|
|
459
|
+
message: "Either email or otp must be provided"
|
|
460
|
+
});
|
|
461
|
+
var sendResetPasswordEmailRequestSchema = z6.object({
|
|
462
|
+
email: emailSchema
|
|
463
|
+
});
|
|
464
|
+
var exchangeResetPasswordTokenRequestSchema = z6.object({
|
|
465
|
+
email: emailSchema,
|
|
466
|
+
code: z6.string().min(1)
|
|
467
|
+
});
|
|
468
|
+
var resetPasswordRequestSchema = z6.object({
|
|
469
|
+
newPassword: passwordSchema,
|
|
470
|
+
otp: z6.string().min(1, "OTP/token is required")
|
|
471
|
+
});
|
|
431
472
|
var createUserResponseSchema = z6.object({
|
|
473
|
+
user: userSchema.optional(),
|
|
474
|
+
accessToken: z6.string().nullable(),
|
|
475
|
+
requireEmailVerification: z6.boolean().optional(),
|
|
476
|
+
redirectTo: z6.string().url().optional()
|
|
477
|
+
});
|
|
478
|
+
var createSessionResponseSchema = z6.object({
|
|
479
|
+
user: userSchema,
|
|
480
|
+
accessToken: z6.string(),
|
|
481
|
+
redirectTo: z6.string().url().optional()
|
|
482
|
+
});
|
|
483
|
+
var verifyEmailResponseSchema = z6.object({
|
|
432
484
|
user: userSchema,
|
|
433
|
-
accessToken: z6.string()
|
|
485
|
+
accessToken: z6.string(),
|
|
486
|
+
redirectTo: z6.string().url().optional()
|
|
487
|
+
});
|
|
488
|
+
var exchangeResetPasswordTokenResponseSchema = z6.object({
|
|
489
|
+
token: z6.string(),
|
|
490
|
+
expiresAt: z6.string().datetime()
|
|
491
|
+
});
|
|
492
|
+
var resetPasswordResponseSchema = z6.object({
|
|
493
|
+
message: z6.string()
|
|
434
494
|
});
|
|
435
495
|
var getCurrentSessionResponseSchema = z6.object({
|
|
436
496
|
user: z6.object({
|
|
@@ -454,18 +514,39 @@ var deleteUsersResponseSchema = z6.object({
|
|
|
454
514
|
var getOauthUrlResponseSchema = z6.object({
|
|
455
515
|
authUrl: z6.string().url()
|
|
456
516
|
});
|
|
457
|
-
var createOAuthConfigRequestSchema = oAuthConfigSchema.
|
|
517
|
+
var createOAuthConfigRequestSchema = oAuthConfigSchema.omit({
|
|
518
|
+
id: true,
|
|
519
|
+
createdAt: true,
|
|
520
|
+
updatedAt: true
|
|
521
|
+
}).extend({
|
|
458
522
|
clientSecret: z6.string().optional()
|
|
459
523
|
});
|
|
460
|
-
var updateOAuthConfigRequestSchema = oAuthConfigSchema.
|
|
524
|
+
var updateOAuthConfigRequestSchema = oAuthConfigSchema.omit({
|
|
525
|
+
id: true,
|
|
526
|
+
provider: true,
|
|
527
|
+
createdAt: true,
|
|
528
|
+
updatedAt: true
|
|
529
|
+
}).extend({
|
|
461
530
|
clientSecret: z6.string().optional()
|
|
462
|
-
}).
|
|
463
|
-
provider: true
|
|
464
|
-
});
|
|
531
|
+
}).partial();
|
|
465
532
|
var listOAuthConfigsResponseSchema = z6.object({
|
|
466
533
|
data: z6.array(oAuthConfigSchema),
|
|
467
534
|
count: z6.number()
|
|
468
535
|
});
|
|
536
|
+
var updateAuthConfigRequestSchema = authConfigSchema.omit({
|
|
537
|
+
id: true,
|
|
538
|
+
createdAt: true,
|
|
539
|
+
updatedAt: true
|
|
540
|
+
}).partial();
|
|
541
|
+
var getPublicAuthConfigResponseSchema = z6.object({
|
|
542
|
+
oAuthProviders: z6.array(oAuthProvidersSchema),
|
|
543
|
+
...authConfigSchema.omit({
|
|
544
|
+
id: true,
|
|
545
|
+
updatedAt: true,
|
|
546
|
+
createdAt: true,
|
|
547
|
+
signInRedirectTo: true
|
|
548
|
+
}).shape
|
|
549
|
+
});
|
|
469
550
|
var authErrorResponseSchema = z6.object({
|
|
470
551
|
error: z6.string(),
|
|
471
552
|
message: z6.string(),
|
|
@@ -474,268 +555,488 @@ var authErrorResponseSchema = z6.object({
|
|
|
474
555
|
});
|
|
475
556
|
|
|
476
557
|
// node_modules/@insforge/shared-schemas/dist/metadata.schema.js
|
|
558
|
+
import { z as z9 } from "zod";
|
|
559
|
+
|
|
560
|
+
// node_modules/@insforge/shared-schemas/dist/realtime.schema.js
|
|
477
561
|
import { z as z7 } from "zod";
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
562
|
+
var senderTypeSchema = z7.enum(["system", "user"]);
|
|
563
|
+
var realtimeChannelSchema = z7.object({
|
|
564
|
+
id: z7.string().uuid(),
|
|
565
|
+
pattern: z7.string().min(1),
|
|
566
|
+
description: z7.string().nullable(),
|
|
567
|
+
webhookUrls: z7.array(z7.string().url()).nullable(),
|
|
568
|
+
enabled: z7.boolean(),
|
|
569
|
+
createdAt: z7.string().datetime(),
|
|
570
|
+
updatedAt: z7.string().datetime()
|
|
571
|
+
});
|
|
572
|
+
var realtimeMessageSchema = z7.object({
|
|
573
|
+
id: z7.string().uuid(),
|
|
574
|
+
eventName: z7.string().min(1),
|
|
575
|
+
channelId: z7.string().uuid().nullable(),
|
|
576
|
+
channelName: z7.string().min(1),
|
|
577
|
+
payload: z7.record(z7.string(), z7.unknown()),
|
|
578
|
+
senderType: senderTypeSchema,
|
|
579
|
+
senderId: z7.string().uuid().nullable(),
|
|
580
|
+
wsAudienceCount: z7.number().int().min(0),
|
|
581
|
+
whAudienceCount: z7.number().int().min(0),
|
|
582
|
+
whDeliveredCount: z7.number().int().min(0),
|
|
583
|
+
createdAt: z7.string().datetime()
|
|
584
|
+
});
|
|
585
|
+
var subscribeChannelPayloadSchema = z7.object({
|
|
586
|
+
channel: z7.string().min(1)
|
|
587
|
+
// The resolved channel instance, e.g., "order:123"
|
|
588
|
+
});
|
|
589
|
+
var unsubscribeChannelPayloadSchema = z7.object({
|
|
590
|
+
channel: z7.string().min(1)
|
|
591
|
+
// The resolved channel instance, e.g., "order:123"
|
|
592
|
+
});
|
|
593
|
+
var publishEventPayloadSchema = z7.object({
|
|
594
|
+
channel: z7.string().min(1),
|
|
595
|
+
event: z7.string().min(1),
|
|
596
|
+
payload: z7.record(z7.string(), z7.unknown())
|
|
597
|
+
});
|
|
598
|
+
var subscribeResponseSchema = z7.discriminatedUnion("ok", [
|
|
599
|
+
z7.object({
|
|
600
|
+
ok: z7.literal(true),
|
|
601
|
+
channel: z7.string().min(1)
|
|
602
|
+
}),
|
|
603
|
+
z7.object({
|
|
604
|
+
ok: z7.literal(false),
|
|
605
|
+
channel: z7.string().min(1),
|
|
606
|
+
error: z7.object({
|
|
607
|
+
code: z7.string().min(1),
|
|
608
|
+
message: z7.string().min(1)
|
|
609
|
+
})
|
|
610
|
+
})
|
|
611
|
+
]);
|
|
612
|
+
var realtimeErrorPayloadSchema = z7.object({
|
|
613
|
+
channel: z7.string().optional(),
|
|
614
|
+
code: z7.string().min(1),
|
|
615
|
+
message: z7.string().min(1)
|
|
616
|
+
});
|
|
617
|
+
var webhookMessageSchema = z7.object({
|
|
618
|
+
messageId: z7.string().uuid(),
|
|
619
|
+
channel: z7.string().min(1),
|
|
620
|
+
eventName: z7.string().min(1),
|
|
621
|
+
payload: z7.record(z7.string(), z7.unknown())
|
|
622
|
+
});
|
|
623
|
+
var socketMessageMetaSchema = z7.object({
|
|
624
|
+
channel: z7.string().optional(),
|
|
625
|
+
// Present for room broadcasts
|
|
626
|
+
messageId: z7.string().uuid(),
|
|
627
|
+
senderType: senderTypeSchema,
|
|
628
|
+
senderId: z7.string().uuid().optional(),
|
|
629
|
+
timestamp: z7.string().datetime()
|
|
630
|
+
});
|
|
631
|
+
var socketMessageSchema = z7.object({
|
|
632
|
+
meta: socketMessageMetaSchema
|
|
633
|
+
}).passthrough();
|
|
634
|
+
|
|
635
|
+
// node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js
|
|
636
|
+
import { z as z8 } from "zod";
|
|
637
|
+
var createChannelRequestSchema = z8.object({
|
|
638
|
+
pattern: z8.string().min(1, "Channel pattern is required"),
|
|
639
|
+
description: z8.string().optional(),
|
|
640
|
+
webhookUrls: z8.array(z8.string().url()).optional(),
|
|
641
|
+
enabled: z8.boolean().optional().default(true)
|
|
642
|
+
});
|
|
643
|
+
var updateChannelRequestSchema = z8.object({
|
|
644
|
+
pattern: z8.string().min(1).optional(),
|
|
645
|
+
description: z8.string().optional(),
|
|
646
|
+
webhookUrls: z8.array(z8.string().url()).optional(),
|
|
647
|
+
enabled: z8.boolean().optional()
|
|
648
|
+
});
|
|
649
|
+
var listChannelsResponseSchema = z8.array(realtimeChannelSchema);
|
|
650
|
+
var deleteChannelResponseSchema = z8.object({
|
|
651
|
+
message: z8.string()
|
|
652
|
+
});
|
|
653
|
+
var listMessagesRequestSchema = z8.object({
|
|
654
|
+
channelId: z8.string().uuid().optional(),
|
|
655
|
+
eventName: z8.string().optional(),
|
|
656
|
+
limit: z8.coerce.number().int().min(1).max(1e3).optional().default(100),
|
|
657
|
+
offset: z8.coerce.number().int().min(0).optional().default(0)
|
|
658
|
+
});
|
|
659
|
+
var listMessagesResponseSchema = z8.array(realtimeMessageSchema);
|
|
660
|
+
var messageStatsRequestSchema = z8.object({
|
|
661
|
+
channelId: z8.string().uuid().optional(),
|
|
662
|
+
since: z8.coerce.date().optional()
|
|
663
|
+
});
|
|
664
|
+
var messageStatsResponseSchema = z8.object({
|
|
665
|
+
totalMessages: z8.number().int().min(0),
|
|
666
|
+
whDeliveryRate: z8.number().min(0).max(1),
|
|
667
|
+
topEvents: z8.array(z8.object({
|
|
668
|
+
eventName: z8.string(),
|
|
669
|
+
count: z8.number().int().min(0)
|
|
670
|
+
}))
|
|
489
671
|
});
|
|
490
|
-
var
|
|
491
|
-
|
|
672
|
+
var rlsPolicySchema = z8.object({
|
|
673
|
+
policyName: z8.string(),
|
|
674
|
+
tableName: z8.string(),
|
|
675
|
+
command: z8.string(),
|
|
676
|
+
roles: z8.array(z8.string()),
|
|
677
|
+
using: z8.string().nullable(),
|
|
678
|
+
withCheck: z8.string().nullable()
|
|
679
|
+
});
|
|
680
|
+
var realtimePermissionsResponseSchema = z8.object({
|
|
681
|
+
subscribe: z8.object({
|
|
682
|
+
policies: z8.array(rlsPolicySchema)
|
|
683
|
+
}),
|
|
684
|
+
publish: z8.object({
|
|
685
|
+
policies: z8.array(rlsPolicySchema)
|
|
686
|
+
})
|
|
492
687
|
});
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
688
|
+
|
|
689
|
+
// node_modules/@insforge/shared-schemas/dist/metadata.schema.js
|
|
690
|
+
var authMetadataSchema = z9.object({
|
|
691
|
+
oauths: z9.array(oAuthConfigSchema)
|
|
496
692
|
});
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
693
|
+
var databaseMetadataSchema = z9.object({
|
|
694
|
+
tables: z9.array(z9.object({
|
|
695
|
+
tableName: z9.string(),
|
|
696
|
+
recordCount: z9.number()
|
|
697
|
+
})),
|
|
698
|
+
totalSizeInGB: z9.number(),
|
|
699
|
+
hint: z9.string().optional()
|
|
502
700
|
});
|
|
503
|
-
var
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
701
|
+
var bucketMetadataSchema = storageBucketSchema.extend({
|
|
702
|
+
objectCount: z9.number().optional()
|
|
703
|
+
});
|
|
704
|
+
var storageMetadataSchema = z9.object({
|
|
705
|
+
buckets: z9.array(bucketMetadataSchema),
|
|
706
|
+
totalSizeInGB: z9.number()
|
|
707
|
+
});
|
|
708
|
+
var edgeFunctionMetadataSchema = z9.object({
|
|
709
|
+
slug: z9.string(),
|
|
710
|
+
name: z9.string(),
|
|
711
|
+
description: z9.string().nullable(),
|
|
712
|
+
status: z9.string()
|
|
713
|
+
});
|
|
714
|
+
var aiMetadataSchema = z9.object({
|
|
715
|
+
models: z9.array(z9.object({
|
|
716
|
+
inputModality: z9.array(z9.string()),
|
|
717
|
+
outputModality: z9.array(z9.string()),
|
|
718
|
+
modelId: z9.string()
|
|
508
719
|
}))
|
|
509
720
|
});
|
|
510
|
-
var
|
|
721
|
+
var realtimeMetadataSchema = z9.object({
|
|
722
|
+
channels: z9.array(realtimeChannelSchema),
|
|
723
|
+
permissions: realtimePermissionsResponseSchema
|
|
724
|
+
});
|
|
725
|
+
var appMetaDataSchema = z9.object({
|
|
511
726
|
auth: authMetadataSchema,
|
|
512
727
|
database: databaseMetadataSchema,
|
|
513
728
|
storage: storageMetadataSchema,
|
|
514
729
|
aiIntegration: aiMetadataSchema.optional(),
|
|
515
|
-
functions:
|
|
516
|
-
|
|
730
|
+
functions: z9.array(edgeFunctionMetadataSchema),
|
|
731
|
+
realtime: realtimeMetadataSchema.optional(),
|
|
732
|
+
version: z9.string().optional()
|
|
517
733
|
});
|
|
518
734
|
|
|
519
735
|
// node_modules/@insforge/shared-schemas/dist/ai.schema.js
|
|
520
|
-
import { z as
|
|
521
|
-
var modalitySchema =
|
|
522
|
-
var aiConfigurationSchema =
|
|
523
|
-
id:
|
|
524
|
-
inputModality:
|
|
525
|
-
outputModality:
|
|
526
|
-
provider:
|
|
527
|
-
modelId:
|
|
528
|
-
systemPrompt:
|
|
736
|
+
import { z as z10 } from "zod";
|
|
737
|
+
var modalitySchema = z10.enum(["text", "image"]);
|
|
738
|
+
var aiConfigurationSchema = z10.object({
|
|
739
|
+
id: z10.string().uuid(),
|
|
740
|
+
inputModality: z10.array(modalitySchema).min(1),
|
|
741
|
+
outputModality: z10.array(modalitySchema).min(1),
|
|
742
|
+
provider: z10.string(),
|
|
743
|
+
modelId: z10.string(),
|
|
744
|
+
systemPrompt: z10.string().optional()
|
|
529
745
|
});
|
|
530
746
|
var aiConfigurationWithUsageSchema = aiConfigurationSchema.extend({
|
|
531
|
-
usageStats:
|
|
532
|
-
totalInputTokens:
|
|
533
|
-
totalOutputTokens:
|
|
534
|
-
totalTokens:
|
|
535
|
-
totalImageCount:
|
|
536
|
-
totalRequests:
|
|
747
|
+
usageStats: z10.object({
|
|
748
|
+
totalInputTokens: z10.number(),
|
|
749
|
+
totalOutputTokens: z10.number(),
|
|
750
|
+
totalTokens: z10.number(),
|
|
751
|
+
totalImageCount: z10.number(),
|
|
752
|
+
totalRequests: z10.number()
|
|
537
753
|
}).optional()
|
|
538
754
|
});
|
|
539
|
-
var aiUsageDataSchema =
|
|
540
|
-
configId:
|
|
541
|
-
inputTokens:
|
|
542
|
-
outputTokens:
|
|
543
|
-
imageCount:
|
|
544
|
-
imageResolution:
|
|
755
|
+
var aiUsageDataSchema = z10.object({
|
|
756
|
+
configId: z10.string().uuid(),
|
|
757
|
+
inputTokens: z10.number().int().optional(),
|
|
758
|
+
outputTokens: z10.number().int().optional(),
|
|
759
|
+
imageCount: z10.number().int().optional(),
|
|
760
|
+
imageResolution: z10.string().optional()
|
|
545
761
|
});
|
|
546
762
|
var aiUsageRecordSchema = aiUsageDataSchema.extend({
|
|
547
|
-
id:
|
|
548
|
-
createdAt:
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
763
|
+
id: z10.string().uuid(),
|
|
764
|
+
createdAt: z10.date(),
|
|
765
|
+
modelId: z10.string().nullable().optional(),
|
|
766
|
+
model: z10.string().nullable(),
|
|
767
|
+
provider: z10.string().nullable(),
|
|
768
|
+
inputModality: z10.array(modalitySchema).nullable(),
|
|
769
|
+
outputModality: z10.array(modalitySchema).nullable()
|
|
770
|
+
});
|
|
771
|
+
var aiUsageSummarySchema = z10.object({
|
|
772
|
+
totalInputTokens: z10.number(),
|
|
773
|
+
totalOutputTokens: z10.number(),
|
|
774
|
+
totalTokens: z10.number(),
|
|
775
|
+
totalImageCount: z10.number(),
|
|
776
|
+
totalRequests: z10.number()
|
|
556
777
|
});
|
|
557
778
|
|
|
558
779
|
// node_modules/@insforge/shared-schemas/dist/ai-api.schema.js
|
|
559
|
-
import { z as
|
|
560
|
-
var
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
780
|
+
import { z as z11 } from "zod";
|
|
781
|
+
var textContentSchema = z11.object({
|
|
782
|
+
type: z11.literal("text"),
|
|
783
|
+
text: z11.string()
|
|
784
|
+
});
|
|
785
|
+
var imageContentSchema = z11.object({
|
|
786
|
+
type: z11.literal("image_url"),
|
|
787
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
788
|
+
image_url: z11.object({
|
|
789
|
+
// URL can be either a public URL or base64-encoded data URI
|
|
790
|
+
// Examples:
|
|
791
|
+
// - Public URL: "https://example.com/image.jpg"
|
|
792
|
+
// - Base64: "data:image/jpeg;base64,/9j/4AAQ..."
|
|
793
|
+
url: z11.string(),
|
|
794
|
+
detail: z11.enum(["auto", "low", "high"]).optional()
|
|
795
|
+
})
|
|
566
796
|
});
|
|
567
|
-
var
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
});
|
|
575
|
-
var
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
797
|
+
var contentSchema = z11.union([textContentSchema, imageContentSchema]);
|
|
798
|
+
var chatMessageSchema = z11.object({
|
|
799
|
+
role: z11.enum(["user", "assistant", "system"]),
|
|
800
|
+
// New format: content can be string or array of content parts (OpenAI-compatible)
|
|
801
|
+
content: z11.union([z11.string(), z11.array(contentSchema)]),
|
|
802
|
+
// Legacy format: separate images field (deprecated but supported for backward compatibility)
|
|
803
|
+
images: z11.array(z11.object({ url: z11.string() })).optional()
|
|
804
|
+
});
|
|
805
|
+
var chatCompletionRequestSchema = z11.object({
|
|
806
|
+
model: z11.string(),
|
|
807
|
+
messages: z11.array(chatMessageSchema),
|
|
808
|
+
temperature: z11.number().min(0).max(2).optional(),
|
|
809
|
+
maxTokens: z11.number().positive().optional(),
|
|
810
|
+
topP: z11.number().min(0).max(1).optional(),
|
|
811
|
+
stream: z11.boolean().optional()
|
|
812
|
+
});
|
|
813
|
+
var chatCompletionResponseSchema = z11.object({
|
|
814
|
+
text: z11.string(),
|
|
815
|
+
metadata: z11.object({
|
|
816
|
+
model: z11.string(),
|
|
817
|
+
usage: z11.object({
|
|
818
|
+
promptTokens: z11.number().optional(),
|
|
819
|
+
completionTokens: z11.number().optional(),
|
|
820
|
+
totalTokens: z11.number().optional()
|
|
583
821
|
}).optional()
|
|
584
822
|
}).optional()
|
|
585
823
|
});
|
|
586
|
-
var imageGenerationRequestSchema =
|
|
587
|
-
model:
|
|
588
|
-
prompt:
|
|
589
|
-
images:
|
|
590
|
-
url:
|
|
824
|
+
var imageGenerationRequestSchema = z11.object({
|
|
825
|
+
model: z11.string(),
|
|
826
|
+
prompt: z11.string(),
|
|
827
|
+
images: z11.array(z11.object({
|
|
828
|
+
url: z11.string()
|
|
591
829
|
})).optional()
|
|
592
830
|
});
|
|
593
|
-
var imageGenerationResponseSchema =
|
|
594
|
-
text:
|
|
595
|
-
images:
|
|
596
|
-
type:
|
|
597
|
-
imageUrl:
|
|
831
|
+
var imageGenerationResponseSchema = z11.object({
|
|
832
|
+
text: z11.string().optional(),
|
|
833
|
+
images: z11.array(z11.object({
|
|
834
|
+
type: z11.literal("imageUrl"),
|
|
835
|
+
imageUrl: z11.string()
|
|
598
836
|
})),
|
|
599
|
-
metadata:
|
|
600
|
-
model:
|
|
601
|
-
usage:
|
|
602
|
-
promptTokens:
|
|
603
|
-
completionTokens:
|
|
604
|
-
totalTokens:
|
|
837
|
+
metadata: z11.object({
|
|
838
|
+
model: z11.string(),
|
|
839
|
+
usage: z11.object({
|
|
840
|
+
promptTokens: z11.number().optional(),
|
|
841
|
+
completionTokens: z11.number().optional(),
|
|
842
|
+
totalTokens: z11.number().optional()
|
|
605
843
|
}).optional()
|
|
606
844
|
}).optional()
|
|
607
845
|
});
|
|
608
|
-
var aiModelSchema =
|
|
609
|
-
id:
|
|
610
|
-
inputModality:
|
|
611
|
-
outputModality:
|
|
612
|
-
provider:
|
|
613
|
-
modelId:
|
|
614
|
-
priceLevel:
|
|
846
|
+
var aiModelSchema = z11.object({
|
|
847
|
+
id: z11.string(),
|
|
848
|
+
inputModality: z11.array(modalitySchema).min(1),
|
|
849
|
+
outputModality: z11.array(modalitySchema).min(1),
|
|
850
|
+
provider: z11.string(),
|
|
851
|
+
modelId: z11.string(),
|
|
852
|
+
priceLevel: z11.number().min(0).max(3).optional()
|
|
615
853
|
});
|
|
616
854
|
var createAIConfigurationRequestSchema = aiConfigurationSchema.omit({
|
|
617
855
|
id: true
|
|
618
856
|
});
|
|
619
|
-
var updateAIConfigurationRequestSchema =
|
|
620
|
-
systemPrompt:
|
|
857
|
+
var updateAIConfigurationRequestSchema = z11.object({
|
|
858
|
+
systemPrompt: z11.string().nullable()
|
|
621
859
|
});
|
|
622
|
-
var listAIUsageResponseSchema =
|
|
623
|
-
records:
|
|
624
|
-
total:
|
|
860
|
+
var listAIUsageResponseSchema = z11.object({
|
|
861
|
+
records: z11.array(aiUsageRecordSchema),
|
|
862
|
+
total: z11.number()
|
|
625
863
|
});
|
|
626
|
-
var getAIUsageRequestSchema =
|
|
627
|
-
startDate:
|
|
628
|
-
endDate:
|
|
629
|
-
limit:
|
|
630
|
-
offset:
|
|
864
|
+
var getAIUsageRequestSchema = z11.object({
|
|
865
|
+
startDate: z11.string().datetime().optional(),
|
|
866
|
+
endDate: z11.string().datetime().optional(),
|
|
867
|
+
limit: z11.string().regex(/^\d+$/).default("50"),
|
|
868
|
+
offset: z11.string().regex(/^\d+$/).default("0")
|
|
631
869
|
});
|
|
632
|
-
var getAIUsageSummaryRequestSchema =
|
|
633
|
-
configId:
|
|
634
|
-
startDate:
|
|
635
|
-
endDate:
|
|
870
|
+
var getAIUsageSummaryRequestSchema = z11.object({
|
|
871
|
+
configId: z11.string().uuid().optional(),
|
|
872
|
+
startDate: z11.string().datetime().optional(),
|
|
873
|
+
endDate: z11.string().datetime().optional()
|
|
636
874
|
});
|
|
637
875
|
|
|
638
876
|
// node_modules/@insforge/shared-schemas/dist/logs.schema.js
|
|
639
|
-
import { z as
|
|
640
|
-
var auditLogSchema =
|
|
641
|
-
id:
|
|
642
|
-
actor:
|
|
643
|
-
action:
|
|
644
|
-
module:
|
|
645
|
-
details:
|
|
646
|
-
ipAddress:
|
|
647
|
-
createdAt:
|
|
648
|
-
updatedAt:
|
|
649
|
-
});
|
|
650
|
-
var logSourceSchema =
|
|
651
|
-
id:
|
|
652
|
-
name:
|
|
653
|
-
token:
|
|
654
|
-
});
|
|
655
|
-
var logSchema =
|
|
656
|
-
id:
|
|
657
|
-
eventMessage:
|
|
658
|
-
timestamp:
|
|
659
|
-
body:
|
|
660
|
-
source:
|
|
661
|
-
});
|
|
662
|
-
var logStatsSchema =
|
|
663
|
-
source:
|
|
664
|
-
count:
|
|
665
|
-
lastActivity:
|
|
877
|
+
import { z as z12 } from "zod";
|
|
878
|
+
var auditLogSchema = z12.object({
|
|
879
|
+
id: z12.string(),
|
|
880
|
+
actor: z12.string(),
|
|
881
|
+
action: z12.string(),
|
|
882
|
+
module: z12.string(),
|
|
883
|
+
details: z12.record(z12.unknown()).nullable(),
|
|
884
|
+
ipAddress: z12.string().nullable(),
|
|
885
|
+
createdAt: z12.string(),
|
|
886
|
+
updatedAt: z12.string()
|
|
887
|
+
});
|
|
888
|
+
var logSourceSchema = z12.object({
|
|
889
|
+
id: z12.string(),
|
|
890
|
+
name: z12.string(),
|
|
891
|
+
token: z12.string()
|
|
892
|
+
});
|
|
893
|
+
var logSchema = z12.object({
|
|
894
|
+
id: z12.string(),
|
|
895
|
+
eventMessage: z12.string(),
|
|
896
|
+
timestamp: z12.string(),
|
|
897
|
+
body: z12.record(z12.string(), z12.unknown()),
|
|
898
|
+
source: z12.string().optional()
|
|
899
|
+
});
|
|
900
|
+
var logStatsSchema = z12.object({
|
|
901
|
+
source: z12.string(),
|
|
902
|
+
count: z12.number(),
|
|
903
|
+
lastActivity: z12.string()
|
|
666
904
|
});
|
|
667
905
|
|
|
668
906
|
// node_modules/@insforge/shared-schemas/dist/logs-api.schema.js
|
|
669
|
-
import { z as
|
|
670
|
-
var getAuditLogsRequestSchema =
|
|
671
|
-
limit:
|
|
672
|
-
offset:
|
|
673
|
-
actor:
|
|
674
|
-
action:
|
|
675
|
-
module:
|
|
676
|
-
startDate:
|
|
677
|
-
endDate:
|
|
678
|
-
});
|
|
679
|
-
var getAuditLogsResponseSchema =
|
|
680
|
-
data:
|
|
681
|
-
pagination:
|
|
682
|
-
limit:
|
|
683
|
-
offset:
|
|
684
|
-
total:
|
|
907
|
+
import { z as z13 } from "zod";
|
|
908
|
+
var getAuditLogsRequestSchema = z13.object({
|
|
909
|
+
limit: z13.number().default(100),
|
|
910
|
+
offset: z13.number().default(0),
|
|
911
|
+
actor: z13.string().optional(),
|
|
912
|
+
action: z13.string().optional(),
|
|
913
|
+
module: z13.string().optional(),
|
|
914
|
+
startDate: z13.string().optional(),
|
|
915
|
+
endDate: z13.string().optional()
|
|
916
|
+
});
|
|
917
|
+
var getAuditLogsResponseSchema = z13.object({
|
|
918
|
+
data: z13.array(auditLogSchema),
|
|
919
|
+
pagination: z13.object({
|
|
920
|
+
limit: z13.number(),
|
|
921
|
+
offset: z13.number(),
|
|
922
|
+
total: z13.number()
|
|
685
923
|
})
|
|
686
924
|
});
|
|
687
|
-
var getAuditLogStatsRequestSchema =
|
|
688
|
-
days:
|
|
925
|
+
var getAuditLogStatsRequestSchema = z13.object({
|
|
926
|
+
days: z13.number().default(7)
|
|
689
927
|
});
|
|
690
|
-
var getAuditLogStatsResponseSchema =
|
|
691
|
-
totalLogs:
|
|
692
|
-
uniqueActors:
|
|
693
|
-
uniqueModules:
|
|
694
|
-
actionsByModule:
|
|
695
|
-
recentActivity:
|
|
928
|
+
var getAuditLogStatsResponseSchema = z13.object({
|
|
929
|
+
totalLogs: z13.number(),
|
|
930
|
+
uniqueActors: z13.number(),
|
|
931
|
+
uniqueModules: z13.number(),
|
|
932
|
+
actionsByModule: z13.record(z13.number()),
|
|
933
|
+
recentActivity: z13.array(auditLogSchema)
|
|
696
934
|
});
|
|
697
|
-
var clearAuditLogsRequestSchema =
|
|
698
|
-
daysToKeep:
|
|
935
|
+
var clearAuditLogsRequestSchema = z13.object({
|
|
936
|
+
daysToKeep: z13.number().default(90)
|
|
699
937
|
});
|
|
700
|
-
var clearAuditLogsResponseSchema =
|
|
701
|
-
message:
|
|
702
|
-
deleted:
|
|
938
|
+
var clearAuditLogsResponseSchema = z13.object({
|
|
939
|
+
message: z13.string(),
|
|
940
|
+
deleted: z13.number()
|
|
703
941
|
});
|
|
704
|
-
var getLogsResponseSchema =
|
|
705
|
-
logs:
|
|
706
|
-
total:
|
|
942
|
+
var getLogsResponseSchema = z13.object({
|
|
943
|
+
logs: z13.array(logSchema),
|
|
944
|
+
total: z13.number()
|
|
707
945
|
});
|
|
708
946
|
|
|
709
947
|
// node_modules/@insforge/shared-schemas/dist/functions.schema.js
|
|
710
|
-
import { z as
|
|
711
|
-
var functionSchema =
|
|
712
|
-
id:
|
|
713
|
-
slug:
|
|
714
|
-
name:
|
|
715
|
-
description:
|
|
716
|
-
code:
|
|
717
|
-
status:
|
|
718
|
-
createdAt:
|
|
719
|
-
updatedAt:
|
|
720
|
-
deployedAt:
|
|
948
|
+
import { z as z14 } from "zod";
|
|
949
|
+
var functionSchema = z14.object({
|
|
950
|
+
id: z14.string(),
|
|
951
|
+
slug: z14.string(),
|
|
952
|
+
name: z14.string(),
|
|
953
|
+
description: z14.string().nullable(),
|
|
954
|
+
code: z14.string(),
|
|
955
|
+
status: z14.enum(["draft", "active"]),
|
|
956
|
+
createdAt: z14.string(),
|
|
957
|
+
updatedAt: z14.string(),
|
|
958
|
+
deployedAt: z14.string().nullable()
|
|
721
959
|
});
|
|
722
960
|
|
|
723
961
|
// node_modules/@insforge/shared-schemas/dist/functions-api.schema.js
|
|
724
|
-
import { z as
|
|
725
|
-
var functionUploadRequestSchema =
|
|
726
|
-
name:
|
|
727
|
-
slug:
|
|
728
|
-
code:
|
|
729
|
-
description:
|
|
730
|
-
status:
|
|
731
|
-
});
|
|
732
|
-
var functionUpdateRequestSchema =
|
|
733
|
-
name:
|
|
734
|
-
code:
|
|
735
|
-
description:
|
|
736
|
-
status:
|
|
962
|
+
import { z as z15 } from "zod";
|
|
963
|
+
var functionUploadRequestSchema = z15.object({
|
|
964
|
+
name: z15.string().min(1, "Name is required"),
|
|
965
|
+
slug: z15.string().regex(/^[a-zA-Z0-9_-]+$/, "Invalid slug format - must be alphanumeric with hyphens or underscores only").optional(),
|
|
966
|
+
code: z15.string().min(1),
|
|
967
|
+
description: z15.string().optional(),
|
|
968
|
+
status: z15.enum(["draft", "active"]).optional().default("active")
|
|
969
|
+
});
|
|
970
|
+
var functionUpdateRequestSchema = z15.object({
|
|
971
|
+
name: z15.string().optional(),
|
|
972
|
+
code: z15.string().optional(),
|
|
973
|
+
description: z15.string().optional(),
|
|
974
|
+
status: z15.enum(["draft", "active"]).optional()
|
|
737
975
|
});
|
|
738
976
|
|
|
977
|
+
// node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js
|
|
978
|
+
import { z as z16 } from "zod";
|
|
979
|
+
var appRouteChangeEventSchema = z16.object({
|
|
980
|
+
type: z16.literal("APP_ROUTE_CHANGE"),
|
|
981
|
+
path: z16.string()
|
|
982
|
+
});
|
|
983
|
+
var authSuccessEventSchema = z16.object({
|
|
984
|
+
type: z16.literal("AUTH_SUCCESS")
|
|
985
|
+
});
|
|
986
|
+
var authErrorEventSchema = z16.object({
|
|
987
|
+
type: z16.literal("AUTH_ERROR"),
|
|
988
|
+
message: z16.string()
|
|
989
|
+
});
|
|
990
|
+
var mcpConnectionStatusEventSchema = z16.object({
|
|
991
|
+
type: z16.literal("MCP_CONNECTION_STATUS"),
|
|
992
|
+
connected: z16.boolean(),
|
|
993
|
+
toolName: z16.string(),
|
|
994
|
+
timestamp: z16.union([z16.number(), z16.string()])
|
|
995
|
+
});
|
|
996
|
+
var showOnboardingOverlayEventSchema = z16.object({
|
|
997
|
+
type: z16.literal("SHOW_ONBOARDING_OVERLAY")
|
|
998
|
+
});
|
|
999
|
+
var showSettingsOverlayEventSchema = z16.object({
|
|
1000
|
+
type: z16.literal("SHOW_SETTINGS_OVERLAY")
|
|
1001
|
+
});
|
|
1002
|
+
var onboardingSuccessSchema = z16.object({
|
|
1003
|
+
type: z16.literal("ONBOARDING_SUCCESS")
|
|
1004
|
+
});
|
|
1005
|
+
var navigateToUsageSchema = z16.object({
|
|
1006
|
+
type: z16.literal("NAVIGATE_TO_USAGE")
|
|
1007
|
+
});
|
|
1008
|
+
var cloudEventSchema = z16.discriminatedUnion("type", [
|
|
1009
|
+
appRouteChangeEventSchema,
|
|
1010
|
+
authSuccessEventSchema,
|
|
1011
|
+
authErrorEventSchema,
|
|
1012
|
+
mcpConnectionStatusEventSchema,
|
|
1013
|
+
showOnboardingOverlayEventSchema,
|
|
1014
|
+
showSettingsOverlayEventSchema,
|
|
1015
|
+
onboardingSuccessSchema,
|
|
1016
|
+
navigateToUsageSchema
|
|
1017
|
+
]);
|
|
1018
|
+
|
|
1019
|
+
// node_modules/@insforge/shared-schemas/dist/docs.schema.js
|
|
1020
|
+
import { z as z17 } from "zod";
|
|
1021
|
+
var docTypeSchema = z17.enum([
|
|
1022
|
+
"instructions",
|
|
1023
|
+
"db-sdk",
|
|
1024
|
+
"storage-sdk",
|
|
1025
|
+
"functions-sdk",
|
|
1026
|
+
"ai-integration-sdk",
|
|
1027
|
+
"auth-components-react",
|
|
1028
|
+
"real-time"
|
|
1029
|
+
]).describe(`
|
|
1030
|
+
Documentation type:
|
|
1031
|
+
"instructions" (essential backend setup - use FIRST),
|
|
1032
|
+
"db-sdk" (database operations),
|
|
1033
|
+
"storage-sdk" (file storage),
|
|
1034
|
+
"functions-sdk" (edge functions),
|
|
1035
|
+
"auth-components-react" (authentication components for React+Vite applications),
|
|
1036
|
+
"ai-integration-sdk" (AI features),
|
|
1037
|
+
"real-time" (real-time pub/sub through WebSockets)
|
|
1038
|
+
`);
|
|
1039
|
+
|
|
739
1040
|
// src/shared/tools.ts
|
|
740
1041
|
import FormData from "form-data";
|
|
741
1042
|
var execAsync = promisify(exec);
|
|
@@ -890,9 +1191,7 @@ ${context}`
|
|
|
890
1191
|
"fetch-docs",
|
|
891
1192
|
'Fetch Insforge documentation. Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.',
|
|
892
1193
|
{
|
|
893
|
-
docType:
|
|
894
|
-
'Documentation type: "instructions" (essential backend setup - use FIRST), "db-sdk" (database operations), "storage-sdk" (file storage), "functions-sdk" (edge functions), "ai-integration-sdk" (AI features), "auth-components-react" (authentication components for React+Vite applications).'
|
|
895
|
-
)
|
|
1194
|
+
docType: docTypeSchema
|
|
896
1195
|
},
|
|
897
1196
|
withUsageTracking("fetch-docs", async ({ docType }) => {
|
|
898
1197
|
try {
|
|
@@ -925,7 +1224,7 @@ ${context}`
|
|
|
925
1224
|
"get-anon-key",
|
|
926
1225
|
"Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
|
|
927
1226
|
{
|
|
928
|
-
apiKey:
|
|
1227
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)")
|
|
929
1228
|
},
|
|
930
1229
|
withUsageTracking("get-anon-key", async ({ apiKey }) => {
|
|
931
1230
|
try {
|
|
@@ -964,8 +1263,8 @@ ${context}`
|
|
|
964
1263
|
"get-table-schema",
|
|
965
1264
|
"Returns the detailed schema(including RLS, indexes, constraints, etc.) of a specific table",
|
|
966
1265
|
{
|
|
967
|
-
apiKey:
|
|
968
|
-
tableName:
|
|
1266
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1267
|
+
tableName: z18.string().describe("Name of the table")
|
|
969
1268
|
},
|
|
970
1269
|
withUsageTracking("get-table-schema", async ({ apiKey, tableName }) => {
|
|
971
1270
|
try {
|
|
@@ -1003,7 +1302,7 @@ ${context}`
|
|
|
1003
1302
|
"get-backend-metadata",
|
|
1004
1303
|
"Index all backend metadata",
|
|
1005
1304
|
{
|
|
1006
|
-
apiKey:
|
|
1305
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)")
|
|
1007
1306
|
},
|
|
1008
1307
|
withUsageTracking("get-backend-metadata", async ({ apiKey }) => {
|
|
1009
1308
|
try {
|
|
@@ -1043,7 +1342,7 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1043
1342
|
"run-raw-sql",
|
|
1044
1343
|
"Execute raw SQL query with optional parameters. Admin access required. Use with caution as it can modify data directly.",
|
|
1045
1344
|
{
|
|
1046
|
-
apiKey:
|
|
1345
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1047
1346
|
...rawSQLRequestSchema.shape
|
|
1048
1347
|
},
|
|
1049
1348
|
withUsageTracking("run-raw-sql", async ({ apiKey, query, params }) => {
|
|
@@ -1088,8 +1387,8 @@ ${JSON.stringify(metadata, null, 2)}`
|
|
|
1088
1387
|
"download-template",
|
|
1089
1388
|
"CRITICAL: MANDATORY FIRST STEP for all new InsForge projects. Download pre-configured starter template (React) to a temporary directory. After download, you MUST copy files to current directory using the provided command.",
|
|
1090
1389
|
{
|
|
1091
|
-
frame:
|
|
1092
|
-
projectName:
|
|
1390
|
+
frame: z18.enum(["react"]).describe("Framework to use for the template (currently only React is supported)"),
|
|
1391
|
+
projectName: z18.string().optional().describe('Name for the project directory (optional, defaults to "insforge-react")')
|
|
1093
1392
|
},
|
|
1094
1393
|
withUsageTracking("download-template", async ({ frame, projectName }) => {
|
|
1095
1394
|
try {
|
|
@@ -1164,9 +1463,9 @@ To: Your current project directory
|
|
|
1164
1463
|
"bulk-upsert",
|
|
1165
1464
|
"Bulk insert or update data from CSV or JSON file. Supports upsert operations with a unique key.",
|
|
1166
1465
|
{
|
|
1167
|
-
apiKey:
|
|
1466
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1168
1467
|
...bulkUpsertRequestSchema.shape,
|
|
1169
|
-
filePath:
|
|
1468
|
+
filePath: z18.string().describe("Path to CSV or JSON file containing data to import")
|
|
1170
1469
|
},
|
|
1171
1470
|
withUsageTracking("bulk-upsert", async ({ apiKey, table, filePath, upsertKey }) => {
|
|
1172
1471
|
try {
|
|
@@ -1221,7 +1520,7 @@ To: Your current project directory
|
|
|
1221
1520
|
"create-bucket",
|
|
1222
1521
|
"Create new storage bucket",
|
|
1223
1522
|
{
|
|
1224
|
-
apiKey:
|
|
1523
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1225
1524
|
...createBucketRequestSchema.shape
|
|
1226
1525
|
},
|
|
1227
1526
|
withUsageTracking("create-bucket", async ({ apiKey, bucketName, isPublic }) => {
|
|
@@ -1297,8 +1596,8 @@ To: Your current project directory
|
|
|
1297
1596
|
"delete-bucket",
|
|
1298
1597
|
"Deletes a storage bucket",
|
|
1299
1598
|
{
|
|
1300
|
-
apiKey:
|
|
1301
|
-
bucketName:
|
|
1599
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1600
|
+
bucketName: z18.string().describe("Name of the bucket to delete")
|
|
1302
1601
|
},
|
|
1303
1602
|
withUsageTracking("delete-bucket", async ({ apiKey, bucketName }) => {
|
|
1304
1603
|
try {
|
|
@@ -1337,7 +1636,7 @@ To: Your current project directory
|
|
|
1337
1636
|
"Create a new edge function that runs in Deno runtime. The code must be written to a file first for version control",
|
|
1338
1637
|
{
|
|
1339
1638
|
...functionUploadRequestSchema.omit({ code: true }).shape,
|
|
1340
|
-
codeFile:
|
|
1639
|
+
codeFile: z18.string().describe(
|
|
1341
1640
|
"Path to JavaScript file containing the function code. Must export: module.exports = async function(request) { return new Response(...) }"
|
|
1342
1641
|
)
|
|
1343
1642
|
},
|
|
@@ -1395,7 +1694,7 @@ To: Your current project directory
|
|
|
1395
1694
|
"get-function",
|
|
1396
1695
|
"Get details of a specific edge function including its code",
|
|
1397
1696
|
{
|
|
1398
|
-
slug:
|
|
1697
|
+
slug: z18.string().describe("The slug identifier of the function")
|
|
1399
1698
|
},
|
|
1400
1699
|
withUsageTracking("get-function", async (args) => {
|
|
1401
1700
|
try {
|
|
@@ -1432,9 +1731,9 @@ To: Your current project directory
|
|
|
1432
1731
|
"update-function",
|
|
1433
1732
|
"Update an existing edge function code or metadata",
|
|
1434
1733
|
{
|
|
1435
|
-
slug:
|
|
1734
|
+
slug: z18.string().describe("The slug identifier of the function to update"),
|
|
1436
1735
|
...functionUpdateRequestSchema.omit({ code: true }).shape,
|
|
1437
|
-
codeFile:
|
|
1736
|
+
codeFile: z18.string().optional().describe(
|
|
1438
1737
|
"Path to JavaScript file containing the new function code. Must export: module.exports = async function(request) { return new Response(...) }"
|
|
1439
1738
|
)
|
|
1440
1739
|
},
|
|
@@ -1498,7 +1797,7 @@ To: Your current project directory
|
|
|
1498
1797
|
"delete-function",
|
|
1499
1798
|
"Delete an edge function permanently",
|
|
1500
1799
|
{
|
|
1501
|
-
slug:
|
|
1800
|
+
slug: z18.string().describe("The slug identifier of the function to delete")
|
|
1502
1801
|
},
|
|
1503
1802
|
withUsageTracking("delete-function", async (args) => {
|
|
1504
1803
|
try {
|
|
@@ -1535,9 +1834,9 @@ To: Your current project directory
|
|
|
1535
1834
|
"get-container-logs",
|
|
1536
1835
|
"Get latest logs from a specific container/service. Use this to help debug problems with your app.",
|
|
1537
1836
|
{
|
|
1538
|
-
apiKey:
|
|
1539
|
-
source:
|
|
1540
|
-
limit:
|
|
1837
|
+
apiKey: z18.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
1838
|
+
source: z18.enum(["insforge.logs", "postgREST.logs", "postgres.logs", "function.logs"]).describe("Log source to retrieve"),
|
|
1839
|
+
limit: z18.number().optional().default(20).describe("Number of logs to return (default: 20)")
|
|
1541
1840
|
},
|
|
1542
1841
|
withUsageTracking("get-container-logs", async ({ apiKey, source, limit }) => {
|
|
1543
1842
|
try {
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-dev.2",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
|
|
5
5
|
"mcpName": "io.github.InsForge/insforge-mcp",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"server.json"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@insforge/shared-schemas": "^1.1.
|
|
39
|
+
"@insforge/shared-schemas": "^1.1.28",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
41
41
|
"@types/express": "^5.0.3",
|
|
42
42
|
"commander": "^14.0.0",
|
package/LICENSE.md
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Support. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2024 Insforge
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|