v2.5.0 — Generic file intake (upload → extract → suggest → pre-fill)
Backward-compatible feature release. Opt-in; defaults unchanged. 2215 tests passing.
File intake — upload → extract → suggest create → pre-fill
A generic, entity-agnostic document pipeline built on FileAnalysisService.
analyze_file tool (#46) — extract a stored upload's text (PDF / Word / txt / csv / xlsx via DocumentService) and suggest the create action it implies. Driven by config keyword patterns → any create_<entity>, so the same mechanism handles invoices, customers, products, or any registered resource — not invoice-specific.
- Secure: sandboxed to
file_analysis.base_path(path traversal / out-of-sandbox / absolute paths rejected — no arbitrary file reads), extension allowlist, size cap. - Suggestions filtered to create tools that actually exist (
validate_actions).
Field pre-fill + vision (#47)
StructuredFileExtractorextracts each suggested create action's own declared fields (its tool parameters) into a ready payload — generic, so a newAiResource/create tool gets upload-to-prefill with zero extra code. Returns{action_id: 'create_invoice', prefill: {customer_name, customer_email, items: [...]}}.- Images / scans (jpg/png/…) are OCR'd by a vision model (
vision_model) and run the same suggest + pre-fill path — a photographed invoice behaves like a PDF.
'file_analysis' => [
'enabled' => true,
'prefill' => true, // also extract fields to pre-fill the create
'base_path' => storage_path('app/uploads'),
'keyword_suggestions' => [
['pattern' => '/\binvoice\b/i', 'action_id' => 'create_invoice'],
['pattern' => '/\bcustomer\b/i', 'action_id' => 'create_customer'],
],
],Upgrade notes
No breaking changes. The feature is opt-in (ai-engine.file_analysis.enabled / .prefill). Model + vision calls hit a live provider at runtime; in tests they're mocked. See docs/agent-resources.mdx → "File intake".