From 869b4bcfa1cc2e62af359fce863d6c160d9d2cfc Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Fri, 5 Dec 2025 18:50:07 -0800 Subject: [PATCH 01/15] aws llm runnning --- samples/mastra-nextjs/.defang/lab | 4 + samples/mastra-nextjs/app/package.json | 2 + samples/mastra-nextjs/app/pnpm-lock.yaml | 1051 +++++++++++++++++ .../app/src/mastra/agent/index.ts | 22 +- samples/mastra-nextjs/compose.yaml | 3 +- 5 files changed, 1080 insertions(+), 2 deletions(-) create mode 100644 samples/mastra-nextjs/.defang/lab diff --git a/samples/mastra-nextjs/.defang/lab b/samples/mastra-nextjs/.defang/lab new file mode 100644 index 00000000..80166a03 --- /dev/null +++ b/samples/mastra-nextjs/.defang/lab @@ -0,0 +1,4 @@ +AWS_REGION="us-west-2" +DEFANG_MODE="affordable" +DEFANG_PROVIDER="aws" +AWS_PROFILE="defang-lab" \ No newline at end of file diff --git a/samples/mastra-nextjs/app/package.json b/samples/mastra-nextjs/app/package.json index 3fc893f8..912b0415 100644 --- a/samples/mastra-nextjs/app/package.json +++ b/samples/mastra-nextjs/app/package.json @@ -10,9 +10,11 @@ "lint": "next lint" }, "dependencies": { + "@ai-sdk/amazon-bedrock": "^3.0.67", "@assistant-ui/react": "^0.11.39", "@assistant-ui/react-ai-sdk": "^1.1.11", "@assistant-ui/react-markdown": "^0.11.4", + "@aws-sdk/credential-providers": "^3.946.0", "@mastra/ai-sdk": "^0.2.7", "@mastra/core": "^0.24.1", "@mastra/memory": "^0.15.11", diff --git a/samples/mastra-nextjs/app/pnpm-lock.yaml b/samples/mastra-nextjs/app/pnpm-lock.yaml index 3047afd2..b6185862 100644 --- a/samples/mastra-nextjs/app/pnpm-lock.yaml +++ b/samples/mastra-nextjs/app/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@ai-sdk/amazon-bedrock': + specifier: ^3.0.67 + version: 3.0.67(zod@4.1.13) '@assistant-ui/react': specifier: ^0.11.39 version: 0.11.47(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(use-sync-external-store@1.6.0(react@19.2.0)) @@ -17,6 +20,9 @@ importers: '@assistant-ui/react-markdown': specifier: ^0.11.4 version: 0.11.6(@assistant-ui/react@0.11.47(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(use-sync-external-store@1.6.0(react@19.2.0)))(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) + '@aws-sdk/credential-providers': + specifier: ^3.946.0 + version: 3.946.0 '@mastra/ai-sdk': specifier: ^0.2.7 version: 0.2.7(@mastra/core@0.24.6(openapi-types@12.1.3)(react@19.2.0)(zod@4.1.13))(zod@4.1.13) @@ -154,12 +160,24 @@ packages: resolution: {integrity: sha512-VTDuRS5V0ATbJ/LkaQlisMnTAeYKXAK6scMguVBstf+KIBQ7HIuKhiXLv+G/hvejkV+THoXzoNifInAkU81P1g==} engines: {node: '>=18'} + '@ai-sdk/amazon-bedrock@3.0.67': + resolution: {integrity: sha512-lsvB3zjxSq79BEI0m+iVWCrnJfaPfRfvKHVdU8tVDhB0hRmJQ16A8qU4K6zjxg4wBZo658DO/6zmygHHMOkyzw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/anthropic@2.0.33': resolution: {integrity: sha512-egqr9PHqqX2Am5mn/Xs1C3+1/wphVKiAjpsVpW85eLc2WpW7AgiAg52DCBr4By9bw3UVVuMeR4uEO1X0dKDUDA==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/anthropic@2.0.53': + resolution: {integrity: sha512-ih7NV+OFSNWZCF+tYYD7ovvvM+gv7TRKQblpVohg2ipIwC9Y0TirzocJVREzZa/v9luxUwFbsPji++DUDWWxsg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/gateway@1.0.33': resolution: {integrity: sha512-v9i3GPEo4t3fGcSkQkc07xM6KJN75VUv7C1Mqmmsu2xD8lQwnQfsrgAXyNuWe20yGY0eHuheSPDZhiqsGKtH1g==} engines: {node: '>=18'} @@ -330,6 +348,135 @@ packages: react: optional: true + '@aws-crypto/crc32@5.2.0': + resolution: {integrity: sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/sha256-browser@5.2.0': + resolution: {integrity: sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==} + + '@aws-crypto/sha256-js@5.2.0': + resolution: {integrity: sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/supports-web-crypto@5.2.0': + resolution: {integrity: sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==} + + '@aws-crypto/util@5.2.0': + resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} + + '@aws-sdk/client-cognito-identity@3.946.0': + resolution: {integrity: sha512-wPdlfEpVqyTmtLfJB+V0Caf6/wEtDi2/GtEuFPkC41ZwHr1xjds8gLvi0MT7tKXcLMcExHOm5biljPbt5cuJ2w==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/client-sso@3.946.0': + resolution: {integrity: sha512-kGAs5iIVyUz4p6TX3pzG5q3cNxXnVpC4pwRC6DCSaSv9ozyPjc2d74FsK4fZ+J+ejtvCdJk72uiuQtWJc86Wuw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/core@3.946.0': + resolution: {integrity: sha512-u2BkbLLVbMFrEiXrko2+S6ih5sUZPlbVyRPtXOqMHlCyzr70sE8kIiD6ba223rQeIFPcYfW/wHc6k4ihW2xxVg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-cognito-identity@3.946.0': + resolution: {integrity: sha512-YNF2zFW6qeKgg5ckEW17bbv825EWEYBizxjk61dCPuu32p+ONlqJSs3uzYfnoKQ92eblIxSPA8pdBlDUkDshyg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-env@3.946.0': + resolution: {integrity: sha512-P4l+K6wX1tf8LmWUvZofdQ+BgCNyk6Tb9u1H10npvqpuCD+dCM4pXIBq3PQcv/juUBOvLGGREo+Govuh3lfD0Q==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-http@3.946.0': + resolution: {integrity: sha512-/zeOJ6E7dGZQ/l2k7KytEoPJX0APIhwt0A79hPf/bUpMF4dDs2P6JmchDrotk0a0Y/MIdNF8sBQ/MEOPnBiYoQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-ini@3.946.0': + resolution: {integrity: sha512-Pdgcra3RivWj/TuZmfFaHbqsvvgnSKO0CxlRUMMr0PgBiCnUhyl+zBktdNOeGsOPH2fUzQpYhcUjYUgVSdcSDQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-login@3.946.0': + resolution: {integrity: sha512-5iqLNc15u2Zx+7jOdQkIbP62N7n2031tw5hkmIG0DLnozhnk64osOh2CliiOE9x3c4P9Pf4frAwgyy9GzNTk2g==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-node@3.946.0': + resolution: {integrity: sha512-I7URUqnBPng1a5y81OImxrwERysZqMBREG6svhhGeZgxmqcpAZ8z5ywILeQXdEOCuuES8phUp/ojzxFjPXp/eA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-process@3.946.0': + resolution: {integrity: sha512-GtGHX7OGqIeVQ3DlVm5RRF43Qmf3S1+PLJv9svrdvAhAdy2bUb044FdXXqrtSsIfpzTKlHgQUiRo5MWLd35Ntw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-sso@3.946.0': + resolution: {integrity: sha512-LeGSSt2V5iwYey1ENGY75RmoDP3bA2iE/py8QBKW8EDA8hn74XBLkprhrK5iccOvU3UGWY8WrEKFAFGNjJOL9g==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.946.0': + resolution: {integrity: sha512-ocBCvjWfkbjxElBI1QUxOnHldsNhoU0uOICFvuRDAZAoxvypJHN3m5BJkqb7gqorBbcv3LRgmBdEnWXOAvq+7Q==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-providers@3.946.0': + resolution: {integrity: sha512-oxx7zHhprVPsMD7HM84Y99En/UOTky6J/gNcOOBlbrSTE5xx3ZkYDersafIzKiOVBnuKu1ZPYrBwDIvlN0lvHQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-host-header@3.936.0': + resolution: {integrity: sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-logger@3.936.0': + resolution: {integrity: sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-recursion-detection@3.936.0': + resolution: {integrity: sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-user-agent@3.946.0': + resolution: {integrity: sha512-7QcljCraeaWQNuqmOoAyZs8KpZcuhPiqdeeKoRd397jVGNRehLFsZbIMOvwaluUDFY11oMyXOkQEERe1Zo2fCw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/nested-clients@3.946.0': + resolution: {integrity: sha512-rjAtEguukeW8mlyEQMQI56vxFoyWlaNwowmz1p1rav948SUjtrzjHAp4TOQWhibb7AR7BUTHBCgIcyCRjBEf4g==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/region-config-resolver@3.936.0': + resolution: {integrity: sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/token-providers@3.946.0': + resolution: {integrity: sha512-a5c+rM6CUPX2ExmUZ3DlbLlS5rQr4tbdoGcgBsjnAHiYx8MuMNAI+8M7wfjF13i2yvUQj5WEIddvLpayfEZj9g==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/types@3.936.0': + resolution: {integrity: sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-endpoints@3.936.0': + resolution: {integrity: sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-locate-window@3.893.0': + resolution: {integrity: sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-user-agent-browser@3.936.0': + resolution: {integrity: sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==} + + '@aws-sdk/util-user-agent-node@3.946.0': + resolution: {integrity: sha512-a2UwwvzbK5AxHKUBupfg4s7VnkqRAHjYsuezHnKCniczmT4HZfP1NnfwwvLKEH8qaTrwenxjKSfq4UWmWkvG+Q==} + engines: {node: '>=18.0.0'} + peerDependencies: + aws-crt: '>=1.0.0' + peerDependenciesMeta: + aws-crt: + optional: true + + '@aws-sdk/xml-builder@3.930.0': + resolution: {integrity: sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==} + engines: {node: '>=18.0.0'} + + '@aws/lambda-invoke-store@0.2.2': + resolution: {integrity: sha512-C0NBLsIqzDIae8HFw9YIrIBsbc0xTiOtt7fAukGPnqQ/+zZNaq+4jhuccltK0QuWHBnNm/a6kLIRA6GFiM10eg==} + engines: {node: '>=18.0.0'} + '@babel/runtime@7.28.4': resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} @@ -1944,6 +2091,182 @@ packages: resolution: {integrity: sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==} engines: {node: '>=12'} + '@smithy/abort-controller@4.2.5': + resolution: {integrity: sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==} + engines: {node: '>=18.0.0'} + + '@smithy/config-resolver@4.4.3': + resolution: {integrity: sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==} + engines: {node: '>=18.0.0'} + + '@smithy/core@3.18.7': + resolution: {integrity: sha512-axG9MvKhMWOhFbvf5y2DuyTxQueO0dkedY9QC3mAfndLosRI/9LJv8WaL0mw7ubNhsO4IuXX9/9dYGPFvHrqlw==} + engines: {node: '>=18.0.0'} + + '@smithy/credential-provider-imds@4.2.5': + resolution: {integrity: sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-codec@4.2.5': + resolution: {integrity: sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA==} + engines: {node: '>=18.0.0'} + + '@smithy/fetch-http-handler@5.3.6': + resolution: {integrity: sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==} + engines: {node: '>=18.0.0'} + + '@smithy/hash-node@4.2.5': + resolution: {integrity: sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==} + engines: {node: '>=18.0.0'} + + '@smithy/invalid-dependency@4.2.5': + resolution: {integrity: sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==} + engines: {node: '>=18.0.0'} + + '@smithy/is-array-buffer@2.2.0': + resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} + engines: {node: '>=14.0.0'} + + '@smithy/is-array-buffer@4.2.0': + resolution: {integrity: sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-content-length@4.2.5': + resolution: {integrity: sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-endpoint@4.3.14': + resolution: {integrity: sha512-v0q4uTKgBM8dsqGjqsabZQyH85nFaTnFcgpWU1uydKFsdyyMzfvOkNum9G7VK+dOP01vUnoZxIeRiJ6uD0kjIg==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-retry@4.4.14': + resolution: {integrity: sha512-Z2DG8Ej7FyWG1UA+7HceINtSLzswUgs2np3sZX0YBBxCt+CXG4QUxv88ZDS3+2/1ldW7LqtSY1UO/6VQ1pND8Q==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-serde@4.2.6': + resolution: {integrity: sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-stack@4.2.5': + resolution: {integrity: sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==} + engines: {node: '>=18.0.0'} + + '@smithy/node-config-provider@4.3.5': + resolution: {integrity: sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==} + engines: {node: '>=18.0.0'} + + '@smithy/node-http-handler@4.4.5': + resolution: {integrity: sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw==} + engines: {node: '>=18.0.0'} + + '@smithy/property-provider@4.2.5': + resolution: {integrity: sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==} + engines: {node: '>=18.0.0'} + + '@smithy/protocol-http@5.3.5': + resolution: {integrity: sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==} + engines: {node: '>=18.0.0'} + + '@smithy/querystring-builder@4.2.5': + resolution: {integrity: sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==} + engines: {node: '>=18.0.0'} + + '@smithy/querystring-parser@4.2.5': + resolution: {integrity: sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==} + engines: {node: '>=18.0.0'} + + '@smithy/service-error-classification@4.2.5': + resolution: {integrity: sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==} + engines: {node: '>=18.0.0'} + + '@smithy/shared-ini-file-loader@4.4.0': + resolution: {integrity: sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==} + engines: {node: '>=18.0.0'} + + '@smithy/signature-v4@5.3.5': + resolution: {integrity: sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==} + engines: {node: '>=18.0.0'} + + '@smithy/smithy-client@4.9.10': + resolution: {integrity: sha512-Jaoz4Jw1QYHc1EFww/E6gVtNjhoDU+gwRKqXP6C3LKYqqH2UQhP8tMP3+t/ePrhaze7fhLE8vS2q6vVxBANFTQ==} + engines: {node: '>=18.0.0'} + + '@smithy/types@4.9.0': + resolution: {integrity: sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==} + engines: {node: '>=18.0.0'} + + '@smithy/url-parser@4.2.5': + resolution: {integrity: sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-base64@4.3.0': + resolution: {integrity: sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-body-length-browser@4.2.0': + resolution: {integrity: sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-body-length-node@4.2.1': + resolution: {integrity: sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==} + engines: {node: '>=18.0.0'} + + '@smithy/util-buffer-from@2.2.0': + resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} + engines: {node: '>=14.0.0'} + + '@smithy/util-buffer-from@4.2.0': + resolution: {integrity: sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==} + engines: {node: '>=18.0.0'} + + '@smithy/util-config-provider@4.2.0': + resolution: {integrity: sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==} + engines: {node: '>=18.0.0'} + + '@smithy/util-defaults-mode-browser@4.3.13': + resolution: {integrity: sha512-hlVLdAGrVfyNei+pKIgqDTxfu/ZI2NSyqj4IDxKd5bIsIqwR/dSlkxlPaYxFiIaDVrBy0he8orsFy+Cz119XvA==} + engines: {node: '>=18.0.0'} + + '@smithy/util-defaults-mode-node@4.2.16': + resolution: {integrity: sha512-F1t22IUiJLHrxW9W1CQ6B9PN+skZ9cqSuzB18Eh06HrJPbjsyZ7ZHecAKw80DQtyGTRcVfeukKaCRYebFwclbg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-endpoints@3.2.5': + resolution: {integrity: sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==} + engines: {node: '>=18.0.0'} + + '@smithy/util-hex-encoding@4.2.0': + resolution: {integrity: sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==} + engines: {node: '>=18.0.0'} + + '@smithy/util-middleware@4.2.5': + resolution: {integrity: sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==} + engines: {node: '>=18.0.0'} + + '@smithy/util-retry@4.2.5': + resolution: {integrity: sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-stream@4.5.6': + resolution: {integrity: sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-uri-escape@4.2.0': + resolution: {integrity: sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==} + engines: {node: '>=18.0.0'} + + '@smithy/util-utf8@2.3.0': + resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} + engines: {node: '>=14.0.0'} + + '@smithy/util-utf8@4.2.0': + resolution: {integrity: sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==} + engines: {node: '>=18.0.0'} + + '@smithy/uuid@1.1.0': + resolution: {integrity: sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==} + engines: {node: '>=18.0.0'} + '@standard-schema/spec@1.0.0': resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==} @@ -2481,6 +2804,9 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} + aws4fetch@1.0.20: + resolution: {integrity: sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g==} + axe-core@4.11.0: resolution: {integrity: sha512-ilYanEU8vxxBexpJd8cWM4ElSQq4QctCLKih0TSfjIfCQTeyH/6zVrmIJfLPrKTKJRbiG+cfnZbQIjAlJmF1jQ==} engines: {node: '>=4'} @@ -2515,6 +2841,9 @@ packages: bottleneck@2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} + bowser@2.13.1: + resolution: {integrity: sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw==} + brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} @@ -3035,6 +3364,10 @@ packages: fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + fast-xml-parser@5.2.5: + resolution: {integrity: sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==} + hasBin: true + fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} @@ -4513,6 +4846,9 @@ packages: resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==} engines: {node: '>=14.16'} + strnum@2.1.1: + resolution: {integrity: sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==} + style-to-js@1.1.21: resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==} @@ -4897,12 +5233,28 @@ snapshots: transitivePeerDependencies: - supports-color + '@ai-sdk/amazon-bedrock@3.0.67(zod@4.1.13)': + dependencies: + '@ai-sdk/anthropic': 2.0.53(zod@4.1.13) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.18(zod@4.1.13) + '@smithy/eventstream-codec': 4.2.5 + '@smithy/util-utf8': 4.2.0 + aws4fetch: 1.0.20 + zod: 4.1.13 + '@ai-sdk/anthropic@2.0.33(zod@4.1.13)': dependencies: '@ai-sdk/provider': 2.0.0 '@ai-sdk/provider-utils': 3.0.12(zod@4.1.13) zod: 4.1.13 + '@ai-sdk/anthropic@2.0.53(zod@4.1.13)': + dependencies: + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.18(zod@4.1.13) + zod: 4.1.13 + '@ai-sdk/gateway@1.0.33(zod@4.1.13)': dependencies: '@ai-sdk/provider': 2.0.0 @@ -5106,6 +5458,414 @@ snapshots: optionalDependencies: react: 19.2.0 + '@aws-crypto/crc32@5.2.0': + dependencies: + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.936.0 + tslib: 2.8.1 + + '@aws-crypto/sha256-browser@5.2.0': + dependencies: + '@aws-crypto/sha256-js': 5.2.0 + '@aws-crypto/supports-web-crypto': 5.2.0 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.936.0 + '@aws-sdk/util-locate-window': 3.893.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + + '@aws-crypto/sha256-js@5.2.0': + dependencies: + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.936.0 + tslib: 2.8.1 + + '@aws-crypto/supports-web-crypto@5.2.0': + dependencies: + tslib: 2.8.1 + + '@aws-crypto/util@5.2.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + + '@aws-sdk/client-cognito-identity@3.946.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.946.0 + '@aws-sdk/credential-provider-node': 3.946.0 + '@aws-sdk/middleware-host-header': 3.936.0 + '@aws-sdk/middleware-logger': 3.936.0 + '@aws-sdk/middleware-recursion-detection': 3.936.0 + '@aws-sdk/middleware-user-agent': 3.946.0 + '@aws-sdk/region-config-resolver': 3.936.0 + '@aws-sdk/types': 3.936.0 + '@aws-sdk/util-endpoints': 3.936.0 + '@aws-sdk/util-user-agent-browser': 3.936.0 + '@aws-sdk/util-user-agent-node': 3.946.0 + '@smithy/config-resolver': 4.4.3 + '@smithy/core': 3.18.7 + '@smithy/fetch-http-handler': 5.3.6 + '@smithy/hash-node': 4.2.5 + '@smithy/invalid-dependency': 4.2.5 + '@smithy/middleware-content-length': 4.2.5 + '@smithy/middleware-endpoint': 4.3.14 + '@smithy/middleware-retry': 4.4.14 + '@smithy/middleware-serde': 4.2.6 + '@smithy/middleware-stack': 4.2.5 + '@smithy/node-config-provider': 4.3.5 + '@smithy/node-http-handler': 4.4.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + '@smithy/util-base64': 4.3.0 + '@smithy/util-body-length-browser': 4.2.0 + '@smithy/util-body-length-node': 4.2.1 + '@smithy/util-defaults-mode-browser': 4.3.13 + '@smithy/util-defaults-mode-node': 4.2.16 + '@smithy/util-endpoints': 3.2.5 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-retry': 4.2.5 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sso@3.946.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.946.0 + '@aws-sdk/middleware-host-header': 3.936.0 + '@aws-sdk/middleware-logger': 3.936.0 + '@aws-sdk/middleware-recursion-detection': 3.936.0 + '@aws-sdk/middleware-user-agent': 3.946.0 + '@aws-sdk/region-config-resolver': 3.936.0 + '@aws-sdk/types': 3.936.0 + '@aws-sdk/util-endpoints': 3.936.0 + '@aws-sdk/util-user-agent-browser': 3.936.0 + '@aws-sdk/util-user-agent-node': 3.946.0 + '@smithy/config-resolver': 4.4.3 + '@smithy/core': 3.18.7 + '@smithy/fetch-http-handler': 5.3.6 + '@smithy/hash-node': 4.2.5 + '@smithy/invalid-dependency': 4.2.5 + '@smithy/middleware-content-length': 4.2.5 + '@smithy/middleware-endpoint': 4.3.14 + '@smithy/middleware-retry': 4.4.14 + '@smithy/middleware-serde': 4.2.6 + '@smithy/middleware-stack': 4.2.5 + '@smithy/node-config-provider': 4.3.5 + '@smithy/node-http-handler': 4.4.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + '@smithy/util-base64': 4.3.0 + '@smithy/util-body-length-browser': 4.2.0 + '@smithy/util-body-length-node': 4.2.1 + '@smithy/util-defaults-mode-browser': 4.3.13 + '@smithy/util-defaults-mode-node': 4.2.16 + '@smithy/util-endpoints': 3.2.5 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-retry': 4.2.5 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/core@3.946.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@aws-sdk/xml-builder': 3.930.0 + '@smithy/core': 3.18.7 + '@smithy/node-config-provider': 4.3.5 + '@smithy/property-provider': 4.2.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/signature-v4': 5.3.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/util-base64': 4.3.0 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-cognito-identity@3.946.0': + dependencies: + '@aws-sdk/client-cognito-identity': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-env@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/fetch-http-handler': 5.3.6 + '@smithy/node-http-handler': 4.4.5 + '@smithy/property-provider': 4.2.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/util-stream': 4.5.6 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-ini@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/credential-provider-env': 3.946.0 + '@aws-sdk/credential-provider-http': 3.946.0 + '@aws-sdk/credential-provider-login': 3.946.0 + '@aws-sdk/credential-provider-process': 3.946.0 + '@aws-sdk/credential-provider-sso': 3.946.0 + '@aws-sdk/credential-provider-web-identity': 3.946.0 + '@aws-sdk/nested-clients': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/credential-provider-imds': 4.2.5 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-login@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/nested-clients': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-node@3.946.0': + dependencies: + '@aws-sdk/credential-provider-env': 3.946.0 + '@aws-sdk/credential-provider-http': 3.946.0 + '@aws-sdk/credential-provider-ini': 3.946.0 + '@aws-sdk/credential-provider-process': 3.946.0 + '@aws-sdk/credential-provider-sso': 3.946.0 + '@aws-sdk/credential-provider-web-identity': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/credential-provider-imds': 4.2.5 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-process@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-sso@3.946.0': + dependencies: + '@aws-sdk/client-sso': 3.946.0 + '@aws-sdk/core': 3.946.0 + '@aws-sdk/token-providers': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-web-identity@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/nested-clients': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-providers@3.946.0': + dependencies: + '@aws-sdk/client-cognito-identity': 3.946.0 + '@aws-sdk/core': 3.946.0 + '@aws-sdk/credential-provider-cognito-identity': 3.946.0 + '@aws-sdk/credential-provider-env': 3.946.0 + '@aws-sdk/credential-provider-http': 3.946.0 + '@aws-sdk/credential-provider-ini': 3.946.0 + '@aws-sdk/credential-provider-login': 3.946.0 + '@aws-sdk/credential-provider-node': 3.946.0 + '@aws-sdk/credential-provider-process': 3.946.0 + '@aws-sdk/credential-provider-sso': 3.946.0 + '@aws-sdk/credential-provider-web-identity': 3.946.0 + '@aws-sdk/nested-clients': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/config-resolver': 4.4.3 + '@smithy/core': 3.18.7 + '@smithy/credential-provider-imds': 4.2.5 + '@smithy/node-config-provider': 4.3.5 + '@smithy/property-provider': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/middleware-host-header@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-logger@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-recursion-detection@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@aws/lambda-invoke-store': 0.2.2 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-user-agent@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@aws-sdk/util-endpoints': 3.936.0 + '@smithy/core': 3.18.7 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/nested-clients@3.946.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.946.0 + '@aws-sdk/middleware-host-header': 3.936.0 + '@aws-sdk/middleware-logger': 3.936.0 + '@aws-sdk/middleware-recursion-detection': 3.936.0 + '@aws-sdk/middleware-user-agent': 3.946.0 + '@aws-sdk/region-config-resolver': 3.936.0 + '@aws-sdk/types': 3.936.0 + '@aws-sdk/util-endpoints': 3.936.0 + '@aws-sdk/util-user-agent-browser': 3.936.0 + '@aws-sdk/util-user-agent-node': 3.946.0 + '@smithy/config-resolver': 4.4.3 + '@smithy/core': 3.18.7 + '@smithy/fetch-http-handler': 5.3.6 + '@smithy/hash-node': 4.2.5 + '@smithy/invalid-dependency': 4.2.5 + '@smithy/middleware-content-length': 4.2.5 + '@smithy/middleware-endpoint': 4.3.14 + '@smithy/middleware-retry': 4.4.14 + '@smithy/middleware-serde': 4.2.6 + '@smithy/middleware-stack': 4.2.5 + '@smithy/node-config-provider': 4.3.5 + '@smithy/node-http-handler': 4.4.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + '@smithy/util-base64': 4.3.0 + '@smithy/util-body-length-browser': 4.2.0 + '@smithy/util-body-length-node': 4.2.1 + '@smithy/util-defaults-mode-browser': 4.3.13 + '@smithy/util-defaults-mode-node': 4.2.16 + '@smithy/util-endpoints': 3.2.5 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-retry': 4.2.5 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/region-config-resolver@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/config-resolver': 4.4.3 + '@smithy/node-config-provider': 4.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/token-providers@3.946.0': + dependencies: + '@aws-sdk/core': 3.946.0 + '@aws-sdk/nested-clients': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/types@3.936.0': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/util-endpoints@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + '@smithy/util-endpoints': 3.2.5 + tslib: 2.8.1 + + '@aws-sdk/util-locate-window@3.893.0': + dependencies: + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-browser@3.936.0': + dependencies: + '@aws-sdk/types': 3.936.0 + '@smithy/types': 4.9.0 + bowser: 2.13.1 + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-node@3.946.0': + dependencies: + '@aws-sdk/middleware-user-agent': 3.946.0 + '@aws-sdk/types': 3.936.0 + '@smithy/node-config-provider': 4.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@aws-sdk/xml-builder@3.930.0': + dependencies: + '@smithy/types': 4.9.0 + fast-xml-parser: 5.2.5 + tslib: 2.8.1 + + '@aws/lambda-invoke-store@0.2.2': {} + '@babel/runtime@7.28.4': {} '@emnapi/core@1.7.1': @@ -6868,6 +7628,287 @@ snapshots: dependencies: escape-string-regexp: 5.0.0 + '@smithy/abort-controller@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/config-resolver@4.4.3': + dependencies: + '@smithy/node-config-provider': 4.3.5 + '@smithy/types': 4.9.0 + '@smithy/util-config-provider': 4.2.0 + '@smithy/util-endpoints': 3.2.5 + '@smithy/util-middleware': 4.2.5 + tslib: 2.8.1 + + '@smithy/core@3.18.7': + dependencies: + '@smithy/middleware-serde': 4.2.6 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + '@smithy/util-base64': 4.3.0 + '@smithy/util-body-length-browser': 4.2.0 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-stream': 4.5.6 + '@smithy/util-utf8': 4.2.0 + '@smithy/uuid': 1.1.0 + tslib: 2.8.1 + + '@smithy/credential-provider-imds@4.2.5': + dependencies: + '@smithy/node-config-provider': 4.3.5 + '@smithy/property-provider': 4.2.5 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + tslib: 2.8.1 + + '@smithy/eventstream-codec@4.2.5': + dependencies: + '@aws-crypto/crc32': 5.2.0 + '@smithy/types': 4.9.0 + '@smithy/util-hex-encoding': 4.2.0 + tslib: 2.8.1 + + '@smithy/fetch-http-handler@5.3.6': + dependencies: + '@smithy/protocol-http': 5.3.5 + '@smithy/querystring-builder': 4.2.5 + '@smithy/types': 4.9.0 + '@smithy/util-base64': 4.3.0 + tslib: 2.8.1 + + '@smithy/hash-node@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + '@smithy/util-buffer-from': 4.2.0 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + + '@smithy/invalid-dependency@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/is-array-buffer@2.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/is-array-buffer@4.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/middleware-content-length@4.2.5': + dependencies: + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/middleware-endpoint@4.3.14': + dependencies: + '@smithy/core': 3.18.7 + '@smithy/middleware-serde': 4.2.6 + '@smithy/node-config-provider': 4.3.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + '@smithy/url-parser': 4.2.5 + '@smithy/util-middleware': 4.2.5 + tslib: 2.8.1 + + '@smithy/middleware-retry@4.4.14': + dependencies: + '@smithy/node-config-provider': 4.3.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/service-error-classification': 4.2.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-retry': 4.2.5 + '@smithy/uuid': 1.1.0 + tslib: 2.8.1 + + '@smithy/middleware-serde@4.2.6': + dependencies: + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/middleware-stack@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/node-config-provider@4.3.5': + dependencies: + '@smithy/property-provider': 4.2.5 + '@smithy/shared-ini-file-loader': 4.4.0 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/node-http-handler@4.4.5': + dependencies: + '@smithy/abort-controller': 4.2.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/querystring-builder': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/property-provider@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/protocol-http@5.3.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/querystring-builder@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + '@smithy/util-uri-escape': 4.2.0 + tslib: 2.8.1 + + '@smithy/querystring-parser@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/service-error-classification@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + + '@smithy/shared-ini-file-loader@4.4.0': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/signature-v4@5.3.5': + dependencies: + '@smithy/is-array-buffer': 4.2.0 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + '@smithy/util-hex-encoding': 4.2.0 + '@smithy/util-middleware': 4.2.5 + '@smithy/util-uri-escape': 4.2.0 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + + '@smithy/smithy-client@4.9.10': + dependencies: + '@smithy/core': 3.18.7 + '@smithy/middleware-endpoint': 4.3.14 + '@smithy/middleware-stack': 4.2.5 + '@smithy/protocol-http': 5.3.5 + '@smithy/types': 4.9.0 + '@smithy/util-stream': 4.5.6 + tslib: 2.8.1 + + '@smithy/types@4.9.0': + dependencies: + tslib: 2.8.1 + + '@smithy/url-parser@4.2.5': + dependencies: + '@smithy/querystring-parser': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-base64@4.3.0': + dependencies: + '@smithy/util-buffer-from': 4.2.0 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + + '@smithy/util-body-length-browser@4.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-body-length-node@4.2.1': + dependencies: + tslib: 2.8.1 + + '@smithy/util-buffer-from@2.2.0': + dependencies: + '@smithy/is-array-buffer': 2.2.0 + tslib: 2.8.1 + + '@smithy/util-buffer-from@4.2.0': + dependencies: + '@smithy/is-array-buffer': 4.2.0 + tslib: 2.8.1 + + '@smithy/util-config-provider@4.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-defaults-mode-browser@4.3.13': + dependencies: + '@smithy/property-provider': 4.2.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-defaults-mode-node@4.2.16': + dependencies: + '@smithy/config-resolver': 4.4.3 + '@smithy/credential-provider-imds': 4.2.5 + '@smithy/node-config-provider': 4.3.5 + '@smithy/property-provider': 4.2.5 + '@smithy/smithy-client': 4.9.10 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-endpoints@3.2.5': + dependencies: + '@smithy/node-config-provider': 4.3.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-hex-encoding@4.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-middleware@4.2.5': + dependencies: + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-retry@4.2.5': + dependencies: + '@smithy/service-error-classification': 4.2.5 + '@smithy/types': 4.9.0 + tslib: 2.8.1 + + '@smithy/util-stream@4.5.6': + dependencies: + '@smithy/fetch-http-handler': 5.3.6 + '@smithy/node-http-handler': 4.4.5 + '@smithy/types': 4.9.0 + '@smithy/util-base64': 4.3.0 + '@smithy/util-buffer-from': 4.2.0 + '@smithy/util-hex-encoding': 4.2.0 + '@smithy/util-utf8': 4.2.0 + tslib: 2.8.1 + + '@smithy/util-uri-escape@4.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-utf8@2.3.0': + dependencies: + '@smithy/util-buffer-from': 2.2.0 + tslib: 2.8.1 + + '@smithy/util-utf8@4.2.0': + dependencies: + '@smithy/util-buffer-from': 4.2.0 + tslib: 2.8.1 + + '@smithy/uuid@1.1.0': + dependencies: + tslib: 2.8.1 + '@standard-schema/spec@1.0.0': {} '@swc/helpers@0.5.15': @@ -7436,6 +8477,8 @@ snapshots: dependencies: possible-typed-array-names: 1.1.0 + aws4fetch@1.0.20: {} + axe-core@4.11.0: {} axobject-query@4.1.0: {} @@ -7483,6 +8526,8 @@ snapshots: bottleneck@2.19.5: {} + bowser@2.13.1: {} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 @@ -8145,6 +9190,10 @@ snapshots: fast-safe-stringify@2.1.1: {} + fast-xml-parser@5.2.5: + dependencies: + strnum: 2.1.1 + fastq@1.19.1: dependencies: reusify: 1.1.0 @@ -9961,6 +11010,8 @@ snapshots: strip-json-comments@5.0.3: {} + strnum@2.1.1: {} + style-to-js@1.1.21: dependencies: style-to-object: 1.0.14 diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index 5348f8e8..84609951 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -1,4 +1,6 @@ import { Agent } from "@mastra/core/agent"; +import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock"; +import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; import { getMemory } from "../memory"; import { instructions } from "./instructions"; @@ -9,11 +11,29 @@ import { getRepositoryCommits } from "../tools/getRepositoryCommits"; import { getRepositoryPullRequests } from "../tools/getRepositoryPullRequests"; import { getRepositoryStars } from "../tools/getRepositoryStars"; +function makeModel(modelName: string, cloudProvider: string) { + if (cloudProvider === "aws") { + return createAmazonBedrock({ + credentialProvider: fromNodeProviderChain(), + })(modelName); + } + + if (cloudProvider === "gcp") { + throw new Error("GCP provider is not implemented yet"); + } + + return null; +} + +const bedrock = createAmazonBedrock({ + credentialProvider: fromNodeProviderChain(), +}); + export const agent = new Agent({ name: "agent", instructions, memory: getMemory, - model: "google/gemini-2.5-flash", + model: bedrock("us.amazon.nova-lite-v1:0"), tools: { getFilePaths, getFileContent, diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index dd198d46..0627eb56 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -1,13 +1,14 @@ services: app: + x-defang-llm: true build: context: ./app dockerfile: Dockerfile environment: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true #set this to false if deploying to defang playground - - GOOGLE_GENERATIVE_AI_API_KEY - GITHUB_TOKEN + - DEFANG_PROVIDER=aws restart: unless-stopped ports: - mode: ingress From 15113814f131fecfeec030206c36d8650b358a78 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Sat, 6 Dec 2025 02:03:15 -0800 Subject: [PATCH 02/15] working GCP --- samples/mastra-nextjs/.defang/lab | 7 +- samples/mastra-nextjs/app/package.json | 3 + samples/mastra-nextjs/app/pnpm-lock.yaml | 260 ++++++++++++++++++ .../app/src/mastra/agent/index.ts | 31 +-- samples/mastra-nextjs/compose.yaml | 3 +- 5 files changed, 285 insertions(+), 19 deletions(-) diff --git a/samples/mastra-nextjs/.defang/lab b/samples/mastra-nextjs/.defang/lab index 80166a03..49fd2e82 100644 --- a/samples/mastra-nextjs/.defang/lab +++ b/samples/mastra-nextjs/.defang/lab @@ -1,4 +1,7 @@ AWS_REGION="us-west-2" DEFANG_MODE="affordable" -DEFANG_PROVIDER="aws" -AWS_PROFILE="defang-lab" \ No newline at end of file +DEFANG_PROVIDER="gcp" +AWS_PROFILE="defang-lab" +GCP_PROJECT_ID="cloudbuildtest-468719" +DEFANG_DEBUG="true" +DEFANG_VERBOSE="true" \ No newline at end of file diff --git a/samples/mastra-nextjs/app/package.json b/samples/mastra-nextjs/app/package.json index 912b0415..e1151e5f 100644 --- a/samples/mastra-nextjs/app/package.json +++ b/samples/mastra-nextjs/app/package.json @@ -11,6 +11,8 @@ }, "dependencies": { "@ai-sdk/amazon-bedrock": "^3.0.67", + "@ai-sdk/google": "^2.0.44", + "@ai-sdk/google-vertex": "^3.0.86", "@assistant-ui/react": "^0.11.39", "@assistant-ui/react-ai-sdk": "^1.1.11", "@assistant-ui/react-markdown": "^0.11.4", @@ -30,6 +32,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dotenv": "^16.4.7", + "google-auth-library": "^10.5.0", "lucide-react": "^0.475.0", "next": "^16.0.3", "next-safe-action": "^7.10.3", diff --git a/samples/mastra-nextjs/app/pnpm-lock.yaml b/samples/mastra-nextjs/app/pnpm-lock.yaml index b6185862..93e71b03 100644 --- a/samples/mastra-nextjs/app/pnpm-lock.yaml +++ b/samples/mastra-nextjs/app/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: '@ai-sdk/amazon-bedrock': specifier: ^3.0.67 version: 3.0.67(zod@4.1.13) + '@ai-sdk/google': + specifier: ^2.0.44 + version: 2.0.44(zod@4.1.13) + '@ai-sdk/google-vertex': + specifier: ^3.0.86 + version: 3.0.86(zod@4.1.13) '@assistant-ui/react': specifier: ^0.11.39 version: 0.11.47(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(use-sync-external-store@1.6.0(react@19.2.0)) @@ -68,6 +74,9 @@ importers: dotenv: specifier: ^16.4.7 version: 16.6.1 + google-auth-library: + specifier: ^10.5.0 + version: 10.5.0 lucide-react: specifier: ^0.475.0 version: 0.475.0(react@19.2.0) @@ -196,12 +205,24 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/google-vertex@3.0.86': + resolution: {integrity: sha512-rdXVXURmmb8A6ma8aud0xqVujbZ9E7Gt68xj6sMw9erZ+HXpBZHJRcx+LYuoLvLoWw9bSLwQJ0QbaXFM68xG4g==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/google@2.0.40': resolution: {integrity: sha512-E7MTVE6vhWXQJzXQDvojwA9t5xlhWpxttCH3R/kUyiE6y0tT8Ay2dmZLO+bLpFBQ5qrvBMrjKWpDVQMoo6TJZg==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/google@2.0.44': + resolution: {integrity: sha512-c5dck36FjqiVoeeMJQLTEmUheoURcGTU/nBT6iJu8/nZiKFT/y8pD85KMDRB7RerRYaaQOtslR2d6/5PditiRw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/mistral@2.0.23': resolution: {integrity: sha512-np2bTlL5ZDi7iAOPCF5SZ5xKqls059iOvsigbgd9VNUCIrWSf6GYOaPvoWEgJ650TUOZitTfMo9MiEhLgutPfA==} engines: {node: '>=18'} @@ -861,6 +882,10 @@ packages: cpu: [x64] os: [win32] + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + '@isaacs/ttlcache@1.4.1': resolution: {integrity: sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==} engines: {node: '>=12'} @@ -1683,6 +1708,10 @@ packages: '@pinojs/redact@0.4.0': resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==} + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + '@protobufjs/aspromise@1.1.2': resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -2726,10 +2755,18 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + engines: {node: '>=12'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} + engines: {node: '>=12'} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -2854,6 +2891,9 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + buffer-equal-constant-time@1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -3125,6 +3165,12 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + ecdsa-sig-formatter@1.0.11: + resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -3411,6 +3457,10 @@ packages: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -3445,10 +3495,18 @@ packages: resolution: {integrity: sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==} engines: {node: '>=14'} + gaxios@7.1.3: + resolution: {integrity: sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==} + engines: {node: '>=18'} + gcp-metadata@6.1.1: resolution: {integrity: sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==} engines: {node: '>=14'} + gcp-metadata@8.1.2: + resolution: {integrity: sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==} + engines: {node: '>=18'} + generator-function@2.0.1: resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==} engines: {node: '>= 0.4'} @@ -3484,6 +3542,10 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + glob@10.5.0: + resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + hasBin: true + globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -3492,10 +3554,18 @@ packages: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} + google-auth-library@10.5.0: + resolution: {integrity: sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==} + engines: {node: '>=18'} + google-logging-utils@0.0.2: resolution: {integrity: sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==} engines: {node: '>=14'} + google-logging-utils@1.1.3: + resolution: {integrity: sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==} + engines: {node: '>=14'} + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -3506,6 +3576,10 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + gtoken@8.0.0: + resolution: {integrity: sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==} + engines: {node: '>=18'} + has-bigints@1.1.0: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} engines: {node: '>= 0.4'} @@ -3792,6 +3866,9 @@ packages: resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} engines: {node: '>= 0.4'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jiti@2.6.1: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true @@ -3849,6 +3926,12 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} + jwa@2.0.1: + resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} + + jws@4.0.1: + resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -3966,6 +4049,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lucide-react@0.475.0: resolution: {integrity: sha512-NJzvVu1HwFVeZ+Gwq2q00KygM1aBhy/ZrhY9FsAgJtpB+E4R7uxRk9M2iKvHa6/vNxZydIB59htha4c2vvwvVg==} peerDependencies: @@ -4164,6 +4250,10 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + module-details-from-path@1.0.4: resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==} @@ -4335,6 +4425,9 @@ packages: resolution: {integrity: sha512-xL4PiFRQa/f9L9ZvR4/gUCRNus4N8YX80ku8kv9Jqz+ZokkiZLM0bcvX0gm1F3PDi9SPRsww1BDsTWgE6Y1GLQ==} engines: {node: '>=20'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -4357,6 +4450,10 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + path-to-regexp@0.1.12: resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} @@ -4666,6 +4763,10 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rimraf@5.0.10: + resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -4767,6 +4868,10 @@ packages: sift@17.1.3: resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + sonic-boom@4.2.0: resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} @@ -4804,6 +4909,10 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -4834,6 +4943,10 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} + engines: {node: '>=12'} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -5141,6 +5254,10 @@ packages: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -5276,12 +5393,29 @@ snapshots: '@vercel/oidc': 3.0.5 zod: 4.1.13 + '@ai-sdk/google-vertex@3.0.86(zod@4.1.13)': + dependencies: + '@ai-sdk/anthropic': 2.0.53(zod@4.1.13) + '@ai-sdk/google': 2.0.44(zod@4.1.13) + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.18(zod@4.1.13) + google-auth-library: 10.5.0 + zod: 4.1.13 + transitivePeerDependencies: + - supports-color + '@ai-sdk/google@2.0.40(zod@4.1.13)': dependencies: '@ai-sdk/provider': 2.0.0 '@ai-sdk/provider-utils': 3.0.17(zod@4.1.13) zod: 4.1.13 + '@ai-sdk/google@2.0.44(zod@4.1.13)': + dependencies: + '@ai-sdk/provider': 2.0.0 + '@ai-sdk/provider-utils': 3.0.18(zod@4.1.13) + zod: 4.1.13 + '@ai-sdk/mistral@2.0.23(zod@4.1.13)': dependencies: '@ai-sdk/provider': 2.0.0 @@ -6145,6 +6279,15 @@ snapshots: '@img/sharp-win32-x64@0.34.5': optional: true + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.2 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + '@isaacs/ttlcache@1.4.1': {} '@jridgewell/gen-mapping@0.3.13': @@ -7274,6 +7417,9 @@ snapshots: '@pinojs/redact@0.4.0': {} + '@pkgjs/parseargs@0.11.0': + optional: true + '@protobufjs/aspromise@1.1.2': {} '@protobufjs/base64@1.1.2': {} @@ -8370,10 +8516,14 @@ snapshots: ansi-regex@5.0.1: {} + ansi-regex@6.2.2: {} + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 + ansi-styles@6.2.3: {} + argparse@2.0.1: {} aria-hidden@1.2.6: @@ -8541,6 +8691,8 @@ snapshots: dependencies: fill-range: 7.1.1 + buffer-equal-constant-time@1.0.1: {} + bytes@3.1.2: {} call-bind-apply-helpers@1.0.2: @@ -8769,6 +8921,12 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + eastasianwidth@0.2.0: {} + + ecdsa-sig-formatter@1.0.11: + dependencies: + safe-buffer: 5.2.1 + ee-first@1.1.1: {} emoji-regex@8.0.0: {} @@ -9243,6 +9401,11 @@ snapshots: dependencies: is-callable: 1.2.7 + foreground-child@3.3.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 @@ -9280,6 +9443,15 @@ snapshots: - encoding - supports-color + gaxios@7.1.3: + dependencies: + extend: 3.0.2 + https-proxy-agent: 7.0.6 + node-fetch: 3.3.2 + rimraf: 5.0.10 + transitivePeerDependencies: + - supports-color + gcp-metadata@6.1.1: dependencies: gaxios: 6.7.1 @@ -9289,6 +9461,14 @@ snapshots: - encoding - supports-color + gcp-metadata@8.1.2: + dependencies: + gaxios: 7.1.3 + google-logging-utils: 1.1.3 + json-bigint: 1.0.0 + transitivePeerDependencies: + - supports-color + generator-function@2.0.1: {} get-caller-file@2.0.5: {} @@ -9331,6 +9511,15 @@ snapshots: dependencies: is-glob: 4.0.3 + glob@10.5.0: + dependencies: + foreground-child: 3.3.1 + jackspeak: 3.4.3 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + globals@14.0.0: {} globalthis@1.0.4: @@ -9338,14 +9527,35 @@ snapshots: define-properties: 1.2.1 gopd: 1.2.0 + google-auth-library@10.5.0: + dependencies: + base64-js: 1.5.1 + ecdsa-sig-formatter: 1.0.11 + gaxios: 7.1.3 + gcp-metadata: 8.1.2 + google-logging-utils: 1.1.3 + gtoken: 8.0.0 + jws: 4.0.1 + transitivePeerDependencies: + - supports-color + google-logging-utils@0.0.2: {} + google-logging-utils@1.1.3: {} + gopd@1.2.0: {} graceful-fs@4.2.11: {} graphemer@1.4.0: {} + gtoken@8.0.0: + dependencies: + gaxios: 7.1.3 + jws: 4.0.1 + transitivePeerDependencies: + - supports-color + has-bigints@1.1.0: {} has-flag@4.0.0: {} @@ -9613,6 +9823,12 @@ snapshots: has-symbols: 1.1.0 set-function-name: 2.0.2 + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + jiti@2.6.1: {} joycon@3.1.1: {} @@ -9665,6 +9881,17 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + jwa@2.0.1: + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + + jws@4.0.1: + dependencies: + jwa: 2.0.1 + safe-buffer: 5.2.1 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -9773,6 +10000,8 @@ snapshots: dependencies: js-tokens: 4.0.0 + lru-cache@10.4.3: {} + lucide-react@0.475.0(react@19.2.0): dependencies: react: 19.2.0 @@ -10168,6 +10397,8 @@ snapshots: minimist@1.2.8: {} + minipass@7.1.2: {} + module-details-from-path@1.0.4: {} ms@2.0.0: {} @@ -10330,6 +10561,8 @@ snapshots: dependencies: is-network-error: 1.3.0 + package-json-from-dist@1.0.1: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -10352,6 +10585,11 @@ snapshots: path-parse@1.0.7: {} + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + path-to-regexp@0.1.12: {} pg-cloudflare@1.2.7: @@ -10740,6 +10978,10 @@ snapshots: reusify@1.1.0: {} + rimraf@5.0.10: + dependencies: + glob: 10.5.0 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -10916,6 +11158,8 @@ snapshots: sift@17.1.3: {} + signal-exit@4.1.0: {} + sonic-boom@4.2.0: dependencies: atomic-sleep: 1.0.0 @@ -10945,6 +11189,12 @@ snapshots: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.2 + string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.8 @@ -11004,6 +11254,10 @@ snapshots: dependencies: ansi-regex: 5.0.1 + strip-ansi@7.1.2: + dependencies: + ansi-regex: 6.2.2 + strip-bom@3.0.0: {} strip-json-comments@3.1.1: {} @@ -11357,6 +11611,12 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.3 + string-width: 5.1.2 + strip-ansi: 7.1.2 + wrappy@1.0.2: {} ws@8.18.3: {} diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index 84609951..8cc5d06c 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -1,6 +1,7 @@ import { Agent } from "@mastra/core/agent"; import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock"; import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; +import { createVertex } from "@ai-sdk/google-vertex"; import { getMemory } from "../memory"; import { instructions } from "./instructions"; @@ -11,29 +12,27 @@ import { getRepositoryCommits } from "../tools/getRepositoryCommits"; import { getRepositoryPullRequests } from "../tools/getRepositoryPullRequests"; import { getRepositoryStars } from "../tools/getRepositoryStars"; -function makeModel(modelName: string, cloudProvider: string) { - if (cloudProvider === "aws") { - return createAmazonBedrock({ - credentialProvider: fromNodeProviderChain(), - })(modelName); - } - - if (cloudProvider === "gcp") { - throw new Error("GCP provider is not implemented yet"); - } - - return null; +function AWSModelProvider(modelName: string) { + return createAmazonBedrock({ + credentialProvider: fromNodeProviderChain(), + })(modelName); } -const bedrock = createAmazonBedrock({ - credentialProvider: fromNodeProviderChain(), -}); +function GCPModelProvider(model: string) { + return createVertex({ + project: "cloudbuildtest-468719", + location: "us-central1", + })(model); +} export const agent = new Agent({ name: "agent", instructions, memory: getMemory, - model: bedrock("us.amazon.nova-lite-v1:0"), + model: + process.env.DEFANG_PROVIDER === "aws" + ? AWSModelProvider(process.env.LLM_MODEL || "us.amazon.nova-lite-v1:0") + : GCPModelProvider(process.env.LLM_MODEL || "gemini-2.5-pro"), tools: { getFilePaths, getFileContent, diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index 0627eb56..452980ab 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -8,7 +8,8 @@ services: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true #set this to false if deploying to defang playground - GITHUB_TOKEN - - DEFANG_PROVIDER=aws + - DEFANG_PROVIDER=gcp + - LLM_MODEL=gemini-2.5-flash #anthropic.claude-3-5-sonnet-20241022-v2:0 restart: unless-stopped ports: - mode: ingress From 7a61396c46cee2ee057c6b6cbe189eea633c4278 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Mon, 8 Dec 2025 01:22:37 -0800 Subject: [PATCH 03/15] Refactors model provider logic and updates dependencies --- samples/mastra-nextjs/.defang/lab | 7 --- samples/mastra-nextjs/app/.gitignore | 2 + samples/mastra-nextjs/app/package.json | 2 +- samples/mastra-nextjs/app/pnpm-lock.yaml | 6 +-- .../app/src/mastra/agent/index.ts | 48 +++++++++++++++---- samples/mastra-nextjs/compose.yaml | 8 ++-- 6 files changed, 50 insertions(+), 23 deletions(-) delete mode 100644 samples/mastra-nextjs/.defang/lab diff --git a/samples/mastra-nextjs/.defang/lab b/samples/mastra-nextjs/.defang/lab deleted file mode 100644 index 49fd2e82..00000000 --- a/samples/mastra-nextjs/.defang/lab +++ /dev/null @@ -1,7 +0,0 @@ -AWS_REGION="us-west-2" -DEFANG_MODE="affordable" -DEFANG_PROVIDER="gcp" -AWS_PROFILE="defang-lab" -GCP_PROJECT_ID="cloudbuildtest-468719" -DEFANG_DEBUG="true" -DEFANG_VERBOSE="true" \ No newline at end of file diff --git a/samples/mastra-nextjs/app/.gitignore b/samples/mastra-nextjs/app/.gitignore index 9fa289a3..7bbcce07 100644 --- a/samples/mastra-nextjs/app/.gitignore +++ b/samples/mastra-nextjs/app/.gitignore @@ -41,3 +41,5 @@ yarn-error.log* next-env.d.ts .mastra +../.defang + diff --git a/samples/mastra-nextjs/app/package.json b/samples/mastra-nextjs/app/package.json index e1151e5f..41db281f 100644 --- a/samples/mastra-nextjs/app/package.json +++ b/samples/mastra-nextjs/app/package.json @@ -11,8 +11,8 @@ }, "dependencies": { "@ai-sdk/amazon-bedrock": "^3.0.67", - "@ai-sdk/google": "^2.0.44", "@ai-sdk/google-vertex": "^3.0.86", + "@ai-sdk/provider": "^2.0.0", "@assistant-ui/react": "^0.11.39", "@assistant-ui/react-ai-sdk": "^1.1.11", "@assistant-ui/react-markdown": "^0.11.4", diff --git a/samples/mastra-nextjs/app/pnpm-lock.yaml b/samples/mastra-nextjs/app/pnpm-lock.yaml index 93e71b03..96cfa048 100644 --- a/samples/mastra-nextjs/app/pnpm-lock.yaml +++ b/samples/mastra-nextjs/app/pnpm-lock.yaml @@ -11,12 +11,12 @@ importers: '@ai-sdk/amazon-bedrock': specifier: ^3.0.67 version: 3.0.67(zod@4.1.13) - '@ai-sdk/google': - specifier: ^2.0.44 - version: 2.0.44(zod@4.1.13) '@ai-sdk/google-vertex': specifier: ^3.0.86 version: 3.0.86(zod@4.1.13) + '@ai-sdk/provider': + specifier: ^2.0.0 + version: 2.0.0 '@assistant-ui/react': specifier: ^0.11.39 version: 0.11.47(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(use-sync-external-store@1.6.0(react@19.2.0)) diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index 8cc5d06c..f3f88db0 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -1,5 +1,6 @@ import { Agent } from "@mastra/core/agent"; import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock"; +import type { LanguageModelV2 } from "@ai-sdk/provider"; import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; import { createVertex } from "@ai-sdk/google-vertex"; @@ -12,27 +13,56 @@ import { getRepositoryCommits } from "../tools/getRepositoryCommits"; import { getRepositoryPullRequests } from "../tools/getRepositoryPullRequests"; import { getRepositoryStars } from "../tools/getRepositoryStars"; -function AWSModelProvider(modelName: string) { +// https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#using-aws-sdk-credentials-chain-instance-profiles-instance-roles-ecs-roles-eks-service-accounts-etc +function createAWSModelProvider(modelName: string): LanguageModelV2 { return createAmazonBedrock({ credentialProvider: fromNodeProviderChain(), })(modelName); } -function GCPModelProvider(model: string) { +// https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex +function createGCPModelProvider(modelName: string): LanguageModelV2 { + const projectId = process.env.DEFANG_GCP_PROJECT; + if (projectId === undefined) { + throw new Error( + "DEFANG_GCP_PROJECT is not defined in environment variables" + ); + } + const location = process.env.DEFANG_GCP_LOCATION; + if (location === undefined) { + throw new Error( + "DEFANG_GCP_LOCATION is not defined in environment variables" + ); + } return createVertex({ - project: "cloudbuildtest-468719", - location: "us-central1", - })(model); + project: projectId, + location: location, + })(modelName); +} + +function getModel(): LanguageModelV2 { + const provider = process.env.DEFANG_PROVIDER; + const modelName = process.env.LLM_MODEL; + if (modelName === undefined) { + throw new Error("LLM_MODEL is not defined in environment variables"); + } + + if (provider === "aws") { + return createAWSModelProvider(modelName); + } + + if (provider === "gcp") { + return createGCPModelProvider(modelName); + } + + throw new Error(`Unsupported DEFANG_PROVIDER: ${provider}`); } export const agent = new Agent({ name: "agent", instructions, memory: getMemory, - model: - process.env.DEFANG_PROVIDER === "aws" - ? AWSModelProvider(process.env.LLM_MODEL || "us.amazon.nova-lite-v1:0") - : GCPModelProvider(process.env.LLM_MODEL || "gemini-2.5-pro"), + model: getModel, tools: { getFilePaths, getFileContent, diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index 452980ab..6c724098 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -7,9 +7,11 @@ services: environment: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true #set this to false if deploying to defang playground - - GITHUB_TOKEN - - DEFANG_PROVIDER=gcp - - LLM_MODEL=gemini-2.5-flash #anthropic.claude-3-5-sonnet-20241022-v2:0 + - GITHUB_TOKEN #optional, remove this line if unused + - DEFANG_PROVIDER=aws # change to gcp when deploying to Google Cloud + - DEFANG_GCP_PROJECT # change to your GCP project when deploying to Google Cloud + - DEFANG_GCP_LOCATION #should be us-central1 when deploying to Google Cloud, else change to your perferred location + - LLM_MODEL=anthropic.claude-3-5-sonnet-20241022-v2:0 #gemini-2.5-flash for GCP, anthroipc.claude-3-5-sonnet-20241022-v2 for AWS restart: unless-stopped ports: - mode: ingress From 938eac81c737aca3e2934409a238abad9fd3dccf Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Mon, 8 Dec 2025 01:24:41 -0800 Subject: [PATCH 04/15] Removes unused google-auth-library dependency --- samples/mastra-nextjs/app/package.json | 1 - samples/mastra-nextjs/app/pnpm-lock.yaml | 3 --- 2 files changed, 4 deletions(-) diff --git a/samples/mastra-nextjs/app/package.json b/samples/mastra-nextjs/app/package.json index 41db281f..2c6b8d3b 100644 --- a/samples/mastra-nextjs/app/package.json +++ b/samples/mastra-nextjs/app/package.json @@ -32,7 +32,6 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dotenv": "^16.4.7", - "google-auth-library": "^10.5.0", "lucide-react": "^0.475.0", "next": "^16.0.3", "next-safe-action": "^7.10.3", diff --git a/samples/mastra-nextjs/app/pnpm-lock.yaml b/samples/mastra-nextjs/app/pnpm-lock.yaml index 96cfa048..fb722ebc 100644 --- a/samples/mastra-nextjs/app/pnpm-lock.yaml +++ b/samples/mastra-nextjs/app/pnpm-lock.yaml @@ -74,9 +74,6 @@ importers: dotenv: specifier: ^16.4.7 version: 16.6.1 - google-auth-library: - specifier: ^10.5.0 - version: 10.5.0 lucide-react: specifier: ^0.475.0 version: 0.475.0(react@19.2.0) From 1ce140ad36ce8bda0291568b476ce4dc7313e513 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Mon, 8 Dec 2025 01:32:22 -0800 Subject: [PATCH 05/15] Update README --- samples/mastra-nextjs/README.md | 20 ++++++++++++++++---- samples/mastra-nextjs/compose.yaml | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/samples/mastra-nextjs/README.md b/samples/mastra-nextjs/README.md index 284ef542..cd17f682 100644 --- a/samples/mastra-nextjs/README.md +++ b/samples/mastra-nextjs/README.md @@ -38,16 +38,28 @@ You can access mastra-nextjs at `http://localhost:3000` once the containers are For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration). Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you. -### `GOOGLE_GENERATIVE_AI_API_KEY` - -Your Google Generative AI API key for accessing the Gemini Flash model. You can get this from the [Google AI Studio](https://aistudio.google.com/). - ### `POSTGRES_PASSWORD` The password for your Postgres database. You need to set this before deploying for the first time. _You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_ +### `DEFANG_PROVIDER` + +Set to `gcp` when deploying to Google Cloud, or `aws` when deploying to AWS. + +### `DEFANG_GCP_PROJECT` (Only for GCP deployments) + +The GCP project ID where you want to deploy the application. You can find this in the [GCP Console](https://console.cloud.google.com/). + +### `DEFANG_GCP_LOCATION` (Only for GCP deployments) + +The GCP region where you want to deploy the application. This should typically be set to `us-central1`, but you can change it to your preferred location. + +### `LLM_MODEL` + +The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in the AWS Bedrock console. + ### `DB_URL` The [PostgreSQL database connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). This will be automatically configured when using BYOC managed database services. It should look something like this: `postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]`. diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index 6c724098..d834c2e1 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -8,7 +8,7 @@ services: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true #set this to false if deploying to defang playground - GITHUB_TOKEN #optional, remove this line if unused - - DEFANG_PROVIDER=aws # change to gcp when deploying to Google Cloud + - DEFANG_PROVIDER # use "gcp" when deploying to Google Cloud, "aws" when deploying to AWS - DEFANG_GCP_PROJECT # change to your GCP project when deploying to Google Cloud - DEFANG_GCP_LOCATION #should be us-central1 when deploying to Google Cloud, else change to your perferred location - LLM_MODEL=anthropic.claude-3-5-sonnet-20241022-v2:0 #gemini-2.5-flash for GCP, anthroipc.claude-3-5-sonnet-20241022-v2 for AWS From 41bdb032ee248857a3772aac5605293dd4ac6e41 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Tue, 9 Dec 2025 00:09:30 -0800 Subject: [PATCH 06/15] Simplifies model provider logic and updates environment variables --- .../app/src/mastra/agent/index.ts | 53 +++++-------------- samples/mastra-nextjs/compose.dev.yaml | 1 + samples/mastra-nextjs/compose.yaml | 12 ++--- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index f3f88db0..a4a2eaf1 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -1,8 +1,7 @@ import { Agent } from "@mastra/core/agent"; import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock"; -import type { LanguageModelV2 } from "@ai-sdk/provider"; import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; -import { createVertex } from "@ai-sdk/google-vertex"; +import { vertex } from "@ai-sdk/google-vertex"; import { getMemory } from "../memory"; import { instructions } from "./instructions"; @@ -13,49 +12,25 @@ import { getRepositoryCommits } from "../tools/getRepositoryCommits"; import { getRepositoryPullRequests } from "../tools/getRepositoryPullRequests"; import { getRepositoryStars } from "../tools/getRepositoryStars"; -// https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#using-aws-sdk-credentials-chain-instance-profiles-instance-roles-ecs-roles-eks-service-accounts-etc -function createAWSModelProvider(modelName: string): LanguageModelV2 { - return createAmazonBedrock({ - credentialProvider: fromNodeProviderChain(), - })(modelName); -} - -// https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex -function createGCPModelProvider(modelName: string): LanguageModelV2 { - const projectId = process.env.DEFANG_GCP_PROJECT; - if (projectId === undefined) { - throw new Error( - "DEFANG_GCP_PROJECT is not defined in environment variables" - ); - } - const location = process.env.DEFANG_GCP_LOCATION; - if (location === undefined) { - throw new Error( - "DEFANG_GCP_LOCATION is not defined in environment variables" - ); - } - return createVertex({ - project: projectId, - location: location, - })(modelName); -} - -function getModel(): LanguageModelV2 { - const provider = process.env.DEFANG_PROVIDER; +function getModel() { + const provider = process.env.AWS_REGION ? "aws" : "gcp"; const modelName = process.env.LLM_MODEL; if (modelName === undefined) { throw new Error("LLM_MODEL is not defined in environment variables"); } - if (provider === "aws") { - return createAWSModelProvider(modelName); - } - - if (provider === "gcp") { - return createGCPModelProvider(modelName); + switch (provider) { + case "aws": + // https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#using-aws-sdk-credentials-chain-instance-profiles-instance-roles-ecs-roles-eks-service-accounts-etc + return createAmazonBedrock({ + credentialProvider: fromNodeProviderChain(), + })(modelName); + case "gcp": + // https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex + return vertex(modelName); + default: + return modelName; } - - throw new Error(`Unsupported DEFANG_PROVIDER: ${provider}`); } export const agent = new Agent({ diff --git a/samples/mastra-nextjs/compose.dev.yaml b/samples/mastra-nextjs/compose.dev.yaml index 659fc9c9..a3db2493 100644 --- a/samples/mastra-nextjs/compose.dev.yaml +++ b/samples/mastra-nextjs/compose.dev.yaml @@ -6,6 +6,7 @@ services: environment: - DB_URL=postgres://postgres:password@database:5432/postgres - DB_SSL=false #set this to true if deploying to defang playground + - LLM_MODEL=gemini-2.5-flash - GOOGLE_GENERATIVE_AI_API_KEY=xxx - GITHUB_TOKEN=xxx # remove this line if unused diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index d834c2e1..ab50ebb9 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -1,17 +1,17 @@ services: app: + domainname: example.com x-defang-llm: true build: context: ./app dockerfile: Dockerfile environment: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - - DB_SSL=true #set this to false if deploying to defang playground - - GITHUB_TOKEN #optional, remove this line if unused - - DEFANG_PROVIDER # use "gcp" when deploying to Google Cloud, "aws" when deploying to AWS - - DEFANG_GCP_PROJECT # change to your GCP project when deploying to Google Cloud - - DEFANG_GCP_LOCATION #should be us-central1 when deploying to Google Cloud, else change to your perferred location - - LLM_MODEL=anthropic.claude-3-5-sonnet-20241022-v2:0 #gemini-2.5-flash for GCP, anthroipc.claude-3-5-sonnet-20241022-v2 for AWS + - DB_SSL=true # set this to false if deploying to defang playground, true otherwise + - GOOGLE_VERTEX_PROJECT= # your GCP project ID + - GOOGLE_VERTEX_LOCATION= # your GCP region, e.g., us-central1 + - LLM_MODEL # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS + - GITHUB_TOKEN # optional, remove this line if unused restart: unless-stopped ports: - mode: ingress From c906edbea94cb874e912346b76f6d7e1216bc7af Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 10 Dec 2025 02:22:31 -0800 Subject: [PATCH 07/15] load in model for different enviromnents --- .../app/src/mastra/agent/index.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index a4a2eaf1..187b9d2a 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -13,24 +13,22 @@ import { getRepositoryPullRequests } from "../tools/getRepositoryPullRequests"; import { getRepositoryStars } from "../tools/getRepositoryStars"; function getModel() { - const provider = process.env.AWS_REGION ? "aws" : "gcp"; const modelName = process.env.LLM_MODEL; if (modelName === undefined) { throw new Error("LLM_MODEL is not defined in environment variables"); } - switch (provider) { - case "aws": - // https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#using-aws-sdk-credentials-chain-instance-profiles-instance-roles-ecs-roles-eks-service-accounts-etc - return createAmazonBedrock({ - credentialProvider: fromNodeProviderChain(), - })(modelName); - case "gcp": - // https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex - return vertex(modelName); - default: - return modelName; + if (process.env.AWS_REGION) { + // https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#using-aws-sdk-credentials-chain-instance-profiles-instance-roles-ecs-roles-eks-service-accounts-etc + return createAmazonBedrock({ + credentialProvider: fromNodeProviderChain(), + })(modelName); + } else if (process.env.GOOGLE_VERTEX_LOCATION) { + // https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex + return vertex(modelName); } + + return modelName; } export const agent = new Agent({ From 4a0f33b590001f7f5dbdd881a911e63fb3ae9230 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 10 Dec 2025 02:22:53 -0800 Subject: [PATCH 08/15] BYOC compose for GCP --- samples/mastra-nextjs/compose.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index ab50ebb9..a3f7449c 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -1,6 +1,5 @@ services: app: - domainname: example.com x-defang-llm: true build: context: ./app @@ -8,8 +7,8 @@ services: environment: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true # set this to false if deploying to defang playground, true otherwise - - GOOGLE_VERTEX_PROJECT= # your GCP project ID - - GOOGLE_VERTEX_LOCATION= # your GCP region, e.g., us-central1 + - GOOGLE_VERTEX_PROJECT= # To deploy to GCP, please enter your GCP project ID + - GOOGLE_VERTEX_LOCATION= # To deploy to GCP, please enter your GCP region, e.g., us-central1 - LLM_MODEL # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS - GITHUB_TOKEN # optional, remove this line if unused restart: unless-stopped From 249d3c4391bc26f2a53f00252e9fd536cec25c99 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 10 Dec 2025 02:23:12 -0800 Subject: [PATCH 09/15] Add hot reloading for docker compose dev --- samples/mastra-nextjs/compose.dev.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/mastra-nextjs/compose.dev.yaml b/samples/mastra-nextjs/compose.dev.yaml index a3db2493..c1836201 100644 --- a/samples/mastra-nextjs/compose.dev.yaml +++ b/samples/mastra-nextjs/compose.dev.yaml @@ -3,12 +3,16 @@ services: extends: file: compose.yaml service: app + command: ["pnpm", "run", "dev"] environment: - DB_URL=postgres://postgres:password@database:5432/postgres - - DB_SSL=false #set this to true if deploying to defang playground - - LLM_MODEL=gemini-2.5-flash - - GOOGLE_GENERATIVE_AI_API_KEY=xxx - - GITHUB_TOKEN=xxx # remove this line if unused + - DB_SSL=false + - LLM_MODEL=google/gemini-2.5-flash #https://mastra.ai/models/providers/google + - GOOGLE_GENERATIVE_AI_API_KEY= #require for local docker compose development + - GITHUB_TOKEN= # remove this line if unused + volumes: # for hot-reloading during development + - ./app:/app + - /app/node_modules database: image: postgres:16 From 7c66e849a0e01efebb1fdc8040587571d5bbde0c Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 10 Dec 2025 02:24:06 -0800 Subject: [PATCH 10/15] update gitignore --- samples/mastra-nextjs/app/.gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/mastra-nextjs/app/.gitignore b/samples/mastra-nextjs/app/.gitignore index 7bbcce07..9fa289a3 100644 --- a/samples/mastra-nextjs/app/.gitignore +++ b/samples/mastra-nextjs/app/.gitignore @@ -41,5 +41,3 @@ yarn-error.log* next-env.d.ts .mastra -../.defang - From d47ca90dc650f69e39fd32af27d6e18628dea9c4 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Wed, 10 Dec 2025 02:35:20 -0800 Subject: [PATCH 11/15] Update README --- samples/mastra-nextjs/README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/samples/mastra-nextjs/README.md b/samples/mastra-nextjs/README.md index cd17f682..d93fc439 100644 --- a/samples/mastra-nextjs/README.md +++ b/samples/mastra-nextjs/README.md @@ -26,6 +26,14 @@ To run the application locally for development, use the development compose file docker compose -f compose.dev.yaml up ``` +### `GOOGLE_GENERATIVE_AI_API_KEY` + +When running locally with Docker Compose, you will need to set the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable to your GCP API key. You can get the API key from the [Google AI Studio](https://aistudio.google.com/). + +### `LLM_MODEL` + +When running locally with Docker Compose, you are limited to the models on this list: [Google models](https://mastra.ai/models/providers/google). + This will: - Start PostgreSQL with volume persistence for local development @@ -44,17 +52,13 @@ The password for your Postgres database. You need to set this before deploying f _You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_ -### `DEFANG_PROVIDER` - -Set to `gcp` when deploying to Google Cloud, or `aws` when deploying to AWS. - -### `DEFANG_GCP_PROJECT` (Only for GCP deployments) +### `GOOGLE_VERTEX_PROJECT` (Only for GCP deployments) -The GCP project ID where you want to deploy the application. You can find this in the [GCP Console](https://console.cloud.google.com/). +The GCP project ID where you want to deploy the application. You can find this in the [GCP Console](https://console.cloud.google.com/). This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex). -### `DEFANG_GCP_LOCATION` (Only for GCP deployments) +### `GOOGLE_VERTEX_LOCATION` (Only for GCP deployments) -The GCP region where you want to deploy the application. This should typically be set to `us-central1`, but you can change it to your preferred location. +The GCP region where you want to deploy the application. This should typically be set to `us-central1`, but you can change it to your preferred location.This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex). ### `LLM_MODEL` From 94b8dd14eacb1cecce66379fb4fa318dfada824b Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Sat, 13 Dec 2025 15:50:27 -0800 Subject: [PATCH 12/15] Update sample after setting env vars --- .../mastra-nextjs/.github/workflows/deploy.yaml | 1 - samples/mastra-nextjs/README.md | 16 +++------------- samples/mastra-nextjs/compose.dev.yaml | 6 +++--- samples/mastra-nextjs/compose.yaml | 7 +++---- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/samples/mastra-nextjs/.github/workflows/deploy.yaml b/samples/mastra-nextjs/.github/workflows/deploy.yaml index 5b508f16..54954735 100644 --- a/samples/mastra-nextjs/.github/workflows/deploy.yaml +++ b/samples/mastra-nextjs/.github/workflows/deploy.yaml @@ -24,4 +24,3 @@ jobs: env: POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} diff --git a/samples/mastra-nextjs/README.md b/samples/mastra-nextjs/README.md index d93fc439..cb4ef725 100644 --- a/samples/mastra-nextjs/README.md +++ b/samples/mastra-nextjs/README.md @@ -52,21 +52,9 @@ The password for your Postgres database. You need to set this before deploying f _You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_ -### `GOOGLE_VERTEX_PROJECT` (Only for GCP deployments) - -The GCP project ID where you want to deploy the application. You can find this in the [GCP Console](https://console.cloud.google.com/). This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex). - -### `GOOGLE_VERTEX_LOCATION` (Only for GCP deployments) - -The GCP region where you want to deploy the application. This should typically be set to `us-central1`, but you can change it to your preferred location.This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex). - ### `LLM_MODEL` -The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in the AWS Bedrock console. - -### `DB_URL` - -The [PostgreSQL database connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). This will be automatically configured when using BYOC managed database services. It should look something like this: `postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]`. +The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in AWS Bedrock console and for GCP make sure you have [request access](https://docs.cloud.google.com/marketplace/docs/enable-ai-models#get-ai-models) to the model in GCP Vertex AI console. ### `DB_SSL` @@ -105,6 +93,8 @@ The large context window of Gemini Flash allows the agent to hold more code in m ### Defang Playground +When deploying we only allow you to use the model `claude-3-5-haiku-20241022` due to resource constraints in the Playground environment. If you want to use other models, please use [Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud). + Deploy your application to the Defang Playground by opening up your terminal and typing: ```bash diff --git a/samples/mastra-nextjs/compose.dev.yaml b/samples/mastra-nextjs/compose.dev.yaml index c1836201..519d5a98 100644 --- a/samples/mastra-nextjs/compose.dev.yaml +++ b/samples/mastra-nextjs/compose.dev.yaml @@ -15,11 +15,11 @@ services: - /app/node_modules database: - image: postgres:16 + extends: + file: compose.yaml + service: database environment: - POSTGRES_PASSWORD=password - - POSTGRES_DB=postgres - - POSTGRES_USER=postgres volumes: - postgres:/var/lib/postgresql/data diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index a3f7449c..6f80ef12 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -7,10 +7,9 @@ services: environment: - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - DB_SSL=true # set this to false if deploying to defang playground, true otherwise - - GOOGLE_VERTEX_PROJECT= # To deploy to GCP, please enter your GCP project ID - - GOOGLE_VERTEX_LOCATION= # To deploy to GCP, please enter your GCP region, e.g., us-central1 - - LLM_MODEL # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS - - GITHUB_TOKEN # optional, remove this line if unused + # Figure out what LLM to turn on for Playground deployment + - LLM_MODEL= # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS + - GITHUB_TOKEN= # optional, remove this line if unused restart: unless-stopped ports: - mode: ingress From 26b6edd189eb10fbd636bd55dcef6dc61ff4db2f Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Sat, 13 Dec 2025 16:02:55 -0800 Subject: [PATCH 13/15] update test env --- .github/workflows/deploy-changed-samples.yml | 2 +- samples/mastra-nextjs/compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-changed-samples.yml b/.github/workflows/deploy-changed-samples.yml index eae80e1a..ee483fb0 100644 --- a/.github/workflows/deploy-changed-samples.yml +++ b/.github/workflows/deploy-changed-samples.yml @@ -79,7 +79,6 @@ jobs: TEST_DB_POSTGRESDB_SSL_ENABLED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_ENABLED }} TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED }} TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} - TEST_GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.TEST_GOOGLE_GENERATIVE_AI_API_KEY }} TEST_HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.TEST_HASURA_GRAPHQL_ADMIN_SECRET }} TEST_HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.TEST_HASURA_GRAPHQL_DATABASE_URL }} TEST_JUPYTER_TOKEN: ${{ secrets.TEST_JUPYTER_TOKEN }} @@ -93,6 +92,7 @@ jobs: TEST_MODEL: ${{ secrets.TEST_MODEL }} TEST_MONGO_INITDB_ROOT_USERNAME: ${{ secrets.TEST_MONGO_INITDB_ROOT_USERNAME }} TEST_MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.TEST_MONGO_INITDB_ROOT_PASSWORD }} + TEST_LLM_MODEL: ${{ secrets.TEST_LLM_MODEL }} TEST_N8N_ENCRYPTION_KEY: ${{ secrets.TEST_N8N_ENCRYPTION_KEY }} TEST_NC_DB: ${{ secrets.TEST_NC_DB }} TEST_NC_S3_ENDPOINT: ${{ secrets.TEST_NC_S3_ENDPOINT }} diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index 6f80ef12..ffd06c30 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -22,7 +22,7 @@ services: database: image: postgres:16 - x-defang-postgres: true # comment when deploying to defang playground + x-defang-postgres: true restart: always environment: - POSTGRES_PASSWORD From 144ccef692f491d201d7b1b8867bda4219bcdd18 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Sat, 13 Dec 2025 16:10:32 -0800 Subject: [PATCH 14/15] update function with doc link --- samples/mastra-nextjs/app/src/mastra/agent/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/mastra-nextjs/app/src/mastra/agent/index.ts b/samples/mastra-nextjs/app/src/mastra/agent/index.ts index 187b9d2a..f2d527b2 100644 --- a/samples/mastra-nextjs/app/src/mastra/agent/index.ts +++ b/samples/mastra-nextjs/app/src/mastra/agent/index.ts @@ -28,6 +28,7 @@ function getModel() { return vertex(modelName); } + // https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai return modelName; } From 8eef1cc81dd33c8c99d43d62c50bcdd18bd6be8e Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Sat, 13 Dec 2025 16:14:06 -0800 Subject: [PATCH 15/15] update one click deployment --- samples/mastra-nextjs/.github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mastra-nextjs/.github/workflows/deploy.yaml b/samples/mastra-nextjs/.github/workflows/deploy.yaml index 54954735..f8ada586 100644 --- a/samples/mastra-nextjs/.github/workflows/deploy.yaml +++ b/samples/mastra-nextjs/.github/workflows/deploy.yaml @@ -20,7 +20,7 @@ jobs: - name: Deploy uses: DefangLabs/defang-github-action@v1.2.0 with: - config-env-vars: POSTGRES_PASSWORD GOOGLE_GENERATIVE_AI_API_KEY GITHUB_TOKEN + config-env-vars: POSTGRES_PASSWORD GITHUB_TOKEN env: POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}