25 Commits
Author SHA1 Message Date
sausheong 4f5c07e538 Document Harness v0.6.3 in README 2026-10-04 07:24:38 +08:00
sausheong 1098ee0362 Document Harness v0.6.2 in README 2026-10-03 19:35:10 +08:00
sausheong 611198dc64 Document Harness v0.6.0 in README 2026-09-28 22:15:58 +08:00
sausheong 26f81ac21f feat: exa_search tool backed by the Exa Search API
ExaSearchTool (tools/web) calls POST https://api.exa.ai/search with
query-relevant highlights, optional category, domain and published-date
filters, and the shared SSRF-safe search client.
2026-09-28 15:13:10 +08:00
sausheong d47a71f779 feat: Stagehand natural-language browser tool
Add tools/stagehand, a browser tool built on the Stagehand Go SDK
(act/observe/extract/navigate/get_text/screenshot) with persistent named
sessions. Runs on local Chrome by default or Browserbase when an API key
is configured. Stagehand's internal inference is routed through the
harness LLMProvider via NewGenerateFunc, so it shares the agent's
provider, usage observers and admission guards.

The Stagehand SDK requires Go 1.26, so the module now declares go 1.26.0.
2026-09-28 01:25:08 +08:00
sausheong 1e5b6599bb Document Harness v0.4.2 response handling and tool events 2026-09-13 21:19:39 +08:00
sausheong 036fe1e547 Document Harness v0.4.0 capabilities 2026-09-10 07:45:54 +08:00
sausheong 0972eed3ea Harden Harness runtime, persistence and execution for Hand 2026-09-09 22:55:55 +08:00
sausheong 09c30fe2d5 Update README: bump stale version references to v0.3.9
Both "Status" mentions were still pinned at v0.3.6 (three releases
behind). Also documents Runtime.DynamicIdentityHint in the components
table — added this session, previously undocumented outside code
comments.
2026-09-07 21:06:05 +08:00
sausheong 50b791d3b6 Rename providers/ollama to providers/local
Ollama is one local-model server among several (LM Studio, llama.cpp's
server, vLLM, ...) that all speak the same OpenAI-compatible shape —
naming the package (and provider name downstream) after one of them
was misleading. Same constructor, same default endpoint (Ollama's,
being the most common), just generically named: NewLocalProvider.

This renames a package published minutes ago in v0.3.8 with no other
known consumers yet, so no compatibility shim is kept.
2026-09-07 13:27:58 +08:00
sausheong 3b5aadb31f Add an ollama provider for local models
Thin constructor over the existing OpenAI-compatible path, same shape
as litellm/openrouter: NewOllamaProvider(baseURL) defaults to Ollama's
local endpoint (http://localhost:11434/v1) and needs no API key, since
Ollama doesn't authenticate requests. Also covers other local servers
that share Ollama's OpenAI-compatible endpoint shape (LM Studio,
llama.cpp's server, vLLM).
2026-09-07 11:57:56 +08:00
sausheong f624e4c7bd Replace Qwen provider with LiteLLM and OpenRouter aggregators
Adding one bespoke provider package per vendor doesn't scale. LiteLLM
proxy and OpenRouter both speak the OpenAI chat-completions wire
format and each front dozens-to-hundreds of underlying models, so
supporting them once gets that whole catalog instead of one more
one-off integration — providers/qwen turns out to have been exactly
that pattern hand-rolled a second time (its own copy of the
OpenAI-compatible translation, just pointed at DashScope's base URL).

providers/litellm and providers/openrouter are both thin constructors
over the OpenAI provider's existing NewOpenAIProviderWithKind(apiKey,
baseURL, "openai-compatible") — no new request/stream-translation code.
OpenRouter defaults to its public endpoint when baseURL is empty;
LiteLLM has none (self-hosted), so callers must supply one.

Context-window detection (tokens.ContextWindow) already keys off the
model ID's family rather than the provider prefix, specifically so a
model exposed under a custom/proxy provider name still gets the right
window — so litellm/openrouter models need zero changes there.
2026-09-06 16:13:30 +08:00
sausheong 986c233d39 fix: preserve native Anthropic inference controls 2026-08-17 03:43:30 +08:00
sausheong 8e92125fb6 docs: bump README to v0.3.5 2026-08-02 10:18:14 +08:00
sausheong eb4fa67976 fix: harden runtime against panics/races, close path-traversal and fail-open gaps
- Runtime.Run rejects concurrent invocations instead of racing on shared state; panics in tools, hooks, and permission checkers are recovered and surfaced as errors/denials instead of crashing the loop
- AgentSpec.Loop now actually overrides RuntimeDeps.AgentLoop per-agent, as documented
- session.Store validates agent ID / session key as single path components, preventing traversal outside the session directory
- ValidatePathInWorkDir resolves symlinks on the target itself, not just its parent, closing a workspace-escape gap
- bash tool now fails closed on an unrecognized ExecPolicy.Level instead of allowing everything
- browser tool rejects unknown actions instead of silently no-op'ing

Bump README to v0.3.4 and document the AgentSpec.Loop override semantics.
2026-08-02 10:14:20 +08:00
sausheong c2af8f389d examples: add self-improving-agent + v0.2.0 README updates 2026-05-09 16:34:44 +08:00
sausheong cc0406d30c Sharpen README: when to use Harness, and for what
Removes the standalone comparison.md (analysis kept locally only) and
folds its key positioning insights into the README without naming
specific competitors.

Why-Harness section:
- Reframes the substrate-vs-DSL distinction more directly: the
  runtime is treated as strategic infrastructure you own, not as
  plumbing hidden behind a graph builder.
- Capitalises 'Harness' in prose to match the project name.

New 'What Harness is for' section enumerates the use cases the
runtime is shaped around:
  - coding agents
  - infrastructure-automation agents
  - long-running autonomous loops
  - local-first agents
  - tool-heavy agents
  - developer-tooling agents
Plus a one-paragraph note on why Go's operational profile (static
binary, low memory, native concurrency, embeddability) matters
for these.

New 'When Harness is the wrong fit' section names the workflow
shapes the package isn't optimised for — visual / declarative
workflows, role-based crews, RAG-first products, notebook research,
heavily-regulated enterprise orchestration — without naming any
competing framework.

The existing 'Non-goals' section still covers what the library
doesn't ship (CLI, UI, channel adapters, etc.); the two sections
serve adjacent purposes.
2026-05-08 15:06:24 +08:00
sausheong 4df84b76d0 Add comparison.md surveying Harness against the agent-framework landscape
New top-level document comparing Harness's approach against LangGraph,
CrewAI, AutoGen/AG2, Semantic Kernel, OpenAI Agents SDK, Claude Agent
SDK, LlamaIndex, Mastra, and the Go peers eino + langchaingo.

Frames Harness as a runtime-centric, in-process Go library closer in
spirit to coding-agent runtimes (Claude Code, OpenClaw, OpenHands)
than to graph-based or role-based orchestration frameworks. Includes
current GitHub stats, per-framework architectural comparisons, the
language-choice tradeoff, the abstraction-fatigue trend, and where
Harness is the right (and wrong) pick.

README links to it next to the developer.md pointer; .gitignore
whitelists comparison.md alongside the other tracked docs.
2026-05-08 14:59:39 +08:00
sausheong 7e9801bf9c Remove upstream-project attribution from docs and code comments
Strips references to the upstream npm-package agent harness from
README design notes, developer.md, the compaction package, the
runtime context/streaming comments, and the tools/mcp adapter
doc-comments. The technical patterns being described stand on their
own; the attribution chain isn't needed.

Remaining mentions of the word in the providers/anthropic package
are literal Anthropic model identifiers (the 'claude-…' API model
strings) — those are functional product names, not attribution.
2026-05-08 13:43:10 +08:00
sausheong fa61dbdf77 Prepare for v0.1.0 release
Update Status section to reflect first tagged release: switch the
top-of-README badge to "v0.1.0" and the bottom Status block to a
go-get install hint plus pointer to GitHub releases for the changelog.
2026-05-08 13:34:00 +08:00
sausheong 50cbc74865 minor update 2026-05-08 13:34:00 +08:00
sausheong 76c03019c8 Add hooks and MCP as first-class components; expand docs
Promotes the two remaining "deliberately not in scope" components from
the harness model to first-class subsystems, and overhauls the docs.

Hooks (runtime/types.go, runtime/runtime.go, runtime/hooks_test.go):
- New runtime.LifecycleHooks struct on LoopConfig.Hooks with five
  Go callbacks: OnUserPromptSubmit (may rewrite prompt),
  OnSessionStart, BeforeToolUse (gating with same shape as
  PermissionChecker), AfterToolUse (observe), OnStop (with reason:
  completed/max_turns/error/aborted).
- Wired into Run, dispatchTool, executeToolKickoff at all 8 exit
  points + both tool-execution paths.
- 8 tests covering each hook firing.

MCP (tools/mcp/, runtime/builder.go, runtime/types.go):
- New tools/mcp package using the official
  github.com/modelcontextprotocol/go-sdk v1.5.0. Stdio and
  Streamable HTTP transports.
- ServerConfig now exposes Headers + HTTPClient for HTTP auth
  (static bearer, OAuth via oauth2.NewClient, mTLS, custom
  RoundTripper). Header injection clones requests so SDK retries
  see clean params.
- First-class AgentSpec.MCPServers — BuildRuntime connects each
  server, registers adapter tools (mcp__<server>__<tool>), stashes
  clients on Runtime.
- New Runtime.Close() releases sessions; idempotent.
- 14 tests including end-to-end header propagation through the SDK
  via httptest.Server.

Examples:
- support-agent now demonstrates Skills + Permission + LifecycleHooks
  together. Audit log via AfterToolUse + OnStop, JSONL output.
- defer rt.Close() added to all four examples (no-op without MCP,
  idiomatic).

Docs:
- README expanded: Why harness, Requirements, Install, Examples
  table, Configuration (env vars), Non-goals, Testing, expanded
  Status. Quick Start fixed to use real BuildRuntime API.
- developer.md mental-model diagram replaced with two correct ones:
  composition (how a Runtime is wired) and per-Run sequence (what
  rt.Run actually does, including hook fan-out and the tool batch
  loop).
- developer.md gains Lifecycle hooks + MCP servers subsections with
  full snippets, including Streamable HTTP auth and OAuth recipes
  (clientcredentials + authcode flows via golang.org/x/oauth2).
- LICENSE file added (MIT).

All 18 packages build and test green.
2026-05-08 13:34:00 +08:00
sausheong 4b2f645f16 Document harness components and design notes in README 2026-05-08 00:44:55 +08:00
sausheong 123a233cb7 Drop Felix references; harness stands as a platform on its own
Removes every Felix mention from public-facing surfaces so the framework
reads as a standalone agent platform rather than an extracted module.

User-visible changes:
- HTTP User-Agent on web_fetch / web_search: Felix/1.0 → harness/1.0
- bash tool path-substitution prefix: '[felix]' → '[harness]'
- On-disk paths: <workspace>/.felix/ → <workspace>/.harness/
  (todos.json + spill/ tree); tests updated in lockstep.
- OTel trace attributes: felix.trace_id / felix.total_ms /
  felix.phase_count → harness.* equivalents.

Doc-comment changes:
- Examples (lta-agent, data-agent) lose 'non-Felix consumer' framing.
- README drops the 'extracted from Felix' lede and the 'What was lifted
  from Felix' section, replaced with a 'Design' overview that points
  to developer.md.
- Runtime / tool / compaction doc comments rewritten so behaviour
  notes describe what the harness does without naming the prior origin.
- Test-fixture text 'you are felix' → 'you are an assistant'.

Verified: zero 'felix' (case-insensitive) in tracked .go / .md files.
All 16 packages build and pass tests.
2026-05-08 00:24:06 +08:00
sausheong 1f2c471ff9 Initial commit: Go agentic harness extracted from Felix 2026-05-07 11:31:42 +08:00