mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
- Add shellflow.py: minimal DSL for DAG execution
- Syntax: A ; B (sequential), { A & B } (parallel)
- Compiles to JSON AST, S-expressions, or command list
- Supports quoted strings, &&, ||, nested braces
- Performance optimizations:
- Precompiled regex with local variable caching
- Fast-path for simple/sequential commands (8x faster)
- LRU cache for repeated patterns
- Full type annotations for mypyc compilation
- Restore dag as separate semantic tool:
- dag: for parallel/serial/graph execution
- zsh: for shell commands with shellflow DSL
- Both support nested arrays for auto-parallel
- Add comprehensive test suite (53 tests):
- Tokenizer, parser, normalization tests
- S-expression and command conversion tests
- Performance benchmarks
- Integration tests with real shell execution
Performance: ~7M ops/sec for simple commands,
~220k ops/sec for sequential, ~100k ops/sec for mixed DAGs