mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 18:03:44 +00:00
Implements support for ${@:N} and ${@:N:L} syntax to slice argument arrays
in prompt templates, following bash conventions.
Syntax:
- ${@:N} - All arguments from Nth position onwards (1-indexed)
- ${@:N:L} - L arguments starting from Nth position
Features:
- Bash-style slicing familiar to shell users
- 1-indexed for consistency with $1, $2, etc.
- Processes before simple $@ to avoid conflicts
- No recursive substitution of patterns in arguments
- Comprehensive edge case handling
Examples:
- ${@:2} with ["a", "b", "c"] -> "b c"
- ${@:2:1} with ["a", "b", "c"] -> "b"
- ${@:99} with ["a", "b"] -> "" (empty, out of range)
Test coverage: 24 new tests, all passing (73 total)
Closes #769
|
||
|---|---|---|
| .. | ||
| compaction | ||
| export-html | ||
| extensions | ||
| tools | ||
| agent-session.ts | ||
| auth-storage.ts | ||
| bash-executor.ts | ||
| event-bus.ts | ||
| exec.ts | ||
| footer-data-provider.ts | ||
| index.ts | ||
| keybindings.ts | ||
| messages.ts | ||
| model-registry.ts | ||
| model-resolver.ts | ||
| prompt-templates.ts | ||
| sdk.ts | ||
| session-manager.ts | ||
| settings-manager.ts | ||
| skills.ts | ||
| system-prompt.ts | ||
| timings.ts | ||