@matheuskrumenauer/tanya 0.6.0-beta.0 → 0.8.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -198,6 +198,35 @@ run directly; JavaScript and TypeScript commands export a default
198
198
  Project-local commands are arbitrary code execution and are gated by the same
199
199
  permission engine as native tools.
200
200
 
201
+ ## Sub-agent tool
202
+
203
+ The `task` tool delegates a bounded child run while keeping the parent in
204
+ control:
205
+
206
+ ```json
207
+ {
208
+ "prompt": "Map the auth module and report blockers.",
209
+ "workspace": "src/auth",
210
+ "max_turns": 12,
211
+ "token_budget": { "max_tokens": 12000 },
212
+ "treat_failure_as": "warning"
213
+ }
214
+ ```
215
+
216
+ Children inherit the parent's skill packs, permission rules, workspace, and
217
+ budget. They may narrow those constraints but cannot loosen them. Depth is
218
+ capped at 2 by default (`TANYA_SUBTASK_MAX_DEPTH`), and active children share a
219
+ default parallel cap of 3 (`TANYA_SUBTASK_MAX_PARALLEL`).
220
+
221
+ Every child runs its own verifier. Failed child verdicts become parent blockers
222
+ by default; `treat_failure_as` can demote a specific child to `warning` or
223
+ `ignore` when the caller wants advisory work only. Child events stream into the
224
+ parent log with a `subRunId`, and parent cancellation propagates into active
225
+ children.
226
+
227
+ See [docs/sub-agents.md](./docs/sub-agents.md) for permission inheritance,
228
+ budget-ledger semantics, cancellation, verifier composition, and memory rollup.
229
+
201
230
  `--verify` adds required verification commands to the run context. Tanya must run and report each exact command before finishing the coding task.
202
231
 
203
232
  `tanya benchmark run --all` currently exercises 27 executable low-to-medium regression fixtures: targeted edits, new files, dependency/lockfile updates, framework-style migrations, failing-test repair, frontend smoke checks, artifact/context reuse, streaming long-tool execution, compaction-boundary recovery, run-history logging, dirty worktrees, report repair, and the CosmoHQ mobile/backend smoke profiles.
@@ -245,12 +274,24 @@ Tanya handles context pressure as a cascade instead of truncating abruptly:
245
274
  1. Microcompact folds empty/no-op tool-call pairs in place.
246
275
  2. Snip removes low-signal history such as duplicate file reads and empty read-only tool results.
247
276
  3. Auto-compact reacts to provider `413` / context-window errors by summarizing older turns into a `[compaction summary: ...]` system message and retrying once normally, then once more aggressively.
248
- 4. Archive writes compacted messages to `.tanya/runs/<runId>/archive.jsonl` before they leave live history, so verifier scans and future memory tools can still inspect them.
277
+ 4. Archive writes compacted messages to `.tania/runs/<runId>/archive.jsonl` before they leave live history, so verifier scans and future memory tools can still inspect them.
249
278
 
250
279
  Runs are capped at three total auto-compactions. If the provider still rejects the context, Tanya raises `CompactionExhaustedError` and asks the user to narrow the task, clear the session, or split the work.
251
280
 
252
281
  See [docs/long-sessions.md](./docs/long-sessions.md) for details.
253
282
 
283
+ ## Token economy
284
+
285
+ Tanya trims model-visible tokens while keeping state reversible and auditable.
286
+
287
+ - Lite prompts can be enabled with `TANYA_LITE_PROMPT=1` for cheap-provider exploration turns. The legacy `TANIA_LITE_PROMPT` alias is still accepted.
288
+ - System prompts are automatically capped to the active provider context window. Tune the default 25% cap with `TANYA_PROMPT_BUDGET_RATIO`.
289
+ - Large shell/tool outputs are shortened for the model with a visible `<truncated ...>` marker. Use `expand_result` with the marker's `tool_call_id` to fetch the full output or a byte range.
290
+ - Repeated unchanged `read_file` calls return a reference marker instead of resending the same content. Pass `force: true` when the agent genuinely needs the full file again.
291
+ - `/budget` reports token usage, cost estimates, expensive turns, and one deterministic optimization suggestion. `/budget --enforce --max-usd <amount>` persists a session spend rule through the permission engine.
292
+
293
+ See [docs/token-economy.md](./docs/token-economy.md) for the full model, cache locations, and tool-definition knobs.
294
+
254
295
  Context files are generic JSON envelopes for caller-supplied task metadata, artifacts, instructions, and verification commands.
255
296
 
256
297
  ## Current Tools