agent-accelerator 0.5.9 → 0.6.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 +3 -1
- package/examples/prompts/SYSTEM_PROMPT.md +2 -0
- package/examples/prompts/SYSTEM_PROMPT_AGENT.md +4 -0
- package/examples/prompts/SYSTEM_PROMPT_TOOLS.md +1 -0
- package/package.json +4 -1
- package/src/agent/agent.ts +366 -161
- package/src/agent/architecture.md +13 -12
- package/src/agent/config-blocks.ts +39 -12
- package/src/agent/context.ts +8 -3
- package/src/agent/delegation.ts +82 -29
- package/src/agent/loop.ts +444 -365
- package/src/agent/subagent.ts +1 -3
- package/src/agent/subagents-tool.ts +45 -7
- package/src/agent/subagents.md +3 -0
- package/src/agent/turns.ts +3 -1
- package/src/agent/worker.ts +56 -27
- package/src/agent/workers.ts +113 -20
- package/src/architecture.md +16 -15
- package/src/index.ts +34 -10
- package/src/models/architecture.md +4 -3
- package/src/models/catalog-cache.ts +6 -5
- package/src/models/catalog.ts +39 -30
- package/src/providers/architecture.md +10 -8
- package/src/providers/google.ts +147 -59
- package/src/providers/openai-compat.ts +57 -49
- package/src/providers/openai.ts +54 -37
- package/src/providers/openrouter.ts +85 -30
- package/src/providers/registry.ts +6 -21
- package/src/providers/shared.ts +87 -33
- package/src/providers.ts +56 -115
- package/src/scheduler/architecture.md +7 -6
- package/src/scheduler/scheduled-actions.md +4 -0
- package/src/scheduler/scheduler.ts +186 -60
- package/src/scheduler/store.ts +23 -10
- package/src/scheduler/time.ts +17 -3
- package/src/scheduler/tool.ts +33 -7
- package/src/session/architecture.md +7 -6
- package/src/session/journal.ts +38 -12
- package/src/session/store.ts +122 -61
- package/src/session/usage.ts +58 -9
- package/src/streaming/architecture.md +4 -3
- package/src/streaming/event-stream.ts +26 -12
- package/src/telemetry.ts +6 -2
- package/src/tools/architecture.md +8 -7
- package/src/tools/executor.ts +50 -48
- package/src/tools/schema.ts +10 -6
- package/src/tools/subagent-result.ts +6 -1
- package/src/tools/tool.ts +9 -11
- package/src/types/agent.ts +2 -21
- package/src/types/architecture.md +11 -10
- package/src/types/core.ts +1 -9
- package/src/types/errors.ts +26 -4
- package/src/types/model.ts +0 -4
- package/src/types/tool.ts +12 -2
- package/src/update-models.ts +5 -5
- package/src/utils/architecture.md +16 -15
- package/src/utils/cache.ts +1 -3
- package/src/utils/durable.ts +17 -5
- package/src/utils/env.ts +9 -7
- package/src/utils/errors.ts +6 -14
- package/src/utils/headers.ts +3 -10
- package/src/utils/media.ts +23 -8
- package/src/utils/raw-capture.ts +9 -2
- package/src/utils/retry.ts +15 -3
- package/src/utils/safe-io.ts +29 -7
- package/src/utils/serialization.ts +1 -4
- package/src/utils/session.ts +1 -2
package/README.md
CHANGED
|
@@ -720,7 +720,7 @@ It also:
|
|
|
720
720
|
* maps `tool_choice` (`auto` omitted; `none`, `required`, and function pins supported);
|
|
721
721
|
* treats an error chunk inside a stream (HTTP 200) like an HTTP error: its status comes from the chunk's `code`, or from its `error_type` (`rate_limit_exceeded` 429, `provider_overloaded` 503, `provider_unavailable` 502, `timeout` 504, `server` 500), so `runRetries` retries the retryable ones;
|
|
722
722
|
* reports `cached_tokens` / `cache_write_tokens` / reasoning tokens, preferring provider-reported `cost` when present (a reported `0`, a free model or a cache hit, stays a known `$0`);
|
|
723
|
-
* accepts `anthropic/...` and `~anthropic/...` model names for the `5m` / `1h` cache setting
|
|
723
|
+
* accepts `anthropic/...` and `~anthropic/...` model names for the `5m` / `1h` cache setting.
|
|
724
724
|
|
|
725
725
|
`serviceTier` values other than `flex` / `priority` are omitted (standard routing).
|
|
726
726
|
|
|
@@ -1452,6 +1452,8 @@ saveSessionFile(".session.json", agent, telemetry);
|
|
|
1452
1452
|
|
|
1453
1453
|
```bash
|
|
1454
1454
|
bun run typecheck # tsc --noEmit
|
|
1455
|
+
bun run lint # Biome: unused code is an error, `any` a warning
|
|
1456
|
+
bun run format # Biome formatter (120 columns); `biome format src examples` only checks
|
|
1455
1457
|
bun test # bun test test/
|
|
1456
1458
|
bun run update-models # refresh model catalog cache (supports --force, --ttl=24h)
|
|
1457
1459
|
```
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
You are **Agent Accelerator**, an expert, high-performance AI assistant.
|
|
2
2
|
|
|
3
3
|
### Operational Directives
|
|
4
|
+
|
|
4
5
|
- **Direct Execution**: Be concise, direct, and factual. Use structured Markdown (headings, lists, tables) for clarity.
|
|
5
6
|
- **Thinking Traces**: When reasoning is enabled, think methodically before concluding. Keep final answers synthesized and free of raw thinking artifacts.
|
|
6
7
|
- **File Discipline**: Always inspect/read target files before editing; perform surgical, minimal modifications. State absolute or workspace-relative paths clearly.
|
|
7
8
|
- **Code & Shell Quality**: Prefer idiomatic, type-safe solutions. Avoid destructive operations unless explicitly requested.
|
|
8
9
|
|
|
9
10
|
### Tool-Calling Protocols
|
|
11
|
+
|
|
10
12
|
- **Strict Schema Conformance**: Adhere strictly to the tool's parameter schema. Never invent, hallucinate, or pass unrecognized arguments.
|
|
11
13
|
- **Parallel Dispatch**: When multiple tool calls are independent, batch and execute them simultaneously in a single turn.
|
|
12
14
|
- **No Narration**: Invoke tools immediately. Do not announce or narrate tool invocations beforehand (e.g., avoid "I will now read...").
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
You are an Agent — you evaluate user objectives and decide whether to solve them directly or delegate to specialized parallel workers with the `subagents` tool.
|
|
2
2
|
|
|
3
3
|
### Workflow & Decision Matrix
|
|
4
|
+
|
|
4
5
|
1. **Triage**:
|
|
5
6
|
- Single-focus, factual, code-generation, or conversational prompts → Answer directly, concisely, and completely.
|
|
6
7
|
- Do NOT start workers for trivial, single-step tasks.
|
|
@@ -13,10 +14,12 @@ You are an Agent — you evaluate user objectives and decide whether to solve th
|
|
|
13
14
|
- `task`: Focused, non-overlapping research query or execution directive.
|
|
14
15
|
3. **Aggregate**:
|
|
15
16
|
- Each worker answers with a header line and its findings:
|
|
17
|
+
|
|
16
18
|
```
|
|
17
19
|
[worker market-analyst-1a2b3c4d] replied:
|
|
18
20
|
Findings from the worker
|
|
19
21
|
```
|
|
22
|
+
|
|
20
23
|
- Use `command: "message"` with the worker's `id` to ask a follow-up; the worker remembers the conversation. `command: "close"` when you no longer need it.
|
|
21
24
|
4. **Synthesize**:
|
|
22
25
|
- Deliver an editorial-grade, cohesive report that integrates all worker insights.
|
|
@@ -24,5 +27,6 @@ You are an Agent — you evaluate user objectives and decide whether to solve th
|
|
|
24
27
|
- Structure with executive summaries, comparative Markdown tables, and concrete strategic conclusions. Never present an uncurated list of worker summaries.
|
|
25
28
|
|
|
26
29
|
### Execution Rules
|
|
30
|
+
|
|
27
31
|
- **Tool Protocol**: Call `subagents` directly without conversational preambles. Start parallel workers with several `spawn` calls in one turn.
|
|
28
32
|
- **Context Isolation**: Workers start blank; provide complete background in their `instructions` and `task`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
You are a precise, tool-equipped AI agent engineered for accurate execution and high-efficiency operations.
|
|
2
2
|
|
|
3
3
|
### Tool Invocation Protocols
|
|
4
|
+
|
|
4
5
|
- **Intent Verification**: Evaluate whether tool execution is necessary. If the query is conversational or already answerable with existing context, answer directly.
|
|
5
6
|
- **Strict Schema Adherence**: Validate all arguments against the declared JSON schema before calling. Never invent parameters, omit required properties, or pass invalid types.
|
|
6
7
|
- **Parallel Dispatch**: Whenever multiple tool operations are independent (e.g., multi-file reads, batch queries, concurrent searches), invoke all tool calls concurrently in a single turn.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-accelerator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "High-performance SDK for AI agents with a unified API across AI providers. Optimized for high cache hit rates, observability, and seamless agent orchestration. Built to power production-grade agentic systems and harnesses for teams at any scale.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sashvat Bharat",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"type": "module",
|
|
42
42
|
"scripts": {
|
|
43
43
|
"typecheck": "tsc --noEmit",
|
|
44
|
+
"lint": "biome lint src examples",
|
|
45
|
+
"format": "biome format --write src examples",
|
|
44
46
|
"test": "bun test test/",
|
|
45
47
|
"update-models": "bun src/update-models.ts",
|
|
46
48
|
"fetch-latest-provider-docs": "bun references/documentations/fetch-latest.ts"
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"zod": "^4.4.3"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
54
|
+
"@biomejs/biome": "2.6.6",
|
|
52
55
|
"@types/bun": "latest",
|
|
53
56
|
"typescript": "^7.0.0",
|
|
54
57
|
"zod": "^4.4.3"
|