diff --git a/composer.json b/composer.json index b8611929b..2f6e03290 100644 --- a/composer.json +++ b/composer.json @@ -71,6 +71,7 @@ "reliefweb/simple-datepicker": "^v1.3", "symfony/uid": "^6.2", "unocha/common_design": "^9", + "unocha/ocha_ai": "^1.0", "unocha/ocha_monitoring": "^1.0", "webflo/drupal-finder": "^1.2.2" }, diff --git a/composer.lock b/composer.lock index 04b870c7d..db1b0fc3d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c8ed7d80cac97502630271c339665816", + "content-hash": "619e13e717581ab4c7c2805ab415e53a", "packages": [ { "name": "asm89/stack-cors", @@ -62,6 +62,155 @@ }, "time": "2023-11-14T13:51:46+00:00" }, + { + "name": "aws/aws-crt-php", + "version": "v1.2.4", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/eb0c6e4e142224a10b08f49ebf87f32611d162b2", + "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "https://github.com/awslabs/aws-crt-php", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.4" + }, + "time": "2023-11-08T00:42:13+00:00" + }, + { + "name": "aws/aws-sdk-php", + "version": "3.299.0", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "76d1165568d949b430a87eaa42f6dbc4b6705b6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/76d1165568d949b430a87eaa42f6dbc4b6705b6f", + "reference": "76d1165568d949b430a87eaa42f6dbc4b6705b6f", + "shasum": "" + }, + "require": { + "aws/aws-crt-php": "^1.2.3", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/promises": "^1.4.0 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "mtdowling/jmespath.php": "^2.6", + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", + "doctrine/cache": "To use the DoctrineCacheAdapter", + "ext-curl": "To send requests using cURL", + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Aws\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "cloud", + "dynamodb", + "ec2", + "glacier", + "s3", + "sdk" + ], + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.299.0" + }, + "time": "2024-02-15T19:08:34+00:00" + }, { "name": "behat/mink", "version": "v1.11.0", @@ -556,16 +705,16 @@ }, { "name": "composer/composer", - "version": "2.6.6", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "683557bd2466072777309d039534bb1332d0dda5" + "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/683557bd2466072777309d039534bb1332d0dda5", - "reference": "683557bd2466072777309d039534bb1332d0dda5", + "url": "https://api.github.com/repos/composer/composer/zipball/aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", + "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", "shasum": "" }, "require": { @@ -583,7 +732,7 @@ "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.2", "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11", + "symfony/console": "^5.4.11 || ^6.0.11 || ^7", "symfony/filesystem": "^5.4 || ^6.0 || ^7", "symfony/finder": "^5.4 || ^6.0 || ^7", "symfony/polyfill-php73": "^1.24", @@ -597,7 +746,7 @@ "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1", "phpstan/phpstan-symfony": "^1.2.10", - "symfony/phpunit-bridge": "^6.0 || ^7" + "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -610,7 +759,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.6-dev" + "dev-main": "2.7-dev" }, "phpstan": { "includes": [ @@ -650,7 +799,7 @@ "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.6.6" + "source": "https://github.com/composer/composer/tree/2.7.1" }, "funding": [ { @@ -666,7 +815,7 @@ "type": "tidelift" } ], - "time": "2023-12-08T17:32:26+00:00" + "time": "2024-02-09T14:26:28+00:00" }, { "name": "composer/installers", @@ -2098,16 +2247,16 @@ }, { "name": "doctrine/lexer", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", "shasum": "" }, "require": { @@ -2115,11 +2264,11 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", + "doctrine/coding-standard": "^9 || ^12", "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" + "vimeo/psalm": "^4.11 || ^5.21" }, "type": "library", "autoload": { @@ -2156,7 +2305,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.0" + "source": "https://github.com/doctrine/lexer/tree/2.1.1" }, "funding": [ { @@ -2172,7 +2321,7 @@ "type": "tidelift" } ], - "time": "2022-12-14T08:49:07+00:00" + "time": "2024-02-05T11:35:39+00:00" }, { "name": "drupal/admin_denied", @@ -2338,16 +2487,16 @@ }, { "name": "drupal/coder", - "version": "8.3.22", + "version": "8.3.23", "source": { "type": "git", "url": "https://github.com/pfrenssen/coder.git", - "reference": "ba6e62303d567863275fb086941f50a06dc7d08f" + "reference": "1a1613d83c08dac5be593f2775c9eccae1b41805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pfrenssen/coder/zipball/ba6e62303d567863275fb086941f50a06dc7d08f", - "reference": "ba6e62303d567863275fb086941f50a06dc7d08f", + "url": "https://api.github.com/repos/pfrenssen/coder/zipball/1a1613d83c08dac5be593f2775c9eccae1b41805", + "reference": "1a1613d83c08dac5be593f2775c9eccae1b41805", "shasum": "" }, "require": { @@ -2385,7 +2534,7 @@ "issues": "https://www.drupal.org/project/issues/coder", "source": "https://www.drupal.org/project/coder" }, - "time": "2023-10-15T09:55:50+00:00" + "time": "2024-01-27T18:13:12+00:00" }, { "name": "drupal/components", @@ -2630,16 +2779,16 @@ }, { "name": "drupal/core", - "version": "10.2.2", + "version": "10.2.3", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "fc9abad1ab687635a5eddec00aa1a5f2a29a23bd" + "reference": "cc8c7952f7013795b735f5c15290e76937163bb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/fc9abad1ab687635a5eddec00aa1a5f2a29a23bd", - "reference": "fc9abad1ab687635a5eddec00aa1a5f2a29a23bd", + "url": "https://api.github.com/repos/drupal/core/zipball/cc8c7952f7013795b735f5c15290e76937163bb7", + "reference": "cc8c7952f7013795b735f5c15290e76937163bb7", "shasum": "" }, "require": { @@ -2787,22 +2936,22 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/10.2.2" + "source": "https://github.com/drupal/core/tree/10.2.3" }, - "time": "2024-01-16T21:10:58+00:00" + "time": "2024-02-07T22:44:48+00:00" }, { "name": "drupal/core-composer-scaffold", - "version": "10.2.2", + "version": "10.2.3", "source": { "type": "git", "url": "https://github.com/drupal/core-composer-scaffold.git", - "reference": "97bd91856535a354e9b1b815f0957893e26b6622" + "reference": "63effa1bc644e80a269e8b4415e627491d26fd3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/97bd91856535a354e9b1b815f0957893e26b6622", - "reference": "97bd91856535a354e9b1b815f0957893e26b6622", + "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/63effa1bc644e80a269e8b4415e627491d26fd3f", + "reference": "63effa1bc644e80a269e8b4415e627491d26fd3f", "shasum": "" }, "require": { @@ -2837,13 +2986,13 @@ "drupal" ], "support": { - "source": "https://github.com/drupal/core-composer-scaffold/tree/10.2.2" + "source": "https://github.com/drupal/core-composer-scaffold/tree/10.2.3" }, - "time": "2023-11-15T23:23:28+00:00" + "time": "2024-01-26T14:59:30+00:00" }, { "name": "drupal/core-dev", - "version": "10.2.2", + "version": "10.2.3", "source": { "type": "git", "url": "https://github.com/drupal/core-dev.git", @@ -2893,22 +3042,22 @@ ], "description": "require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.", "support": { - "source": "https://github.com/drupal/core-dev/tree/10.2.2" + "source": "https://github.com/drupal/core-dev/tree/10.2.3" }, "time": "2023-12-12T22:01:45+00:00" }, { "name": "drupal/core-recommended", - "version": "10.2.2", + "version": "10.2.3", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "d8cb769d86449af5ad763f3517c7f3c0e226ed60" + "reference": "ee5d148455ca5792108a1fd007ae162ea2ffe859" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/d8cb769d86449af5ad763f3517c7f3c0e226ed60", - "reference": "d8cb769d86449af5ad763f3517c7f3c0e226ed60", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/ee5d148455ca5792108a1fd007ae162ea2ffe859", + "reference": "ee5d148455ca5792108a1fd007ae162ea2ffe859", "shasum": "" }, "require": { @@ -2917,7 +3066,7 @@ "doctrine/annotations": "~1.14.3", "doctrine/deprecations": "~1.1.2", "doctrine/lexer": "~2.1.0", - "drupal/core": "10.2.2", + "drupal/core": "10.2.3", "egulias/email-validator": "~4.0.2", "guzzlehttp/guzzle": "~7.8.1", "guzzlehttp/promises": "~2.0.2", @@ -2978,9 +3127,9 @@ ], "description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/10.2.2" + "source": "https://github.com/drupal/core-recommended/tree/10.2.3" }, - "time": "2024-01-16T21:10:58+00:00" + "time": "2024-02-07T22:44:48+00:00" }, { "name": "drupal/ctools", @@ -3695,7 +3844,7 @@ "shasum": "fc8ea60619b6b4682bade340e13fb4565d3a7e0c" }, "require": { - "drupal/core": "^9.1 || ^10" + "drupal/core": "^10" }, "type": "drupal-module", "extra": { @@ -3894,7 +4043,7 @@ "shasum": "c25246747dac4372c7d5a5a5fd0f276d9e468eff" }, "require": { - "drupal/core": "^9.3 || ^10", + "drupal/core": "^10", "drupal/mailsystem": "^4" }, "require-dev": { @@ -4596,7 +4745,7 @@ "shasum": "77906ae731878b68a181f82b073617b798e5f110" }, "require": { - "drupal/core": "^9.3 || ^10", + "drupal/core": "^10", "enshrined/svg-sanitize": ">=0.15 <1.0" }, "type": "drupal-module", @@ -4744,7 +4893,7 @@ "shasum": "9ea9eee91cf75f21fcc939704baa6a7ec10d7748" }, "require": { - "drupal/core": "^8.9 || ^9 || ^10" + "drupal/core": "^10" }, "type": "drupal-module", "extra": { @@ -5152,22 +5301,21 @@ }, { "name": "enshrined/svg-sanitize", - "version": "0.16.0", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "239e257605e2141265b429e40987b2ee51bba4b4" + "reference": "a1af5cd21636306414da3f6ad4707b98c7601582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/239e257605e2141265b429e40987b2ee51bba4b4", - "reference": "239e257605e2141265b429e40987b2ee51bba4b4", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/a1af5cd21636306414da3f6ad4707b98c7601582", + "reference": "a1af5cd21636306414da3f6ad4707b98c7601582", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", - "ezyang/htmlpurifier": "^4.16", "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { @@ -5192,70 +5340,9 @@ "description": "An SVG sanitizer for PHP", "support": { "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.16.0" + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.17.0" }, - "time": "2023-03-20T10:51:12+00:00" - }, - { - "name": "ezyang/htmlpurifier", - "version": "v4.17.0", - "source": { - "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", - "shasum": "" - }, - "require": { - "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "cerdic/css-tidy": "^1.7 || ^2.0", - "simpletest/simpletest": "dev-master" - }, - "suggest": { - "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", - "ext-bcmath": "Used for unit conversion and imagecrash protection", - "ext-iconv": "Converts text to and from non-UTF-8 encodings", - "ext-tidy": "Used for pretty-printing HTML" - }, - "type": "library", - "autoload": { - "files": [ - "library/HTMLPurifier.composer.php" - ], - "psr-0": { - "HTMLPurifier": "library/" - }, - "exclude-from-classmap": [ - "/library/HTMLPurifier/Language/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-or-later" - ], - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", - "keywords": [ - "html" - ], - "support": { - "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" - }, - "time": "2023-11-17T15:01:25+00:00" + "time": "2024-02-14T17:34:36+00:00" }, { "name": "fileeye/mimemap", @@ -7059,16 +7146,16 @@ }, { "name": "mglaman/phpstan-drupal", - "version": "1.2.6", + "version": "1.2.7", "source": { "type": "git", "url": "https://github.com/mglaman/phpstan-drupal.git", - "reference": "ba8678f8cbea42cc41022c21751004eb677cf5a4" + "reference": "32f79fcf48c74532014248687ae3850581a22416" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mglaman/phpstan-drupal/zipball/ba8678f8cbea42cc41022c21751004eb677cf5a4", - "reference": "ba8678f8cbea42cc41022c21751004eb677cf5a4", + "url": "https://api.github.com/repos/mglaman/phpstan-drupal/zipball/32f79fcf48c74532014248687ae3850581a22416", + "reference": "32f79fcf48c74532014248687ae3850581a22416", "shasum": "" }, "require": { @@ -7143,7 +7230,7 @@ "description": "Drupal extension and rules for PHPStan", "support": { "issues": "https://github.com/mglaman/phpstan-drupal/issues", - "source": "https://github.com/mglaman/phpstan-drupal/tree/1.2.6" + "source": "https://github.com/mglaman/phpstan-drupal/tree/1.2.7" }, "funding": [ { @@ -7159,7 +7246,7 @@ "type": "tidelift" } ], - "time": "2024-01-16T00:42:10+00:00" + "time": "2024-02-14T04:38:08+00:00" }, { "name": "micheh/phpcs-gitlab", @@ -7264,6 +7351,72 @@ }, "time": "2022-02-23T02:02:42+00:00" }, + { + "name": "mtdowling/jmespath.php", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^3.0.3", + "phpunit/phpunit": "^8.5.33" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "files": [ + "src/JmesPath.php" + ], + "psr-4": { + "JmesPath\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.7.0" + }, + "time": "2023-08-25T10:54:48+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -7531,16 +7684,16 @@ }, { "name": "open-telemetry/api", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "401d04c6afe349afa78250ac862db2f89dbf94f6" + "reference": "87de95d926f46262885d0d390060c095af13e2e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/401d04c6afe349afa78250ac862db2f89dbf94f6", - "reference": "401d04c6afe349afa78250ac862db2f89dbf94f6", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/87de95d926f46262885d0d390060c095af13e2e5", + "reference": "87de95d926f46262885d0d390060c095af13e2e5", "shasum": "" }, "require": { @@ -7594,7 +7747,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-01-10T13:04:59+00:00" + "time": "2024-02-06T01:32:25+00:00" }, { "name": "open-telemetry/context", @@ -7786,16 +7939,16 @@ }, { "name": "open-telemetry/sdk", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "818263750d299df5b9612a738440e56d92e5a296" + "reference": "1da4c0ca4f1a3c0fe84b81729dadec16f464fa77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/818263750d299df5b9612a738440e56d92e5a296", - "reference": "818263750d299df5b9612a738440e56d92e5a296", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/1da4c0ca4f1a3c0fe84b81729dadec16f464fa77", + "reference": "1da4c0ca4f1a3c0fe84b81729dadec16f464fa77", "shasum": "" }, "require": { @@ -7865,7 +8018,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-01-24T12:00:22+00:00" + "time": "2024-02-02T03:42:40+00:00" }, { "name": "open-telemetry/sem-conv", @@ -7924,6 +8077,98 @@ }, "time": "2024-01-23T21:47:17+00:00" }, + { + "name": "openai-php/client", + "version": "v0.7.10", + "source": { + "type": "git", + "url": "https://github.com/openai-php/client.git", + "reference": "f9af25d7d7bd8e58f60ada6c30f1c93d65c73833" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/openai-php/client/zipball/f9af25d7d7bd8e58f60ada6c30f1c93d65c73833", + "reference": "f9af25d7d7bd8e58f60ada6c30f1c93d65c73833", + "shasum": "" + }, + "require": { + "php": "^8.1.0", + "php-http/discovery": "^1.19.1", + "php-http/multipart-stream-builder": "^1.3.0", + "psr/http-client": "^1.0.3", + "psr/http-client-implementation": "^1.0.1", + "psr/http-factory-implementation": "*", + "psr/http-message": "^1.1.0|^2.0.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.8.0", + "guzzlehttp/psr7": "^2.6.1", + "laravel/pint": "^1.13.2", + "nunomaduro/collision": "^7.9.0", + "pestphp/pest": "^2.19.2", + "pestphp/pest-plugin-arch": "^2.3.3", + "pestphp/pest-plugin-mock": "^2.0.0", + "pestphp/pest-plugin-type-coverage": "^2.2.0", + "phpstan/phpstan": "^1.10.35", + "rector/rector": "^0.16.0", + "symfony/var-dumper": "^6.3.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/OpenAI.php" + ], + "psr-4": { + "OpenAI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + }, + { + "name": "Sandro Gehri" + } + ], + "description": "OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API", + "keywords": [ + "GPT-3", + "api", + "client", + "codex", + "dall-e", + "language", + "natural", + "openai", + "php", + "processing", + "sdk" + ], + "support": { + "issues": "https://github.com/openai-php/client/issues", + "source": "https://github.com/openai-php/client/tree/v0.7.10" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/gehrisandro", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2023-11-14T13:39:26+00:00" + }, { "name": "orakili/composer-drupal-info-file-patch-helper", "version": "1.0.1", @@ -8256,6 +8501,54 @@ }, "time": "2021-03-21T15:43:46+00:00" }, + { + "name": "pear/text_languagedetect", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Text_LanguageDetect.git", + "reference": "655b269959782416426cf0aa7bd47e19fed63210" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/655b269959782416426cf0aa7bd47e19fed63210", + "reference": "655b269959782416426cf0aa7bd47e19fed63210", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "8.*|9.*" + }, + "suggest": { + "ext-mbstring": "May require the mbstring PHP extension" + }, + "type": "library", + "autoload": { + "psr-0": { + "Text": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Nicholas Pisarro", + "email": "taak@php.net", + "role": "Lead" + } + ], + "description": "Identify human languages from text samples", + "homepage": "http://pear.php.net/package/Text_LanguageDetect", + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Text_LanguageDetect", + "source": "https://github.com/pear/Text_LanguageDetect" + }, + "time": "2023-02-27T20:54:21+00:00" + }, { "name": "pelago/emogrifier", "version": "v7.2.0", @@ -8447,16 +8740,16 @@ }, { "name": "phenx/php-font-lib", - "version": "0.5.5", + "version": "0.5.6", "source": { "type": "git", "url": "https://github.com/dompdf/php-font-lib.git", - "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8" + "reference": "a1681e9793040740a405ac5b189275059e2a9863" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/671df0f3516252011aa94f9e8e3b3b66199339f8", - "reference": "671df0f3516252011aa94f9e8e3b3b66199339f8", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a1681e9793040740a405ac5b189275059e2a9863", + "reference": "a1681e9793040740a405ac5b189275059e2a9863", "shasum": "" }, "require": { @@ -8485,9 +8778,9 @@ "homepage": "https://github.com/PhenX/php-font-lib", "support": { "issues": "https://github.com/dompdf/php-font-lib/issues", - "source": "https://github.com/dompdf/php-font-lib/tree/0.5.5" + "source": "https://github.com/dompdf/php-font-lib/tree/0.5.6" }, - "time": "2024-01-07T18:13:29+00:00" + "time": "2024-01-29T14:45:26+00:00" }, { "name": "phootwork/collection", @@ -8790,6 +9083,62 @@ }, "time": "2023-04-14T15:10:03+00:00" }, + { + "name": "php-http/multipart-stream-builder", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/multipart-stream-builder.git", + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/f5938fd135d9fa442cc297dc98481805acfe2b6a", + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/discovery": "^1.15", + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "nyholm/psr7": "^1.0", + "php-http/message": "^1.5", + "php-http/message-factory": "^1.0.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A builder class that help you create a multipart stream", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "multipart stream", + "stream" + ], + "support": { + "issues": "https://github.com/php-http/multipart-stream-builder/issues", + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.3.0" + }, + "time": "2023-04-28T14:10:22+00:00" + }, { "name": "php-http/promise", "version": "1.3.0", @@ -9276,16 +9625,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.57", + "version": "1.10.58", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" + "reference": "a23518379ec4defd9e47cbf81019526861623ec2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a23518379ec4defd9e47cbf81019526861623ec2", + "reference": "a23518379ec4defd9e47cbf81019526861623ec2", "shasum": "" }, "require": { @@ -9334,7 +9683,7 @@ "type": "tidelift" } ], - "time": "2024-01-24T11:51:34+00:00" + "time": "2024-02-12T20:02:57+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -11544,16 +11893,16 @@ }, { "name": "seld/jsonlint", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "76d449a358ece77d6f1d6331c68453e657172202" + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/76d449a358ece77d6f1d6331c68453e657172202", - "reference": "76d449a358ece77d6f1d6331c68453e657172202", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", "shasum": "" }, "require": { @@ -11592,7 +11941,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.1" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" }, "funding": [ { @@ -11604,7 +11953,7 @@ "type": "tidelift" } ], - "time": "2023-12-18T13:03:25+00:00" + "time": "2024-02-07T12:57:50+00:00" }, { "name": "seld/phar-utils", @@ -13734,16 +14083,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", "shasum": "" }, "require": { @@ -13751,9 +14100,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -13790,7 +14136,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" }, "funding": [ { @@ -13806,20 +14152,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", "shasum": "" }, "require": { @@ -13827,9 +14173,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -13869,7 +14212,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" }, "funding": [ { @@ -13885,20 +14228,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -13906,9 +14249,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -13952,7 +14292,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -13968,20 +14308,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", "shasum": "" }, "require": { @@ -13989,9 +14329,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -14031,7 +14368,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -14047,20 +14384,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php82", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php82.git", - "reference": "7716bea9c86776fb3362d6b52fe1fc9471056a49" + "reference": "559d488c38784112c78b9bf17c5ce8366a265643" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/7716bea9c86776fb3362d6b52fe1fc9471056a49", - "reference": "7716bea9c86776fb3362d6b52fe1fc9471056a49", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/559d488c38784112c78b9bf17c5ce8366a265643", + "reference": "559d488c38784112c78b9bf17c5ce8366a265643", "shasum": "" }, "require": { @@ -14068,9 +14405,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -14110,7 +14444,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php82/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php82/tree/v1.29.0" }, "funding": [ { @@ -14126,7 +14460,7 @@ "type": "tidelift" } ], - "time": "2023-08-25T17:27:25+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php83", @@ -15473,6 +15807,52 @@ }, "time": "2024-01-17T09:30:38+00:00" }, + { + "name": "unocha/ocha_ai", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/UN-OCHA/ocha_ai.git", + "reference": "9a6c4a2ce929a2ff3b551203b8a7fd2c413c47b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/UN-OCHA/ocha_ai/zipball/9a6c4a2ce929a2ff3b551203b8a7fd2c413c47b3", + "reference": "9a6c4a2ce929a2ff3b551203b8a7fd2c413c47b3", + "shasum": "" + }, + "require": { + "aws/aws-sdk-php": "^3.283", + "drupal/core": "^10", + "openai-php/client": "^0.7", + "pear/text_languagedetect": "^1.0", + "php": ">=8.2", + "reliefweb/simple-autocomplete": "^v1.3", + "reliefweb/simple-datepicker": "^v1.3", + "symfony/uid": "^6.3" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "drupal/coder": "^8.3", + "phpcompatibility/php-compatibility": "^9.3" + }, + "type": "drupal-module", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "UNOCHA" + } + ], + "description": "OCHA AI module", + "support": { + "issues": "https://github.com/UN-OCHA/ocha_ai/issues", + "source": "https://github.com/UN-OCHA/ocha_ai/tree/v1.0.2" + }, + "time": "2024-02-16T02:57:42+00:00" + }, { "name": "unocha/ocha_monitoring", "version": "1.0.3", @@ -15956,17 +16336,17 @@ }, { "name": "drupal/devel_php", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/devel_php.git", - "reference": "8.x-1.5" + "reference": "8.x-1.6" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/devel_php-8.x-1.5.zip", - "reference": "8.x-1.5", - "shasum": "eca4f0fba9f89ffcc104478a1107de2e2f9fe926" + "url": "https://ftp.drupal.org/files/projects/devel_php-8.x-1.6.zip", + "reference": "8.x-1.6", + "shasum": "c65b291b39f70275ed47f82a7fb25d23f3ec3640" }, "require": { "drupal/core": "^9.2 || ^10", @@ -15975,8 +16355,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.5", - "datestamp": "1649422110", + "version": "8.x-1.6", + "datestamp": "1706781306", "security-coverage": { "status": "not-covered", "message": "Project has not opted into security advisory coverage!" diff --git a/config/block.block.common_design_subtheme_ochaaichatpopup.yml b/config/block.block.common_design_subtheme_ochaaichatpopup.yml new file mode 100644 index 000000000..70dd616d6 --- /dev/null +++ b/config/block.block.common_design_subtheme_ochaaichatpopup.yml @@ -0,0 +1,33 @@ +uuid: b9a70ca4-c0f1-435d-9d2f-4ad6abc77a99 +langcode: en +status: true +dependencies: + module: + - node + - ocha_ai_chat + - system + theme: + - common_design_subtheme +id: common_design_subtheme_ochaaichatpopup +theme: common_design_subtheme +region: content +weight: 0 +provider: null +plugin: ocha_ai_chat_chat_popup +settings: + id: ocha_ai_chat_chat_popup + label: 'OCHA AI Chat popup' + label_display: '0' + provider: ocha_ai_chat +visibility: + 'entity_bundle:node': + id: 'entity_bundle:node' + negate: false + context_mapping: + node: '@node.node_route_context:node' + bundles: + report: report + request_path: + id: request_path + negate: true + pages: '/node/*/*' diff --git a/config/core.extension.yml b/config/core.extension.yml index ed0923fa0..e05333a5e 100644 --- a/config/core.extension.yml +++ b/config/core.extension.yml @@ -51,6 +51,8 @@ module: monitoring: 0 mysql: 0 node: 0 + ocha_ai: 0 + ocha_ai_chat: 0 ocha_monitoring: 0 options: 0 page_cache: 0 diff --git a/config/ocha_ai.settings.yml b/config/ocha_ai.settings.yml new file mode 100644 index 000000000..9079af562 --- /dev/null +++ b/config/ocha_ai.settings.yml @@ -0,0 +1,81 @@ +plugins: + completion: + aws_bedrock: + model: amazon.titan-text-express-v1 + endpoint: '' + version: '' + region: REPLACE_WITH_REGION + api_key: REPLACE_WITH_KEY + max_tokens: 512 + prompt_template: |- + {{ context }} + + Based solely on the information above, please answer the following question. Please do not make things up and say you don't know if you cannot answer. + + {{ question }} + api_secret: REPLACE_WITH_SECRET + role_arn: null + azure_openai: + model: gpt-3.5-turbo + endpoint: REPLACE_WITH_ENDPOINT + version: '2023-05-15' + region: REPLACE_WITH_REGION + api_key: REPLACE_WITH_KEY + max_tokens: 512 + prompt_template: |- + Based solely on the information below, please answer the user's question. Please do not make things up and say you don't know if you cannot answer. + + {{ context }} + embedding: + aws_bedrock: + model: amazon.titan-embed-text-v1 + endpoint: '' + version: '' + region: REPLACE_WITH_REGION + api_key: REPLACE_WITH_KEY + batch_size: 1 + dimensions: 1536 + max_tokens: 8192 + api_secret: REPLACE_WITH_SECRET + role_arn: null + azure_openai: + model: text-embedding-ada-002 + endpoint: REPLACE_WITH_ENDPOINT + version: '2023-05-15' + region: REPLACE_WITH_REGION + api_key: REPLACE_WITH_KEY + batch_size: 16 + dimensions: 1536 + max_tokens: 4096 + source: + reliefweb: + api_url: 'https://api.reliefweb.int/v1' + converter_url: 'https://reliefweb.int/search/converter/json' + site_url: 'https://reliefweb.int' + appname: ocha-ai + cache_enabled: true + cache_lifetime: 600 + text_extractor: + mupdf: + mutool: /usr/bin/mutool + text_splitter: + token: + length: 384 + overlap: 96 + sentence: + length: 4 + overlap: 2 + page: + length: 1 + overlap: 0 + vector_store: + elasticsearch: + url: REPLACE_WITH_URL + base_index_name: ocha_ai + shards: 1 + replicas: 0 + nested_object_limit: 100000 + indexing_batch_size: 10 + topk: 5 + min_similarity: 0.3 + cutoff_coefficient: 0.5 diff --git a/config/ocha_ai_chat.settings.yml b/config/ocha_ai_chat.settings.yml new file mode 100644 index 000000000..ac6fc19d9 --- /dev/null +++ b/config/ocha_ai_chat.settings.yml @@ -0,0 +1,19 @@ +defaults: + form: + instructions: + value: '' + format: markdown_editor + plugins: + completion: + plugin_id: aws_bedrock + embedding: + plugin_id: aws_bedrock + source: + plugin_id: reliefweb + text_extractor: + application/pdf: + plugin_id: mupdf + text_splitter: + plugin_id: token + vector_store: + plugin_id: elasticsearch diff --git a/config/user.role.beta_tester.yml b/config/user.role.beta_tester.yml index 8fa3ce20f..573684923 100644 --- a/config/user.role.beta_tester.yml +++ b/config/user.role.beta_tester.yml @@ -1,9 +1,12 @@ uuid: d32877fc-1a02-4626-902d-577e71464493 langcode: en status: true -dependencies: { } +dependencies: + module: + - ocha_ai_chat id: beta_tester label: 'Beta tester' weight: 7 is_admin: null -permissions: { } +permissions: + - 'access ocha ai chat' diff --git a/docker/Dockerfile b/docker/Dockerfile index 974bf4936..200c96625 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,15 +3,16 @@ FROM public.ecr.aws/unocha/php-k8s:8.2-stable as builder ARG BRANCH_ENVIRONMENT -ENV NODE_ENV=$BRANCH_ENVIRONMENT - # Copy only the files necessary to build the code (see .dockerignore in root). COPY . /srv/www WORKDIR /srv/www # Clean up previous composer installation and run new one. -RUN rm -rf ./vendor && composer install --no-interaction --no-dev +RUN rm -rf ./vendor && \ + COMPOSER_ALLOW_SUPERUSER=1 \ + COMPOSER_MEMORY_LIMIT=-1 \ + composer install --no-interaction --no-dev --prefer-dist # Copy settings to default site location. RUN cp -a docker/settings.php docker/services.yml docker/memcache.services.yml html/sites/default diff --git a/html/modules/custom/reliefweb_entities/reliefweb_entities.module b/html/modules/custom/reliefweb_entities/reliefweb_entities.module index 016c4c800..dfbc92673 100644 --- a/html/modules/custom/reliefweb_entities/reliefweb_entities.module +++ b/html/modules/custom/reliefweb_entities/reliefweb_entities.module @@ -17,6 +17,7 @@ use Drupal\Core\Render\Element; use Drupal\media\MediaInterface; use Drupal\reliefweb_entities\BundleEntityInterface; use Drupal\reliefweb_entities\BundleEntityStorageInterface; +use Drupal\reliefweb_entities\Entity\Report; use Drupal\reliefweb_entities\EntityFormAlterServiceBase; use Drupal\reliefweb_utility\Helpers\ClassHelper; use Drupal\reliefweb_utility\Helpers\DateHelper; @@ -842,3 +843,63 @@ function reliefweb_entities_node_delete(EntityInterface $entity) { } } } + +/** + * Implements hook_form_FORM_ID_alter() for `ocha_ai_chat_chat_form`. + */ +function reliefweb_entities_form_ocha_ai_chat_chat_form_alter(array &$form, FormStateInterface $form_state, string $form_id) { + $url = \Drupal::request()?->query?->get('url'); + if (isset($url)) { + $router = \Drupal::service('router.no_access_checks'); + $parameters = $router->match($url); + $node = $parameters['node'] ?? NULL; + + if (isset($node) && $node instanceof Report) { + // No need to show the source when chatting with a single report. + if (isset($form['source'])) { + $form['source']['#access'] = FALSE; + } + + // Only English documents are supported due to LLM limitations. + $is_english_report = FALSE; + foreach ($node->field_language as $item) { + if ($item->target_id == 267) { + $is_english_report = TRUE; + break; + } + } + if (!$is_english_report) { + $reason = t('Sorry, only English reports are supported.'); + } + + // Non supported content formats. + foreach ($node->field_content_format as $item) { + if ($item->target_id == 12) { + $reason = t('Sorry, maps are not supported.'); + break; + } + elseif ($item->target_id == 12570) { + $reason = t('Sorry, infographics are not supported.'); + break; + } + elseif ($item->target_id == 38974) { + $reason = t('Sorry, interactive reports are not supported.'); + break; + } + } + + if (!empty($reason)) { + foreach (Element::children($form) as $key) { + $form[$key]['#access'] = FALSE; + } + $form['unsupported'] = [ + '#type' => 'inline_template', + '#template' => '
{{ reason }}
', + '#context' => [ + 'reason' => $reason, + ], + ]; + } + } + } +} diff --git a/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php b/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php index d2156db69..ab987f3ea 100644 --- a/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php +++ b/html/modules/custom/reliefweb_files/src/Plugin/Field/FieldType/ReliefWebFile.php @@ -877,8 +877,8 @@ protected function extractPreview($source_uri, $destination_uri, $page, $rotatio $mutool = \Drupal::state()->get('mutool', '/usr/bin/mutool'); if (is_executable($mutool)) { - // @todo add max dimensions. - $command = "{$mutool} draw -R {$rotation} -o {$destination} {$source} {$page}"; + $options = \Drupal::state()->get('mutool_options', ''); + $command = "{$mutool} draw {$options} -R {$rotation} -o {$destination} {$source} {$page}"; exec($command, $output, $return_val); // @todo log error? return empty($return_val) && @file_exists($destination_uri); diff --git a/html/themes/custom/common_design_subtheme/templates/cd/cd-header/cd-ocha.html.twig b/html/themes/custom/common_design_subtheme/templates/cd/cd-header/cd-ocha.html.twig index fe6ff99c3..cbd305763 100644 --- a/html/themes/custom/common_design_subtheme/templates/cd/cd-header/cd-ocha.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/cd/cd-header/cd-ocha.html.twig @@ -3,7 +3,7 @@ {% block related_platforms %}