Commit Graph

124 Commits

Author SHA1 Message Date
Ibrahim Kazimov dfe46721a5 feat: add cli 2026-04-12 20:12:16 +03:00
JackChen 0f16e81ae6
Merge pull request #105 from JackChen-me/chore/feature-request-source-field
chore: add source field to feature request template
2026-04-12 23:25:51 +08:00
JackChen 5804a54898 chore: add source field to feature request issue template
Helps maintainers triage by requiring contributors to indicate where
the idea originated (real use case, competitive reference, systematic
gap, or external discussion).
2026-04-12 23:23:42 +08:00
JackChen 252419e1f8
Merge pull request #104 from JackChen-me/fix/issue-99-100-101-abort-signal-propagation
fix: propagate AbortSignal through tools, Gemini adapter, and abort queue path
2026-04-12 23:22:15 +08:00
JackChen 6ea66afab5 fix: propagate AbortSignal through tool execution, Gemini adapter, and abort queue path (#99, #100, #101)
- #99: pass per-call effectiveAbortSignal to buildToolContext() so tools
  receive the correct signal instead of the static runner-level one
- #100: replace manual pending-task loop with queue.skipRemaining() on
  abort, fixing blocked tasks left non-terminal and missing events
- #101: forward abortSignal in Gemini adapter's buildConfig() so the
  SDK can cancel in-flight API calls
- Add 8 targeted tests for all three fixes
2026-04-12 23:20:30 +08:00
JackChen 97c5e457dd
Merge pull request #103 from JackChen-me/fix/issue-98-run-error-propagation
fix: propagate error events in AgentRunner.run()
2026-04-12 22:22:22 +08:00
JackChen 9b04fbf2e5
Merge pull request #102 from ibrahimkzmv/feat.add-glob-tool
feat: add glob tool
2026-04-12 22:21:43 +08:00
JackChen 9a446b8796 fix: propagate error events in AgentRunner.run() (#98)
run() only handled 'done' events from stream(), silently dropping
'error' events. This caused failed LLM calls to return an empty
RunResult that the caller treated as successful.
2026-04-12 22:16:33 +08:00
Ibrahim Kazimov dc88232885 feat: add glob tool 2026-04-12 16:59:20 +03:00
JackChen ced1d90a93
Merge pull request #89 from ibrahimkzmv/feat.mcp-tool-integration
feat: add connectMCPTools() to register MCP server tools as standard agent tools
2026-04-12 17:05:31 +08:00
JackChen 0fb8a38284
Merge pull request #88 from ibrahimkzmv/feat.context-strategy
feat: Add contextStrategy to control conversation growth and prevent token explosion in agent runs
2026-04-12 16:54:41 +08:00
MrAvalonApple 629d9c8253 feat: implement synthetic framing for user messages and enhance context strategy handling 2026-04-12 00:18:36 +03:00
Ibrahim Kazimov 167085c3a7
Merge branch 'main' into feat.mcp-tool-integration 2026-04-12 00:03:18 +03:00
MrAvalonApple 12dd802ad8 feat: update MCP GitHub example and added llmInputSchema 2026-04-12 00:01:22 +03:00
JackChen 1fbed196ca Revert "ci: add release workflow triggered by v*.*.* tags" 2026-04-11 15:25:24 +08:00
JackChen a220b6ecc5 ci: add release workflow triggered by v*.*.* tags 2026-04-11 15:23:41 +08:00
JackChen 89311dc4d4 chore: release 1.1.0 2026-04-11 15:15:15 +08:00
JackChen 06cc415ddf
docs: rewrite README top fold and trim Examples section (#95)
Strategic rewrite following docs/project-evaluation-2026-04-09.md.
README.md and README_zh.md updated in lockstep.

Top fold changes:
- New tagline positioning against CrewAI and LangGraph
- Replace 11-bullet "Why" with 3 bullets (runTeam / 3 deps / multi-model)
- New Philosophy section with "we build / we don't build / tracking"
- "We don't build" limited to handoffs and checkpointing (softened);
  Cloud/Studio bullet dropped to preserve future Hosted option
- New "How is this different from X?" FAQ covering LangGraph JS, CrewAI,
  and Vercel AI SDK
- New "Used by" section with three early-stage integrations, framed
  honestly for a new project (temodar-agent, rentech-quant-platform,
  cybersecurity SOC home lab)

Examples section:
- Shrink 15-row catalog table to 4 featured entries + link to examples/
- Featured: 02 team collaboration, 06 local model, 09 structured output,
  11 trace observability
- Eliminates maintenance debt of updating the table on every new example

Refinements during alignment pass:
- Launch date corrected to 2026-04-01 (matches first commit timestamp)
- Surface Gemini @google/genai peer dep in top fold and Providers table
- Rephrase "Agent handoffs" bullet to avoid reading as single-agent framework
- Update prose example to Opus 4.6 / GPT-5.4 / local Gemma 4
- Quick Start code example shortened ~30% (developer/reviewer collapsed
  to stubs, still demonstrates multi-agent team shape)
- Remove CrewAI endorsement stats (48K stars / Andrew Ng / $18M) to keep
  comparisons technical
- Drop Star History cache-buster since growth has stabilized; bump
  contributors cache-buster to max=20 so all 8 contributors render
- Delete Author section; shrink Contributing to Examples + Documentation

Small carry-over fixes:
- Fix duplicated task_complete line in Quick Start output sample
- Add AgentPool.runParallel() note to Three Ways to Run
- Update source file count 33 → 35

Kept unchanged per scope:
- Architecture diagram, Built-in Tools, Supported Providers

Does not touch source code or package.json.
2026-04-11 14:19:03 +08:00
Ibrahim Kazimov aa5fab59fa
feat: enforce dependency-scoped agent context (default-deny) (#87)
Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-10 03:09:58 +08:00
MrAvalonApple 7aa1bb7b5d feat: add connectMCPTools() to register MCP server tools as agent tools 2026-04-09 20:05:20 +03:00
MrAvalonApple eb484d9bbf feat: add context management strategies (sliding-window, summarize, custom) to prevent unbounded conversation growth 2026-04-09 19:40:15 +03:00
JackChen f1c7477a26 docs: fix MCP tracking issue link to #86 2026-04-09 03:29:58 +08:00
JackChen 664bed987f docs: restructure DECISIONS.md to signal openness on MCP and A2A
Split decisions into "Won't Do" (handoffs, checkpointing) and "Open to
Adoption" (MCP, A2A). Feature parity is a race that can be caught;
network effects from protocol adoption create a different kind of moat.

- MCP marked as "Next up" with optional peer dependency approach
- A2A marked as "Watching" with clear adoption trigger criteria
2026-04-09 03:16:38 +08:00
JackChen 2022882bfb
Merge pull request #85 from ibrahimkzmv/feat.customizable-coordinator
feat: make coordinator configurable (model, prompt, tools, and runtime options)
2026-04-08 18:56:12 +08:00
MrAvalonApple 0b57ffe3e9 feat: enhance CoordinatorConfig with toolPreset and disallowedTools options 2026-04-08 12:34:25 +03:00
JackChen 03dc897929 fix: eliminate duplicate progress events and double completedTaskCount in short-circuit path (#82)
The short-circuit block in runTeam() called this.runAgent(), which emits
its own agent_start/agent_complete events and increments completedTaskCount.
The short-circuit block then emitted the same events again, and
buildTeamRunResult() incremented the count a second time.

Fix: call buildAgent() + agent.run() directly, bypassing runAgent().
Events and counting are handled once by the short-circuit block and
buildTeamRunResult() respectively.
2026-04-08 12:49:13 +08:00
JackChen cb11020c65 chore: rename research aggregation example to 15- (avoid collision with 14-) 2026-04-08 12:14:23 +08:00
JackChen 91494bcca9
Merge pull request #79 from mvanhorn/osc/76-research-aggregation
feat: add multi-source research aggregation example
2026-04-08 12:13:48 +08:00
JackChen faf24aaffa chore: rename example to 14- prefix and fix misleading shared memory prompts
The agent system prompts and task descriptions implied agents could
explicitly read/write shared memory keys, but the framework handles
this automatically. Simplified to match actual behavior.
2026-04-08 12:08:54 +08:00
JackChen d8c3808851
Merge pull request #80 from mvanhorn/osc/75-multi-perspective-review
feat: add multi-perspective code review example
2026-04-08 12:01:38 +08:00
Matt Van Horn 54bfe2ed2d fix: address review feedback on research aggregation example
- Fix handleProgress: use underscore event types (task_start/task_complete)
  and correct property names (event.task/event.agent) per OrchestratorEvent
- Remove Task[] annotation (Task requires id, status, createdAt, updatedAt)
- Rename 13-research-aggregation.ts to 14-research-aggregation.ts
- Remove shared memory key references from prompts (framework handles this)
- Add header note differentiating from example 07 (runTasks vs AgentPool)
2026-04-07 18:22:31 -07:00
Matt Van Horn 40f13a09a6 fix: correct event types, properties, and Task annotation
- Use 'task_start'/'task_complete' (underscores) instead of colons
- Use event.task/event.agent instead of non-existent taskTitle/agentName
- Remove Task import; runTasks() accepts a lighter inline type
2026-04-07 16:46:50 -07:00
MrAvalonApple 30369b0597 feat: add customizable coordinator options for runTeam and enhance system prompt 2026-04-07 22:11:27 +03:00
JackChen dc8cbe0262 chore: bump contrib.rocks cache version to refresh contributors 2026-04-08 02:08:32 +08:00
Ibrahim Kazimov 97c39b316c
feat: add tool allowlist, denylist, preset list (#83)
* feat: add allowlist denylist and preset list for tools

* feat: update readme and add AGENT_FRAMEWORK_DISALLOWED

* fix: update filtering logic to allow custom tools

* fix: enhance tool registration and filtering for runtime-added tools

---------

Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-08 02:04:40 +08:00
JackChen 48fbec6659
Merge pull request #70 from EchoOfZion/feature/smart-shortcircuit
feat: skip coordinator for simple goals in runTeam()
2026-04-07 23:52:16 +08:00
EchoOfZion 9463dbb28e refactor(orchestrator): address PR #70 review feedback
Addresses all five review points from @JackChen-me on PR #70:

1. Extract shared keyword helpers into src/utils/keywords.ts so the
   short-circuit selector and Scheduler.capability-match cannot drift.
   Both orchestrator.ts and scheduler.ts now import the same module.

2. selectBestAgent now mirrors Scheduler.capability-match exactly,
   including the asymmetric use of agent.model: agentKeywords includes
   model, agentText does not. This restores parity with the documented
   capability-match behaviour.

3. Remove isSimpleGoal and selectBestAgent from the public barrel
   (src/index.ts). They remain exported from orchestrator.ts for unit
   tests but are no longer part of the package API surface.

4. Forward the AbortSignal from runTeam(options) through the
   short-circuit path. runAgent() now accepts an optional
   { abortSignal } argument; runTeam's short-circuit branch passes
   the caller's signal so cancellation works for simple goals too.

5. Tighten the collaborate/coordinate complexity regexes so they only
   fire on imperative directives ("collaborate with X", "coordinate
   the team") and not on descriptive uses ("explain how pods
   coordinate", "what is microservice collaboration").

Also fixes a pre-existing test failure in token-budget.test.ts:
"enforces orchestrator budget in runTeam" was using "Do work" as its
goal which now short-circuits, so the coordinator path the test was
exercising never ran. Switched to a multi-step goal.

Adds 60 new tests across short-circuit.test.ts and the new
keywords.test.ts covering all five fixes.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 21:46:03 +09:00
EchoOfZion cfbbd24601 feat: skip coordinator for simple goals in runTeam()
When a goal is short (<200 chars) and contains no multi-step or
coordination signals, runTeam() now dispatches directly to the
best-matching agent — skipping the coordinator decomposition and
synthesis round-trips. This saves ~2 LLM calls worth of tokens
and latency for genuinely simple goals.

Complexity detection uses regex patterns for sequencing markers
(first...then, step N, numbered lists), coordination language
(collaborate, coordinate, work together), parallel execution
signals, and multi-deliverable patterns.

Agent selection reuses the same keyword-affinity scoring as the
capability-match scheduler strategy to pick the most relevant
agent from the team roster.

- Add isSimpleGoal() and selectBestAgent() (exported for testing)
- Add 35 unit tests covering heuristic edge cases and integration
- Update existing runTeam tests to use complex goals

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 21:21:36 +09:00
Matt Van Horn 0fd18d8a19 feat: add multi-perspective code review example
Adds an example showing a generator agent producing code, then
three reviewer agents (security, performance, style) analyzing it
in parallel, followed by a synthesizer merging all feedback into
a prioritized action item report.

Closes #75
2026-04-07 03:16:27 -07:00
Matt Van Horn 34ca8602d0 feat: add multi-source research aggregation example
Demonstrates parallel analyst execution with dependency-based
synthesis using runTasks(), sharedMemory, and dependsOn:

1. Three analyst agents research the same topic in parallel
   (technical, market, community perspectives)
2. Synthesizer waits for all analysts via dependsOn, reads
   shared memory, cross-references findings, and produces
   a unified report

Fixes #76
2026-04-07 02:52:23 -07:00
JackChen 607ba57a69
Merge pull request #77 from JackChen-me/fix/per-agent-serialization-72
fix: add per-agent mutex to prevent concurrent runs on same Agent instance
2026-04-07 11:20:40 +08:00
JackChen 5a67d559a3 chore: update .gitignore and revise MCP decision in DECISIONS.md 2026-04-07 11:20:32 +08:00
JackChen a29d87f384 docs: update CLAUDE.md concurrency section for per-agent mutex 2026-04-07 10:46:08 +08:00
JackChen 73b2454c2f fix: add per-agent mutex to prevent concurrent runs on same Agent instance (#72)
AgentPool now maintains a per-agent Semaphore(1) that serializes
concurrent run() calls targeting the same Agent. This prevents
shared-state races on Agent.state (status, messages, tokenUsage)
when multiple independent tasks are assigned to the same agent.

Lock acquisition order: per-agent lock first, then pool semaphore,
so queued tasks don't waste pool slots while waiting.
2026-04-07 03:42:24 +08:00
Ibrahim Kazimov 60fb2b142e
feat: implement token budget management in agent and orchestrator (#71)
* feat: implement token budget management in agent and orchestrator

* fix: resolve TypeScript type errors in event and trace handlers

* feat: add budget exceeded event handling in agent and orchestrator

---------

Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-06 23:14:08 +08:00
JackChen 1e3bd1013e fix: correct Team constructor usage in abort-signal tests 2026-04-06 12:54:24 +08:00
Jason 336d94e50d
feat: add AbortSignal support to runTeam() and runTasks() (#69)
Fixes #61

Thread AbortSignal from the top-level API through RunContext to
executeQueue(), enabling graceful cancellation in Express, Next.js,
serverless, and CLI scenarios.

Changes:
- Added optional  to RunContext interface
-  now accepts
-  now accepts
- executeQueue() checks signal.aborted before each dispatch round
  and skips remaining tasks when cancelled
- Signal is forwarded to coordinator's run() and per-task pool.run()
  so in-flight LLM calls are also cancelled
- Full backward compatibility: both methods work without options

The abort infrastructure already existed at lower layers
(AgentRunner, Agent, AgentPool) — this commit bridges the last gap
at the orchestrator level.

Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
2026-04-06 12:49:01 +08:00
JackChen d59898ce3d
docs: update coverage badge from 71% to 88% (#57) 2026-04-05 14:34:29 +08:00
JackChen c23a20bb6c
test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56)
- Add contract tests for Anthropic, OpenAI, Gemini, Copilot adapters
- Add optional E2E test suite (tests/e2e/, run with npm run test:e2e)
- Add shared test fixtures (tests/helpers/llm-fixtures.ts)
- Configure vitest to exclude e2e tests by default
- Add "files" field to package.json to reduce npm package size by 50%
- Align npm description with GitHub repo description
- Bump version to 1.0.1
2026-04-05 14:14:43 +08:00
JackChen c6b971bc19 chore: bump version to 1.0.0 2026-04-05 13:41:07 +08:00