FileSystem

Register the native Android file-system tool suite to list, read, download, push, copy, move, and delete files inside approved roots.

Install

Published artifact: ai.ansight:ansight-tools-filesystem-android.

dependencies {
    debugImplementation("ai.ansight:ansight-tools-filesystem-android:1.0.2-preview.1")
}

Register the Suite

import ai.ansight.runtime.AnsightOptions
import ai.ansight.tools.filesystem.withFileSystemTools

val options = AnsightOptions.createBuilder()
    .withFileSystemTools {
        addRoot("exports", application.filesDir.resolve("exports"))
    }
    .withReadOnlyToolAccess()
    .build()

Registration API

  • withFileSystemTools(...): registers the suite.
  • AndroidFileSystemToolsOptions.createBuilder(): creates a suite options builder.
  • addRoot(alias, path): exposes an additional approved root.

Specific Concerns

  • All access is constrained to approved roots.
  • File contents are sensitive even when only read tools are enabled.
  • files.push_file, files.copy_file, and files.move_file are write-scoped.
  • files.delete_file is delete-scoped and requires withAllToolAccess().
  • files.begin_binary_download streams bytes over the binary transfer channel.

Tool Matrix

NameIdScopeDescriptionSecurity
List Directoryfiles.list_directoryReadLists files and folders inside approved roots.Moderate
Read Filefiles.read_fileReadReads a constrained file.High
Get File Checksumfiles.get_file_checksumReadComputes file checksums without returning contents.Moderate
Download Filefiles.download_fileReadDownloads chunks through JSON fallback.High
Begin Binary Downloadfiles.begin_binary_downloadReadStarts binary WebSocket download for a constrained file.High
Push Filefiles.push_fileWriteWrites caller-provided content into an approved root.High
Copy Filefiles.copy_fileWriteCopies a constrained file.High
Move Filefiles.move_fileWriteMoves or renames a constrained file.High
Delete Filefiles.delete_fileDeleteDeletes a constrained file.Critical

Tool Details

Use read tools for inspection and download. Use write and delete tools only for specific local repair workflows.