Commit Graph
14667 Commits
Author SHA1 Message Date
Tanish Manku ff98e9b5b0 artcraft-mcp: fold crate into the parent workspace
Drop the standalone [workspace] block from the crate's Cargo.toml and
add 'crates/cli/artcraft-mcp' to the root workspace members list.

Kept this as the final commit on the branch — until this lands the
crate was a separate workspace, which kept the root Cargo.toml
untouched during the spike (avoiding conflicts with parallel work on
main) but meant 'cargo build' at the repo root didn't include it.

After this commit, 'cargo check -p artcraft-mcp' works from the repo
root and the crate is a first-class workspace member.
2026-06-15 14:32:34 -07:00
Tanish Manku 168977c44d artcraft-mcp: return all images from batch generations
When num_images>1, the omni_gen response is still a single job with a
single inline result; the rest of the batch is reachable through the
result's maybe_batch_token via GET /v1/media_files/batch_gen_redux/{token}.

Previously we only surfaced the single inline result, so 'num_images: 4'
returned just 1 image. Now after poll detects CompleteSuccess we follow
the batch token to fetch every member and return them all.

Inline rendering:
- Single result: 768 px thumbnail (unchanged).
- Batch: 512 px per image — 4 thumbnails at 512 px JPEG stay well under
  Claude Desktop's 1 MB tool-result cap.

Per-image inline fetch failures are logged and skipped (still return
the URL as text), so a single bad thumbnail doesn't poison the whole
response.

Multi-image text output is one URL per line, prefixed 'Image N:'.
2026-06-15 14:29:02 -07:00
Tanish Manku f872ca4a6e artcraft-mcp: structured error UX + connection check
Make failure modes legible to both the LLM and the user:

errors.rs:
- ErrorCode enum: artcraft_not_installed, not_logged_in,
  session_expired, backend_unavailable, invalid_params,
  generation_timeout, generation_failed, reference_image_failed,
  internal.
- ToolError { error_code, message, remediation, details? } that
  serializes as JSON in CallToolResult::error content blocks.
- not_logged_in() detects whether the app is installed
  (/Applications/ArtCraft.app or the cache dir) and returns the
  appropriate code + remediation text.

creds.rs:
- load_session() now returns Result<_, ToolError>. The user sees a
  proper sign-in remediation instead of a generic anyhow message.

tools/check_artcraft_connection.rs (new):
- Always succeeds, never errors. Reports desktop_app_installed,
  signed_in, session_valid, error_code, remediation. Detects expired
  sessions by making a cheap authenticated get_session_credits call.

tools/list_image_models.rs:
- 401/403 from the API now maps to session_expired.

All existing tools converted from anyhow::Result to Result<_, ToolError>
with appropriate error codes per failure path.

server.rs:
- Updated instructions teach Claude how to react to each error code
  (open desktop app and sign in, download from getartcraft.com, etc.)
  and to call check_artcraft_connection when troubleshooting.
- error_result() now serializes the full ToolError struct as JSON
  inside the error content block.

main.rs:
- New '--check' / '-c' CLI flag prints a human-readable diagnostic to
  stdout and exits, useful when the user can't see the Artcraft tools
  in Claude and wants to debug from a terminal without round-tripping
  through MCP.
2026-06-15 14:24:46 -07:00
Tanish Manku 5160019733 artcraft-mcp: 3 new tools + expanded generate_image
Split main.rs (398 lines) into modules: main.rs, server.rs, creds.rs,
inline_image.rs, tools/{generate_image,list_image_models,
get_user_status,estimate_image_cost}.rs.

New tools:

- list_image_models — GET /v1/omni_gen/models/image; returns each
  model's constraints (aspect_ratio_options, resolution_options,
  quality_options, batch_size_max, image_refs_supported, image_refs_max,
  text_prompt_max_length, etc.) so Claude can pick valid params before
  calling generate_image. Optional provider filter.

- get_user_status — parallel GETs to /v1/credits/namespace/artcraft +
  /v1/subscriptions/namespace/artcraft. Returns credits (free, monthly,
  banked, total) and active subscription info.

- estimate_image_cost — POST /v1/generate/cost_estimate/image. Takes
  model + num_reference_images + aspect_ratio + resolution + quality +
  num_images. Returns cost_in_credits, cost_in_usd_cents, is_free,
  is_unlimited, is_rate_limited, has_watermark — so Claude can confirm
  with the user before spending credits.

Expanded generate_image:

- New optional params: aspect_ratio, resolution, quality, num_images,
  reference_image_urls.
- reference_image_urls fetches each https URL, validates as image/*
  (PNG/JPEG/GIF, max 20 MB), uploads via /v1/media_files/..., and
  passes the resulting MediaFileToken to omni_gen. Marked as
  intermediate system files so they don't appear in the user's gallery.

Constraint validation is left to backend's structured errors; Claude
is expected to consult list_image_models first.
2026-06-15 14:17:17 -07:00
Tanish Manku d5b26784cb artcraft-mcp: optional model parameter on generate_image
The tool now accepts an optional `model` arg (snake_case id matching
CommonImageModel's serde rename, e.g. nano_banana_pro,
flux_pro_1p1_ultra, gpt_image_2, midjourney_8, seedream_4, etc.).
Defaults to nano_banana_pro when omitted. Unknown ids return a
structured error so the LLM can correct itself.

Valid model ids are listed in the JSON schema description so Claude
can pick one before calling the tool.
2026-06-08 12:46:17 -07:00
Tanish Manku 617f02ec15 artcraft-mcp: inline a 768px thumbnail, not the full-res image
Claude Desktop rejects tool results over 1 MB; base64 adds ~33%
overhead so the raw payload must stay under ~750 KB. Full-res PNGs
from Artcraft (often 1024+ px) routinely exceed that.

Use media_links.maybe_thumbnail_template at width 768 for the inline
preview when the API returns one; fall back to the full cdn_url
otherwise. The full URL is still returned as text so the user can
open the original at full resolution.
2026-06-08 12:37:23 -07:00
Tanish Manku afa4c9acb8 artcraft-mcp: return inline image content for in-chat preview
Previously the tool returned only Content::text(cdn_url), which Claude
Desktop renders as a "show image" link. Switch to fetching the
generated image bytes from the CDN, base64-encoding them, and
returning both Content::image and Content::text so the chat shows the
image inline while keeping the URL clickable.

On fetch failure (timeout, CDN error, etc.) we fall back to the
URL-only response so the tool still succeeds.
2026-06-08 12:30:31 -07:00
Tanish Manku b233825aac artcraft-mcp: send v4 UUID as idempotency_token
The OmniGenImageCostAndGenerateRequest doc comment claims the server
auto-generates an idempotency_token when None is passed, but the
backend actually rejects requests without one ("idempotency token does
not match the expected format"). Match the desktop app's behavior at
handle_artcraft_via_omni_endpoint.rs:30 by sending a fresh hyphenated
v4 UUID per call.
2026-06-08 12:25:47 -07:00
Tanish Manku e409f3b11d artcraft-mcp: load creds from tauri-plugin-http cookie jar
Production desktop v0.32 keeps Storyteller cookies only in the vendored
tauri-plugin-http jar at <app_cache_dir>/.cookies; persist_all_to_disk()
for the text-file path in the dev source is commented out, so shipped
builds never populate those files.

Add a JSON-parsing fallback that reads the .cookies jar, filters to
api.storyteller.ai, and extracts the session + visitor cookies. The
text-file path stays as a secondary fallback for forward-compat.

macOS-only path resolution via directories::ProjectDirs for the
"ai.artcraft.app" bundle id. Linux/Windows resolutions differ from
Tauri's app_cache_dir() and are deferred.
2026-06-08 12:22:54 -07:00
Tanish Manku 9bafc23a41 artcraft-mcp: MVP stdio server with generate_image tool
Standalone crate at crates/cli/artcraft-mcp/ exposing a single MCP tool
that submits an image generation via /v1/omni_gen/generate/image, polls
/v1/jobs/session until the job completes, and returns the CDN URL.

Reads Storyteller cookies from ~/Artcraft/credentials/ written by the
desktop app — no separate sign-in needed. 90s poll timeout.

Kept as its own [workspace] during the spike so the parent workspace
Cargo.toml stays untouched and parallel work on main doesn't conflict.
Workspace registration deferred to a final commit once the spike is
validated end-to-end against Claude Desktop.
2026-06-08 12:01:24 -07:00
Tanish Mankuandbflatastic d09d44b7e2 Page video editor: Mount and make public (#1606)
Co-authored-by: bflatastic <bombayapirat@gmail.com>
2026-06-05 22:21:55 +07:00
BFlat 8e754b4b8f website: landing buttons and footer cta updates (#1607)
- Renamed the "Supercharge Credits" button to **Use on Web** (globe
icon) in the hero and bottom CTA. Routes subscribers to the webapp
homepage, everyone else to `/pricing`.
- Removed the "Create image / Create video" links from both sections.
- Split Discord + GitHub into a separate "Open source &
community-driven" CTA (subtle container) above the "Ready to craft?"
CTA.
2026-06-05 14:47:30 +07:00
BFlat cbda6b7b1f fix(webapp): prevent iOS caret loss in mobile prompt input (#1605)
MentionTextarea's DOM-sync effect rewrote innerHTML under the live caret
whenever buildHTML's identity changed, detaching the cursor on iOS
Safari mid-typing. Skip the rewrite when focused and the DOM already
matches value, and memoize colorMap in MobilePromptForm to stop the
per-render churn.
2026-06-04 13:05:30 +07:00
Brandon Thomas 186ce24390 fix routing 2026-06-03 23:59:13 -04:00
Brandon Thomas 3401e709bb rename handlers + codegen fix 2026-06-03 10:57:27 -04:00
Brandon Thomas f71d344ff3 admin email changes (#1604) 2026-06-03 10:37:28 -04:00
Brandon Thomas ca43d5cbe8 grok failure update (#1603) 2026-06-02 22:00:10 -04:00
BFlat 1d8f64dd23 webapp: midjourney icon and name mappings (#1602) 2026-06-02 22:58:33 +07:00
BFlat 2a49226479 mobile view update (#1601)
- Separate mobile generations page
- Bottom mobile navbar
2026-06-02 20:36:02 +07:00
Brandon Thomas a6f8d2a4aa midjourney images - router, web, jobs, etc. (#1600) 2026-06-02 06:49:12 -04:00
Brandon Thomas 017b923c5a midjourney client (#1599) 2026-06-02 04:02:09 -04:00
Brandon Thomas f0244c6da8 analytics queries (#1598) 2026-06-01 23:55:52 -04:00
Brandon Thomas 75788d9525 kling 1.6 pro, 2.5 turbo pro, 2.6 pro -> web omni api / artcraft_router / fal_client (#1597) 2026-06-01 19:08:25 -04:00
BFlat c5dcf0e155 app styling updates (#1596)
darker tone
2026-06-01 18:17:14 +07:00
Brandon Thomas c71af2b2b0 move deprecated modules (the bulk of them) (#1595) 2026-05-31 23:59:25 -04:00
Brandon Thomas 2f808fe61e artcraft_router cleanup from old migration (#1594) 2026-05-31 23:42:50 -04:00
Brandon Thomas 0c1bb0794a auto aspect ratio for grok 2026-05-31 16:39:46 -04:00
Brandon Thomas f551a547a0 grok max length is 4096 2026-05-31 15:05:09 -04:00
Brandon Thomas 8ac4e534e1 refactor to make intention of request prereq checks clear + reusable 2026-05-31 14:40:10 -04:00
BFlat e39fe7c106 textToVideoSupported api field (#1593) 2026-06-01 01:30:24 +07:00
Brandon Thomas e3d30a677a 400 on grok ttv (#1592) 2026-05-31 14:19:13 -04:00
Brandon Thomas e8a2cbd490 text_to_video_supported=false on new grok model (#1591) 2026-05-31 13:53:02 -04:00
Brandon Thomas 0d7168c506 grok imagine video 1.5 preview (#1590) 2026-05-31 12:21:54 -04:00
bflatastic 5d4f307320 model selector width update 2026-05-30 01:03:13 +07:00
Brandon Thomas dbd723541f add prompt token to GET /v1/media_files/list/user/{username} (#1589) 2026-05-29 13:45:17 -04:00
bflatastic c589f20110 popover updates for info tooltip 2026-05-30 00:42:55 +07:00
Brandon Thomas 59da9a2a79 descriptions got switched 2026-05-29 13:38:03 -04:00
BFlat 58d4f4ff12 webapp: extra info for models (#1588) 2026-05-30 00:30:14 +07:00
Brandon Thomas 10cb0b3030 fix build 2026-05-29 13:09:46 -04:00
Brandon Thomas 55d375895c description fields on video models 2026-05-29 13:05:55 -04:00
Brandon Thomas 5dfa059523 disable characters 2026-05-28 19:46:46 -04:00
bflatastic 9598a86dcd webapp: recreate failed jobs 2026-05-29 06:40:54 +07:00
Brandon Thomas d86da55954 update model list (#1587) 2026-05-28 19:10:36 -04:00
Brandon Thomas 6f9e240b4e ultra variant backend (#1586) 2026-05-28 19:03:12 -04:00
Brandon Thomas 491715e5a6 seedance variant - BytePlus "Ultra" (#1585) 2026-05-28 16:23:56 -04:00
Brandon Thomas 6e55dc63c0 group providers together (#1584) 2026-05-28 15:14:24 -04:00
Brandon Thomas 7aa8d9b7ca enums renames for less confusion (#1583) 2026-05-27 22:51:42 -04:00
Brandon Thomas 094afb4cf0 remove legacy image pipeline (#1582) 2026-05-27 18:30:54 -04:00
bflatastic cfd60a4d11 webapp: create row card styling fixes and copy prompt on failed and in progress rows 2026-05-27 14:30:29 +07:00
BFlat 2b0a692634 webapp: create pages list view (#1581)
Create pages now have a toggle for grid/list view depending on
preference
2026-05-27 14:14:36 +07:00