@hsupu/copilot-api 0.7.12 → 0.7.15
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 +20 -9
- package/dist/main.js +2420 -1356
- package/dist/main.js.map +1 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -13,11 +13,14 @@ This fork includes the following enhancements over the upstream project:
|
|
|
13
13
|
### New Features
|
|
14
14
|
|
|
15
15
|
- **`--host` option**: Bind the server to a specific network interface (e.g., `--host 0.0.0.0` for all interfaces, `--host 127.0.0.1` for localhost only)
|
|
16
|
-
- **
|
|
16
|
+
- **Adaptive rate limiting**: Smart rate limiting with exponential backoff, auto-recovery, and Retry-After support (replaces queue-based limiting)
|
|
17
|
+
- **Direct Anthropic API**: Claude models use Copilot's native Anthropic endpoint without translation overhead
|
|
18
|
+
- **Smart auto-truncate**: Automatically truncates conversation history when exceeding context limits, with optional tool result compression
|
|
17
19
|
- **`/v1/event_logging/batch` endpoint**: Compatibility endpoint for Anthropic SDK's event logging (returns OK without processing)
|
|
18
20
|
- **`logout` command**: Remove stored GitHub token with `copilot-api logout`
|
|
21
|
+
- **`patch-claude` command**: Patch Claude Code's context window limit to match Copilot's limits
|
|
19
22
|
- **Tool name length handling**: Automatically truncates long tool names (>64 chars) to comply with OpenAI's limit, with hash-based suffix to avoid collisions. Original names are restored in responses.
|
|
20
|
-
- **Request History UI**:
|
|
23
|
+
- **Request History UI**: Built-in Web UI (enabled by default) to view, search, filter, and export all API requests/responses. Access at `/history`.
|
|
21
24
|
|
|
22
25
|
### Bug Fixes
|
|
23
26
|
|
|
@@ -98,19 +101,25 @@ copilot-api start
|
|
|
98
101
|
| Option | Description | Default |
|
|
99
102
|
|--------|-------------|---------|
|
|
100
103
|
| `--port`, `-p` | Port to listen on | 4141 |
|
|
101
|
-
| `--host` | Host/interface to bind to | (all interfaces) |
|
|
104
|
+
| `--host`, `-H` | Host/interface to bind to | (all interfaces) |
|
|
102
105
|
| `--verbose`, `-v` | Enable verbose logging | false |
|
|
103
106
|
| `--account-type`, `-a` | Account type (individual, business, enterprise) | individual |
|
|
104
|
-
| `--
|
|
105
|
-
| `--
|
|
107
|
+
| `--manual` | Manual request approval mode | false |
|
|
108
|
+
| `--no-rate-limit` | Disable adaptive rate limiting | false |
|
|
109
|
+
| `--retry-interval` | Seconds to wait before retrying after rate limit | 10 |
|
|
110
|
+
| `--request-interval` | Seconds between requests in rate-limited mode | 10 |
|
|
111
|
+
| `--recovery-timeout` | Minutes before attempting recovery | 10 |
|
|
112
|
+
| `--consecutive-successes` | Successes needed to exit rate-limited mode | 5 |
|
|
106
113
|
| `--github-token`, `-g` | Provide GitHub token directly | none |
|
|
107
114
|
| `--claude-code`, `-c` | Generate Claude Code launch command | false |
|
|
108
115
|
| `--show-token` | Show tokens on fetch/refresh | false |
|
|
109
|
-
| `--manual` | Manual request approval mode | false |
|
|
110
116
|
| `--proxy-env` | Use proxy from environment | false |
|
|
111
|
-
| `--history` |
|
|
117
|
+
| `--no-history` | Disable request history UI at `/history` | false |
|
|
112
118
|
| `--history-limit` | Max history entries in memory | 1000 |
|
|
113
|
-
| `--auto-truncate` |
|
|
119
|
+
| `--no-auto-truncate` | Disable auto-truncate when exceeding limits | false |
|
|
120
|
+
| `--compress-tool-results` | Compress old tool results before truncating | false |
|
|
121
|
+
| `--redirect-anthropic` | Force Anthropic through OpenAI translation | false |
|
|
122
|
+
| `--no-rewrite-anthropic-tools` | Don't rewrite server-side tools | false |
|
|
114
123
|
|
|
115
124
|
### Patch-Claude Command Options
|
|
116
125
|
|
|
@@ -143,9 +152,11 @@ copilot-api start
|
|
|
143
152
|
|
|
144
153
|
| Endpoint | Method | Description |
|
|
145
154
|
|----------|--------|-------------|
|
|
155
|
+
| `/` | GET | Server status |
|
|
146
156
|
| `/usage` | GET | Copilot usage stats |
|
|
147
157
|
| `/token` | GET | Current Copilot token |
|
|
148
|
-
| `/
|
|
158
|
+
| `/health` | GET | Health check |
|
|
159
|
+
| `/history` | GET | Request history Web UI (enabled by default) |
|
|
149
160
|
| `/history/api/*` | GET/DELETE | History API endpoints |
|
|
150
161
|
|
|
151
162
|
## Using with Claude Code
|