Skip to content

feat(tools): SwiftAgentKitTools product (filesystem, shell, PDF) - #17

Merged
ayman3000 merged 1 commit into
mainfrom
feat/swiftagentkit-tools
Jul 27, 2026
Merged

feat(tools): SwiftAgentKitTools product (filesystem, shell, PDF)#17
ayman3000 merged 1 commit into
mainfrom
feat/swiftagentkit-tools

Conversation

@ayman3000

Copy link
Copy Markdown
Owner

Summary

Adds SwiftAgentKitTools, a new opt-in library product of ready-made native AgentTools — the same pattern as SwiftAgentKitMCP. Apps import SwiftAgentKitTools, register the ones they want, and supply the confirmation UI/policy via AgentCallbacks.onToolConfirmation.

Layering: generic capability lives in the framework; app-specific UI/policy stays in the app; security-sensitive tools split (execution here, decision/UI in the app).

Tools

  • Filesystem (Foundation-only, cross-platform): read_file (paged), write_file (append/overwrite, requiresConfirmation), list_dir, search_files (name and/or content substring, bounded traversal).
  • Shell (run_shell, requiresConfirmation, macOS-only via #if os(macOS)): zsh -lc, reads to EOF (no pipe deadlock), bounded output, configurable default working directory. Promoted from the Naseem app so every consumer gets it.
  • PDF (#if canImport(PDFKit)): pdf_info, pdf_extract_text (page range, bounded), pdf_merge / pdf_split (requiresConfirmation).

Read tools are unconfirmed; disk-mutating tools are requiresConfirmation (fail-closed via the existing dispatcher gate).

Tests

New SwiftAgentKitToolsTests (11): filesystem write→read→append, list-dir, search by name/content, shell exit/cwd, PDF merge→split round-trip, confirmation flags. All 108 tests pass.

🤖 Generated with Claude Code

A new opt-in library product of ready-made native AgentTools, mirroring the
SwiftAgentKitMCP pattern. Apps import it, register what they want, and supply
the confirmation UI/policy via AgentCallbacks.onToolConfirmation.

- Filesystem (Foundation-only, cross-platform): read_file (paged),
  write_file (append/overwrite, requiresConfirmation), list_dir,
  search_files (name/content substring, bounded traversal).
- Shell (run_shell, requiresConfirmation, macOS-only): zsh -lc, reads to EOF,
  bounded output, configurable default working directory. Promoted from Naseem.
- PDF (#if canImport(PDFKit)): pdf_info, pdf_extract_text (page range),
  pdf_merge / pdf_split (requiresConfirmation).

Read tools are unconfirmed; disk-mutating tools require confirmation. New
SwiftAgentKitToolsTests target (11 tests): filesystem round-trips, search,
shell exit/cwd, PDF merge->split.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@ayman3000
ayman3000 merged commit 183a16e into main Jul 27, 2026
1 check passed
@ayman3000
ayman3000 deleted the feat/swiftagentkit-tools branch July 27, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant