[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1165":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":36,"discoverSource":37},1165,"harnessclaw-engine","harnessclaw\u002Fharnessclaw-engine","harnessclaw","An LLM programming assistant engine built with Go, supporting WebSocket, multi-turn dialogues, tool calling, permission control, and skill extension.","",null,"Go",265,91,18,1,0,2,3,5.89,"Apache License 2.0",false,"main",[24,25,26,27,28,29,30,31,32],"agent","ai-agent","golang","harness-engineering","iflytek-astron","llm","programming-assistant","skill-engine","websocket","2026-06-12 02:00:24","# HarnessClaw Engine\n\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg)](LICENSE)\n\n[English](README.md) | [中文](README_zh.md)\n\nAn LLM programming assistant engine built with Go. It provides capabilities via the WebSocket protocol, supporting multi-turn dialogues, tool calling, permission control, and skill extension.\n\n## Architecture Overview\n\n```text\n┌───────────-──┐   ┌─────────────┐   ┌─────────────┐\n│  WebSocket   │   │    HTTP     │   │   Feishu    │\n│  Channel     │   │   Channel   │   │  Channel    │\n└──────┬───────┘   └──────┬──────┘   └──────┬──────┘\n       │                  │                  │\n       └──────────────────┼──────────────────┘\n                          ▼\n                ┌──────────────────┐\n                │Router + Middleware│  Auth \u002F RateLimit \u002F Logging\n                └────────┬─────────┘\n                         ▼\n                ┌──────────────────┐\n                │   Query Engine   │  5-Phase Loop\n                │  (queryloop.go)  │  Preprocessing → LLM Streaming → Error Recovery\n                └───┬──────────┬───┘  → Tool Execution → Continuation Check\n                    │          │\n              ┌─────▼──-─┐  ┌──▼──────────┐\n              │ Provider │  │ Tool System │\n              │ (LLM)    │  │ 7 Built-in  │\n              └───────-──┘  └─────────────┘\n```\n\n**Dependency Direction**: Channel → Router → Engine → Provider \u002F Tool (Unidirectional, no circular dependencies)\n\n## Core Features\n\n- **5-Phase Query Loop** — Preprocessing (Auto-compaction) → LLM Streaming Call → Error Recovery (Exponential Backoff) → Tool Execution (Parallel\u002FSerial) → Continuation Check\n- **WebSocket Protocol v1.4** — Explicit session handshake, full message lifecycle, bidirectional tool calling (Server-side + Client-side execution), permission request\u002Fresponse stream\n- **7 Built-in Tools** — Bash, FileRead, FileEdit, FileWrite, Grep, Glob, WebFetch\n- **6-Step Permission Pipeline** — DenyRule → ToolCheckPerm → BypassMode → AlwaysAllowRule → ReadOnlyAutoAllow → ModeDefault, supporting 6 permission modes\n- **Skill System** — Loads skills from `SKILL.md` files, supporting YAML frontmatter, parameter substitution, and priority override\n- **Multi-Provider Support** — Direct Anthropic SSE client + Bifrost Multi-Provider adapter (Anthropic\u002FOpenAI\u002FBedrock\u002FVertex)\n- **Context Compaction** — LLM-based conversation summarization + Circuit breaker pattern, automatically triggered when token usage reaches the threshold\n- **Session Management** — Thread-safe session state, multi-connection fan-out, idle timeout reclamation\n\n## Project Structure\n\n```text\ngo_rebuild\u002F\n├── cmd\u002Fserver\u002F           # Entry point & Integration tests\n│   ├── main.go           # 11-step startup process\n│   └── main_test.go      # E2E tests (build tag: integration)\n├── configs\u002F\n│   └── config.yaml       # Default configuration\n├── internal\u002F\n│   ├── channel\u002F           # Multi-protocol access layer (WebSocket \u002F HTTP \u002F Feishu)\n│   ├── command\u002F           # Command registration & Priority system\n│   ├── config\u002F            # Viper configuration management (50+ defaults)\n│   ├── engine\u002F            # Core query engine\n│   │   ├── queryloop.go   # QueryEngine main loop (831 lines)\n│   │   ├── executor.go    # Parallel\u002FSerial tool executor\n│   │   ├── compact\u002F       # LLM context compaction\n│   │   ├── context\u002F       # System prompt assembly\n│   │   └── session\u002F       # Session state & Lifecycle\n│   ├── event\u002F             # In-process pub\u002Fsub event bus\n│   ├── permission\u002F        # 6-step permission pipeline (6 modes)\n│   ├── provider\u002F          # LLM Provider abstraction\n│   │   ├── anthropic\u002F     # Direct Anthropic SSE client\n│   │   ├── bifrost\u002F       # Multi-Provider adapter\n│   │   └── retry\u002F         # Exponential backoff + 529 overload switching\n│   ├── router\u002F            # Message routing + Middleware chain\n│   ├── skill\u002F             # SKILL.md loading & Parameter substitution\n│   ├── storage\u002F           # Storage interfaces (Memory implementation)\n│   └── tool\u002F              # Tool system\n│       ├── tool.go        # Tool interface + 10 extension interfaces\n│       ├── registry.go    # Thread-safe tool registry\n│       ├── pool.go        # Immutable per-query tool pool\n│       └── bash\u002Ffileread\u002Ffileedit\u002Ffilewrite\u002Fgrep\u002Fglob\u002Fwebfetch\u002Fskilltool\u002F\n├── pkg\u002F\n│   ├── types\u002F             # Shared types (Message, Event, ToolCall, Context)\n│   └── errors\u002F            # Domain errors (16 error codes)\n├── docs\u002F\n│   ├── protocols\u002F         # WebSocket protocol specification (v1.4)\n├── Makefile               # Build\u002FRun\u002FTest\u002FLint\n└── go.mod                 # Go 1.26.1\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Go 1.26+\n- (Optional) [golangci-lint](https:\u002F\u002Fgolangci-lint.run\u002F) — For code linting\n- (Optional) [ripgrep](https:\u002F\u002Fgithub.com\u002FBurntSushi\u002Fripgrep) — Runtime dependency for the Grep tool\n\n### Build & Run\n\n```bash\n# Build\nmake build              # Outputs to .\u002Fdist\u002Fharnessclaw-engine\n\n# Run (using default configuration)\nmake run                # go run .\u002Fcmd\u002Fserver -config .\u002Fconfigs\u002Fconfig.yaml\n\n# Run directly with a specific configuration file\n.\u002Fdist\u002Fharnessclaw-engine -config .\u002Fconfigs\u002Fconfig.yaml\n```\n\n### Testing\n\n```bash\n# Unit tests\nmake test               # go test .\u002F... -v -race -count=1\n\n# Coverage report\nmake test-cover         # Generates coverage.html\n\n# Integration tests (requires real LLM API)\ngo test -tags=integration .\u002Fcmd\u002Fserver\u002F -v\ngo test -tags=integration .\u002Finternal\u002Fprovider\u002Fbifrost\u002F -v\n```\n\n### Other Commands\n\n```bash\nmake fmt                # Format code\nmake tidy               # Tidy go.mod\nmake lint               # Run linters\nmake vuln               # Scan for vulnerabilities\nmake clean              # Clean build artifacts\n```\n\n## Configuration\n\nThe configuration file is located at `configs\u002Fconfig.yaml`. Main configuration items:\n\n| Configuration Item | Description | Default Value |\n|--------|------|--------|\n| `server.port` | HTTP server port | `8080` |\n| `channels.websocket.port` | WebSocket port | `8081` |\n| `channels.websocket.path` | WebSocket path | `\u002Fws` |\n| `llm.default_provider` | LLM Provider | `anthropic` |\n| `llm.providers.anthropic.model` | Model name | `astron-code-latest` |\n| `engine.max_turns` | Max tool calls per turn | `50` |\n| `engine.auto_compact_threshold` | Token ratio threshold for auto-compaction | `0.8` |\n| `session.idle_timeout` | Session idle timeout | `30m` |\n| `permission.mode` | Permission mode | `default` |\n| `tools.*` | Individual tool toggles | All `true` |\n\n## WebSocket Protocol\n\nConnection Address: `ws:\u002F\u002Fhost:8081\u002Fws`\n\n### Session Lifecycle\n\n```text\nClient                                   Server\n  │                                        │\n  │── session.create ──────────────────────>│\n  │\u003C────────────────────── session.created ─│\n  │                                        │\n  │── user.message ────────────────────────>│\n  │\u003C──────────────────── message.start ─────│\n  │\u003C──── content.start \u002F content.delta ─────│  (Streaming Text)\n  │\u003C──────── tool.start \u002F tool.end ─────────│  (Server-side Tool)\n  │\u003C──────────── tool.call ─────────────────│  (Client-side Tool)\n  │── tool.result ─────────────────────────>│\n  │\u003C──── permission.request ────────────────│  (Permission Request)\n  │── permission.response ─────────────────>│\n  │\u003C──────────────── content.stop ──────────│\n  │\u003C──────────────── message.stop ──────────│\n  │\u003C──────────────── task.end ──────────────│\n  │                                        │\n  │── abort ───────────────────────────────>│  (Interrupt)\n```\n\nFor detailed protocol specifications, see [docs\u002Fprotocols\u002Fwebsocket.md](docs\u002Fprotocols\u002Fwebsocket.md).\n\n## Documentation\n\n- [WebSocket Protocol Specification v1.4](docs\u002Fprotocols\u002Fwebsocket.md)\n\n## 📞 Support\n\n- 💬 **Community Discussion**: [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fharnessclaw\u002Fharnessclaw-engine\u002Fdiscussions)\n- 🐛 **Bug Reports**: [Issues](https:\u002F\u002Fgithub.com\u002Fharnessclaw\u002Fharnessclaw-engine\u002Fissues)\n- 👾 **Discord**: [Join our server](https:\u002F\u002Fdiscord.gg\u002FSeseGE7ZUH)\n- 👥 **WeChat Work Group**: \u003Cbr>\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fiflytek\u002Fastron-agent\u002Fblob\u002Fmain\u002Fdocs\u002Fimgs\u002FWeCom_Group.png?raw=true\" alt=\"WeChat Work Group\" width=\"300\"\u002F>\n\n## License\n\nApache-2.0 License. See [LICENSE](LICENSE) for details.\n","HarnessClaw Engine 是一个用 Go 语言构建的编程助手引擎，通过 WebSocket 协议提供多轮对话、工具调用、权限控制和技能扩展等功能。其核心功能包括五阶段查询循环、WebSocket 协议支持、内置七种工具、六步权限管道以及基于 YAML 的技能系统等。该引擎适用于需要辅助编程、自动化任务执行或与外部服务交互的场景，特别适合那些希望在开发过程中集成 AI 辅助能力以提高效率和准确性的开发者或团队使用。","2026-06-11 02:42:03","CREATED_QUERY"]