orcaq 1.0.20
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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/8qASMGdV.js +1 -0
- package/.output/public/_nuxt/9lJACZIQ.js +19 -0
- package/.output/public/_nuxt/B2DnNiWd.js +1 -0
- package/.output/public/_nuxt/B6E6ObS_.js +8 -0
- package/.output/public/_nuxt/BH83_dXo.js +39 -0
- package/.output/public/_nuxt/BIKqrFbQ.js +1 -0
- package/.output/public/_nuxt/BNjPC06x.js +1 -0
- package/.output/public/_nuxt/BPQ-Pz1w.js +39 -0
- package/.output/public/_nuxt/BRpgKkVT.js +51 -0
- package/.output/public/_nuxt/BTCLPbPY.js +4 -0
- package/.output/public/_nuxt/BUV-RarV.js +1 -0
- package/.output/public/_nuxt/Bh6RgYlO.js +1 -0
- package/.output/public/_nuxt/Bq3cyzOD.js +1 -0
- package/.output/public/_nuxt/Bt9sU68B.js +9 -0
- package/.output/public/_nuxt/BwpH2ZxJ.js +1 -0
- package/.output/public/_nuxt/C25Tmn1m.js +1 -0
- package/.output/public/_nuxt/C2HlI1ss.js +1 -0
- package/.output/public/_nuxt/CU3ZV9iV.js +1 -0
- package/.output/public/_nuxt/CbcyysXi.js +1 -0
- package/.output/public/_nuxt/CepyvMhE.js +1 -0
- package/.output/public/_nuxt/CrgoNCm2.js +2 -0
- package/.output/public/_nuxt/CuBKbBH_.js +1 -0
- package/.output/public/_nuxt/CulD8qYQ.js +193 -0
- package/.output/public/_nuxt/CustomEdge.BNBpjEHb.css +1 -0
- package/.output/public/_nuxt/CylkLpwm.js +1 -0
- package/.output/public/_nuxt/D-bWLYHw.js +1 -0
- package/.output/public/_nuxt/D-zecHND.js +1 -0
- package/.output/public/_nuxt/D8vj6kFe.js +160 -0
- package/.output/public/_nuxt/DIETYtCL.js +1 -0
- package/.output/public/_nuxt/DJ4vUzxS.js +1 -0
- package/.output/public/_nuxt/DK-itzXx.js +8 -0
- package/.output/public/_nuxt/DL3T5jYo.js +3867 -0
- package/.output/public/_nuxt/DUsuhY9i.js +1 -0
- package/.output/public/_nuxt/DXV2HFBA.js +224 -0
- package/.output/public/_nuxt/Dh2zppOR.js +1 -0
- package/.output/public/_nuxt/DlAUqK2U.js +1 -0
- package/.output/public/_nuxt/DlmSeCnw.js +5 -0
- package/.output/public/_nuxt/DswTpYG4.js +1 -0
- package/.output/public/_nuxt/DynamicTable.DJeANwbG.css +1 -0
- package/.output/public/_nuxt/G830WtVn.js +1 -0
- package/.output/public/_nuxt/ICwM1E4-.js +15 -0
- package/.output/public/_nuxt/QZbJy9YW.js +31 -0
- package/.output/public/_nuxt/QuickQueryTable.DS_ON57S.css +1 -0
- package/.output/public/_nuxt/UXhX8z2W.js +1 -0
- package/.output/public/_nuxt/WrapperErdDiagram.DwhUd9Wr.css +1 -0
- package/.output/public/_nuxt/_fileId_.DmPfwyyD.css +1 -0
- package/.output/public/_nuxt/_tabViewId_.9Axt3zoi.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/6364d5cf-4642-479f-ba12-6440c56702af.json +1 -0
- package/.output/public/_nuxt/default.DixIpIal.css +1 -0
- package/.output/public/_nuxt/entry.GqPNPe1e.css +1 -0
- package/.output/public/_nuxt/index.CrXmf4gr.css +1 -0
- package/.output/public/_nuxt/ivUnXl9B.js +1 -0
- package/.output/public/_nuxt/pAheHeBV.js +36 -0
- package/.output/public/_nuxt/s5fCn4j5.js +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo.png +0 -0
- package/.output/public/manifest.json +25 -0
- package/.output/public/robots.txt +1 -0
- package/.output/public/vite.svg +1 -0
- package/.output/server/chunks/_/error-500.mjs +8 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/client.manifest.mjs +773 -0
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6432 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/ai/chat.mjs +77 -0
- package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +100 -0
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs +105 -0
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute.mjs +47 -0
- package/.output/server/chunks/routes/api/execute.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-one-function.mjs +28 -0
- package/.output/server/chunks/routes/api/get-one-function.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-one-table.mjs +180 -0
- package/.output/server/chunks/routes/api/get-one-table.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-over-view-function.mjs +41 -0
- package/.output/server/chunks/routes/api/get-over-view-function.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs +53 -0
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +112 -0
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +152 -0
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-table-size.mjs +49 -0
- package/.output/server/chunks/routes/api/get-table-size.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-table-structure.mjs +111 -0
- package/.output/server/chunks/routes/api/get-table-structure.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-tables.mjs +287 -0
- package/.output/server/chunks/routes/api/get-tables.mjs.map +1 -0
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs +46 -0
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +1 -0
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +28 -0
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -0
- package/.output/server/chunks/routes/api/raw-execute.mjs +48 -0
- package/.output/server/chunks/routes/api/raw-execute.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +316 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +14 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/dist/index.mjs +4374 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/gateway/dist/index.mjs +1082 -0
- package/.output/server/node_modules/@ai-sdk/gateway/package.json +69 -0
- package/.output/server/node_modules/@ai-sdk/google/dist/index.mjs +2007 -0
- package/.output/server/node_modules/@ai-sdk/google/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/openai/dist/index.mjs +5956 -0
- package/.output/server/node_modules/@ai-sdk/openai/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/dist/index.mjs +1551 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@ai-sdk/xai/dist/index.mjs +2214 -0
- package/.output/server/node_modules/@ai-sdk/xai/package.json +68 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14246 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.mjs +350 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.mjs +188 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.mjs +90 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.mjs +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.mjs +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.mjs +168 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.mjs +14 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.mjs +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.mjs +51 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.mjs +84 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.mjs +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.mjs +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.mjs +231 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.mjs +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.mjs +164 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.mjs +216 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.mjs +113 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.mjs +104 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.mjs +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.mjs +75 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.mjs +97 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.mjs +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.mjs +97 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.mjs +45 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.mjs +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.mjs +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.mjs +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.mjs +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.mjs +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.mjs +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.mjs +182 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.mjs +46 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.mjs +66 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.mjs +51 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.mjs +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.mjs +62 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.mjs +161 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.mjs +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.mjs +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.mjs +59 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.mjs +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.mjs +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.mjs +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.mjs +17 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.mjs +5 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.mjs +119 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.mjs +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.mjs +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.mjs +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.mjs +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.mjs +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.mjs +83 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.mjs +70 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.mjs +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.mjs +5 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.mjs +11 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.mjs +8 -0
- package/.output/server/node_modules/@iconify/utils/package.json +447 -0
- package/.output/server/node_modules/@ioredis/commands/built/commands.json +2447 -0
- package/.output/server/node_modules/@ioredis/commands/built/index.js +208 -0
- package/.output/server/node_modules/@ioredis/commands/package.json +52 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/context.js +81 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/diag.js +93 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/metrics.js +61 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/propagation.js +89 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/trace.js +79 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +63 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +23 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/utils.js +51 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +38 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context/context.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +59 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +57 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +45 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/types.js +44 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag-api.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/index.js +81 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/internal/global-utils.js +64 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/internal/semver.js +122 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/Metric.js +25 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +127 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +31 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/index.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js +22 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/index.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +34 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +41 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +69 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +75 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +32 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +54 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +42 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/context-utils.js +82 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +103 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +46 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +27 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/span_kind.js +46 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +49 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/status.js +23 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +26 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/version.js +21 -0
- package/.output/server/node_modules/@opentelemetry/api/package.json +113 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Formatter.js +234 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Indentation.js +42 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/InlineBlock.js +60 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Params.js +21 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Tokenizer.js +272 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/escapeRegExp.js +10 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/last.js +7 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/types.js +22 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/Db2Formatter.js +585 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/N1qlFormatter.js +257 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/PlSqlFormatter.js +459 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/StandardSqlFormatter.js +369 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/utils/abstract.js +23 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/sqlFormatter.js +34 -0
- package/.output/server/node_modules/@sqltools/formatter/package.json +59 -0
- package/.output/server/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/.output/server/node_modules/@standard-schema/spec/package.json +52 -0
- package/.output/server/node_modules/@vercel/oidc/dist/auth-config.js +84 -0
- package/.output/server/node_modules/@vercel/oidc/dist/get-context.js +34 -0
- package/.output/server/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js +80 -0
- package/.output/server/node_modules/@vercel/oidc/dist/index.js +33 -0
- package/.output/server/node_modules/@vercel/oidc/dist/oauth.js +88 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-error.js +40 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-io.js +78 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-util.js +198 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token.js +53 -0
- package/.output/server/node_modules/@vercel/oidc/package.json +52 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6690 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1404 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1789 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6654 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1669 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/ai/dist/index.mjs +12363 -0
- package/.output/server/node_modules/ai/package.json +106 -0
- package/.output/server/node_modules/ansis/index.js +1 -0
- package/.output/server/node_modules/ansis/package.json +28 -0
- package/.output/server/node_modules/app-root-path/index.js +4 -0
- package/.output/server/node_modules/app-root-path/lib/app-root-path.js +30 -0
- package/.output/server/node_modules/app-root-path/lib/resolve.js +128 -0
- package/.output/server/node_modules/app-root-path/package.json +66 -0
- package/.output/server/node_modules/balanced-match/index.js +62 -0
- package/.output/server/node_modules/balanced-match/package.json +48 -0
- package/.output/server/node_modules/bindings/bindings.js +221 -0
- package/.output/server/node_modules/bindings/package.json +28 -0
- package/.output/server/node_modules/brace-expansion/index.js +203 -0
- package/.output/server/node_modules/brace-expansion/package.json +46 -0
- package/.output/server/node_modules/cluster-key-slot/lib/index.js +166 -0
- package/.output/server/node_modules/cluster-key-slot/package.json +56 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/dayjs/dayjs.min.js +1 -0
- package/.output/server/node_modules/dayjs/package.json +84 -0
- package/.output/server/node_modules/debug/package.json +65 -0
- package/.output/server/node_modules/debug/src/browser.js +272 -0
- package/.output/server/node_modules/debug/src/common.js +292 -0
- package/.output/server/node_modules/debug/src/index.js +10 -0
- package/.output/server/node_modules/debug/src/node.js +263 -0
- package/.output/server/node_modules/dedent/dist/dedent.js +73 -0
- package/.output/server/node_modules/dedent/package.json +119 -0
- package/.output/server/node_modules/denque/index.js +481 -0
- package/.output/server/node_modules/denque/package.json +58 -0
- package/.output/server/node_modules/devalue/index.js +3 -0
- package/.output/server/node_modules/devalue/package.json +34 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +6 -0
- package/.output/server/node_modules/devalue/src/parse.js +160 -0
- package/.output/server/node_modules/devalue/src/stringify.js +232 -0
- package/.output/server/node_modules/devalue/src/uneval.js +351 -0
- package/.output/server/node_modules/devalue/src/utils.js +113 -0
- package/.output/server/node_modules/dotenv/lib/main.js +361 -0
- package/.output/server/node_modules/dotenv/package.json +61 -0
- package/.output/server/node_modules/entities/lib/decode.js +536 -0
- package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/.output/server/node_modules/entities/package.json +90 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/eventsource-parser/dist/index.js +106 -0
- package/.output/server/node_modules/eventsource-parser/dist/stream.js +29 -0
- package/.output/server/node_modules/eventsource-parser/package.json +115 -0
- package/.output/server/node_modules/file-uri-to-path/index.js +66 -0
- package/.output/server/node_modules/file-uri-to-path/package.json +32 -0
- package/.output/server/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/.output/server/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/.output/server/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/.output/server/node_modules/glob/dist/commonjs/index.js +68 -0
- package/.output/server/node_modules/glob/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/.output/server/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/.output/server/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/.output/server/node_modules/glob/package.json +99 -0
- package/.output/server/node_modules/has-flag/index.js +8 -0
- package/.output/server/node_modules/has-flag/package.json +46 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
- package/.output/server/node_modules/hookable/package.json +49 -0
- package/.output/server/node_modules/inherits/inherits.js +9 -0
- package/.output/server/node_modules/inherits/inherits_browser.js +27 -0
- package/.output/server/node_modules/inherits/package.json +29 -0
- package/.output/server/node_modules/ioredis/built/Command.js +349 -0
- package/.output/server/node_modules/ioredis/built/DataHandler.js +220 -0
- package/.output/server/node_modules/ioredis/built/Pipeline.js +334 -0
- package/.output/server/node_modules/ioredis/built/Redis.js +697 -0
- package/.output/server/node_modules/ioredis/built/ScanStream.js +51 -0
- package/.output/server/node_modules/ioredis/built/Script.js +62 -0
- package/.output/server/node_modules/ioredis/built/SubscriptionSet.js +41 -0
- package/.output/server/node_modules/ioredis/built/autoPipelining.js +159 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterOptions.js +22 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriber.js +202 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +224 -0
- package/.output/server/node_modules/ioredis/built/cluster/ConnectionPool.js +154 -0
- package/.output/server/node_modules/ioredis/built/cluster/DelayQueue.js +53 -0
- package/.output/server/node_modules/ioredis/built/cluster/index.js +862 -0
- package/.output/server/node_modules/ioredis/built/cluster/util.js +100 -0
- package/.output/server/node_modules/ioredis/built/connectors/AbstractConnector.js +26 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +45 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +37 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/index.js +305 -0
- package/.output/server/node_modules/ioredis/built/connectors/StandaloneConnector.js +69 -0
- package/.output/server/node_modules/ioredis/built/connectors/index.js +7 -0
- package/.output/server/node_modules/ioredis/built/constants/TLSProfiles.js +149 -0
- package/.output/server/node_modules/ioredis/built/errors/ClusterAllFailedError.js +15 -0
- package/.output/server/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +14 -0
- package/.output/server/node_modules/ioredis/built/errors/index.js +5 -0
- package/.output/server/node_modules/ioredis/built/index.js +62 -0
- package/.output/server/node_modules/ioredis/built/redis/RedisOptions.js +55 -0
- package/.output/server/node_modules/ioredis/built/redis/event_handler.js +292 -0
- package/.output/server/node_modules/ioredis/built/transaction.js +93 -0
- package/.output/server/node_modules/ioredis/built/utils/Commander.js +117 -0
- package/.output/server/node_modules/ioredis/built/utils/applyMixin.js +8 -0
- package/.output/server/node_modules/ioredis/built/utils/debug.js +95 -0
- package/.output/server/node_modules/ioredis/built/utils/index.js +297 -0
- package/.output/server/node_modules/ioredis/built/utils/lodash.js +9 -0
- package/.output/server/node_modules/ioredis/package.json +100 -0
- package/.output/server/node_modules/lodash.defaults/index.js +668 -0
- package/.output/server/node_modules/lodash.defaults/package.json +19 -0
- package/.output/server/node_modules/lodash.isarguments/index.js +229 -0
- package/.output/server/node_modules/lodash.isarguments/package.json +19 -0
- package/.output/server/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
- package/.output/server/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/lru-cache/package.json +116 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/ast.js +592 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/escape.js +22 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/index.js +1017 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
- package/.output/server/node_modules/minimatch/package.json +82 -0
- package/.output/server/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/.output/server/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/minipass/package.json +82 -0
- package/.output/server/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/path-scurry/dist/commonjs/index.js +2014 -0
- package/.output/server/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/path-scurry/package.json +89 -0
- package/.output/server/node_modules/pg/lib/client.js +650 -0
- package/.output/server/node_modules/pg/lib/connection-parameters.js +167 -0
- package/.output/server/node_modules/pg/lib/connection.js +222 -0
- package/.output/server/node_modules/pg/lib/crypto/cert-signatures.js +121 -0
- package/.output/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/.output/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/.output/server/node_modules/pg/lib/crypto/utils-webcrypto.js +88 -0
- package/.output/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/.output/server/node_modules/pg/lib/defaults.js +84 -0
- package/.output/server/node_modules/pg/lib/index.js +58 -0
- package/.output/server/node_modules/pg/lib/native/client.js +307 -0
- package/.output/server/node_modules/pg/lib/native/index.js +2 -0
- package/.output/server/node_modules/pg/lib/native/query.js +168 -0
- package/.output/server/node_modules/pg/lib/query.js +253 -0
- package/.output/server/node_modules/pg/lib/result.js +108 -0
- package/.output/server/node_modules/pg/lib/stream.js +81 -0
- package/.output/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/.output/server/node_modules/pg/lib/utils.js +206 -0
- package/.output/server/node_modules/pg/package.json +62 -0
- package/.output/server/node_modules/pg-cloudflare/dist/empty.js +4 -0
- package/.output/server/node_modules/pg-cloudflare/package.json +32 -0
- package/.output/server/node_modules/pg-connection-string/index.js +112 -0
- package/.output/server/node_modules/pg-connection-string/package.json +40 -0
- package/.output/server/node_modules/pg-cursor/index.js +265 -0
- package/.output/server/node_modules/pg-cursor/package.json +38 -0
- package/.output/server/node_modules/pg-int8/index.js +100 -0
- package/.output/server/node_modules/pg-int8/package.json +24 -0
- package/.output/server/node_modules/pg-pool/index.js +471 -0
- package/.output/server/node_modules/pg-pool/package.json +41 -0
- package/.output/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/.output/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
- package/.output/server/node_modules/pg-protocol/dist/index.js +15 -0
- package/.output/server/node_modules/pg-protocol/dist/messages.js +160 -0
- package/.output/server/node_modules/pg-protocol/dist/parser.js +304 -0
- package/.output/server/node_modules/pg-protocol/dist/serializer.js +189 -0
- package/.output/server/node_modules/pg-protocol/package.json +35 -0
- package/.output/server/node_modules/pg-query-stream/dist/index.js +48 -0
- package/.output/server/node_modules/pg-query-stream/package.json +60 -0
- package/.output/server/node_modules/pg-types/index.js +47 -0
- package/.output/server/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/.output/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/.output/server/node_modules/pg-types/lib/builtins.js +73 -0
- package/.output/server/node_modules/pg-types/lib/textParsers.js +215 -0
- package/.output/server/node_modules/pg-types/package.json +42 -0
- package/.output/server/node_modules/pgpass/lib/helper.js +233 -0
- package/.output/server/node_modules/pgpass/lib/index.js +23 -0
- package/.output/server/node_modules/pgpass/package.json +41 -0
- package/.output/server/node_modules/postgres-array/index.js +97 -0
- package/.output/server/node_modules/postgres-array/package.json +35 -0
- package/.output/server/node_modules/postgres-bytea/index.js +31 -0
- package/.output/server/node_modules/postgres-bytea/package.json +34 -0
- package/.output/server/node_modules/postgres-date/index.js +116 -0
- package/.output/server/node_modules/postgres-date/package.json +33 -0
- package/.output/server/node_modules/postgres-interval/index.js +125 -0
- package/.output/server/node_modules/postgres-interval/package.json +36 -0
- package/.output/server/node_modules/redis-errors/index.js +7 -0
- package/.output/server/node_modules/redis-errors/lib/modern.js +59 -0
- package/.output/server/node_modules/redis-errors/lib/old.js +119 -0
- package/.output/server/node_modules/redis-errors/package.json +41 -0
- package/.output/server/node_modules/redis-parser/index.js +3 -0
- package/.output/server/node_modules/redis-parser/lib/parser.js +552 -0
- package/.output/server/node_modules/redis-parser/package.json +53 -0
- package/.output/server/node_modules/reflect-metadata/Reflect.js +1415 -0
- package/.output/server/node_modules/reflect-metadata/package.json +68 -0
- package/.output/server/node_modules/safe-buffer/index.js +65 -0
- package/.output/server/node_modules/safe-buffer/package.json +51 -0
- package/.output/server/node_modules/sha.js/hash.js +81 -0
- package/.output/server/node_modules/sha.js/index.js +15 -0
- package/.output/server/node_modules/sha.js/package.json +30 -0
- package/.output/server/node_modules/sha.js/sha.js +94 -0
- package/.output/server/node_modules/sha.js/sha1.js +99 -0
- package/.output/server/node_modules/sha.js/sha224.js +53 -0
- package/.output/server/node_modules/sha.js/sha256.js +135 -0
- package/.output/server/node_modules/sha.js/sha384.js +57 -0
- package/.output/server/node_modules/sha.js/sha512.js +260 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/split2/index.js +141 -0
- package/.output/server/node_modules/split2/package.json +39 -0
- package/.output/server/node_modules/sql-highlight/lib/escapeHtml.js +59 -0
- package/.output/server/node_modules/sql-highlight/lib/index.js +85 -0
- package/.output/server/node_modules/sql-highlight/lib/keywords.js +145 -0
- package/.output/server/node_modules/sql-highlight/package.json +49 -0
- package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node +0 -0
- package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node.bak +0 -0
- package/.output/server/node_modules/sqlite3/lib/sqlite3-binding.js +1 -0
- package/.output/server/node_modules/sqlite3/lib/sqlite3.js +207 -0
- package/.output/server/node_modules/sqlite3/lib/trace.js +38 -0
- package/.output/server/node_modules/sqlite3/package.json +89 -0
- package/.output/server/node_modules/standard-as-callback/built/index.js +41 -0
- package/.output/server/node_modules/standard-as-callback/built/utils.js +23 -0
- package/.output/server/node_modules/standard-as-callback/package.json +40 -0
- package/.output/server/node_modules/supports-color/index.js +152 -0
- package/.output/server/node_modules/supports-color/package.json +58 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/node_modules/typeorm/cache/DbQueryResultCache.js +264 -0
- package/.output/server/node_modules/typeorm/cache/QueryResultCacheFactory.js +42 -0
- package/.output/server/node_modules/typeorm/cache/RedisQueryResultCache.js +197 -0
- package/.output/server/node_modules/typeorm/common/DeepPartial.js +4 -0
- package/.output/server/node_modules/typeorm/common/EntityTarget.js +4 -0
- package/.output/server/node_modules/typeorm/common/MixedList.js +4 -0
- package/.output/server/node_modules/typeorm/common/ObjectLiteral.js +4 -0
- package/.output/server/node_modules/typeorm/common/ObjectType.js +4 -0
- package/.output/server/node_modules/typeorm/common/RelationType.js +4 -0
- package/.output/server/node_modules/typeorm/connection/Connection.js +16 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionManager.js +66 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionMetadataBuilder.js +74 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionOptionsReader.js +198 -0
- package/.output/server/node_modules/typeorm/connection/options-reader/ConnectionOptionsEnvReader.js +111 -0
- package/.output/server/node_modules/typeorm/container.js +60 -0
- package/.output/server/node_modules/typeorm/data-source/DataSource.js +517 -0
- package/.output/server/node_modules/typeorm/decorator/Check.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/EntityRepository.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/Exclusion.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/ForeignKey.js +44 -0
- package/.output/server/node_modules/typeorm/decorator/Generated.js +24 -0
- package/.output/server/node_modules/typeorm/decorator/Index.js +56 -0
- package/.output/server/node_modules/typeorm/decorator/Unique.js +50 -0
- package/.output/server/node_modules/typeorm/decorator/columns/Column.js +78 -0
- package/.output/server/node_modules/typeorm/decorator/columns/CreateDateColumn.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/columns/DeleteDateColumn.js +20 -0
- package/.output/server/node_modules/typeorm/decorator/columns/ObjectIdColumn.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryColumn.js +63 -0
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryGeneratedColumn.js +59 -0
- package/.output/server/node_modules/typeorm/decorator/columns/UpdateDateColumn.js +20 -0
- package/.output/server/node_modules/typeorm/decorator/columns/VersionColumn.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/columns/ViewColumn.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/columns/VirtualColumn.js +49 -0
- package/.output/server/node_modules/typeorm/decorator/entity/ChildEntity.js +25 -0
- package/.output/server/node_modules/typeorm/decorator/entity/Entity.js +31 -0
- package/.output/server/node_modules/typeorm/decorator/entity/TableInheritance.js +22 -0
- package/.output/server/node_modules/typeorm/decorator/entity-view/ViewEntity.js +32 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterInsert.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterLoad.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRecover.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterSoftRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterUpdate.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeInsert.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRecover.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeSoftRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeUpdate.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/EventSubscriber.js +17 -0
- package/.output/server/node_modules/typeorm/decorator/options/ColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/EntityOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/IndexOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/JoinColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/JoinTableOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/RelationOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/ValueTransformer.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/relations/JoinColumn.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/relations/JoinTable.js +34 -0
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToMany.js +46 -0
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToOne.js +46 -0
- package/.output/server/node_modules/typeorm/decorator/relations/OneToMany.js +37 -0
- package/.output/server/node_modules/typeorm/decorator/relations/OneToOne.js +45 -0
- package/.output/server/node_modules/typeorm/decorator/relations/RelationCount.js +23 -0
- package/.output/server/node_modules/typeorm/decorator/relations/RelationId.js +22 -0
- package/.output/server/node_modules/typeorm/decorator/tree/Tree.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeChildren.js +34 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeLevelColumn.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeParent.js +33 -0
- package/.output/server/node_modules/typeorm/driver/DriverFactory.js +98 -0
- package/.output/server/node_modules/typeorm/driver/DriverUtils.js +228 -0
- package/.output/server/node_modules/typeorm/driver/Query.js +16 -0
- package/.output/server/node_modules/typeorm/driver/SqlInMemory.js +15 -0
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlDriver.js +847 -0
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlQueryRunner.js +1709 -0
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresDriver.js +103 -0
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresQueryRunner.js +146 -0
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js +153 -0
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js +126 -0
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorDriver.js +78 -0
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorQueryRunner.js +98 -0
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachDriver.js +885 -0
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachQueryRunner.js +2453 -0
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaDriver.js +76 -0
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaQueryRunner.js +170 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriver.js +29 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriverFactory.js +22 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoQueryRunner.js +65 -0
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyDriver.js +75 -0
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyQueryRunner.js +169 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoDriver.js +404 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js +701 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/bson.typings.js +5 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/typings.js +23 -0
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlDriver.js +1105 -0
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js +2139 -0
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptDriver.js +94 -0
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptQueryRunner.js +92 -0
- package/.output/server/node_modules/typeorm/driver/oracle/OracleDriver.js +869 -0
- package/.output/server/node_modules/typeorm/driver/oracle/OracleQueryRunner.js +1884 -0
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresDriver.js +1259 -0
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js +2729 -0
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeDriver.js +728 -0
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeQueryRunner.js +107 -0
- package/.output/server/node_modules/typeorm/driver/sap/SapDriver.js +681 -0
- package/.output/server/node_modules/typeorm/driver/sap/SapQueryRunner.js +2054 -0
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerDriver.js +613 -0
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerQueryRunner.js +1464 -0
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteDriver.js +174 -0
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js +124 -0
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteDriver.js +695 -0
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +1511 -0
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsDriver.js +250 -0
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsQueryRunner.js +123 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/MssqlParameter.js +23 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerDriver.js +922 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerQueryRunner.js +2484 -0
- package/.output/server/node_modules/typeorm/driver/types/DatabaseType.js +4 -0
- package/.output/server/node_modules/typeorm/driver/types/GeoJsonTypes.js +4 -0
- package/.output/server/node_modules/typeorm/driver/types/MetadataTableType.js +11 -0
- package/.output/server/node_modules/typeorm/driver/types/ReplicationMode.js +4 -0
- package/.output/server/node_modules/typeorm/entity-manager/EntityManager.js +853 -0
- package/.output/server/node_modules/typeorm/entity-manager/EntityManagerFactory.js +24 -0
- package/.output/server/node_modules/typeorm/entity-manager/MongoEntityManager.js +668 -0
- package/.output/server/node_modules/typeorm/entity-manager/SqljsEntityManager.js +44 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchema.js +15 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js +8 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedError.js +18 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaOptions.js +11 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaTransformer.js +333 -0
- package/.output/server/node_modules/typeorm/error/AlreadyHasActiveConnectionError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotAttachTreeChildrenEntityError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotConnectAlreadyConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotCreateEntityIdMapError.js +21 -0
- package/.output/server/node_modules/typeorm/error/CannotDetermineEntityError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotExecuteNotConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotGetEntityManagerNotConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotReflectMethodParameterTypeError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CircularRelationsError.js +16 -0
- package/.output/server/node_modules/typeorm/error/ColumnTypeUndefinedError.js +19 -0
- package/.output/server/node_modules/typeorm/error/ConnectionIsNotSetError.js +15 -0
- package/.output/server/node_modules/typeorm/error/ConnectionNotFoundError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryCannotInheritRepositoryError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryDoesNotHaveEntityError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryNotFoundError.js +18 -0
- package/.output/server/node_modules/typeorm/error/DataTypeNotSupportedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/DriverOptionNotSetError.js +16 -0
- package/.output/server/node_modules/typeorm/error/DriverPackageNotInstalledError.js +16 -0
- package/.output/server/node_modules/typeorm/error/EntityMetadataNotFoundError.js +29 -0
- package/.output/server/node_modules/typeorm/error/EntityNotFoundError.js +42 -0
- package/.output/server/node_modules/typeorm/error/EntityPropertyNotFoundError.js +17 -0
- package/.output/server/node_modules/typeorm/error/FindRelationsNotFoundError.js +23 -0
- package/.output/server/node_modules/typeorm/error/ForbiddenTransactionModeOverrideError.js +16 -0
- package/.output/server/node_modules/typeorm/error/InitializedRelationError.js +20 -0
- package/.output/server/node_modules/typeorm/error/InsertValuesMissingError.js +16 -0
- package/.output/server/node_modules/typeorm/error/LimitOnUpdateNotSupportedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/LockNotSupportedOnGivenDriverError.js +15 -0
- package/.output/server/node_modules/typeorm/error/MetadataAlreadyExistsError.js +18 -0
- package/.output/server/node_modules/typeorm/error/MetadataWithSuchNameAlreadyExistsError.js +16 -0
- package/.output/server/node_modules/typeorm/error/MissingDeleteDateColumnError.js +12 -0
- package/.output/server/node_modules/typeorm/error/MissingDriverError.js +16 -0
- package/.output/server/node_modules/typeorm/error/MissingJoinColumnError.js +23 -0
- package/.output/server/node_modules/typeorm/error/MissingJoinTableError.js +23 -0
- package/.output/server/node_modules/typeorm/error/MissingPrimaryColumnError.js +13 -0
- package/.output/server/node_modules/typeorm/error/MustBeEntityError.js +15 -0
- package/.output/server/node_modules/typeorm/error/NestedSetMultipleRootError.js +12 -0
- package/.output/server/node_modules/typeorm/error/NoConnectionForRepositoryError.js +16 -0
- package/.output/server/node_modules/typeorm/error/NoConnectionOptionError.js +16 -0
- package/.output/server/node_modules/typeorm/error/NoNeedToReleaseEntityManagerError.js +17 -0
- package/.output/server/node_modules/typeorm/error/NoVersionOrUpdateDateColumnError.js +15 -0
- package/.output/server/node_modules/typeorm/error/OffsetWithoutLimitNotSupportedError.js +17 -0
- package/.output/server/node_modules/typeorm/error/OptimisticLockCanNotBeUsedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/OptimisticLockVersionMismatchError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PersistedEntityNotFoundError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PessimisticLockTransactionRequiredError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PrimaryColumnCannotBeNullableError.js +13 -0
- package/.output/server/node_modules/typeorm/error/QueryFailedError.js +30 -0
- package/.output/server/node_modules/typeorm/error/QueryRunnerAlreadyReleasedError.js +12 -0
- package/.output/server/node_modules/typeorm/error/QueryRunnerProviderAlreadyReleasedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/RepositoryNotTreeError.js +32 -0
- package/.output/server/node_modules/typeorm/error/ReturningStatementNotSupportedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/SubjectRemovedAndUpdatedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/SubjectWithoutIdentifierError.js +17 -0
- package/.output/server/node_modules/typeorm/error/TransactionAlreadyStartedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/TransactionNotStartedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/TreeRepositoryNotSupportedError.js +12 -0
- package/.output/server/node_modules/typeorm/error/TypeORMError.js +23 -0
- package/.output/server/node_modules/typeorm/error/UpdateValuesMissingError.js +12 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnIsNotAllowedError.js +13 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinTableIsNotAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinTableOnlyOnOneSideAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/index.js +66 -0
- package/.output/server/node_modules/typeorm/find-options/EqualOperator.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/FindManyOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOneOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOperator.js +96 -0
- package/.output/server/node_modules/typeorm/find-options/FindOperatorType.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsOrder.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsRelations.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsSelect.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsUtils.js +350 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsWhere.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindTreeOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/JoinOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/OrderByCondition.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/operator/And.js +9 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Any.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContainedBy.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContains.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayOverlap.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Between.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Equal.js +17 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ILike.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/In.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/IsNull.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/JsonContains.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/LessThan.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/LessThanOrEqual.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Like.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThan.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThanOrEqual.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Not.js +14 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Or.js +9 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Raw.js +12 -0
- package/.output/server/node_modules/typeorm/globals.js +182 -0
- package/.output/server/node_modules/typeorm/index.js +196 -0
- package/.output/server/node_modules/typeorm/index.mjs +422 -0
- package/.output/server/node_modules/typeorm/logger/AbstractLogger.js +238 -0
- package/.output/server/node_modules/typeorm/logger/AdvancedConsoleLogger.js +56 -0
- package/.output/server/node_modules/typeorm/logger/DebugLogger.js +78 -0
- package/.output/server/node_modules/typeorm/logger/FileLogger.js +88 -0
- package/.output/server/node_modules/typeorm/logger/FormattedConsoleLogger.js +59 -0
- package/.output/server/node_modules/typeorm/logger/Logger.js +4 -0
- package/.output/server/node_modules/typeorm/logger/LoggerFactory.js +39 -0
- package/.output/server/node_modules/typeorm/logger/LoggerOptions.js +4 -0
- package/.output/server/node_modules/typeorm/logger/SimpleConsoleLogger.js +57 -0
- package/.output/server/node_modules/typeorm/metadata/CheckMetadata.js +35 -0
- package/.output/server/node_modules/typeorm/metadata/ColumnMetadata.js +618 -0
- package/.output/server/node_modules/typeorm/metadata/EmbeddedMetadata.js +224 -0
- package/.output/server/node_modules/typeorm/metadata/EntityListenerMetadata.js +77 -0
- package/.output/server/node_modules/typeorm/metadata/EntityMetadata.js +692 -0
- package/.output/server/node_modules/typeorm/metadata/ExclusionMetadata.js +35 -0
- package/.output/server/node_modules/typeorm/metadata/ForeignKeyMetadata.js +57 -0
- package/.output/server/node_modules/typeorm/metadata/IndexMetadata.js +144 -0
- package/.output/server/node_modules/typeorm/metadata/RelationCountMetadata.js +39 -0
- package/.output/server/node_modules/typeorm/metadata/RelationIdMetadata.js +62 -0
- package/.output/server/node_modules/typeorm/metadata/RelationMetadata.js +440 -0
- package/.output/server/node_modules/typeorm/metadata/UniqueMetadata.js +101 -0
- package/.output/server/node_modules/typeorm/metadata/types/EventListenerTypes.js +22 -0
- package/.output/server/node_modules/typeorm/metadata-args/MetadataArgsStorage.js +236 -0
- package/.output/server/node_modules/typeorm/metadata-builder/ClosureJunctionEntityMetadataBuilder.js +145 -0
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataBuilder.js +838 -0
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataValidator.js +258 -0
- package/.output/server/node_modules/typeorm/metadata-builder/JunctionEntityMetadataBuilder.js +287 -0
- package/.output/server/node_modules/typeorm/metadata-builder/MetadataUtils.js +44 -0
- package/.output/server/node_modules/typeorm/metadata-builder/RelationJoinColumnBuilder.js +185 -0
- package/.output/server/node_modules/typeorm/migration/Migration.js +21 -0
- package/.output/server/node_modules/typeorm/migration/MigrationExecutor.js +534 -0
- package/.output/server/node_modules/typeorm/naming-strategy/DefaultNamingStrategy.js +145 -0
- package/.output/server/node_modules/typeorm/naming-strategy/LegacyOracleNamingStrategy.js +50 -0
- package/.output/server/node_modules/typeorm/package.json +268 -0
- package/.output/server/node_modules/typeorm/persistence/EntityPersistExecutor.js +170 -0
- package/.output/server/node_modules/typeorm/persistence/Subject.js +239 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectChangedColumnsComputer.js +216 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectDatabaseEntityLoader.js +135 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectExecutor.js +760 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectTopologicalSorter.js +174 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/CascadesSubjectBuilder.js +107 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/ManyToManySubjectBuilder.js +218 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js +181 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +155 -0
- package/.output/server/node_modules/typeorm/persistence/tree/ClosureSubjectExecutor.js +241 -0
- package/.output/server/node_modules/typeorm/persistence/tree/MaterializedPathSubjectExecutor.js +125 -0
- package/.output/server/node_modules/typeorm/persistence/tree/NestedSetSubjectExecutor.js +271 -0
- package/.output/server/node_modules/typeorm/platform/PlatformTools.js +243 -0
- package/.output/server/node_modules/typeorm/query-builder/Alias.js +29 -0
- package/.output/server/node_modules/typeorm/query-builder/Brackets.js +19 -0
- package/.output/server/node_modules/typeorm/query-builder/DeleteQueryBuilder.js +200 -0
- package/.output/server/node_modules/typeorm/query-builder/InsertQueryBuilder.js +745 -0
- package/.output/server/node_modules/typeorm/query-builder/JoinAttribute.js +175 -0
- package/.output/server/node_modules/typeorm/query-builder/NotBrackets.js +17 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilder.js +1139 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilderUtils.js +32 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryExpressionMap.js +328 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationIdLoader.js +503 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationLoader.js +283 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationQueryBuilder.js +155 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationRemover.js +143 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationUpdater.js +152 -0
- package/.output/server/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js +176 -0
- package/.output/server/node_modules/typeorm/query-builder/SelectQueryBuilder.js +2656 -0
- package/.output/server/node_modules/typeorm/query-builder/SoftDeleteQueryBuilder.js +368 -0
- package/.output/server/node_modules/typeorm/query-builder/UpdateQueryBuilder.js +498 -0
- package/.output/server/node_modules/typeorm/query-builder/index.js +20 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountAttribute.js +80 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountLoader.js +168 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountMetadataToAttributeTransformer.js +55 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdAttribute.js +88 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdLoader.js +275 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdMetadataToAttributeTransformer.js +55 -0
- package/.output/server/node_modules/typeorm/query-builder/result/DeleteResult.js +17 -0
- package/.output/server/node_modules/typeorm/query-builder/result/InsertResult.js +28 -0
- package/.output/server/node_modules/typeorm/query-builder/result/UpdateResult.js +29 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/DocumentToEntityTransformer.js +196 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +112 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToNewEntityTransformer.js +92 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js +447 -0
- package/.output/server/node_modules/typeorm/query-runner/BaseQueryRunner.js +454 -0
- package/.output/server/node_modules/typeorm/query-runner/QueryLock.js +28 -0
- package/.output/server/node_modules/typeorm/query-runner/QueryResult.js +17 -0
- package/.output/server/node_modules/typeorm/repository/AbstractRepository.js +92 -0
- package/.output/server/node_modules/typeorm/repository/BaseEntity.js +328 -0
- package/.output/server/node_modules/typeorm/repository/MongoRepository.js +305 -0
- package/.output/server/node_modules/typeorm/repository/RemoveOptions.js +4 -0
- package/.output/server/node_modules/typeorm/repository/Repository.js +379 -0
- package/.output/server/node_modules/typeorm/repository/SaveOptions.js +4 -0
- package/.output/server/node_modules/typeorm/repository/TreeRepository.js +255 -0
- package/.output/server/node_modules/typeorm/schema-builder/MongoSchemaBuilder.js +66 -0
- package/.output/server/node_modules/typeorm/schema-builder/RdbmsSchemaBuilder.js +929 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableCheckOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableExclusionOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableForeignKeyOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableIndexOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableUniqueOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/ViewOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/Table.js +296 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableCheck.js +49 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableColumn.js +117 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableExclusion.js +43 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableForeignKey.js +72 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableIndex.js +68 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableUnique.js +50 -0
- package/.output/server/node_modules/typeorm/schema-builder/util/TableUtils.js +41 -0
- package/.output/server/node_modules/typeorm/schema-builder/util/ViewUtils.js +27 -0
- package/.output/server/node_modules/typeorm/schema-builder/view/View.js +71 -0
- package/.output/server/node_modules/typeorm/subscriber/Broadcaster.js +660 -0
- package/.output/server/node_modules/typeorm/subscriber/BroadcasterResult.js +30 -0
- package/.output/server/node_modules/typeorm/subscriber/event/QueryEvent.js +4 -0
- package/.output/server/node_modules/typeorm/util/ApplyValueTransformers.js +25 -0
- package/.output/server/node_modules/typeorm/util/DateUtils.js +229 -0
- package/.output/server/node_modules/typeorm/util/DepGraph.js +230 -0
- package/.output/server/node_modules/typeorm/util/DirectoryExportedClassesLoader.js +65 -0
- package/.output/server/node_modules/typeorm/util/ImportUtils.js +66 -0
- package/.output/server/node_modules/typeorm/util/InstanceChecker.js +104 -0
- package/.output/server/node_modules/typeorm/util/ObjectUtils.js +49 -0
- package/.output/server/node_modules/typeorm/util/OrmUtils.js +443 -0
- package/.output/server/node_modules/typeorm/util/PathUtils.js +33 -0
- package/.output/server/node_modules/typeorm/util/RandomGenerator.js +154 -0
- package/.output/server/node_modules/typeorm/util/SqlTagUtils.js +43 -0
- package/.output/server/node_modules/typeorm/util/StringUtils.js +113 -0
- package/.output/server/node_modules/typeorm/util/TreeRepositoryUtils.js +67 -0
- package/.output/server/node_modules/typeorm/util/VersionUtils.js +27 -0
- package/.output/server/node_modules/typeorm/util/escapeRegExp.js +10 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +630 -0
- package/.output/server/node_modules/ufo/package.json +47 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +94 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +220 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +48 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Cp0iF6eN.mjs +177 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DGkFBTYv.mjs +172 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +70 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +101 -0
- package/.output/server/node_modules/uuid/dist/cjs/index.js +31 -0
- package/.output/server/node_modules/uuid/dist/cjs/max.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/md5.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/native.js +4 -0
- package/.output/server/node_modules/uuid/dist/cjs/nil.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/package.json +1 -0
- package/.output/server/node_modules/uuid/dist/cjs/parse.js +11 -0
- package/.output/server/node_modules/uuid/dist/cjs/regex.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/rng.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/sha1.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/stringify.js +39 -0
- package/.output/server/node_modules/uuid/dist/cjs/v1.js +87 -0
- package/.output/server/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/v3.js +14 -0
- package/.output/server/node_modules/uuid/dist/cjs/v35.js +41 -0
- package/.output/server/node_modules/uuid/dist/cjs/v4.js +29 -0
- package/.output/server/node_modules/uuid/dist/cjs/v5.js +14 -0
- package/.output/server/node_modules/uuid/dist/cjs/v6.js +19 -0
- package/.output/server/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/v7.js +69 -0
- package/.output/server/node_modules/uuid/dist/cjs/validate.js +7 -0
- package/.output/server/node_modules/uuid/dist/cjs/version.js +10 -0
- package/.output/server/node_modules/uuid/package.json +132 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
- package/.output/server/node_modules/xtend/mutable.js +17 -0
- package/.output/server/node_modules/xtend/package.json +55 -0
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +135 -0
- package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
- package/.output/server/node_modules/zod/v3/errors.js +9 -0
- package/.output/server/node_modules/zod/v3/external.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
- package/.output/server/node_modules/zod/v3/index.js +4 -0
- package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v3/package.json +6 -0
- package/.output/server/node_modules/zod/v3/types.js +3695 -0
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
- package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
- package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/.output/server/node_modules/zod/v4/classic/index.js +4 -0
- package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
- package/.output/server/node_modules/zod/v4/classic/package.json +6 -0
- package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +1157 -0
- package/.output/server/node_modules/zod/v4/core/api.js +1082 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
- package/.output/server/node_modules/zod/v4/core/core.js +76 -0
- package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
- package/.output/server/node_modules/zod/v4/core/errors.js +182 -0
- package/.output/server/node_modules/zod/v4/core/index.js +16 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
- package/.output/server/node_modules/zod/v4/core/package.json +6 -0
- package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +133 -0
- package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
- package/.output/server/node_modules/zod/v4/core/schemas.js +2095 -0
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +437 -0
- package/.output/server/node_modules/zod/v4/core/util.js +651 -0
- package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
- package/.output/server/node_modules/zod/v4/index.js +3 -0
- package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
- package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +49 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +6 -0
- package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/.output/server/node_modules/zod/v4/package.json +6 -0
- package/.output/server/package.json +95 -0
- package/README.md +46 -0
- package/bin/cli.mjs +113 -0
- package/bin/entry.cjs +84 -0
- package/package.json +48 -0
|
@@ -0,0 +1,2007 @@
|
|
|
1
|
+
// src/google-provider.ts
|
|
2
|
+
import {
|
|
3
|
+
generateId as generateId2,
|
|
4
|
+
loadApiKey,
|
|
5
|
+
withoutTrailingSlash,
|
|
6
|
+
withUserAgentSuffix
|
|
7
|
+
} from "@ai-sdk/provider-utils";
|
|
8
|
+
|
|
9
|
+
// src/version.ts
|
|
10
|
+
var VERSION = true ? "3.0.6" : "0.0.0-test";
|
|
11
|
+
|
|
12
|
+
// src/google-generative-ai-embedding-model.ts
|
|
13
|
+
import {
|
|
14
|
+
TooManyEmbeddingValuesForCallError
|
|
15
|
+
} from "@ai-sdk/provider";
|
|
16
|
+
import {
|
|
17
|
+
combineHeaders,
|
|
18
|
+
createJsonResponseHandler,
|
|
19
|
+
lazySchema as lazySchema3,
|
|
20
|
+
parseProviderOptions,
|
|
21
|
+
postJsonToApi,
|
|
22
|
+
resolve,
|
|
23
|
+
zodSchema as zodSchema3
|
|
24
|
+
} from "@ai-sdk/provider-utils";
|
|
25
|
+
import { z as z3 } from "zod/v4";
|
|
26
|
+
|
|
27
|
+
// src/google-error.ts
|
|
28
|
+
import {
|
|
29
|
+
createJsonErrorResponseHandler,
|
|
30
|
+
lazySchema,
|
|
31
|
+
zodSchema
|
|
32
|
+
} from "@ai-sdk/provider-utils";
|
|
33
|
+
import { z } from "zod/v4";
|
|
34
|
+
var googleErrorDataSchema = lazySchema(
|
|
35
|
+
() => zodSchema(
|
|
36
|
+
z.object({
|
|
37
|
+
error: z.object({
|
|
38
|
+
code: z.number().nullable(),
|
|
39
|
+
message: z.string(),
|
|
40
|
+
status: z.string()
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
var googleFailedResponseHandler = createJsonErrorResponseHandler({
|
|
46
|
+
errorSchema: googleErrorDataSchema,
|
|
47
|
+
errorToMessage: (data) => data.error.message
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// src/google-generative-ai-embedding-options.ts
|
|
51
|
+
import {
|
|
52
|
+
lazySchema as lazySchema2,
|
|
53
|
+
zodSchema as zodSchema2
|
|
54
|
+
} from "@ai-sdk/provider-utils";
|
|
55
|
+
import { z as z2 } from "zod/v4";
|
|
56
|
+
var googleGenerativeAIEmbeddingProviderOptions = lazySchema2(
|
|
57
|
+
() => zodSchema2(
|
|
58
|
+
z2.object({
|
|
59
|
+
/**
|
|
60
|
+
* Optional. Optional reduced dimension for the output embedding.
|
|
61
|
+
* If set, excessive values in the output embedding are truncated from the end.
|
|
62
|
+
*/
|
|
63
|
+
outputDimensionality: z2.number().optional(),
|
|
64
|
+
/**
|
|
65
|
+
* Optional. Specifies the task type for generating embeddings.
|
|
66
|
+
* Supported task types:
|
|
67
|
+
* - SEMANTIC_SIMILARITY: Optimized for text similarity.
|
|
68
|
+
* - CLASSIFICATION: Optimized for text classification.
|
|
69
|
+
* - CLUSTERING: Optimized for clustering texts based on similarity.
|
|
70
|
+
* - RETRIEVAL_DOCUMENT: Optimized for document retrieval.
|
|
71
|
+
* - RETRIEVAL_QUERY: Optimized for query-based retrieval.
|
|
72
|
+
* - QUESTION_ANSWERING: Optimized for answering questions.
|
|
73
|
+
* - FACT_VERIFICATION: Optimized for verifying factual information.
|
|
74
|
+
* - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
|
|
75
|
+
*/
|
|
76
|
+
taskType: z2.enum([
|
|
77
|
+
"SEMANTIC_SIMILARITY",
|
|
78
|
+
"CLASSIFICATION",
|
|
79
|
+
"CLUSTERING",
|
|
80
|
+
"RETRIEVAL_DOCUMENT",
|
|
81
|
+
"RETRIEVAL_QUERY",
|
|
82
|
+
"QUESTION_ANSWERING",
|
|
83
|
+
"FACT_VERIFICATION",
|
|
84
|
+
"CODE_RETRIEVAL_QUERY"
|
|
85
|
+
]).optional()
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// src/google-generative-ai-embedding-model.ts
|
|
91
|
+
var GoogleGenerativeAIEmbeddingModel = class {
|
|
92
|
+
constructor(modelId, config) {
|
|
93
|
+
this.specificationVersion = "v3";
|
|
94
|
+
this.maxEmbeddingsPerCall = 2048;
|
|
95
|
+
this.supportsParallelCalls = true;
|
|
96
|
+
this.modelId = modelId;
|
|
97
|
+
this.config = config;
|
|
98
|
+
}
|
|
99
|
+
get provider() {
|
|
100
|
+
return this.config.provider;
|
|
101
|
+
}
|
|
102
|
+
async doEmbed({
|
|
103
|
+
values,
|
|
104
|
+
headers,
|
|
105
|
+
abortSignal,
|
|
106
|
+
providerOptions
|
|
107
|
+
}) {
|
|
108
|
+
const googleOptions = await parseProviderOptions({
|
|
109
|
+
provider: "google",
|
|
110
|
+
providerOptions,
|
|
111
|
+
schema: googleGenerativeAIEmbeddingProviderOptions
|
|
112
|
+
});
|
|
113
|
+
if (values.length > this.maxEmbeddingsPerCall) {
|
|
114
|
+
throw new TooManyEmbeddingValuesForCallError({
|
|
115
|
+
provider: this.provider,
|
|
116
|
+
modelId: this.modelId,
|
|
117
|
+
maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
|
|
118
|
+
values
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const mergedHeaders = combineHeaders(
|
|
122
|
+
await resolve(this.config.headers),
|
|
123
|
+
headers
|
|
124
|
+
);
|
|
125
|
+
if (values.length === 1) {
|
|
126
|
+
const {
|
|
127
|
+
responseHeaders: responseHeaders2,
|
|
128
|
+
value: response2,
|
|
129
|
+
rawValue: rawValue2
|
|
130
|
+
} = await postJsonToApi({
|
|
131
|
+
url: `${this.config.baseURL}/models/${this.modelId}:embedContent`,
|
|
132
|
+
headers: mergedHeaders,
|
|
133
|
+
body: {
|
|
134
|
+
model: `models/${this.modelId}`,
|
|
135
|
+
content: {
|
|
136
|
+
parts: [{ text: values[0] }]
|
|
137
|
+
},
|
|
138
|
+
outputDimensionality: googleOptions == null ? void 0 : googleOptions.outputDimensionality,
|
|
139
|
+
taskType: googleOptions == null ? void 0 : googleOptions.taskType
|
|
140
|
+
},
|
|
141
|
+
failedResponseHandler: googleFailedResponseHandler,
|
|
142
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
143
|
+
googleGenerativeAISingleEmbeddingResponseSchema
|
|
144
|
+
),
|
|
145
|
+
abortSignal,
|
|
146
|
+
fetch: this.config.fetch
|
|
147
|
+
});
|
|
148
|
+
return {
|
|
149
|
+
warnings: [],
|
|
150
|
+
embeddings: [response2.embedding.values],
|
|
151
|
+
usage: void 0,
|
|
152
|
+
response: { headers: responseHeaders2, body: rawValue2 }
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const {
|
|
156
|
+
responseHeaders,
|
|
157
|
+
value: response,
|
|
158
|
+
rawValue
|
|
159
|
+
} = await postJsonToApi({
|
|
160
|
+
url: `${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`,
|
|
161
|
+
headers: mergedHeaders,
|
|
162
|
+
body: {
|
|
163
|
+
requests: values.map((value) => ({
|
|
164
|
+
model: `models/${this.modelId}`,
|
|
165
|
+
content: { role: "user", parts: [{ text: value }] },
|
|
166
|
+
outputDimensionality: googleOptions == null ? void 0 : googleOptions.outputDimensionality,
|
|
167
|
+
taskType: googleOptions == null ? void 0 : googleOptions.taskType
|
|
168
|
+
}))
|
|
169
|
+
},
|
|
170
|
+
failedResponseHandler: googleFailedResponseHandler,
|
|
171
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
172
|
+
googleGenerativeAITextEmbeddingResponseSchema
|
|
173
|
+
),
|
|
174
|
+
abortSignal,
|
|
175
|
+
fetch: this.config.fetch
|
|
176
|
+
});
|
|
177
|
+
return {
|
|
178
|
+
warnings: [],
|
|
179
|
+
embeddings: response.embeddings.map((item) => item.values),
|
|
180
|
+
usage: void 0,
|
|
181
|
+
response: { headers: responseHeaders, body: rawValue }
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
var googleGenerativeAITextEmbeddingResponseSchema = lazySchema3(
|
|
186
|
+
() => zodSchema3(
|
|
187
|
+
z3.object({
|
|
188
|
+
embeddings: z3.array(z3.object({ values: z3.array(z3.number()) }))
|
|
189
|
+
})
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
var googleGenerativeAISingleEmbeddingResponseSchema = lazySchema3(
|
|
193
|
+
() => zodSchema3(
|
|
194
|
+
z3.object({
|
|
195
|
+
embedding: z3.object({ values: z3.array(z3.number()) })
|
|
196
|
+
})
|
|
197
|
+
)
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
// src/google-generative-ai-language-model.ts
|
|
201
|
+
import {
|
|
202
|
+
combineHeaders as combineHeaders2,
|
|
203
|
+
createEventSourceResponseHandler,
|
|
204
|
+
createJsonResponseHandler as createJsonResponseHandler2,
|
|
205
|
+
generateId,
|
|
206
|
+
lazySchema as lazySchema5,
|
|
207
|
+
parseProviderOptions as parseProviderOptions2,
|
|
208
|
+
postJsonToApi as postJsonToApi2,
|
|
209
|
+
resolve as resolve2,
|
|
210
|
+
zodSchema as zodSchema5
|
|
211
|
+
} from "@ai-sdk/provider-utils";
|
|
212
|
+
import { z as z5 } from "zod/v4";
|
|
213
|
+
|
|
214
|
+
// src/convert-google-generative-ai-usage.ts
|
|
215
|
+
function convertGoogleGenerativeAIUsage(usage) {
|
|
216
|
+
var _a, _b, _c, _d;
|
|
217
|
+
if (usage == null) {
|
|
218
|
+
return {
|
|
219
|
+
inputTokens: {
|
|
220
|
+
total: void 0,
|
|
221
|
+
noCache: void 0,
|
|
222
|
+
cacheRead: void 0,
|
|
223
|
+
cacheWrite: void 0
|
|
224
|
+
},
|
|
225
|
+
outputTokens: {
|
|
226
|
+
total: void 0,
|
|
227
|
+
text: void 0,
|
|
228
|
+
reasoning: void 0
|
|
229
|
+
},
|
|
230
|
+
raw: void 0
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const promptTokens = (_a = usage.promptTokenCount) != null ? _a : 0;
|
|
234
|
+
const candidatesTokens = (_b = usage.candidatesTokenCount) != null ? _b : 0;
|
|
235
|
+
const cachedContentTokens = (_c = usage.cachedContentTokenCount) != null ? _c : 0;
|
|
236
|
+
const thoughtsTokens = (_d = usage.thoughtsTokenCount) != null ? _d : 0;
|
|
237
|
+
return {
|
|
238
|
+
inputTokens: {
|
|
239
|
+
total: promptTokens,
|
|
240
|
+
noCache: promptTokens - cachedContentTokens,
|
|
241
|
+
cacheRead: cachedContentTokens,
|
|
242
|
+
cacheWrite: void 0
|
|
243
|
+
},
|
|
244
|
+
outputTokens: {
|
|
245
|
+
total: candidatesTokens + thoughtsTokens,
|
|
246
|
+
text: candidatesTokens,
|
|
247
|
+
reasoning: thoughtsTokens
|
|
248
|
+
},
|
|
249
|
+
raw: usage
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/convert-json-schema-to-openapi-schema.ts
|
|
254
|
+
function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
|
|
255
|
+
if (jsonSchema == null) {
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
if (isEmptyObjectSchema(jsonSchema)) {
|
|
259
|
+
if (isRoot) {
|
|
260
|
+
return void 0;
|
|
261
|
+
}
|
|
262
|
+
if (typeof jsonSchema === "object" && jsonSchema.description) {
|
|
263
|
+
return { type: "object", description: jsonSchema.description };
|
|
264
|
+
}
|
|
265
|
+
return { type: "object" };
|
|
266
|
+
}
|
|
267
|
+
if (typeof jsonSchema === "boolean") {
|
|
268
|
+
return { type: "boolean", properties: {} };
|
|
269
|
+
}
|
|
270
|
+
const {
|
|
271
|
+
type,
|
|
272
|
+
description,
|
|
273
|
+
required,
|
|
274
|
+
properties,
|
|
275
|
+
items,
|
|
276
|
+
allOf,
|
|
277
|
+
anyOf,
|
|
278
|
+
oneOf,
|
|
279
|
+
format,
|
|
280
|
+
const: constValue,
|
|
281
|
+
minLength,
|
|
282
|
+
enum: enumValues
|
|
283
|
+
} = jsonSchema;
|
|
284
|
+
const result = {};
|
|
285
|
+
if (description) result.description = description;
|
|
286
|
+
if (required) result.required = required;
|
|
287
|
+
if (format) result.format = format;
|
|
288
|
+
if (constValue !== void 0) {
|
|
289
|
+
result.enum = [constValue];
|
|
290
|
+
}
|
|
291
|
+
if (type) {
|
|
292
|
+
if (Array.isArray(type)) {
|
|
293
|
+
const hasNull = type.includes("null");
|
|
294
|
+
const nonNullTypes = type.filter((t) => t !== "null");
|
|
295
|
+
if (nonNullTypes.length === 0) {
|
|
296
|
+
result.type = "null";
|
|
297
|
+
} else {
|
|
298
|
+
result.anyOf = nonNullTypes.map((t) => ({ type: t }));
|
|
299
|
+
if (hasNull) {
|
|
300
|
+
result.nullable = true;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
result.type = type;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (enumValues !== void 0) {
|
|
308
|
+
result.enum = enumValues;
|
|
309
|
+
}
|
|
310
|
+
if (properties != null) {
|
|
311
|
+
result.properties = Object.entries(properties).reduce(
|
|
312
|
+
(acc, [key, value]) => {
|
|
313
|
+
acc[key] = convertJSONSchemaToOpenAPISchema(value, false);
|
|
314
|
+
return acc;
|
|
315
|
+
},
|
|
316
|
+
{}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
if (items) {
|
|
320
|
+
result.items = Array.isArray(items) ? items.map((item) => convertJSONSchemaToOpenAPISchema(item, false)) : convertJSONSchemaToOpenAPISchema(items, false);
|
|
321
|
+
}
|
|
322
|
+
if (allOf) {
|
|
323
|
+
result.allOf = allOf.map(
|
|
324
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
if (anyOf) {
|
|
328
|
+
if (anyOf.some(
|
|
329
|
+
(schema) => typeof schema === "object" && (schema == null ? void 0 : schema.type) === "null"
|
|
330
|
+
)) {
|
|
331
|
+
const nonNullSchemas = anyOf.filter(
|
|
332
|
+
(schema) => !(typeof schema === "object" && (schema == null ? void 0 : schema.type) === "null")
|
|
333
|
+
);
|
|
334
|
+
if (nonNullSchemas.length === 1) {
|
|
335
|
+
const converted = convertJSONSchemaToOpenAPISchema(
|
|
336
|
+
nonNullSchemas[0],
|
|
337
|
+
false
|
|
338
|
+
);
|
|
339
|
+
if (typeof converted === "object") {
|
|
340
|
+
result.nullable = true;
|
|
341
|
+
Object.assign(result, converted);
|
|
342
|
+
}
|
|
343
|
+
} else {
|
|
344
|
+
result.anyOf = nonNullSchemas.map(
|
|
345
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
346
|
+
);
|
|
347
|
+
result.nullable = true;
|
|
348
|
+
}
|
|
349
|
+
} else {
|
|
350
|
+
result.anyOf = anyOf.map(
|
|
351
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (oneOf) {
|
|
356
|
+
result.oneOf = oneOf.map(
|
|
357
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
if (minLength !== void 0) {
|
|
361
|
+
result.minLength = minLength;
|
|
362
|
+
}
|
|
363
|
+
return result;
|
|
364
|
+
}
|
|
365
|
+
function isEmptyObjectSchema(jsonSchema) {
|
|
366
|
+
return jsonSchema != null && typeof jsonSchema === "object" && jsonSchema.type === "object" && (jsonSchema.properties == null || Object.keys(jsonSchema.properties).length === 0) && !jsonSchema.additionalProperties;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// src/convert-to-google-generative-ai-messages.ts
|
|
370
|
+
import {
|
|
371
|
+
UnsupportedFunctionalityError
|
|
372
|
+
} from "@ai-sdk/provider";
|
|
373
|
+
import { convertToBase64 } from "@ai-sdk/provider-utils";
|
|
374
|
+
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
375
|
+
var _a, _b, _c;
|
|
376
|
+
const systemInstructionParts = [];
|
|
377
|
+
const contents = [];
|
|
378
|
+
let systemMessagesAllowed = true;
|
|
379
|
+
const isGemmaModel = (_a = options == null ? void 0 : options.isGemmaModel) != null ? _a : false;
|
|
380
|
+
const providerOptionsName = (_b = options == null ? void 0 : options.providerOptionsName) != null ? _b : "google";
|
|
381
|
+
for (const { role, content } of prompt) {
|
|
382
|
+
switch (role) {
|
|
383
|
+
case "system": {
|
|
384
|
+
if (!systemMessagesAllowed) {
|
|
385
|
+
throw new UnsupportedFunctionalityError({
|
|
386
|
+
functionality: "system messages are only supported at the beginning of the conversation"
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
systemInstructionParts.push({ text: content });
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
case "user": {
|
|
393
|
+
systemMessagesAllowed = false;
|
|
394
|
+
const parts = [];
|
|
395
|
+
for (const part of content) {
|
|
396
|
+
switch (part.type) {
|
|
397
|
+
case "text": {
|
|
398
|
+
parts.push({ text: part.text });
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
case "file": {
|
|
402
|
+
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
403
|
+
parts.push(
|
|
404
|
+
part.data instanceof URL ? {
|
|
405
|
+
fileData: {
|
|
406
|
+
mimeType: mediaType,
|
|
407
|
+
fileUri: part.data.toString()
|
|
408
|
+
}
|
|
409
|
+
} : {
|
|
410
|
+
inlineData: {
|
|
411
|
+
mimeType: mediaType,
|
|
412
|
+
data: convertToBase64(part.data)
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
contents.push({ role: "user", parts });
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
case "assistant": {
|
|
424
|
+
systemMessagesAllowed = false;
|
|
425
|
+
contents.push({
|
|
426
|
+
role: "model",
|
|
427
|
+
parts: content.map((part) => {
|
|
428
|
+
var _a2;
|
|
429
|
+
const providerOpts = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName];
|
|
430
|
+
const thoughtSignature = (providerOpts == null ? void 0 : providerOpts.thoughtSignature) != null ? String(providerOpts.thoughtSignature) : void 0;
|
|
431
|
+
switch (part.type) {
|
|
432
|
+
case "text": {
|
|
433
|
+
return part.text.length === 0 ? void 0 : {
|
|
434
|
+
text: part.text,
|
|
435
|
+
thoughtSignature
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
case "reasoning": {
|
|
439
|
+
return part.text.length === 0 ? void 0 : {
|
|
440
|
+
text: part.text,
|
|
441
|
+
thought: true,
|
|
442
|
+
thoughtSignature
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
case "file": {
|
|
446
|
+
if (part.data instanceof URL) {
|
|
447
|
+
throw new UnsupportedFunctionalityError({
|
|
448
|
+
functionality: "File data URLs in assistant messages are not supported"
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
inlineData: {
|
|
453
|
+
mimeType: part.mediaType,
|
|
454
|
+
data: convertToBase64(part.data)
|
|
455
|
+
},
|
|
456
|
+
thoughtSignature
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
case "tool-call": {
|
|
460
|
+
return {
|
|
461
|
+
functionCall: {
|
|
462
|
+
name: part.toolName,
|
|
463
|
+
args: part.input
|
|
464
|
+
},
|
|
465
|
+
thoughtSignature
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}).filter((part) => part !== void 0)
|
|
470
|
+
});
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
case "tool": {
|
|
474
|
+
systemMessagesAllowed = false;
|
|
475
|
+
const parts = [];
|
|
476
|
+
for (const part of content) {
|
|
477
|
+
if (part.type === "tool-approval-response") {
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
const output = part.output;
|
|
481
|
+
if (output.type === "content") {
|
|
482
|
+
for (const contentPart of output.value) {
|
|
483
|
+
switch (contentPart.type) {
|
|
484
|
+
case "text":
|
|
485
|
+
parts.push({
|
|
486
|
+
functionResponse: {
|
|
487
|
+
name: part.toolName,
|
|
488
|
+
response: {
|
|
489
|
+
name: part.toolName,
|
|
490
|
+
content: contentPart.text
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
break;
|
|
495
|
+
case "image-data":
|
|
496
|
+
parts.push(
|
|
497
|
+
{
|
|
498
|
+
inlineData: {
|
|
499
|
+
mimeType: contentPart.mediaType,
|
|
500
|
+
data: contentPart.data
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
text: "Tool executed successfully and returned this image as a response"
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
break;
|
|
508
|
+
default:
|
|
509
|
+
parts.push({ text: JSON.stringify(contentPart) });
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
parts.push({
|
|
515
|
+
functionResponse: {
|
|
516
|
+
name: part.toolName,
|
|
517
|
+
response: {
|
|
518
|
+
name: part.toolName,
|
|
519
|
+
content: output.type === "execution-denied" ? (_c = output.reason) != null ? _c : "Tool execution denied." : output.value
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
contents.push({
|
|
526
|
+
role: "user",
|
|
527
|
+
parts
|
|
528
|
+
});
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
if (isGemmaModel && systemInstructionParts.length > 0 && contents.length > 0 && contents[0].role === "user") {
|
|
534
|
+
const systemText = systemInstructionParts.map((part) => part.text).join("\n\n");
|
|
535
|
+
contents[0].parts.unshift({ text: systemText + "\n\n" });
|
|
536
|
+
}
|
|
537
|
+
return {
|
|
538
|
+
systemInstruction: systemInstructionParts.length > 0 && !isGemmaModel ? { parts: systemInstructionParts } : void 0,
|
|
539
|
+
contents
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// src/get-model-path.ts
|
|
544
|
+
function getModelPath(modelId) {
|
|
545
|
+
return modelId.includes("/") ? modelId : `models/${modelId}`;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// src/google-generative-ai-options.ts
|
|
549
|
+
import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
|
|
550
|
+
import { z as z4 } from "zod/v4";
|
|
551
|
+
var googleGenerativeAIProviderOptions = lazySchema4(
|
|
552
|
+
() => zodSchema4(
|
|
553
|
+
z4.object({
|
|
554
|
+
responseModalities: z4.array(z4.enum(["TEXT", "IMAGE"])).optional(),
|
|
555
|
+
thinkingConfig: z4.object({
|
|
556
|
+
thinkingBudget: z4.number().optional(),
|
|
557
|
+
includeThoughts: z4.boolean().optional(),
|
|
558
|
+
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
559
|
+
thinkingLevel: z4.enum(["minimal", "low", "medium", "high"]).optional()
|
|
560
|
+
}).optional(),
|
|
561
|
+
/**
|
|
562
|
+
* Optional.
|
|
563
|
+
* The name of the cached content used as context to serve the prediction.
|
|
564
|
+
* Format: cachedContents/{cachedContent}
|
|
565
|
+
*/
|
|
566
|
+
cachedContent: z4.string().optional(),
|
|
567
|
+
/**
|
|
568
|
+
* Optional. Enable structured output. Default is true.
|
|
569
|
+
*
|
|
570
|
+
* This is useful when the JSON Schema contains elements that are
|
|
571
|
+
* not supported by the OpenAPI schema version that
|
|
572
|
+
* Google Generative AI uses. You can use this to disable
|
|
573
|
+
* structured outputs if you need to.
|
|
574
|
+
*/
|
|
575
|
+
structuredOutputs: z4.boolean().optional(),
|
|
576
|
+
/**
|
|
577
|
+
* Optional. A list of unique safety settings for blocking unsafe content.
|
|
578
|
+
*/
|
|
579
|
+
safetySettings: z4.array(
|
|
580
|
+
z4.object({
|
|
581
|
+
category: z4.enum([
|
|
582
|
+
"HARM_CATEGORY_UNSPECIFIED",
|
|
583
|
+
"HARM_CATEGORY_HATE_SPEECH",
|
|
584
|
+
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
585
|
+
"HARM_CATEGORY_HARASSMENT",
|
|
586
|
+
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
587
|
+
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
588
|
+
]),
|
|
589
|
+
threshold: z4.enum([
|
|
590
|
+
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
591
|
+
"BLOCK_LOW_AND_ABOVE",
|
|
592
|
+
"BLOCK_MEDIUM_AND_ABOVE",
|
|
593
|
+
"BLOCK_ONLY_HIGH",
|
|
594
|
+
"BLOCK_NONE",
|
|
595
|
+
"OFF"
|
|
596
|
+
])
|
|
597
|
+
})
|
|
598
|
+
).optional(),
|
|
599
|
+
threshold: z4.enum([
|
|
600
|
+
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
601
|
+
"BLOCK_LOW_AND_ABOVE",
|
|
602
|
+
"BLOCK_MEDIUM_AND_ABOVE",
|
|
603
|
+
"BLOCK_ONLY_HIGH",
|
|
604
|
+
"BLOCK_NONE",
|
|
605
|
+
"OFF"
|
|
606
|
+
]).optional(),
|
|
607
|
+
/**
|
|
608
|
+
* Optional. Enables timestamp understanding for audio-only files.
|
|
609
|
+
*
|
|
610
|
+
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
|
611
|
+
*/
|
|
612
|
+
audioTimestamp: z4.boolean().optional(),
|
|
613
|
+
/**
|
|
614
|
+
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
|
615
|
+
*
|
|
616
|
+
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
|
617
|
+
*/
|
|
618
|
+
labels: z4.record(z4.string(), z4.string()).optional(),
|
|
619
|
+
/**
|
|
620
|
+
* Optional. If specified, the media resolution specified will be used.
|
|
621
|
+
*
|
|
622
|
+
* https://ai.google.dev/api/generate-content#MediaResolution
|
|
623
|
+
*/
|
|
624
|
+
mediaResolution: z4.enum([
|
|
625
|
+
"MEDIA_RESOLUTION_UNSPECIFIED",
|
|
626
|
+
"MEDIA_RESOLUTION_LOW",
|
|
627
|
+
"MEDIA_RESOLUTION_MEDIUM",
|
|
628
|
+
"MEDIA_RESOLUTION_HIGH"
|
|
629
|
+
]).optional(),
|
|
630
|
+
/**
|
|
631
|
+
* Optional. Configures the image generation aspect ratio for Gemini models.
|
|
632
|
+
*
|
|
633
|
+
* https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
|
|
634
|
+
*/
|
|
635
|
+
imageConfig: z4.object({
|
|
636
|
+
aspectRatio: z4.enum([
|
|
637
|
+
"1:1",
|
|
638
|
+
"2:3",
|
|
639
|
+
"3:2",
|
|
640
|
+
"3:4",
|
|
641
|
+
"4:3",
|
|
642
|
+
"4:5",
|
|
643
|
+
"5:4",
|
|
644
|
+
"9:16",
|
|
645
|
+
"16:9",
|
|
646
|
+
"21:9"
|
|
647
|
+
]).optional(),
|
|
648
|
+
imageSize: z4.enum(["1K", "2K", "4K"]).optional()
|
|
649
|
+
}).optional(),
|
|
650
|
+
/**
|
|
651
|
+
* Optional. Configuration for grounding retrieval.
|
|
652
|
+
* Used to provide location context for Google Maps and Google Search grounding.
|
|
653
|
+
*
|
|
654
|
+
* https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
655
|
+
*/
|
|
656
|
+
retrievalConfig: z4.object({
|
|
657
|
+
latLng: z4.object({
|
|
658
|
+
latitude: z4.number(),
|
|
659
|
+
longitude: z4.number()
|
|
660
|
+
}).optional()
|
|
661
|
+
}).optional()
|
|
662
|
+
})
|
|
663
|
+
)
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
// src/google-prepare-tools.ts
|
|
667
|
+
import {
|
|
668
|
+
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|
|
669
|
+
} from "@ai-sdk/provider";
|
|
670
|
+
function prepareTools({
|
|
671
|
+
tools,
|
|
672
|
+
toolChoice,
|
|
673
|
+
modelId
|
|
674
|
+
}) {
|
|
675
|
+
var _a;
|
|
676
|
+
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
677
|
+
const toolWarnings = [];
|
|
678
|
+
const isLatest = [
|
|
679
|
+
"gemini-flash-latest",
|
|
680
|
+
"gemini-flash-lite-latest",
|
|
681
|
+
"gemini-pro-latest"
|
|
682
|
+
].some((id) => id === modelId);
|
|
683
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
684
|
+
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
685
|
+
const supportsFileSearch = modelId.includes("gemini-2.5") || modelId.includes("gemini-3");
|
|
686
|
+
if (tools == null) {
|
|
687
|
+
return { tools: void 0, toolConfig: void 0, toolWarnings };
|
|
688
|
+
}
|
|
689
|
+
const hasFunctionTools = tools.some((tool) => tool.type === "function");
|
|
690
|
+
const hasProviderTools = tools.some((tool) => tool.type === "provider");
|
|
691
|
+
if (hasFunctionTools && hasProviderTools) {
|
|
692
|
+
toolWarnings.push({
|
|
693
|
+
type: "unsupported",
|
|
694
|
+
feature: `combination of function and provider-defined tools`
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
if (hasProviderTools) {
|
|
698
|
+
const googleTools2 = [];
|
|
699
|
+
const ProviderTools = tools.filter((tool) => tool.type === "provider");
|
|
700
|
+
ProviderTools.forEach((tool) => {
|
|
701
|
+
switch (tool.id) {
|
|
702
|
+
case "google.google_search":
|
|
703
|
+
if (isGemini2orNewer) {
|
|
704
|
+
googleTools2.push({ googleSearch: {} });
|
|
705
|
+
} else if (supportsDynamicRetrieval) {
|
|
706
|
+
googleTools2.push({
|
|
707
|
+
googleSearchRetrieval: {
|
|
708
|
+
dynamicRetrievalConfig: {
|
|
709
|
+
mode: tool.args.mode,
|
|
710
|
+
dynamicThreshold: tool.args.dynamicThreshold
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
} else {
|
|
715
|
+
googleTools2.push({ googleSearchRetrieval: {} });
|
|
716
|
+
}
|
|
717
|
+
break;
|
|
718
|
+
case "google.enterprise_web_search":
|
|
719
|
+
if (isGemini2orNewer) {
|
|
720
|
+
googleTools2.push({ enterpriseWebSearch: {} });
|
|
721
|
+
} else {
|
|
722
|
+
toolWarnings.push({
|
|
723
|
+
type: "unsupported",
|
|
724
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
725
|
+
details: "Enterprise Web Search requires Gemini 2.0 or newer."
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
break;
|
|
729
|
+
case "google.url_context":
|
|
730
|
+
if (isGemini2orNewer) {
|
|
731
|
+
googleTools2.push({ urlContext: {} });
|
|
732
|
+
} else {
|
|
733
|
+
toolWarnings.push({
|
|
734
|
+
type: "unsupported",
|
|
735
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
736
|
+
details: "The URL context tool is not supported with other Gemini models than Gemini 2."
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
break;
|
|
740
|
+
case "google.code_execution":
|
|
741
|
+
if (isGemini2orNewer) {
|
|
742
|
+
googleTools2.push({ codeExecution: {} });
|
|
743
|
+
} else {
|
|
744
|
+
toolWarnings.push({
|
|
745
|
+
type: "unsupported",
|
|
746
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
747
|
+
details: "The code execution tools is not supported with other Gemini models than Gemini 2."
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
break;
|
|
751
|
+
case "google.file_search":
|
|
752
|
+
if (supportsFileSearch) {
|
|
753
|
+
googleTools2.push({ fileSearch: { ...tool.args } });
|
|
754
|
+
} else {
|
|
755
|
+
toolWarnings.push({
|
|
756
|
+
type: "unsupported",
|
|
757
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
758
|
+
details: "The file search tool is only supported with Gemini 2.5 models and Gemini 3 models."
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
case "google.vertex_rag_store":
|
|
763
|
+
if (isGemini2orNewer) {
|
|
764
|
+
googleTools2.push({
|
|
765
|
+
retrieval: {
|
|
766
|
+
vertex_rag_store: {
|
|
767
|
+
rag_resources: {
|
|
768
|
+
rag_corpus: tool.args.ragCorpus
|
|
769
|
+
},
|
|
770
|
+
similarity_top_k: tool.args.topK
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
} else {
|
|
775
|
+
toolWarnings.push({
|
|
776
|
+
type: "unsupported",
|
|
777
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
778
|
+
details: "The RAG store tool is not supported with other Gemini models than Gemini 2."
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
break;
|
|
782
|
+
case "google.google_maps":
|
|
783
|
+
if (isGemini2orNewer) {
|
|
784
|
+
googleTools2.push({ googleMaps: {} });
|
|
785
|
+
} else {
|
|
786
|
+
toolWarnings.push({
|
|
787
|
+
type: "unsupported",
|
|
788
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
789
|
+
details: "The Google Maps grounding tool is not supported with Gemini models other than Gemini 2 or newer."
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
break;
|
|
793
|
+
default:
|
|
794
|
+
toolWarnings.push({
|
|
795
|
+
type: "unsupported",
|
|
796
|
+
feature: `provider-defined tool ${tool.id}`
|
|
797
|
+
});
|
|
798
|
+
break;
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
return {
|
|
802
|
+
tools: googleTools2.length > 0 ? googleTools2 : void 0,
|
|
803
|
+
toolConfig: void 0,
|
|
804
|
+
toolWarnings
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
const functionDeclarations = [];
|
|
808
|
+
for (const tool of tools) {
|
|
809
|
+
switch (tool.type) {
|
|
810
|
+
case "function":
|
|
811
|
+
functionDeclarations.push({
|
|
812
|
+
name: tool.name,
|
|
813
|
+
description: (_a = tool.description) != null ? _a : "",
|
|
814
|
+
parameters: convertJSONSchemaToOpenAPISchema(tool.inputSchema)
|
|
815
|
+
});
|
|
816
|
+
break;
|
|
817
|
+
default:
|
|
818
|
+
toolWarnings.push({
|
|
819
|
+
type: "unsupported",
|
|
820
|
+
feature: `function tool ${tool.name}`
|
|
821
|
+
});
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (toolChoice == null) {
|
|
826
|
+
return {
|
|
827
|
+
tools: [{ functionDeclarations }],
|
|
828
|
+
toolConfig: void 0,
|
|
829
|
+
toolWarnings
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
const type = toolChoice.type;
|
|
833
|
+
switch (type) {
|
|
834
|
+
case "auto":
|
|
835
|
+
return {
|
|
836
|
+
tools: [{ functionDeclarations }],
|
|
837
|
+
toolConfig: { functionCallingConfig: { mode: "AUTO" } },
|
|
838
|
+
toolWarnings
|
|
839
|
+
};
|
|
840
|
+
case "none":
|
|
841
|
+
return {
|
|
842
|
+
tools: [{ functionDeclarations }],
|
|
843
|
+
toolConfig: { functionCallingConfig: { mode: "NONE" } },
|
|
844
|
+
toolWarnings
|
|
845
|
+
};
|
|
846
|
+
case "required":
|
|
847
|
+
return {
|
|
848
|
+
tools: [{ functionDeclarations }],
|
|
849
|
+
toolConfig: { functionCallingConfig: { mode: "ANY" } },
|
|
850
|
+
toolWarnings
|
|
851
|
+
};
|
|
852
|
+
case "tool":
|
|
853
|
+
return {
|
|
854
|
+
tools: [{ functionDeclarations }],
|
|
855
|
+
toolConfig: {
|
|
856
|
+
functionCallingConfig: {
|
|
857
|
+
mode: "ANY",
|
|
858
|
+
allowedFunctionNames: [toolChoice.toolName]
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
toolWarnings
|
|
862
|
+
};
|
|
863
|
+
default: {
|
|
864
|
+
const _exhaustiveCheck = type;
|
|
865
|
+
throw new UnsupportedFunctionalityError2({
|
|
866
|
+
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// src/map-google-generative-ai-finish-reason.ts
|
|
873
|
+
function mapGoogleGenerativeAIFinishReason({
|
|
874
|
+
finishReason,
|
|
875
|
+
hasToolCalls
|
|
876
|
+
}) {
|
|
877
|
+
switch (finishReason) {
|
|
878
|
+
case "STOP":
|
|
879
|
+
return hasToolCalls ? "tool-calls" : "stop";
|
|
880
|
+
case "MAX_TOKENS":
|
|
881
|
+
return "length";
|
|
882
|
+
case "IMAGE_SAFETY":
|
|
883
|
+
case "RECITATION":
|
|
884
|
+
case "SAFETY":
|
|
885
|
+
case "BLOCKLIST":
|
|
886
|
+
case "PROHIBITED_CONTENT":
|
|
887
|
+
case "SPII":
|
|
888
|
+
return "content-filter";
|
|
889
|
+
case "MALFORMED_FUNCTION_CALL":
|
|
890
|
+
return "error";
|
|
891
|
+
case "FINISH_REASON_UNSPECIFIED":
|
|
892
|
+
case "OTHER":
|
|
893
|
+
default:
|
|
894
|
+
return "other";
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/google-generative-ai-language-model.ts
|
|
899
|
+
var GoogleGenerativeAILanguageModel = class {
|
|
900
|
+
constructor(modelId, config) {
|
|
901
|
+
this.specificationVersion = "v3";
|
|
902
|
+
var _a;
|
|
903
|
+
this.modelId = modelId;
|
|
904
|
+
this.config = config;
|
|
905
|
+
this.generateId = (_a = config.generateId) != null ? _a : generateId;
|
|
906
|
+
}
|
|
907
|
+
get provider() {
|
|
908
|
+
return this.config.provider;
|
|
909
|
+
}
|
|
910
|
+
get supportedUrls() {
|
|
911
|
+
var _a, _b, _c;
|
|
912
|
+
return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};
|
|
913
|
+
}
|
|
914
|
+
async getArgs({
|
|
915
|
+
prompt,
|
|
916
|
+
maxOutputTokens,
|
|
917
|
+
temperature,
|
|
918
|
+
topP,
|
|
919
|
+
topK,
|
|
920
|
+
frequencyPenalty,
|
|
921
|
+
presencePenalty,
|
|
922
|
+
stopSequences,
|
|
923
|
+
responseFormat,
|
|
924
|
+
seed,
|
|
925
|
+
tools,
|
|
926
|
+
toolChoice,
|
|
927
|
+
providerOptions
|
|
928
|
+
}) {
|
|
929
|
+
var _a;
|
|
930
|
+
const warnings = [];
|
|
931
|
+
const providerOptionsName = this.config.provider.includes("vertex") ? "vertex" : "google";
|
|
932
|
+
let googleOptions = await parseProviderOptions2({
|
|
933
|
+
provider: providerOptionsName,
|
|
934
|
+
providerOptions,
|
|
935
|
+
schema: googleGenerativeAIProviderOptions
|
|
936
|
+
});
|
|
937
|
+
if (googleOptions == null && providerOptionsName !== "google") {
|
|
938
|
+
googleOptions = await parseProviderOptions2({
|
|
939
|
+
provider: "google",
|
|
940
|
+
providerOptions,
|
|
941
|
+
schema: googleGenerativeAIProviderOptions
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
if ((tools == null ? void 0 : tools.some(
|
|
945
|
+
(tool) => tool.type === "provider" && tool.id === "google.vertex_rag_store"
|
|
946
|
+
)) && !this.config.provider.startsWith("google.vertex.")) {
|
|
947
|
+
warnings.push({
|
|
948
|
+
type: "other",
|
|
949
|
+
message: `The 'vertex_rag_store' tool is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (${this.config.provider}).`
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
|
|
953
|
+
const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
|
|
954
|
+
prompt,
|
|
955
|
+
{ isGemmaModel, providerOptionsName }
|
|
956
|
+
);
|
|
957
|
+
const {
|
|
958
|
+
tools: googleTools2,
|
|
959
|
+
toolConfig: googleToolConfig,
|
|
960
|
+
toolWarnings
|
|
961
|
+
} = prepareTools({
|
|
962
|
+
tools,
|
|
963
|
+
toolChoice,
|
|
964
|
+
modelId: this.modelId
|
|
965
|
+
});
|
|
966
|
+
return {
|
|
967
|
+
args: {
|
|
968
|
+
generationConfig: {
|
|
969
|
+
// standardized settings:
|
|
970
|
+
maxOutputTokens,
|
|
971
|
+
temperature,
|
|
972
|
+
topK,
|
|
973
|
+
topP,
|
|
974
|
+
frequencyPenalty,
|
|
975
|
+
presencePenalty,
|
|
976
|
+
stopSequences,
|
|
977
|
+
seed,
|
|
978
|
+
// response format:
|
|
979
|
+
responseMimeType: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? "application/json" : void 0,
|
|
980
|
+
responseSchema: (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && // Google GenAI does not support all OpenAPI Schema features,
|
|
981
|
+
// so this is needed as an escape hatch:
|
|
982
|
+
// TODO convert into provider option
|
|
983
|
+
((_a = googleOptions == null ? void 0 : googleOptions.structuredOutputs) != null ? _a : true) ? convertJSONSchemaToOpenAPISchema(responseFormat.schema) : void 0,
|
|
984
|
+
...(googleOptions == null ? void 0 : googleOptions.audioTimestamp) && {
|
|
985
|
+
audioTimestamp: googleOptions.audioTimestamp
|
|
986
|
+
},
|
|
987
|
+
// provider options:
|
|
988
|
+
responseModalities: googleOptions == null ? void 0 : googleOptions.responseModalities,
|
|
989
|
+
thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig,
|
|
990
|
+
...(googleOptions == null ? void 0 : googleOptions.mediaResolution) && {
|
|
991
|
+
mediaResolution: googleOptions.mediaResolution
|
|
992
|
+
},
|
|
993
|
+
...(googleOptions == null ? void 0 : googleOptions.imageConfig) && {
|
|
994
|
+
imageConfig: googleOptions.imageConfig
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
contents,
|
|
998
|
+
systemInstruction: isGemmaModel ? void 0 : systemInstruction,
|
|
999
|
+
safetySettings: googleOptions == null ? void 0 : googleOptions.safetySettings,
|
|
1000
|
+
tools: googleTools2,
|
|
1001
|
+
toolConfig: (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
|
|
1002
|
+
...googleToolConfig,
|
|
1003
|
+
retrievalConfig: googleOptions.retrievalConfig
|
|
1004
|
+
} : googleToolConfig,
|
|
1005
|
+
cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
|
|
1006
|
+
labels: googleOptions == null ? void 0 : googleOptions.labels
|
|
1007
|
+
},
|
|
1008
|
+
warnings: [...warnings, ...toolWarnings],
|
|
1009
|
+
providerOptionsName
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
async doGenerate(options) {
|
|
1013
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1014
|
+
const { args, warnings, providerOptionsName } = await this.getArgs(options);
|
|
1015
|
+
const mergedHeaders = combineHeaders2(
|
|
1016
|
+
await resolve2(this.config.headers),
|
|
1017
|
+
options.headers
|
|
1018
|
+
);
|
|
1019
|
+
const {
|
|
1020
|
+
responseHeaders,
|
|
1021
|
+
value: response,
|
|
1022
|
+
rawValue: rawResponse
|
|
1023
|
+
} = await postJsonToApi2({
|
|
1024
|
+
url: `${this.config.baseURL}/${getModelPath(
|
|
1025
|
+
this.modelId
|
|
1026
|
+
)}:generateContent`,
|
|
1027
|
+
headers: mergedHeaders,
|
|
1028
|
+
body: args,
|
|
1029
|
+
failedResponseHandler: googleFailedResponseHandler,
|
|
1030
|
+
successfulResponseHandler: createJsonResponseHandler2(responseSchema),
|
|
1031
|
+
abortSignal: options.abortSignal,
|
|
1032
|
+
fetch: this.config.fetch
|
|
1033
|
+
});
|
|
1034
|
+
const candidate = response.candidates[0];
|
|
1035
|
+
const content = [];
|
|
1036
|
+
const parts = (_b = (_a = candidate.content) == null ? void 0 : _a.parts) != null ? _b : [];
|
|
1037
|
+
const usageMetadata = response.usageMetadata;
|
|
1038
|
+
let lastCodeExecutionToolCallId;
|
|
1039
|
+
for (const part of parts) {
|
|
1040
|
+
if ("executableCode" in part && ((_c = part.executableCode) == null ? void 0 : _c.code)) {
|
|
1041
|
+
const toolCallId = this.config.generateId();
|
|
1042
|
+
lastCodeExecutionToolCallId = toolCallId;
|
|
1043
|
+
content.push({
|
|
1044
|
+
type: "tool-call",
|
|
1045
|
+
toolCallId,
|
|
1046
|
+
toolName: "code_execution",
|
|
1047
|
+
input: JSON.stringify(part.executableCode),
|
|
1048
|
+
providerExecuted: true
|
|
1049
|
+
});
|
|
1050
|
+
} else if ("codeExecutionResult" in part && part.codeExecutionResult) {
|
|
1051
|
+
content.push({
|
|
1052
|
+
type: "tool-result",
|
|
1053
|
+
// Assumes a result directly follows its corresponding call part.
|
|
1054
|
+
toolCallId: lastCodeExecutionToolCallId,
|
|
1055
|
+
toolName: "code_execution",
|
|
1056
|
+
result: {
|
|
1057
|
+
outcome: part.codeExecutionResult.outcome,
|
|
1058
|
+
output: part.codeExecutionResult.output
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
lastCodeExecutionToolCallId = void 0;
|
|
1062
|
+
} else if ("text" in part && part.text != null && part.text.length > 0) {
|
|
1063
|
+
content.push({
|
|
1064
|
+
type: part.thought === true ? "reasoning" : "text",
|
|
1065
|
+
text: part.text,
|
|
1066
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1067
|
+
[providerOptionsName]: {
|
|
1068
|
+
thoughtSignature: part.thoughtSignature
|
|
1069
|
+
}
|
|
1070
|
+
} : void 0
|
|
1071
|
+
});
|
|
1072
|
+
} else if ("functionCall" in part) {
|
|
1073
|
+
content.push({
|
|
1074
|
+
type: "tool-call",
|
|
1075
|
+
toolCallId: this.config.generateId(),
|
|
1076
|
+
toolName: part.functionCall.name,
|
|
1077
|
+
input: JSON.stringify(part.functionCall.args),
|
|
1078
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1079
|
+
[providerOptionsName]: {
|
|
1080
|
+
thoughtSignature: part.thoughtSignature
|
|
1081
|
+
}
|
|
1082
|
+
} : void 0
|
|
1083
|
+
});
|
|
1084
|
+
} else if ("inlineData" in part) {
|
|
1085
|
+
content.push({
|
|
1086
|
+
type: "file",
|
|
1087
|
+
data: part.inlineData.data,
|
|
1088
|
+
mediaType: part.inlineData.mimeType,
|
|
1089
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1090
|
+
[providerOptionsName]: {
|
|
1091
|
+
thoughtSignature: part.thoughtSignature
|
|
1092
|
+
}
|
|
1093
|
+
} : void 0
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
const sources = (_d = extractSources({
|
|
1098
|
+
groundingMetadata: candidate.groundingMetadata,
|
|
1099
|
+
generateId: this.config.generateId
|
|
1100
|
+
})) != null ? _d : [];
|
|
1101
|
+
for (const source of sources) {
|
|
1102
|
+
content.push(source);
|
|
1103
|
+
}
|
|
1104
|
+
return {
|
|
1105
|
+
content,
|
|
1106
|
+
finishReason: {
|
|
1107
|
+
unified: mapGoogleGenerativeAIFinishReason({
|
|
1108
|
+
finishReason: candidate.finishReason,
|
|
1109
|
+
// Only count client-executed tool calls for finish reason determination.
|
|
1110
|
+
hasToolCalls: content.some(
|
|
1111
|
+
(part) => part.type === "tool-call" && !part.providerExecuted
|
|
1112
|
+
)
|
|
1113
|
+
}),
|
|
1114
|
+
raw: (_e = candidate.finishReason) != null ? _e : void 0
|
|
1115
|
+
},
|
|
1116
|
+
usage: convertGoogleGenerativeAIUsage(usageMetadata),
|
|
1117
|
+
warnings,
|
|
1118
|
+
providerMetadata: {
|
|
1119
|
+
[providerOptionsName]: {
|
|
1120
|
+
promptFeedback: (_f = response.promptFeedback) != null ? _f : null,
|
|
1121
|
+
groundingMetadata: (_g = candidate.groundingMetadata) != null ? _g : null,
|
|
1122
|
+
urlContextMetadata: (_h = candidate.urlContextMetadata) != null ? _h : null,
|
|
1123
|
+
safetyRatings: (_i = candidate.safetyRatings) != null ? _i : null,
|
|
1124
|
+
usageMetadata: usageMetadata != null ? usageMetadata : null
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
request: { body: args },
|
|
1128
|
+
response: {
|
|
1129
|
+
// TODO timestamp, model id, id
|
|
1130
|
+
headers: responseHeaders,
|
|
1131
|
+
body: rawResponse
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
async doStream(options) {
|
|
1136
|
+
const { args, warnings, providerOptionsName } = await this.getArgs(options);
|
|
1137
|
+
const headers = combineHeaders2(
|
|
1138
|
+
await resolve2(this.config.headers),
|
|
1139
|
+
options.headers
|
|
1140
|
+
);
|
|
1141
|
+
const { responseHeaders, value: response } = await postJsonToApi2({
|
|
1142
|
+
url: `${this.config.baseURL}/${getModelPath(
|
|
1143
|
+
this.modelId
|
|
1144
|
+
)}:streamGenerateContent?alt=sse`,
|
|
1145
|
+
headers,
|
|
1146
|
+
body: args,
|
|
1147
|
+
failedResponseHandler: googleFailedResponseHandler,
|
|
1148
|
+
successfulResponseHandler: createEventSourceResponseHandler(chunkSchema),
|
|
1149
|
+
abortSignal: options.abortSignal,
|
|
1150
|
+
fetch: this.config.fetch
|
|
1151
|
+
});
|
|
1152
|
+
let finishReason = {
|
|
1153
|
+
unified: "other",
|
|
1154
|
+
raw: void 0
|
|
1155
|
+
};
|
|
1156
|
+
let usage = void 0;
|
|
1157
|
+
let providerMetadata = void 0;
|
|
1158
|
+
const generateId3 = this.config.generateId;
|
|
1159
|
+
let hasToolCalls = false;
|
|
1160
|
+
let currentTextBlockId = null;
|
|
1161
|
+
let currentReasoningBlockId = null;
|
|
1162
|
+
let blockCounter = 0;
|
|
1163
|
+
const emittedSourceUrls = /* @__PURE__ */ new Set();
|
|
1164
|
+
let lastCodeExecutionToolCallId;
|
|
1165
|
+
return {
|
|
1166
|
+
stream: response.pipeThrough(
|
|
1167
|
+
new TransformStream({
|
|
1168
|
+
start(controller) {
|
|
1169
|
+
controller.enqueue({ type: "stream-start", warnings });
|
|
1170
|
+
},
|
|
1171
|
+
transform(chunk, controller) {
|
|
1172
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1173
|
+
if (options.includeRawChunks) {
|
|
1174
|
+
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
1175
|
+
}
|
|
1176
|
+
if (!chunk.success) {
|
|
1177
|
+
controller.enqueue({ type: "error", error: chunk.error });
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
const value = chunk.value;
|
|
1181
|
+
const usageMetadata = value.usageMetadata;
|
|
1182
|
+
if (usageMetadata != null) {
|
|
1183
|
+
usage = usageMetadata;
|
|
1184
|
+
}
|
|
1185
|
+
const candidate = (_a = value.candidates) == null ? void 0 : _a[0];
|
|
1186
|
+
if (candidate == null) {
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
const content = candidate.content;
|
|
1190
|
+
const sources = extractSources({
|
|
1191
|
+
groundingMetadata: candidate.groundingMetadata,
|
|
1192
|
+
generateId: generateId3
|
|
1193
|
+
});
|
|
1194
|
+
if (sources != null) {
|
|
1195
|
+
for (const source of sources) {
|
|
1196
|
+
if (source.sourceType === "url" && !emittedSourceUrls.has(source.url)) {
|
|
1197
|
+
emittedSourceUrls.add(source.url);
|
|
1198
|
+
controller.enqueue(source);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
if (content != null) {
|
|
1203
|
+
const parts = (_b = content.parts) != null ? _b : [];
|
|
1204
|
+
for (const part of parts) {
|
|
1205
|
+
if ("executableCode" in part && ((_c = part.executableCode) == null ? void 0 : _c.code)) {
|
|
1206
|
+
const toolCallId = generateId3();
|
|
1207
|
+
lastCodeExecutionToolCallId = toolCallId;
|
|
1208
|
+
controller.enqueue({
|
|
1209
|
+
type: "tool-call",
|
|
1210
|
+
toolCallId,
|
|
1211
|
+
toolName: "code_execution",
|
|
1212
|
+
input: JSON.stringify(part.executableCode),
|
|
1213
|
+
providerExecuted: true
|
|
1214
|
+
});
|
|
1215
|
+
} else if ("codeExecutionResult" in part && part.codeExecutionResult) {
|
|
1216
|
+
const toolCallId = lastCodeExecutionToolCallId;
|
|
1217
|
+
if (toolCallId) {
|
|
1218
|
+
controller.enqueue({
|
|
1219
|
+
type: "tool-result",
|
|
1220
|
+
toolCallId,
|
|
1221
|
+
toolName: "code_execution",
|
|
1222
|
+
result: {
|
|
1223
|
+
outcome: part.codeExecutionResult.outcome,
|
|
1224
|
+
output: part.codeExecutionResult.output
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
lastCodeExecutionToolCallId = void 0;
|
|
1228
|
+
}
|
|
1229
|
+
} else if ("text" in part && part.text != null && part.text.length > 0) {
|
|
1230
|
+
if (part.thought === true) {
|
|
1231
|
+
if (currentTextBlockId !== null) {
|
|
1232
|
+
controller.enqueue({
|
|
1233
|
+
type: "text-end",
|
|
1234
|
+
id: currentTextBlockId
|
|
1235
|
+
});
|
|
1236
|
+
currentTextBlockId = null;
|
|
1237
|
+
}
|
|
1238
|
+
if (currentReasoningBlockId === null) {
|
|
1239
|
+
currentReasoningBlockId = String(blockCounter++);
|
|
1240
|
+
controller.enqueue({
|
|
1241
|
+
type: "reasoning-start",
|
|
1242
|
+
id: currentReasoningBlockId,
|
|
1243
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1244
|
+
[providerOptionsName]: {
|
|
1245
|
+
thoughtSignature: part.thoughtSignature
|
|
1246
|
+
}
|
|
1247
|
+
} : void 0
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
controller.enqueue({
|
|
1251
|
+
type: "reasoning-delta",
|
|
1252
|
+
id: currentReasoningBlockId,
|
|
1253
|
+
delta: part.text,
|
|
1254
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1255
|
+
[providerOptionsName]: {
|
|
1256
|
+
thoughtSignature: part.thoughtSignature
|
|
1257
|
+
}
|
|
1258
|
+
} : void 0
|
|
1259
|
+
});
|
|
1260
|
+
} else {
|
|
1261
|
+
if (currentReasoningBlockId !== null) {
|
|
1262
|
+
controller.enqueue({
|
|
1263
|
+
type: "reasoning-end",
|
|
1264
|
+
id: currentReasoningBlockId
|
|
1265
|
+
});
|
|
1266
|
+
currentReasoningBlockId = null;
|
|
1267
|
+
}
|
|
1268
|
+
if (currentTextBlockId === null) {
|
|
1269
|
+
currentTextBlockId = String(blockCounter++);
|
|
1270
|
+
controller.enqueue({
|
|
1271
|
+
type: "text-start",
|
|
1272
|
+
id: currentTextBlockId,
|
|
1273
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1274
|
+
[providerOptionsName]: {
|
|
1275
|
+
thoughtSignature: part.thoughtSignature
|
|
1276
|
+
}
|
|
1277
|
+
} : void 0
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
controller.enqueue({
|
|
1281
|
+
type: "text-delta",
|
|
1282
|
+
id: currentTextBlockId,
|
|
1283
|
+
delta: part.text,
|
|
1284
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1285
|
+
[providerOptionsName]: {
|
|
1286
|
+
thoughtSignature: part.thoughtSignature
|
|
1287
|
+
}
|
|
1288
|
+
} : void 0
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
} else if ("inlineData" in part) {
|
|
1292
|
+
controller.enqueue({
|
|
1293
|
+
type: "file",
|
|
1294
|
+
mediaType: part.inlineData.mimeType,
|
|
1295
|
+
data: part.inlineData.data
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
const toolCallDeltas = getToolCallsFromParts({
|
|
1300
|
+
parts: content.parts,
|
|
1301
|
+
generateId: generateId3,
|
|
1302
|
+
providerOptionsName
|
|
1303
|
+
});
|
|
1304
|
+
if (toolCallDeltas != null) {
|
|
1305
|
+
for (const toolCall of toolCallDeltas) {
|
|
1306
|
+
controller.enqueue({
|
|
1307
|
+
type: "tool-input-start",
|
|
1308
|
+
id: toolCall.toolCallId,
|
|
1309
|
+
toolName: toolCall.toolName,
|
|
1310
|
+
providerMetadata: toolCall.providerMetadata
|
|
1311
|
+
});
|
|
1312
|
+
controller.enqueue({
|
|
1313
|
+
type: "tool-input-delta",
|
|
1314
|
+
id: toolCall.toolCallId,
|
|
1315
|
+
delta: toolCall.args,
|
|
1316
|
+
providerMetadata: toolCall.providerMetadata
|
|
1317
|
+
});
|
|
1318
|
+
controller.enqueue({
|
|
1319
|
+
type: "tool-input-end",
|
|
1320
|
+
id: toolCall.toolCallId,
|
|
1321
|
+
providerMetadata: toolCall.providerMetadata
|
|
1322
|
+
});
|
|
1323
|
+
controller.enqueue({
|
|
1324
|
+
type: "tool-call",
|
|
1325
|
+
toolCallId: toolCall.toolCallId,
|
|
1326
|
+
toolName: toolCall.toolName,
|
|
1327
|
+
input: toolCall.args,
|
|
1328
|
+
providerMetadata: toolCall.providerMetadata
|
|
1329
|
+
});
|
|
1330
|
+
hasToolCalls = true;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
if (candidate.finishReason != null) {
|
|
1335
|
+
finishReason = {
|
|
1336
|
+
unified: mapGoogleGenerativeAIFinishReason({
|
|
1337
|
+
finishReason: candidate.finishReason,
|
|
1338
|
+
hasToolCalls
|
|
1339
|
+
}),
|
|
1340
|
+
raw: candidate.finishReason
|
|
1341
|
+
};
|
|
1342
|
+
providerMetadata = {
|
|
1343
|
+
[providerOptionsName]: {
|
|
1344
|
+
promptFeedback: (_d = value.promptFeedback) != null ? _d : null,
|
|
1345
|
+
groundingMetadata: (_e = candidate.groundingMetadata) != null ? _e : null,
|
|
1346
|
+
urlContextMetadata: (_f = candidate.urlContextMetadata) != null ? _f : null,
|
|
1347
|
+
safetyRatings: (_g = candidate.safetyRatings) != null ? _g : null
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
if (usageMetadata != null) {
|
|
1351
|
+
providerMetadata[providerOptionsName].usageMetadata = usageMetadata;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
flush(controller) {
|
|
1356
|
+
if (currentTextBlockId !== null) {
|
|
1357
|
+
controller.enqueue({
|
|
1358
|
+
type: "text-end",
|
|
1359
|
+
id: currentTextBlockId
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
if (currentReasoningBlockId !== null) {
|
|
1363
|
+
controller.enqueue({
|
|
1364
|
+
type: "reasoning-end",
|
|
1365
|
+
id: currentReasoningBlockId
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
controller.enqueue({
|
|
1369
|
+
type: "finish",
|
|
1370
|
+
finishReason,
|
|
1371
|
+
usage: convertGoogleGenerativeAIUsage(usage),
|
|
1372
|
+
providerMetadata
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
})
|
|
1376
|
+
),
|
|
1377
|
+
response: { headers: responseHeaders },
|
|
1378
|
+
request: { body: args }
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
function getToolCallsFromParts({
|
|
1383
|
+
parts,
|
|
1384
|
+
generateId: generateId3,
|
|
1385
|
+
providerOptionsName
|
|
1386
|
+
}) {
|
|
1387
|
+
const functionCallParts = parts == null ? void 0 : parts.filter(
|
|
1388
|
+
(part) => "functionCall" in part
|
|
1389
|
+
);
|
|
1390
|
+
return functionCallParts == null || functionCallParts.length === 0 ? void 0 : functionCallParts.map((part) => ({
|
|
1391
|
+
type: "tool-call",
|
|
1392
|
+
toolCallId: generateId3(),
|
|
1393
|
+
toolName: part.functionCall.name,
|
|
1394
|
+
args: JSON.stringify(part.functionCall.args),
|
|
1395
|
+
providerMetadata: part.thoughtSignature ? {
|
|
1396
|
+
[providerOptionsName]: {
|
|
1397
|
+
thoughtSignature: part.thoughtSignature
|
|
1398
|
+
}
|
|
1399
|
+
} : void 0
|
|
1400
|
+
}));
|
|
1401
|
+
}
|
|
1402
|
+
function extractSources({
|
|
1403
|
+
groundingMetadata,
|
|
1404
|
+
generateId: generateId3
|
|
1405
|
+
}) {
|
|
1406
|
+
var _a, _b, _c, _d, _e;
|
|
1407
|
+
if (!(groundingMetadata == null ? void 0 : groundingMetadata.groundingChunks)) {
|
|
1408
|
+
return void 0;
|
|
1409
|
+
}
|
|
1410
|
+
const sources = [];
|
|
1411
|
+
for (const chunk of groundingMetadata.groundingChunks) {
|
|
1412
|
+
if (chunk.web != null) {
|
|
1413
|
+
sources.push({
|
|
1414
|
+
type: "source",
|
|
1415
|
+
sourceType: "url",
|
|
1416
|
+
id: generateId3(),
|
|
1417
|
+
url: chunk.web.uri,
|
|
1418
|
+
title: (_a = chunk.web.title) != null ? _a : void 0
|
|
1419
|
+
});
|
|
1420
|
+
} else if (chunk.retrievedContext != null) {
|
|
1421
|
+
const uri = chunk.retrievedContext.uri;
|
|
1422
|
+
const fileSearchStore = chunk.retrievedContext.fileSearchStore;
|
|
1423
|
+
if (uri && (uri.startsWith("http://") || uri.startsWith("https://"))) {
|
|
1424
|
+
sources.push({
|
|
1425
|
+
type: "source",
|
|
1426
|
+
sourceType: "url",
|
|
1427
|
+
id: generateId3(),
|
|
1428
|
+
url: uri,
|
|
1429
|
+
title: (_b = chunk.retrievedContext.title) != null ? _b : void 0
|
|
1430
|
+
});
|
|
1431
|
+
} else if (uri) {
|
|
1432
|
+
const title = (_c = chunk.retrievedContext.title) != null ? _c : "Unknown Document";
|
|
1433
|
+
let mediaType = "application/octet-stream";
|
|
1434
|
+
let filename = void 0;
|
|
1435
|
+
if (uri.endsWith(".pdf")) {
|
|
1436
|
+
mediaType = "application/pdf";
|
|
1437
|
+
filename = uri.split("/").pop();
|
|
1438
|
+
} else if (uri.endsWith(".txt")) {
|
|
1439
|
+
mediaType = "text/plain";
|
|
1440
|
+
filename = uri.split("/").pop();
|
|
1441
|
+
} else if (uri.endsWith(".docx")) {
|
|
1442
|
+
mediaType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
1443
|
+
filename = uri.split("/").pop();
|
|
1444
|
+
} else if (uri.endsWith(".doc")) {
|
|
1445
|
+
mediaType = "application/msword";
|
|
1446
|
+
filename = uri.split("/").pop();
|
|
1447
|
+
} else if (uri.match(/\.(md|markdown)$/)) {
|
|
1448
|
+
mediaType = "text/markdown";
|
|
1449
|
+
filename = uri.split("/").pop();
|
|
1450
|
+
} else {
|
|
1451
|
+
filename = uri.split("/").pop();
|
|
1452
|
+
}
|
|
1453
|
+
sources.push({
|
|
1454
|
+
type: "source",
|
|
1455
|
+
sourceType: "document",
|
|
1456
|
+
id: generateId3(),
|
|
1457
|
+
mediaType,
|
|
1458
|
+
title,
|
|
1459
|
+
filename
|
|
1460
|
+
});
|
|
1461
|
+
} else if (fileSearchStore) {
|
|
1462
|
+
const title = (_d = chunk.retrievedContext.title) != null ? _d : "Unknown Document";
|
|
1463
|
+
sources.push({
|
|
1464
|
+
type: "source",
|
|
1465
|
+
sourceType: "document",
|
|
1466
|
+
id: generateId3(),
|
|
1467
|
+
mediaType: "application/octet-stream",
|
|
1468
|
+
title,
|
|
1469
|
+
filename: fileSearchStore.split("/").pop()
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
} else if (chunk.maps != null) {
|
|
1473
|
+
if (chunk.maps.uri) {
|
|
1474
|
+
sources.push({
|
|
1475
|
+
type: "source",
|
|
1476
|
+
sourceType: "url",
|
|
1477
|
+
id: generateId3(),
|
|
1478
|
+
url: chunk.maps.uri,
|
|
1479
|
+
title: (_e = chunk.maps.title) != null ? _e : void 0
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return sources.length > 0 ? sources : void 0;
|
|
1485
|
+
}
|
|
1486
|
+
var getGroundingMetadataSchema = () => z5.object({
|
|
1487
|
+
webSearchQueries: z5.array(z5.string()).nullish(),
|
|
1488
|
+
retrievalQueries: z5.array(z5.string()).nullish(),
|
|
1489
|
+
searchEntryPoint: z5.object({ renderedContent: z5.string() }).nullish(),
|
|
1490
|
+
groundingChunks: z5.array(
|
|
1491
|
+
z5.object({
|
|
1492
|
+
web: z5.object({ uri: z5.string(), title: z5.string().nullish() }).nullish(),
|
|
1493
|
+
retrievedContext: z5.object({
|
|
1494
|
+
uri: z5.string().nullish(),
|
|
1495
|
+
title: z5.string().nullish(),
|
|
1496
|
+
text: z5.string().nullish(),
|
|
1497
|
+
fileSearchStore: z5.string().nullish()
|
|
1498
|
+
}).nullish(),
|
|
1499
|
+
maps: z5.object({
|
|
1500
|
+
uri: z5.string().nullish(),
|
|
1501
|
+
title: z5.string().nullish(),
|
|
1502
|
+
text: z5.string().nullish(),
|
|
1503
|
+
placeId: z5.string().nullish()
|
|
1504
|
+
}).nullish()
|
|
1505
|
+
})
|
|
1506
|
+
).nullish(),
|
|
1507
|
+
groundingSupports: z5.array(
|
|
1508
|
+
z5.object({
|
|
1509
|
+
segment: z5.object({
|
|
1510
|
+
startIndex: z5.number().nullish(),
|
|
1511
|
+
endIndex: z5.number().nullish(),
|
|
1512
|
+
text: z5.string().nullish()
|
|
1513
|
+
}),
|
|
1514
|
+
segment_text: z5.string().nullish(),
|
|
1515
|
+
groundingChunkIndices: z5.array(z5.number()).nullish(),
|
|
1516
|
+
supportChunkIndices: z5.array(z5.number()).nullish(),
|
|
1517
|
+
confidenceScores: z5.array(z5.number()).nullish(),
|
|
1518
|
+
confidenceScore: z5.array(z5.number()).nullish()
|
|
1519
|
+
})
|
|
1520
|
+
).nullish(),
|
|
1521
|
+
retrievalMetadata: z5.union([
|
|
1522
|
+
z5.object({
|
|
1523
|
+
webDynamicRetrievalScore: z5.number()
|
|
1524
|
+
}),
|
|
1525
|
+
z5.object({})
|
|
1526
|
+
]).nullish()
|
|
1527
|
+
});
|
|
1528
|
+
var getContentSchema = () => z5.object({
|
|
1529
|
+
parts: z5.array(
|
|
1530
|
+
z5.union([
|
|
1531
|
+
// note: order matters since text can be fully empty
|
|
1532
|
+
z5.object({
|
|
1533
|
+
functionCall: z5.object({
|
|
1534
|
+
name: z5.string(),
|
|
1535
|
+
args: z5.unknown()
|
|
1536
|
+
}),
|
|
1537
|
+
thoughtSignature: z5.string().nullish()
|
|
1538
|
+
}),
|
|
1539
|
+
z5.object({
|
|
1540
|
+
inlineData: z5.object({
|
|
1541
|
+
mimeType: z5.string(),
|
|
1542
|
+
data: z5.string()
|
|
1543
|
+
}),
|
|
1544
|
+
thoughtSignature: z5.string().nullish()
|
|
1545
|
+
}),
|
|
1546
|
+
z5.object({
|
|
1547
|
+
executableCode: z5.object({
|
|
1548
|
+
language: z5.string(),
|
|
1549
|
+
code: z5.string()
|
|
1550
|
+
}).nullish(),
|
|
1551
|
+
codeExecutionResult: z5.object({
|
|
1552
|
+
outcome: z5.string(),
|
|
1553
|
+
output: z5.string()
|
|
1554
|
+
}).nullish(),
|
|
1555
|
+
text: z5.string().nullish(),
|
|
1556
|
+
thought: z5.boolean().nullish(),
|
|
1557
|
+
thoughtSignature: z5.string().nullish()
|
|
1558
|
+
})
|
|
1559
|
+
])
|
|
1560
|
+
).nullish()
|
|
1561
|
+
});
|
|
1562
|
+
var getSafetyRatingSchema = () => z5.object({
|
|
1563
|
+
category: z5.string().nullish(),
|
|
1564
|
+
probability: z5.string().nullish(),
|
|
1565
|
+
probabilityScore: z5.number().nullish(),
|
|
1566
|
+
severity: z5.string().nullish(),
|
|
1567
|
+
severityScore: z5.number().nullish(),
|
|
1568
|
+
blocked: z5.boolean().nullish()
|
|
1569
|
+
});
|
|
1570
|
+
var usageSchema = z5.object({
|
|
1571
|
+
cachedContentTokenCount: z5.number().nullish(),
|
|
1572
|
+
thoughtsTokenCount: z5.number().nullish(),
|
|
1573
|
+
promptTokenCount: z5.number().nullish(),
|
|
1574
|
+
candidatesTokenCount: z5.number().nullish(),
|
|
1575
|
+
totalTokenCount: z5.number().nullish(),
|
|
1576
|
+
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
1577
|
+
trafficType: z5.string().nullish()
|
|
1578
|
+
});
|
|
1579
|
+
var getUrlContextMetadataSchema = () => z5.object({
|
|
1580
|
+
urlMetadata: z5.array(
|
|
1581
|
+
z5.object({
|
|
1582
|
+
retrievedUrl: z5.string(),
|
|
1583
|
+
urlRetrievalStatus: z5.string()
|
|
1584
|
+
})
|
|
1585
|
+
)
|
|
1586
|
+
});
|
|
1587
|
+
var responseSchema = lazySchema5(
|
|
1588
|
+
() => zodSchema5(
|
|
1589
|
+
z5.object({
|
|
1590
|
+
candidates: z5.array(
|
|
1591
|
+
z5.object({
|
|
1592
|
+
content: getContentSchema().nullish().or(z5.object({}).strict()),
|
|
1593
|
+
finishReason: z5.string().nullish(),
|
|
1594
|
+
safetyRatings: z5.array(getSafetyRatingSchema()).nullish(),
|
|
1595
|
+
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
1596
|
+
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
1597
|
+
})
|
|
1598
|
+
),
|
|
1599
|
+
usageMetadata: usageSchema.nullish(),
|
|
1600
|
+
promptFeedback: z5.object({
|
|
1601
|
+
blockReason: z5.string().nullish(),
|
|
1602
|
+
safetyRatings: z5.array(getSafetyRatingSchema()).nullish()
|
|
1603
|
+
}).nullish()
|
|
1604
|
+
})
|
|
1605
|
+
)
|
|
1606
|
+
);
|
|
1607
|
+
var chunkSchema = lazySchema5(
|
|
1608
|
+
() => zodSchema5(
|
|
1609
|
+
z5.object({
|
|
1610
|
+
candidates: z5.array(
|
|
1611
|
+
z5.object({
|
|
1612
|
+
content: getContentSchema().nullish(),
|
|
1613
|
+
finishReason: z5.string().nullish(),
|
|
1614
|
+
safetyRatings: z5.array(getSafetyRatingSchema()).nullish(),
|
|
1615
|
+
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
1616
|
+
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
1617
|
+
})
|
|
1618
|
+
).nullish(),
|
|
1619
|
+
usageMetadata: usageSchema.nullish(),
|
|
1620
|
+
promptFeedback: z5.object({
|
|
1621
|
+
blockReason: z5.string().nullish(),
|
|
1622
|
+
safetyRatings: z5.array(getSafetyRatingSchema()).nullish()
|
|
1623
|
+
}).nullish()
|
|
1624
|
+
})
|
|
1625
|
+
)
|
|
1626
|
+
);
|
|
1627
|
+
|
|
1628
|
+
// src/tool/code-execution.ts
|
|
1629
|
+
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
|
1630
|
+
import { z as z6 } from "zod/v4";
|
|
1631
|
+
var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
1632
|
+
id: "google.code_execution",
|
|
1633
|
+
inputSchema: z6.object({
|
|
1634
|
+
language: z6.string().describe("The programming language of the code."),
|
|
1635
|
+
code: z6.string().describe("The code to be executed.")
|
|
1636
|
+
}),
|
|
1637
|
+
outputSchema: z6.object({
|
|
1638
|
+
outcome: z6.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
1639
|
+
output: z6.string().describe("The output from the code execution.")
|
|
1640
|
+
})
|
|
1641
|
+
});
|
|
1642
|
+
|
|
1643
|
+
// src/tool/enterprise-web-search.ts
|
|
1644
|
+
import {
|
|
1645
|
+
createProviderToolFactory,
|
|
1646
|
+
lazySchema as lazySchema6,
|
|
1647
|
+
zodSchema as zodSchema6
|
|
1648
|
+
} from "@ai-sdk/provider-utils";
|
|
1649
|
+
import { z as z7 } from "zod/v4";
|
|
1650
|
+
var enterpriseWebSearch = createProviderToolFactory({
|
|
1651
|
+
id: "google.enterprise_web_search",
|
|
1652
|
+
inputSchema: lazySchema6(() => zodSchema6(z7.object({})))
|
|
1653
|
+
});
|
|
1654
|
+
|
|
1655
|
+
// src/tool/file-search.ts
|
|
1656
|
+
import {
|
|
1657
|
+
createProviderToolFactory as createProviderToolFactory2,
|
|
1658
|
+
lazySchema as lazySchema7,
|
|
1659
|
+
zodSchema as zodSchema7
|
|
1660
|
+
} from "@ai-sdk/provider-utils";
|
|
1661
|
+
import { z as z8 } from "zod/v4";
|
|
1662
|
+
var fileSearchArgsBaseSchema = z8.object({
|
|
1663
|
+
/** The names of the file_search_stores to retrieve from.
|
|
1664
|
+
* Example: `fileSearchStores/my-file-search-store-123`
|
|
1665
|
+
*/
|
|
1666
|
+
fileSearchStoreNames: z8.array(z8.string()).describe(
|
|
1667
|
+
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
1668
|
+
),
|
|
1669
|
+
/** The number of file search retrieval chunks to retrieve. */
|
|
1670
|
+
topK: z8.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
1671
|
+
/** Metadata filter to apply to the file search retrieval documents.
|
|
1672
|
+
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
1673
|
+
*/
|
|
1674
|
+
metadataFilter: z8.string().describe(
|
|
1675
|
+
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
1676
|
+
).optional()
|
|
1677
|
+
}).passthrough();
|
|
1678
|
+
var fileSearchArgsSchema = lazySchema7(
|
|
1679
|
+
() => zodSchema7(fileSearchArgsBaseSchema)
|
|
1680
|
+
);
|
|
1681
|
+
var fileSearch = createProviderToolFactory2({
|
|
1682
|
+
id: "google.file_search",
|
|
1683
|
+
inputSchema: fileSearchArgsSchema
|
|
1684
|
+
});
|
|
1685
|
+
|
|
1686
|
+
// src/tool/google-maps.ts
|
|
1687
|
+
import {
|
|
1688
|
+
createProviderToolFactory as createProviderToolFactory3,
|
|
1689
|
+
lazySchema as lazySchema8,
|
|
1690
|
+
zodSchema as zodSchema8
|
|
1691
|
+
} from "@ai-sdk/provider-utils";
|
|
1692
|
+
import { z as z9 } from "zod/v4";
|
|
1693
|
+
var googleMaps = createProviderToolFactory3({
|
|
1694
|
+
id: "google.google_maps",
|
|
1695
|
+
inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
1696
|
+
});
|
|
1697
|
+
|
|
1698
|
+
// src/tool/google-search.ts
|
|
1699
|
+
import {
|
|
1700
|
+
createProviderToolFactory as createProviderToolFactory4,
|
|
1701
|
+
lazySchema as lazySchema9,
|
|
1702
|
+
zodSchema as zodSchema9
|
|
1703
|
+
} from "@ai-sdk/provider-utils";
|
|
1704
|
+
import { z as z10 } from "zod/v4";
|
|
1705
|
+
var googleSearch = createProviderToolFactory4({
|
|
1706
|
+
id: "google.google_search",
|
|
1707
|
+
inputSchema: lazySchema9(
|
|
1708
|
+
() => zodSchema9(
|
|
1709
|
+
z10.object({
|
|
1710
|
+
mode: z10.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
|
|
1711
|
+
dynamicThreshold: z10.number().default(1)
|
|
1712
|
+
})
|
|
1713
|
+
)
|
|
1714
|
+
)
|
|
1715
|
+
});
|
|
1716
|
+
|
|
1717
|
+
// src/tool/url-context.ts
|
|
1718
|
+
import {
|
|
1719
|
+
createProviderToolFactory as createProviderToolFactory5,
|
|
1720
|
+
lazySchema as lazySchema10,
|
|
1721
|
+
zodSchema as zodSchema10
|
|
1722
|
+
} from "@ai-sdk/provider-utils";
|
|
1723
|
+
import { z as z11 } from "zod/v4";
|
|
1724
|
+
var urlContext = createProviderToolFactory5({
|
|
1725
|
+
id: "google.url_context",
|
|
1726
|
+
inputSchema: lazySchema10(() => zodSchema10(z11.object({})))
|
|
1727
|
+
});
|
|
1728
|
+
|
|
1729
|
+
// src/tool/vertex-rag-store.ts
|
|
1730
|
+
import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
|
|
1731
|
+
import { z as z12 } from "zod/v4";
|
|
1732
|
+
var vertexRagStore = createProviderToolFactory6({
|
|
1733
|
+
id: "google.vertex_rag_store",
|
|
1734
|
+
inputSchema: z12.object({
|
|
1735
|
+
ragCorpus: z12.string(),
|
|
1736
|
+
topK: z12.number().optional()
|
|
1737
|
+
})
|
|
1738
|
+
});
|
|
1739
|
+
|
|
1740
|
+
// src/google-tools.ts
|
|
1741
|
+
var googleTools = {
|
|
1742
|
+
/**
|
|
1743
|
+
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
1744
|
+
* Must have name "google_search".
|
|
1745
|
+
*/
|
|
1746
|
+
googleSearch,
|
|
1747
|
+
/**
|
|
1748
|
+
* Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
|
|
1749
|
+
* Designed for highly-regulated industries (finance, healthcare, public sector).
|
|
1750
|
+
* Does not log customer data and supports VPC service controls.
|
|
1751
|
+
* Must have name "enterprise_web_search".
|
|
1752
|
+
*
|
|
1753
|
+
* @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
|
|
1754
|
+
*
|
|
1755
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
|
|
1756
|
+
*/
|
|
1757
|
+
enterpriseWebSearch,
|
|
1758
|
+
/**
|
|
1759
|
+
* Creates a Google Maps grounding tool that gives the model access to Google Maps data.
|
|
1760
|
+
* Must have name "google_maps".
|
|
1761
|
+
*
|
|
1762
|
+
* @see https://ai.google.dev/gemini-api/docs/maps-grounding
|
|
1763
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
1764
|
+
*/
|
|
1765
|
+
googleMaps,
|
|
1766
|
+
/**
|
|
1767
|
+
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
1768
|
+
* Must have name "url_context".
|
|
1769
|
+
*/
|
|
1770
|
+
urlContext,
|
|
1771
|
+
/**
|
|
1772
|
+
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
1773
|
+
* Must have name "file_search".
|
|
1774
|
+
*
|
|
1775
|
+
* @param fileSearchStoreNames - Fully-qualified File Search store resource names.
|
|
1776
|
+
* @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
|
|
1777
|
+
* @param topK - Optional result limit for the number of chunks returned from File Search.
|
|
1778
|
+
*
|
|
1779
|
+
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
1780
|
+
*/
|
|
1781
|
+
fileSearch,
|
|
1782
|
+
/**
|
|
1783
|
+
* A tool that enables the model to generate and run Python code.
|
|
1784
|
+
* Must have name "code_execution".
|
|
1785
|
+
*
|
|
1786
|
+
* @note Ensure the selected model supports Code Execution.
|
|
1787
|
+
* Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
|
|
1788
|
+
*
|
|
1789
|
+
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
1790
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
1791
|
+
*/
|
|
1792
|
+
codeExecution,
|
|
1793
|
+
/**
|
|
1794
|
+
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
1795
|
+
* Must have name "vertex_rag_store".
|
|
1796
|
+
*/
|
|
1797
|
+
vertexRagStore
|
|
1798
|
+
};
|
|
1799
|
+
|
|
1800
|
+
// src/google-generative-ai-image-model.ts
|
|
1801
|
+
import {
|
|
1802
|
+
combineHeaders as combineHeaders3,
|
|
1803
|
+
createJsonResponseHandler as createJsonResponseHandler3,
|
|
1804
|
+
lazySchema as lazySchema11,
|
|
1805
|
+
parseProviderOptions as parseProviderOptions3,
|
|
1806
|
+
postJsonToApi as postJsonToApi3,
|
|
1807
|
+
resolve as resolve3,
|
|
1808
|
+
zodSchema as zodSchema11
|
|
1809
|
+
} from "@ai-sdk/provider-utils";
|
|
1810
|
+
import { z as z13 } from "zod/v4";
|
|
1811
|
+
var GoogleGenerativeAIImageModel = class {
|
|
1812
|
+
constructor(modelId, settings, config) {
|
|
1813
|
+
this.modelId = modelId;
|
|
1814
|
+
this.settings = settings;
|
|
1815
|
+
this.config = config;
|
|
1816
|
+
this.specificationVersion = "v3";
|
|
1817
|
+
}
|
|
1818
|
+
get maxImagesPerCall() {
|
|
1819
|
+
var _a;
|
|
1820
|
+
return (_a = this.settings.maxImagesPerCall) != null ? _a : 4;
|
|
1821
|
+
}
|
|
1822
|
+
get provider() {
|
|
1823
|
+
return this.config.provider;
|
|
1824
|
+
}
|
|
1825
|
+
async doGenerate(options) {
|
|
1826
|
+
var _a, _b, _c;
|
|
1827
|
+
const {
|
|
1828
|
+
prompt,
|
|
1829
|
+
n = 1,
|
|
1830
|
+
size,
|
|
1831
|
+
aspectRatio = "1:1",
|
|
1832
|
+
seed,
|
|
1833
|
+
providerOptions,
|
|
1834
|
+
headers,
|
|
1835
|
+
abortSignal,
|
|
1836
|
+
files,
|
|
1837
|
+
mask
|
|
1838
|
+
} = options;
|
|
1839
|
+
const warnings = [];
|
|
1840
|
+
if (files != null && files.length > 0) {
|
|
1841
|
+
throw new Error(
|
|
1842
|
+
"Google Generative AI does not support image editing. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
|
|
1843
|
+
);
|
|
1844
|
+
}
|
|
1845
|
+
if (mask != null) {
|
|
1846
|
+
throw new Error(
|
|
1847
|
+
"Google Generative AI does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
if (size != null) {
|
|
1851
|
+
warnings.push({
|
|
1852
|
+
type: "unsupported",
|
|
1853
|
+
feature: "size",
|
|
1854
|
+
details: "This model does not support the `size` option. Use `aspectRatio` instead."
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
if (seed != null) {
|
|
1858
|
+
warnings.push({
|
|
1859
|
+
type: "unsupported",
|
|
1860
|
+
feature: "seed",
|
|
1861
|
+
details: "This model does not support the `seed` option through this provider."
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
const googleOptions = await parseProviderOptions3({
|
|
1865
|
+
provider: "google",
|
|
1866
|
+
providerOptions,
|
|
1867
|
+
schema: googleImageProviderOptionsSchema
|
|
1868
|
+
});
|
|
1869
|
+
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1870
|
+
const parameters = {
|
|
1871
|
+
sampleCount: n
|
|
1872
|
+
};
|
|
1873
|
+
if (aspectRatio != null) {
|
|
1874
|
+
parameters.aspectRatio = aspectRatio;
|
|
1875
|
+
}
|
|
1876
|
+
if (googleOptions) {
|
|
1877
|
+
Object.assign(parameters, googleOptions);
|
|
1878
|
+
}
|
|
1879
|
+
const body = {
|
|
1880
|
+
instances: [{ prompt }],
|
|
1881
|
+
parameters
|
|
1882
|
+
};
|
|
1883
|
+
const { responseHeaders, value: response } = await postJsonToApi3({
|
|
1884
|
+
url: `${this.config.baseURL}/models/${this.modelId}:predict`,
|
|
1885
|
+
headers: combineHeaders3(await resolve3(this.config.headers), headers),
|
|
1886
|
+
body,
|
|
1887
|
+
failedResponseHandler: googleFailedResponseHandler,
|
|
1888
|
+
successfulResponseHandler: createJsonResponseHandler3(
|
|
1889
|
+
googleImageResponseSchema
|
|
1890
|
+
),
|
|
1891
|
+
abortSignal,
|
|
1892
|
+
fetch: this.config.fetch
|
|
1893
|
+
});
|
|
1894
|
+
return {
|
|
1895
|
+
images: response.predictions.map(
|
|
1896
|
+
(p) => p.bytesBase64Encoded
|
|
1897
|
+
),
|
|
1898
|
+
warnings: warnings != null ? warnings : [],
|
|
1899
|
+
providerMetadata: {
|
|
1900
|
+
google: {
|
|
1901
|
+
images: response.predictions.map((prediction) => ({
|
|
1902
|
+
// Add any prediction-specific metadata here
|
|
1903
|
+
}))
|
|
1904
|
+
}
|
|
1905
|
+
},
|
|
1906
|
+
response: {
|
|
1907
|
+
timestamp: currentDate,
|
|
1908
|
+
modelId: this.modelId,
|
|
1909
|
+
headers: responseHeaders
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
var googleImageResponseSchema = lazySchema11(
|
|
1915
|
+
() => zodSchema11(
|
|
1916
|
+
z13.object({
|
|
1917
|
+
predictions: z13.array(z13.object({ bytesBase64Encoded: z13.string() })).default([])
|
|
1918
|
+
})
|
|
1919
|
+
)
|
|
1920
|
+
);
|
|
1921
|
+
var googleImageProviderOptionsSchema = lazySchema11(
|
|
1922
|
+
() => zodSchema11(
|
|
1923
|
+
z13.object({
|
|
1924
|
+
personGeneration: z13.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
|
|
1925
|
+
aspectRatio: z13.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
|
|
1926
|
+
})
|
|
1927
|
+
)
|
|
1928
|
+
);
|
|
1929
|
+
|
|
1930
|
+
// src/google-provider.ts
|
|
1931
|
+
function createGoogleGenerativeAI(options = {}) {
|
|
1932
|
+
var _a, _b;
|
|
1933
|
+
const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a : "https://generativelanguage.googleapis.com/v1beta";
|
|
1934
|
+
const providerName = (_b = options.name) != null ? _b : "google.generative-ai";
|
|
1935
|
+
const getHeaders = () => withUserAgentSuffix(
|
|
1936
|
+
{
|
|
1937
|
+
"x-goog-api-key": loadApiKey({
|
|
1938
|
+
apiKey: options.apiKey,
|
|
1939
|
+
environmentVariableName: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
1940
|
+
description: "Google Generative AI"
|
|
1941
|
+
}),
|
|
1942
|
+
...options.headers
|
|
1943
|
+
},
|
|
1944
|
+
`ai-sdk/google/${VERSION}`
|
|
1945
|
+
);
|
|
1946
|
+
const createChatModel = (modelId) => {
|
|
1947
|
+
var _a2;
|
|
1948
|
+
return new GoogleGenerativeAILanguageModel(modelId, {
|
|
1949
|
+
provider: providerName,
|
|
1950
|
+
baseURL,
|
|
1951
|
+
headers: getHeaders,
|
|
1952
|
+
generateId: (_a2 = options.generateId) != null ? _a2 : generateId2,
|
|
1953
|
+
supportedUrls: () => ({
|
|
1954
|
+
"*": [
|
|
1955
|
+
// Google Generative Language "files" endpoint
|
|
1956
|
+
// e.g. https://generativelanguage.googleapis.com/v1beta/files/...
|
|
1957
|
+
new RegExp(`^${baseURL}/files/.*$`),
|
|
1958
|
+
// YouTube URLs (public or unlisted videos)
|
|
1959
|
+
new RegExp(
|
|
1960
|
+
`^https://(?:www\\.)?youtube\\.com/watch\\?v=[\\w-]+(?:&[\\w=&.-]*)?$`
|
|
1961
|
+
),
|
|
1962
|
+
new RegExp(`^https://youtu\\.be/[\\w-]+(?:\\?[\\w=&.-]*)?$`)
|
|
1963
|
+
]
|
|
1964
|
+
}),
|
|
1965
|
+
fetch: options.fetch
|
|
1966
|
+
});
|
|
1967
|
+
};
|
|
1968
|
+
const createEmbeddingModel = (modelId) => new GoogleGenerativeAIEmbeddingModel(modelId, {
|
|
1969
|
+
provider: providerName,
|
|
1970
|
+
baseURL,
|
|
1971
|
+
headers: getHeaders,
|
|
1972
|
+
fetch: options.fetch
|
|
1973
|
+
});
|
|
1974
|
+
const createImageModel = (modelId, settings = {}) => new GoogleGenerativeAIImageModel(modelId, settings, {
|
|
1975
|
+
provider: providerName,
|
|
1976
|
+
baseURL,
|
|
1977
|
+
headers: getHeaders,
|
|
1978
|
+
fetch: options.fetch
|
|
1979
|
+
});
|
|
1980
|
+
const provider = function(modelId) {
|
|
1981
|
+
if (new.target) {
|
|
1982
|
+
throw new Error(
|
|
1983
|
+
"The Google Generative AI model function cannot be called with the new keyword."
|
|
1984
|
+
);
|
|
1985
|
+
}
|
|
1986
|
+
return createChatModel(modelId);
|
|
1987
|
+
};
|
|
1988
|
+
provider.specificationVersion = "v3";
|
|
1989
|
+
provider.languageModel = createChatModel;
|
|
1990
|
+
provider.chat = createChatModel;
|
|
1991
|
+
provider.generativeAI = createChatModel;
|
|
1992
|
+
provider.embedding = createEmbeddingModel;
|
|
1993
|
+
provider.embeddingModel = createEmbeddingModel;
|
|
1994
|
+
provider.textEmbedding = createEmbeddingModel;
|
|
1995
|
+
provider.textEmbeddingModel = createEmbeddingModel;
|
|
1996
|
+
provider.image = createImageModel;
|
|
1997
|
+
provider.imageModel = createImageModel;
|
|
1998
|
+
provider.tools = googleTools;
|
|
1999
|
+
return provider;
|
|
2000
|
+
}
|
|
2001
|
+
var google = createGoogleGenerativeAI();
|
|
2002
|
+
export {
|
|
2003
|
+
VERSION,
|
|
2004
|
+
createGoogleGenerativeAI,
|
|
2005
|
+
google
|
|
2006
|
+
};
|
|
2007
|
+
//# sourceMappingURL=index.mjs.map
|