@langwatch/server 3.1.0-beta.1 → 3.1.0-beta.11
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/langwatch_nlp/uv.lock +179 -5
- 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 -6
- package/packages/server/dist/cli.cjs +453 -186
- package/cmd/service/main.go +0 -68
- package/go.mod +0 -117
- package/go.sum +0 -299
- package/pkg/breaker/breaker.go +0 -157
- package/pkg/breaker/breaker_test.go +0 -131
- package/pkg/clog/LICENSE +0 -26
- package/pkg/clog/clog.go +0 -90
- package/pkg/clog/clog_test.go +0 -56
- package/pkg/clog/panic.go +0 -39
- package/pkg/config/LICENSE +0 -26
- package/pkg/config/config.go +0 -86
- package/pkg/config/config_test.go +0 -70
- package/pkg/config/otel.go +0 -50
- package/pkg/config/server.go +0 -61
- package/pkg/config/validate.go +0 -80
- package/pkg/config/validate_test.go +0 -74
- package/pkg/contexts/contexts_test.go +0 -34
- package/pkg/contexts/request_id.go +0 -1
- package/pkg/contexts/service_info.go +0 -33
- package/pkg/errfuncs/errfuncs.go +0 -9
- package/pkg/errfuncs/errfuncs_test.go +0 -28
- package/pkg/forkedcontext/forkedcontext.go +0 -57
- package/pkg/health/health.go +0 -123
- package/pkg/health/health_test.go +0 -84
- package/pkg/herr/LICENSE +0 -26
- package/pkg/herr/code.go +0 -14
- package/pkg/herr/herr.go +0 -112
- package/pkg/herr/herr_test.go +0 -78
- package/pkg/herr/http.go +0 -133
- package/pkg/herr/http_test.go +0 -103
- package/pkg/herr/validate.go +0 -72
- package/pkg/herr/validate_test.go +0 -75
- package/pkg/httpmiddleware/bearer.go +0 -47
- package/pkg/httpmiddleware/httputil_test.go +0 -167
- package/pkg/httpmiddleware/inflight.go +0 -23
- package/pkg/httpmiddleware/maxbody.go +0 -30
- package/pkg/httpmiddleware/recover.go +0 -38
- package/pkg/httpmiddleware/requestid.go +0 -40
- package/pkg/httpmiddleware/telemetry.go +0 -96
- package/pkg/httpmiddleware/version.go +0 -16
- package/pkg/jwtverify/verifier.go +0 -72
- package/pkg/jwtverify/verifier_test.go +0 -134
- package/pkg/ksuid/LICENSE +0 -26
- package/pkg/ksuid/ksuid.go +0 -157
- package/pkg/ksuid/ksuid_test.go +0 -107
- package/pkg/ksuid/resources.go +0 -13
- package/pkg/lifecycle/group.go +0 -175
- package/pkg/lifecycle/group_test.go +0 -236
- package/pkg/lifecycle/service.go +0 -112
- package/pkg/netprobe/netprobe.go +0 -89
- package/pkg/netprobe/netprobe_test.go +0 -55
- package/pkg/otelsetup/otelsetup.go +0 -226
- package/pkg/otelsetup/otelsetup_test.go +0 -130
- package/pkg/ptr/LICENSE +0 -26
- package/pkg/ptr/ptr.go +0 -34
- package/pkg/ptr/ptr_test.go +0 -66
- package/pkg/retry/bench_test.go +0 -67
- package/pkg/retry/retry.go +0 -188
- package/pkg/retry/retry_test.go +0 -222
- package/pkg/slicefuncs/LICENSE +0 -26
- package/pkg/slicefuncs/slicefuncs.go +0 -10
- package/pkg/slicefuncs/slicefuncs_test.go +0 -29
- package/pkg/stacktrace/LICENSE +0 -26
- package/pkg/stacktrace/frames.go +0 -77
- package/pkg/stacktrace/frames_test.go +0 -73
- package/services/aigateway/BENCHMARKS.md +0 -110
- package/services/aigateway/README.md +0 -156
- package/services/aigateway/adapters/authresolver/bench_test.go +0 -13
- package/services/aigateway/adapters/authresolver/redis.go +0 -61
- package/services/aigateway/adapters/authresolver/service.go +0 -442
- package/services/aigateway/adapters/authresolver/service_test.go +0 -435
- package/services/aigateway/adapters/budget/bench_test.go +0 -50
- package/services/aigateway/adapters/budget/budget.go +0 -59
- package/services/aigateway/adapters/cacherules/evaluator.go +0 -134
- package/services/aigateway/adapters/cacherules/evaluator_test.go +0 -207
- package/services/aigateway/adapters/controlplane/bench_test.go +0 -40
- package/services/aigateway/adapters/controlplane/client.go +0 -213
- package/services/aigateway/adapters/controlplane/client_test.go +0 -73
- package/services/aigateway/adapters/controlplane/config_wire.go +0 -310
- package/services/aigateway/adapters/controlplane/guardrails.go +0 -88
- package/services/aigateway/adapters/controlplane/signer.go +0 -95
- package/services/aigateway/adapters/controlplane/signer_test.go +0 -64
- package/services/aigateway/adapters/customertracebridge/context.go +0 -48
- package/services/aigateway/adapters/customertracebridge/context_test.go +0 -24
- package/services/aigateway/adapters/customertracebridge/emitter.go +0 -329
- package/services/aigateway/adapters/customertracebridge/emitter_test.go +0 -93
- package/services/aigateway/adapters/customertracebridge/registry.go +0 -82
- package/services/aigateway/adapters/customertracebridge/transport.go +0 -122
- package/services/aigateway/adapters/gatewaytracer/attrs.go +0 -28
- package/services/aigateway/adapters/gatewaytracer/attrs_genai.go +0 -24
- package/services/aigateway/adapters/gatewaytracer/headers.go +0 -8
- package/services/aigateway/adapters/gatewaytracer/tracer.go +0 -101
- package/services/aigateway/adapters/httpapi/bench_test.go +0 -83
- package/services/aigateway/adapters/httpapi/middleware.go +0 -123
- package/services/aigateway/adapters/httpapi/router.go +0 -635
- package/services/aigateway/adapters/httpapi/router_test.go +0 -633
- package/services/aigateway/adapters/modelresolver/resolver.go +0 -107
- package/services/aigateway/adapters/modelresolver/resolver_test.go +0 -140
- package/services/aigateway/adapters/policy/matcher.go +0 -250
- package/services/aigateway/adapters/policy/matcher_test.go +0 -124
- package/services/aigateway/adapters/providers/bifrost.go +0 -798
- package/services/aigateway/adapters/providers/bifrost_parser.go +0 -201
- package/services/aigateway/adapters/providers/bifrost_test.go +0 -181
- package/services/aigateway/adapters/ratelimit/limiter.go +0 -122
- package/services/aigateway/adapters/ratelimit/limiter_test.go +0 -81
- package/services/aigateway/app/app.go +0 -104
- package/services/aigateway/app/dispatch.go +0 -89
- package/services/aigateway/app/dispatch_test.go +0 -475
- package/services/aigateway/app/handlers.go +0 -79
- package/services/aigateway/app/peek_bench_test.go +0 -21
- package/services/aigateway/app/pipeline/bench_test.go +0 -34
- package/services/aigateway/app/pipeline/budget.go +0 -55
- package/services/aigateway/app/pipeline/cache.go +0 -34
- package/services/aigateway/app/pipeline/cachecontrol.go +0 -86
- package/services/aigateway/app/pipeline/cachecontrol_test.go +0 -110
- package/services/aigateway/app/pipeline/guardrail.go +0 -121
- package/services/aigateway/app/pipeline/pipeline.go +0 -159
- package/services/aigateway/app/pipeline/policy.go +0 -23
- package/services/aigateway/app/pipeline/ratelimit.go +0 -21
- package/services/aigateway/app/pipeline/rawframing_test.go +0 -67
- package/services/aigateway/app/pipeline/resolve.go +0 -44
- package/services/aigateway/app/pipeline/trace.go +0 -129
- package/services/aigateway/app/ports.go +0 -61
- package/services/aigateway/cmd/root.go +0 -42
- package/services/aigateway/config.go +0 -86
- package/services/aigateway/deps.go +0 -177
- package/services/aigateway/domain/bundle.go +0 -203
- package/services/aigateway/domain/errors.go +0 -23
- package/services/aigateway/domain/model.go +0 -24
- package/services/aigateway/domain/provider.go +0 -38
- package/services/aigateway/domain/request.go +0 -65
- package/services/aigateway/domain/response.go +0 -56
- package/services/aigateway/domain/verdict.go +0 -55
- package/services/aigateway/serve.go +0 -45
- package/services/aigateway/tests/matrix/README.md +0 -71
- package/services/aigateway/tests/matrix/anthropic_test.go +0 -61
- package/services/aigateway/tests/matrix/azure_test.go +0 -52
- package/services/aigateway/tests/matrix/bedrock_test.go +0 -69
- package/services/aigateway/tests/matrix/gemini_test.go +0 -117
- package/services/aigateway/tests/matrix/matrix_test.go +0 -601
- package/services/aigateway/tests/matrix/openai_test.go +0 -66
- package/services/aigateway/tests/matrix/vertex_test.go +0 -160
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAnnotation,
|
|
3
|
+
deleteAnnotation,
|
|
4
|
+
getAnnotation,
|
|
5
|
+
getAnnotationsByTrace,
|
|
6
|
+
listAnnotations
|
|
7
|
+
} from "./chunk-IE4M5OGE.js";
|
|
8
|
+
import "./chunk-2WPLXEKF.js";
|
|
9
|
+
import "./chunk-BWWY5KEF.js";
|
|
10
|
+
export {
|
|
11
|
+
createAnnotation,
|
|
12
|
+
deleteAnnotation,
|
|
13
|
+
getAnnotation,
|
|
14
|
+
getAnnotationsByTrace,
|
|
15
|
+
listAnnotations
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=langwatch-api-annotations-ERBG27RF.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDashboard,
|
|
3
|
+
deleteDashboard,
|
|
4
|
+
getDashboard,
|
|
5
|
+
listDashboards,
|
|
6
|
+
renameDashboard
|
|
7
|
+
} from "./chunk-EUQDVOSU.js";
|
|
8
|
+
import "./chunk-2WPLXEKF.js";
|
|
9
|
+
import "./chunk-BWWY5KEF.js";
|
|
10
|
+
export {
|
|
11
|
+
createDashboard,
|
|
12
|
+
deleteDashboard,
|
|
13
|
+
getDashboard,
|
|
14
|
+
listDashboards,
|
|
15
|
+
renameDashboard
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=langwatch-api-dashboards-G6TR7VVO.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRequest
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/langwatch-api-monitors.ts
|
|
7
|
+
async function listMonitors() {
|
|
8
|
+
return makeRequest("GET", "/api/monitors");
|
|
9
|
+
}
|
|
10
|
+
async function getMonitor(id) {
|
|
11
|
+
return makeRequest(
|
|
12
|
+
"GET",
|
|
13
|
+
`/api/monitors/${encodeURIComponent(id)}`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
async function createMonitor(data) {
|
|
17
|
+
return makeRequest("POST", "/api/monitors", {
|
|
18
|
+
...data,
|
|
19
|
+
preconditions: [],
|
|
20
|
+
parameters: data.parameters ?? {}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async function updateMonitor(params) {
|
|
24
|
+
const { id, ...data } = params;
|
|
25
|
+
return makeRequest(
|
|
26
|
+
"PATCH",
|
|
27
|
+
`/api/monitors/${encodeURIComponent(id)}`,
|
|
28
|
+
data
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
async function toggleMonitor(params) {
|
|
32
|
+
return makeRequest(
|
|
33
|
+
"POST",
|
|
34
|
+
`/api/monitors/${encodeURIComponent(params.id)}/toggle`,
|
|
35
|
+
{ enabled: params.enabled }
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
async function deleteMonitor(id) {
|
|
39
|
+
return makeRequest(
|
|
40
|
+
"DELETE",
|
|
41
|
+
`/api/monitors/${encodeURIComponent(id)}`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
createMonitor,
|
|
46
|
+
deleteMonitor,
|
|
47
|
+
getMonitor,
|
|
48
|
+
listMonitors,
|
|
49
|
+
toggleMonitor,
|
|
50
|
+
updateMonitor
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=langwatch-api-monitors-WSXZLS2B.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRequest
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/langwatch-api-secrets.ts
|
|
7
|
+
async function listSecrets() {
|
|
8
|
+
return makeRequest("GET", "/api/secrets");
|
|
9
|
+
}
|
|
10
|
+
async function getSecret(id) {
|
|
11
|
+
return makeRequest(
|
|
12
|
+
"GET",
|
|
13
|
+
`/api/secrets/${encodeURIComponent(id)}`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
async function createSecret(data) {
|
|
17
|
+
return makeRequest("POST", "/api/secrets", data);
|
|
18
|
+
}
|
|
19
|
+
async function updateSecret(params) {
|
|
20
|
+
const { id, value } = params;
|
|
21
|
+
return makeRequest(
|
|
22
|
+
"PUT",
|
|
23
|
+
`/api/secrets/${encodeURIComponent(id)}`,
|
|
24
|
+
{ value }
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
async function deleteSecret(id) {
|
|
28
|
+
return makeRequest(
|
|
29
|
+
"DELETE",
|
|
30
|
+
`/api/secrets/${encodeURIComponent(id)}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
createSecret,
|
|
35
|
+
deleteSecret,
|
|
36
|
+
getSecret,
|
|
37
|
+
listSecrets,
|
|
38
|
+
updateSecret
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=langwatch-api-secrets-RR5DKG2X.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRequest
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/langwatch-api-triggers.ts
|
|
7
|
+
async function listTriggers() {
|
|
8
|
+
return makeRequest("GET", "/api/triggers");
|
|
9
|
+
}
|
|
10
|
+
async function getTrigger(id) {
|
|
11
|
+
return makeRequest("GET", `/api/triggers/${encodeURIComponent(id)}`);
|
|
12
|
+
}
|
|
13
|
+
async function createTrigger(data) {
|
|
14
|
+
return makeRequest("POST", "/api/triggers", data);
|
|
15
|
+
}
|
|
16
|
+
async function updateTrigger(params) {
|
|
17
|
+
const { id, ...data } = params;
|
|
18
|
+
return makeRequest("PATCH", `/api/triggers/${encodeURIComponent(id)}`, data);
|
|
19
|
+
}
|
|
20
|
+
async function deleteTrigger(id) {
|
|
21
|
+
return makeRequest("DELETE", `/api/triggers/${encodeURIComponent(id)}`);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
createTrigger,
|
|
25
|
+
deleteTrigger,
|
|
26
|
+
getTrigger,
|
|
27
|
+
listTriggers,
|
|
28
|
+
updateTrigger
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=langwatch-api-triggers-2RTNSWQY.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deleteWorkflow,
|
|
3
|
+
getWorkflow,
|
|
4
|
+
listWorkflows,
|
|
5
|
+
runWorkflow
|
|
6
|
+
} from "./chunk-ZVS4UKN2.js";
|
|
7
|
+
import "./chunk-2WPLXEKF.js";
|
|
8
|
+
import "./chunk-BWWY5KEF.js";
|
|
9
|
+
export {
|
|
10
|
+
deleteWorkflow,
|
|
11
|
+
getWorkflow,
|
|
12
|
+
listWorkflows,
|
|
13
|
+
runWorkflow
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=langwatch-api-workflows-VJRIIDZ7.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listAgents
|
|
3
|
+
} from "./chunk-4AUB2BIA.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-agents.ts
|
|
8
|
+
async function handleListAgents() {
|
|
9
|
+
const result = await listAgents({ limit: 100 });
|
|
10
|
+
const agents = result.data;
|
|
11
|
+
if (!Array.isArray(agents) || agents.length === 0) {
|
|
12
|
+
return "No agents found in this project.\n\n> Tip: Use `platform_create_agent` to create your first agent.";
|
|
13
|
+
}
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push(`# Agents (${result.pagination.total} total)
|
|
16
|
+
`);
|
|
17
|
+
for (const a of agents) {
|
|
18
|
+
lines.push(`## ${a.name}`);
|
|
19
|
+
lines.push(`**ID**: ${a.id}`);
|
|
20
|
+
lines.push(`**Type**: ${a.type}`);
|
|
21
|
+
lines.push(`**Updated**: ${a.updatedAt}`);
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
24
|
+
lines.push(
|
|
25
|
+
"> Use `platform_get_agent` with the ID to see full agent details including config."
|
|
26
|
+
);
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
handleListAgents
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=list-agents-AW3P6FJV.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAnnotationsByTrace,
|
|
3
|
+
listAnnotations
|
|
4
|
+
} from "./chunk-IE4M5OGE.js";
|
|
5
|
+
import "./chunk-2WPLXEKF.js";
|
|
6
|
+
import "./chunk-BWWY5KEF.js";
|
|
7
|
+
|
|
8
|
+
// src/tools/list-annotations.ts
|
|
9
|
+
async function handleListAnnotations(params) {
|
|
10
|
+
const annotations = params.traceId ? await getAnnotationsByTrace(params.traceId) : await listAnnotations();
|
|
11
|
+
if (!Array.isArray(annotations) || annotations.length === 0) {
|
|
12
|
+
return params.traceId ? `No annotations found for trace "${params.traceId}".
|
|
13
|
+
|
|
14
|
+
> Tip: Use \`platform_create_annotation\` to annotate a trace.` : "No annotations found in this project.\n\n> Tip: Use `platform_create_annotation` to annotate a trace.";
|
|
15
|
+
}
|
|
16
|
+
const lines = [];
|
|
17
|
+
lines.push(`# Annotations (${annotations.length} total)
|
|
18
|
+
`);
|
|
19
|
+
for (const a of annotations) {
|
|
20
|
+
const rating = a.isThumbsUp === true ? "\u{1F44D}" : a.isThumbsUp === false ? "\u{1F44E}" : "\u2014";
|
|
21
|
+
lines.push(`## Annotation ${a.id ?? "\u2014"}`);
|
|
22
|
+
lines.push(`**Trace ID**: ${a.traceId ?? "\u2014"}`);
|
|
23
|
+
lines.push(`**Rating**: ${rating}`);
|
|
24
|
+
if (a.comment) lines.push(`**Comment**: ${a.comment}`);
|
|
25
|
+
if (a.email) lines.push(`**By**: ${a.email}`);
|
|
26
|
+
lines.push("");
|
|
27
|
+
}
|
|
28
|
+
return lines.join("\n");
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
handleListAnnotations
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=list-annotations-QNCGWPQ3.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listDashboards
|
|
3
|
+
} from "./chunk-EUQDVOSU.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-dashboards.ts
|
|
8
|
+
async function handleListDashboards() {
|
|
9
|
+
const result = await listDashboards();
|
|
10
|
+
const dashboards = result.data;
|
|
11
|
+
if (!Array.isArray(dashboards) || dashboards.length === 0) {
|
|
12
|
+
return "No dashboards found in this project.\n\n> Tip: Use `platform_create_dashboard` to create a new dashboard.";
|
|
13
|
+
}
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push(`# Dashboards (${dashboards.length} total)
|
|
16
|
+
`);
|
|
17
|
+
for (const d of dashboards) {
|
|
18
|
+
lines.push(`## ${d.name}`);
|
|
19
|
+
lines.push(`**ID**: ${d.id}`);
|
|
20
|
+
lines.push(`**Graphs**: ${d.graphCount}`);
|
|
21
|
+
lines.push(`**Updated**: ${d.updatedAt}`);
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
24
|
+
lines.push(
|
|
25
|
+
"> Use `platform_get_dashboard` with the ID to see dashboard details including graphs."
|
|
26
|
+
);
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
handleListDashboards
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=list-dashboards-R7RK2IXL.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
escapeMarkdown
|
|
3
|
+
} from "./chunk-NUFPTHKU.js";
|
|
4
|
+
import {
|
|
5
|
+
listDatasetRecords
|
|
6
|
+
} from "./chunk-WQG2DFHX.js";
|
|
7
|
+
import "./chunk-2WPLXEKF.js";
|
|
8
|
+
import "./chunk-BWWY5KEF.js";
|
|
9
|
+
|
|
10
|
+
// src/tools/list-dataset-records.ts
|
|
11
|
+
async function handleListDatasetRecords(params) {
|
|
12
|
+
const response = await listDatasetRecords({
|
|
13
|
+
slugOrId: params.slugOrId,
|
|
14
|
+
page: params.page,
|
|
15
|
+
limit: params.limit
|
|
16
|
+
});
|
|
17
|
+
if (params.format === "json") {
|
|
18
|
+
return JSON.stringify(response, null, 2);
|
|
19
|
+
}
|
|
20
|
+
const { data: records, pagination } = response;
|
|
21
|
+
if (records.length === 0) {
|
|
22
|
+
return "No records found in this dataset.";
|
|
23
|
+
}
|
|
24
|
+
const lines = [];
|
|
25
|
+
lines.push(`# Records (page ${pagination.page} of ${pagination.totalPages}, ${pagination.total} total)
|
|
26
|
+
`);
|
|
27
|
+
for (const record of records) {
|
|
28
|
+
lines.push(`**${escapeMarkdown(record.id)}**: ${escapeMarkdown(JSON.stringify(record.entry))}`);
|
|
29
|
+
}
|
|
30
|
+
if (pagination.page < pagination.totalPages) {
|
|
31
|
+
lines.push("");
|
|
32
|
+
lines.push(`> Use \`platform_list_dataset_records\` with \`page: ${pagination.page + 1}\` to see the next page.`);
|
|
33
|
+
}
|
|
34
|
+
return lines.join("\n");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
handleListDatasetRecords
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=list-dataset-records-WVCSQP7P.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
escapeMarkdown
|
|
3
|
+
} from "./chunk-NUFPTHKU.js";
|
|
4
|
+
import {
|
|
5
|
+
listDatasets
|
|
6
|
+
} from "./chunk-WQG2DFHX.js";
|
|
7
|
+
import "./chunk-2WPLXEKF.js";
|
|
8
|
+
import "./chunk-BWWY5KEF.js";
|
|
9
|
+
|
|
10
|
+
// src/tools/list-datasets.ts
|
|
11
|
+
async function fetchAllDatasets() {
|
|
12
|
+
const PAGE_SIZE = 100;
|
|
13
|
+
const datasets = [];
|
|
14
|
+
let page = 1;
|
|
15
|
+
let total = 0;
|
|
16
|
+
while (true) {
|
|
17
|
+
const response = await listDatasets({ page, limit: PAGE_SIZE });
|
|
18
|
+
total = response.pagination.total;
|
|
19
|
+
datasets.push(...response.data);
|
|
20
|
+
if (datasets.length >= total || response.data.length === 0) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
page++;
|
|
24
|
+
}
|
|
25
|
+
return { datasets, total };
|
|
26
|
+
}
|
|
27
|
+
async function handleListDatasets(params = {}) {
|
|
28
|
+
if (params.format === "json") {
|
|
29
|
+
const { datasets: datasets2, total: total2 } = await fetchAllDatasets();
|
|
30
|
+
return JSON.stringify({ data: datasets2, total: total2 }, null, 2);
|
|
31
|
+
}
|
|
32
|
+
const { datasets, total } = await fetchAllDatasets();
|
|
33
|
+
if (datasets.length === 0) {
|
|
34
|
+
return "No datasets found in this project.\n\n> Tip: Use `platform_create_dataset` to create your first dataset.";
|
|
35
|
+
}
|
|
36
|
+
const lines = [];
|
|
37
|
+
lines.push(`# Datasets (${total} total)
|
|
38
|
+
`);
|
|
39
|
+
for (const ds of datasets) {
|
|
40
|
+
lines.push(`## ${escapeMarkdown(ds.name)}`);
|
|
41
|
+
lines.push(`**Slug**: ${escapeMarkdown(ds.slug)}`);
|
|
42
|
+
lines.push(`**ID**: ${ds.id}`);
|
|
43
|
+
if (Array.isArray(ds.columnTypes) && ds.columnTypes.length > 0) {
|
|
44
|
+
const colNames = ds.columnTypes.map((c) => c.name).join(", ");
|
|
45
|
+
lines.push(`**Columns**: ${colNames}`);
|
|
46
|
+
}
|
|
47
|
+
lines.push(
|
|
48
|
+
`**Records**: ${ds.recordCount ?? "unknown"}`
|
|
49
|
+
);
|
|
50
|
+
lines.push("");
|
|
51
|
+
}
|
|
52
|
+
lines.push(
|
|
53
|
+
"> Use `platform_get_dataset` with the slug to see full dataset details and records."
|
|
54
|
+
);
|
|
55
|
+
return lines.join("\n");
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
handleListDatasets
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=list-datasets-KEXRLDEU.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEvaluatorType,
|
|
3
|
+
listEvaluators
|
|
4
|
+
} from "./chunk-HYMIWO3U.js";
|
|
5
|
+
import "./chunk-2WPLXEKF.js";
|
|
6
|
+
import "./chunk-BWWY5KEF.js";
|
|
7
|
+
|
|
8
|
+
// src/tools/list-evaluators.ts
|
|
9
|
+
async function handleListEvaluators() {
|
|
10
|
+
const evaluators = await listEvaluators();
|
|
11
|
+
if (!Array.isArray(evaluators) || evaluators.length === 0) {
|
|
12
|
+
return "No evaluators found in this project.\n\n> Tip: Use `platform_create_evaluator` to create your first evaluator. Call `discover_schema({ category: 'evaluators' })` to see available evaluator types.";
|
|
13
|
+
}
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push(`# Evaluators (${evaluators.length} total)
|
|
16
|
+
`);
|
|
17
|
+
for (const e of evaluators) {
|
|
18
|
+
const evaluatorType = getEvaluatorType(e);
|
|
19
|
+
lines.push(`## ${e.name}`);
|
|
20
|
+
lines.push(`**ID**: ${e.id}`);
|
|
21
|
+
if (e.slug) lines.push(`**Slug**: ${e.slug}`);
|
|
22
|
+
if (evaluatorType) lines.push(`**Type**: ${evaluatorType}`);
|
|
23
|
+
lines.push(`**Kind**: ${e.type}`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
}
|
|
26
|
+
lines.push(
|
|
27
|
+
"> Use `platform_get_evaluator` with the ID or slug to see full evaluator details."
|
|
28
|
+
);
|
|
29
|
+
return lines.join("\n");
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
handleListEvaluators
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=list-evaluators-7R2LB4JH.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listModelProviders
|
|
3
|
+
} from "./chunk-CCWCIJJ3.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-model-providers.ts
|
|
8
|
+
async function handleListModelProviders() {
|
|
9
|
+
const providers = await listModelProviders();
|
|
10
|
+
const entries = Object.entries(providers);
|
|
11
|
+
if (entries.length === 0) {
|
|
12
|
+
return "No model providers configured for this project.\n\n> Tip: Use `platform_set_model_provider` to configure an API key for a model provider.";
|
|
13
|
+
}
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push(`# Model Providers (${entries.length} total)
|
|
16
|
+
`);
|
|
17
|
+
for (const [key, provider] of entries) {
|
|
18
|
+
const status = provider.enabled ? "enabled" : "disabled";
|
|
19
|
+
lines.push(`## ${key}`);
|
|
20
|
+
lines.push(`**Status**: ${status}`);
|
|
21
|
+
if (provider.customKeys) {
|
|
22
|
+
const keyFields = Object.entries(provider.customKeys).map(([k, v]) => `${k}: ${v ? "set" : "not set"}`).join(", ");
|
|
23
|
+
lines.push(`**Keys**: ${keyFields}`);
|
|
24
|
+
}
|
|
25
|
+
if (provider.models && provider.models.length > 0) {
|
|
26
|
+
lines.push(`**Models**: ${provider.models.length} available`);
|
|
27
|
+
}
|
|
28
|
+
lines.push("");
|
|
29
|
+
}
|
|
30
|
+
return lines.join("\n");
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
handleListModelProviders
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=list-model-providers-OBYJCKBX.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listPromptTags
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/list-prompt-tags.ts
|
|
7
|
+
async function handleListPromptTags() {
|
|
8
|
+
const tags = await listPromptTags();
|
|
9
|
+
if (!tags || tags.length === 0) {
|
|
10
|
+
return "No prompt tags found. The `latest` tag is always available.";
|
|
11
|
+
}
|
|
12
|
+
const lines = [];
|
|
13
|
+
lines.push("# Prompt Tags\n");
|
|
14
|
+
for (const tag of tags) {
|
|
15
|
+
const created = tag.createdAt ? ` (created ${tag.createdAt})` : "";
|
|
16
|
+
lines.push(`- **${tag.name}**${created}`);
|
|
17
|
+
}
|
|
18
|
+
return lines.join("\n");
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
handleListPromptTags
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=list-prompt-tags-6LY3ZPYI.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listPrompts
|
|
3
|
+
} from "./chunk-2WPLXEKF.js";
|
|
4
|
+
import "./chunk-BWWY5KEF.js";
|
|
5
|
+
|
|
6
|
+
// src/tools/list-prompts.ts
|
|
7
|
+
async function handleListPrompts() {
|
|
8
|
+
const prompts = await listPrompts();
|
|
9
|
+
if (!Array.isArray(prompts) || prompts.length === 0) {
|
|
10
|
+
return "No prompts found in this project.";
|
|
11
|
+
}
|
|
12
|
+
const lines = [];
|
|
13
|
+
lines.push(`# Prompts (${prompts.length} total)
|
|
14
|
+
`);
|
|
15
|
+
lines.push("| Handle | Name | Latest Version |");
|
|
16
|
+
lines.push("|--------|------|----------------|");
|
|
17
|
+
for (const p of prompts) {
|
|
18
|
+
const handle = p.handle || p.id || "N/A";
|
|
19
|
+
const name = p.name || "Untitled";
|
|
20
|
+
const versionNum = p.latestVersionNumber ?? p.version;
|
|
21
|
+
const version = versionNum != null ? `v${versionNum}` : "N/A";
|
|
22
|
+
lines.push(`| ${handle} | ${name} | ${version} |`);
|
|
23
|
+
}
|
|
24
|
+
lines.push(
|
|
25
|
+
"\n> Use `platform_get_prompt` with the handle or ID to see full prompt details."
|
|
26
|
+
);
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
handleListPrompts
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=list-prompts-VWEZ4CDE.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listScenarios
|
|
3
|
+
} from "./chunk-2GT7IFWK.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-scenarios.ts
|
|
8
|
+
async function handleListScenarios(params) {
|
|
9
|
+
const scenarios = await listScenarios();
|
|
10
|
+
if (params.format === "json") {
|
|
11
|
+
return JSON.stringify(scenarios, null, 2);
|
|
12
|
+
}
|
|
13
|
+
if (!Array.isArray(scenarios) || scenarios.length === 0) {
|
|
14
|
+
return "No scenarios found in this project.\n\n> Tip: Use `platform_create_scenario` to create your first scenario.";
|
|
15
|
+
}
|
|
16
|
+
const lines = [];
|
|
17
|
+
lines.push(`# Scenarios (${scenarios.length} total)
|
|
18
|
+
`);
|
|
19
|
+
for (const s of scenarios) {
|
|
20
|
+
lines.push(`## ${s.name}`);
|
|
21
|
+
lines.push(`**ID**: ${s.id}`);
|
|
22
|
+
const preview = s.situation && s.situation.length > 60 ? s.situation.slice(0, 60) + "..." : s.situation;
|
|
23
|
+
lines.push(`**Situation**: ${preview}`);
|
|
24
|
+
lines.push(
|
|
25
|
+
`**Criteria**: ${Array.isArray(s.criteria) ? s.criteria.length : 0} criteria`
|
|
26
|
+
);
|
|
27
|
+
if (Array.isArray(s.labels) && s.labels.length > 0) {
|
|
28
|
+
lines.push(`**Labels**: ${s.labels.join(", ")}`);
|
|
29
|
+
}
|
|
30
|
+
lines.push("");
|
|
31
|
+
}
|
|
32
|
+
lines.push(
|
|
33
|
+
"> Use `platform_get_scenario` with the ID to see full scenario details."
|
|
34
|
+
);
|
|
35
|
+
return lines.join("\n");
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
handleListScenarios
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=list-scenarios-TXD4W2ZJ.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listSimulationRuns
|
|
3
|
+
} from "./chunk-EGH5RPXM.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-simulation-runs.ts
|
|
8
|
+
async function handleListSimulationRuns(params) {
|
|
9
|
+
const result = await listSimulationRuns({
|
|
10
|
+
scenarioSetId: params.scenarioSetId,
|
|
11
|
+
batchRunId: params.batchRunId,
|
|
12
|
+
limit: params.limit
|
|
13
|
+
});
|
|
14
|
+
if (params.format === "json") {
|
|
15
|
+
return JSON.stringify(result, null, 2);
|
|
16
|
+
}
|
|
17
|
+
const { runs } = result;
|
|
18
|
+
if (runs.length === 0) {
|
|
19
|
+
return "No simulation runs found.\n\n> Run a suite first with `platform_run_suite` to create simulation runs.";
|
|
20
|
+
}
|
|
21
|
+
const lines = [];
|
|
22
|
+
lines.push(`# Simulation Runs (${runs.length} results${result.hasMore ? ", more available" : ""})
|
|
23
|
+
`);
|
|
24
|
+
for (const run of runs) {
|
|
25
|
+
const statusIcon = run.status === "SUCCESS" ? "pass" : run.status === "FAILED" ? "FAIL" : run.status;
|
|
26
|
+
const duration = run.durationInMs > 0 ? `${(run.durationInMs / 1e3).toFixed(1)}s` : "\u2014";
|
|
27
|
+
const verdict = run.results?.verdict ?? "";
|
|
28
|
+
lines.push(`## ${run.name ?? run.scenarioId} \u2014 ${statusIcon}${verdict ? ` (${verdict})` : ""}`);
|
|
29
|
+
lines.push(`**Run ID**: ${run.scenarioRunId}`);
|
|
30
|
+
lines.push(`**Batch**: ${run.batchRunId}`);
|
|
31
|
+
lines.push(`**Duration**: ${duration}`);
|
|
32
|
+
if (run.totalCost) {
|
|
33
|
+
lines.push(`**Cost**: $${run.totalCost.toFixed(4)}`);
|
|
34
|
+
}
|
|
35
|
+
lines.push("");
|
|
36
|
+
}
|
|
37
|
+
lines.push("> Use `platform_get_simulation_run` with a run ID to see full details (messages, results).");
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
handleListSimulationRuns
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=list-simulation-runs-RHPOLMFI.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listSuites
|
|
3
|
+
} from "./chunk-LUMEZEHL.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-suites.ts
|
|
8
|
+
async function handleListSuites(params) {
|
|
9
|
+
const suites = await listSuites();
|
|
10
|
+
if (params.format === "json") {
|
|
11
|
+
return JSON.stringify(suites, null, 2);
|
|
12
|
+
}
|
|
13
|
+
if (!Array.isArray(suites) || suites.length === 0) {
|
|
14
|
+
return "No suites (run plans) found in this project.\n\n> Tip: Use `platform_create_suite` to create your first suite.";
|
|
15
|
+
}
|
|
16
|
+
const lines = [];
|
|
17
|
+
lines.push(`# Suites / Run Plans (${suites.length} total)
|
|
18
|
+
`);
|
|
19
|
+
for (const s of suites) {
|
|
20
|
+
lines.push(`## ${s.name}`);
|
|
21
|
+
lines.push(`**ID**: ${s.id}`);
|
|
22
|
+
lines.push(`**Slug**: ${s.slug}`);
|
|
23
|
+
lines.push(`**Scenarios**: ${s.scenarioIds.length}`);
|
|
24
|
+
lines.push(`**Targets**: ${s.targets.length} (${s.targets.map((t) => `${t.type}:${t.referenceId}`).join(", ")})`);
|
|
25
|
+
lines.push(`**Repeat**: ${s.repeatCount}x`);
|
|
26
|
+
if (s.description) {
|
|
27
|
+
lines.push(`**Description**: ${s.description}`);
|
|
28
|
+
}
|
|
29
|
+
if (Array.isArray(s.labels) && s.labels.length > 0) {
|
|
30
|
+
lines.push(`**Labels**: ${s.labels.join(", ")}`);
|
|
31
|
+
}
|
|
32
|
+
lines.push("");
|
|
33
|
+
}
|
|
34
|
+
lines.push(
|
|
35
|
+
"> Use `platform_get_suite` with the ID to see full details, or `platform_run_suite` to trigger execution."
|
|
36
|
+
);
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
handleListSuites
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=list-suites-FSGBX27Z.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listWorkflows
|
|
3
|
+
} from "./chunk-ZVS4UKN2.js";
|
|
4
|
+
import "./chunk-2WPLXEKF.js";
|
|
5
|
+
import "./chunk-BWWY5KEF.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/list-workflows.ts
|
|
8
|
+
async function handleListWorkflows() {
|
|
9
|
+
const workflows = await listWorkflows();
|
|
10
|
+
if (!Array.isArray(workflows) || workflows.length === 0) {
|
|
11
|
+
return "No workflows found in this project.";
|
|
12
|
+
}
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push(`# Workflows (${workflows.length} total)
|
|
15
|
+
`);
|
|
16
|
+
for (const w of workflows) {
|
|
17
|
+
const tags = [];
|
|
18
|
+
if (w.isEvaluator) tags.push("evaluator");
|
|
19
|
+
if (w.isComponent) tags.push("component");
|
|
20
|
+
const tagStr = tags.length > 0 ? ` [${tags.join(", ")}]` : "";
|
|
21
|
+
lines.push(`## ${w.name}${tagStr}`);
|
|
22
|
+
lines.push(`**ID**: ${w.id}`);
|
|
23
|
+
if (w.description) lines.push(`**Description**: ${w.description}`);
|
|
24
|
+
lines.push(`**Updated**: ${w.updatedAt}`);
|
|
25
|
+
lines.push("");
|
|
26
|
+
}
|
|
27
|
+
lines.push(
|
|
28
|
+
"> Use `platform_get_workflow` with the ID to see full workflow details."
|
|
29
|
+
);
|
|
30
|
+
return lines.join("\n");
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
handleListWorkflows
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=list-workflows-VRGEZ3EN.js.map
|