Search by

adachsoft / file-content-tool

Arkadiusz Adach

Secure AI tools for byte-range and line-range file reading and contextual file search.

Package info

gitlab.com/a.adach/file-content-tool

Issues

pkg:composer/adachsoft/file-content-tool

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.1 2026-11-23 09:35 UTC

This package is auto-updated.

Last update: 2026-11-23 08:35:50 UTC


README

adachsoft/file-content-tool provides AI tool adapters for controlled file access. Applications can read bounded byte ranges, read selected lines, and search file contents with contextual matches.

Requirements

The library requires PHP and Composer dependencies declared in composer.json.

Capabilities

  • Read a bounded byte range or an inclusive, one-based line range.
  • Search file contents using plain text, case-sensitive text, regular expressions, or similarity matching.
  • Return match text, offsets, line and column positions, and surrounding context.
  • Authorize file access through adachsoft/file-tool-security-policy before file I/O.

Search matching and context calculation are provided by adachsoft/text-search. File search rejects files larger than the configured limit, which defaults to 1 MiB.

Installation

composer require adachsoft/file-content-tool

Usage

Create tools through FileReadRangeToolFactory, FileReadLinesToolFactory, or FileSearchInFileToolFactory. Each factory accepts the SPI ConfigMap; configure a base_path and any required file or extension policies before registering the tool with your AI tool-call integration.

See the integration example for a factory setup and the tool request format.

The factories are the intended construction API. Request, result, handler, validator, serializer, and support classes are implementation details.