@siteboon/claude-code-ui 1.11.0 → 1.13.0
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 +19 -16
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/index-Cc6pl7ji.css +32 -0
- package/dist/assets/index-Zq2roSUR.js +1206 -0
- package/dist/assets/{vendor-codemirror-B7BYDWj-.js → vendor-codemirror-CnTQH7Pk.js} +1 -1
- package/dist/assets/{vendor-react-7V_UDHjJ.js → vendor-react-DVSKlM5e.js} +9 -9
- package/dist/assets/{vendor-xterm-jI4BCHEb.js → vendor-xterm-DfaPXD3y.js} +12 -12
- package/dist/icons/codex-white.svg +3 -0
- package/dist/icons/codex.svg +3 -0
- package/dist/icons/cursor-white.svg +12 -0
- package/dist/index.html +6 -6
- package/dist/logo-128.png +0 -0
- package/dist/logo-256.png +0 -0
- package/dist/logo-32.png +0 -0
- package/dist/logo-512.png +0 -0
- package/dist/logo-64.png +0 -0
- package/dist/logo.svg +17 -9
- package/package.json +7 -1
- package/server/claude-sdk.js +20 -19
- package/server/database/auth.db +0 -0
- package/server/database/db.js +73 -0
- package/server/database/init.sql +4 -1
- package/server/index.js +263 -29
- package/server/middleware/auth.js +34 -3
- package/server/openai-codex.js +387 -0
- package/server/projects.js +448 -7
- package/server/routes/agent.js +42 -4
- package/server/routes/cli-auth.js +263 -0
- package/server/routes/codex.js +310 -0
- package/server/routes/git.js +123 -28
- package/server/routes/projects.js +378 -0
- package/server/routes/taskmaster.js +2 -10
- package/server/routes/user.js +106 -0
- package/server/utils/gitConfig.js +24 -0
- package/dist/assets/index-B4_v-YUz.css +0 -32
- package/dist/assets/index-BZX1vtg9.js +0 -932
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="100 100 520 520" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M304.246 295.411V249.828C304.246 245.989 305.687 243.109 309.044 241.191L400.692 188.412C413.167 181.215 428.042 177.858 443.394 177.858C500.971 177.858 537.44 222.482 537.44 269.982C537.44 273.34 537.44 277.179 536.959 281.018L441.954 225.358C436.197 222 430.437 222 424.68 225.358L304.246 295.411ZM518.245 472.945V364.024C518.245 357.304 515.364 352.507 509.608 349.149L389.174 279.096L428.519 256.543C431.877 254.626 434.757 254.626 438.115 256.543L529.762 309.323C556.154 324.679 573.905 357.304 573.905 388.971C573.905 425.436 552.315 459.024 518.245 472.941V472.945ZM275.937 376.982L236.592 353.952C233.235 352.034 231.794 349.154 231.794 345.315V239.756C231.794 188.416 271.139 149.548 324.4 149.548C344.555 149.548 363.264 156.268 379.102 168.262L284.578 222.964C278.822 226.321 275.942 231.119 275.942 237.838V376.986L275.937 376.982ZM360.626 425.922L304.246 394.255V327.083L360.626 295.416L417.002 327.083V394.255L360.626 425.922ZM396.852 571.789C376.698 571.789 357.989 565.07 342.151 553.075L436.674 498.374C442.431 495.017 445.311 490.219 445.311 483.499V344.352L485.138 367.382C488.495 369.299 489.936 372.179 489.936 376.018V481.577C489.936 532.917 450.109 571.785 396.852 571.785V571.789ZM283.134 464.79L191.486 412.01C165.094 396.654 147.343 364.029 147.343 332.362C147.343 295.416 169.415 262.309 203.48 248.393V357.791C203.48 364.51 206.361 369.308 212.117 372.665L332.074 442.237L292.729 464.79C289.372 466.707 286.491 466.707 283.134 464.79ZM277.859 543.48C223.639 543.48 183.813 502.695 183.813 452.314C183.813 448.475 184.294 444.636 184.771 440.797L279.295 495.498C285.051 498.856 290.812 498.856 296.568 495.498L417.002 425.927V471.509C417.002 475.349 415.562 478.229 412.204 480.146L320.557 532.926C308.081 540.122 293.206 543.48 277.854 543.48H277.859ZM396.852 600.576C454.911 600.576 503.37 559.313 514.41 504.612C568.149 490.696 602.696 440.315 602.696 388.976C602.696 355.387 588.303 322.762 562.392 299.25C564.791 289.173 566.231 279.096 566.231 269.024C566.231 200.411 510.571 149.067 446.274 149.067C433.322 149.067 420.846 150.984 408.37 155.305C386.775 134.192 357.026 120.758 324.4 120.758C266.342 120.758 217.883 162.02 206.843 216.721C153.104 230.637 118.557 281.018 118.557 332.357C118.557 365.946 132.95 398.571 158.861 422.083C156.462 432.16 155.022 442.237 155.022 452.309C155.022 520.922 210.682 572.266 274.978 572.266C287.931 572.266 300.407 570.349 312.883 566.028C334.473 587.141 364.222 600.576 396.852 600.576Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg viewBox="100 100 520 520" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M304.246 294.611V249.028C304.246 245.189 305.687 242.309 309.044 240.392L400.692 187.612C413.167 180.415 428.042 177.058 443.394 177.058C500.971 177.058 537.44 221.682 537.44 269.182C537.44 272.54 537.44 276.379 536.959 280.218L441.954 224.558C436.197 221.201 430.437 221.201 424.68 224.558L304.246 294.611ZM518.245 472.145V363.224C518.245 356.505 515.364 351.707 509.608 348.349L389.174 278.296L428.519 255.743C431.877 253.826 434.757 253.826 438.115 255.743L529.762 308.523C556.154 323.879 573.905 356.505 573.905 388.171C573.905 424.636 552.315 458.225 518.245 472.141V472.145ZM275.937 376.182L236.592 353.152C233.235 351.235 231.794 348.354 231.794 344.515V238.956C231.794 187.617 271.139 148.749 324.4 148.749C344.555 148.749 363.264 155.468 379.102 167.463L284.578 222.164C278.822 225.521 275.942 230.319 275.942 237.039V376.186L275.937 376.182ZM360.626 425.122L304.246 393.455V326.283L360.626 294.616L417.002 326.283V393.455L360.626 425.122ZM396.852 570.989C376.698 570.989 357.989 564.27 342.151 552.276L436.674 497.574C442.431 494.217 445.311 489.419 445.311 482.699V343.552L485.138 366.582C488.495 368.499 489.936 371.379 489.936 375.219V480.778C489.936 532.117 450.109 570.985 396.852 570.985V570.989ZM283.134 463.99L191.486 411.211C165.094 395.854 147.343 363.229 147.343 331.562C147.343 294.616 169.415 261.509 203.48 247.593V356.991C203.48 363.71 206.361 368.508 212.117 371.866L332.074 441.437L292.729 463.99C289.372 465.907 286.491 465.907 283.134 463.99ZM277.859 542.68C223.639 542.68 183.813 501.895 183.813 451.514C183.813 447.675 184.294 443.836 184.771 439.997L279.295 494.698C285.051 498.056 290.812 498.056 296.568 494.698L417.002 425.127V470.71C417.002 474.549 415.562 477.429 412.204 479.346L320.557 532.126C308.081 539.323 293.206 542.68 277.854 542.68H277.859ZM396.852 599.776C454.911 599.776 503.37 558.513 514.41 503.812C568.149 489.896 602.696 439.515 602.696 388.176C602.696 354.587 588.303 321.962 562.392 298.45C564.791 288.373 566.231 278.296 566.231 268.224C566.231 199.611 510.571 148.267 446.274 148.267C433.322 148.267 420.846 150.184 408.37 154.505C386.775 133.392 357.026 119.958 324.4 119.958C266.342 119.958 217.883 161.22 206.843 215.921C153.104 229.837 118.557 280.218 118.557 331.557C118.557 365.146 132.95 397.771 158.861 421.283C156.462 431.36 155.022 441.437 155.022 451.51C155.022 520.123 210.682 571.466 274.978 571.466C287.931 571.466 300.407 569.549 312.883 565.228C334.473 586.341 364.222 599.776 396.852 599.776Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Ebene_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 466.73 532.09">
|
|
3
|
+
<!-- Generator: Adobe Illustrator 29.6.1, SVG Export Plug-In . SVG Version: 2.1.1 Build 9) -->
|
|
4
|
+
<defs>
|
|
5
|
+
<style>
|
|
6
|
+
.st0 {
|
|
7
|
+
fill: #edecec;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
</defs>
|
|
11
|
+
<path class="st0" d="M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z"/>
|
|
12
|
+
</svg>
|
package/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="manifest" href="/manifest.json" />
|
|
12
12
|
|
|
13
13
|
<!-- iOS Safari PWA Meta Tags -->
|
|
14
|
-
<meta name="
|
|
14
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
15
15
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
16
16
|
<meta name="apple-mobile-web-app-title" content="Claude UI" />
|
|
17
17
|
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
|
|
26
26
|
<!-- Prevent zoom on iOS -->
|
|
27
27
|
<meta name="format-detection" content="telephone=no" />
|
|
28
|
-
<script type="module" crossorigin src="/assets/index-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-react-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-xterm-
|
|
32
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
28
|
+
<script type="module" crossorigin src="/assets/index-Zq2roSUR.js"></script>
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DVSKlM5e.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-CnTQH7Pk.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-xterm-DfaPXD3y.js">
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cc6pl7ji.css">
|
|
33
33
|
</head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|
|
Binary file
|
|
Binary file
|
package/dist/logo-32.png
ADDED
|
Binary file
|
|
Binary file
|
package/dist/logo-64.png
ADDED
|
Binary file
|
package/dist/logo.svg
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
width="32"
|
|
4
|
+
height="32"
|
|
5
|
+
viewBox="0 0 32 32"
|
|
6
|
+
fill="none"
|
|
7
|
+
>
|
|
8
|
+
<rect width="32" height="32" rx="8" fill="hsl(221.2 83.2% 53.3%)"/>
|
|
9
|
+
<path
|
|
10
|
+
d="M8 9C8 8.44772 8.44772 8 9 8H23C23.5523 8 24 8.44772 24 9V18C24 18.5523 23.5523 19 23 19H12L8 23V9Z"
|
|
11
|
+
stroke="white"
|
|
12
|
+
strokeWidth="2"
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
fill="none"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siteboon/claude-code-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "A web-based UI for Claude Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server/index.js",
|
|
@@ -49,12 +49,15 @@
|
|
|
49
49
|
"@codemirror/lang-python": "^6.2.1",
|
|
50
50
|
"@codemirror/merge": "^6.11.1",
|
|
51
51
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
52
|
+
"@iarna/toml": "^2.2.5",
|
|
52
53
|
"@octokit/rest": "^22.0.0",
|
|
54
|
+
"@openai/codex-sdk": "^0.75.0",
|
|
53
55
|
"@replit/codemirror-minimap": "^0.5.2",
|
|
54
56
|
"@tailwindcss/typography": "^0.5.16",
|
|
55
57
|
"@uiw/react-codemirror": "^4.23.13",
|
|
56
58
|
"@xterm/addon-clipboard": "^0.1.0",
|
|
57
59
|
"@xterm/addon-fit": "^0.10.0",
|
|
60
|
+
"@xterm/addon-web-links": "^0.11.0",
|
|
58
61
|
"@xterm/addon-webgl": "^0.18.0",
|
|
59
62
|
"@xterm/xterm": "^5.5.0",
|
|
60
63
|
"bcrypt": "^6.0.0",
|
|
@@ -68,6 +71,7 @@
|
|
|
68
71
|
"fuse.js": "^7.0.0",
|
|
69
72
|
"gray-matter": "^4.0.3",
|
|
70
73
|
"jsonwebtoken": "^9.0.2",
|
|
74
|
+
"katex": "^0.16.25",
|
|
71
75
|
"lucide-react": "^0.515.0",
|
|
72
76
|
"mime-types": "^3.0.1",
|
|
73
77
|
"multer": "^2.0.1",
|
|
@@ -78,7 +82,9 @@
|
|
|
78
82
|
"react-dropzone": "^14.2.3",
|
|
79
83
|
"react-markdown": "^10.1.0",
|
|
80
84
|
"react-router-dom": "^6.8.1",
|
|
85
|
+
"rehype-katex": "^7.0.1",
|
|
81
86
|
"remark-gfm": "^4.0.0",
|
|
87
|
+
"remark-math": "^6.0.0",
|
|
82
88
|
"sqlite": "^5.1.1",
|
|
83
89
|
"sqlite3": "^5.1.7",
|
|
84
90
|
"tailwind-merge": "^3.3.1",
|
package/server/claude-sdk.js
CHANGED
|
@@ -57,7 +57,7 @@ function mapCliOptionsToSDK(options = {}) {
|
|
|
57
57
|
|
|
58
58
|
// Add plan mode default tools
|
|
59
59
|
if (permissionMode === 'plan') {
|
|
60
|
-
const planModeTools = ['Read', 'Task', 'exit_plan_mode', 'TodoRead', 'TodoWrite'];
|
|
60
|
+
const planModeTools = ['Read', 'Task', 'exit_plan_mode', 'TodoRead', 'TodoWrite', 'WebFetch', 'WebSearch'];
|
|
61
61
|
for (const tool of planModeTools) {
|
|
62
62
|
if (!allowedTools.includes(tool)) {
|
|
63
63
|
allowedTools.push(tool);
|
|
@@ -76,8 +76,9 @@ function mapCliOptionsToSDK(options = {}) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// Map model (default to sonnet)
|
|
79
|
-
//
|
|
79
|
+
// Valid models: sonnet, opus, haiku, opusplan, sonnet[1m]
|
|
80
80
|
sdkOptions.model = options.model || 'sonnet';
|
|
81
|
+
console.log(`Using model: ${sdkOptions.model}`);
|
|
81
82
|
|
|
82
83
|
// Map system prompt configuration
|
|
83
84
|
sdkOptions.systemPrompt = {
|
|
@@ -183,7 +184,7 @@ function extractTokenBudget(resultMessage) {
|
|
|
183
184
|
// This is the user's budget limit, not the model's context window
|
|
184
185
|
const contextWindow = parseInt(process.env.CONTEXT_WINDOW) || 160000;
|
|
185
186
|
|
|
186
|
-
console.log(
|
|
187
|
+
console.log(`Token calculation: input=${inputTokens}, output=${outputTokens}, cache=${cacheReadTokens + cacheCreationTokens}, total=${totalUsed}/${contextWindow}`);
|
|
187
188
|
|
|
188
189
|
return {
|
|
189
190
|
used: totalUsed,
|
|
@@ -239,7 +240,7 @@ async function handleImages(command, images, cwd) {
|
|
|
239
240
|
modifiedCommand = command + imageNote;
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
console.log(
|
|
243
|
+
console.log(`Processed ${tempImagePaths.length} images to temp directory: ${tempDir}`);
|
|
243
244
|
return { modifiedCommand, tempImagePaths, tempDir };
|
|
244
245
|
} catch (error) {
|
|
245
246
|
console.error('Error processing images for SDK:', error);
|
|
@@ -272,7 +273,7 @@ async function cleanupTempFiles(tempImagePaths, tempDir) {
|
|
|
272
273
|
);
|
|
273
274
|
}
|
|
274
275
|
|
|
275
|
-
console.log(
|
|
276
|
+
console.log(`Cleaned up ${tempImagePaths.length} temp image files`);
|
|
276
277
|
} catch (error) {
|
|
277
278
|
console.error('Error during temp file cleanup:', error);
|
|
278
279
|
}
|
|
@@ -292,7 +293,7 @@ async function loadMcpConfig(cwd) {
|
|
|
292
293
|
await fs.access(claudeConfigPath);
|
|
293
294
|
} catch (error) {
|
|
294
295
|
// File doesn't exist, return null
|
|
295
|
-
console.log('
|
|
296
|
+
console.log('No ~/.claude.json found, proceeding without MCP servers');
|
|
296
297
|
return null;
|
|
297
298
|
}
|
|
298
299
|
|
|
@@ -302,7 +303,7 @@ async function loadMcpConfig(cwd) {
|
|
|
302
303
|
const configContent = await fs.readFile(claudeConfigPath, 'utf8');
|
|
303
304
|
claudeConfig = JSON.parse(configContent);
|
|
304
305
|
} catch (error) {
|
|
305
|
-
console.error('
|
|
306
|
+
console.error('Failed to parse ~/.claude.json:', error.message);
|
|
306
307
|
return null;
|
|
307
308
|
}
|
|
308
309
|
|
|
@@ -312,7 +313,7 @@ async function loadMcpConfig(cwd) {
|
|
|
312
313
|
// Add global MCP servers
|
|
313
314
|
if (claudeConfig.mcpServers && typeof claudeConfig.mcpServers === 'object') {
|
|
314
315
|
mcpServers = { ...claudeConfig.mcpServers };
|
|
315
|
-
console.log(
|
|
316
|
+
console.log(`Loaded ${Object.keys(mcpServers).length} global MCP servers`);
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
// Add/override with project-specific MCP servers
|
|
@@ -320,20 +321,20 @@ async function loadMcpConfig(cwd) {
|
|
|
320
321
|
const projectConfig = claudeConfig.claudeProjects[cwd];
|
|
321
322
|
if (projectConfig && projectConfig.mcpServers && typeof projectConfig.mcpServers === 'object') {
|
|
322
323
|
mcpServers = { ...mcpServers, ...projectConfig.mcpServers };
|
|
323
|
-
console.log(
|
|
324
|
+
console.log(`Loaded ${Object.keys(projectConfig.mcpServers).length} project-specific MCP servers`);
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
|
|
327
328
|
// Return null if no servers found
|
|
328
329
|
if (Object.keys(mcpServers).length === 0) {
|
|
329
|
-
console.log('
|
|
330
|
+
console.log('No MCP servers configured');
|
|
330
331
|
return null;
|
|
331
332
|
}
|
|
332
333
|
|
|
333
|
-
console.log(
|
|
334
|
+
console.log(`Total MCP servers loaded: ${Object.keys(mcpServers).length}`);
|
|
334
335
|
return mcpServers;
|
|
335
336
|
} catch (error) {
|
|
336
|
-
console.error('
|
|
337
|
+
console.error('Error loading MCP config:', error.message);
|
|
337
338
|
return null;
|
|
338
339
|
}
|
|
339
340
|
}
|
|
@@ -380,7 +381,7 @@ async function queryClaudeSDK(command, options = {}, ws) {
|
|
|
380
381
|
}
|
|
381
382
|
|
|
382
383
|
// Process streaming messages
|
|
383
|
-
console.log('
|
|
384
|
+
console.log('Starting async generator loop for session:', capturedSessionId || 'NEW');
|
|
384
385
|
for await (const message of queryInstance) {
|
|
385
386
|
// Capture session ID from first message
|
|
386
387
|
if (message.session_id && !capturedSessionId) {
|
|
@@ -401,10 +402,10 @@ async function queryClaudeSDK(command, options = {}, ws) {
|
|
|
401
402
|
sessionId: capturedSessionId
|
|
402
403
|
}));
|
|
403
404
|
} else {
|
|
404
|
-
console.log('
|
|
405
|
+
console.log('Not sending session-created. sessionId:', sessionId, 'sessionCreatedSent:', sessionCreatedSent);
|
|
405
406
|
}
|
|
406
407
|
} else {
|
|
407
|
-
console.log('
|
|
408
|
+
console.log('No session_id in message or already captured. message.session_id:', message.session_id, 'capturedSessionId:', capturedSessionId);
|
|
408
409
|
}
|
|
409
410
|
|
|
410
411
|
// Transform and send message to WebSocket
|
|
@@ -418,7 +419,7 @@ async function queryClaudeSDK(command, options = {}, ws) {
|
|
|
418
419
|
if (message.type === 'result') {
|
|
419
420
|
const tokenBudget = extractTokenBudget(message);
|
|
420
421
|
if (tokenBudget) {
|
|
421
|
-
console.log('
|
|
422
|
+
console.log('Token budget from modelUsage:', tokenBudget);
|
|
422
423
|
ws.send(JSON.stringify({
|
|
423
424
|
type: 'token-budget',
|
|
424
425
|
data: tokenBudget
|
|
@@ -436,14 +437,14 @@ async function queryClaudeSDK(command, options = {}, ws) {
|
|
|
436
437
|
await cleanupTempFiles(tempImagePaths, tempDir);
|
|
437
438
|
|
|
438
439
|
// Send completion event
|
|
439
|
-
console.log('
|
|
440
|
+
console.log('Streaming complete, sending claude-complete event');
|
|
440
441
|
ws.send(JSON.stringify({
|
|
441
442
|
type: 'claude-complete',
|
|
442
443
|
sessionId: capturedSessionId,
|
|
443
444
|
exitCode: 0,
|
|
444
445
|
isNewSession: !sessionId && !!command
|
|
445
446
|
}));
|
|
446
|
-
console.log('
|
|
447
|
+
console.log('claude-complete event sent');
|
|
447
448
|
|
|
448
449
|
} catch (error) {
|
|
449
450
|
console.error('SDK query error:', error);
|
|
@@ -480,7 +481,7 @@ async function abortClaudeSDKSession(sessionId) {
|
|
|
480
481
|
}
|
|
481
482
|
|
|
482
483
|
try {
|
|
483
|
-
console.log(
|
|
484
|
+
console.log(`Aborting SDK session: ${sessionId}`);
|
|
484
485
|
|
|
485
486
|
// Call interrupt() on the query instance
|
|
486
487
|
await session.instance.interrupt();
|
package/server/database/auth.db
CHANGED
|
Binary file
|
package/server/database/db.js
CHANGED
|
@@ -55,12 +55,40 @@ if (process.env.DATABASE_PATH) {
|
|
|
55
55
|
console.log(c.dim('═'.repeat(60)));
|
|
56
56
|
console.log('');
|
|
57
57
|
|
|
58
|
+
const runMigrations = () => {
|
|
59
|
+
try {
|
|
60
|
+
const tableInfo = db.prepare("PRAGMA table_info(users)").all();
|
|
61
|
+
const columnNames = tableInfo.map(col => col.name);
|
|
62
|
+
|
|
63
|
+
if (!columnNames.includes('git_name')) {
|
|
64
|
+
console.log('Running migration: Adding git_name column');
|
|
65
|
+
db.exec('ALTER TABLE users ADD COLUMN git_name TEXT');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!columnNames.includes('git_email')) {
|
|
69
|
+
console.log('Running migration: Adding git_email column');
|
|
70
|
+
db.exec('ALTER TABLE users ADD COLUMN git_email TEXT');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!columnNames.includes('has_completed_onboarding')) {
|
|
74
|
+
console.log('Running migration: Adding has_completed_onboarding column');
|
|
75
|
+
db.exec('ALTER TABLE users ADD COLUMN has_completed_onboarding BOOLEAN DEFAULT 0');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
console.log('Database migrations completed successfully');
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error('Error running migrations:', error.message);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
58
85
|
// Initialize database with schema
|
|
59
86
|
const initializeDatabase = async () => {
|
|
60
87
|
try {
|
|
61
88
|
const initSQL = fs.readFileSync(INIT_SQL_PATH, 'utf8');
|
|
62
89
|
db.exec(initSQL);
|
|
63
90
|
console.log('Database initialized successfully');
|
|
91
|
+
runMigrations();
|
|
64
92
|
} catch (error) {
|
|
65
93
|
console.error('Error initializing database:', error.message);
|
|
66
94
|
throw error;
|
|
@@ -117,6 +145,51 @@ const userDb = {
|
|
|
117
145
|
} catch (err) {
|
|
118
146
|
throw err;
|
|
119
147
|
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
getFirstUser: () => {
|
|
151
|
+
try {
|
|
152
|
+
const row = db.prepare('SELECT id, username, created_at, last_login FROM users WHERE is_active = 1 LIMIT 1').get();
|
|
153
|
+
return row;
|
|
154
|
+
} catch (err) {
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
updateGitConfig: (userId, gitName, gitEmail) => {
|
|
160
|
+
try {
|
|
161
|
+
const stmt = db.prepare('UPDATE users SET git_name = ?, git_email = ? WHERE id = ?');
|
|
162
|
+
stmt.run(gitName, gitEmail, userId);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
throw err;
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
getGitConfig: (userId) => {
|
|
169
|
+
try {
|
|
170
|
+
const row = db.prepare('SELECT git_name, git_email FROM users WHERE id = ?').get(userId);
|
|
171
|
+
return row;
|
|
172
|
+
} catch (err) {
|
|
173
|
+
throw err;
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
completeOnboarding: (userId) => {
|
|
178
|
+
try {
|
|
179
|
+
const stmt = db.prepare('UPDATE users SET has_completed_onboarding = 1 WHERE id = ?');
|
|
180
|
+
stmt.run(userId);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
throw err;
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
hasCompletedOnboarding: (userId) => {
|
|
187
|
+
try {
|
|
188
|
+
const row = db.prepare('SELECT has_completed_onboarding FROM users WHERE id = ?').get(userId);
|
|
189
|
+
return row?.has_completed_onboarding === 1;
|
|
190
|
+
} catch (err) {
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
120
193
|
}
|
|
121
194
|
};
|
|
122
195
|
|
package/server/database/init.sql
CHANGED
|
@@ -8,7 +8,10 @@ CREATE TABLE IF NOT EXISTS users (
|
|
|
8
8
|
password_hash TEXT NOT NULL,
|
|
9
9
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
10
10
|
last_login DATETIME,
|
|
11
|
-
is_active BOOLEAN DEFAULT 1
|
|
11
|
+
is_active BOOLEAN DEFAULT 1,
|
|
12
|
+
git_name TEXT,
|
|
13
|
+
git_email TEXT,
|
|
14
|
+
has_completed_onboarding BOOLEAN DEFAULT 0
|
|
12
15
|
);
|
|
13
16
|
|
|
14
17
|
-- Indexes for performance
|