@hsupu/copilot-api 0.7.17 → 0.7.18-beta
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 +47 -49
- package/README.zh.md +39 -0
- package/dist/main.mjs +6674 -5600
- package/dist/main.mjs.map +1 -1
- package/package.json +23 -15
- package/ui/history-v1/index.html +149 -0
- package/ui/history-v1/script.js +1799 -0
- package/ui/history-v1/styles.css +1467 -0
- package/ui/history-v3/dist/assets/index-BJHz2Wfg.js +3 -0
- package/ui/history-v3/dist/assets/index-DZDkeXE1.css +1 -0
- package/ui/history-v3/dist/assets/vendor-C3jfkhqq.js +125 -0
- package/ui/history-v3/dist/assets/vue-jlQnwi-P.js +1 -0
- package/ui/history-v3/dist/index.html +15 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hsupu/copilot-api",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Turn GitHub Copilot into OpenAI/Anthropic API compatible server.
|
|
3
|
+
"version": "0.7.18-beta",
|
|
4
|
+
"description": "Turn GitHub Copilot into OpenAI/Anthropic API compatible server.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"proxy",
|
|
7
7
|
"github-copilot",
|
|
@@ -20,13 +20,15 @@
|
|
|
20
20
|
"copilot-api": "dist/main.mjs"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"ui/history-v1",
|
|
25
|
+
"ui/history-v3/dist"
|
|
24
26
|
],
|
|
25
27
|
"scripts": {
|
|
26
28
|
"build": "npm run build:ui && npx tsdown",
|
|
27
|
-
"build:ui": "cd
|
|
29
|
+
"build:ui": "cd ui/history-v3 && bun install && bun run build",
|
|
28
30
|
"dev": "bun run --watch ./src/main.ts",
|
|
29
|
-
"dev:ui": "cd
|
|
31
|
+
"dev:ui": "cd ui/history-v3 && bun run dev",
|
|
30
32
|
"knip": "knip-bun",
|
|
31
33
|
"lint": "eslint --cache",
|
|
32
34
|
"lint:all": "eslint --cache .",
|
|
@@ -41,37 +43,43 @@
|
|
|
41
43
|
"test:contract": "bun test tests/contract/",
|
|
42
44
|
"test:e2e": "bun test tests/e2e/",
|
|
43
45
|
"test:integration": "bun test tests/integration/",
|
|
46
|
+
"test:ui": "cd ui/history-v3 && bun test tests/",
|
|
44
47
|
"typecheck": "tsc"
|
|
45
48
|
},
|
|
46
49
|
"simple-git-hooks": {
|
|
47
50
|
"pre-commit": "bun x lint-staged"
|
|
48
51
|
},
|
|
49
52
|
"lint-staged": {
|
|
50
|
-
"
|
|
53
|
+
"*.{ts,js,mjs,cjs}": "bun run lint"
|
|
51
54
|
},
|
|
52
55
|
"dependencies": {
|
|
53
|
-
"
|
|
56
|
+
"@hono/node-ws": "^1.3.0",
|
|
57
|
+
"citty": "^0.2.1",
|
|
54
58
|
"consola": "^3.4.2",
|
|
55
59
|
"fetch-event-stream": "^0.1.6",
|
|
56
60
|
"gpt-tokenizer": "^3.4.0",
|
|
57
|
-
"hono": "^4.
|
|
61
|
+
"hono": "^4.12.3",
|
|
58
62
|
"picocolors": "^1.1.1",
|
|
59
|
-
"proxy-from-env": "^
|
|
60
|
-
"srvx": "^0.11.
|
|
63
|
+
"proxy-from-env": "^2.0.0",
|
|
64
|
+
"srvx": "^0.11.8",
|
|
61
65
|
"tiny-invariant": "^1.3.3",
|
|
62
|
-
"undici": "^7.
|
|
66
|
+
"undici": "^7.22.0",
|
|
67
|
+
"yaml": "^2.8.2"
|
|
63
68
|
},
|
|
64
69
|
"devDependencies": {
|
|
70
|
+
"@anthropic-ai/sdk": "^0.78.0",
|
|
65
71
|
"@echristian/eslint-config": "^0.0.54",
|
|
66
|
-
"@types/bun": "^1.3.
|
|
72
|
+
"@types/bun": "^1.3.9",
|
|
67
73
|
"@types/proxy-from-env": "^1.0.4",
|
|
68
74
|
"bumpp": "^10.4.1",
|
|
69
|
-
"eslint": "^9.39.
|
|
70
|
-
"knip": "^5.
|
|
75
|
+
"eslint": "^9.39.3",
|
|
76
|
+
"knip": "^5.85.0",
|
|
71
77
|
"lint-staged": "^16.2.7",
|
|
78
|
+
"openai": "^6.25.0",
|
|
72
79
|
"prettier-plugin-packagejson": "^3.0.0",
|
|
73
80
|
"simple-git-hooks": "^2.13.1",
|
|
74
81
|
"tsdown": "^0.20.3",
|
|
75
|
-
"typescript": "^5.9.3"
|
|
82
|
+
"typescript": "^5.9.3",
|
|
83
|
+
"vue": "^3.5.29"
|
|
76
84
|
}
|
|
77
85
|
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Request History (V1) - Copilot API</title>
|
|
7
|
+
<link rel="stylesheet" href="/history/v1/styles.css">
|
|
8
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/diff2html@3.4.56/bundles/css/diff2html.min.css" />
|
|
9
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/diff@8.0.3/dist/diff.min.js"></script>
|
|
10
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/diff2html@3.4.56/bundles/js/diff2html.min.js"></script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
|
|
14
|
+
<div class="app">
|
|
15
|
+
<!-- Header -->
|
|
16
|
+
<header class="header">
|
|
17
|
+
<div class="header-left">
|
|
18
|
+
<h1>Request History <span style="font-size:11px;color:var(--text-muted);font-weight:400;">V1</span></h1>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="header-right">
|
|
21
|
+
<div class="session-selector">
|
|
22
|
+
<select id="session-select" onchange="onSessionChange()">
|
|
23
|
+
<option value="">All Sessions</option>
|
|
24
|
+
</select>
|
|
25
|
+
</div>
|
|
26
|
+
<button onclick="refresh()" title="Refresh" id="btn-refresh">Refresh</button>
|
|
27
|
+
<div class="export-wrapper">
|
|
28
|
+
<button onclick="toggleExportMenu()" title="Export" id="btn-export">Export</button>
|
|
29
|
+
<div class="export-menu" id="export-menu">
|
|
30
|
+
<button onclick="exportData('json')">Export as JSON</button>
|
|
31
|
+
<button onclick="exportData('csv')">Export as CSV</button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<button class="danger" onclick="clearAll()" title="Clear all history" id="btn-clear">Clear</button>
|
|
35
|
+
</div>
|
|
36
|
+
</header>
|
|
37
|
+
|
|
38
|
+
<!-- Stats bar -->
|
|
39
|
+
<div class="stats-bar" id="stats-bar">
|
|
40
|
+
<div class="stat">
|
|
41
|
+
<span class="stat-value" id="stat-total">-</span>
|
|
42
|
+
<span class="stat-label">requests</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="stat success">
|
|
45
|
+
<span class="stat-value" id="stat-success">-</span>
|
|
46
|
+
<span class="stat-label">success</span>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="stat error">
|
|
49
|
+
<span class="stat-value" id="stat-failed">-</span>
|
|
50
|
+
<span class="stat-label">failed</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="stat">
|
|
53
|
+
<span class="stat-value" id="stat-input">-</span>
|
|
54
|
+
<span class="stat-label">in tokens</span>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="stat">
|
|
57
|
+
<span class="stat-value" id="stat-output">-</span>
|
|
58
|
+
<span class="stat-label">out tokens</span>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- Main content -->
|
|
63
|
+
<div class="main">
|
|
64
|
+
<!-- Left: Request list panel -->
|
|
65
|
+
<div class="list-panel">
|
|
66
|
+
<div class="list-controls">
|
|
67
|
+
<div class="list-search">
|
|
68
|
+
<span class="list-search-icon" id="list-search-icon"></span>
|
|
69
|
+
<input type="text" id="list-search" placeholder="Search requests..." onkeyup="debounceListSearch()">
|
|
70
|
+
</div>
|
|
71
|
+
<div class="list-filters">
|
|
72
|
+
<select id="filter-endpoint" onchange="loadEntries()">
|
|
73
|
+
<option value="">All Endpoints</option>
|
|
74
|
+
<option value="anthropic">Anthropic</option>
|
|
75
|
+
<option value="openai">OpenAI</option>
|
|
76
|
+
</select>
|
|
77
|
+
<select id="filter-status" onchange="loadEntries()">
|
|
78
|
+
<option value="">All Status</option>
|
|
79
|
+
<option value="true">Success</option>
|
|
80
|
+
<option value="false">Failed</option>
|
|
81
|
+
</select>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="request-list" id="request-list">
|
|
85
|
+
<div class="loading">Loading...</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="list-pagination" id="list-pagination"></div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<!-- Right: Detail panel -->
|
|
91
|
+
<div class="detail-panel">
|
|
92
|
+
<div class="detail-empty" id="detail-empty">
|
|
93
|
+
<div class="empty-state">
|
|
94
|
+
<h3>No request selected</h3>
|
|
95
|
+
<p>Select a request from the list to view details</p>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div id="detail-view" style="display:none;flex:1;flex-direction:column;overflow:hidden;">
|
|
99
|
+
<div class="detail-toolbar">
|
|
100
|
+
<div class="detail-search">
|
|
101
|
+
<span class="detail-search-icon" id="detail-search-icon"></span>
|
|
102
|
+
<input type="text" id="detail-search" placeholder="Search in conversation..." onkeyup="debounceDetailSearch()">
|
|
103
|
+
</div>
|
|
104
|
+
<div class="detail-filters">
|
|
105
|
+
<select id="filter-role" onchange="renderDetail()">
|
|
106
|
+
<option value="">All Roles</option>
|
|
107
|
+
<option value="system">System</option>
|
|
108
|
+
<option value="user">User</option>
|
|
109
|
+
<option value="assistant">Assistant</option>
|
|
110
|
+
</select>
|
|
111
|
+
<select id="filter-type" onchange="renderDetail()">
|
|
112
|
+
<option value="">All Types</option>
|
|
113
|
+
<option value="text">Text</option>
|
|
114
|
+
<option value="tool_use">Tool Use</option>
|
|
115
|
+
<option value="tool_result">Tool Result</option>
|
|
116
|
+
<option value="image">Image</option>
|
|
117
|
+
</select>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="detail-toggle">
|
|
120
|
+
<input type="checkbox" id="toggle-aggregate" checked onchange="renderDetail()">
|
|
121
|
+
<label for="toggle-aggregate">Aggregate Tools</label>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="detail-content" id="detail-content"></div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- Raw JSON Modal -->
|
|
131
|
+
<div class="modal-overlay" id="raw-modal" onclick="closeRawModal(event)">
|
|
132
|
+
<div class="modal" onclick="event.stopPropagation()">
|
|
133
|
+
<div class="modal-header">
|
|
134
|
+
<h3 id="raw-modal-title">Raw JSON</h3>
|
|
135
|
+
<div style="display:flex;gap:8px;">
|
|
136
|
+
<button class="small" onclick="copyRawContent()">Copy</button>
|
|
137
|
+
<button class="icon-btn" onclick="closeRawModal()" id="btn-close-raw"></button>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="modal-body">
|
|
141
|
+
<pre id="raw-content"></pre>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<script src="/history/v1/script.js"></script>
|
|
148
|
+
</body>
|
|
149
|
+
</html>
|