@langwatch/server 3.1.0-beta.4 → 3.1.0-beta.6
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/langwatch/ee/admin/ImpersonationBanner.tsx +61 -0
- package/langwatch/ee/admin/ImpersonationSwitchBackMenuItem.tsx +30 -0
- package/langwatch/ee/admin/__tests__/ImpersonationBanner.integration.test.tsx +82 -0
- package/langwatch/ee/admin/__tests__/impersonation.service.unit.test.ts +231 -0
- package/langwatch/ee/admin/backoffice/BackofficeTable.tsx +200 -0
- package/langwatch/ee/admin/backoffice/__tests__/adminClient.unit.test.ts +147 -0
- package/langwatch/ee/admin/backoffice/__tests__/dateInputToISO.unit.test.ts +42 -0
- package/langwatch/ee/admin/backoffice/__tests__/userVisibility.unit.test.ts +174 -0
- package/langwatch/ee/admin/backoffice/adminClient.ts +114 -0
- package/langwatch/ee/admin/backoffice/resources/OrganizationFeaturesView.tsx +373 -0
- package/langwatch/ee/admin/backoffice/resources/OrganizationsView.tsx +677 -0
- package/langwatch/ee/admin/backoffice/resources/ProjectsView.tsx +647 -0
- package/langwatch/ee/admin/backoffice/resources/SubscriptionsView.tsx +628 -0
- package/langwatch/ee/admin/backoffice/resources/UsersView.tsx +556 -0
- package/langwatch/ee/admin/backoffice/useAdminResource.ts +104 -0
- package/langwatch/ee/admin/backoffice/userVisibility.ts +105 -0
- package/langwatch/ee/admin/impersonation.service.ts +170 -0
- package/langwatch/ee/admin/isAdmin.ts +9 -0
- package/langwatch/ee/admin/routes/admin.ts +531 -0
- package/langwatch/ee/admin/safeSelects.ts +64 -0
- package/langwatch/ee/billing/__tests__/customerService.unit.test.ts +183 -0
- package/langwatch/ee/billing/__tests__/growthSeatEvent.unit.test.ts +213 -0
- package/langwatch/ee/billing/__tests__/licensePurchaseHandler.unit.test.ts +250 -0
- package/langwatch/ee/billing/__tests__/notification.service.unit.test.ts +768 -0
- package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +19 -0
- package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +440 -0
- package/langwatch/ee/billing/__tests__/planTypes.unit.test.ts +32 -0
- package/langwatch/ee/billing/__tests__/pricing.unit.test.ts +54 -0
- package/langwatch/ee/billing/__tests__/seatEventSubscription.unit.test.ts +717 -0
- package/langwatch/ee/billing/__tests__/stripe.integration.test.ts +344 -0
- package/langwatch/ee/billing/__tests__/stripePrices.types.unit.test.ts +27 -0
- package/langwatch/ee/billing/__tests__/stripePricesLoader.unit.test.ts +72 -0
- package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +730 -0
- package/langwatch/ee/billing/__tests__/subscriptionItemCalculator.unit.test.ts +176 -0
- package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +706 -0
- package/langwatch/ee/billing/__tests__/usageReportingService.integration.test.ts +421 -0
- package/langwatch/ee/billing/__tests__/usageReportingService.unit.test.ts +515 -0
- package/langwatch/ee/billing/__tests__/webhookService.unit.test.ts +958 -0
- package/langwatch/ee/billing/currencyRouter.ts +18 -0
- package/langwatch/ee/billing/errors.ts +129 -0
- package/langwatch/ee/billing/index.ts +67 -0
- package/langwatch/ee/billing/middleware.ts +17 -0
- package/langwatch/ee/billing/notifications/notification.service.ts +651 -0
- package/langwatch/ee/billing/notifications/repositories/notification.repository.ts +51 -0
- package/langwatch/ee/billing/notifications/types.ts +9 -0
- package/langwatch/ee/billing/notifications/usage-limit.service.ts +622 -0
- package/langwatch/ee/billing/nurturing/hooks/activityTracking.ts +90 -0
- package/langwatch/ee/billing/nurturing/hooks/activityTracking.unit.test.ts +237 -0
- package/langwatch/ee/billing/nurturing/hooks/featureAdoption.ts +120 -0
- package/langwatch/ee/billing/nurturing/hooks/featureAdoption.unit.test.ts +324 -0
- package/langwatch/ee/billing/nurturing/hooks/index.ts +17 -0
- package/langwatch/ee/billing/nurturing/hooks/productInterest.ts +68 -0
- package/langwatch/ee/billing/nurturing/hooks/productInterest.unit.test.ts +138 -0
- package/langwatch/ee/billing/nurturing/hooks/promptCreation.integration.test.ts +288 -0
- package/langwatch/ee/billing/nurturing/hooks/promptCreation.ts +131 -0
- package/langwatch/ee/billing/nurturing/hooks/promptCreation.unit.test.ts +134 -0
- package/langwatch/ee/billing/nurturing/hooks/signupIdentification.ts +101 -0
- package/langwatch/ee/billing/nurturing/hooks/signupIdentification.unit.test.ts +317 -0
- package/langwatch/ee/billing/nurturing/hooks/subscriptionSync.ts +49 -0
- package/langwatch/ee/billing/nurturing/hooks/subscriptionSync.unit.test.ts +170 -0
- package/langwatch/ee/billing/nurturing/hooks/userSync.ts +143 -0
- package/langwatch/ee/billing/nurturing/hooks/userSync.unit.test.ts +307 -0
- package/langwatch/ee/billing/nurturing/nurturing.service.ts +179 -0
- package/langwatch/ee/billing/nurturing/nurturing.service.unit.test.ts +266 -0
- package/langwatch/ee/billing/nurturing/nurturing.service.wiring.unit.test.ts +109 -0
- package/langwatch/ee/billing/nurturing/types.ts +125 -0
- package/langwatch/ee/billing/planLimits.ts +190 -0
- package/langwatch/ee/billing/planProvider.ts +119 -0
- package/langwatch/ee/billing/planTypes.ts +53 -0
- package/langwatch/ee/billing/pricing.ts +57 -0
- package/langwatch/ee/billing/services/billableEventsQuery.ts +248 -0
- package/langwatch/ee/billing/services/customerService.ts +90 -0
- package/langwatch/ee/billing/services/licensePurchaseHandler.ts +73 -0
- package/langwatch/ee/billing/services/seatEventSubscription.ts +351 -0
- package/langwatch/ee/billing/services/seatSyncService.ts +34 -0
- package/langwatch/ee/billing/services/subscription.repository.ts +203 -0
- package/langwatch/ee/billing/services/subscription.service.ts +549 -0
- package/langwatch/ee/billing/services/subscriptionItemCalculator.ts +249 -0
- package/langwatch/ee/billing/services/usageReportingService.ts +301 -0
- package/langwatch/ee/billing/services/webhookService.ts +858 -0
- package/langwatch/ee/billing/stripe/stripeCatalog.json +1781 -0
- package/langwatch/ee/billing/stripe/stripeClient.ts +13 -0
- package/langwatch/ee/billing/stripe/stripePriceCatalog.ts +70 -0
- package/langwatch/ee/billing/stripe/stripePrices.types.ts +118 -0
- package/langwatch/ee/billing/subscriptionRouter.ts +202 -0
- package/langwatch/ee/billing/types.ts +102 -0
- package/langwatch/ee/billing/utils/currency.ts +99 -0
- package/langwatch/ee/billing/utils/growthSeatEvent.ts +137 -0
- package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +56 -0
- package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +192 -0
- package/langwatch/ee/licensing/__tests__/fixtures/testKeys.ts +86 -0
- package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +92 -0
- package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +232 -0
- package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +419 -0
- package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +195 -0
- package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +193 -0
- package/langwatch/ee/licensing/__tests__/signing.unit.test.ts +164 -0
- package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +281 -0
- package/langwatch/ee/licensing/client.ts +29 -0
- package/langwatch/ee/licensing/constants.ts +195 -0
- package/langwatch/ee/licensing/defaults.ts +55 -0
- package/langwatch/ee/licensing/errors.ts +11 -0
- package/langwatch/ee/licensing/index.ts +52 -0
- package/langwatch/ee/licensing/licenseGenerationService.ts +87 -0
- package/langwatch/ee/licensing/licenseHandler.ts +308 -0
- package/langwatch/ee/licensing/planInfo.ts +46 -0
- package/langwatch/ee/licensing/planMapping.ts +37 -0
- package/langwatch/ee/licensing/planTemplates.ts +109 -0
- package/langwatch/ee/licensing/server.ts +43 -0
- package/langwatch/ee/licensing/signing.ts +43 -0
- package/langwatch/ee/licensing/types.ts +156 -0
- package/langwatch/ee/licensing/validation.ts +107 -0
- package/langwatch/ee/managed-providers/ManagedModelProviderAlert.tsx +29 -0
- package/langwatch/ee/managed-providers/managedBedrockConfig.ts +226 -0
- package/langwatch/ee/saas/ExtraFooterComponents.tsx +169 -0
- package/langwatch/package.json +1 -1
- package/langwatch/pnpm-workspace.yaml +0 -1
- package/mcp-server/.env.example +2 -0
- package/mcp-server/.eslintrc.cjs +36 -0
- package/mcp-server/CHANGELOG.md +165 -0
- package/mcp-server/CONTRIBUTING.md +96 -0
- package/mcp-server/README.md +172 -0
- package/mcp-server/dist/archive-scenario-WJ2A7ETN.js +19 -0
- package/mcp-server/dist/archive-suite-4JOM4SSL.js +15 -0
- package/mcp-server/dist/assign-prompt-tag-GL7EAAF3.js +19 -0
- package/mcp-server/dist/chunk-2GT7IFWK.js +40 -0
- package/mcp-server/dist/chunk-2WPLXEKF.js +127 -0
- package/mcp-server/dist/chunk-4AUB2BIA.js +71 -0
- package/mcp-server/dist/chunk-BWWY5KEF.js +71 -0
- package/mcp-server/dist/chunk-CCWCIJJ3.js +22 -0
- package/mcp-server/dist/chunk-EGH5RPXM.js +25 -0
- package/mcp-server/dist/chunk-EUQDVOSU.js +39 -0
- package/mcp-server/dist/chunk-HYMIWO3U.js +44 -0
- package/mcp-server/dist/chunk-IE4M5OGE.js +42 -0
- package/mcp-server/dist/chunk-LUMEZEHL.js +48 -0
- package/mcp-server/dist/chunk-NUFPTHKU.js +9 -0
- package/mcp-server/dist/chunk-UDHJYT6P.js +1567 -0
- package/mcp-server/dist/chunk-WQG2DFHX.js +86 -0
- package/mcp-server/dist/chunk-WVI5CJ6S.js +21 -0
- package/mcp-server/dist/chunk-ZVS4UKN2.js +35 -0
- package/mcp-server/dist/chunk-ZXKLPC2E.js +27 -0
- package/mcp-server/dist/config.d.ts +17 -0
- package/mcp-server/dist/config.js +13 -0
- package/mcp-server/dist/create-agent-MBOOT3XK.js +23 -0
- package/mcp-server/dist/create-annotation-XMV6A7ED.js +24 -0
- package/mcp-server/dist/create-dashboard-VRKLFVZJ.js +18 -0
- package/mcp-server/dist/create-dataset-7HQPZCRE.js +22 -0
- package/mcp-server/dist/create-dataset-records-2NIVFYTV.js +22 -0
- package/mcp-server/dist/create-evaluator-WYFRFLRC.js +27 -0
- package/mcp-server/dist/create-mcp-server.d.ts +8 -0
- package/mcp-server/dist/create-mcp-server.js +8 -0
- package/mcp-server/dist/create-prompt-IEN7O6JT.js +39 -0
- package/mcp-server/dist/create-prompt-tag-CAEZ45VO.js +17 -0
- package/mcp-server/dist/create-scenario-6YHSMGLP.js +26 -0
- package/mcp-server/dist/create-suite-H5XOFDE5.js +38 -0
- package/mcp-server/dist/delete-agent-JKTNBWAA.js +18 -0
- package/mcp-server/dist/delete-annotation-ACMDV6QO.js +17 -0
- package/mcp-server/dist/delete-dashboard-VJSR7CRU.js +18 -0
- package/mcp-server/dist/delete-dataset-RTTTWP4D.js +20 -0
- package/mcp-server/dist/delete-dataset-records-KNQTIPQK.js +21 -0
- package/mcp-server/dist/delete-evaluator-7FVC5WM4.js +15 -0
- package/mcp-server/dist/delete-prompt-tag-ZMZUAGFW.js +17 -0
- package/mcp-server/dist/delete-workflow-EYQ3T4RQ.js +17 -0
- package/mcp-server/dist/discover-evaluator-schema-H23XCLNE.js +1402 -0
- package/mcp-server/dist/discover-scenario-schema-MEEEVND7.js +65 -0
- package/mcp-server/dist/discover-schema-3T52ORPB.js +446 -0
- package/mcp-server/dist/get-agent-E3QSTVKG.js +28 -0
- package/mcp-server/dist/get-analytics-2OHV763I.js +72 -0
- package/mcp-server/dist/get-dashboard-PC7JDHH6.js +29 -0
- package/mcp-server/dist/get-dataset-H5IK5FVU.js +48 -0
- package/mcp-server/dist/get-evaluator-UWVUPYTM.js +47 -0
- package/mcp-server/dist/get-prompt-WZUOLLQC.js +45 -0
- package/mcp-server/dist/get-scenario-Q6LCNUYN.js +33 -0
- package/mcp-server/dist/get-simulation-run-Z2XKO256.js +56 -0
- package/mcp-server/dist/get-suite-BXK5TN7P.js +44 -0
- package/mcp-server/dist/get-trace-4EJAYVBG.js +50 -0
- package/mcp-server/dist/get-workflow-O34QJLHD.js +25 -0
- package/mcp-server/dist/http-server-RSTXN4CN.js +224 -0
- package/mcp-server/dist/index.d.ts +2 -0
- package/mcp-server/dist/index.js +67774 -0
- package/mcp-server/dist/langwatch-api-annotations-ERBG27RF.js +17 -0
- package/mcp-server/dist/langwatch-api-dashboards-G6TR7VVO.js +17 -0
- package/mcp-server/dist/langwatch-api-monitors-WSXZLS2B.js +52 -0
- package/mcp-server/dist/langwatch-api-secrets-RR5DKG2X.js +40 -0
- package/mcp-server/dist/langwatch-api-triggers-2RTNSWQY.js +30 -0
- package/mcp-server/dist/langwatch-api-workflows-VJRIIDZ7.js +15 -0
- package/mcp-server/dist/list-agents-AW3P6FJV.js +32 -0
- package/mcp-server/dist/list-annotations-QNCGWPQ3.js +33 -0
- package/mcp-server/dist/list-dashboards-R7RK2IXL.js +32 -0
- package/mcp-server/dist/list-dataset-records-WVCSQP7P.js +39 -0
- package/mcp-server/dist/list-datasets-KEXRLDEU.js +60 -0
- package/mcp-server/dist/list-evaluators-7R2LB4JH.js +34 -0
- package/mcp-server/dist/list-model-providers-OBYJCKBX.js +35 -0
- package/mcp-server/dist/list-prompt-tags-6LY3ZPYI.js +23 -0
- package/mcp-server/dist/list-prompts-VWEZ4CDE.js +32 -0
- package/mcp-server/dist/list-scenarios-TXD4W2ZJ.js +40 -0
- package/mcp-server/dist/list-simulation-runs-RHPOLMFI.js +43 -0
- package/mcp-server/dist/list-suites-FSGBX27Z.js +42 -0
- package/mcp-server/dist/list-workflows-VRGEZ3EN.js +35 -0
- package/mcp-server/dist/rename-prompt-tag-VOJJLX4M.js +18 -0
- package/mcp-server/dist/run-agent-KTCC7TB7.js +36 -0
- package/mcp-server/dist/run-evaluation-2X3V3Q6L.js +64 -0
- package/mcp-server/dist/run-suite-BTMHGI2D.js +29 -0
- package/mcp-server/dist/run-workflow-IGAYGKJL.js +36 -0
- package/mcp-server/dist/search-traces-VYFUIMXH.js +72 -0
- package/mcp-server/dist/set-model-provider-W5IUI326.js +33 -0
- package/mcp-server/dist/update-agent-4BB7EYLR.js +20 -0
- package/mcp-server/dist/update-dataset-CXBKZ4W3.js +22 -0
- package/mcp-server/dist/update-dataset-record-HOHAMHXG.js +19 -0
- package/mcp-server/dist/update-evaluator-IVOR6FTR.js +24 -0
- package/mcp-server/dist/update-prompt-OWQAKE7K.js +24 -0
- package/mcp-server/dist/update-scenario-GDFVILPN.js +27 -0
- package/mcp-server/dist/update-suite-BXYUYSPT.js +39 -0
- package/mcp-server/package.json +79 -0
- package/mcp-server/pnpm-lock.yaml +6103 -0
- package/mcp-server/pnpm-workspace.yaml +2 -0
- package/mcp-server/pyproject.toml +17 -0
- package/mcp-server/src/__tests__/all-tools.integration.test.ts +1681 -0
- package/mcp-server/src/__tests__/config.unit.test.ts +169 -0
- package/mcp-server/src/__tests__/datasets.integration.test.ts +603 -0
- package/mcp-server/src/__tests__/datasets.unit.test.ts +240 -0
- package/mcp-server/src/__tests__/date-parsing.unit.test.ts +78 -0
- package/mcp-server/src/__tests__/discover-evaluator-schema.unit.test.ts +89 -0
- package/mcp-server/src/__tests__/discover-schema.unit.test.ts +118 -0
- package/mcp-server/src/__tests__/docker.integration.test.ts +234 -0
- package/mcp-server/src/__tests__/evaluator-tools.unit.test.ts +262 -0
- package/mcp-server/src/__tests__/http-transport.integration.test.ts +397 -0
- package/mcp-server/src/__tests__/integration.integration.test.ts +288 -0
- package/mcp-server/src/__tests__/langwatch-api.unit.test.ts +455 -0
- package/mcp-server/src/__tests__/model-provider-tools.unit.test.ts +190 -0
- package/mcp-server/src/__tests__/scenario-tools.integration.test.ts +286 -0
- package/mcp-server/src/__tests__/scenario-tools.unit.test.ts +185 -0
- package/mcp-server/src/__tests__/schemas.unit.test.ts +85 -0
- package/mcp-server/src/__tests__/tools.unit.test.ts +900 -0
- package/mcp-server/src/config.d.ts +15 -0
- package/mcp-server/src/config.ts +107 -0
- package/mcp-server/src/create-mcp-server.d.ts +6 -0
- package/mcp-server/src/create-mcp-server.ts +1799 -0
- package/mcp-server/src/http-server.ts +329 -0
- package/mcp-server/src/index.ts +46 -0
- package/mcp-server/src/langwatch-api-agents.ts +108 -0
- package/mcp-server/src/langwatch-api-annotations.ts +49 -0
- package/mcp-server/src/langwatch-api-dashboards.ts +48 -0
- package/mcp-server/src/langwatch-api-datasets.ts +191 -0
- package/mcp-server/src/langwatch-api-evaluators.ts +80 -0
- package/mcp-server/src/langwatch-api-model-providers.ts +41 -0
- package/mcp-server/src/langwatch-api-monitors.ts +82 -0
- package/mcp-server/src/langwatch-api-scenarios.ts +67 -0
- package/mcp-server/src/langwatch-api-secrets.ts +48 -0
- package/mcp-server/src/langwatch-api-simulation-runs.ts +51 -0
- package/mcp-server/src/langwatch-api-suites.ts +118 -0
- package/mcp-server/src/langwatch-api-triggers.ts +48 -0
- package/mcp-server/src/langwatch-api-workflows.ts +41 -0
- package/mcp-server/src/langwatch-api.ts +299 -0
- package/mcp-server/src/schemas/analytics-groups.ts +78 -0
- package/mcp-server/src/schemas/analytics-metrics.ts +179 -0
- package/mcp-server/src/schemas/create-dataset.ts +48 -0
- package/mcp-server/src/schemas/filter-fields.ts +119 -0
- package/mcp-server/src/schemas/index.ts +4 -0
- package/mcp-server/src/tools/archive-scenario.ts +19 -0
- package/mcp-server/src/tools/archive-suite.ts +12 -0
- package/mcp-server/src/tools/assign-prompt-tag.ts +16 -0
- package/mcp-server/src/tools/create-agent.ts +15 -0
- package/mcp-server/src/tools/create-annotation.ts +18 -0
- package/mcp-server/src/tools/create-dashboard.ts +7 -0
- package/mcp-server/src/tools/create-dataset-records.ts +23 -0
- package/mcp-server/src/tools/create-dataset.ts +22 -0
- package/mcp-server/src/tools/create-evaluator.ts +33 -0
- package/mcp-server/src/tools/create-prompt-tag.ts +12 -0
- package/mcp-server/src/tools/create-prompt.ts +58 -0
- package/mcp-server/src/tools/create-scenario.ts +30 -0
- package/mcp-server/src/tools/create-suite.ts +42 -0
- package/mcp-server/src/tools/delete-agent.ts +7 -0
- package/mcp-server/src/tools/delete-annotation.ts +7 -0
- package/mcp-server/src/tools/delete-dashboard.ts +7 -0
- package/mcp-server/src/tools/delete-dataset-records.ts +22 -0
- package/mcp-server/src/tools/delete-dataset.ts +20 -0
- package/mcp-server/src/tools/delete-evaluator.ts +12 -0
- package/mcp-server/src/tools/delete-prompt-tag.ts +12 -0
- package/mcp-server/src/tools/delete-workflow.ts +7 -0
- package/mcp-server/src/tools/discover-evaluator-schema.ts +143 -0
- package/mcp-server/src/tools/discover-scenario-schema.ts +71 -0
- package/mcp-server/src/tools/discover-schema.ts +106 -0
- package/mcp-server/src/tools/format-dataset-mutation.ts +25 -0
- package/mcp-server/src/tools/get-agent.ts +21 -0
- package/mcp-server/src/tools/get-analytics.ts +98 -0
- package/mcp-server/src/tools/get-dashboard.ts +22 -0
- package/mcp-server/src/tools/get-dataset.ts +63 -0
- package/mcp-server/src/tools/get-evaluator.ts +53 -0
- package/mcp-server/src/tools/get-prompt.ts +54 -0
- package/mcp-server/src/tools/get-scenario.ts +36 -0
- package/mcp-server/src/tools/get-simulation-run.ts +60 -0
- package/mcp-server/src/tools/get-suite.ts +47 -0
- package/mcp-server/src/tools/get-trace.ts +61 -0
- package/mcp-server/src/tools/get-workflow.ts +17 -0
- package/mcp-server/src/tools/list-agents.ts +27 -0
- package/mcp-server/src/tools/list-annotations.ts +33 -0
- package/mcp-server/src/tools/list-dashboards.ts +27 -0
- package/mcp-server/src/tools/list-dataset-records.ts +46 -0
- package/mcp-server/src/tools/list-datasets.ts +80 -0
- package/mcp-server/src/tools/list-evaluators.ts +37 -0
- package/mcp-server/src/tools/list-model-providers.ts +40 -0
- package/mcp-server/src/tools/list-prompt-tags.ts +21 -0
- package/mcp-server/src/tools/list-prompts.ts +34 -0
- package/mcp-server/src/tools/list-scenarios.ts +47 -0
- package/mcp-server/src/tools/list-simulation-runs.ts +49 -0
- package/mcp-server/src/tools/list-suites.ts +43 -0
- package/mcp-server/src/tools/list-workflows.ts +31 -0
- package/mcp-server/src/tools/rename-prompt-tag.ts +14 -0
- package/mcp-server/src/tools/run-agent.ts +36 -0
- package/mcp-server/src/tools/run-evaluation.ts +87 -0
- package/mcp-server/src/tools/run-suite.ts +28 -0
- package/mcp-server/src/tools/run-workflow.ts +36 -0
- package/mcp-server/src/tools/search-traces.ts +91 -0
- package/mcp-server/src/tools/set-model-provider.ts +46 -0
- package/mcp-server/src/tools/update-agent.ts +13 -0
- package/mcp-server/src/tools/update-dataset-record.ts +21 -0
- package/mcp-server/src/tools/update-dataset.ts +23 -0
- package/mcp-server/src/tools/update-evaluator.ts +30 -0
- package/mcp-server/src/tools/update-prompt.ts +31 -0
- package/mcp-server/src/tools/update-scenario.ts +32 -0
- package/mcp-server/src/tools/update-suite.ts +44 -0
- package/mcp-server/src/utils/date-parsing.ts +31 -0
- package/mcp-server/src/utils/escape-markdown.ts +12 -0
- package/mcp-server/tsconfig.json +27 -0
- package/mcp-server/uv.lock +2731 -0
- package/package.json +2 -1
- package/packages/server/dist/cli.cjs +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renamePromptTag
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/rename-prompt-tag.ts
|
|
7
|
+
async function handleRenamePromptTag(params) {
|
|
8
|
+
await renamePromptTag({ tag: params.tag, name: params.name });
|
|
9
|
+
const lines = [];
|
|
10
|
+
lines.push("Tag renamed successfully!\n");
|
|
11
|
+
lines.push(`**Old name**: ${params.tag}`);
|
|
12
|
+
lines.push(`**New name**: ${params.name}`);
|
|
13
|
+
return lines.join("\n");
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
handleRenamePromptTag
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=rename-prompt-tag-VOJJLX4M.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAgent
|
|
3
|
+
} from "./chunk-4AUB2BIA.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-agent.ts
|
|
8
|
+
async function handleRunAgent(params) {
|
|
9
|
+
let parsedInput = {};
|
|
10
|
+
if (params.input) {
|
|
11
|
+
try {
|
|
12
|
+
parsedInput = JSON.parse(params.input);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `input` must be a valid JSON object.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const { agentType, result } = await runAgent(params.id, parsedInput);
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`Agent executed successfully (type: ${agentType}).
|
|
20
|
+
`);
|
|
21
|
+
if (typeof result === "object" && result !== null) {
|
|
22
|
+
const output = result.output;
|
|
23
|
+
if (output !== void 0) {
|
|
24
|
+
lines.push("**Output:**");
|
|
25
|
+
lines.push(typeof output === "string" ? output : JSON.stringify(output, null, 2));
|
|
26
|
+
} else {
|
|
27
|
+
lines.push("**Result:**");
|
|
28
|
+
lines.push(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
handleRunAgent
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=run-agent-KTCC7TB7.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRequest
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/run-evaluation.ts
|
|
7
|
+
async function handleRunEvaluation(params) {
|
|
8
|
+
const result = await makeRequest(
|
|
9
|
+
"POST",
|
|
10
|
+
`/api/evaluations/v3/${encodeURIComponent(params.slug)}/run`
|
|
11
|
+
);
|
|
12
|
+
const lines = [];
|
|
13
|
+
lines.push(`Evaluation started!
|
|
14
|
+
`);
|
|
15
|
+
lines.push(`**Run ID**: ${result.runId}`);
|
|
16
|
+
lines.push(`**Status**: ${result.status}`);
|
|
17
|
+
lines.push(`**Total cells**: ${result.total}`);
|
|
18
|
+
if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);
|
|
19
|
+
lines.push("");
|
|
20
|
+
lines.push(
|
|
21
|
+
`> Use \`platform_evaluation_status\` with run ID "${result.runId}" to check progress.`
|
|
22
|
+
);
|
|
23
|
+
return lines.join("\n");
|
|
24
|
+
}
|
|
25
|
+
async function handleEvaluationStatus(params) {
|
|
26
|
+
const status = await makeRequest(
|
|
27
|
+
"GET",
|
|
28
|
+
`/api/evaluations/v3/runs/${encodeURIComponent(params.runId)}`
|
|
29
|
+
);
|
|
30
|
+
const lines = [];
|
|
31
|
+
lines.push(`# Evaluation Run ${status.runId}
|
|
32
|
+
`);
|
|
33
|
+
lines.push(`**Status**: ${status.status}`);
|
|
34
|
+
lines.push(`**Progress**: ${status.progress}/${status.total} cells`);
|
|
35
|
+
if (status.startedAt) {
|
|
36
|
+
lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);
|
|
37
|
+
}
|
|
38
|
+
if (status.finishedAt) {
|
|
39
|
+
lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);
|
|
40
|
+
}
|
|
41
|
+
if (status.summary) {
|
|
42
|
+
lines.push("\n## Summary\n");
|
|
43
|
+
if (status.summary.completedCells !== void 0) {
|
|
44
|
+
lines.push(`**Completed**: ${status.summary.completedCells}`);
|
|
45
|
+
}
|
|
46
|
+
if (status.summary.failedCells) {
|
|
47
|
+
lines.push(`**Failed**: ${status.summary.failedCells}`);
|
|
48
|
+
}
|
|
49
|
+
if (status.summary.duration) {
|
|
50
|
+
lines.push(
|
|
51
|
+
`**Duration**: ${(status.summary.duration / 1e3).toFixed(1)}s`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (status.summary.runUrl) {
|
|
55
|
+
lines.push(`**View results**: ${status.summary.runUrl}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
handleEvaluationStatus,
|
|
62
|
+
handleRunEvaluation
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=run-evaluation-2X3V3Q6L.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runSuite
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-suite.ts
|
|
8
|
+
async function handleRunSuite(params) {
|
|
9
|
+
const result = await runSuite(params.id);
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push(`Suite run scheduled successfully.`);
|
|
12
|
+
lines.push("");
|
|
13
|
+
lines.push(`**Batch Run ID**: ${result.batchRunId}`);
|
|
14
|
+
lines.push(`**Jobs**: ${result.jobCount}`);
|
|
15
|
+
lines.push(`**Set ID**: ${result.setId}`);
|
|
16
|
+
if (result.skippedArchived.scenarios.length > 0) {
|
|
17
|
+
lines.push(`
|
|
18
|
+
\u26A0\uFE0F Skipped archived scenarios: ${result.skippedArchived.scenarios.join(", ")}`);
|
|
19
|
+
}
|
|
20
|
+
if (result.skippedArchived.targets.length > 0) {
|
|
21
|
+
lines.push(`\u26A0\uFE0F Skipped archived targets: ${result.skippedArchived.targets.join(", ")}`);
|
|
22
|
+
}
|
|
23
|
+
lines.push("\nView results in the LangWatch dashboard under Simulations.");
|
|
24
|
+
return lines.join("\n");
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
handleRunSuite
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=run-suite-BTMHGI2D.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runWorkflow
|
|
3
|
+
} from "./chunk-ZVS4UKN2.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/run-workflow.ts
|
|
8
|
+
async function handleRunWorkflow(params) {
|
|
9
|
+
let parsedInput = {};
|
|
10
|
+
if (params.input) {
|
|
11
|
+
try {
|
|
12
|
+
parsedInput = JSON.parse(params.input);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `input` must be a valid JSON object.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const result = await runWorkflow(params.id, parsedInput);
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`Workflow "${params.id}" executed successfully.
|
|
20
|
+
`);
|
|
21
|
+
if (typeof result === "object" && result !== null) {
|
|
22
|
+
const output = result.output;
|
|
23
|
+
if (output !== void 0) {
|
|
24
|
+
lines.push("**Output:**");
|
|
25
|
+
lines.push(typeof output === "string" ? output : JSON.stringify(output, null, 2));
|
|
26
|
+
} else {
|
|
27
|
+
lines.push("**Result:**");
|
|
28
|
+
lines.push(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n");
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
handleRunWorkflow
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=run-workflow-IGAYGKJL.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseRelativeDate
|
|
3
|
+
} from "./chunk-ZXKLPC2E.js";
|
|
4
|
+
import {
|
|
5
|
+
searchTraces
|
|
6
|
+
} from "./chunk-2WPLXEKF.js";
|
|
7
|
+
import "./chunk-BWWY5KEF.js";
|
|
8
|
+
|
|
9
|
+
// src/tools/search-traces.ts
|
|
10
|
+
async function handleSearchTraces(params) {
|
|
11
|
+
const now = Date.now();
|
|
12
|
+
const startDate = params.startDate ? parseRelativeDate(params.startDate) : now - 864e5;
|
|
13
|
+
const endDate = params.endDate ? parseRelativeDate(params.endDate) : now;
|
|
14
|
+
const format = params.format ?? "digest";
|
|
15
|
+
const result = await searchTraces({
|
|
16
|
+
query: params.query,
|
|
17
|
+
filters: params.filters,
|
|
18
|
+
startDate,
|
|
19
|
+
endDate,
|
|
20
|
+
pageSize: params.pageSize ?? 25,
|
|
21
|
+
scrollId: params.scrollId,
|
|
22
|
+
format
|
|
23
|
+
});
|
|
24
|
+
const traces = result.traces ?? [];
|
|
25
|
+
if (traces.length === 0) {
|
|
26
|
+
return "No traces found matching your query.";
|
|
27
|
+
}
|
|
28
|
+
if (format === "json") {
|
|
29
|
+
return JSON.stringify(result, null, 2);
|
|
30
|
+
}
|
|
31
|
+
const lines = [];
|
|
32
|
+
lines.push(
|
|
33
|
+
`Found ${result.pagination?.totalHits ?? traces.length} traces:
|
|
34
|
+
`
|
|
35
|
+
);
|
|
36
|
+
for (const trace of traces) {
|
|
37
|
+
lines.push(`### Trace: ${trace.trace_id}`);
|
|
38
|
+
if (trace.formatted_trace) {
|
|
39
|
+
lines.push(trace.formatted_trace);
|
|
40
|
+
} else {
|
|
41
|
+
const inputStr = trace.input?.value ? String(trace.input.value) : "N/A";
|
|
42
|
+
const outputStr = trace.output?.value ? String(trace.output.value) : "N/A";
|
|
43
|
+
lines.push(
|
|
44
|
+
`- **Input**: ${inputStr.slice(0, 100)}${inputStr.length > 100 ? "..." : ""}`
|
|
45
|
+
);
|
|
46
|
+
lines.push(
|
|
47
|
+
`- **Output**: ${outputStr.slice(0, 100)}${outputStr.length > 100 ? "..." : ""}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
if (trace.timestamps) {
|
|
51
|
+
lines.push(`- **Time**: ${trace.timestamps.started_at || "N/A"}`);
|
|
52
|
+
}
|
|
53
|
+
if (trace.error) {
|
|
54
|
+
lines.push(`- **Error**: ${JSON.stringify(trace.error)}`);
|
|
55
|
+
}
|
|
56
|
+
lines.push("");
|
|
57
|
+
}
|
|
58
|
+
if (result.pagination?.scrollId) {
|
|
59
|
+
lines.push(
|
|
60
|
+
`
|
|
61
|
+
**More results available.** Use scrollId: "${result.pagination.scrollId}" to get next page.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
lines.push(
|
|
65
|
+
'\n> Tip: Use `get_trace` with a trace_id for full details. Use `search_traces` with `format: "json"` for raw data. Use `discover_schema` to see available filter fields.'
|
|
66
|
+
);
|
|
67
|
+
return lines.join("\n");
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
handleSearchTraces
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=search-traces-VYFUIMXH.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setModelProvider
|
|
3
|
+
} from "./chunk-CCWCIJJ3.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/set-model-provider.ts
|
|
8
|
+
async function handleSetModelProvider(params) {
|
|
9
|
+
const providers = await setModelProvider(params);
|
|
10
|
+
const updated = providers[params.provider];
|
|
11
|
+
if (!updated) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Model provider "${params.provider}" was not found in the response. The provider name may be invalid.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
const lines = [];
|
|
17
|
+
lines.push("Model provider updated successfully!\n");
|
|
18
|
+
lines.push(`**Provider**: ${params.provider}`);
|
|
19
|
+
lines.push(`**Status**: ${updated?.enabled ? "enabled" : "disabled"}`);
|
|
20
|
+
if (updated?.customKeys) {
|
|
21
|
+
const keyFields = Object.entries(updated.customKeys).map(([k, v]) => `${k}: ${v ? "set" : "not set"}`).join(", ");
|
|
22
|
+
lines.push(`**Keys**: ${keyFields}`);
|
|
23
|
+
}
|
|
24
|
+
if (params.defaultModel) {
|
|
25
|
+
const normalizedModel = params.defaultModel.includes("/") ? params.defaultModel : `${params.provider}/${params.defaultModel}`;
|
|
26
|
+
lines.push(`**Default Model**: ${normalizedModel}`);
|
|
27
|
+
}
|
|
28
|
+
return lines.join("\n");
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
handleSetModelProvider
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=set-model-provider-W5IUI326.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateAgent
|
|
3
|
+
} from "./chunk-4AUB2BIA.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-agent.ts
|
|
8
|
+
async function handleUpdateAgent(params) {
|
|
9
|
+
const { id, ...data } = params;
|
|
10
|
+
const agent = await updateAgent({ id, ...data });
|
|
11
|
+
return `Agent updated successfully!
|
|
12
|
+
|
|
13
|
+
**Name**: ${agent.name}
|
|
14
|
+
**ID**: ${agent.id}
|
|
15
|
+
**Type**: ${agent.type}`;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
handleUpdateAgent
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=update-agent-4BB7EYLR.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDatasetMutationDetails
|
|
3
|
+
} from "./chunk-WVI5CJ6S.js";
|
|
4
|
+
import "./chunk-NUFPTHKU.js";
|
|
5
|
+
import {
|
|
6
|
+
updateDataset
|
|
7
|
+
} from "./chunk-WQG2DFHX.js";
|
|
8
|
+
import "./chunk-2WPLXEKF.js";
|
|
9
|
+
import "./chunk-BWWY5KEF.js";
|
|
10
|
+
|
|
11
|
+
// src/tools/update-dataset.ts
|
|
12
|
+
async function handleUpdateDataset(params) {
|
|
13
|
+
const result = await updateDataset(params);
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push("Dataset updated successfully!\n");
|
|
16
|
+
lines.push(...formatDatasetMutationDetails(result));
|
|
17
|
+
return lines.join("\n");
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
handleUpdateDataset
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=update-dataset-CXBKZ4W3.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateDatasetRecord
|
|
3
|
+
} from "./chunk-WQG2DFHX.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-dataset-record.ts
|
|
8
|
+
async function handleUpdateDatasetRecord(params) {
|
|
9
|
+
const result = await updateDatasetRecord(params);
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push("Record updated successfully!\n");
|
|
12
|
+
lines.push(`**Record ID**: ${result.id}`);
|
|
13
|
+
lines.push(`**Entry**: ${JSON.stringify(result.entry)}`);
|
|
14
|
+
return lines.join("\n");
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
handleUpdateDatasetRecord
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=update-dataset-record-HOHAMHXG.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEvaluatorType,
|
|
3
|
+
updateEvaluator
|
|
4
|
+
} from "./chunk-HYMIWO3U.js";
|
|
5
|
+
import "./chunk-2WPLXEKF.js";
|
|
6
|
+
import "./chunk-BWWY5KEF.js";
|
|
7
|
+
|
|
8
|
+
// src/tools/update-evaluator.ts
|
|
9
|
+
async function handleUpdateEvaluator(params) {
|
|
10
|
+
const { evaluatorId, ...data } = params;
|
|
11
|
+
const result = await updateEvaluator({ id: evaluatorId, ...data });
|
|
12
|
+
const evaluatorType = getEvaluatorType(result);
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push("Evaluator updated successfully!\n");
|
|
15
|
+
lines.push(`**ID**: ${result.id}`);
|
|
16
|
+
if (result.slug) lines.push(`**Slug**: ${result.slug}`);
|
|
17
|
+
lines.push(`**Name**: ${result.name}`);
|
|
18
|
+
if (evaluatorType) lines.push(`**Evaluator Type**: ${evaluatorType}`);
|
|
19
|
+
return lines.join("\n");
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
handleUpdateEvaluator
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=update-evaluator-IVOR6FTR.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updatePrompt
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/update-prompt.ts
|
|
7
|
+
async function handleUpdatePrompt(params) {
|
|
8
|
+
const { idOrHandle, ...data } = params;
|
|
9
|
+
const result = await updatePrompt(idOrHandle, data);
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push("Prompt updated successfully!\n");
|
|
12
|
+
if (result.id) lines.push(`**ID**: ${result.id}`);
|
|
13
|
+
if (result.handle) lines.push(`**Handle**: ${result.handle}`);
|
|
14
|
+
if (result.latestVersionNumber != null)
|
|
15
|
+
lines.push(`**Version**: v${result.latestVersionNumber}`);
|
|
16
|
+
lines.push(`**Commit**: ${params.commitMessage}`);
|
|
17
|
+
if (params.tags && params.tags.length > 0)
|
|
18
|
+
lines.push(`**Tags**: ${params.tags.join(", ")}`);
|
|
19
|
+
return lines.join("\n");
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
handleUpdatePrompt
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=update-prompt-OWQAKE7K.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateScenario
|
|
3
|
+
} from "./chunk-2GT7IFWK.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-scenario.ts
|
|
8
|
+
async function handleUpdateScenario(params) {
|
|
9
|
+
const { scenarioId, ...data } = params;
|
|
10
|
+
const result = await updateScenario({ id: scenarioId, ...data });
|
|
11
|
+
const lines = [];
|
|
12
|
+
lines.push("Scenario updated successfully!\n");
|
|
13
|
+
lines.push(`**ID**: ${result.id}`);
|
|
14
|
+
lines.push(`**Name**: ${result.name}`);
|
|
15
|
+
if (result.situation) lines.push(`**Situation**: ${result.situation}`);
|
|
16
|
+
if (Array.isArray(result.criteria) && result.criteria.length > 0) {
|
|
17
|
+
lines.push(`**Criteria**: ${result.criteria.length} criteria`);
|
|
18
|
+
}
|
|
19
|
+
if (Array.isArray(result.labels) && result.labels.length > 0) {
|
|
20
|
+
lines.push(`**Labels**: ${result.labels.join(", ")}`);
|
|
21
|
+
}
|
|
22
|
+
return lines.join("\n");
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
handleUpdateScenario
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=update-scenario-GDFVILPN.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
updateSuite
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/update-suite.ts
|
|
8
|
+
async function handleUpdateSuite(params) {
|
|
9
|
+
let parsedTargets;
|
|
10
|
+
if (params.targets) {
|
|
11
|
+
try {
|
|
12
|
+
parsedTargets = JSON.parse(params.targets);
|
|
13
|
+
} catch {
|
|
14
|
+
return "Error: `targets` must be a valid JSON array.";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const suite = await updateSuite({
|
|
18
|
+
id: params.id,
|
|
19
|
+
name: params.name,
|
|
20
|
+
description: params.description,
|
|
21
|
+
scenarioIds: params.scenarioIds,
|
|
22
|
+
targets: parsedTargets,
|
|
23
|
+
repeatCount: params.repeatCount,
|
|
24
|
+
labels: params.labels
|
|
25
|
+
});
|
|
26
|
+
return [
|
|
27
|
+
`Suite "${suite.name}" updated successfully.`,
|
|
28
|
+
"",
|
|
29
|
+
`**ID**: ${suite.id}`,
|
|
30
|
+
`**Slug**: ${suite.slug}`,
|
|
31
|
+
`**Scenarios**: ${suite.scenarioIds.length}`,
|
|
32
|
+
`**Targets**: ${suite.targets.length}`,
|
|
33
|
+
`**Repeat**: ${suite.repeatCount}x`
|
|
34
|
+
].join("\n");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
handleUpdateSuite
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=update-suite-BXYUYSPT.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@langwatch/mcp-server",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "An MCP server for Langwatch.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./create-mcp-server": {
|
|
15
|
+
"types": "./src/create-mcp-server.d.ts",
|
|
16
|
+
"import": "./dist/create-mcp-server.js",
|
|
17
|
+
"require": "./dist/create-mcp-server.js",
|
|
18
|
+
"default": "./dist/create-mcp-server.js"
|
|
19
|
+
},
|
|
20
|
+
"./config": {
|
|
21
|
+
"types": "./src/config.d.ts",
|
|
22
|
+
"import": "./dist/config.js",
|
|
23
|
+
"require": "./dist/config.js",
|
|
24
|
+
"default": "./dist/config.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/langwatch/langwatch.git",
|
|
30
|
+
"directory": "mcp-server"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"start": "tsx src/index.ts",
|
|
34
|
+
"build": "tsup && node build.js",
|
|
35
|
+
"prepublish": "pnpm run build",
|
|
36
|
+
"test": "vitest"
|
|
37
|
+
},
|
|
38
|
+
"author": "",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@ai-sdk/anthropic": "^3.0.44",
|
|
45
|
+
"@anthropic-ai/claude-code": "^2.1.72",
|
|
46
|
+
"@eslint/js": "^9.4.0",
|
|
47
|
+
"@langwatch/scenario": "^0.4.6",
|
|
48
|
+
"@types/debug": "^4.1.12",
|
|
49
|
+
"@types/eslint__js": "^8.42.3",
|
|
50
|
+
"@types/express": "^5.0.6",
|
|
51
|
+
"@types/node": "^16.0.0",
|
|
52
|
+
"@types/yargs": "^17.0.33",
|
|
53
|
+
"@typescript/native-preview": "7.0.0-dev.20250911.1",
|
|
54
|
+
"ai": "^6.0.0",
|
|
55
|
+
"dotenv": "^17.2.2",
|
|
56
|
+
"esbuild": "^0.25.0",
|
|
57
|
+
"eslint": "^10.2.1",
|
|
58
|
+
"tsup": "^8.1.0",
|
|
59
|
+
"tsx": "^4.20.5",
|
|
60
|
+
"typescript": "^5.0.0",
|
|
61
|
+
"typescript-eslint": "^8.55.0"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
65
|
+
"@opentelemetry/context-async-hooks": "^2.1.0",
|
|
66
|
+
"@opentelemetry/sdk-node": "^0.215.0",
|
|
67
|
+
"chalk": "^5.6.2",
|
|
68
|
+
"date-fns": "^4.1.0",
|
|
69
|
+
"express": "^5.2.1",
|
|
70
|
+
"node-pty": "^1.0.0",
|
|
71
|
+
"vitest": "^3.2.4",
|
|
72
|
+
"yargs": "^17.7.2",
|
|
73
|
+
"zod": "^4.3.6",
|
|
74
|
+
"zod-validation-error": "^5.0.0"
|
|
75
|
+
},
|
|
76
|
+
"bin": {
|
|
77
|
+
"langwatch-mcp-server": "./dist/index.js"
|
|
78
|
+
}
|
|
79
|
+
}
|