@jini-ai/provider-plugins 0.7.3-next.1 → 0.7.3-next.3
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/CHANGELOG.md +2 -0
- package/catalog.json +25 -20
- package/dist/model-proxy-anthropic/index.d.ts +18 -0
- package/dist/model-proxy-anthropic/index.js +32 -0
- package/dist/model-proxy-azure/index.d.ts +19 -0
- package/dist/model-proxy-azure/index.js +32 -0
- package/dist/model-proxy-google/index.d.ts +18 -0
- package/dist/model-proxy-google/index.js +25 -0
- package/dist/model-proxy-ollama/index.d.ts +8 -0
- package/dist/model-proxy-ollama/index.js +13 -0
- package/dist/model-proxy-openai/index.d.ts +8 -0
- package/dist/model-proxy-openai/index.js +13 -0
- package/dist/observability-opentelemetry/contract.d.ts +2 -0
- package/dist/observability-opentelemetry/otel-port.d.ts +3 -1
- package/dist/observability-opentelemetry/otel-port.js +31 -15
- package/dist/xai/media/index.d.ts +67 -0
- package/dist/xai/media/index.js +132 -0
- package/dist/xai/oauth-port.d.ts +132 -0
- package/dist/xai/oauth-port.js +5 -0
- package/dist/xai/preset.d.ts +22 -0
- package/dist/xai/preset.js +28 -0
- package/dist/xai/routes.d.ts +108 -0
- package/dist/xai/routes.js +658 -0
- package/package.json +68 -27
- package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +3 -3
- package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/package-license.json +1 -1
- package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +2 -2
- package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/README.md +1 -1
- package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +4 -4
- package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/package-license.json +1 -1
- package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +2 -2
- package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/client/provider.js +1 -1
- package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +3 -3
- package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/package-license.json +1 -1
- package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +2 -2
- package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/package-license.json +1 -1
- package/plugins/fixture-provider/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +2 -2
- package/plugins/fixture-provider/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/formspree/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +2 -2
- package/plugins/formspree/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/google-forms/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +2 -2
- package/plugins/google-forms/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/README.md +1 -1
- package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +5 -5
- package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_core/package-license.json +1 -1
- package/plugins/observability-opentelemetry/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +42 -23
- package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/README.md +1 -1
- package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +5 -5
- package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_core/package-license.json +1 -1
- package/plugins/observability-sentry/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +19 -8
- package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/jini.plugin.json +2 -2
- package/plugins/payments-stripe/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/xai/0.7.3-next.3/jini.plugin.json +48 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_core/LICENSE +201 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_core/package-license.json +5 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_protocol/LICENSE +201 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_protocol/package-license.json +5 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_provider-plugins/LICENSE +201 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_provider-plugins/NOTICE +28 -0
- package/plugins/xai/0.7.3-next.3/licenses/_jini-ai_provider-plugins/package-license.json +5 -0
- package/plugins/xai/0.7.3-next.3/licenses/zod/LICENSE +21 -0
- package/plugins/xai/0.7.3-next.3/licenses/zod/package-license.json +5 -0
- package/plugins/xai/0.7.3-next.3/server/index.mjs +1597 -0
- package/plugins/fixture-provider/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- package/plugins/formspree/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- package/plugins/google-forms/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- package/plugins/observability-opentelemetry/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- package/plugins/observability-sentry/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- package/plugins/payments-stripe/0.7.3-next.1/licenses/_jini-ai_provider-plugins/package-license.json +0 -5
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/CHANGELOG.md +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/LICENSE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/NOTICE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/README.md +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse/LICENSE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse/LICENSE-SOURCE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse/SOURCE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse/package-license.json +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse-core/LICENSE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse-core/LICENSE-SOURCE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse-core/SOURCE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/langfuse-core/package-license.json +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/mustache/LICENSE +0 -0
- /package/plugins/ai-trace-langfuse/{0.7.3-next.1 → 0.7.3-next.3}/licenses/mustache/package-license.json +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/CHANGELOG.md +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/LICENSE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/NOTICE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_posthog_core/LICENSE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_posthog_core/package-license.json +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/posthog-js/LICENSE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/posthog-js/package-license.json +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/posthog-node/LICENSE +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/licenses/posthog-node/package-license.json +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/server/consent-adapter.mjs +0 -0
- /package/plugins/analytics-posthog/{0.7.3-next.1 → 0.7.3-next.3}/server/posthog-browser.js +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/client/styles.css +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/echarts/LICENSE +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/echarts/NOTICE +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/echarts/package-license.json +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/tslib/LICENSE.txt +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/tslib/package-license.json +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/zrender/LICENSE +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/zrender/package-license.json +0 -0
- /package/plugins/charts-echarts/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/client/provider.js +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/client/styles.css +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_reduxjs_toolkit/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_reduxjs_toolkit/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/clsx/license +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/clsx/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-array/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-array/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-color/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-color/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-format/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-format/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-interpolate/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-interpolate/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-path/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-path/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-scale/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-scale/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-shape/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-shape/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-time/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-time/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-time-format/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/d3-time-format/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/decimal.js-light/LICENCE.md +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/decimal.js-light/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/es-toolkit/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/es-toolkit/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/eventemitter3/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/eventemitter3/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/immer/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/immer/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/internmap/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/internmap/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-dom/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-dom/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-is/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-is/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-redux/LICENSE.md +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/react-redux/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/recharts/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/recharts/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/redux/LICENSE.md +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/redux/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/redux-thunk/LICENSE.md +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/redux-thunk/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/reselect/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/reselect/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/scheduler/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/scheduler/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/tiny-invariant/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/tiny-invariant/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/use-sync-external-store/LICENSE +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/use-sync-external-store/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/victory-vendor/LICENSE.txt +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/licenses/victory-vendor/package-license.json +0 -0
- /package/plugins/charts-recharts/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
- /package/plugins/fixture-provider/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/fixture-provider/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/fixture-provider/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
- /package/plugins/formspree/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/formspree/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/formspree/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
- /package/plugins/google-forms/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/google-forms/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/google-forms/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/CHANGELOG.md +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/NOTICE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_core/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api-logs/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api-logs/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_context-async-hooks/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_context-async-hooks/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_core/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_core/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_otlp-exporter-base/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_otlp-exporter-base/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_otlp-transformer/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_otlp-transformer/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_resources/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_resources/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-metrics/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-metrics/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace-base/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace-base/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace-node/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_sdk-trace-node/package-license.json +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_semantic-conventions/LICENSE +0 -0
- /package/plugins/observability-opentelemetry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_semantic-conventions/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/CHANGELOG.md +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/NOTICE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_core/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_opentelemetry_api/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_conventions/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_conventions/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_core/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_core/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_node/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_node/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_opentelemetry/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_opentelemetry/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-runtime-injection/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-runtime-injection/LICENSE-SOURCE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-runtime-injection/package-license.json +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-utils/LICENSE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-utils/LICENSE-SOURCE +0 -0
- /package/plugins/observability-sentry/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_sentry_server-utils/package-license.json +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/CHANGELOG.md +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/LICENSE +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/NOTICE +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/README.md +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/LICENSE +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/licenses/_jini-ai_provider-plugins/NOTICE +0 -0
- /package/plugins/payments-stripe/{0.7.3-next.1 → 0.7.3-next.3}/server/index.mjs +0 -0
package/catalog.json
CHANGED
|
@@ -1,52 +1,57 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"id": "ai-trace-langfuse",
|
|
4
|
-
"version": "0.7.3-next.
|
|
5
|
-
"path": "plugins/ai-trace-langfuse/0.7.3-next.
|
|
4
|
+
"version": "0.7.3-next.3",
|
|
5
|
+
"path": "plugins/ai-trace-langfuse/0.7.3-next.3"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"id": "analytics-posthog",
|
|
9
|
-
"version": "0.7.3-next.
|
|
10
|
-
"path": "plugins/analytics-posthog/0.7.3-next.
|
|
9
|
+
"version": "0.7.3-next.3",
|
|
10
|
+
"path": "plugins/analytics-posthog/0.7.3-next.3"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"id": "charts-echarts",
|
|
14
|
-
"version": "0.7.3-next.
|
|
15
|
-
"path": "plugins/charts-echarts/0.7.3-next.
|
|
14
|
+
"version": "0.7.3-next.3",
|
|
15
|
+
"path": "plugins/charts-echarts/0.7.3-next.3"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"id": "charts-recharts",
|
|
19
|
-
"version": "0.7.3-next.
|
|
20
|
-
"path": "plugins/charts-recharts/0.7.3-next.
|
|
19
|
+
"version": "0.7.3-next.3",
|
|
20
|
+
"path": "plugins/charts-recharts/0.7.3-next.3"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"id": "fixture-provider",
|
|
24
|
-
"version": "0.7.3-next.
|
|
25
|
-
"path": "plugins/fixture-provider/0.7.3-next.
|
|
24
|
+
"version": "0.7.3-next.3",
|
|
25
|
+
"path": "plugins/fixture-provider/0.7.3-next.3"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"id": "formspree",
|
|
29
|
-
"version": "0.7.3-next.
|
|
30
|
-
"path": "plugins/formspree/0.7.3-next.
|
|
29
|
+
"version": "0.7.3-next.3",
|
|
30
|
+
"path": "plugins/formspree/0.7.3-next.3"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"id": "google-forms",
|
|
34
|
-
"version": "0.7.3-next.
|
|
35
|
-
"path": "plugins/google-forms/0.7.3-next.
|
|
34
|
+
"version": "0.7.3-next.3",
|
|
35
|
+
"path": "plugins/google-forms/0.7.3-next.3"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"id": "observability-opentelemetry",
|
|
39
|
-
"version": "0.7.3-next.
|
|
40
|
-
"path": "plugins/observability-opentelemetry/0.7.3-next.
|
|
39
|
+
"version": "0.7.3-next.3",
|
|
40
|
+
"path": "plugins/observability-opentelemetry/0.7.3-next.3"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"id": "observability-sentry",
|
|
44
|
-
"version": "0.7.3-next.
|
|
45
|
-
"path": "plugins/observability-sentry/0.7.3-next.
|
|
44
|
+
"version": "0.7.3-next.3",
|
|
45
|
+
"path": "plugins/observability-sentry/0.7.3-next.3"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"id": "payments-stripe",
|
|
49
|
-
"version": "0.7.3-next.
|
|
50
|
-
"path": "plugins/payments-stripe/0.7.3-next.
|
|
49
|
+
"version": "0.7.3-next.3",
|
|
50
|
+
"path": "plugins/payments-stripe/0.7.3-next.3"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "xai",
|
|
54
|
+
"version": "0.7.3-next.3",
|
|
55
|
+
"path": "plugins/xai/0.7.3-next.3"
|
|
51
56
|
}
|
|
52
57
|
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `/api/proxy/anthropic/stream` registration: this provider's request parser and its tool-turn runner call.
|
|
3
|
+
* The daemon's model proxy holds no provider list; the host imports `createAnthropicProxyRegistration` and injects the result.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProxyProviderRegistration } from '@jini-ai/core/contracts/agents/proxy-provider';
|
|
6
|
+
import { type ParsedProxyCommon } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
7
|
+
import { type Result } from '@jini-ai/core/contracts/server';
|
|
8
|
+
export interface ParsedAnthropicProxyRequest extends ParsedProxyCommon {
|
|
9
|
+
readonly apiVersion?: string;
|
|
10
|
+
readonly system?: string;
|
|
11
|
+
readonly tools?: unknown[];
|
|
12
|
+
readonly maxTokens: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseAnthropicProxyRequest({ body }: {
|
|
15
|
+
body: unknown;
|
|
16
|
+
}, _optional?: Record<string, never>): Result<ParsedAnthropicProxyRequest>;
|
|
17
|
+
/** The Anthropic Messages registration: `maxTokens` is required (the API demands it), everything else forwards only when the request carried it. */
|
|
18
|
+
export declare function createAnthropicProxyRegistration(): ProxyProviderRegistration<ParsedAnthropicProxyRequest>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SYSTEM_CHECK, TOOLS_CHECK, extendParsed, isString, parseCommon, pickDefined, requiredFieldError, toolsOption } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
2
|
+
import { err } from '@jini-ai/core/contracts/server';
|
|
3
|
+
const ANTHROPIC_OPTIONAL_CHECKS = [
|
|
4
|
+
['apiVersion', (value) => isString({ value }), 'apiVersion must be a string when provided'],
|
|
5
|
+
SYSTEM_CHECK,
|
|
6
|
+
TOOLS_CHECK,
|
|
7
|
+
];
|
|
8
|
+
function isPositiveFiniteNumber(value) {
|
|
9
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0;
|
|
10
|
+
}
|
|
11
|
+
export function parseAnthropicProxyRequest({ body }, _optional = {}) {
|
|
12
|
+
const common = parseCommon({ body });
|
|
13
|
+
if (!common.ok)
|
|
14
|
+
return common;
|
|
15
|
+
const record = body;
|
|
16
|
+
if (!isPositiveFiniteNumber(record.maxTokens)) {
|
|
17
|
+
return err({ error: requiredFieldError({ path: 'maxTokens', message: 'maxTokens must be a positive number', issue: 'required positive number' }) });
|
|
18
|
+
}
|
|
19
|
+
return extendParsed({ base: common.value, record, checks: ANTHROPIC_OPTIONAL_CHECKS }, { required: { maxTokens: record.maxTokens } });
|
|
20
|
+
}
|
|
21
|
+
/** The Anthropic Messages registration: `maxTokens` is required (the API demands it), everything else forwards only when the request carried it. */
|
|
22
|
+
export function createAnthropicProxyRegistration() {
|
|
23
|
+
return {
|
|
24
|
+
id: 'anthropic',
|
|
25
|
+
parse: (body) => parseAnthropicProxyRequest({ body }),
|
|
26
|
+
run: (parsed, { toolTurns, onEvent, shared }) => toolTurns.anthropic({ apiKey: parsed.apiKey, model: parsed.model, maxTokens: parsed.maxTokens, messages: parsed.messages, onEvent }, {
|
|
27
|
+
...pickDefined({ source: parsed, keys: ['baseUrl', 'apiVersion', 'system', 'temperature', 'maxToolTurns', 'extraHeaders'] }),
|
|
28
|
+
...toolsOption({ tools: parsed.tools }),
|
|
29
|
+
...shared,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `/api/proxy/azure/stream` registration: this provider's request parser and its tool-turn runner call.
|
|
3
|
+
* The daemon's model proxy holds no provider list; the host imports `createAzureProxyRegistration` and injects the result.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProxyProviderRegistration } from '@jini-ai/core/contracts/agents/proxy-provider';
|
|
6
|
+
import { type ParsedProxyCommon } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
7
|
+
import { type Result } from '@jini-ai/core/contracts/server';
|
|
8
|
+
export interface ParsedAzureProxyRequest extends ParsedProxyCommon {
|
|
9
|
+
/** Required for Azure, unlike the other four providers — every Azure OpenAI resource has its own endpoint (see `@jini-ai/agent-runtime`'s `azure-chat.ts`). */
|
|
10
|
+
readonly baseUrl: string;
|
|
11
|
+
/** Required for Azure — no sane global default exists at the HTTP-request-shape level either (the turn-runner itself does have a `'2024-10-21'` fallback, but this route requires the caller be explicit). */
|
|
12
|
+
readonly apiVersion: string;
|
|
13
|
+
readonly tools?: unknown[];
|
|
14
|
+
}
|
|
15
|
+
export declare function parseAzureProxyRequest({ body }: {
|
|
16
|
+
body: unknown;
|
|
17
|
+
}, _optional?: Record<string, never>): Result<ParsedAzureProxyRequest>;
|
|
18
|
+
/** The Azure OpenAI registration: `baseUrl` and `apiVersion` are required, every Azure resource having its own endpoint. */
|
|
19
|
+
export declare function createAzureProxyRegistration(): ProxyProviderRegistration<ParsedAzureProxyRequest>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TOOLS_CHECK, extendParsed, nonEmptyString, parseCommon, pickDefined, requiredFieldError, toolsOption } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
2
|
+
import { err } from '@jini-ai/core/contracts/server';
|
|
3
|
+
export function parseAzureProxyRequest({ body }, _optional = {}) {
|
|
4
|
+
const common = parseCommon({ body });
|
|
5
|
+
if (!common.ok)
|
|
6
|
+
return common;
|
|
7
|
+
const record = body;
|
|
8
|
+
const { baseUrl } = common.value;
|
|
9
|
+
// Truthiness only, unlike `apiVersion`'s trim check: a whitespace-only baseUrl passes here and
|
|
10
|
+
// fails inside the turn-runner instead (pinned as "reported, not fixed").
|
|
11
|
+
if (!baseUrl) {
|
|
12
|
+
return err({ error: requiredFieldError({ path: 'baseUrl', message: 'baseUrl must be a non-empty string', issue: 'required non-empty string' }) });
|
|
13
|
+
}
|
|
14
|
+
const apiVersion = nonEmptyString({ value: record.apiVersion });
|
|
15
|
+
if (!apiVersion) {
|
|
16
|
+
return err({ error: requiredFieldError({ path: 'apiVersion', message: 'apiVersion must be a non-empty string', issue: 'required non-empty string' }) });
|
|
17
|
+
}
|
|
18
|
+
return extendParsed({ base: common.value, record, checks: [TOOLS_CHECK] }, { required: { baseUrl, apiVersion } });
|
|
19
|
+
}
|
|
20
|
+
/** The Azure OpenAI registration: `baseUrl` and `apiVersion` are required, every Azure resource having its own endpoint. */
|
|
21
|
+
export function createAzureProxyRegistration() {
|
|
22
|
+
return {
|
|
23
|
+
id: 'azure',
|
|
24
|
+
parse: (body) => parseAzureProxyRequest({ body }),
|
|
25
|
+
run: (parsed, { toolTurns, onEvent, shared }) => toolTurns.azure({ apiKey: parsed.apiKey, baseUrl: parsed.baseUrl, model: parsed.model, messages: parsed.messages, onEvent }, {
|
|
26
|
+
apiVersion: parsed.apiVersion,
|
|
27
|
+
...pickDefined({ source: parsed, keys: ['temperature', 'maxTokens', 'maxToolTurns', 'extraHeaders'] }),
|
|
28
|
+
...toolsOption({ tools: parsed.tools }),
|
|
29
|
+
...shared,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `/api/proxy/google/stream` registration: this provider's request parser and its tool-turn runner call.
|
|
3
|
+
* The daemon's model proxy holds no provider list; the host imports `createGoogleProxyRegistration` and injects the result.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProxyProviderRegistration } from '@jini-ai/core/contracts/agents/proxy-provider';
|
|
6
|
+
import { type ParsedProxyCommon } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
7
|
+
import type { Result } from '@jini-ai/core/contracts/server';
|
|
8
|
+
export interface ParsedGoogleProxyRequest extends ParsedProxyCommon {
|
|
9
|
+
readonly system?: string;
|
|
10
|
+
readonly tools?: unknown[];
|
|
11
|
+
readonly maxOutputTokens?: number;
|
|
12
|
+
}
|
|
13
|
+
/** `parsed.messages` carries Gemini's own `contents: [{role, parts}]` shape at the call site below (cast, same convention as `parsed.messages`) — the HTTP JSON body schema stays uniform across all five providers; only each turn-runner's own field name differs. */
|
|
14
|
+
export declare function parseGoogleProxyRequest({ body }: {
|
|
15
|
+
body: unknown;
|
|
16
|
+
}, _optional?: Record<string, never>): Result<ParsedGoogleProxyRequest>;
|
|
17
|
+
/** The Google (Gemini) registration: the body's `messages` travel to the runner as Gemini `contents`. */
|
|
18
|
+
export declare function createGoogleProxyRegistration(): ProxyProviderRegistration<ParsedGoogleProxyRequest>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SYSTEM_CHECK, TOOLS_CHECK, extendParsed, isNumber, parseCommon, pickDefined, toolsOption } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
2
|
+
const GOOGLE_OPTIONAL_CHECKS = [
|
|
3
|
+
SYSTEM_CHECK,
|
|
4
|
+
TOOLS_CHECK,
|
|
5
|
+
['maxOutputTokens', (value) => isNumber({ value }), 'maxOutputTokens must be a number when provided'],
|
|
6
|
+
];
|
|
7
|
+
/** `parsed.messages` carries Gemini's own `contents: [{role, parts}]` shape at the call site below (cast, same convention as `parsed.messages`) — the HTTP JSON body schema stays uniform across all five providers; only each turn-runner's own field name differs. */
|
|
8
|
+
export function parseGoogleProxyRequest({ body }, _optional = {}) {
|
|
9
|
+
const common = parseCommon({ body });
|
|
10
|
+
if (!common.ok)
|
|
11
|
+
return common;
|
|
12
|
+
return extendParsed({ base: common.value, record: body, checks: GOOGLE_OPTIONAL_CHECKS });
|
|
13
|
+
}
|
|
14
|
+
/** The Google (Gemini) registration: the body's `messages` travel to the runner as Gemini `contents`. */
|
|
15
|
+
export function createGoogleProxyRegistration() {
|
|
16
|
+
return {
|
|
17
|
+
id: 'google',
|
|
18
|
+
parse: (body) => parseGoogleProxyRequest({ body }),
|
|
19
|
+
run: (parsed, { toolTurns, onEvent, shared }) => toolTurns.google({ apiKey: parsed.apiKey, model: parsed.model, contents: parsed.messages, onEvent }, {
|
|
20
|
+
...pickDefined({ source: parsed, keys: ['baseUrl', 'system', 'temperature', 'maxOutputTokens', 'maxToolTurns', 'extraHeaders'] }),
|
|
21
|
+
...toolsOption({ tools: parsed.tools }),
|
|
22
|
+
...shared,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `/api/proxy/ollama/stream` registration: this provider's request parser and its tool-turn runner call.
|
|
3
|
+
* The daemon's model proxy holds no provider list; the host imports `createOllamaProxyRegistration` and injects the result.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProxyProviderRegistration } from '@jini-ai/core/contracts/agents/proxy-provider';
|
|
6
|
+
import { type ParsedToolsProxyRequest } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
7
|
+
/** The Ollama native `/api/chat` registration (`apiKey` required: the default target is Ollama Cloud); it shares the OpenAI-shaped request body (shared fields plus optional `tools`). */
|
|
8
|
+
export declare function createOllamaProxyRegistration(): ProxyProviderRegistration<ParsedToolsProxyRequest>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { parseToolsProxyRequest, pickDefined, toolsOption } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
2
|
+
/** The Ollama native `/api/chat` registration (`apiKey` required: the default target is Ollama Cloud); it shares the OpenAI-shaped request body (shared fields plus optional `tools`). */
|
|
3
|
+
export function createOllamaProxyRegistration() {
|
|
4
|
+
return {
|
|
5
|
+
id: 'ollama',
|
|
6
|
+
parse: (body) => parseToolsProxyRequest({ body }),
|
|
7
|
+
run: (parsed, { toolTurns, onEvent, shared }) => toolTurns.ollama({ apiKey: parsed.apiKey, model: parsed.model, messages: parsed.messages, onEvent }, {
|
|
8
|
+
...pickDefined({ source: parsed, keys: ['baseUrl', 'temperature', 'maxTokens', 'maxToolTurns', 'extraHeaders'] }),
|
|
9
|
+
...toolsOption({ tools: parsed.tools }),
|
|
10
|
+
...shared,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `/api/proxy/openai/stream` registration: this provider's request parser and its tool-turn runner call.
|
|
3
|
+
* The daemon's model proxy holds no provider list; the host imports `createOpenAiProxyRegistration` and injects the result.
|
|
4
|
+
*/
|
|
5
|
+
import type { ProxyProviderRegistration } from '@jini-ai/core/contracts/agents/proxy-provider';
|
|
6
|
+
import { type ParsedToolsProxyRequest } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
7
|
+
/** The OpenAI Chat Completions registration; it shares the OpenAI-shaped request body (shared fields plus optional `tools`). */
|
|
8
|
+
export declare function createOpenAiProxyRegistration(): ProxyProviderRegistration<ParsedToolsProxyRequest>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { parseToolsProxyRequest, pickDefined, toolsOption } from '@jini-ai/core/contracts/agents/proxy-provider-kit';
|
|
2
|
+
/** The OpenAI Chat Completions registration; it shares the OpenAI-shaped request body (shared fields plus optional `tools`). */
|
|
3
|
+
export function createOpenAiProxyRegistration() {
|
|
4
|
+
return {
|
|
5
|
+
id: 'openai',
|
|
6
|
+
parse: (body) => parseToolsProxyRequest({ body }),
|
|
7
|
+
run: (parsed, { toolTurns, onEvent, shared }) => toolTurns.openai({ apiKey: parsed.apiKey, model: parsed.model, messages: parsed.messages, onEvent }, {
|
|
8
|
+
...pickDefined({ source: parsed, keys: ['baseUrl', 'temperature', 'maxTokens', 'maxToolTurns', 'extraHeaders'] }),
|
|
9
|
+
...toolsOption({ tools: parsed.tools }),
|
|
10
|
+
...shared,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -12,6 +12,7 @@ export interface ObservabilityConfigEnabled {
|
|
|
12
12
|
}
|
|
13
13
|
export interface TraceSpanPort {
|
|
14
14
|
ids?(required?: Record<string, never>, optional?: Record<string, never>): TraceIds | undefined;
|
|
15
|
+
traceparent?(): string | undefined;
|
|
15
16
|
updateName(required: {
|
|
16
17
|
name: string;
|
|
17
18
|
}): void;
|
|
@@ -38,6 +39,7 @@ export interface TracerPort {
|
|
|
38
39
|
attributes: Record<string, string | number>;
|
|
39
40
|
}, optional?: {
|
|
40
41
|
parent?: TraceSpanPort;
|
|
42
|
+
traceparent?: string;
|
|
41
43
|
}): TraceSpanPort;
|
|
42
44
|
}
|
|
43
45
|
export interface SpanScopePort {
|
|
@@ -21,7 +21,9 @@ export declare function redactRequestTarget({ path }: {
|
|
|
21
21
|
routePattern?: string;
|
|
22
22
|
}): string;
|
|
23
23
|
/** Scheme, host and explicit port only. Paths carry bot tokens and signed-URL keys; userinfo carries passwords. */
|
|
24
|
-
export declare function outboundTargetAttributes(url
|
|
24
|
+
export declare function outboundTargetAttributes({ url }: {
|
|
25
|
+
url: string;
|
|
26
|
+
}, _optional?: Record<string, never>): Attributes;
|
|
25
27
|
/** Builds request, DB, outbound, agent-run and operation spans, and exception events for reported errors, through injected provider/exporter factories.
|
|
26
28
|
* @param required Explicit config and structural factories. Hosts wrap their SDK here.
|
|
27
29
|
* @param options Domain helpers (redaction and error labels, handed over as the factory context) and optional host scope storage; with it, spans started inside a tracker's run() are its children.
|
|
@@ -33,7 +33,7 @@ export function redactRequestTarget({ path }, { routePattern } = {}) {
|
|
|
33
33
|
return withoutQueryOrFragment(path).split('/').map(segment => safePathSegment({ segment })).join('/').slice(0, 1024);
|
|
34
34
|
}
|
|
35
35
|
/** Scheme, host and explicit port only. Paths carry bot tokens and signed-URL keys; userinfo carries passwords. */
|
|
36
|
-
export function outboundTargetAttributes(url) {
|
|
36
|
+
export function outboundTargetAttributes({ url }, _optional = {}) {
|
|
37
37
|
let parsed;
|
|
38
38
|
try {
|
|
39
39
|
parsed = new URL(url);
|
|
@@ -79,9 +79,9 @@ function finishWithOutcome({ ctx, span, attributes }, { error, softFailure } = {
|
|
|
79
79
|
}
|
|
80
80
|
finish({ ctx, span, attributes }, softFailure !== undefined ? { failure: softFailure } : {});
|
|
81
81
|
}
|
|
82
|
-
function start({ ctx, name, kind, attributes }, { root = false } = {}) {
|
|
82
|
+
function start({ ctx, name, kind, attributes }, { root = false, traceparent } = {}) {
|
|
83
83
|
const parent = root ? undefined : ctx.scope?.active();
|
|
84
|
-
return ctx.tracer.startSpan({ name, kind, attributes }, parent ? { parent } : {});
|
|
84
|
+
return ctx.tracer.startSpan({ name, kind, attributes }, { ...(parent ? { parent } : {}), ...(traceparent ? { traceparent } : {}) });
|
|
85
85
|
}
|
|
86
86
|
function runIn({ ctx, span }) {
|
|
87
87
|
return (fn) => (ctx.scope ? ctx.scope.run({ span, fn }) : fn());
|
|
@@ -113,7 +113,7 @@ function trackDbQuery({ ctx, system }) {
|
|
|
113
113
|
}) };
|
|
114
114
|
}
|
|
115
115
|
function trackOutboundCall({ ctx, method, url }) {
|
|
116
|
-
const target = outboundTargetAttributes(url);
|
|
116
|
+
const target = outboundTargetAttributes({ url });
|
|
117
117
|
const span = start({ ctx, name: `${method} ${target['server.address']}`, kind: 'client', attributes: { 'http.request.method': method, ...target } });
|
|
118
118
|
return { run: runIn({ ctx, span }), end: once(({ statusCode, error }) => {
|
|
119
119
|
const attributes = statusCode !== undefined ? { 'http.response.status_code': statusCode } : {};
|
|
@@ -121,12 +121,13 @@ function trackOutboundCall({ ctx, method, url }) {
|
|
|
121
121
|
finishWithOutcome({ ctx, span, attributes }, { error, ...(statusCode !== undefined && statusCode >= 400 ? { softFailure: String(statusCode) } : {}) });
|
|
122
122
|
}) };
|
|
123
123
|
}
|
|
124
|
-
function trackOperation({ ctx, name, attributes = {} }) {
|
|
124
|
+
function trackOperation({ ctx, name, attributes = {}, traceparent }) {
|
|
125
125
|
const { redactOperationAttributes, redactLabel } = ctx.helpers;
|
|
126
|
-
const span = start({ ctx, name, kind: 'internal', attributes: redactOperationAttributes({ attributes }) });
|
|
127
|
-
return { run: runIn({ ctx, span }), end: once(({ outcome, failed, attributes: settled = {} }) => {
|
|
126
|
+
const span = start({ ctx, name, kind: 'internal', attributes: redactOperationAttributes({ attributes }) }, traceparent ? { traceparent } : {});
|
|
127
|
+
return { run: runIn({ ctx, span }), traceIds: () => span.ids?.(), end: once(({ outcome, failed, attributes: settled = {} }) => {
|
|
128
128
|
// The feature decides what counts as failure; its outcome label doubles as the error type.
|
|
129
129
|
finish({ ctx, span, attributes: redactOperationAttributes({ attributes: { ...settled, 'operation.outcome': outcome } }) }, failed ? { failure: redactLabel({ text: outcome }) } : {});
|
|
130
|
+
ctx.metric?.({ name: 'operation.completed', value: 1 }, { kind: 'counter', attributes: { 'operation.name': name, 'operation.failed': failed ? 1 : 0 } });
|
|
130
131
|
}) };
|
|
131
132
|
}
|
|
132
133
|
function reportError({ ctx, error, context }) {
|
|
@@ -136,8 +137,8 @@ function reportError({ ctx, error, context }) {
|
|
|
136
137
|
// short root span. Type only, never the message: the same export rule errorType documents.
|
|
137
138
|
const active = ctx.scope?.active();
|
|
138
139
|
const span = active ?? start({ ctx, name: `error ${context.operation}`, kind: 'internal', attributes: redactOperationAttributes({ attributes: context.attributes ?? {} }) }, { root: true });
|
|
139
|
-
const type = errorType({ error });
|
|
140
|
-
span.addEvent({ name: 'exception', attributes: { 'exception.type': type, 'operation.name': context.operation } });
|
|
140
|
+
const type = context.incidentId && context.label ? context.label : errorType({ error });
|
|
141
|
+
span.addEvent({ name: 'exception', attributes: { 'exception.type': type, 'operation.name': context.operation, ...(context.incidentId ? { 'incident.id': context.incidentId } : {}) } });
|
|
141
142
|
span.setAttribute({ name: 'error.type', value: type });
|
|
142
143
|
span.setStatus({ code: 'error', description: type });
|
|
143
144
|
ctx.reportedSpans.add(span);
|
|
@@ -150,16 +151,30 @@ function reportError({ ctx, error, context }) {
|
|
|
150
151
|
return false;
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function agentUsageAttributes({ usage }, _optional = {}) {
|
|
155
|
+
const attributes = {};
|
|
156
|
+
if (!usage)
|
|
157
|
+
return attributes;
|
|
158
|
+
// Unreported usage stays absent; a reported zero is still usage, and pricing is never estimated.
|
|
159
|
+
for (const [name, value] of [['gen_ai.usage.input_tokens', usage.inputTokens], ['gen_ai.usage.output_tokens', usage.outputTokens]]) {
|
|
160
|
+
if (value !== undefined && Number.isInteger(value) && value >= 0)
|
|
161
|
+
attributes[name] = value;
|
|
162
|
+
}
|
|
163
|
+
if (usage.costUsd !== undefined && Number.isFinite(usage.costUsd) && usage.costUsd >= 0)
|
|
164
|
+
attributes['gen_ai.usage.cost_usd'] = usage.costUsd;
|
|
165
|
+
return attributes;
|
|
166
|
+
}
|
|
167
|
+
function trackAgentRun({ ctx, runId, conversationId, agentName, traceparent }) {
|
|
154
168
|
const startedAt = ctx.metric ? performance.now() : 0;
|
|
155
169
|
// A run outlives the request that started it, so it is its own trace rather than a long child.
|
|
156
170
|
const span = start({ ctx, name: agentName ? `invoke_agent ${agentName}` : 'invoke_agent', kind: 'internal', attributes: {
|
|
157
171
|
'gen_ai.operation.name': 'invoke_agent', ...(agentName ? { 'gen_ai.agent.name': agentName } : {}),
|
|
158
172
|
...(conversationId ? { 'gen_ai.conversation.id': conversationId } : {}), 'agent.run.id': runId,
|
|
159
|
-
} }, { root: true });
|
|
160
|
-
return { run: runIn({ ctx, span }), end: once(({ status, error }) => {
|
|
161
|
-
finishWithOutcome({ ctx, span, attributes: { 'agent.run.status': status } }, { error, ...(FAILED_RUN_STATUSES.has(status) ? { softFailure: status } : {}) });
|
|
173
|
+
} }, { root: true, ...(traceparent ? { traceparent } : {}) });
|
|
174
|
+
return { run: runIn({ ctx, span }), end: once(({ status, error, usage }) => {
|
|
175
|
+
finishWithOutcome({ ctx, span, attributes: { 'agent.run.status': status, ...agentUsageAttributes({ usage }) } }, { error, ...(FAILED_RUN_STATUSES.has(status) ? { softFailure: status } : {}) });
|
|
162
176
|
ctx.metric?.({ name: 'agent.run.duration', value: performance.now() - startedAt }, { kind: 'histogram', unit: 'ms' });
|
|
177
|
+
ctx.metric?.({ name: 'agent.run.completed', value: 1 }, { kind: 'counter', attributes: { 'agent.run.status': status } });
|
|
163
178
|
}) };
|
|
164
179
|
}
|
|
165
180
|
/** Builds request, DB, outbound, agent-run and operation spans, and exception events for reported errors, through injected provider/exporter factories.
|
|
@@ -175,13 +190,14 @@ export function createOtelObservabilityPort({ config, exporterFactory, tracerPro
|
|
|
175
190
|
return {
|
|
176
191
|
supportsMetric: false,
|
|
177
192
|
activeTraceIds: (_required = {}, _optional = {}) => scope?.active()?.ids?.(),
|
|
193
|
+
activeTraceparent: () => scope?.active()?.traceparent?.(),
|
|
178
194
|
// This structural tracing adapter has no metrics exporter; the provider plugin supplies it.
|
|
179
195
|
metric() { },
|
|
180
196
|
trackRequest: (input, { requestId } = {}) => trackRequest({ ctx, input, ...(requestId ? { requestId } : {}) }),
|
|
181
197
|
trackDbQuery: ({ system }) => trackDbQuery({ ctx, system }),
|
|
182
198
|
trackOutboundCall: ({ method, url }) => trackOutboundCall({ ctx, method, url }),
|
|
183
|
-
trackOperation: ({ name, attributes }) => trackOperation({ ctx, name, ...(attributes ? { attributes } : {}) }),
|
|
199
|
+
trackOperation: ({ name, attributes, traceparent }) => trackOperation({ ctx, name, ...(attributes ? { attributes } : {}), ...(traceparent ? { traceparent } : {}) }),
|
|
184
200
|
reportError: ({ error, context }) => reportError({ ctx, error, context }),
|
|
185
|
-
trackAgentRun: ({ runId }, { conversationId, agentName } = {}) => trackAgentRun({ ctx, runId, ...(conversationId ? { conversationId } : {}), ...(agentName ? { agentName } : {}) }),
|
|
201
|
+
trackAgentRun: ({ runId }, { conversationId, agentName, traceparent } = {}) => trackAgentRun({ ctx, runId, ...(conversationId ? { conversationId } : {}), ...(agentName ? { agentName } : {}), ...(traceparent ? { traceparent } : {}) }),
|
|
186
202
|
};
|
|
187
203
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI Grok Imagine as a media provider contribution: image generation through an
|
|
3
|
+
* OpenAI-images-compatible `/images/generations` endpoint, plus text-to-speech through the vendor's own
|
|
4
|
+
* `/tts` endpoint. Moved out of the host's built-in dispatch set; the request/response wire helpers are
|
|
5
|
+
* the host's, handed in as {@link MediaWirePort}.
|
|
6
|
+
*
|
|
7
|
+
* Image responses (`{ data: [{ b64_json | url }] }`) match the OpenAI images shape, so the image adapter
|
|
8
|
+
* reuses the host's JSON parsing and byte extraction. `/tts` returns raw audio bytes from a plain JSON
|
|
9
|
+
* POST with no per-request format negotiation, so it uses the raw-bytes parser. No OAuth or
|
|
10
|
+
* local-CLI-login concept lives here: credentials are always host-injected.
|
|
11
|
+
*/
|
|
12
|
+
import type { MediaProviderContribution, MediaWirePort } from '@jini-ai/core/contracts/site/media-provider-contribution';
|
|
13
|
+
/**
|
|
14
|
+
* Provider: xAI Grok — image generation via an OpenAI-images-compatible
|
|
15
|
+
* `/images/generations` endpoint (`renderGrokImage`), plus text-to-speech
|
|
16
|
+
* via a dedicated `/tts` endpoint (`renderXAITTS`). Ported near-verbatim
|
|
17
|
+
* from Open Design's `apps/daemon/src/media/index.ts` `renderGrokImage`/
|
|
18
|
+
* `renderXAITTS` — see `archived provenance ledger`.
|
|
19
|
+
*
|
|
20
|
+
* Image response shape (`{ data: [{ b64_json | url }] }`) is identical to
|
|
21
|
+
* OpenAI's images API, so `renderGrokImage` routes through
|
|
22
|
+
* `openai-compatible.ts`'s already-ported JSON-parsing/byte-extraction/
|
|
23
|
+
* URL-building helpers rather than re-implementing them. `/tts` is xAI's
|
|
24
|
+
* own dedicated endpoint (not the OpenAI `/audio/speech` shape) — it
|
|
25
|
+
* returns raw audio bytes directly from a plain JSON POST, with no
|
|
26
|
+
* per-request format negotiation the caller can control, so `renderXAITTS`
|
|
27
|
+
* doesn't route through `openai-compatible.ts` at all (only the generic
|
|
28
|
+
* `truncate`/`withRequestInit` helpers are shared).
|
|
29
|
+
*
|
|
30
|
+
* Dropped from the origin's no-credential error messages (both
|
|
31
|
+
* functions): the OD-specific "sign in with your SuperGrok subscription
|
|
32
|
+
* (in OD or via `hermes auth add xai-oauth`)" OAuth guidance — this
|
|
33
|
+
* package has no OAuth chain or local-CLI-login concept; credentials are
|
|
34
|
+
* always host-injected (see `types.ts`'s `ProviderCredentials`), matching
|
|
35
|
+
* every other ported provider's error-message style (e.g. `openai.ts`'s
|
|
36
|
+
* `OPENAI_IMAGE_NO_CREDENTIAL_MESSAGE`).
|
|
37
|
+
*
|
|
38
|
+
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
39
|
+
* (`vendor-adapter.ts`/`vendor-registry.ts`) — two adapters registered on
|
|
40
|
+
* the same `grok` provider id (`image`/`audio:speech`). External behavior
|
|
41
|
+
* is unchanged (verified against `grok.test.ts`, which asserts URL/body/
|
|
42
|
+
* header/error-message/providerNote shape and passes unmodified) — only
|
|
43
|
+
* the internal implementation moved. The image adapter is not routed
|
|
44
|
+
* through `response-parsers.ts`'s factories (reuses
|
|
45
|
+
* `openai-compatible.ts`'s JSON-parsing helpers directly, same as before —
|
|
46
|
+
* see `imagerouter.ts`'s module doc for the identical reasoning); the TTS
|
|
47
|
+
* adapter's response (raw bytes, no envelope) is the same shape
|
|
48
|
+
* `fishaudio.ts`/`openai.ts`'s speech renderer return, so it now shares
|
|
49
|
+
* `response-parsers.ts`'s `createRawBytesParser`.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* The catalogue provider id. Why `grok` and not the plugin id: saved credentials, env maps and existing
|
|
53
|
+
* sealed rows key on `grok`, so the contribution keeps that persisted identity instead of renaming it.
|
|
54
|
+
*/
|
|
55
|
+
export declare const XAI_MEDIA_PROVIDER_ID = "grok";
|
|
56
|
+
/** The old UI id a host injects as a registry alias (`createMediaProviderRegistry({}, { aliases })`), so lookups by it still find `grok`. */
|
|
57
|
+
export declare const XAI_MEDIA_PROVIDER_ALIASES: Readonly<Record<string, string>>;
|
|
58
|
+
/**
|
|
59
|
+
* Builds the xAI media contribution: one provider row, its three catalogued models and the image and
|
|
60
|
+
* speech adapters. The video model is a catalogue declaration only; no standalone video adapter exists.
|
|
61
|
+
* @param required.mediaWire - The host's generic wire helpers.
|
|
62
|
+
* @returns A fresh contribution; allocates no connection and reads no environment.
|
|
63
|
+
* @complexity O(1) time and space; no I/O.
|
|
64
|
+
*/
|
|
65
|
+
export declare function createXaiMediaContribution({ mediaWire }: {
|
|
66
|
+
mediaWire: MediaWirePort;
|
|
67
|
+
}, _optional?: Record<string, never>): MediaProviderContribution;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider: xAI Grok — image generation via an OpenAI-images-compatible
|
|
3
|
+
* `/images/generations` endpoint (`renderGrokImage`), plus text-to-speech
|
|
4
|
+
* via a dedicated `/tts` endpoint (`renderXAITTS`). Ported near-verbatim
|
|
5
|
+
* from Open Design's `apps/daemon/src/media/index.ts` `renderGrokImage`/
|
|
6
|
+
* `renderXAITTS` — see `archived provenance ledger`.
|
|
7
|
+
*
|
|
8
|
+
* Image response shape (`{ data: [{ b64_json | url }] }`) is identical to
|
|
9
|
+
* OpenAI's images API, so `renderGrokImage` routes through
|
|
10
|
+
* `openai-compatible.ts`'s already-ported JSON-parsing/byte-extraction/
|
|
11
|
+
* URL-building helpers rather than re-implementing them. `/tts` is xAI's
|
|
12
|
+
* own dedicated endpoint (not the OpenAI `/audio/speech` shape) — it
|
|
13
|
+
* returns raw audio bytes directly from a plain JSON POST, with no
|
|
14
|
+
* per-request format negotiation the caller can control, so `renderXAITTS`
|
|
15
|
+
* doesn't route through `openai-compatible.ts` at all (only the generic
|
|
16
|
+
* `truncate`/`withRequestInit` helpers are shared).
|
|
17
|
+
*
|
|
18
|
+
* Dropped from the origin's no-credential error messages (both
|
|
19
|
+
* functions): the OD-specific "sign in with your SuperGrok subscription
|
|
20
|
+
* (in OD or via `hermes auth add xai-oauth`)" OAuth guidance — this
|
|
21
|
+
* package has no OAuth chain or local-CLI-login concept; credentials are
|
|
22
|
+
* always host-injected (see `types.ts`'s `ProviderCredentials`), matching
|
|
23
|
+
* every other ported provider's error-message style (e.g. `openai.ts`'s
|
|
24
|
+
* `OPENAI_IMAGE_NO_CREDENTIAL_MESSAGE`).
|
|
25
|
+
*
|
|
26
|
+
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
27
|
+
* (`vendor-adapter.ts`/`vendor-registry.ts`) — two adapters registered on
|
|
28
|
+
* the same `grok` provider id (`image`/`audio:speech`). External behavior
|
|
29
|
+
* is unchanged (verified against `grok.test.ts`, which asserts URL/body/
|
|
30
|
+
* header/error-message/providerNote shape and passes unmodified) — only
|
|
31
|
+
* the internal implementation moved. The image adapter is not routed
|
|
32
|
+
* through `response-parsers.ts`'s factories (reuses
|
|
33
|
+
* `openai-compatible.ts`'s JSON-parsing helpers directly, same as before —
|
|
34
|
+
* see `imagerouter.ts`'s module doc for the identical reasoning); the TTS
|
|
35
|
+
* adapter's response (raw bytes, no envelope) is the same shape
|
|
36
|
+
* `fishaudio.ts`/`openai.ts`'s speech renderer return, so it now shares
|
|
37
|
+
* `response-parsers.ts`'s `createRawBytesParser`.
|
|
38
|
+
*/
|
|
39
|
+
// After the move the image and speech adapters below are `createImageAdapter` and `createSpeechAdapter`, and the host's
|
|
40
|
+
// wire helpers (the former `openai-compatible.ts` / `response-parsers.ts` functions) arrive as the injected `mediaWire` port.
|
|
41
|
+
/**
|
|
42
|
+
* The catalogue provider id. Why `grok` and not the plugin id: saved credentials, env maps and existing
|
|
43
|
+
* sealed rows key on `grok`, so the contribution keeps that persisted identity instead of renaming it.
|
|
44
|
+
*/
|
|
45
|
+
export const XAI_MEDIA_PROVIDER_ID = 'grok';
|
|
46
|
+
/** The old UI id a host injects as a registry alias (`createMediaProviderRegistry({}, { aliases })`), so lookups by it still find `grok`. */
|
|
47
|
+
export const XAI_MEDIA_PROVIDER_ALIASES = { 'xai-grok-imagine': XAI_MEDIA_PROVIDER_ID };
|
|
48
|
+
const PROVIDER_ID = XAI_MEDIA_PROVIDER_ID;
|
|
49
|
+
const DEFAULT_BASE_URL = 'https://api.x.ai/v1';
|
|
50
|
+
const NO_CREDENTIAL_MESSAGE = 'no xAI credential — configure an API key or set XAI_API_KEY.';
|
|
51
|
+
const TTS_DEFAULT_VOICE_ID = 'eve';
|
|
52
|
+
const TTS_DEFAULT_LANGUAGE = 'en';
|
|
53
|
+
const baseUrlOf = (credentials) => (credentials.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
54
|
+
function createImageAdapter({ mediaWire }, _optional = {}) {
|
|
55
|
+
return {
|
|
56
|
+
requireCredential: mediaWire.requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
57
|
+
buildRequest({ ctx, credentials }) {
|
|
58
|
+
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
59
|
+
const aspectRatio = mediaWire.imageAspectFor({ aspect: ctx.aspect });
|
|
60
|
+
const body = {
|
|
61
|
+
model: ctx.wireModel, prompt: ctx.prompt || 'A high-quality reference image.', n: 1, aspect_ratio: aspectRatio, response_format: 'b64_json',
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
url: mediaWire.imageGenerationUrl({ baseUrl: baseUrlOf(credentials) }),
|
|
65
|
+
init: mediaWire.jsonPostInit({ ctx, body }, { apiKey }),
|
|
66
|
+
meta: { wireModel: ctx.wireModel, aspectRatio },
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
async parseResponse({ resp, ctx, request }) {
|
|
70
|
+
const data = await mediaWire.parseJson({ resp, providerTag: 'grok image' });
|
|
71
|
+
const bytes = await mediaWire.imageBytesFromData({ data, providerTag: 'grok image', ctx });
|
|
72
|
+
return {
|
|
73
|
+
bytes,
|
|
74
|
+
providerNote: `grok/${request.meta.wireModel} · ${request.meta.aspectRatio} · ${bytes.length} bytes`,
|
|
75
|
+
suggestedExt: mediaWire.sniffImageExt({ bytes }),
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* xAI's `/tts` endpoint takes only `{ text, voice_id, language }` — no
|
|
82
|
+
* per-request output-format field — and always returns mp3/24kHz/128kbps
|
|
83
|
+
* audio bytes directly (not wrapped in JSON), matching the origin exactly.
|
|
84
|
+
* `ctx.speechFormat` (used by `openai.ts`'s `renderOpenAISpeech`/AIHubMix's
|
|
85
|
+
* TTS) has no equivalent here since the wire protocol offers nothing to
|
|
86
|
+
* set it with.
|
|
87
|
+
*/
|
|
88
|
+
function createSpeechAdapter({ mediaWire }, _optional = {}) {
|
|
89
|
+
return {
|
|
90
|
+
requireCredential: mediaWire.requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
91
|
+
buildRequest({ ctx, credentials }) {
|
|
92
|
+
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
93
|
+
const text = (ctx.prompt && ctx.prompt.trim()) || 'This is a test.';
|
|
94
|
+
const voiceId = (ctx.voice && ctx.voice.trim()) || TTS_DEFAULT_VOICE_ID;
|
|
95
|
+
const language = ctx.language.trim() || TTS_DEFAULT_LANGUAGE;
|
|
96
|
+
return {
|
|
97
|
+
url: `${baseUrlOf(credentials)}/tts`,
|
|
98
|
+
init: mediaWire.jsonPostInit({ ctx, body: { text, voice_id: voiceId, language } }, { apiKey }),
|
|
99
|
+
meta: { wireModel: ctx.wireModel, voiceId, language },
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
parseResponse: mediaWire.createRawBytesParser({
|
|
103
|
+
errorTag: 'xai tts',
|
|
104
|
+
zeroBytesMessage: 'xai tts response had zero bytes',
|
|
105
|
+
note: ({ bytes, meta }) => `xai/${meta.wireModel} · voice=${meta.voiceId} · ${meta.language} · ${bytes.length} bytes`,
|
|
106
|
+
suggestedExt: '.mp3',
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Builds the xAI media contribution: one provider row, its three catalogued models and the image and
|
|
112
|
+
* speech adapters. The video model is a catalogue declaration only; no standalone video adapter exists.
|
|
113
|
+
* @param required.mediaWire - The host's generic wire helpers.
|
|
114
|
+
* @returns A fresh contribution; allocates no connection and reads no environment.
|
|
115
|
+
* @complexity O(1) time and space; no I/O.
|
|
116
|
+
*/
|
|
117
|
+
// Why: extracting vendor media does not merge credential lanes, change endpoint ownership, or widen transport permissions.
|
|
118
|
+
export function createXaiMediaContribution({ mediaWire }, _optional = {}) {
|
|
119
|
+
const model = (id, hint, caps) => ({ id, label: id, hint, provider: PROVIDER_ID, caps });
|
|
120
|
+
return {
|
|
121
|
+
provider: { id: PROVIDER_ID, label: 'xAI Grok Imagine', hint: 'grok-imagine — image + video with native audio', integrated: true, defaultBaseUrl: DEFAULT_BASE_URL },
|
|
122
|
+
models: [
|
|
123
|
+
{ ...model('grok-imagine-image', 'xAI · 2K text-to-image', ['t2i']), surface: 'image' },
|
|
124
|
+
{ ...model('grok-imagine-video', 'xAI · 720p t2v + i2v + native audio', ['t2v', 'i2v', 'audio']), surface: 'video' },
|
|
125
|
+
{ ...model('grok-tts', 'xAI · multilingual · uses Grok subscription', ['tts']), surface: 'audio', audioKind: 'speech' },
|
|
126
|
+
],
|
|
127
|
+
adapters: {
|
|
128
|
+
image: createImageAdapter({ mediaWire }),
|
|
129
|
+
'audio:speech': createSpeechAdapter({ mediaWire }),
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|