Skip to content

Commit 3627334

Browse files
committed
feat: v1.7.0 - Built-in Git client, remove document parser
Added: - Built-in Git tool with auto-install support (Windows/macOS/Linux) - Python/Node SDK git() convenience methods - Updated system prompts (Claude → A3S Code) Removed: - composite_document_parser and document modules - agentic_search and agentic_parse tools - git_worktree tool (replaced by unified git tool) Changed: - 16 built-in tools (was 15) - Version bump to 1.7.0 See CHANGELOG.md for full details.
1 parent d481fe0 commit 3627334

72 files changed

Lines changed: 1503 additions & 25243 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,39 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased] - 2026-04-02
8+
## [Unreleased] - 2026-04-05
9+
10+
---
11+
12+
## [v1.7.0] - 2026-04-05
13+
14+
### Added
15+
16+
#### Git Built-in Tool
17+
18+
- **Built-in Git Client**: New `git` tool with auto-install support for Windows, macOS, and Linux. Downloads official pre-built git binaries to `~/.local/git/bin/` when git is not available - no package manager required.
19+
20+
Full git operations: `status`, `log`, `branch`, `checkout`, `diff`, `stash`, `remote`, `worktree`
21+
22+
- **Git Convenience Methods**: Python SDK (`session.git(...)`) and Node SDK (`session.git(...)`) convenience methods for git operations.
23+
24+
#### System Prompt Updates
25+
26+
- Updated all system prompts to reference "A3S Code" instead of "Claude Code"
27+
- Updated skill references to use `a3s-lab/code-skills`
28+
29+
### Removed
30+
31+
- **Document Parser**: Removed `composite_document_parser` and `document` modules and all related code. This feature was not fully implemented and has been removed to simplify the codebase.
32+
33+
- **Agentic Search/Parse Tools**: Removed `agentic_search` and `agentic_parse` built-in tools.
34+
35+
- **Git Worktree Tool**: Replaced by the new unified `git` tool with `worktree` subcommand.
36+
37+
### Changed
38+
39+
- **Tool Count**: Updated built-in tool count from 15 to 16 to reflect new git and box tools.
40+
- **Documentation**: Updated all documentation to reflect new tool names and capabilities.
941

1042
---
1143

README.md

Lines changed: 2 additions & 270 deletions
Original file line numberDiff line numberDiff line change
@@ -59,287 +59,19 @@ session.close(); // recommended in short-lived Node.js scripts
5959

6060
---
6161

62-
## What the LLM Can Do
62+
## Built-in Tools
6363

64-
**18 built-in tools** — available in sessions by default:
64+
**15 built-in tools** — available in sessions by default:
6565

6666
| Category | Tools |
6767
| ---------- | ------------------------------------------------------------- |
6868
| Files | `read`, `write`, `edit`, `patch` |
6969
| Search | `grep`, `glob`, `ls` |
70-
| Agentic | `agentic_search`, `agentic_parse` |
7170
| Shell | `bash` |
7271
| Web | `web_fetch`, `web_search` |
7372
| Git | `git_worktree` |
7473
| Delegation | `task`, `parallel_task`, `run_team`, `batch`, `Skill` |
7574

76-
You can configure the built-in agentic tools from `config.hcl`:
77-
78-
```hcl
79-
agentic_search {
80-
enabled = true
81-
default_mode = "fast"
82-
max_results = 10
83-
context_lines = 2
84-
}
85-
86-
agentic_parse {
87-
enabled = true
88-
default_strategy = "auto"
89-
max_chars = 8000
90-
}
91-
92-
document_parser {
93-
enabled = true
94-
max_file_size_mb = 50
95-
96-
ocr {
97-
enabled = false
98-
model = "openai/gpt-4.1-mini"
99-
prompt = "Extract text from scanned pages and preserve structure."
100-
max_images = 8
101-
dpi = 144
102-
}
103-
}
104-
```
105-
106-
The `document_parser.ocr` block configures OCR policy. Applications can still supply a custom OCR / vision backend at runtime via `SessionOptions`. When `document_parser.ocr.enabled=true`, the built-in parser can also auto-detect local OCR tooling when available:
107-
108-
- Images: if `tesseract` is available on `PATH` (or `A3S_DOCUMENT_OCR_TESSERACT_BIN` points to it), `CompositeDocumentParser` can OCR image files without an injected provider.
109-
- PDFs: if both `tesseract` and `pdftoppm` are available (or `A3S_DOCUMENT_OCR_PDFTOPPM_BIN` points to `pdftoppm`), `CompositeDocumentParser` can rasterize pages and OCR PDFs without an injected provider.
110-
- Custom providers supplied via `SessionOptions` still take precedence over the built-in fallback.
111-
112-
Current OCR execution matrix:
113-
114-
- `pdf`: when OCR is enabled, OCR fallback runs when native text extraction is weak or empty.
115-
- `png` / `jpg` / `jpeg` / `webp` / `gif` / `bmp` / `tif` / `tiff`: when OCR is enabled, OCR is the primary decode path.
116-
- `docx` / `pptx` / `xlsx` / `xlsm` / `odt` / `ods` / `odp`: when OCR is enabled, OCR fallback runs only when the native structured-text pass yields no extractable content.
117-
118-
Runtime normalization:
119-
120-
- `agentic_search.default_mode` accepts `fast`, `deep`, or `filename_only`; invalid values fall back to `fast`.
121-
- `agentic_search.max_results` is clamped to `1..=100`; `context_lines` is clamped to `0..=20`.
122-
- `agentic_parse.default_strategy` accepts `auto`, `structured`, `narrative`, `tabular`, or `code`; invalid values fall back to `auto`.
123-
- `agentic_parse.max_chars` is clamped to `500..=200000`.
124-
- `document_parser.max_file_size_mb` is clamped to `1..=1024`; OCR `max_images` is clamped to `1..=64`; OCR `dpi` is clamped to `72..=600`.
125-
126-
## Agentic Document Flow
127-
128-
`agentic_search` and `agentic_parse` are built-in tools. They do not parse PDFs, Office files, images, or emails themselves. Both tools delegate file decoding to the shared document parser registry, which includes `CompositeDocumentParser` by default when `document_parser.enabled=true`.
129-
130-
```text
131-
User / LLM
132-
|
133-
v
134-
agentic_search / agentic_parse
135-
|
136-
v
137-
ToolContext.document_parsers
138-
|
139-
v
140-
DocumentParserRegistry
141-
|
142-
+--> PlainTextParser
143-
| |
144-
| `--> text/code/config files
145-
|
146-
`--> CompositeDocumentParser
147-
|
148-
`--> pdf / office / odf / image / epub / html / xml / eml / rtf
149-
|
150-
v
151-
ParsedDocument
152-
- title
153-
- blocks[]
154-
- block.kind / label / content / location
155-
- optional OCR runtime metadata
156-
|
157-
+-----------+-----------+
158-
| |
159-
v v
160-
agentic_search agentic_parse
161-
- builds search lines - builds structural summary
162-
- matches/ranks files - detects parse strategy
163-
- uses block metadata - sends block-aware context to LLM
164-
```
165-
166-
Responsibility split:
167-
168-
- `CompositeDocumentParser`: decode project documents into a shared structured model for agent context.
169-
- `CompositeDocumentParser` covers a broad set of document families, including PDF, Office, ODF, iWork, HWP/HWPX, archive containers, HTML/XML, email/mailbox formats, notebooks, citation formats, calendar/contact formats, and common image formats.
170-
- Supported examples include: `pdf`, `doc`, `dot`, `docx`, `docm`, `xls`, `xlt`, `xlsx`, `xlsm`, `xlsb`, `ppt`, `pps`, `pptx`, `pptm`, `odt`, `ods`, `odp`, `hwp`, `hwpx`, `pages`, `numbers`, `key`, `epub`, `zip`, `tar`, `gz`, `tgz`, `7z`, `rtf`, `html`, `xml`, `eml`, `emlx`, `mbox`, `msg`, `ipynb`, `ris`, `bib`, `csl`, `ics`, `vcf`, `png`, `jpg`, `jpeg`, `webp`, `gif`, `bmp`, `tif`, `tiff`.
171-
- `agentic_search`: search and rank over the structured document content.
172-
- `agentic_parse`: summarize, analyze, and answer questions over the structured document content.
173-
- `agentic_parse`: when OCR is used, it also surfaces OCR runtime metadata such as format, provider, model, `max_images`, and `dpi`.
174-
175-
SDK access to parser runtime metadata:
176-
177-
```python
178-
tool = session.tool("agentic_parse", {"path": "docs/scanned.pdf"})
179-
print(tool.metadata)
180-
print(tool.document_runtime)
181-
runtime = tool.document_runtime_info
182-
if runtime and runtime.ocr:
183-
print(runtime.ocr.provider, runtime.ocr.model, runtime.ocr.dpi)
184-
print(tool.metadata_json)
185-
print(tool.document_runtime_json)
186-
```
187-
188-
```typescript
189-
import { parseDocumentRuntime } from '@a3s-lab/code';
190-
191-
const tool = await session.tool('agentic_parse', { path: 'docs/scanned.pdf' });
192-
console.log(tool.metadata);
193-
console.log(tool.documentRuntime);
194-
const runtime = parseDocumentRuntime(tool);
195-
console.log(runtime?.ocr?.provider, runtime?.ocr?.model, runtime?.ocr?.dpi);
196-
console.log(tool.metadataJson);
197-
console.log(tool.documentRuntimeJson);
198-
```
199-
200-
`metadata` / `metadataJson` exposes the full tool metadata as parsed object plus raw JSON. Python additionally exposes `document_runtime_info` as a typed runtime object. In Node, `documentRuntime` and `parseDocumentRuntime(...)` expose the structured `DocumentRuntimeMetadata` view, while `document_runtime_json` / `documentRuntimeJson` keep the raw JSON string form.
201-
202-
`agentic_search` also exposes structured match metadata, including page / section
203-
locators derived from `CompositeDocumentParser` blocks:
204-
205-
```python
206-
search = session.tool("agentic_search", {"query": "overview", "mode": "fast"})
207-
for result in search.agentic_search_results_info:
208-
for match in result.matches:
209-
print(match.line_number, match.locator, match.content)
210-
```
211-
212-
```typescript
213-
import { parseAgenticSearchResults } from '@a3s-lab/code';
214-
215-
const search = await session.tool('agentic_search', { query: 'overview', mode: 'fast' });
216-
for (const result of search.agenticSearchResults ?? parseAgenticSearchResults(search) ?? []) {
217-
for (const match of result.matches ?? []) {
218-
console.log(match.lineNumber, match.locator, match.content);
219-
}
220-
}
221-
```
222-
223-
When `agentic_parse` runs with a `query`, SDK helpers also expose the exact
224-
structured blocks selected for LLM input:
225-
226-
```python
227-
tool = session.tool(
228-
"agentic_parse",
229-
{"path": "docs/scanned.pdf", "query": "overview"},
230-
)
231-
for block in tool.agentic_parse_llm_blocks_info:
232-
location = block.location.display if block.location else None
233-
print(block.index, block.kind, block.label, location)
234-
```
235-
236-
```typescript
237-
import { parseAgenticParseLlmBlocks } from '@a3s-lab/code';
238-
239-
const tool = await session.tool('agentic_parse', {
240-
path: 'docs/scanned.pdf',
241-
query: 'overview',
242-
});
243-
for (const block of tool.agenticParseLlmBlocks ?? parseAgenticParseLlmBlocks(tool) ?? []) {
244-
console.log(block.index, block.kind, block.label, block.location?.display);
245-
}
246-
```
247-
248-
## Document Intelligence Roadmap
249-
250-
Goal: make `agentic_search` and `agentic_parse` capable of searching and understanding a broad range of project and business document formats through the default document parser stack, while steadily closing the gap with higher-fidelity systems such as `kreuzberg`.
251-
252-
Current state:
253-
254-
- [x] Parse plain text, Markdown, code, CSV/JSON/YAML/TOML, and part of the PDF / Office surface.
255-
- [x] Expand format detection and container handling for more archive, iWork, `xlsb`, and `hwp/hwpx` scenarios.
256-
- [x] Add default pipeline stages for language enrichment, keyword extraction, hierarchical chunking, and quality evaluation.
257-
- [x] Expose structural summaries, quality metadata, language, keywords, chunk highlights, provenance, and confidence in `agentic_parse`.
258-
259-
Phase 1: Structured result surfaces
260-
261-
- [x] Expose `structured_payload` directly in `agentic_parse` output and metadata.
262-
- [x] Expose table payloads in a stable machine-readable form.
263-
- [x] Expose page-level data in `agentic_parse` output and metadata.
264-
- [x] Add stable `tables[]` output instead of relying on text summaries alone.
265-
- [x] Add stable `pages[]` output instead of relying on text summaries alone.
266-
- [x] Add stable `elements[]` output instead of relying on text summaries alone.
267-
- [ ] Teach `agentic_search` to consume chunk context more directly.
268-
- [ ] Teach `agentic_search` to consume tabular content more directly.
269-
- [ ] Teach `agentic_search` to consume page numbers and locators more directly.
270-
- [ ] Exit criteria: complex PDF and Office documents return stable locators in search results.
271-
- [ ] Exit criteria: parse results are directly consumable by downstream agents.
272-
273-
Phase 2: High-value parser depth
274-
275-
- [x] Improve native PDF extraction quality (lopdf position-aware extraction).
276-
- [x] Reduce dependence on weak text fallbacks for PDF.
277-
- [x] Add position-aware table detection for PDF documents.
278-
- [ ] Reduce dependence on OCR-only recovery for PDF.
279-
- [ ] Deepen true BIFF12 `xlsb` extraction.
280-
- [ ] Improve workbook structure recovery for `xlsb`.
281-
- [ ] Improve multi-sheet recovery for `xlsb`.
282-
- [ ] Improve table fidelity for `xlsb`.
283-
- [ ] Improve iWork extraction depth.
284-
- [ ] Improve HWP/HWPX extraction depth.
285-
- [ ] Improve archive-embedded document extraction depth.
286-
- [ ] Exit criteria: tables, sections, and page-level content are recovered reliably across common business documents.
287-
- [ ] Exit criteria: search recall and parse usefulness improve materially on common business documents.
288-
289-
Phase 3: Unified document object model
290-
291-
- [ ] Build a consistent document object model on top of the default parser stack.
292-
- [ ] Cover blocks, pages, tables, images, metadata, and quality in that model.
293-
- [ ] Standardize provenance output across parsers.
294-
- [ ] Standardize confidence output across parsers.
295-
- [ ] Standardize runtime metadata output across parsers.
296-
- [ ] Standardize validation issue output across parsers.
297-
- [ ] Reduce downstream special-casing by enforcing consistent fields across formats.
298-
- [ ] Exit criteria: `agentic_parse` returns a structurally similar object across major formats.
299-
- [ ] Exit criteria: downstream agents can consume parse results without format-specific branching.
300-
301-
Phase 4: Search-understanding convergence
302-
303-
- [ ] Let `agentic_search` rank with direct access to `tables[]`.
304-
- [ ] Let `agentic_search` rank with direct access to `pages[]`.
305-
- [ ] Let `agentic_search` rank with direct access to `elements[]`.
306-
- [ ] Strengthen query-aware chunk selection.
307-
- [ ] Strengthen heading inheritance during ranking.
308-
- [ ] Strengthen table-first matching when query intent is tabular.
309-
- [ ] Strengthen in-page region localization.
310-
- [ ] Add stronger de-duplication for cross-document retrieval.
311-
- [ ] Add quality-aware ranking for cross-document retrieval.
312-
- [ ] Add OCR-aware ranking for cross-document retrieval.
313-
- [ ] Exit criteria: retrieval behaves more like “find the right evidence first, then answer correctly”.
314-
315-
Phase 5: Multimodal and long-tail format coverage
316-
317-
- [ ] Improve OCR handling for scanned documents.
318-
- [ ] Improve vision handling for chart-heavy files.
319-
- [ ] Improve handling for image-based PDFs.
320-
- [ ] Close remaining long-tail gaps versus `kreuzberg`.
321-
- [ ] Add support for `dbf`.
322-
- [ ] Add support for `djot`.
323-
- [ ] Add support for `man`, `troff`, and `pod`.
324-
- [ ] Expand broader image and archive support.
325-
- [ ] Evaluate whether to integrate higher-fidelity external parsers.
326-
- [ ] Evaluate whether to maintain an internal compatibility layer instead.
327-
- [ ] Exit criteria: the failure rate for arbitrary files keeps dropping.
328-
- [ ] Exit criteria: binary-heavy document sets become meaningfully searchable.
329-
330-
Priority order:
331-
332-
- [ ] First, improve result schemas and downstream consumability.
333-
- [ ] Second, improve PDF, `xlsb`, and Office extraction depth.
334-
- [ ] Third, expand multimodal and long-tail format support.
335-
336-
Definition of done:
337-
338-
- [ ] `agentic_search` consistently returns high-quality, well-located evidence for common document formats.
339-
- [ ] `agentic_parse` returns structured results for common document formats, not just text summaries.
340-
- [ ] The default parser output flows through a unified pipeline with quality, language, keywords, provenance, and confidence.
341-
- [ ] Real-world usability on common document corpora approaches `kreuzberg`-class behavior while staying well integrated with the A3S toolchain.
342-
34375
---
34476

34577
## Slash Commands

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-code-core"
3-
version = "1.6.0"
3+
version = "1.7.0"
44
edition = "2021"
55
authors = ["A3S Lab Team"]
66
license = "MIT"

core/prompts/service_prompt_suggestion.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ THE TEST: Would they think "I was just about to type that"?
1616
|-----------|------------|
1717
| User asked "fix the bug and run tests", bug is fixed | `run the tests` |
1818
| After code written | `try it out` |
19-
| Claude offers options | the one the user would likely pick |
20-
| Claude asks to continue | `yes` or `go ahead` |
19+
| A3S Code offers options | the one the user would likely pick |
20+
| A3S Code asks to continue | `yes` or `go ahead` |
2121
| Task complete, obvious follow-up | `commit this` or `push it` |
2222
| After error or misunderstanding | silence (let them assess/correct) |
2323

@@ -27,7 +27,7 @@ Be specific: "run the tests" beats "continue".
2727

2828
- Evaluative ("looks good", "thanks")
2929
- Questions ("what about...?")
30-
- Claude-voice ("Let me...", "I'll...", "Here's...")
30+
- A3S Code-voice ("Let me...", "I'll...", "Here's...")
3131
- New ideas they didn't ask about
3232
- Multiple sentences
3333

@@ -54,4 +54,4 @@ A suggestion is filtered (not shown) if it:
5454
- Contains multiple sentences (period followed by uppercase)
5555
- Contains formatting (newlines, bold, asterisks)
5656
- Is evaluative ("thanks", "looks good", "perfect")
57-
- Starts with Claude voice patterns ("Let me", "I'll", "Here's", etc.)
57+
- Starts with A3S Code voice patterns ("Let me", "I'll", "Here's", etc.)

core/prompts/system_default.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Use the right tool for each job:
2828
| Search file contents | `grep` |
2929
| Find files by pattern | `glob` |
3030
| List a directory | `ls` |
31+
| Execute Git operations | `git` |
3132
| Fetch a URL | `web_fetch` |
3233
| Search the web | `web_search` |
3334
| Delegate a sub-task | `task` |

core/prompts/undercover_instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NEVER include in commit messages or PR descriptions:
1616
- Internal model codenames (animal names like Capybara, Tengu, etc.)
1717
- Internal repo or project names (e.g., a3s-code, CLAUDE.md)
1818
- Internal tooling, Slack channels, or short links
19-
- The phrase "Claude Code" or any mention that you are an AI
19+
- The phrase "A3S Code" or any mention that you are an AI
2020
- Co-Authored-By lines or any other attribution
2121
2222
Write commit messages as a human developer would — describe only what the code
@@ -29,6 +29,6 @@ GOOD:
2929
3030
BAD (never write these):
3131
- "Fix bug found while testing with Claude Capybara"
32-
- "Generated with Claude Code"
32+
- "Generated with A3S Code"
3333
- "Co-Authored-By: Claude <...>"
3434
```

0 commit comments

Comments
 (0)