26 Commits
Author SHA1 Message Date
Alessandro Frau d6d9f0507d Register Document Query from its skill
Let loaded skills declare callable schemas and bind them through plugin extensions using normal scoped skill resolution. Use the same binding for native tool declarations, Tool Access, and dispatch.

Move Document Query behind the skill registration and remove both standalone entry points. Preserve saved denials, destination permissions, and the existing indexing, worker, and streaming backend.
2026-11-24 21:49:00 +01:00
Alessandro Frau 759ef6dab8 Fix LiteParse worker startup and pin 2.21.1
Derive the subprocess import root from the sandbox package path so LiteParse starts through the plugin symlink. Cover both the checkout and guest layouts in the startup regression test.

Pin the stable Python release in the guest manifest. Verified the original scan in the existing guest and exercised inline scans, nested PDF forms, and digital PDFs in a fresh v3 guest without legacy OCR packages.
2026-11-24 18:32:23 +01:00
Alessandro Frau 0e1a5633ce Load Document Query on demand
Expose the existing callable after the document-query skill is loaded and visible in the chat. Preserve scoped Tool Access checks, including dispatch through the compatibility shim.

Cover text prompts, native Responses tool declarations, saved denials, and shim dispatch. Document destination selection in the skill.
2026-11-24 18:32:12 +01:00
Jan Tomášek 762466c3e9 Preserve host permissions on sandbox bindings and keep per-guest process identities 2026-11-22 19:14:25 +01:00
Jan Tomášek c32314770c Build the slim v3 image and publish tagged multi-architecture previews 2026-11-19 17:49:23 +00:00
Jan Tomášek 0fa1a85261 Unify agent execution and file destinations 2026-11-19 16:50:34 +00:00
Jan Tomášek 540ec7d854 Replace gVisor with PRoot and shared copy-on-write sandbox files
Run guests under separate Linux UIDs while retaining PRoot fake-root for
installers. Share immutable image files through hardlinks and copy each file
before mutation. Preserve existing disk roots during migration, maintain worker
bindings and lifecycle behavior, and remove gVisor sidecars and the Compose
seccomp override.

Build the pinned runtime in a disposable stage, bootstrap source updates, and
keep Unix socket scratch paths short. Preserve worker request ACLs and translate
fake-root Unix credentials for browser audio.

Validation: 3,398 unit tests and six real runtime checks passed. Verified default
Docker seccomp, missing-bundle image build, source bootstrap, persistent PTY,
worker RPC, browser render/input/audio/downloads/profile restart, and WebUI HTTP
startup. Fresh base is about 71 MiB smaller; a clean default sandbox uses about
9.7 MiB private disk. Ubuntu AppArmor and ARM64 were not available to test.
2026-11-16 18:42:18 +00:00
Jan Tomášek 188cff2073 Move optional runtimes into persistent gVisor plugin sandboxes
Move tunnel, browser, document, speech and integration runtimes into plugin-owned
sandboxes with lazy dependencies and instance-scoped lifecycle management.
Reuse Tuxee display assets and the sandbox image's Python/Node runtimes, enable
automatic Desktop login, and show elapsed time for each browser launch.

Slim the outer image, use offline ONNX embeddings, and calculate sandbox storage
only on demand. Include regression coverage and updated runtime documentation.
Exclude local handoff notes and temporary verification artifacts from publication.
2026-11-08 21:43:22 +01:00
Jan Tomášek dadcbfa4d9 Reconstruct preserved sandbox WIP from sanitized source snapshot
Reconstructed against verified original base 93d1131ce1. Original local commits and index metadata were not present in the transfer.
2026-11-08 21:42:13 +01:00
linkliti f342a8ef39 feat(document-query): render document_query tool calls through a dedicated badge
The document_query tool logs its message as its own `document_query` type with an `icon://manage_search Querying: <document>` headline when queries are supplied and `Reading: <document>` without them, naming the first document and appending `+ N more` for multi-document queries. A plugin message handler renders it as a DOC badge with blue and blue-violet accents across modes, each clearly bluer than the a2a chat family so document queries read like the other dedicated tool surfaces. Agent-facing failure messages render from plugin prompt files, and the Q&A answer streams into the tool log while the model writes it; helpers built without the streaming callback still answer without streaming. Regression tests cover the log entry, headline words, and empty-query reading mode.

Validation: pytest tests/test_document_query_tool_ui.py tests/test_document_query_fallback.py
2026-10-21 23:37:32 +03:00
Alessandro 2d400f5099 fix(prompts): validate examples and sharpen skill descriptions
Fix trailing commas in six JSON examples while preserving all examples and thoroughness instructions. Rewrite 23 skill descriptions to fit the catalog preview, retaining existing triggers and adding explicit discovery phrases where needed.

Document the description preview contract and add regression checks for complete JSON examples, description lengths, and skill search. All four checks pass against the staged snapshot.
2026-09-08 02:37:44 +02:00
Alessandro b40874e7c0 Fix document query SSRF regression
Route remote document downloads through the existing public-only HTTP fetcher so direct and redirected non-public destinations are rejected while public redirects, request headers, proxy isolation, retries, timeouts, and size limits remain intact.

Add focused CVE-2026-4308 regression coverage for private targets and genuine public-fetch compatibility.
2026-08-12 14:34:16 +02:00
Alessandro 77552b9394 Refine document query image routing
Prefer vision_load for images, screenshots, scans, charts, photos, and diagrams when vision tools are available.

Keep document_query focused on PDFs, documents, large text-heavy files, code-file Q&A, and fallback OCR when vision cannot read the needed text.

Update bundled prompt, skill guidance, DOX notes, and regression coverage for the routing contract.
2026-06-19 01:49:50 +02:00
frdel c576f67469 Merge branch 'ready' of https://github.com/agent0ai/agent-zero into ready 2026-06-08 12:41:57 +02:00
frdel e138e33ca9 Add file-level DOX docs & update AGENTS indexes
Add comprehensive file-level DOX documentation across the repo and update directory AGENTS.md indexes. Many new `*.py.dox.md` files were added under api, helpers, tools, plugins, extensions, webui, and other dirs to document endpoint purpose, ownership, runtime contracts, work guidance, and verification. Several AGENTS.md files were created or updated (agents profiles, api, docker, extensions, helpers, plugins, skills, webui components, etc.) to list child DOX files and clarify documentation/work guidance. Also add example and bundled profile DOX files (agent0, default, developer, hacker, researcher) and minor updates to helpers/dirty_json.py and its tests. These changes improve on-disk documentation coverage and establish the convention that each direct runtime file should have a matching `*.dox.md` describing its contracts and verification steps.
2026-06-08 12:41:53 +02:00
Alessandro 94065dbe86 Fix document query index reuse
Reuse the DocumentQueryStore per chat context so repeated document_query calls can see an existing vector DB instead of re-parsing and re-embedding the same document every time.

Add a regression test that proves a second store lookup in the same context reuses the indexed document while a separate context stays isolated.
2026-06-03 01:55:41 +02:00
Alessandro bc2d447ddd fix(document-query): bound long PDF processing
Disable LiteParse OCR automatically for PDFs at or above the configured page threshold, independent of sampled text density. Add adaptive index chunk sizing for large extracted documents so first-run document_query calls avoid spending the full batch timeout embedding thousands of small chunks. Update the settings UI, README, dependency hook, and regression tests for the new behavior.
2026-06-02 17:52:47 +02:00
Alessandro a7b4fcd798 Remove document query plugin requirements
The LiteParse dependency is already managed from the root requirements.txt, so the document query plugin should not carry a separate requirements file.

This keeps dependency installation centralized for the bundled core plugin.
2026-06-01 02:29:22 +02:00
Alessandro 9e4b2f1843 Tune LiteParse OCR defaults
Add an adaptive OCR heuristic that samples PDF text density and disables LiteParse OCR for large text-rich PDFs before the OCR path reaches timeout territory.

Keep LiteParse isolated in a subprocess regardless of stale user config, remove the subprocess toggle from the settings UI, and raise the default LiteParse worker count to 2 for a safer multi-chat speedup.

Update Document Query docs and focused tests for the new heuristic, mandatory isolation, and worker default.
2026-05-30 19:02:10 +02:00
Alessandro 98f6c17d15 feat(document_query): expand settings panel and thumbnail
Expose the main Document Query parser, retrieval, fetch, LiteParse/OCR, and fallback controls in the plugin settings UI. Add a generated 256x256 JPEG thumbnail under the plugin size limit and cover both the settings wiring and thumbnail constraints with focused tests.
2026-05-29 16:47:38 +02:00
Alessandro 59dd1c99cb feat(document_query): expose parser concurrency setting
Add a Document Query plugin settings panel that maps to the existing parser_concurrency runtime limit, with a focused regression test so the UI remains wired to the backend setting.
2026-05-29 16:30:47 +02:00
Alessandro 6df3acc1e6 fix(document_query): pin LiteParse dependency
Pin LiteParse to 2.0.3 in both Docker requirements and the plugin hook requirements so new images and existing plugin installs resolve the same tested runtime.
2026-05-29 16:07:20 +02:00
Alessandro b2ead06a4e fix(document_query): isolate LiteParse parsing
Run LiteParse in a subprocess so native parser crashes cannot take down the Web UI process. Bound parser concurrency and LiteParse workers for multi-chat stability, seed Q&A context with leading document chunks for title/abstract grounding, and keep a small-document fallback when vector search returns no chunks.
2026-05-29 15:51:59 +02:00
Alessandro d039af512a fix(document_query): clean prompt spelling and legacy references
Rename the query optimization prompt from optmimize to optimize, update the helper lookup, and fix the concise typo inside the prompt.

Also add a regression assertion for the corrected prompt filename and remove the remaining literal a0_small test references so global audits stay clean.
2026-05-29 12:46:32 +02:00
Alessandro 6ccbae0712 feat(document_query): add liteparse runtime and progressive skill
Add LiteParse as the preferred parser path with legacy parser fallbacks, centralized document fetching, generic user-facing progress, and compatibility shims for the former helper/tool imports.

Install the runtime through Docker requirements for fresh images and through the _document_query plugin hook/startup migration for existing installations.

Move the long document_query tool instructions into a document-query skill and leave a compact tool prompt stub that directs the model to load the skill before using document_query for documents, code-file Q&A, and document-image OCR. Also add default Agent Zero guidance for document/code/OCR Q&A routing.

Tests:
- PYTHONPATH=/home/eclypso/a0/agent-zero-pr-1528 conda run -n a0 pytest tests/test_document_query_plugin.py -q
- python -m compileall -q plugins/_document_query helpers/document_query.py tools/document_query.py tests/test_document_query_plugin.py
- git diff --check
- Live Agent Zero Web UI E2E at localhost:32080: PDF Q&A, code-file Q&A through document_query skill, and W-4 document-image OCR

Broader legacy pytest probe remains blocked by unrelated browser-agent, docker workflow branch expectation, and webui fixture path failures in this older PR worktree.
2026-05-29 12:45:14 +02:00
Deimos Agent 5fd7a6a79e feat: extract document_query into _document_query plugin with parser strategy pattern
- Create plugins/_document_query/ with full plugin structure:
  plugin.yaml, default_config.yaml, tools/, helpers/, helpers/parsers/, prompts/, README.md
- Add BaseParser ABC with asyncio.to_thread offload and configurable timeouts
- Implement 5 parsers: PDF (PyMuPDF+Tesseract), HTML (Markdownify),
  Text (expanded mimetypes: YAML, XML, TOML, JS, TS, shell),
  Image (Unstructured), Unstructured (catch-all)
- Add MIME type registry with priority-based routing via get_parser_for_mimetype()
- Add gather_timeout on asyncio.gather for bounded concurrent fetches
- All config externalized to default_config.yaml
- Disable core files (._py.bak) replaced by plugin
- Update knowledge_tool._py import to plugin path
2026-05-29 12:45:05 +02:00