Commit Graph
11 Commits
Author SHA1 Message Date
m105 efdec9eabd Add optional Tone field to Sites for AI content generation
- Add tone column to sites table (nullable string)
- Add TONES constant to Site model with predefined options:
  professional, casual, technical, friendly, formal, humorous,
  conversational, authoritative, inspirational, educational, minimal, detailed
- Update Sites Livewire component to edit tone
- Update Sites view with tone select dropdown in form
- Add tone column to sites table display
- Add tone to SiteResource API response

AI agents can now read the site's tone and use it when generating content.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-28 22:06:17 +03:00
m105 cee9fdc290 Add Webhook Endpoints for external automation
- Create WebhookController with 4 endpoints:
  - POST /api/webhooks/posts - Create a new post
  - GET /api/webhooks/posts - List posts with filters
  - POST /api/webhooks/posts/{post}/publish - Trigger publishing
  - GET /api/webhooks/posts/{post}/status - Get post status
- Add X-Muninn-Token header authentication
- Add MUNINN_WEBHOOK_TOKEN config in services.php
- Add MUNINN_WEBHOOK_TOKEN to .env.example
- Add webhook routes with /webhooks prefix

All endpoints return JSON responses with success/error fields.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-27 21:50:17 +03:00
m105andClaude Sonnet 5 b3b250aaca Add free-text api_instructions field to Sites
For custom sites we'll post to via their own API — there's no wired-in
publisher for these, so this is where the site owner documents how to
actually post there (auth, endpoints, payload shape). Shown in the UI
for non-WordPress sites, exposed via the JSON API, and pointed to from
AI_API.md's "any other network/CMS" fallback section so an agent checks
it before improvising.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 14:03:43 +03:00
m105andClaude Sonnet 5 42abc658f2 Add an image field, required for WordPress posts
Posts get a nullable image_url. WordPressPublisher now downloads it
and uploads it to WordPress's media endpoint before creating the
post, setting it as featured_media — and rejects publishing (without
touching status) if a blog post has no image set, mirroring the
existing title requirement. Every other network treats it as optional.

Not enforced at save time, same as title — you can still draft an
incomplete WordPress post, it just can't be published until an image
is set. Exposed through the UI form (with a thumbnail/""missing""
indicator in the table), the JSON API, and the Python CLI wrapper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 20:03:25 +03:00
m105andClaude Sonnet 5 9278d2e8a0 Add a Publisher abstraction and queued job to publish from the UI
Introduce Publisher/PublisherManager (WordPress + Reddit implementations)
so publishing logic is shared between the CLI, the queue, and future
network integrations. Add a "Publish" button on the Posts page that
dispatches PublishPostJob instead of blocking the request — Reddit's
publisher shells out to the existing Playwright sidecar and can take
tens of seconds, so it can't run synchronously in a web request.

Adds a `target` field (e.g. subreddit) and `publishing` status to Post,
plus a `publish_error` field so failures surface in the UI. Refactors
posts:publish to delegate to WordPressPublisher without changing its
CLI output contract (existing tests pass unchanged).

Also fixes two bugs found along the way: UpdatePostRequest was silently
dropping `published_url` from PATCH requests (never in its validation
rules, despite AI_API.md documenting it), and three Livewire index-page
tests were broken by the earlier auth change (never re-run after adding
the `auth` middleware) since they hit routes via HTTP without a logged-in
user.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 14:04:45 +03:00
Doar Mihai f7b71684f1 test: cover credential-clearing and trailing-slash URL edge cases
Also fixes a missing trailing newline in SiteResource.php.
2026-07-19 17:05:01 +03:00
Doar Mihai 5501b93686 feat: expose cms_type/WordPress credentials and published_url in API responses 2026-07-19 16:51:15 +03:00
Doar MihaiandClaude Sonnet 5 e0b8f2f924 feat: add full CRUD Posts API
Adds JSON API for Posts (index/show/store/update/destroy) so an AI
agent can draft posts, read what's due for publishing, and report
back publish/fail status. Unlike the existing read-only Sites/Accounts
APIs, this is full CRUD since the app itself never publishes anything.

- PostController with status/site_id/social_account_id/due filters
- StorePostRequest/UpdatePostRequest validate against Post::TYPES/STATUSES
- PostResource shapes the JSON response
- Route::apiResource('posts', ...) registered with ->names('api.posts')
  to avoid colliding with the existing web posts.index route name
- store() calls ->fresh() after create() so the response reflects the
  DB-level default status ('draft') instead of a stale in-memory null

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 17:22:16 +03:00
Doar MihaiandClaude Sonnet 5 5c24b6fbe0 feat: add read-only Social Accounts API
Add GET /api/accounts (list with optional ?network= and ?type= filters) and
GET /api/accounts/{socialAccount} (show) endpoints. Include plain-text password
field for AI agent consumption.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 15:25:56 +03:00
Doar MihaiandClaude Sonnet 5 20c33f1c23 feat: add read-only Sites API
Add GET /api/sites endpoint for listing sites with optional name filter,
and GET /api/sites/{site} for showing individual sites. Includes API
resource, controller, routes registration, and comprehensive tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 15:12:44 +03:00
Doar MihaiandClaude Sonnet 5 900e4f0309 Initial commit: Laravel skeleton with sites & accounts spec/plan
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 14:35:53 +03:00