trypost/composer.json

167 lines
5.4 KiB
JSON
Raw Normal View History

2026-01-15 01:13:44 +00:00
{
"$schema": "https://getcomposer.org/schema.json",
"name": "trypost-it/trypost",
2026-01-15 01:13:44 +00:00
"type": "project",
"description": "Open-source social media scheduling for creators and teams",
2026-01-15 01:13:44 +00:00
"keywords": [
"open-source",
"self-hosted",
2026-01-15 01:13:44 +00:00
"laravel",
"social-media",
"social-media-scheduler",
"social-media-management",
"content-scheduling",
"twitter",
"linkedin",
"instagram",
"facebook",
"tiktok",
"youtube",
"threads",
"pinterest"
2026-01-15 01:13:44 +00:00
],
"license": "AGPL-3.0-only",
"homepage": "https://trypost.it",
"support": {
"issues": "https://github.com/trypost-it/trypost/issues",
"source": "https://github.com/trypost-it/trypost"
},
"authors": [
{
"name": "Paulo Castellano",
"homepage": "https://github.com/paulocastellano"
}
],
2026-01-15 01:13:44 +00:00
"require": {
"php": "^8.2",
"google/apiclient": "^2.19",
"inertiajs/inertia-laravel": "^3.0",
"intervention/image": "^4.0",
2026-04-16 12:30:12 +00:00
"laravel/ai": "^0.5.1",
"laravel/boost": "^2.0",
2026-01-15 01:13:44 +00:00
"laravel/cashier": "^16.2",
"laravel/framework": "^13.0",
"laravel/horizon": "^5.45",
"laravel/mcp": "^0.6.4",
"laravel/nightwatch": "^1.22",
"laravel/passport": "^13.7",
2026-01-15 17:24:39 +00:00
"laravel/reverb": "^1.0",
2026-01-15 01:13:44 +00:00
"laravel/socialite": "^5.24",
"laravel/tinker": "^3.0",
2026-01-15 01:13:44 +00:00
"laravel/wayfinder": "^0.1.9",
"league/color-extractor": "^0.4.0",
2026-01-15 01:13:44 +00:00
"league/flysystem-aws-s3-v3": "^3.0",
feat: use LLM to polish brand autofill when provider is configured When config('trypost.ai.text_provider') points to a provider whose API key is populated (services.gemini.api_key or services.openai.api_key), the autofill action pipes the homepage markdown through a BrandAnalyzer agent with structured output to produce higher-quality values for: - brand_description — 2-3 sentences summarizing the company based on the actual page content, not the raw meta description (which is often generic SEO boilerplate) - brand_tone — classified into one of our seven enum values from the writing style on the page - content_language — detected from the actual content (more reliable than <html lang> which is often wrong) - brand_voice_notes — concrete writing guidelines inferred from the site's style, written in the detected language When the LLM provider is NOT configured (open-source self-hosted deploys without API keys), the action keeps the existing deterministic meta-tag-only flow — no crash, no noise, no LLM cost. When the LLM fails mid-request, we log a warning and fall back to the meta-tag values so the user still gets something useful. Stack additions: - league/html-to-markdown ^5.1 converts the main body to clean markdown for the LLM input (truncated to 4000 chars). - BrandAnalyzer agent (Agent + HasStructuredOutput) with schema enums matching our allowed tones and languages. - resources/views/prompts/brand_analyzer.blade.php holds the instructions, including explicit enum lists and examples of good voice_notes. Frontend: Brand.vue now also fills brand_tone and brand_voice_notes from the response when present. Tests (+3): LLM-configured happy path, no-credentials fallback (asserts BrandAnalyzer is never prompted via preventStrayPrompts), and LLM-exception fallback (meta tags win, brand_tone stays null).
2026-04-16 14:33:02 +00:00
"league/html-to-markdown": "^5.1",
2026-03-31 00:18:07 +00:00
"posthog/posthog-php": "^4.1",
2026-01-15 01:13:44 +00:00
"predis/predis": "^3.3",
"sendkit/sendkit-laravel": "^1.1",
"simplepie/simplepie": "^1.9",
"socialiteproviders/facebook": "^4.1",
"socialiteproviders/instagram": "^5.1",
2026-01-15 01:13:44 +00:00
"socialiteproviders/linkedin": "^5.0",
"socialiteproviders/pinterest": "^4.3",
2026-01-15 01:13:44 +00:00
"socialiteproviders/tiktok": "^5.2",
feat: add brand autofill from website URL in onboarding Users on the Brand step can type their website URL and click 'Preencher' (Portuguese) / 'Autofill' (English). The backend fetches their homepage, parses standard meta tags, and returns: - name ← og:site_name | title (suffix stripped at ' | ', ' - ') - description ← meta[name=description] | og:description - language ← <html lang> mapped to en / pt-BR / es - logo ← apple-touch-icon | largest link[rel*=icon] | og:image The logo is downloaded, validated (mime whitelist, 2MB max), and attached to the workspace's 'logo' media collection so the avatar updates immediately. Zero LLM calls, zero external APIs. Uses symfony/dom-crawler + symfony/css-selector (newly required) for meta extraction. Everything else (Http client, workspace media, Intervention) was already in the project. Security: - SSRF guardrail: resolves the host, rejects private / loopback / link-local ranges, enforces http(s) scheme on both the initial page fetch and the logo download. - Rate limited at 10 req/min per user via the throttle middleware alias on the route. - Logo content-type must be one of the allowed image mimes; wrong types are silently dropped so users never see broken images. UX: - 'Autofill' button next to the website input, disabled until there is a URL; shows a spinner while running. - If a logo was captured, a small preview appears below the input so users can see what was pulled before saving. - Success and error paths both surface as vue-sonner toasts, with translations in en / pt-BR / es. - Failures leave the form untouched — nothing is destructively overwritten if parsing gave us nothing. Tests (16 new): action-level coverage for happy path, title-suffix fallback, language code normalization across 6 locales, scheme rejection, private-range SSRF rejection, implicit https prefixing, empty sites, upstream errors, and wrong-mime logo rejection. Plus two controller-level tests for the autofill endpoint.
2026-04-16 14:13:54 +00:00
"socialiteproviders/twitter": "^4.1",
"symfony/css-selector": "^8.0",
"symfony/dom-crawler": "^8.0"
2026-01-15 01:13:44 +00:00
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.24",
"laravel/sail": "*",
"laravel/telescope": "^5.19",
2026-01-15 01:13:44 +00:00
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^4.4",
2026-07-04 00:46:19 +00:00
"pestphp/pest-plugin-browser": "^4.3",
"pestphp/pest-plugin-laravel": "^4.1"
2026-01-15 01:13:44 +00:00
},
"autoload": {
"files": [
2026-03-31 14:35:49 +00:00
"app/Helpers/Upload.php"
2026-01-15 01:13:44 +00:00
],
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"setup": [
"composer install",
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"@php artisan key:generate",
"@php artisan migrate --force",
"npm install",
"npm run build"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
],
"dev:ssr": [
"npm run build:ssr",
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"php artisan inertia:start-ssr\" --names=server,queue,logs,ssr --kill-others"
],
"lint": [
"pint --parallel"
],
"test:lint": [
"pint --parallel --test"
],
"test": [
"@php artisan config:clear --ansi",
"@test:lint",
"@php artisan test"
],
"test:all": [
"@test",
"@php artisan test tests/Browser"
],
2026-01-15 01:13:44 +00:00
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force",
"@php artisan boost:update --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
],
"pre-package-uninstall": [
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
]
},
"extra": {
"laravel": {
"dont-discover": [
"laravel/telescope"
]
2026-01-15 01:13:44 +00:00
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}