codex/increment-4768
18 次代码提交
| 作者 | SHA1 | 备注 | 提交日期 | |
|---|---|---|---|---|
|
|
0595130f16 |
run: surface MCP tools in the micro run banner by default (#3434)
The gateway already serves /mcp/tools on :8080 unconditionally (every endpoint is an AI-callable tool), but the startup banner only printed an MCP line when --mcp-address was set — so the live `micro run` experience hid the harness's signature feature even though it was running, and didn't match the README. Always advertise MCP Tools on the gateway address; keep the optional standalone MCP-protocol server (--mcp-address) as a clearly separate line. No behavior change — banner output only. Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
3e885308a0 |
lint: clear the golangci-lint backlog and enforce a blocking lint in CI (#2995)
Fixes #2988. Brings 'golangci-lint run ./...' to zero issues (was ~373): - errcheck: explicitly ignore fire-and-forget calls with '_ =' (and a small errcheck.exclude-functions list for response writes — json Encoder.Encode, http ResponseWriter.Write, fmt.Fprint*); genuine cases handled. - unused: remove dead code (unexported decls and dead test helpers) and the imports they orphaned. - staticcheck: ST1005 error strings, ST1016 receiver names, S1000/S1017/S1019/ S1023 simplifications, SA4004/SA4006/SA4010 dead code, SA1021 net.IP.Equal, SA6002 (store *[]byte in sync.Pool). - govet: fix a context leak (lostcancel) in internal/util/mdns and move t.Fatal/Fatalf out of goroutines (testinggoroutine) in tests. - ineffassign, unconvert: mechanical fixes. CI: the Lint workflow now runs a blocking full-tree 'golangci-lint run' on pushes and PRs (dropped only-new-issues now that the tree is clean). Verified: go build, go vet, test compilation, and unit tests for the behaviourally-touched packages all pass. Claude-Session: https://claude.ai/code/session_01CmdEY7pYmV5zzwCjNJ4ykL Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
4311b73361 |
Enhance ADK vs Go Micro comparison and apply lint fixes (#2994)
* docs: compare Go Micro with Google ADK in the comparison guide Adds a 'vs Agent Frameworks (Google ADK)' section: ADK builds an agent, Go Micro builds the distributed system the agent lives in (agents are services in the mesh). Covers the category difference, a feature table, when to choose each, and MCP/A2A interoperability. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmdEY7pYmV5zzwCjNJ4ykL * docs: replace ADK comparison slogan with concrete explanation State plainly what each tool provides (ADK builds an agent process; Go Micro builds the surrounding service mesh) instead of marketing phrasing. * lint: apply golangci-lint autofixes; exclude ST1003 and demo errcheck Mechanical, behaviour-preserving fixes applied by 'golangci-lint run --fix': gofmt, misspell (US spelling), usestdlibvars (http.Method*/Status*), unconvert, and the auto-fixable staticcheck simplifications (QF*, S1017/S1019/S1023/S1039). Config: exclude ST1003 (remaining offenders are exported API renames, e.g. web.Id, which would break compatibility) and skip errcheck for examples/ and internal/harness/ (demo code where fire-and-forget is intentional). Build and test compilation verified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmdEY7pYmV5zzwCjNJ4ykL * lint: WIP cleanup checkpoint (errcheck config + partial fixes) Checkpoint of an in-progress golangci-lint cleanup (background pass). Builds cleanly; lint is not yet zero. Follow-up commit will complete the cleanup and switch CI to a blocking full-tree lint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CmdEY7pYmV5zzwCjNJ4ykL --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
c7657f73f4 |
Refactor agent plan storage, update docs, and release v6 (#2977)
goreleaser / goreleaser (push) Has been cancelled
* test(harness): read agent plan from the scoped store
The store-scoping change moved an agent's plan from the default table
key agent/{name}/plan to its own table (database "agent", table {name},
key "plan"). The plan-delegate harness tests still read the old key and
failed with 'not found'; read through store.Scope(mem, "agent", name)
like the agent does.
* docs: orient agents-first across README, landing, and docs overview
Lead with agents (then services and flows), surface MCP + A2A as the
interop story, and frame agents as services. Landing hero and feature
grid reordered agents-first with an A2A gateway card.
* v6: module path go-micro.dev/v6, TLS secure by default, NewService
Cut v6. Three breaking changes, bundled so the major bump is paid once:
- Module path go-micro.dev/v5 -> go-micro.dev/v6 across all imports + go.mod.
- TLS verification on by default (was off). MICRO_TLS_SECURE removed;
MICRO_TLS_INSECURE=true opts out for self-signed/dev.
- micro.NewService(name, opts...) is the canonical service constructor,
symmetric with NewAgent/NewFlow; micro.New kept as a deprecated alias;
the old name-less NewService(opts...) removed. Generators emit NewService.
Also ports the JWT auth token provider in-module (go-micro.dev/v6/auth/jwt/token
on golang-jwt/jwt/v5), dropping the v5-pinned github.com/micro/plugins/v5/auth/jwt
and the deprecated dgrijalva/jwt-go.
Docs/README/landing updated to v6 and @latest; v5->v6 migration guide added;
CHANGELOG cut as [6.0.0]. Blog posts left at their historical versions.
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
9bed04ced0 |
Enhance micro run with interactive console and image compression (#2948)
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled
* perf: compress hero image — 1.4MB to 80KB Resized from 1536px to 1200px, converted to JPEG at quality 80. 80KB loads instantly vs 1.4MB stalling on slower connections. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * docs: micro run drops into interactive console One command does everything — generate, start, and chat. No separate micro chat step. The landing page shows micro run dropping straight into the > prompt. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: interactive console in micro run, -d for detached mode micro run now drops into an interactive chat console after services start. The console discovers services, exposes them as tools, and lets you talk to them through an LLM — same as micro chat but built into the run experience. - Detects MICRO_AI_PROVIDER and MICRO_AI_API_KEY from environment - Falls back to provider-specific env vars (ANTHROPIC_API_KEY, etc.) - If no API key, prints hint and blocks on Ctrl-C (no console) - -d / --detach flag skips the console (background mode) - Ctrl-C always shuts everything down Removed adopters section from README. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
1bc886fa82 |
Introduce Agent abstraction and integrate with chat router (#2939)
* docs: Agent interface design sketch Proposes Agent as a top-level abstraction alongside Service in the micro package. Agent manages services — scoped tools, system prompt, conversation memory, registry-discoverable. Design only, no implementation. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: Agent as a first-class abstraction Introduce micro.NewAgent() alongside micro.New() — Agent is to intelligence what Service is to capability. Agent interface: - Chat(ctx, message) (*Response, error) — core interaction method - Run() — registers in registry, subscribes to broker, blocks - Stop() — graceful shutdown - Scoped tools — only sees endpoints of its assigned services - Persistent memory — conversation history stored in store - Agent-to-agent — communication via broker topics Top-level API: agent := micro.NewAgent("task-mgr", micro.AgentServices("task"), micro.AgentPrompt("You manage tasks."), micro.AgentProvider("anthropic"), ) agent.Run() https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: wire agents into chat router, add micro agent CLI, expose Flow Three top-level abstractions: micro.New("task") — Service (capability) micro.NewAgent("task-mgr") — Agent (intelligence) micro.NewFlow("onboard-user") — Flow (event-driven orchestration) micro chat as router: - Discovers agents from registry on startup - Single agent: routes directly - Multiple agents: LLM classifies intent, dispatches to right agent via route_to_agent tool - No agents: falls back to current direct-service behaviour - Banner shows discovered agents micro agent CLI: - micro agent list — shows registered agents and their services - micro agent describe <name> — shows agent details from registry https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: move flow to top level, update docs for three abstractions Package structure now consistent: service/ — Service (capability) agent/ — Agent (intelligence) flow/ — Flow (event-driven orchestration) ai/flow/ kept as backward-compatible re-export. Updated across all surfaces: - CLAUDE.md: added agent/ and flow/ to project structure - README: added "Building Agents" section with NewAgent() examples, updated features table (Agents, Flows, Chat router), CLI table (agent list, agent describe), docs links - Website: features grid shows Services, Agents, Flows as the three pillars alongside generation, MCP, and pluggable architecture - micro.go: Flow imported from top-level flow/ package https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * docs: rewrite getting-started, fix ai-integration import paths Getting started now covers all three abstractions: - Service (write handlers, micro run, templates) - Agent (micro.NewAgent, scoped tools, memory, CLI) - Flow (event-driven LLM orchestration) Leads with prompt-based generation, then manual service creation. ai-integration.md: fixed flow import path from go-micro.dev/v5/ai/flow to go-micro.dev/v5/flow, updated stack diagram to show agent/flow/chat. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * blog: Introducing micro.NewAgent() Post 16 — announces Agent as a first-class abstraction. Shows the API (NewAgent, AgentServices, AgentPrompt, AgentProvider), scoped tools, persistent memory, multi-service agents, multi-agent systems, and the three-abstraction comparison table (Service/Agent/Flow). https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: fix agent registration, blog post 16 Agent registration: - Add node with address so mDNS can discover agents - Store type and services in node metadata (mDNS requirement) - Connect broker before subscribing, non-fatal if broker unavailable - Print registration confirmation on Run() Agent/chat discovery: - Check both service-level and node-level metadata for type=agent (mDNS stores metadata on nodes, not services) Blog post 16: "Introducing micro.NewAgent()" — announces the Agent abstraction with code examples, comparison table, multi-agent patterns. Tested end-to-end: micro run → micro agent list discovers the agent → micro chat routes to it → agent calls service endpoints. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: agents are proper services with RPC Chat endpoint Refactored agent to use server.Server instead of fake registry entries. An agent now: - Creates a real RPC server with server.Name(agentName) - Registers an Agent.Chat handler callable via standard RPC - Sets server metadata type=agent, services=x,y for discovery - No more fake addresses or broker hacks micro chat calls agents via RPC (client.Call) instead of creating local agent instances. The registry stays clean — agents are real services with real endpoints. Removed broker dependency from agent options. Agent-to-agent communication is just RPC like everything else. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: agent uses proto-defined RPC interface Added agent/proto/agent.proto with Agent service definition: rpc Chat(ChatRequest) returns (ChatResponse) Agent now implements the generated AgentHandler interface and registers via pb.RegisterAgentHandler. The Chat endpoint is a standard proto-based RPC callable by any go-micro client. Renamed the programmatic API from Chat() to Ask() to avoid collision with the proto handler method name. micro chat calls agents via standard RPC with JSON-encoded request/response — no special types needed on the caller side. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd * feat: generate agent alongside services, update all docs micro run --prompt now generates an agent binary that manages all the generated services. The agent reads MICRO_AI_PROVIDER and MICRO_AI_API_KEY from the environment. micro run propagates these when started with --prompt. Run banner shows services and agents separately. Updated README, getting-started guide, and landing page to show the complete flow: generate → services + agent start → micro chat routes to agent → agent orchestrates services. https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
d3c4981326 |
Enhance AI service generation with prompt-based architecture and logic (#2926)
goreleaser / goreleaser (push) Has been cancelled
* feat: add micro new --prompt and micro run --prompt
Add AI-powered service generation: describe a system in natural
language and get real go-micro services with proto definitions,
handlers, doc comments, and MCP support.
micro new --prompt "a contact book with notes and tags" \
--provider anthropic
Generates:
contacts/ — CRUD service with name, email, phone fields
notes/ — notes linked to contacts
tags/ — tagging system
Each service gets:
proto/{name}.proto — domain model + CRUD endpoints
handler/{name}.go — in-memory store, @example tags for MCP
main.go — MCP-enabled, proper imports
go.mod + Makefile — compiles with go mod tidy + make proto
micro run --prompt does the same then starts all services.
The LLM designs the architecture (service names, fields, endpoints,
descriptions) and returns structured JSON. Code generation uses
the existing template patterns — the output is standard go-micro
code that compiles, runs, and is immediately callable via MCP
and micro chat. No AI dependency at runtime.
* feat: LLM generates real business logic with compile-fix loop
Rebuild the generate package so the LLM writes actual handler
code with business logic, not just CRUD scaffolding.
The flow is now:
1. LLM designs architecture (service names, fields, endpoints)
→ returns structured JSON
2. Proto, main.go, go.mod, Makefile generated deterministically
from the design (guaranteed to be correct)
3. go mod tidy + make proto compiles the protos
4. LLM generates handler code with REAL business logic
→ given the proto, endpoint descriptions, and go-micro patterns
5. go build — does it compile?
6. If no: feed errors back to LLM, get fixed code (up to 3 attempts)
7. If yes: service is ready
The handler prompt instructs the LLM to:
- Use sync.RWMutex for thread-safe in-memory state
- Include validation, edge cases, meaningful errors
- Write doc comments with @example tags for MCP
- Implement actual domain logic, not just map operations
Proto generation still uses deterministic templates (CRUD +
custom endpoints from the design spec) to guarantee correctness.
The compile-fix loop catches LLM mistakes automatically.
Both micro new --prompt and micro run --prompt use this flow.
* fix: handle edge cases in prompt-based generation
- Fix PATH for protoc-gen-micro in child processes
- Handle existing directories: skip structural files (main.go,
go.mod, Makefile) if dir exists, always regenerate proto,
only write placeholder handler if none exists
- Allow re-running micro new --prompt on same directory to
iterate on business logic without clobbering user edits
Tested end-to-end: "a simple todo list with tasks and categories"
generates 2 services (task-service, category-service) with real
business logic (validation, toggle complete, etc.), compiles
after 1 fix iteration, and runs with 6 MCP tools discovered.
* feat: auto-detect modified handlers on regeneration
Instead of requiring a --keep-handlers flag, the generate package now
tracks a SHA-256 hash of each generated handler in a .micro metadata
file. On re-run, if the user has edited the handler since generation,
it's left untouched. Unmodified handlers are regenerated normally.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: add tests, fix go.mod, gitignore, proto tracking, spinner
- Add 12 tests covering helpers, proto generation, hash tracking
- Fix go.mod: write minimal module file, let go mod tidy resolve deps
- Add .gitignore to prompt-generated services
- Protect user-edited proto files (same hash tracking as handlers)
- Add spinner during LLM calls so it doesn't look hung
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: signal handling, existing service discovery, help text
- Ctrl+C during generation now cancels LLM calls immediately via
signal-aware context; re-run picks up where it left off
- Design() scans for existing services in the working directory and
includes their proto definitions in the prompt, so the LLM extends
the system rather than redesigning from scratch
- Updated --prompt help text with usage examples on both new and run
- Listed all supported providers in flag descriptions
- Added discoverExisting test
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: show endpoints in run --prompt output, add micro chat hint
Print endpoint names and descriptions when designing services so users
see what was built. Add a micro chat hint to the run banner so users
know how to interact with their services after startup.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* fix: generated go.mod uses go 1.24 with explicit go-micro require
go 1.22 with no explicit require caused Go to resolve sub-packages
(gateway/mcp, client, server) as separate modules, hitting stale v1.18
tags. Pin to go 1.24 + require go-micro.dev/v5 v5.24.0 so go mod tidy
resolves all sub-packages from the root module correctly.
Tested end-to-end: 4 services generated and compiled successfully.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* fix: skip handler regeneration when proto unchanged
Compare proto hash before and after structure generation. If the proto
didn't change and the handler wasn't edited by the user, skip go mod
tidy, make proto, LLM handler generation, and compile-fix entirely.
Prints "(unchanged)" instead.
Reduces re-run of 4-service project from ~2 minutes to ~10 seconds.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: confirm design before generating code
Show the service design (names, endpoints) and prompt "Generate? [Y/n]"
before spending LLM time on handler generation. Applies to both
micro new --prompt and micro run --prompt. Default is yes (enter).
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* fix: use port :0 for MCP in generated multi-service projects
Each generated service had mcp.WithMCP(":3001") hardcoded, causing
port conflicts when running multiple services. Use :0 to auto-assign
a free port. micro run's central gateway handles unified MCP access.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: truncation detection, tool result display in chat
- Detect truncated LLM responses (unbalanced braces, doesn't end
with '}') and retry with a conciseness hint before falling through
to compile-fix
- Show tool call results in micro chat output (← for success, ✗ for
errors) so users can see what the LLM did
- Add Result/Error fields to ToolCall, populated by Anthropic provider
after tool execution
- Add isTruncated tests
Tested end-to-end with Anthropic: services generate, compile, start,
register, respond to RPC calls, and micro chat discovers and calls
tools correctly.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* fix: Anthropic tool loop, service naming, chat tool results
Anthropic provider:
- Fix tool execution loop to properly iterate (was re-processing all
tool calls instead of only new ones each round)
- Clean assistant content blocks before sending back (strip 'id' from
text blocks that Anthropic rejects on input)
- Include tools in follow-up requests so model can make additional calls
- Loop up to 10 rounds until model responds with text only
Service naming:
- Strip '-service' suffix from micro.New() name so services register
as 'task', 'category' instead of 'taskservice', 'categoryservice'
Chat:
- Show tool results (← for success) and errors (✗) in chat output
Tested end-to-end: create task → list tasks works as multi-step
orchestration through micro chat with Anthropic Claude.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: blog post 13 — from prompt to production
Covers the full micro run --prompt flow: design, generate, compile-fix,
run, and chat orchestration. Positions agent-as-orchestrator as the
answer to service coordination.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* fix: timeouts, max_tokens, TTY detection, smaller services
- Add 60s timeout on design, 90s on handler generation, 60s on
compile-fix LLM calls so hung providers don't block forever
- Bump Anthropic max_tokens from 4096 to 8192 to reduce truncation
- Add TTY detection: spinner prints static message in non-TTY (CI/pipes)
instead of ANSI escape codes
- Tighten prompts: max 200 lines per handler, 2-4 services, 5-8 fields,
explicit "services don't call each other" rule
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: chat suggests creating services when capabilities are missing
Update system prompt with the list of available services. When the user
asks for something no existing service can handle, the agent explains
what's available and suggests the exact micro new --prompt command to
create the missing service.
This is the natural evolution path: start with a few services, talk to
them via chat, and when the domain grows, the agent tells you what to
add. Each service stays small and focused.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: chat generates and starts services inline, drop -service suffix
Chat agent now has a micro_generate_service tool. When the user asks
for a capability that doesn't exist, the agent generates the service,
compiles it, starts it as a background process, waits for registration,
re-discovers tools, and uses the new endpoints immediately — all within
the conversation.
Service naming: design prompt now instructs LLM to return names without
'-service' suffix (e.g. 'task' not 'task-service'). buildMain keeps
TrimSuffix as safety net for backward compatibility.
Spawned processes are cleaned up when chat exits.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* docs: rewrite blog post 13 with inline service generation
Updated to reflect the full UX: services generate and start within
the chat conversation. Added the shipping example showing the agent
creating a service mid-conversation. Removed -service suffix from
all examples. Tightened the narrative around agent-as-orchestrator.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
* feat: persistent storage, README quickstart, auto-detect new services
Storage: generated handlers now use go-micro's store package instead
of in-memory maps. Data persists across restarts. The handler prompt
includes store API examples so the LLM generates correct store usage.
README: added "Generate From a Prompt" section with micro run --prompt
and micro chat examples, linking to blog post 13.
Watcher: micro run now scans for new service directories every 5s. When
micro chat generates a service, micro run detects the new directory,
builds it, starts it, and adds it to the watcher — fully automatic.
Added AddDir/Dirs methods to the watcher.
Blog: updated post 13 with persistent storage example and watcher note.
https://claude.ai/code/session_01QTp4SshuVmLAvvEGJe4TJd
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
601c67675f |
Update logo, add AI integration docs, and enhance CLI features (#2914)
* feat: update Go Micro logo to interconnected nodes design
Replace the text-on-blue-square logo with a modern icon: three
teal nodes connected in a triangle, representing distributed
systems. Generated via Atlas Cloud. Clean at all sizes — works
as GitHub avatar, favicon, and nav bar icon.
* feat: new logo, AI integration architecture doc, and landing page CTA
Update logo to triangle-nodes icon + "Go Micro" text wordmark.
Save icon-only variant for favicon/avatar use.
Add docs/ai-integration.md — a single page that explains how the
AI stack fits together: services → registry → MCP gateway →
ai/tools → ai.Model → micro chat. Layer-by-layer with code
examples, provider table, and "what you don't need" section.
Add AI Integration to docs sidebar navigation (after Getting
Started). Update the landing page AI section with a direct CTA
button linking to the new doc.
* fix: restore original logo and add border-radius to all renders
Revert logo to original. Add border-radius: 8px to the logo img
in the landing page nav, docs layout nav, and blog layout nav
so the square logo renders with rounded corners everywhere.
Remove unused icon.png.
* feat(ai): add ai/flow package and micro flow CLI
Add ai/flow — event-driven LLM orchestration for go-micro. A Flow
subscribes to a broker topic, discovers services as tools, and
feeds each event into an LLM that decides which RPCs to call.
Key types:
- flow.New(name, opts...) creates a flow with trigger topic,
prompt template, provider config
- flow.Register(registry, broker, client) wires it into a service
- flow.Execute(ctx, data) runs the flow once (for testing/CLI)
- flow.Results() returns execution history
Add micro flow CLI with two subcommands:
- micro flow run: subscribe to a topic and react to events
- micro flow exec: one-shot execution with inline data
Both output JSON results with flow name, prompt, tool calls,
reply, answer, duration, and errors.
Example:
micro flow run --trigger events.user.created \
--prompt "New user: {{.Data}}. Send welcome email." \
--provider anthropic
micro flow exec --prompt "List all users" --provider anthropic
* docs: update flows blog post with ai/flow package and CLI examples
Add "Update: We Built It" section to blog/9 showing the ai/flow
package API, CLI usage for both event-driven and one-shot modes,
and what it does/doesn't do. Links the conceptual discussion to
the shipped implementation.
* feat(cli): add micro api gateway command, clarify run vs server
Add 'micro api' — a standalone lightweight HTTP-to-RPC gateway:
- POST /{service}/{endpoint} proxies to RPC calls
- GET / lists all services and endpoints
- GET /{service} describes a service
- GET /health returns ok
- Supports Micro-Endpoint header for endpoint routing
- No dashboard, no auth, no hot reload — just the proxy
Update help text to clarify the three gateway modes:
- micro api: bare HTTP-to-RPC proxy
- micro run: development mode (hot reload + gateway + agent playground)
- micro server: production mode (dashboard + auth + JWT)
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
a0ad9ee566 |
Claude/fix issue 2893 x3rpd (#2901)
* docs: add AI provider integration guide and Supported AI Providers section Add a step-by-step guide for AI infrastructure companies to implement ai.Model and contribute a provider to go-micro. Covers the full lifecycle: skeleton, tool call handling, tests, registration, and PR checklist. Add a "Supported AI Providers" section to the project README that lists current providers (Anthropic, OpenAI) in a table and links to the integration guide with a call-to-action for new providers and sponsors. Streamline the "Adding a New Provider" section in ai/README.md to point to the new guide instead of duplicating a full code listing. * fix: remove nonexistent Discord link from README * fix(website): set content container width to 800px on desktop Move the 800px max-width from .markdown-body up to .content so the entire content pane (not just the inner body) is sized correctly. The container now fills up to 800px beside the sidebar. * feat(ai): wire Atlas Cloud into server and auto-detection Import atlascloud provider in the micro server so it is available when running micro run / micro server. Add atlascloud to AutoDetectProvider so --ai_base_url with an atlascloud domain selects the right provider automatically. * feat(ai): add Google Gemini provider Add ai/gemini implementing ai.Model for Google's Gemini API. Uses the native generateContent endpoint with system_instruction, contents/parts, and functionDeclarations — not an OpenAI shim. Default model gemini-2.5-flash, auth via x-goog-api-key header. Wire into micro server imports and AutoDetectProvider (matches googleapis.com and google in base URL). Update README.md and ai/README.md with provider listing. * feat(ai): add Groq, Mistral, and Together AI providers Add three new OpenAI-compatible providers: - ai/groq: ultra-fast inference, default model llama-3.3-70b-versatile - ai/mistral: Mistral AI, default model mistral-large-latest - ai/together: Together AI, default model Llama-3.3-70B-Instruct-Turbo All three are wired into the micro server imports and AutoDetectProvider. README and ai/README updated with the full provider table. * feat(ai): add ai/tools helper and 'micro chat' interactive agent Extract the registry-discovery + RPC-execution loop from the web agent playground into a reusable ai/tools package: - tools.New(reg) creates a Set bound to a registry - Set.Discover() walks the registry and returns []ai.Tool with LLM-safe (underscored) names, remembering the mapping back to the original dotted form - Set.Handler(client) returns an ai.ToolHandler that resolves the safe name and issues the RPC Add cmd/micro/chat — an interactive 'micro chat' REPL that uses ai/tools to let users talk to their services through any registered AI provider. Supports --prompt for single-shot use, auto-detects the provider from --base_url, and falls back to the provider's conventional env var (ANTHROPIC_API_KEY, etc). Update README with the new command and the programmatic example. * feat(examples): add gRPC interop example Add examples/grpc-interop showing that any standard gRPC client can call a go-micro service — no go-micro SDK required on the client side. Includes: - proto/greeter.proto with generated Go, gRPC, and micro stubs - server/ using go-micro gRPC transport - client/ using stock google.golang.org/grpc (no go-micro imports) - README with Python example and explanation of how routing works Addresses the confusion from issue #2818 where users didn't know that go-micro gRPC services are callable by any gRPC client. * fix: strip /api prefix from MCP routes Change /api/mcp/tools and /api/mcp/call to /mcp/tools and /mcp/call. MCP is a first-class feature, not a sub-path of the API proxy. Update server routes, playground template, scopes template, run.go output, README, CLI README, and all docs. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
beeaad748e |
Claude/update docs roadmap f zd2 j (#2868)
* feat: add LlamaIndex SDK for Go Micro services Add LlamaIndex integration package that enables LlamaIndex agents to discover and call Go Micro microservices through the MCP gateway. Follows the same pattern as the existing LangChain SDK. - GoMicroToolkit with from_gateway() factory and tool filtering - FunctionTool integration via llama_index.core.tools - Auth support, error handling, and retry configuration - Examples for basic agent and RAG + microservices workflows - Unit tests with mocked gateway responses https://claude.ai/code/session_01GkduEhcrqcG45rdfYh8dAc * docs: update status for OTel, WebSocket, and LlamaIndex SDK completion Reflect recently completed work in roadmap and status documents: - Q2 progress: 85% -> 95% (WebSocket, LlamaIndex SDK done) - Q3 progress: 40% -> 50% (OpenTelemetry integration done) - Transports: 2 -> 3 (added WebSocket) - Agent SDKs: 1 -> 2 (added LlamaIndex) - Test coverage: 568 -> 1,000+ lines https://claude.ai/code/session_01GkduEhcrqcG45rdfYh8dAc * feat: add WithMCP convenience option, improve startup banner, and blog post - Add mcp.WithMCP(":3000") service option for one-line MCP setup - Improve `micro run` startup banner to show Agent playground, MCP tools, and WebSocket endpoints prominently - Add blog post: "Building the AI-Native Future of Go Micro with Claude" covering WebSocket transport, OTel integration, LlamaIndex SDK, and Anthropic's Claude Max sponsorship - Update blog index and navigation links https://claude.ai/code/session_01GkduEhcrqcG45rdfYh8dAc --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
9d9968d66b | scopes | ||
|
|
c9a3584656 | update docs | ||
|
|
ee76eb6d2c |
v5.15.0: Unified Gateway Architecture + MCP Support
Major Features: - Unified gateway architecture (micro run + micro server use same code) - MCP (Model Context Protocol) integration as library package - AI-accessible microservices with 3 lines of code Gateway Unification: - Created reusable gateway module (cmd/micro/server/gateway.go) - Updated micro run to use unified gateway (removed duplicate code) - Conditional authentication (disabled in dev, required in prod) - Reduced code duplication, simplified maintenance MCP Integration: - New library package: gateway/mcp - Automatic service discovery → MCP tools - HTTP/SSE transport support (stdio coming soon) - Works for both library users and CLI users - CLI flags: --mcp-address for micro run and micro server Documentation: - ADR-010: Unified Gateway Architecture - CLI & Gateway Guide for users - MCP Gateway README and examples - Blog post: Making Your Microservices AI-Native with MCP Breaking Changes: None (fully backward compatible) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|
|
a38d7df106 | go fmt | ||
|
|
a5bef7af29 |
Add systemd-based deployment support (#2836)
* Add systemd-based deployment support
- micro init --server: Initialize server to receive deployments
- Creates /opt/micro/{bin,data,config} directories
- Generates systemd template unit (micro@.service)
- Creates 'micro' system user
- micro deploy: Deploy services via SSH + systemd
- Builds linux/amd64 binaries automatically
- Copies via rsync/scp to server
- Manages services via systemctl
- Helpful error messages for common issues
- micro status --remote: Check remote service status
- micro logs --remote: Stream remote logs via journalctl
- micro stop --remote: Stop services on remote server
- Config: Added 'deploy' blocks to micro.mu for named targets
The deployment model:
- systemd is the process supervisor (battle-tested)
- SSH is the transport (standard, secure)
- No custom daemons or platforms needed
Co-authored-by: Shelley <shelley@exe.dev>
* Add deployment documentation
- docs/deployment.md: Comprehensive guide for server deployment
- README.md: Updated deployment section with full workflow
Co-authored-by: Shelley <shelley@exe.dev>
* Add deployment section to CLI documentation
Co-authored-by: Shelley <shelley@exe.dev>
* Fix systemd template escaping and rsync permission warnings
- Fix %i escaping in systemd template (was being interpreted by fmt.Sprintf)
- Handle rsync exit code 23/24 gracefully (metadata permission warnings)
- Add --omit-dir-times to rsync to avoid directory timestamp errors
Co-authored-by: Shelley <shelley@exe.dev>
* Add install script for micro CLI
Co-authored-by: Shelley <shelley@exe.dev>
* Fix non-constant format string in deploy error
Co-authored-by: Shelley <shelley@exe.dev>
---------
Co-authored-by: Shelley <shelley@exe.dev>
|
||
|
|
139e70e880 |
feat(run): integrate HTTP gateway with micro run (#2832)
micro run now starts an HTTP gateway alongside your services: - Web dashboard at http://localhost:8080 - API proxy at /api/{service}/{method} - Health checks at /health - Service listing at /services The experience is now: $ micro new helloworld $ cd helloworld $ micro run Open http://localhost:8080 to see and call your services. New flags: --address :3000 # Custom gateway port --no-gateway # Disable gateway (services only) Updated documentation to make this the central experience. Co-authored-by: Shelley <shelley@exe.dev> |
||
|
|
7690c41d5f |
feat(run): add hot reload, config files, and dependency ordering (#2829)
- Add micro.mu DSL and micro.json config file support
- Implement hot reload with file watching (--no-watch to disable)
- Start services in dependency order (topological sort)
- Environment management (--env flag, MICRO_ENV var)
- Health check waiting before starting dependents
- Graceful shutdown in reverse dependency order
Config file example (micro.mu):
service users
path ./users
port 8081
service posts
path ./posts
port 8082
depends users
env development
STORE_ADDRESS file://./data
Closes #2828
Co-authored-by: Shelley <shelley@exe.dev>
|
||
|
|
1dde737b64 | move micro cli and protoc-gen-micro to cmd/ |