@wu529778790/open-im 1.9.3-beta.8 → 1.9.3
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/dist/adapters/claude-sdk-adapter.js +24 -34
- package/dist/adapters/codebuddy-adapter.js +0 -1
- package/dist/adapters/codex-adapter.js +0 -1
- package/dist/adapters/tool-adapter.interface.d.ts +0 -1
- package/dist/codebuddy/cli-runner.d.ts +0 -1
- package/dist/codebuddy/cli-runner.js +0 -61
- package/dist/codex/cli-runner.d.ts +0 -1
- package/dist/codex/cli-runner.js +0 -64
- package/dist/config-web-page-i18n.d.ts +20 -48
- package/dist/config-web-page-i18n.js +20 -48
- package/dist/config-web-page-script.js +37 -112
- package/dist/config-web-page-template.js +118 -242
- package/dist/config-web.js +0 -15
- package/dist/config.d.ts +0 -6
- package/dist/config.js +2 -16
- package/dist/dingtalk/event-handler.js +1 -3
- package/dist/feishu/event-handler.js +1 -3
- package/dist/qq/event-handler.js +1 -3
- package/dist/setup.js +2 -5
- package/dist/shared/ai-task.js +0 -6
- package/dist/shared/ai-task.test.js +0 -3
- package/dist/telegram/event-handler.js +1 -3
- package/dist/wework/event-handler.js +1 -3
- package/dist/workbuddy/event-handler.js +1 -3
- package/package.json +1 -1
- package/dist/shared/task-cleanup.d.ts +0 -2
- package/dist/shared/task-cleanup.js +0 -19
|
@@ -209,12 +209,39 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
.main-header {
|
|
212
|
+
position: sticky;
|
|
213
|
+
top: 0;
|
|
214
|
+
z-index: 30;
|
|
212
215
|
background: var(--bg-primary);
|
|
213
216
|
border-bottom: 1px solid var(--border-subtle);
|
|
214
|
-
padding: 16px 32px;
|
|
217
|
+
padding: 16px 32px 14px;
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
align-items: stretch;
|
|
221
|
+
gap: 12px;
|
|
222
|
+
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
|
|
223
|
+
}
|
|
224
|
+
:root.dark .main-header {
|
|
225
|
+
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
226
|
+
}
|
|
227
|
+
.main-header-top {
|
|
215
228
|
display: flex;
|
|
216
229
|
justify-content: space-between;
|
|
217
230
|
align-items: center;
|
|
231
|
+
gap: 16px;
|
|
232
|
+
flex-wrap: wrap;
|
|
233
|
+
}
|
|
234
|
+
.main-header-toolbar {
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-wrap: wrap;
|
|
237
|
+
gap: 8px;
|
|
238
|
+
align-items: center;
|
|
239
|
+
padding-top: 12px;
|
|
240
|
+
margin: 0 -2px;
|
|
241
|
+
border-top: 1px solid var(--border-subtle);
|
|
242
|
+
}
|
|
243
|
+
.main-header-toolbar .btn {
|
|
244
|
+
flex: 0 1 auto;
|
|
218
245
|
}
|
|
219
246
|
|
|
220
247
|
.main-title {
|
|
@@ -223,12 +250,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
223
250
|
color: var(--text-primary);
|
|
224
251
|
}
|
|
225
252
|
|
|
226
|
-
.main-subtitle {
|
|
227
|
-
font-size: 13px;
|
|
228
|
-
color: var(--text-secondary);
|
|
229
|
-
margin-top: 2px;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
253
|
.header-actions {
|
|
233
254
|
display: flex;
|
|
234
255
|
gap: 12px;
|
|
@@ -356,88 +377,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
356
377
|
line-height: 1;
|
|
357
378
|
}
|
|
358
379
|
|
|
359
|
-
/* Setup wizard (overview) */
|
|
360
|
-
.setup-wizard-card {
|
|
361
|
-
background: var(--bg-card);
|
|
362
|
-
border: 1px solid var(--border-subtle);
|
|
363
|
-
border-radius: var(--radius-lg);
|
|
364
|
-
padding: 20px 24px;
|
|
365
|
-
margin-bottom: 24px;
|
|
366
|
-
box-shadow: var(--shadow-sm);
|
|
367
|
-
}
|
|
368
|
-
.setup-wizard-card h2 {
|
|
369
|
-
margin: 0 0 16px;
|
|
370
|
-
font-size: 16px;
|
|
371
|
-
font-weight: 600;
|
|
372
|
-
color: var(--text-primary);
|
|
373
|
-
}
|
|
374
|
-
.wizard-steps {
|
|
375
|
-
display: grid;
|
|
376
|
-
gap: 12px;
|
|
377
|
-
}
|
|
378
|
-
@media (min-width: 900px) {
|
|
379
|
-
.wizard-steps {
|
|
380
|
-
grid-template-columns: repeat(2, 1fr);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
.wizard-step {
|
|
384
|
-
display: flex;
|
|
385
|
-
gap: 14px;
|
|
386
|
-
align-items: flex-start;
|
|
387
|
-
padding: 14px 16px;
|
|
388
|
-
border-radius: var(--radius-md);
|
|
389
|
-
border: 1px solid var(--border-subtle);
|
|
390
|
-
background: var(--bg-secondary);
|
|
391
|
-
transition: border-color var(--transition-fast), background var(--transition-fast);
|
|
392
|
-
}
|
|
393
|
-
.wizard-step--done {
|
|
394
|
-
border-color: var(--success-border);
|
|
395
|
-
background: var(--success-bg);
|
|
396
|
-
}
|
|
397
|
-
.wizard-step-badge {
|
|
398
|
-
flex-shrink: 0;
|
|
399
|
-
width: 28px;
|
|
400
|
-
height: 28px;
|
|
401
|
-
border-radius: 999px;
|
|
402
|
-
display: flex;
|
|
403
|
-
align-items: center;
|
|
404
|
-
justify-content: center;
|
|
405
|
-
font-size: 13px;
|
|
406
|
-
font-weight: 700;
|
|
407
|
-
background: var(--bg-tertiary);
|
|
408
|
-
color: var(--text-secondary);
|
|
409
|
-
}
|
|
410
|
-
.wizard-step--done .wizard-step-badge {
|
|
411
|
-
background: var(--success-text);
|
|
412
|
-
color: #fff;
|
|
413
|
-
}
|
|
414
|
-
.wizard-step-body {
|
|
415
|
-
flex: 1;
|
|
416
|
-
min-width: 0;
|
|
417
|
-
}
|
|
418
|
-
.wizard-step-title {
|
|
419
|
-
font-weight: 600;
|
|
420
|
-
font-size: 14px;
|
|
421
|
-
color: var(--text-primary);
|
|
422
|
-
margin-bottom: 4px;
|
|
423
|
-
}
|
|
424
|
-
.wizard-step-desc {
|
|
425
|
-
font-size: 13px;
|
|
426
|
-
color: var(--text-secondary);
|
|
427
|
-
line-height: 1.5;
|
|
428
|
-
margin-bottom: 8px;
|
|
429
|
-
}
|
|
430
|
-
.wizard-step-status {
|
|
431
|
-
font-size: 11px;
|
|
432
|
-
font-weight: 600;
|
|
433
|
-
text-transform: uppercase;
|
|
434
|
-
letter-spacing: 0.04em;
|
|
435
|
-
margin-bottom: 6px;
|
|
436
|
-
color: var(--text-tertiary);
|
|
437
|
-
}
|
|
438
|
-
.wizard-step--done .wizard-step-status {
|
|
439
|
-
color: var(--success-text);
|
|
440
|
-
}
|
|
441
380
|
.field-inline-tip {
|
|
442
381
|
font-size: 12px;
|
|
443
382
|
color: var(--text-tertiary);
|
|
@@ -454,49 +393,18 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
454
393
|
border-radius: var(--radius-xs);
|
|
455
394
|
}
|
|
456
395
|
|
|
457
|
-
|
|
458
|
-
.onboarding-backdrop {
|
|
459
|
-
position: fixed;
|
|
460
|
-
inset: 0;
|
|
461
|
-
background: rgba(15, 23, 42, 0.45);
|
|
462
|
-
z-index: 100;
|
|
396
|
+
.config-files-stack {
|
|
463
397
|
display: flex;
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
padding: 24px;
|
|
467
|
-
}
|
|
468
|
-
.onboarding-backdrop.hidden {
|
|
469
|
-
display: none;
|
|
470
|
-
}
|
|
471
|
-
.onboarding-card {
|
|
472
|
-
background: var(--bg-card);
|
|
473
|
-
color: var(--text-primary);
|
|
474
|
-
border-radius: var(--radius-xl);
|
|
475
|
-
max-width: 520px;
|
|
476
|
-
width: 100%;
|
|
477
|
-
padding: 28px 28px 24px;
|
|
478
|
-
box-shadow: var(--shadow-lg);
|
|
479
|
-
border: 1px solid var(--border-subtle);
|
|
480
|
-
}
|
|
481
|
-
.onboarding-card h2 {
|
|
482
|
-
margin: 0 0 12px;
|
|
483
|
-
font-size: 20px;
|
|
484
|
-
font-weight: 700;
|
|
398
|
+
flex-direction: column;
|
|
399
|
+
gap: 20px;
|
|
485
400
|
}
|
|
486
|
-
.
|
|
401
|
+
.config-file-card .card-title.mono {
|
|
402
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
487
403
|
font-size: 14px;
|
|
488
|
-
|
|
489
|
-
line-height: 1.55;
|
|
490
|
-
}
|
|
491
|
-
.onboarding-card .onboarding-body p {
|
|
492
|
-
margin: 0 0 8px;
|
|
404
|
+
font-weight: 600;
|
|
493
405
|
}
|
|
494
|
-
.
|
|
495
|
-
|
|
496
|
-
flex-wrap: wrap;
|
|
497
|
-
gap: 10px;
|
|
498
|
-
margin-top: 20px;
|
|
499
|
-
align-items: center;
|
|
406
|
+
.config-file-card textarea {
|
|
407
|
+
width: 100%;
|
|
500
408
|
}
|
|
501
409
|
|
|
502
410
|
/* Platform Cards */
|
|
@@ -911,6 +819,15 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
911
819
|
</svg>
|
|
912
820
|
<span id="navPlatformsText">Platforms</span>
|
|
913
821
|
</button>
|
|
822
|
+
<button class="nav-item" id="navConfigFilesBtn">
|
|
823
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
824
|
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
825
|
+
<polyline points="14 2 14 8 20 8"/>
|
|
826
|
+
<line x1="16" y1="13" x2="8" y2="13"/>
|
|
827
|
+
<line x1="16" y1="17" x2="8" y2="17"/>
|
|
828
|
+
</svg>
|
|
829
|
+
<span id="navConfigFilesText">Config files</span>
|
|
830
|
+
</button>
|
|
914
831
|
<button class="nav-item" id="navAiBtn">
|
|
915
832
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
916
833
|
<path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 14a4 4 0 1 1 4-4 4 4 0 0 1-4 4z"/>
|
|
@@ -930,27 +847,34 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
930
847
|
<!-- Main Content -->
|
|
931
848
|
<main class="main">
|
|
932
849
|
<header class="main-header">
|
|
933
|
-
<div>
|
|
934
|
-
<
|
|
935
|
-
|
|
850
|
+
<div class="main-header-top">
|
|
851
|
+
<div>
|
|
852
|
+
<h1 class="main-title" id="mainTitle">Dashboard</h1>
|
|
853
|
+
</div>
|
|
854
|
+
<div class="header-actions">
|
|
855
|
+
<a href="https://github.com/wu529778790/open-im" target="_blank" class="btn btn-ghost btn-sm">
|
|
856
|
+
<svg style="width:16px;height:16px" viewBox="0 0 16 16" fill="currentColor">
|
|
857
|
+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
|
|
858
|
+
</svg>
|
|
859
|
+
<span id="footerGithubText">GitHub</span>
|
|
860
|
+
</a>
|
|
861
|
+
<button class="dark-mode-toggle" id="darkModeToggle" type="button" aria-label="Toggle dark mode">
|
|
862
|
+
<svg class="sun-icon" style="width:16px;height:16px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
863
|
+
<circle cx="12" cy="12" r="5"/>
|
|
864
|
+
<path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
|
|
865
|
+
</svg>
|
|
866
|
+
<svg class="moon-icon" style="width:16px;height:16px;display:none" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
867
|
+
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
|
|
868
|
+
</svg>
|
|
869
|
+
</button>
|
|
870
|
+
<button class="lang-button" id="langButton">中文</button>
|
|
871
|
+
</div>
|
|
936
872
|
</div>
|
|
937
|
-
<div class="header-
|
|
938
|
-
<
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
<span id="footerGithubText">GitHub</span>
|
|
943
|
-
</a>
|
|
944
|
-
<button class="dark-mode-toggle" id="darkModeToggle" type="button" aria-label="Toggle dark mode">
|
|
945
|
-
<svg class="sun-icon" style="width:16px;height:16px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
946
|
-
<circle cx="12" cy="12" r="5"/>
|
|
947
|
-
<path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
|
|
948
|
-
</svg>
|
|
949
|
-
<svg class="moon-icon" style="width:16px;height:16px;display:none" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
950
|
-
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
|
|
951
|
-
</svg>
|
|
952
|
-
</button>
|
|
953
|
-
<button class="lang-button" id="langButton">中文</button>
|
|
873
|
+
<div class="main-header-toolbar" id="headerToolbar" role="toolbar" aria-label="Bridge controls">
|
|
874
|
+
<button type="button" id="headerValidateButton" class="btn btn-warning btn-sm">Validate</button>
|
|
875
|
+
<button type="button" id="headerSaveButton" class="btn btn-secondary btn-sm">Save config</button>
|
|
876
|
+
<button type="button" id="headerStartButton" class="btn btn-primary btn-sm">Start bridge</button>
|
|
877
|
+
<button type="button" id="headerStopButton" class="btn btn-danger btn-sm">Stop bridge</button>
|
|
954
878
|
</div>
|
|
955
879
|
</header>
|
|
956
880
|
|
|
@@ -982,48 +906,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
982
906
|
<div class="stat-value" id="statServiceValue">Idle</div>
|
|
983
907
|
</div>
|
|
984
908
|
</div>
|
|
985
|
-
|
|
986
|
-
<div class="setup-wizard-card">
|
|
987
|
-
<h2 id="wizardTitle">First-time setup</h2>
|
|
988
|
-
<div class="wizard-steps" id="wizardSteps">
|
|
989
|
-
<div class="wizard-step" id="wizard-step-1">
|
|
990
|
-
<div class="wizard-step-badge">1</div>
|
|
991
|
-
<div class="wizard-step-body">
|
|
992
|
-
<div class="wizard-step-status" id="wizardStep1Status">To do</div>
|
|
993
|
-
<div class="wizard-step-title" id="wizardStep1Title">Connect an IM channel</div>
|
|
994
|
-
<div class="wizard-step-desc" id="wizardStep1Desc"></div>
|
|
995
|
-
<button type="button" class="btn btn-secondary btn-sm wizard-jump" data-section="configSection" data-nav="navPlatformsBtn" id="wizardJumpPlatforms">Open Platforms</button>
|
|
996
|
-
</div>
|
|
997
|
-
</div>
|
|
998
|
-
<div class="wizard-step" id="wizard-step-2">
|
|
999
|
-
<div class="wizard-step-badge">2</div>
|
|
1000
|
-
<div class="wizard-step-body">
|
|
1001
|
-
<div class="wizard-step-status" id="wizardStep2Status">To do</div>
|
|
1002
|
-
<div class="wizard-step-title" id="wizardStep2Title">Set the default AI tool</div>
|
|
1003
|
-
<div class="wizard-step-desc" id="wizardStep2Desc"></div>
|
|
1004
|
-
<button type="button" class="btn btn-secondary btn-sm wizard-jump" data-section="aiSection" data-nav="navAiBtn" id="wizardJumpAi">Open AI</button>
|
|
1005
|
-
</div>
|
|
1006
|
-
</div>
|
|
1007
|
-
<div class="wizard-step" id="wizard-step-3">
|
|
1008
|
-
<div class="wizard-step-badge">3</div>
|
|
1009
|
-
<div class="wizard-step-body">
|
|
1010
|
-
<div class="wizard-step-status" id="wizardStep3Status">To do</div>
|
|
1011
|
-
<div class="wizard-step-title" id="wizardStep3Title">Validate and save</div>
|
|
1012
|
-
<div class="wizard-step-desc" id="wizardStep3Desc"></div>
|
|
1013
|
-
<button type="button" class="btn btn-secondary btn-sm wizard-jump" data-section="serviceSection" data-nav="navServiceBtn" id="wizardJumpService">Open Service</button>
|
|
1014
|
-
</div>
|
|
1015
|
-
</div>
|
|
1016
|
-
<div class="wizard-step" id="wizard-step-4">
|
|
1017
|
-
<div class="wizard-step-badge">4</div>
|
|
1018
|
-
<div class="wizard-step-body">
|
|
1019
|
-
<div class="wizard-step-status" id="wizardStep4Status">To do</div>
|
|
1020
|
-
<div class="wizard-step-title" id="wizardStep4Title">Start the bridge</div>
|
|
1021
|
-
<div class="wizard-step-desc" id="wizardStep4Desc"></div>
|
|
1022
|
-
<button type="button" class="btn btn-secondary btn-sm wizard-jump" data-section="serviceSection" data-nav="navServiceBtn" id="wizardJumpService2">Open Service</button>
|
|
1023
|
-
</div>
|
|
1024
|
-
</div>
|
|
1025
|
-
</div>
|
|
1026
|
-
</div>
|
|
1027
909
|
</section>
|
|
1028
910
|
|
|
1029
911
|
<!-- Platforms Section -->
|
|
@@ -1355,10 +1237,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
1355
1237
|
</div>
|
|
1356
1238
|
<div class="ai-card-body">
|
|
1357
1239
|
<div id="ai-tool-claude" class="ai-tool-panel active" data-tool-panel="claude">
|
|
1358
|
-
<div class="form-group">
|
|
1359
|
-
<label class="form-label" id="ai-claudeTimeoutMs-label">Timeout (ms)</label>
|
|
1360
|
-
<input id="ai-claudeTimeoutMs" class="form-input" type="number" min="1" />
|
|
1361
|
-
</div>
|
|
1362
1240
|
<div class="form-group">
|
|
1363
1241
|
<label class="form-label" id="ai-claudeProxy-label">Proxy (optional)</label>
|
|
1364
1242
|
<input id="ai-claudeProxy" class="form-input mono" type="text" />
|
|
@@ -1369,35 +1247,7 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
1369
1247
|
<input id="ai-claudeConfigPath" class="form-input mono" type="text" readonly style="background: var(--bg-secondary);" />
|
|
1370
1248
|
<div class="form-hint" id="ai-claudeConfigPath-hint">Environment variables are saved to ~/.claude/settings.json</div>
|
|
1371
1249
|
</div>
|
|
1372
|
-
<
|
|
1373
|
-
<details id="openImConfigContainer">
|
|
1374
|
-
<summary class="form-label" style="cursor: pointer;" id="openImConfigSummary">~/.open-im/config.json</summary>
|
|
1375
|
-
<div style="margin-top: 12px;">
|
|
1376
|
-
<div style="display:flex; justify-content:flex-end; gap:8px; margin-bottom:8px;">
|
|
1377
|
-
<button type="button" id="formatJsonButton" class="btn btn-sm btn-ghost"><span id="formatJsonButtonText">Format</span></button>
|
|
1378
|
-
<button type="button" id="resetJsonButton" class="btn btn-sm btn-ghost"><span id="resetJsonButtonText">Reset</span></button>
|
|
1379
|
-
</div>
|
|
1380
|
-
<textarea id="configJson" class="form-input mono" rows="16" style="font-family:monospace; font-size:13px; line-height:1.5; min-height:320px; resize:vertical; white-space:pre;" spellcheck="false"></textarea>
|
|
1381
|
-
<div id="jsonValidationMessage" class="message hidden" style="margin-top:6px;" aria-live="polite"></div>
|
|
1382
|
-
<div style="margin-top: 8px;">
|
|
1383
|
-
<button type="button" id="saveOpenImConfigBtn" class="btn btn-secondary btn-sm"><span id="saveOpenImConfigBtnText">Save</span></button>
|
|
1384
|
-
</div>
|
|
1385
|
-
</div>
|
|
1386
|
-
</details>
|
|
1387
|
-
<details id="claudeSettingsContainer" style="margin-top: 12px;">
|
|
1388
|
-
<summary class="form-label" style="cursor: pointer;" id="claudeSettingsSummary">~/.claude/settings.json</summary>
|
|
1389
|
-
<div style="margin-top: 12px;">
|
|
1390
|
-
<textarea
|
|
1391
|
-
id="claudeSettingsEditor"
|
|
1392
|
-
class="form-input mono"
|
|
1393
|
-
style="min-height: 180px; white-space: pre; font-family: var(--font-mono);"
|
|
1394
|
-
></textarea>
|
|
1395
|
-
<div style="margin-top: 8px;">
|
|
1396
|
-
<button type="button" id="saveClaudeSettingsBtn" class="btn btn-secondary btn-sm"><span id="saveClaudeSettingsBtnText">Save</span></button>
|
|
1397
|
-
</div>
|
|
1398
|
-
</div>
|
|
1399
|
-
</details>
|
|
1400
|
-
</div>
|
|
1250
|
+
<p class="form-hint" id="claudeJsonShortcutHint"></p>
|
|
1401
1251
|
</div>
|
|
1402
1252
|
|
|
1403
1253
|
<div id="ai-tool-codex" class="ai-tool-panel" data-tool-panel="codex">
|
|
@@ -1405,10 +1255,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
1405
1255
|
<label class="form-label" id="ai-codexCliPath-label">CLI Path</label>
|
|
1406
1256
|
<input id="ai-codexCliPath" class="form-input mono" type="text" />
|
|
1407
1257
|
</div>
|
|
1408
|
-
<div class="form-group">
|
|
1409
|
-
<label class="form-label" id="ai-codexTimeoutMs-label">Timeout (ms)</label>
|
|
1410
|
-
<input id="ai-codexTimeoutMs" class="form-input" type="number" min="1" />
|
|
1411
|
-
</div>
|
|
1412
1258
|
<div class="form-group">
|
|
1413
1259
|
<label class="form-label" id="ai-codexProxy-label">Proxy (optional)</label>
|
|
1414
1260
|
<input id="ai-codexProxy" class="form-input mono" type="text" />
|
|
@@ -1420,10 +1266,51 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
1420
1266
|
<label class="form-label" id="ai-codebuddyCliPath-label">CLI Path</label>
|
|
1421
1267
|
<input id="ai-codebuddyCliPath" class="form-input mono" type="text" />
|
|
1422
1268
|
</div>
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1269
|
+
</div>
|
|
1270
|
+
</div>
|
|
1271
|
+
</div>
|
|
1272
|
+
</div>
|
|
1273
|
+
</section>
|
|
1274
|
+
|
|
1275
|
+
<!-- Standalone JSON editors (~/.open-im/config.json & ~/.claude/settings.json) -->
|
|
1276
|
+
<section class="section" id="configFilesSection">
|
|
1277
|
+
<div class="section-header">
|
|
1278
|
+
<h2 class="section-title" id="configFilesTitle">Config files</h2>
|
|
1279
|
+
<p class="section-description" id="configFilesHint"></p>
|
|
1280
|
+
</div>
|
|
1281
|
+
<div class="config-files-stack">
|
|
1282
|
+
<div class="card config-file-card">
|
|
1283
|
+
<div class="card-header">
|
|
1284
|
+
<h3 class="card-title mono" id="openImConfigCardTitle">~/.open-im/config.json</h3>
|
|
1285
|
+
</div>
|
|
1286
|
+
<div class="card-body">
|
|
1287
|
+
<p class="form-hint" id="openImConfigCardHint"></p>
|
|
1288
|
+
<div style="display:flex; justify-content:flex-end; gap:8px; margin-bottom:8px;">
|
|
1289
|
+
<button type="button" id="formatJsonButton" class="btn btn-sm btn-ghost"><span id="formatJsonButtonText">Format</span></button>
|
|
1290
|
+
<button type="button" id="resetJsonButton" class="btn btn-sm btn-ghost"><span id="resetJsonButtonText">Reset</span></button>
|
|
1291
|
+
</div>
|
|
1292
|
+
<textarea id="configJson" class="form-input mono" rows="18" style="font-family:monospace; font-size:13px; line-height:1.5; min-height:360px; resize:vertical; white-space:pre;" spellcheck="false"></textarea>
|
|
1293
|
+
<div id="jsonValidationMessage" class="message hidden" style="margin-top:6px;" aria-live="polite"></div>
|
|
1294
|
+
<div style="margin-top: 10px;">
|
|
1295
|
+
<button type="button" id="saveOpenImConfigBtn" class="btn btn-secondary btn-sm"><span id="saveOpenImConfigBtnText">Save</span></button>
|
|
1296
|
+
</div>
|
|
1297
|
+
</div>
|
|
1298
|
+
</div>
|
|
1299
|
+
<div class="card config-file-card">
|
|
1300
|
+
<div class="card-header">
|
|
1301
|
+
<h3 class="card-title mono" id="claudeSettingsCardTitle">~/.claude/settings.json</h3>
|
|
1302
|
+
</div>
|
|
1303
|
+
<div class="card-body">
|
|
1304
|
+
<p class="form-hint" id="claudeSettingsCardHint"></p>
|
|
1305
|
+
<textarea
|
|
1306
|
+
id="claudeSettingsEditor"
|
|
1307
|
+
class="form-input mono"
|
|
1308
|
+
rows="12"
|
|
1309
|
+
style="min-height: 220px; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical;"
|
|
1310
|
+
spellcheck="false"
|
|
1311
|
+
></textarea>
|
|
1312
|
+
<div style="margin-top: 10px;">
|
|
1313
|
+
<button type="button" id="saveClaudeSettingsBtn" class="btn btn-secondary btn-sm"><span id="saveClaudeSettingsBtnText">Save</span></button>
|
|
1427
1314
|
</div>
|
|
1428
1315
|
</div>
|
|
1429
1316
|
</div>
|
|
@@ -1452,17 +1339,6 @@ export const PAGE_HTML_PREFIX = String.raw `<!doctype html>
|
|
|
1452
1339
|
</div>
|
|
1453
1340
|
</section>
|
|
1454
1341
|
|
|
1455
|
-
<div id="onboardingBackdrop" class="onboarding-backdrop hidden" role="dialog" aria-modal="true" aria-labelledby="onboardingTitle">
|
|
1456
|
-
<div class="onboarding-card">
|
|
1457
|
-
<h2 id="onboardingTitle">Welcome</h2>
|
|
1458
|
-
<div id="onboardingBody" class="onboarding-body"></div>
|
|
1459
|
-
<div class="onboarding-actions">
|
|
1460
|
-
<button type="button" class="btn btn-primary" id="onboardingDismiss">Got it</button>
|
|
1461
|
-
<a href="https://github.com/wu529778790/open-im/blob/main/README.zh-CN.md" target="_blank" rel="noopener" class="btn btn-ghost" id="onboardingReadmeLink"><span id="onboardingReadme">README</span></a>
|
|
1462
|
-
</div>
|
|
1463
|
-
</div>
|
|
1464
|
-
</div>
|
|
1465
|
-
|
|
1466
1342
|
</div>
|
|
1467
1343
|
</main>
|
|
1468
1344
|
</div>
|
package/dist/config-web.js
CHANGED
|
@@ -278,7 +278,6 @@ function buildInitialPayload(file) {
|
|
|
278
278
|
ai: {
|
|
279
279
|
aiCommand: file.aiCommand ?? "claude",
|
|
280
280
|
claudeWorkDir: file.tools?.claude?.workDir ?? process.cwd(),
|
|
281
|
-
claudeTimeoutMs: file.tools?.claude?.timeoutMs ?? 600000,
|
|
282
281
|
claudeConfigPath: process.platform === 'win32'
|
|
283
282
|
? getClaudeConfigHome() + "\\.claude\\settings.json"
|
|
284
283
|
: getClaudeConfigHome() + "/.claude/settings.json",
|
|
@@ -286,8 +285,6 @@ function buildInitialPayload(file) {
|
|
|
286
285
|
claudeBaseUrl: claudeEnv.ANTHROPIC_BASE_URL ?? "",
|
|
287
286
|
claudeModel: claudeEnv.ANTHROPIC_MODEL ?? "",
|
|
288
287
|
claudeProxy: file.tools?.claude?.proxy ?? "",
|
|
289
|
-
codexTimeoutMs: file.tools?.codex?.timeoutMs ?? 600000,
|
|
290
|
-
codebuddyTimeoutMs: file.tools?.codebuddy?.timeoutMs ?? 600000,
|
|
291
288
|
codexCliPath: file.tools?.codex?.cliPath ?? "codex",
|
|
292
289
|
codebuddyCliPath: file.tools?.codebuddy?.cliPath ?? "codebuddy",
|
|
293
290
|
codexProxy: file.tools?.codex?.proxy ?? "",
|
|
@@ -327,12 +324,6 @@ function validatePayload(payload) {
|
|
|
327
324
|
errors.push("WorkBuddy user ID is required.");
|
|
328
325
|
if (!clean(payload.ai.claudeWorkDir))
|
|
329
326
|
errors.push("Default work directory is required.");
|
|
330
|
-
if (!Number.isFinite(payload.ai.claudeTimeoutMs) || payload.ai.claudeTimeoutMs <= 0)
|
|
331
|
-
errors.push("Claude timeout must be positive.");
|
|
332
|
-
if (!Number.isFinite(payload.ai.codexTimeoutMs) || payload.ai.codexTimeoutMs <= 0)
|
|
333
|
-
errors.push("Codex timeout must be positive.");
|
|
334
|
-
if (!Number.isFinite(payload.ai.codebuddyTimeoutMs) || payload.ai.codebuddyTimeoutMs <= 0)
|
|
335
|
-
errors.push("CodeBuddy timeout must be positive.");
|
|
336
327
|
return errors;
|
|
337
328
|
}
|
|
338
329
|
function validateConfigForPlatform(platform, config) {
|
|
@@ -422,9 +413,6 @@ function createProbeConfig(values) {
|
|
|
422
413
|
aiCommand: "claude",
|
|
423
414
|
codexCliPath: "codex",
|
|
424
415
|
claudeWorkDir: process.cwd(),
|
|
425
|
-
claudeTimeoutMs: 600000,
|
|
426
|
-
codexTimeoutMs: 600000,
|
|
427
|
-
codebuddyTimeoutMs: 600000,
|
|
428
416
|
logDir: "",
|
|
429
417
|
logLevel: "INFO",
|
|
430
418
|
codebuddyCliPath: "codebuddy",
|
|
@@ -588,7 +576,6 @@ function toFileConfig(payload, existing) {
|
|
|
588
576
|
claude: {
|
|
589
577
|
...existing.tools?.claude,
|
|
590
578
|
workDir: clean(payload.ai.claudeWorkDir) ?? process.cwd(),
|
|
591
|
-
timeoutMs: payload.ai.claudeTimeoutMs,
|
|
592
579
|
proxy: clean(payload.ai.claudeProxy),
|
|
593
580
|
// model is now saved to ~/.claude/settings.json as env var
|
|
594
581
|
},
|
|
@@ -596,13 +583,11 @@ function toFileConfig(payload, existing) {
|
|
|
596
583
|
...existing.tools?.codex,
|
|
597
584
|
cliPath: clean(payload.ai.codexCliPath) ?? "codex",
|
|
598
585
|
workDir: clean(payload.ai.claudeWorkDir) ?? process.cwd(),
|
|
599
|
-
timeoutMs: payload.ai.codexTimeoutMs,
|
|
600
586
|
proxy: clean(payload.ai.codexProxy),
|
|
601
587
|
},
|
|
602
588
|
codebuddy: {
|
|
603
589
|
...existing.tools?.codebuddy,
|
|
604
590
|
cliPath: clean(payload.ai.codebuddyCliPath) ?? "codebuddy",
|
|
605
|
-
timeoutMs: payload.ai.codebuddyTimeoutMs,
|
|
606
591
|
},
|
|
607
592
|
},
|
|
608
593
|
platforms: {
|
package/dist/config.d.ts
CHANGED
|
@@ -28,9 +28,6 @@ export interface Config {
|
|
|
28
28
|
claudeProxy?: string;
|
|
29
29
|
/** Codex 访问 chatgpt.com 的代理(如 http://127.0.0.1:7890) */
|
|
30
30
|
codexProxy?: string;
|
|
31
|
-
claudeTimeoutMs: number;
|
|
32
|
-
codexTimeoutMs: number;
|
|
33
|
-
codebuddyTimeoutMs: number;
|
|
34
31
|
claudeWorkDir: string;
|
|
35
32
|
claudeModel?: string;
|
|
36
33
|
logDir: string;
|
|
@@ -137,7 +134,6 @@ interface FilePlatformWorkBuddy {
|
|
|
137
134
|
export interface FileToolClaude {
|
|
138
135
|
cliPath?: string;
|
|
139
136
|
workDir?: string;
|
|
140
|
-
timeoutMs?: number;
|
|
141
137
|
skipPermissions?: boolean;
|
|
142
138
|
/** HTTP/HTTPS 代理,用于访问 Claude API(如 http://127.0.0.1:7890) */
|
|
143
139
|
proxy?: string;
|
|
@@ -147,13 +143,11 @@ export interface FileToolClaude {
|
|
|
147
143
|
export interface FileToolCodex {
|
|
148
144
|
cliPath?: string;
|
|
149
145
|
workDir?: string;
|
|
150
|
-
timeoutMs?: number;
|
|
151
146
|
/** HTTP/HTTPS 代理,用于访问 chatgpt.com(如 http://127.0.0.1:7890) */
|
|
152
147
|
proxy?: string;
|
|
153
148
|
}
|
|
154
149
|
export interface FileToolCodeBuddy {
|
|
155
150
|
cliPath?: string;
|
|
156
|
-
timeoutMs?: number;
|
|
157
151
|
}
|
|
158
152
|
export interface FileConfig {
|
|
159
153
|
telegramBotToken?: string;
|
package/dist/config.js
CHANGED
|
@@ -20,7 +20,8 @@ const CODEX_AUTH_PATHS = [
|
|
|
20
20
|
];
|
|
21
21
|
const OLD_ROOT_KEYS = [
|
|
22
22
|
'claudeWorkDir',
|
|
23
|
-
'claudeTimeoutMs',
|
|
23
|
+
'claudeTimeoutMs',
|
|
24
|
+
'claudeModel',
|
|
24
25
|
];
|
|
25
26
|
// Config cache with mtime tracking
|
|
26
27
|
let cachedConfig = null;
|
|
@@ -57,7 +58,6 @@ function migrateToNewConfigFormat(raw) {
|
|
|
57
58
|
claude: {
|
|
58
59
|
...tc,
|
|
59
60
|
workDir: tc.workDir ?? raw.claudeWorkDir ?? process.cwd(),
|
|
60
|
-
timeoutMs: tc.timeoutMs ?? raw.claudeTimeoutMs ?? 600000,
|
|
61
61
|
proxy: tc.proxy,
|
|
62
62
|
// model 现在通过 env 配置,不再在这里处理
|
|
63
63
|
},
|
|
@@ -65,13 +65,11 @@ function migrateToNewConfigFormat(raw) {
|
|
|
65
65
|
...tcod,
|
|
66
66
|
cliPath: tcod.cliPath ?? 'codex',
|
|
67
67
|
workDir: tcod.workDir ?? raw.claudeWorkDir ?? process.cwd(),
|
|
68
|
-
timeoutMs: tcod.timeoutMs ?? raw.claudeTimeoutMs ?? 600000,
|
|
69
68
|
proxy: tcod.proxy,
|
|
70
69
|
},
|
|
71
70
|
codebuddy: {
|
|
72
71
|
...tcb,
|
|
73
72
|
cliPath: tcb.cliPath ?? 'codebuddy',
|
|
74
|
-
timeoutMs: tcb.timeoutMs ?? raw.claudeTimeoutMs ?? 600000,
|
|
75
73
|
},
|
|
76
74
|
};
|
|
77
75
|
for (const k of OLD_ROOT_KEYS) {
|
|
@@ -407,15 +405,6 @@ export function loadConfig() {
|
|
|
407
405
|
}
|
|
408
406
|
}
|
|
409
407
|
const claudeWorkDir = process.env.CLAUDE_WORK_DIR ?? tc.workDir ?? process.cwd();
|
|
410
|
-
const claudeTimeoutMs = process.env.CLAUDE_TIMEOUT_MS !== undefined
|
|
411
|
-
? parseInt(process.env.CLAUDE_TIMEOUT_MS, 10) || 600000
|
|
412
|
-
: tc.timeoutMs ?? 600000;
|
|
413
|
-
const codexTimeoutMs = process.env.CODEX_TIMEOUT_MS !== undefined
|
|
414
|
-
? parseInt(process.env.CODEX_TIMEOUT_MS, 10) || 600000
|
|
415
|
-
: tcod.timeoutMs ?? 600000;
|
|
416
|
-
const codebuddyTimeoutMs = process.env.CODEBUDDY_TIMEOUT_MS !== undefined
|
|
417
|
-
? parseInt(process.env.CODEBUDDY_TIMEOUT_MS, 10) || 600000
|
|
418
|
-
: tcb.timeoutMs ?? 600000;
|
|
419
408
|
// 6. 校验 Claude API 凭证(SDK 模式需要)
|
|
420
409
|
// 支持:官方 API Key、Auth Token、或自定义 API(第三方模型等,BASE_URL + token)
|
|
421
410
|
if (aiCommand === 'claude') {
|
|
@@ -639,9 +628,6 @@ export function loadConfig() {
|
|
|
639
628
|
claudeProxy,
|
|
640
629
|
codexProxy,
|
|
641
630
|
claudeWorkDir,
|
|
642
|
-
claudeTimeoutMs,
|
|
643
|
-
codexTimeoutMs,
|
|
644
|
-
codebuddyTimeoutMs,
|
|
645
631
|
claudeModel: process.env.ANTHROPIC_MODEL,
|
|
646
632
|
logDir,
|
|
647
633
|
logLevel,
|
|
@@ -6,7 +6,6 @@ import { ackMessage, downloadRobotMessageFile, registerSessionWebhook } from './
|
|
|
6
6
|
import { CommandHandler } from '../commands/handler.js';
|
|
7
7
|
import { getAdapter } from '../adapters/registry.js';
|
|
8
8
|
import { runAITask } from '../shared/ai-task.js';
|
|
9
|
-
import { startTaskCleanup } from '../shared/task-cleanup.js';
|
|
10
9
|
import { setActiveChatId, setDingTalkActiveTarget } from '../shared/active-chats.js';
|
|
11
10
|
import { setChatUser } from '../shared/chat-user-map.js';
|
|
12
11
|
import { createLogger } from '../logger.js';
|
|
@@ -159,7 +158,6 @@ export function setupDingTalkHandlers(config, sessionManager) {
|
|
|
159
158
|
const accessControl = new AccessControl(config.dingtalkAllowedUserIds);
|
|
160
159
|
const requestQueue = new RequestQueue();
|
|
161
160
|
const runningTasks = new Map();
|
|
162
|
-
const stopTaskCleanup = startTaskCleanup(runningTasks);
|
|
163
161
|
const commandHandler = new CommandHandler({
|
|
164
162
|
config,
|
|
165
163
|
sessionManager,
|
|
@@ -301,7 +299,7 @@ export function setupDingTalkHandlers(config, sessionManager) {
|
|
|
301
299
|
ackMessage(callbackId, { queued: enqueueResult });
|
|
302
300
|
}
|
|
303
301
|
return {
|
|
304
|
-
stop: () =>
|
|
302
|
+
stop: () => { },
|
|
305
303
|
getRunningTaskCount: () => runningTasks.size,
|
|
306
304
|
handleEvent,
|
|
307
305
|
};
|
|
@@ -7,7 +7,6 @@ import { getAdapter } from '../adapters/registry.js';
|
|
|
7
7
|
import { runAITask } from '../shared/ai-task.js';
|
|
8
8
|
import { buildCardV2 } from './card-builder.js';
|
|
9
9
|
import { disableStreaming, updateCardFull, destroySession } from './cardkit-manager.js';
|
|
10
|
-
import { startTaskCleanup } from '../shared/task-cleanup.js';
|
|
11
10
|
import { CARDKIT_THROTTLE_MS } from '../constants.js';
|
|
12
11
|
import { setActiveChatId } from '../shared/active-chats.js';
|
|
13
12
|
import { setChatUser } from '../shared/chat-user-map.js';
|
|
@@ -126,7 +125,6 @@ export function setupFeishuHandlers(config, sessionManager) {
|
|
|
126
125
|
const accessControl = new AccessControl(config.feishuAllowedUserIds);
|
|
127
126
|
const requestQueue = new RequestQueue();
|
|
128
127
|
const runningTasks = new Map();
|
|
129
|
-
const stopTaskCleanup = startTaskCleanup(runningTasks);
|
|
130
128
|
const commandHandler = new CommandHandler({
|
|
131
129
|
config,
|
|
132
130
|
sessionManager,
|
|
@@ -608,7 +606,7 @@ export function setupFeishuHandlers(config, sessionManager) {
|
|
|
608
606
|
}
|
|
609
607
|
}
|
|
610
608
|
return {
|
|
611
|
-
stop: () =>
|
|
609
|
+
stop: () => { },
|
|
612
610
|
getRunningTaskCount: () => runningTasks.size,
|
|
613
611
|
handleEvent,
|
|
614
612
|
};
|