@amplitude/ai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/skills/instrument-with-amplitude-ai/SKILL.md +50 -0
- package/AGENTS.md +79 -0
- package/LICENSE +21 -0
- package/README.md +2111 -0
- package/bin/amplitude-ai-completions.mjs +19 -0
- package/bin/amplitude-ai-doctor.mjs +26 -0
- package/bin/amplitude-ai-init.mjs +27 -0
- package/bin/amplitude-ai-instrument.mjs +52 -0
- package/bin/amplitude-ai-mcp.mjs +8 -0
- package/bin/amplitude-ai-register-catalog.mjs +156 -0
- package/bin/amplitude-ai-status.mjs +28 -0
- package/bin/amplitude-ai.mjs +43 -0
- package/bin/validate-catalog-constants.mjs +134 -0
- package/data/agent_event_catalog.json +1277 -0
- package/dist/_virtual/rolldown_runtime.js +31 -0
- package/dist/bound-agent.d.ts +56 -0
- package/dist/bound-agent.d.ts.map +1 -0
- package/dist/bound-agent.js +155 -0
- package/dist/bound-agent.js.map +1 -0
- package/dist/cli/doctor.d.ts +17 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +89 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/init.d.ts +14 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +40 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/providers.d.ts +32 -0
- package/dist/cli/providers.d.ts.map +1 -0
- package/dist/cli/providers.js +46 -0
- package/dist/cli/providers.js.map +1 -0
- package/dist/cli/status.d.ts +14 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +38 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/client.d.ts +246 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +369 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +44 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +53 -0
- package/dist/context.js.map +1 -0
- package/dist/core/constants.d.ts +96 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +105 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/enrichments.d.ts +139 -0
- package/dist/core/enrichments.d.ts.map +1 -0
- package/dist/core/enrichments.js +177 -0
- package/dist/core/enrichments.js.map +1 -0
- package/dist/core/privacy.d.ts +53 -0
- package/dist/core/privacy.d.ts.map +1 -0
- package/dist/core/privacy.js +235 -0
- package/dist/core/privacy.js.map +1 -0
- package/dist/core/tracking.d.ts +242 -0
- package/dist/core/tracking.d.ts.map +1 -0
- package/dist/core/tracking.js +469 -0
- package/dist/core/tracking.js.map +1 -0
- package/dist/decorators.d.ts +109 -0
- package/dist/decorators.d.ts.map +1 -0
- package/dist/decorators.js +281 -0
- package/dist/decorators.js.map +1 -0
- package/dist/exceptions.d.ts +19 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +35 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +38 -0
- package/dist/integrations/anthropic-tools.d.ts +38 -0
- package/dist/integrations/anthropic-tools.d.ts.map +1 -0
- package/dist/integrations/anthropic-tools.js +175 -0
- package/dist/integrations/anthropic-tools.js.map +1 -0
- package/dist/integrations/crewai.d.ts +14 -0
- package/dist/integrations/crewai.d.ts.map +1 -0
- package/dist/integrations/crewai.js +19 -0
- package/dist/integrations/crewai.js.map +1 -0
- package/dist/integrations/langchain.d.ts +37 -0
- package/dist/integrations/langchain.d.ts.map +1 -0
- package/dist/integrations/langchain.js +189 -0
- package/dist/integrations/langchain.js.map +1 -0
- package/dist/integrations/llamaindex.d.ts +44 -0
- package/dist/integrations/llamaindex.d.ts.map +1 -0
- package/dist/integrations/llamaindex.js +144 -0
- package/dist/integrations/llamaindex.js.map +1 -0
- package/dist/integrations/openai-agents.d.ts +35 -0
- package/dist/integrations/openai-agents.d.ts.map +1 -0
- package/dist/integrations/openai-agents.js +248 -0
- package/dist/integrations/openai-agents.js.map +1 -0
- package/dist/integrations/opentelemetry.d.ts +40 -0
- package/dist/integrations/opentelemetry.d.ts.map +1 -0
- package/dist/integrations/opentelemetry.js +146 -0
- package/dist/integrations/opentelemetry.js.map +1 -0
- package/dist/internals.d.ts +5 -0
- package/dist/internals.js +5 -0
- package/dist/mcp/contract.d.ts +27 -0
- package/dist/mcp/contract.d.ts.map +1 -0
- package/dist/mcp/contract.js +25 -0
- package/dist/mcp/contract.js.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/patterns.d.ts +11 -0
- package/dist/mcp/patterns.d.ts.map +1 -0
- package/dist/mcp/patterns.js +38 -0
- package/dist/mcp/patterns.js.map +1 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +241 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/validate-file.d.ts +20 -0
- package/dist/mcp/validate-file.d.ts.map +1 -0
- package/dist/mcp/validate-file.js +122 -0
- package/dist/mcp/validate-file.js.map +1 -0
- package/dist/middleware.d.ts +32 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +67 -0
- package/dist/middleware.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +54 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +20 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +34 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +225 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +22 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +351 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +634 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +60 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +122 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +37 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +858 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +32 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +74 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1262 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +83 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js +195 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js +44 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js +88 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js +107 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js +142 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js +678 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js +145 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js +106 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js +227 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js +33 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js +137 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js +65 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js +150 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js +27 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js +52 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js +176 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js +437 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js +117 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js +76 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js +587 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +145 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js +29 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js +20 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +61 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +101 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +34 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +21 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +94 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +91 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js +64 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js +63 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +39 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js +36 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +56 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +66 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +57 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +46 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js +134 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js +27 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js +116 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +106 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +18 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js +31 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js +97 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js +15 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js +27 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js +32 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js +54 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js +53 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +33 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +38 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +52 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +33 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +32 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +43 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js +77 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +75 -0
- package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +37 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +240 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +194 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +286 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +82 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +30 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +16 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +57 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +17 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +23 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +36 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +39 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +13 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +11 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +47 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +17 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +38 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +16 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +13 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +11 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +46 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +37 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +64 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +20 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +27 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +56 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +21 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +250 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +38 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +64 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +10 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +78 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +70 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +104 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +11 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +110 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +99 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +84 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +3160 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js +23 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js +38 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js +12 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js +611 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js +437 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js +360 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js +50 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js +34 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js +71 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js +74 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js +63 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js +50 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js +1098 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js +599 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js +267 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js +50 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js.map +1 -0
- package/dist/patching.d.ts +59 -0
- package/dist/patching.d.ts.map +1 -0
- package/dist/patching.js +891 -0
- package/dist/patching.js.map +1 -0
- package/dist/propagation.d.ts +8 -0
- package/dist/propagation.d.ts.map +1 -0
- package/dist/propagation.js +46 -0
- package/dist/propagation.js.map +1 -0
- package/dist/providers/anthropic.d.ts +44 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +287 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/azure-openai.d.ts +32 -0
- package/dist/providers/azure-openai.d.ts.map +1 -0
- package/dist/providers/azure-openai.js +39 -0
- package/dist/providers/azure-openai.js.map +1 -0
- package/dist/providers/base.d.ts +70 -0
- package/dist/providers/base.d.ts.map +1 -0
- package/dist/providers/base.js +141 -0
- package/dist/providers/base.js.map +1 -0
- package/dist/providers/bedrock.d.ts +41 -0
- package/dist/providers/bedrock.d.ts.map +1 -0
- package/dist/providers/bedrock.js +229 -0
- package/dist/providers/bedrock.js.map +1 -0
- package/dist/providers/gemini.d.ts +34 -0
- package/dist/providers/gemini.d.ts.map +1 -0
- package/dist/providers/gemini.js +225 -0
- package/dist/providers/gemini.js.map +1 -0
- package/dist/providers/mistral.d.ts +32 -0
- package/dist/providers/mistral.d.ts.map +1 -0
- package/dist/providers/mistral.js +218 -0
- package/dist/providers/mistral.js.map +1 -0
- package/dist/providers/openai.d.ts +61 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +530 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +46 -0
- package/dist/register.js.map +1 -0
- package/dist/session.d.ts +46 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +144 -0
- package/dist/session.js.map +1 -0
- package/dist/tenant.d.ts +30 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/tenant.js +23 -0
- package/dist/tenant.js.map +1 -0
- package/dist/testing.d.ts +46 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +120 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +384 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/costs.d.ts +27 -0
- package/dist/utils/costs.d.ts.map +1 -0
- package/dist/utils/costs.js +63 -0
- package/dist/utils/costs.js.map +1 -0
- package/dist/utils/debug.d.ts +6 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/debug.js +73 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +18 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/model-tiers.d.ts +8 -0
- package/dist/utils/model-tiers.d.ts.map +1 -0
- package/dist/utils/model-tiers.js +76 -0
- package/dist/utils/model-tiers.js.map +1 -0
- package/dist/utils/providers.d.ts +5 -0
- package/dist/utils/providers.d.ts.map +1 -0
- package/dist/utils/providers.js +20 -0
- package/dist/utils/providers.js.map +1 -0
- package/dist/utils/resolve-module.d.ts +5 -0
- package/dist/utils/resolve-module.d.ts.map +1 -0
- package/dist/utils/resolve-module.js +29 -0
- package/dist/utils/resolve-module.js.map +1 -0
- package/dist/utils/streaming.d.ts +55 -0
- package/dist/utils/streaming.d.ts.map +1 -0
- package/dist/utils/streaming.js +72 -0
- package/dist/utils/streaming.js.map +1 -0
- package/dist/utils/tokens.d.ts +16 -0
- package/dist/utils/tokens.d.ts.map +1 -0
- package/dist/utils/tokens.js +80 -0
- package/dist/utils/tokens.js.map +1 -0
- package/dist/wrappers.d.ts +37 -0
- package/dist/wrappers.d.ts.map +1 -0
- package/dist/wrappers.js +61 -0
- package/dist/wrappers.js.map +1 -0
- package/llms-full.txt +127 -0
- package/llms.txt +28 -0
- package/mcp.schema.json +18 -0
- package/package.json +189 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared type definitions for the Amplitude AI SDK.
|
|
4
|
+
*
|
|
5
|
+
* Structural interfaces for provider request/response shapes,
|
|
6
|
+
* events, and the core AmplitudeLike contract. These are
|
|
7
|
+
* "duck-typed" interfaces — they describe the subset of each
|
|
8
|
+
* provider SDK's shape that we actually use, without importing
|
|
9
|
+
* the real SDK types.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Event payload shape for Amplitude tracking.
|
|
13
|
+
* Used when passing events to `AmplitudeLike.track()`.
|
|
14
|
+
*/
|
|
15
|
+
interface AmplitudeEvent {
|
|
16
|
+
event_type: string;
|
|
17
|
+
user_id?: string;
|
|
18
|
+
device_id?: string;
|
|
19
|
+
session_id?: number;
|
|
20
|
+
event_properties?: Record<string, unknown>;
|
|
21
|
+
user_properties?: Record<string, unknown>;
|
|
22
|
+
groups?: Record<string, unknown>;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Contract for Amplitude analytics clients.
|
|
27
|
+
* Any object with a `track(event)` method satisfies this interface.
|
|
28
|
+
*/
|
|
29
|
+
interface AmplitudeLike {
|
|
30
|
+
track: (event: AmplitudeEvent) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Extended Amplitude client with flush, shutdown, and optional init.
|
|
34
|
+
* Used by the SDK when it owns or receives an Amplitude instance.
|
|
35
|
+
*/
|
|
36
|
+
interface AmplitudeClientLike extends AmplitudeLike {
|
|
37
|
+
flush: () => unknown;
|
|
38
|
+
shutdown?: () => void;
|
|
39
|
+
init?: (apiKey: string) => unknown;
|
|
40
|
+
configuration?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Structural type matching AmplitudeAI instances.
|
|
44
|
+
* Allows providers to accept either an AmplitudeLike (raw analytics client)
|
|
45
|
+
* or an AmplitudeAI instance (which exposes `.amplitude` getter).
|
|
46
|
+
* This avoids circular imports while enabling the convenience pattern:
|
|
47
|
+
* new OpenAI({ amplitude: ai }) // AmplitudeAI
|
|
48
|
+
* new OpenAI({ amplitude: amp }) // raw Amplitude client
|
|
49
|
+
*/
|
|
50
|
+
interface AmplitudeAILike {
|
|
51
|
+
readonly amplitude: AmplitudeClientLike;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Union type accepted by provider constructors.
|
|
55
|
+
* Providers call `resolveAmplitude()` to normalize to `AmplitudeLike`.
|
|
56
|
+
*/
|
|
57
|
+
type AmplitudeOrAI = AmplitudeLike | AmplitudeAILike;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve an `AmplitudeOrAI` value to a plain `AmplitudeLike`.
|
|
60
|
+
*/
|
|
61
|
+
declare function resolveAmplitude(input: AmplitudeOrAI): AmplitudeLike;
|
|
62
|
+
/**
|
|
63
|
+
* Single message in a chat completion request.
|
|
64
|
+
* Supports role, content, optional name, and tool calls.
|
|
65
|
+
*/
|
|
66
|
+
interface ChatMessage {
|
|
67
|
+
role: string;
|
|
68
|
+
content?: string | null;
|
|
69
|
+
name?: string;
|
|
70
|
+
tool_calls?: ToolCallShape[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Structural interface for OpenAI-compatible chat completion parameters.
|
|
74
|
+
* Used by the OpenAI and Azure OpenAI provider wrappers.
|
|
75
|
+
*/
|
|
76
|
+
interface ChatCompletionParams {
|
|
77
|
+
model: string;
|
|
78
|
+
messages: ChatMessage[];
|
|
79
|
+
temperature?: number;
|
|
80
|
+
top_p?: number;
|
|
81
|
+
max_tokens?: number;
|
|
82
|
+
stream?: boolean;
|
|
83
|
+
[key: string]: unknown;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Structural interface for OpenAI-compatible chat completion responses.
|
|
87
|
+
* Describes the subset of the OpenAI SDK's response shape that the SDK tracks.
|
|
88
|
+
*/
|
|
89
|
+
interface ChatCompletionResponse {
|
|
90
|
+
model: string;
|
|
91
|
+
choices: ChatChoice[];
|
|
92
|
+
usage?: OpenAITokenUsage;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Single choice in a chat completion response.
|
|
96
|
+
*/
|
|
97
|
+
interface ChatChoice {
|
|
98
|
+
message: {
|
|
99
|
+
content?: string | null;
|
|
100
|
+
tool_calls?: ToolCallShape[];
|
|
101
|
+
};
|
|
102
|
+
finish_reason?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Token usage metadata for OpenAI/Azure OpenAI responses.
|
|
106
|
+
*/
|
|
107
|
+
interface OpenAITokenUsage {
|
|
108
|
+
prompt_tokens?: number;
|
|
109
|
+
completion_tokens?: number;
|
|
110
|
+
total_tokens?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Structural interface for OpenAI Responses API request input items.
|
|
114
|
+
*/
|
|
115
|
+
interface OpenAIResponseInput {
|
|
116
|
+
role?: string;
|
|
117
|
+
content?: string | Array<{
|
|
118
|
+
text?: string;
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}>;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Structural interface for OpenAI Responses API output content blocks.
|
|
125
|
+
*/
|
|
126
|
+
interface OpenAIResponseOutputContentItem {
|
|
127
|
+
type?: string;
|
|
128
|
+
text?: string;
|
|
129
|
+
[key: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Structural interface for OpenAI Responses API output items.
|
|
133
|
+
*/
|
|
134
|
+
interface OpenAIResponseOutputItem {
|
|
135
|
+
type?: string;
|
|
136
|
+
status?: string;
|
|
137
|
+
content?: OpenAIResponseOutputContentItem[];
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Structural interface for OpenAI Responses API usage metadata.
|
|
142
|
+
*/
|
|
143
|
+
interface OpenAIResponseUsage {
|
|
144
|
+
input_tokens?: number;
|
|
145
|
+
output_tokens?: number;
|
|
146
|
+
total_tokens?: number;
|
|
147
|
+
output_tokens_details?: {
|
|
148
|
+
reasoning_tokens?: number;
|
|
149
|
+
[key: string]: unknown;
|
|
150
|
+
};
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Structural interface for OpenAI Responses API responses.
|
|
155
|
+
*/
|
|
156
|
+
interface OpenAIResponse {
|
|
157
|
+
model?: string;
|
|
158
|
+
status?: string;
|
|
159
|
+
output_text?: string;
|
|
160
|
+
output?: OpenAIResponseOutputItem[];
|
|
161
|
+
usage?: OpenAIResponseUsage;
|
|
162
|
+
[key: string]: unknown;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Structural interface for Anthropic chat completion request parameters.
|
|
166
|
+
*/
|
|
167
|
+
interface AnthropicParams {
|
|
168
|
+
model: string;
|
|
169
|
+
system?: string;
|
|
170
|
+
messages: unknown[];
|
|
171
|
+
max_tokens?: number;
|
|
172
|
+
temperature?: number;
|
|
173
|
+
top_p?: number;
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Structural interface for Anthropic chat completion responses.
|
|
178
|
+
*/
|
|
179
|
+
interface AnthropicResponse {
|
|
180
|
+
model: string;
|
|
181
|
+
content: ContentBlock[];
|
|
182
|
+
usage: AnthropicTokenUsage;
|
|
183
|
+
stop_reason?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Content block in an Anthropic response (text, thinking, or tool_use).
|
|
187
|
+
*/
|
|
188
|
+
interface ContentBlock {
|
|
189
|
+
type: 'text' | 'thinking' | 'tool_use';
|
|
190
|
+
text?: string;
|
|
191
|
+
thinking?: string;
|
|
192
|
+
name?: string;
|
|
193
|
+
input?: unknown;
|
|
194
|
+
id?: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Token usage metadata for Anthropic responses.
|
|
198
|
+
*/
|
|
199
|
+
interface AnthropicTokenUsage {
|
|
200
|
+
input_tokens: number;
|
|
201
|
+
output_tokens: number;
|
|
202
|
+
cache_read_input_tokens?: number;
|
|
203
|
+
cache_creation_input_tokens?: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Structural interface for Google Gemini API responses.
|
|
207
|
+
* Supports both response object and legacy text/usageMetadata shape.
|
|
208
|
+
*/
|
|
209
|
+
interface GeminiResponse {
|
|
210
|
+
response?: GeminiResponseObject;
|
|
211
|
+
text?: (() => string) | string;
|
|
212
|
+
usageMetadata?: GeminiUsageMetadata;
|
|
213
|
+
candidates?: GeminiCandidate[];
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Wrapper object for Gemini response (response.text, usageMetadata, candidates).
|
|
217
|
+
*/
|
|
218
|
+
interface GeminiResponseObject {
|
|
219
|
+
text?: () => string;
|
|
220
|
+
usageMetadata?: GeminiUsageMetadata;
|
|
221
|
+
candidates?: GeminiCandidate[];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Token usage metadata for Gemini responses.
|
|
225
|
+
*/
|
|
226
|
+
interface GeminiUsageMetadata {
|
|
227
|
+
promptTokenCount?: number;
|
|
228
|
+
candidatesTokenCount?: number;
|
|
229
|
+
totalTokenCount?: number;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Single candidate in a Gemini response.
|
|
233
|
+
*/
|
|
234
|
+
interface GeminiCandidate {
|
|
235
|
+
finishReason?: string;
|
|
236
|
+
content?: {
|
|
237
|
+
parts?: GeminiPart[];
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Part of a Gemini candidate (text or functionCall).
|
|
242
|
+
*/
|
|
243
|
+
interface GeminiPart {
|
|
244
|
+
text?: string;
|
|
245
|
+
functionCall?: {
|
|
246
|
+
name: string;
|
|
247
|
+
args: Record<string, unknown>;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Structural interface for AWS Bedrock Converse API request parameters.
|
|
252
|
+
*/
|
|
253
|
+
interface BedrockConverseParams {
|
|
254
|
+
modelId: string;
|
|
255
|
+
messages?: unknown[];
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Structural interface for AWS Bedrock Converse API responses.
|
|
260
|
+
*/
|
|
261
|
+
interface BedrockConverseResponse {
|
|
262
|
+
output?: {
|
|
263
|
+
message?: {
|
|
264
|
+
content?: Array<{
|
|
265
|
+
text?: string;
|
|
266
|
+
}>;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
usage?: {
|
|
270
|
+
inputTokens?: number;
|
|
271
|
+
outputTokens?: number;
|
|
272
|
+
totalTokens?: number;
|
|
273
|
+
};
|
|
274
|
+
stopReason?: string;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Structural interface for Mistral chat completion request parameters.
|
|
278
|
+
*/
|
|
279
|
+
interface MistralChatParams {
|
|
280
|
+
model: string;
|
|
281
|
+
messages: unknown[];
|
|
282
|
+
temperature?: number;
|
|
283
|
+
top_p?: number;
|
|
284
|
+
max_tokens?: number;
|
|
285
|
+
[key: string]: unknown;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Structural interface for Mistral chat completion responses.
|
|
289
|
+
*/
|
|
290
|
+
interface MistralChatResponse {
|
|
291
|
+
model?: string;
|
|
292
|
+
choices?: MistralChoice[];
|
|
293
|
+
usage?: MistralTokenUsage;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Single choice in a Mistral chat response.
|
|
297
|
+
*/
|
|
298
|
+
interface MistralChoice {
|
|
299
|
+
message?: {
|
|
300
|
+
content?: string | unknown[] | null;
|
|
301
|
+
};
|
|
302
|
+
finish_reason?: string;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Token usage metadata for Mistral responses.
|
|
306
|
+
*/
|
|
307
|
+
interface MistralTokenUsage {
|
|
308
|
+
prompt_tokens?: number;
|
|
309
|
+
completion_tokens?: number;
|
|
310
|
+
total_tokens?: number;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Shape of a tool/function call across provider SDKs.
|
|
314
|
+
*/
|
|
315
|
+
interface ToolCallShape {
|
|
316
|
+
name: string;
|
|
317
|
+
arguments?: unknown;
|
|
318
|
+
id?: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* File or URL attachment for messages (e.g., image, document).
|
|
322
|
+
*/
|
|
323
|
+
interface Attachment {
|
|
324
|
+
type: string;
|
|
325
|
+
name?: string;
|
|
326
|
+
content?: string;
|
|
327
|
+
url?: string;
|
|
328
|
+
size_bytes?: number;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Callback used by provider wrappers to emit an AI response tracking event.
|
|
332
|
+
*
|
|
333
|
+
* Provider wrappers (OpenAI, Anthropic, etc.) receive a `TrackFn` via
|
|
334
|
+
* `BaseAIProvider.trackFn()` and call it after each completion or stream
|
|
335
|
+
* finishes. The function serializes the options into an Amplitude event
|
|
336
|
+
* and sends it via the underlying Amplitude client.
|
|
337
|
+
*
|
|
338
|
+
* @returns The generated message ID for the tracked event.
|
|
339
|
+
*/
|
|
340
|
+
type TrackFn = (opts: TrackCallOptions) => string;
|
|
341
|
+
/**
|
|
342
|
+
* Options passed to the internal track function for LLM completion events.
|
|
343
|
+
*
|
|
344
|
+
* This is the unified shape used by all provider wrappers to report a
|
|
345
|
+
* single AI completion (streaming or non-streaming). Fields like
|
|
346
|
+
* `reasoningTokens`, `cacheReadInputTokens`, and `totalCostUsd` are
|
|
347
|
+
* optional and populated when the provider returns that data.
|
|
348
|
+
*/
|
|
349
|
+
interface TrackCallOptions {
|
|
350
|
+
userId: string;
|
|
351
|
+
modelName: string;
|
|
352
|
+
provider: string;
|
|
353
|
+
responseContent: string;
|
|
354
|
+
latencyMs: number;
|
|
355
|
+
sessionId?: string | null;
|
|
356
|
+
traceId?: string | null;
|
|
357
|
+
turnId?: number;
|
|
358
|
+
agentId?: string | null;
|
|
359
|
+
parentAgentId?: string | null;
|
|
360
|
+
customerOrgId?: string | null;
|
|
361
|
+
env?: string | null;
|
|
362
|
+
groups?: Record<string, unknown> | null;
|
|
363
|
+
inputTokens?: number | null;
|
|
364
|
+
outputTokens?: number | null;
|
|
365
|
+
totalTokens?: number | null;
|
|
366
|
+
reasoningTokens?: number | null;
|
|
367
|
+
cacheReadInputTokens?: number | null;
|
|
368
|
+
cacheCreationInputTokens?: number | null;
|
|
369
|
+
totalCostUsd?: number | null;
|
|
370
|
+
providerTtfbMs?: number | null;
|
|
371
|
+
isError?: boolean;
|
|
372
|
+
errorMessage?: string | null;
|
|
373
|
+
finishReason?: string | null;
|
|
374
|
+
toolCalls?: Array<ToolCallShape | Record<string, unknown>> | null;
|
|
375
|
+
reasoningContent?: string | null;
|
|
376
|
+
systemPrompt?: string | null;
|
|
377
|
+
temperature?: number | null;
|
|
378
|
+
maxOutputTokens?: number | null;
|
|
379
|
+
topP?: number | null;
|
|
380
|
+
isStreaming?: boolean;
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
export { AmplitudeAILike, AmplitudeClientLike, AmplitudeEvent, AmplitudeLike, AmplitudeOrAI, AnthropicParams, AnthropicResponse, AnthropicTokenUsage, Attachment, BedrockConverseParams, BedrockConverseResponse, ChatChoice, ChatCompletionParams, ChatCompletionResponse, ChatMessage, ContentBlock, GeminiCandidate, GeminiPart, GeminiResponse, GeminiResponseObject, GeminiUsageMetadata, MistralChatParams, MistralChatResponse, MistralChoice, MistralTokenUsage, OpenAIResponse, OpenAIResponseInput, OpenAIResponseOutputContentItem, OpenAIResponseOutputItem, OpenAIResponseUsage, OpenAITokenUsage, ToolCallShape, TrackCallOptions, TrackFn, resolveAmplitude };
|
|
384
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;AAkBA;;;;;AAeA;AAQA;AAeA;AAQA;AAKA;AA0BA;AAWA;AAciB,UAtGA,cAAA,CAsGsB;EAStB,UAAA,EAAA,MAAU;EAQV,OAAA,CAAA,EAAA,MAAA;EASA,SAAA,CAAA,EAAA,MAAA;EASA,UAAA,CAAA,EAAA,MAAA;EASA,gBAAA,CAAA,EA7II,MA6IJ,CAAA,MAAwB,EAAA,OAG7B,CAAA;EAOK,eAAA,CAAA,EAtJG,MAsJgB,CAAA,MAAA,EAAA,OAAA,CAAA;EAcnB,MAAA,CAAA,EAnKN,MAmKM,CAAA,MAAc,EAAA,OAIpB,CAAA;EAYM,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAe;AAahC;AAUA;AAYA;AAeA;;AAGkB,UAhOD,aAAA,CAgOC;EACH,KAAA,EAAA,CAAA,KAAA,EAhOE,cAgOF,EAAA,GAAA,IAAA;;AAMf;AASA;AASA;AAQA;AAYiB,UArQA,mBAAA,SAA4B,aAqQP,CAAA;EASrB,KAAA,EAAA,GAAA,GAAA,OAAA;EAqBA,QAAA,CAAA,EAAA,GAAA,GAAA,IAAiB;EAYjB,IAAA,CAAA,EAAA,CAAA,MAAA,EAAA,MAAmB,EAAA,GAAA,OAAA;EASnB,aAAA,CAAA,EApTC,MAoTY,CAAA,MAAA,EAAA,OAAA,CAAA;AAQ9B;AAaA;AASA;AAkBA;AAUA;;;;;AAyBmB,UA5XF,eAAA,CA4XE;sBA3XG;;;;;;KAOV,aAAA,GAAgB,gBAAgB;;;;iBAK5B,gBAAA,QAAwB,gBAAgB;;;;;UA0BvC,WAAA;;;;eAIF;;;;;;UAOE,oBAAA;;YAEL;;;;;;;;;;;UAYK,sBAAA;;WAEN;UACD;;;;;UAMO,UAAA;;;iBACkC;;;;;;;UAOlC,gBAAA;;;;;;;;UASA,mBAAA;;qBAEI;;;;;;;;;UAOJ,+BAAA;;;;;;;;UASA,wBAAA;;;YAGL;;;;;;UAOK,mBAAA;;;;;;;;;;;;;UAcA,cAAA;;;;WAIN;UACD;;;;;;UAWO,eAAA;;;;;;;;;;;;UAaA,iBAAA;;WAEN;SACF;;;;;;UAOQ,YAAA;;;;;;;;;;;UAYA,mBAAA;;;;;;;;;;UAeA,cAAA;aACJ;;kBAEK;eACH;;;;;UAME,oBAAA;;kBAEC;eACH;;;;;UAME,mBAAA;;;;;;;;UASA,eAAA;;;YAEK;;;;;;UAML,UAAA;;;;UAEsB;;;;;;UAUtB,qBAAA;;;;;;;;UASA,uBAAA;;;gBAGD;;;;;;;;;;;;;;;UAkBC,iBAAA;;;;;;;;;;;UAYA,mBAAA;;YAEL;UACF;;;;;UAMO,aAAA;;;;;;;;;UAQA,iBAAA;;;;;;;;UAaA,aAAA;;;;;;;;UASA,UAAA;;;;;;;;;;;;;;;;;KAkBL,OAAA,UAAiB;;;;;;;;;UAUZ,gBAAA;;;;;;;;;;;;;WAaN;;;;;;;;;;;;cAYG,MAAM,gBAAgB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/types.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an `AmplitudeOrAI` value to a plain `AmplitudeLike`.
|
|
4
|
+
*/
|
|
5
|
+
function resolveAmplitude(input) {
|
|
6
|
+
if ("amplitude" in input && typeof input.amplitude === "object" && input.amplitude !== null && "track" in input.amplitude) return input.amplitude;
|
|
7
|
+
if ("track" in input && typeof input.track === "function") return input;
|
|
8
|
+
throw new Error("Expected an AmplitudeLike (with .track()) or AmplitudeAI (with .amplitude) instance. Pass either your AmplitudeAI instance or ai.amplitude.");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { resolveAmplitude };
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared type definitions for the Amplitude AI SDK.\n *\n * Structural interfaces for provider request/response shapes,\n * events, and the core AmplitudeLike contract. These are\n * \"duck-typed\" interfaces — they describe the subset of each\n * provider SDK's shape that we actually use, without importing\n * the real SDK types.\n */\n\n// ---------------------------------------------------------------------------\n// Amplitude client contract\n// ---------------------------------------------------------------------------\n\n/**\n * Event payload shape for Amplitude tracking.\n * Used when passing events to `AmplitudeLike.track()`.\n */\nexport interface AmplitudeEvent {\n event_type: string;\n user_id?: string;\n device_id?: string;\n session_id?: number;\n event_properties?: Record<string, unknown>;\n user_properties?: Record<string, unknown>;\n groups?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/**\n * Contract for Amplitude analytics clients.\n * Any object with a `track(event)` method satisfies this interface.\n */\nexport interface AmplitudeLike {\n track: (event: AmplitudeEvent) => void;\n}\n\n/**\n * Extended Amplitude client with flush, shutdown, and optional init.\n * Used by the SDK when it owns or receives an Amplitude instance.\n */\nexport interface AmplitudeClientLike extends AmplitudeLike {\n flush: () => unknown;\n shutdown?: () => void;\n init?: (apiKey: string) => unknown;\n configuration?: Record<string, unknown>;\n}\n\n/**\n * Structural type matching AmplitudeAI instances.\n * Allows providers to accept either an AmplitudeLike (raw analytics client)\n * or an AmplitudeAI instance (which exposes `.amplitude` getter).\n * This avoids circular imports while enabling the convenience pattern:\n * new OpenAI({ amplitude: ai }) // AmplitudeAI\n * new OpenAI({ amplitude: amp }) // raw Amplitude client\n */\nexport interface AmplitudeAILike {\n readonly amplitude: AmplitudeClientLike;\n}\n\n/**\n * Union type accepted by provider constructors.\n * Providers call `resolveAmplitude()` to normalize to `AmplitudeLike`.\n */\nexport type AmplitudeOrAI = AmplitudeLike | AmplitudeAILike;\n\n/**\n * Resolve an `AmplitudeOrAI` value to a plain `AmplitudeLike`.\n */\nexport function resolveAmplitude(input: AmplitudeOrAI): AmplitudeLike {\n if (\n 'amplitude' in input &&\n typeof input.amplitude === 'object' &&\n input.amplitude !== null &&\n 'track' in input.amplitude\n ) {\n return input.amplitude;\n }\n if ('track' in input && typeof input.track === 'function') {\n return input as AmplitudeLike;\n }\n throw new Error(\n 'Expected an AmplitudeLike (with .track()) or AmplitudeAI (with .amplitude) instance. ' +\n 'Pass either your AmplitudeAI instance or ai.amplitude.',\n );\n}\n\n// ---------------------------------------------------------------------------\n// OpenAI-compatible shapes (also used by Azure OpenAI)\n// ---------------------------------------------------------------------------\n\n/**\n * Single message in a chat completion request.\n * Supports role, content, optional name, and tool calls.\n */\nexport interface ChatMessage {\n role: string;\n content?: string | null;\n name?: string;\n tool_calls?: ToolCallShape[];\n}\n\n/**\n * Structural interface for OpenAI-compatible chat completion parameters.\n * Used by the OpenAI and Azure OpenAI provider wrappers.\n */\nexport interface ChatCompletionParams {\n model: string;\n messages: ChatMessage[];\n temperature?: number;\n top_p?: number;\n max_tokens?: number;\n stream?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for OpenAI-compatible chat completion responses.\n * Describes the subset of the OpenAI SDK's response shape that the SDK tracks.\n */\nexport interface ChatCompletionResponse {\n model: string;\n choices: ChatChoice[];\n usage?: OpenAITokenUsage;\n}\n\n/**\n * Single choice in a chat completion response.\n */\nexport interface ChatChoice {\n message: { content?: string | null; tool_calls?: ToolCallShape[] };\n finish_reason?: string;\n}\n\n/**\n * Token usage metadata for OpenAI/Azure OpenAI responses.\n */\nexport interface OpenAITokenUsage {\n prompt_tokens?: number;\n completion_tokens?: number;\n total_tokens?: number;\n}\n\n/**\n * Structural interface for OpenAI Responses API request input items.\n */\nexport interface OpenAIResponseInput {\n role?: string;\n content?: string | Array<{ text?: string; [key: string]: unknown }>;\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for OpenAI Responses API output content blocks.\n */\nexport interface OpenAIResponseOutputContentItem {\n type?: string;\n text?: string;\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for OpenAI Responses API output items.\n */\nexport interface OpenAIResponseOutputItem {\n type?: string;\n status?: string;\n content?: OpenAIResponseOutputContentItem[];\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for OpenAI Responses API usage metadata.\n */\nexport interface OpenAIResponseUsage {\n input_tokens?: number;\n output_tokens?: number;\n total_tokens?: number;\n output_tokens_details?: {\n reasoning_tokens?: number;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for OpenAI Responses API responses.\n */\nexport interface OpenAIResponse {\n model?: string;\n status?: string;\n output_text?: string;\n output?: OpenAIResponseOutputItem[];\n usage?: OpenAIResponseUsage;\n [key: string]: unknown;\n}\n\n// ---------------------------------------------------------------------------\n// Anthropic shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Structural interface for Anthropic chat completion request parameters.\n */\nexport interface AnthropicParams {\n model: string;\n system?: string;\n messages: unknown[];\n max_tokens?: number;\n temperature?: number;\n top_p?: number;\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for Anthropic chat completion responses.\n */\nexport interface AnthropicResponse {\n model: string;\n content: ContentBlock[];\n usage: AnthropicTokenUsage;\n stop_reason?: string;\n}\n\n/**\n * Content block in an Anthropic response (text, thinking, or tool_use).\n */\nexport interface ContentBlock {\n type: 'text' | 'thinking' | 'tool_use';\n text?: string;\n thinking?: string;\n name?: string;\n input?: unknown;\n id?: string;\n}\n\n/**\n * Token usage metadata for Anthropic responses.\n */\nexport interface AnthropicTokenUsage {\n input_tokens: number;\n output_tokens: number;\n cache_read_input_tokens?: number;\n cache_creation_input_tokens?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Gemini shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Structural interface for Google Gemini API responses.\n * Supports both response object and legacy text/usageMetadata shape.\n */\nexport interface GeminiResponse {\n response?: GeminiResponseObject;\n text?: (() => string) | string;\n usageMetadata?: GeminiUsageMetadata;\n candidates?: GeminiCandidate[];\n}\n\n/**\n * Wrapper object for Gemini response (response.text, usageMetadata, candidates).\n */\nexport interface GeminiResponseObject {\n text?: () => string;\n usageMetadata?: GeminiUsageMetadata;\n candidates?: GeminiCandidate[];\n}\n\n/**\n * Token usage metadata for Gemini responses.\n */\nexport interface GeminiUsageMetadata {\n promptTokenCount?: number;\n candidatesTokenCount?: number;\n totalTokenCount?: number;\n}\n\n/**\n * Single candidate in a Gemini response.\n */\nexport interface GeminiCandidate {\n finishReason?: string;\n content?: { parts?: GeminiPart[] };\n}\n\n/**\n * Part of a Gemini candidate (text or functionCall).\n */\nexport interface GeminiPart {\n text?: string;\n functionCall?: { name: string; args: Record<string, unknown> };\n}\n\n// ---------------------------------------------------------------------------\n// Bedrock shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Structural interface for AWS Bedrock Converse API request parameters.\n */\nexport interface BedrockConverseParams {\n modelId: string;\n messages?: unknown[];\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for AWS Bedrock Converse API responses.\n */\nexport interface BedrockConverseResponse {\n output?: {\n message?: {\n content?: Array<{ text?: string }>;\n };\n };\n usage?: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n };\n stopReason?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Mistral shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Structural interface for Mistral chat completion request parameters.\n */\nexport interface MistralChatParams {\n model: string;\n messages: unknown[];\n temperature?: number;\n top_p?: number;\n max_tokens?: number;\n [key: string]: unknown;\n}\n\n/**\n * Structural interface for Mistral chat completion responses.\n */\nexport interface MistralChatResponse {\n model?: string;\n choices?: MistralChoice[];\n usage?: MistralTokenUsage;\n}\n\n/**\n * Single choice in a Mistral chat response.\n */\nexport interface MistralChoice {\n message?: { content?: string | unknown[] | null };\n finish_reason?: string;\n}\n\n/**\n * Token usage metadata for Mistral responses.\n */\nexport interface MistralTokenUsage {\n prompt_tokens?: number;\n completion_tokens?: number;\n total_tokens?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Common shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Shape of a tool/function call across provider SDKs.\n */\nexport interface ToolCallShape {\n name: string;\n arguments?: unknown;\n id?: string;\n}\n\n/**\n * File or URL attachment for messages (e.g., image, document).\n */\nexport interface Attachment {\n type: string;\n name?: string;\n content?: string;\n url?: string;\n size_bytes?: number;\n}\n\n/**\n * Callback used by provider wrappers to emit an AI response tracking event.\n *\n * Provider wrappers (OpenAI, Anthropic, etc.) receive a `TrackFn` via\n * `BaseAIProvider.trackFn()` and call it after each completion or stream\n * finishes. The function serializes the options into an Amplitude event\n * and sends it via the underlying Amplitude client.\n *\n * @returns The generated message ID for the tracked event.\n */\nexport type TrackFn = (opts: TrackCallOptions) => string;\n\n/**\n * Options passed to the internal track function for LLM completion events.\n *\n * This is the unified shape used by all provider wrappers to report a\n * single AI completion (streaming or non-streaming). Fields like\n * `reasoningTokens`, `cacheReadInputTokens`, and `totalCostUsd` are\n * optional and populated when the provider returns that data.\n */\nexport interface TrackCallOptions {\n userId: string;\n modelName: string;\n provider: string;\n responseContent: string;\n latencyMs: number;\n sessionId?: string | null;\n traceId?: string | null;\n turnId?: number;\n agentId?: string | null;\n parentAgentId?: string | null;\n customerOrgId?: string | null;\n env?: string | null;\n groups?: Record<string, unknown> | null;\n inputTokens?: number | null;\n outputTokens?: number | null;\n totalTokens?: number | null;\n reasoningTokens?: number | null;\n cacheReadInputTokens?: number | null;\n cacheCreationInputTokens?: number | null;\n totalCostUsd?: number | null;\n providerTtfbMs?: number | null;\n isError?: boolean;\n errorMessage?: string | null;\n finishReason?: string | null;\n toolCalls?: Array<ToolCallShape | Record<string, unknown>> | null;\n reasoningContent?: string | null;\n systemPrompt?: string | null;\n temperature?: number | null;\n maxOutputTokens?: number | null;\n topP?: number | null;\n isStreaming?: boolean;\n}\n"],"mappings":";;;;AAqEA,SAAgB,iBAAiB,OAAqC;AACpE,KACE,eAAe,SACf,OAAO,MAAM,cAAc,YAC3B,MAAM,cAAc,QACpB,WAAW,MAAM,UAEjB,QAAO,MAAM;AAEf,KAAI,WAAW,SAAS,OAAO,MAAM,UAAU,WAC7C,QAAO;AAET,OAAM,IAAI,MACR,8IAED"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inferProviderFromModel } from "./providers.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/costs.d.ts
|
|
4
|
+
|
|
5
|
+
declare function stripProviderPrefix(modelName: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Infer the provider name from a model name.
|
|
8
|
+
* Delegates to the canonical implementation in utils/providers.ts.
|
|
9
|
+
*/
|
|
10
|
+
declare const inferProvider: typeof inferProviderFromModel;
|
|
11
|
+
/**
|
|
12
|
+
* Generate candidate model names for price lookup, mirroring Python's
|
|
13
|
+
* get_genai_price_lookup_candidates(). Tries progressively stripped names
|
|
14
|
+
* so the caller can attempt each until a match is found.
|
|
15
|
+
*/
|
|
16
|
+
declare function getGenaiPriceLookupCandidates(modelName: string): string[];
|
|
17
|
+
declare function calculateCost(options: {
|
|
18
|
+
modelName: string;
|
|
19
|
+
inputTokens: number;
|
|
20
|
+
outputTokens: number;
|
|
21
|
+
reasoningTokens?: number;
|
|
22
|
+
cacheReadInputTokens?: number;
|
|
23
|
+
cacheCreationInputTokens?: number;
|
|
24
|
+
}): number;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { calculateCost, getGenaiPriceLookupCandidates, inferProvider, stripProviderPrefix };
|
|
27
|
+
//# sourceMappingURL=costs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costs.d.ts","names":[],"sources":["../../src/utils/costs.ts"],"sourcesContent":[],"mappings":";;;;iBAYgB,mBAAA;;;;;cAgBH,sBAAa;;;;;;iBAOV,6BAAA;iBAmBA,aAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { inferProviderFromModel } from "./providers.js";
|
|
2
|
+
import { tryRequire } from "./resolve-module.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/costs.ts
|
|
5
|
+
/**
|
|
6
|
+
* Cost calculation utilities.
|
|
7
|
+
*
|
|
8
|
+
* Uses the genai-prices package when available (npm: @pydantic/genai-prices).
|
|
9
|
+
* Falls back to returning 0 when not installed.
|
|
10
|
+
*/
|
|
11
|
+
const genaiPrices = tryRequire("@pydantic/genai-prices");
|
|
12
|
+
function stripProviderPrefix(modelName) {
|
|
13
|
+
const colonIdx = modelName.indexOf(":");
|
|
14
|
+
return colonIdx >= 0 ? modelName.slice(colonIdx + 1) : modelName;
|
|
15
|
+
}
|
|
16
|
+
function normalizeBedrockModel(modelName) {
|
|
17
|
+
return modelName.match(/(?:us\.|eu\.|ap\.)?(?:anthropic|meta|mistral|amazon|cohere)\.(.*)/)?.[1] ?? modelName;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Infer the provider name from a model name.
|
|
21
|
+
* Delegates to the canonical implementation in utils/providers.ts.
|
|
22
|
+
*/
|
|
23
|
+
const inferProvider = inferProviderFromModel;
|
|
24
|
+
/**
|
|
25
|
+
* Generate candidate model names for price lookup, mirroring Python's
|
|
26
|
+
* get_genai_price_lookup_candidates(). Tries progressively stripped names
|
|
27
|
+
* so the caller can attempt each until a match is found.
|
|
28
|
+
*/
|
|
29
|
+
function getGenaiPriceLookupCandidates(modelName) {
|
|
30
|
+
const candidates = [];
|
|
31
|
+
const stripped = stripProviderPrefix(modelName);
|
|
32
|
+
const normalized = normalizeBedrockModel(stripped);
|
|
33
|
+
if (normalized !== modelName) candidates.push(normalized);
|
|
34
|
+
if (stripped !== modelName && stripped !== normalized) candidates.push(stripped);
|
|
35
|
+
candidates.push(modelName);
|
|
36
|
+
return [...new Set(candidates)];
|
|
37
|
+
}
|
|
38
|
+
function safeInt(value) {
|
|
39
|
+
if (typeof value === "number" && !Number.isNaN(value)) return Math.round(value);
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
function calculateCost(options) {
|
|
43
|
+
const { modelName, inputTokens, outputTokens, reasoningTokens = 0, cacheReadInputTokens = 0, cacheCreationInputTokens = 0 } = options;
|
|
44
|
+
if (genaiPrices != null) try {
|
|
45
|
+
const prices = genaiPrices;
|
|
46
|
+
if (typeof prices.calculateCost === "function") {
|
|
47
|
+
const normalized = normalizeBedrockModel(stripProviderPrefix(modelName));
|
|
48
|
+
return prices.calculateCost({
|
|
49
|
+
model: normalized,
|
|
50
|
+
inputTokens: safeInt(inputTokens),
|
|
51
|
+
outputTokens: safeInt(outputTokens),
|
|
52
|
+
reasoningTokens: safeInt(reasoningTokens),
|
|
53
|
+
cacheReadInputTokens: safeInt(cacheReadInputTokens),
|
|
54
|
+
cacheCreationInputTokens: safeInt(cacheCreationInputTokens)
|
|
55
|
+
}) ?? 0;
|
|
56
|
+
}
|
|
57
|
+
} catch {}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { calculateCost, getGenaiPriceLookupCandidates, inferProvider, stripProviderPrefix };
|
|
63
|
+
//# sourceMappingURL=costs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costs.js","names":["candidates: string[]"],"sources":["../../src/utils/costs.ts"],"sourcesContent":["/**\n * Cost calculation utilities.\n *\n * Uses the genai-prices package when available (npm: @pydantic/genai-prices).\n * Falls back to returning 0 when not installed.\n */\n\nimport { inferProviderFromModel } from './providers.js';\nimport { tryRequire } from './resolve-module.js';\n\nconst genaiPrices = tryRequire('@pydantic/genai-prices');\n\nexport function stripProviderPrefix(modelName: string): string {\n const colonIdx = modelName.indexOf(':');\n return colonIdx >= 0 ? modelName.slice(colonIdx + 1) : modelName;\n}\n\nfunction normalizeBedrockModel(modelName: string): string {\n const match = modelName.match(\n /(?:us\\.|eu\\.|ap\\.)?(?:anthropic|meta|mistral|amazon|cohere)\\.(.*)/,\n );\n return match?.[1] ?? modelName;\n}\n\n/**\n * Infer the provider name from a model name.\n * Delegates to the canonical implementation in utils/providers.ts.\n */\nexport const inferProvider = inferProviderFromModel;\n\n/**\n * Generate candidate model names for price lookup, mirroring Python's\n * get_genai_price_lookup_candidates(). Tries progressively stripped names\n * so the caller can attempt each until a match is found.\n */\nexport function getGenaiPriceLookupCandidates(modelName: string): string[] {\n const candidates: string[] = [];\n const stripped = stripProviderPrefix(modelName);\n const normalized = normalizeBedrockModel(stripped);\n\n if (normalized !== modelName) candidates.push(normalized);\n if (stripped !== modelName && stripped !== normalized)\n candidates.push(stripped);\n candidates.push(modelName);\n\n return [...new Set(candidates)];\n}\n\nfunction safeInt(value: unknown): number {\n if (typeof value === 'number' && !Number.isNaN(value))\n return Math.round(value);\n return 0;\n}\n\nexport function calculateCost(options: {\n modelName: string;\n inputTokens: number;\n outputTokens: number;\n reasoningTokens?: number;\n cacheReadInputTokens?: number;\n cacheCreationInputTokens?: number;\n}): number {\n const {\n modelName,\n inputTokens,\n outputTokens,\n reasoningTokens = 0,\n cacheReadInputTokens = 0,\n cacheCreationInputTokens = 0,\n } = options;\n\n if (genaiPrices != null) {\n try {\n const prices = genaiPrices as Record<string, unknown>;\n if (typeof prices.calculateCost === 'function') {\n const stripped = stripProviderPrefix(modelName);\n const normalized = normalizeBedrockModel(stripped);\n const cost = prices.calculateCost({\n model: normalized,\n inputTokens: safeInt(inputTokens),\n outputTokens: safeInt(outputTokens),\n reasoningTokens: safeInt(reasoningTokens),\n cacheReadInputTokens: safeInt(cacheReadInputTokens),\n cacheCreationInputTokens: safeInt(cacheCreationInputTokens),\n }) as number | null;\n return cost ?? 0;\n }\n } catch {\n // Fall through to 0\n }\n }\n\n return 0;\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,cAAc,WAAW,yBAAyB;AAExD,SAAgB,oBAAoB,WAA2B;CAC7D,MAAM,WAAW,UAAU,QAAQ,IAAI;AACvC,QAAO,YAAY,IAAI,UAAU,MAAM,WAAW,EAAE,GAAG;;AAGzD,SAAS,sBAAsB,WAA2B;AAIxD,QAHc,UAAU,MACtB,oEACD,GACc,MAAM;;;;;;AAOvB,MAAa,gBAAgB;;;;;;AAO7B,SAAgB,8BAA8B,WAA6B;CACzE,MAAMA,aAAuB,EAAE;CAC/B,MAAM,WAAW,oBAAoB,UAAU;CAC/C,MAAM,aAAa,sBAAsB,SAAS;AAElD,KAAI,eAAe,UAAW,YAAW,KAAK,WAAW;AACzD,KAAI,aAAa,aAAa,aAAa,WACzC,YAAW,KAAK,SAAS;AAC3B,YAAW,KAAK,UAAU;AAE1B,QAAO,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC;;AAGjC,SAAS,QAAQ,OAAwB;AACvC,KAAI,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,MAAM,CACnD,QAAO,KAAK,MAAM,MAAM;AAC1B,QAAO;;AAGT,SAAgB,cAAc,SAOnB;CACT,MAAM,EACJ,WACA,aACA,cACA,kBAAkB,GAClB,uBAAuB,GACvB,2BAA2B,MACzB;AAEJ,KAAI,eAAe,KACjB,KAAI;EACF,MAAM,SAAS;AACf,MAAI,OAAO,OAAO,kBAAkB,YAAY;GAE9C,MAAM,aAAa,sBADF,oBAAoB,UAAU,CACG;AASlD,UARa,OAAO,cAAc;IAChC,OAAO;IACP,aAAa,QAAQ,YAAY;IACjC,cAAc,QAAQ,aAAa;IACnC,iBAAiB,QAAQ,gBAAgB;IACzC,sBAAsB,QAAQ,qBAAqB;IACnD,0BAA0B,QAAQ,yBAAyB;IAC5D,CAAC,IACa;;SAEX;AAKV,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","names":[],"sources":["../../src/utils/debug.ts"],"sourcesContent":[],"mappings":";iBAyCgB,eAAA;AAAA,iBAuEA,gBAAA,CAvEe,KAAA,EAAA,OAAA,CAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EVENT_AI_RESPONSE, EVENT_EMBEDDING, EVENT_SCORE, EVENT_SESSION_END, EVENT_SESSION_ENRICHMENT, EVENT_SPAN, EVENT_TOOL_CALL, EVENT_USER_MESSAGE, PROP_AGENT_ID, PROP_COST_USD, PROP_EMBEDDING_DIMENSIONS, PROP_ENRICHMENTS, PROP_INPUT_TOKENS, PROP_IS_ERROR, PROP_LATENCY_MS, PROP_MODEL_NAME, PROP_OUTPUT_TOKENS, PROP_PROVIDER, PROP_SCORE_NAME, PROP_SCORE_VALUE, PROP_SESSION_ID, PROP_SPAN_NAME, PROP_TARGET_ID, PROP_TOOL_NAME, PROP_TOOL_SUCCESS } from "../core/constants.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/debug.ts
|
|
4
|
+
const CYAN = "\x1B[36m";
|
|
5
|
+
const GREEN = "\x1B[32m";
|
|
6
|
+
const RED = "\x1B[31m";
|
|
7
|
+
const YELLOW = "\x1B[33m";
|
|
8
|
+
const DIM = "\x1B[2m";
|
|
9
|
+
const RESET = "\x1B[0m";
|
|
10
|
+
function formatDebugLine(event) {
|
|
11
|
+
const e = event;
|
|
12
|
+
const eventType = e.event_type ?? "unknown";
|
|
13
|
+
const userId = e.user_id ?? "?";
|
|
14
|
+
const props = e.event_properties ?? {};
|
|
15
|
+
let line = `${CYAN}[amplitude-ai]${RESET} ${eventType} ${DIM}|${RESET} user=${userId}`;
|
|
16
|
+
const sessionId = props[PROP_SESSION_ID];
|
|
17
|
+
if (sessionId) line += ` session=${sessionId}`;
|
|
18
|
+
const agentId = props[PROP_AGENT_ID];
|
|
19
|
+
if (agentId) line += ` agent=${agentId}`;
|
|
20
|
+
if (eventType === EVENT_AI_RESPONSE) {
|
|
21
|
+
const model = props[PROP_MODEL_NAME] ?? "?";
|
|
22
|
+
const latency = props[PROP_LATENCY_MS] ?? "?";
|
|
23
|
+
const inputTokens = props[PROP_INPUT_TOKENS] ?? "?";
|
|
24
|
+
const outputTokens = props[PROP_OUTPUT_TOKENS] ?? "?";
|
|
25
|
+
const cost = props[PROP_COST_USD];
|
|
26
|
+
line += ` ${GREEN}model=${model}${RESET} latency=${latency}ms tokens=${inputTokens}→${outputTokens}`;
|
|
27
|
+
if (cost != null) line += ` cost=$${cost}`;
|
|
28
|
+
if (props[PROP_IS_ERROR]) line += ` ${RED}ERROR${RESET}`;
|
|
29
|
+
} else if (eventType === EVENT_TOOL_CALL) {
|
|
30
|
+
line += ` ${YELLOW}tool=${props[PROP_TOOL_NAME] ?? "?"}${RESET}`;
|
|
31
|
+
line += ` success=${props[PROP_TOOL_SUCCESS] ?? "?"}`;
|
|
32
|
+
line += ` latency=${props[PROP_LATENCY_MS] ?? "?"}ms`;
|
|
33
|
+
} else if (eventType === EVENT_USER_MESSAGE) {
|
|
34
|
+
const latency = props[PROP_LATENCY_MS];
|
|
35
|
+
if (latency != null) line += ` latency=${latency}ms`;
|
|
36
|
+
} else if (eventType === EVENT_SCORE) {
|
|
37
|
+
line += ` ${GREEN}score=${props[PROP_SCORE_NAME] ?? "?"}${RESET}`;
|
|
38
|
+
line += ` value=${props[PROP_SCORE_VALUE] ?? "?"}`;
|
|
39
|
+
line += ` target=${props[PROP_TARGET_ID] ?? "?"}`;
|
|
40
|
+
} else if (eventType === EVENT_EMBEDDING) {
|
|
41
|
+
line += ` ${GREEN}model=${props[PROP_MODEL_NAME] ?? "?"}${RESET}`;
|
|
42
|
+
line += ` provider=${props[PROP_PROVIDER] ?? "?"}`;
|
|
43
|
+
const dims = props[PROP_EMBEDDING_DIMENSIONS];
|
|
44
|
+
if (dims != null) line += ` dims=${dims}`;
|
|
45
|
+
line += ` latency=${props[PROP_LATENCY_MS] ?? "?"}ms`;
|
|
46
|
+
} else if (eventType === EVENT_SPAN) {
|
|
47
|
+
line += ` ${YELLOW}span=${props[PROP_SPAN_NAME] ?? "?"}${RESET}`;
|
|
48
|
+
line += ` latency=${props[PROP_LATENCY_MS] ?? "?"}ms`;
|
|
49
|
+
if (props[PROP_IS_ERROR]) line += ` ${RED}ERROR${RESET}`;
|
|
50
|
+
} else if (eventType === EVENT_SESSION_END) line += ` ${DIM}session-end${RESET}`;
|
|
51
|
+
else if (eventType === EVENT_SESSION_ENRICHMENT) {
|
|
52
|
+
const enrichments = props[PROP_ENRICHMENTS];
|
|
53
|
+
let count = 0;
|
|
54
|
+
if (enrichments != null && typeof enrichments === "object") count = Object.keys(enrichments).length;
|
|
55
|
+
else if (typeof enrichments === "string") try {
|
|
56
|
+
const parsed = JSON.parse(enrichments);
|
|
57
|
+
if (parsed != null && typeof parsed === "object" && !Array.isArray(parsed)) count = Object.keys(parsed).length;
|
|
58
|
+
} catch {}
|
|
59
|
+
line += ` ${DIM}enrichment keys=${count}${RESET}`;
|
|
60
|
+
}
|
|
61
|
+
return line;
|
|
62
|
+
}
|
|
63
|
+
function formatDryRunLine(event) {
|
|
64
|
+
try {
|
|
65
|
+
return JSON.stringify(event);
|
|
66
|
+
} catch {
|
|
67
|
+
return String(event);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { formatDebugLine, formatDryRunLine };
|
|
73
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","names":[],"sources":["../../src/utils/debug.ts"],"sourcesContent":["import {\n EVENT_AI_RESPONSE,\n EVENT_EMBEDDING,\n EVENT_SCORE,\n EVENT_SESSION_END,\n EVENT_SESSION_ENRICHMENT,\n EVENT_SPAN,\n EVENT_TOOL_CALL,\n EVENT_USER_MESSAGE,\n PROP_AGENT_ID,\n PROP_COST_USD,\n PROP_EMBEDDING_DIMENSIONS,\n PROP_ENRICHMENTS,\n PROP_INPUT_TOKENS,\n PROP_IS_ERROR,\n PROP_LATENCY_MS,\n PROP_MODEL_NAME,\n PROP_OUTPUT_TOKENS,\n PROP_PROVIDER,\n PROP_SCORE_NAME,\n PROP_SCORE_VALUE,\n PROP_SESSION_ID,\n PROP_SPAN_NAME,\n PROP_TARGET_ID,\n PROP_TOOL_NAME,\n PROP_TOOL_SUCCESS,\n} from '../core/constants.js';\n\nconst CYAN = '\\x1b[36m';\nconst GREEN = '\\x1b[32m';\nconst RED = '\\x1b[31m';\nconst YELLOW = '\\x1b[33m';\nconst DIM = '\\x1b[2m';\nconst RESET = '\\x1b[0m';\n\ninterface EventLike {\n event_type?: string;\n user_id?: string;\n event_properties?: Record<string, unknown>;\n}\n\nexport function formatDebugLine(event: unknown): string {\n const e = event as EventLike;\n const eventType = e.event_type ?? 'unknown';\n const userId = e.user_id ?? '?';\n const props = e.event_properties ?? {};\n\n let line = `${CYAN}[amplitude-ai]${RESET} ${eventType} ${DIM}|${RESET} user=${userId}`;\n\n const sessionId = props[PROP_SESSION_ID];\n if (sessionId) line += ` session=${sessionId}`;\n\n const agentId = props[PROP_AGENT_ID];\n if (agentId) line += ` agent=${agentId}`;\n\n if (eventType === EVENT_AI_RESPONSE) {\n const model = props[PROP_MODEL_NAME] ?? '?';\n const latency = props[PROP_LATENCY_MS] ?? '?';\n const inputTokens = props[PROP_INPUT_TOKENS] ?? '?';\n const outputTokens = props[PROP_OUTPUT_TOKENS] ?? '?';\n const cost = props[PROP_COST_USD];\n line += ` ${GREEN}model=${model}${RESET} latency=${latency}ms tokens=${inputTokens}→${outputTokens}`;\n if (cost != null) line += ` cost=$${cost}`;\n if (props[PROP_IS_ERROR]) line += ` ${RED}ERROR${RESET}`;\n } else if (eventType === EVENT_TOOL_CALL) {\n line += ` ${YELLOW}tool=${props[PROP_TOOL_NAME] ?? '?'}${RESET}`;\n line += ` success=${props[PROP_TOOL_SUCCESS] ?? '?'}`;\n line += ` latency=${props[PROP_LATENCY_MS] ?? '?'}ms`;\n } else if (eventType === EVENT_USER_MESSAGE) {\n const latency = props[PROP_LATENCY_MS];\n if (latency != null) line += ` latency=${latency}ms`;\n } else if (eventType === EVENT_SCORE) {\n line += ` ${GREEN}score=${props[PROP_SCORE_NAME] ?? '?'}${RESET}`;\n line += ` value=${props[PROP_SCORE_VALUE] ?? '?'}`;\n line += ` target=${props[PROP_TARGET_ID] ?? '?'}`;\n } else if (eventType === EVENT_EMBEDDING) {\n line += ` ${GREEN}model=${props[PROP_MODEL_NAME] ?? '?'}${RESET}`;\n line += ` provider=${props[PROP_PROVIDER] ?? '?'}`;\n const dims = props[PROP_EMBEDDING_DIMENSIONS];\n if (dims != null) line += ` dims=${dims}`;\n line += ` latency=${props[PROP_LATENCY_MS] ?? '?'}ms`;\n } else if (eventType === EVENT_SPAN) {\n line += ` ${YELLOW}span=${props[PROP_SPAN_NAME] ?? '?'}${RESET}`;\n line += ` latency=${props[PROP_LATENCY_MS] ?? '?'}ms`;\n if (props[PROP_IS_ERROR]) line += ` ${RED}ERROR${RESET}`;\n } else if (eventType === EVENT_SESSION_END) {\n line += ` ${DIM}session-end${RESET}`;\n } else if (eventType === EVENT_SESSION_ENRICHMENT) {\n const enrichments = props[PROP_ENRICHMENTS];\n let count = 0;\n if (enrichments != null && typeof enrichments === 'object') {\n count = Object.keys(enrichments).length;\n } else if (typeof enrichments === 'string') {\n try {\n const parsed = JSON.parse(enrichments) as unknown;\n if (\n parsed != null &&\n typeof parsed === 'object' &&\n !Array.isArray(parsed)\n ) {\n count = Object.keys(parsed).length;\n }\n } catch {\n // keep count at 0 when enrichments is non-JSON text\n }\n }\n line += ` ${DIM}enrichment keys=${count}${RESET}`;\n }\n\n return line;\n}\n\nexport function formatDryRunLine(event: unknown): string {\n try {\n return JSON.stringify(event);\n } catch {\n return String(event);\n }\n}\n"],"mappings":";;;AA4BA,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,QAAQ;AAQd,SAAgB,gBAAgB,OAAwB;CACtD,MAAM,IAAI;CACV,MAAM,YAAY,EAAE,cAAc;CAClC,MAAM,SAAS,EAAE,WAAW;CAC5B,MAAM,QAAQ,EAAE,oBAAoB,EAAE;CAEtC,IAAI,OAAO,GAAG,KAAK,gBAAgB,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,MAAM,QAAQ;CAE9E,MAAM,YAAY,MAAM;AACxB,KAAI,UAAW,SAAQ,YAAY;CAEnC,MAAM,UAAU,MAAM;AACtB,KAAI,QAAS,SAAQ,UAAU;AAE/B,KAAI,cAAc,mBAAmB;EACnC,MAAM,QAAQ,MAAM,oBAAoB;EACxC,MAAM,UAAU,MAAM,oBAAoB;EAC1C,MAAM,cAAc,MAAM,sBAAsB;EAChD,MAAM,eAAe,MAAM,uBAAuB;EAClD,MAAM,OAAO,MAAM;AACnB,UAAQ,IAAI,MAAM,QAAQ,QAAQ,MAAM,WAAW,QAAQ,YAAY,YAAY,GAAG;AACtF,MAAI,QAAQ,KAAM,SAAQ,UAAU;AACpC,MAAI,MAAM,eAAgB,SAAQ,IAAI,IAAI,OAAO;YACxC,cAAc,iBAAiB;AACxC,UAAQ,IAAI,OAAO,OAAO,MAAM,mBAAmB,MAAM;AACzD,UAAQ,YAAY,MAAM,sBAAsB;AAChD,UAAQ,YAAY,MAAM,oBAAoB,IAAI;YACzC,cAAc,oBAAoB;EAC3C,MAAM,UAAU,MAAM;AACtB,MAAI,WAAW,KAAM,SAAQ,YAAY,QAAQ;YACxC,cAAc,aAAa;AACpC,UAAQ,IAAI,MAAM,QAAQ,MAAM,oBAAoB,MAAM;AAC1D,UAAQ,UAAU,MAAM,qBAAqB;AAC7C,UAAQ,WAAW,MAAM,mBAAmB;YACnC,cAAc,iBAAiB;AACxC,UAAQ,IAAI,MAAM,QAAQ,MAAM,oBAAoB,MAAM;AAC1D,UAAQ,aAAa,MAAM,kBAAkB;EAC7C,MAAM,OAAO,MAAM;AACnB,MAAI,QAAQ,KAAM,SAAQ,SAAS;AACnC,UAAQ,YAAY,MAAM,oBAAoB,IAAI;YACzC,cAAc,YAAY;AACnC,UAAQ,IAAI,OAAO,OAAO,MAAM,mBAAmB,MAAM;AACzD,UAAQ,YAAY,MAAM,oBAAoB,IAAI;AAClD,MAAI,MAAM,eAAgB,SAAQ,IAAI,IAAI,OAAO;YACxC,cAAc,kBACvB,SAAQ,IAAI,IAAI,aAAa;UACpB,cAAc,0BAA0B;EACjD,MAAM,cAAc,MAAM;EAC1B,IAAI,QAAQ;AACZ,MAAI,eAAe,QAAQ,OAAO,gBAAgB,SAChD,SAAQ,OAAO,KAAK,YAAY,CAAC;WACxB,OAAO,gBAAgB,SAChC,KAAI;GACF,MAAM,SAAS,KAAK,MAAM,YAAY;AACtC,OACE,UAAU,QACV,OAAO,WAAW,YAClB,CAAC,MAAM,QAAQ,OAAO,CAEtB,SAAQ,OAAO,KAAK,OAAO,CAAC;UAExB;AAIV,UAAQ,IAAI,IAAI,kBAAkB,QAAQ;;AAG5C,QAAO;;AAGT,SAAgB,iBAAiB,OAAwB;AACvD,KAAI;AACF,SAAO,KAAK,UAAU,MAAM;SACtB;AACN,SAAO,OAAO,MAAM"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/utils/logger.d.ts
|
|
2
|
+
interface Logger {
|
|
3
|
+
debug(message: string): void;
|
|
4
|
+
error(message: string): void;
|
|
5
|
+
warn(message: string): void;
|
|
6
|
+
info(message: string): void;
|
|
7
|
+
}
|
|
8
|
+
declare function getLogger(amplitude?: unknown): Logger;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Logger, getLogger };
|
|
11
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","names":[],"sources":["../../src/utils/logger.ts"],"sourcesContent":[],"mappings":";UAAiB,MAAA;EAAA,KAAA,CAAA,OAAM,EAAA,MAAA,CAAA,EAAA,IAAA;EAcP,KAAA,CAAA,OAAS,EAAA,MAAA,CAAA,EAAA,IAAuB;;;;iBAAhC,SAAA,uBAAgC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/utils/logger.ts
|
|
2
|
+
const defaultLogger = {
|
|
3
|
+
debug: () => {},
|
|
4
|
+
error: (msg) => console.error(`[amplitude-ai] ${msg}`),
|
|
5
|
+
warn: (msg) => console.warn(`[amplitude-ai] ${msg}`),
|
|
6
|
+
info: () => {}
|
|
7
|
+
};
|
|
8
|
+
function getLogger(amplitude) {
|
|
9
|
+
if (amplitude && typeof amplitude === "object") {
|
|
10
|
+
const config = amplitude.configuration;
|
|
11
|
+
if (config?.loggerProvider && typeof config.loggerProvider === "object") return config.loggerProvider;
|
|
12
|
+
}
|
|
13
|
+
return defaultLogger;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getLogger };
|
|
18
|
+
//# sourceMappingURL=logger.js.map
|