codexmate 0.0.31 → 0.0.33
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 +92 -308
- package/README.zh.md +94 -318
- package/cli/local-bridge.js +227 -0
- package/cli/update.js +162 -0
- package/cli.js +357 -112
- package/lib/cli-sessions.js +16 -6
- package/lib/win-tray.js +119 -0
- package/package.json +2 -2
- package/web-ui/app.js +4 -0
- package/web-ui/logic.sessions.mjs +17 -1
- package/web-ui/modules/app.computed.session.mjs +51 -315
- package/web-ui/modules/app.methods.agents.mjs +19 -0
- package/web-ui/modules/app.methods.claude-config.mjs +71 -2
- package/web-ui/modules/app.methods.codex-config.mjs +20 -0
- package/web-ui/modules/app.methods.providers.mjs +53 -7
- package/web-ui/modules/app.methods.session-actions.mjs +1 -1
- package/web-ui/modules/app.methods.session-browser.mjs +29 -1
- package/web-ui/modules/app.methods.startup-claude.mjs +4 -0
- package/web-ui/modules/i18n.dict.mjs +21 -3
- package/web-ui/partials/index/layout-header.html +1 -2
- package/web-ui/partials/index/modal-config-template-agents.html +12 -1
- package/web-ui/partials/index/modals-basic.html +14 -3
- package/web-ui/partials/index/panel-config-claude.html +57 -85
- package/web-ui/partials/index/panel-config-codex.html +60 -226
- package/web-ui/partials/index/panel-dashboard.html +0 -33
- package/web-ui/partials/index/panel-docs.html +21 -53
- package/web-ui/partials/index/panel-sessions.html +37 -20
- package/web-ui/partials/index/panel-trash.html +33 -38
- package/web-ui/partials/index/panel-usage.html +71 -304
- package/web-ui/styles/controls-forms.css +11 -0
- package/web-ui/styles/docs-panel.css +57 -83
- package/web-ui/styles/layout-shell.css +26 -24
- package/web-ui/styles/modals-core.css +33 -0
- package/web-ui/styles/responsive.css +5 -67
- package/web-ui/styles/sessions-list.css +274 -8
- package/web-ui/styles/sessions-toolbar-trash.css +185 -15
- package/web-ui/styles/sessions-usage.css +336 -788
|
@@ -22,26 +22,27 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
<div v-else>
|
|
24
24
|
<div class="selector-section">
|
|
25
|
-
<div class="selector-header">
|
|
25
|
+
<div class="selector-header" style="display:none">
|
|
26
26
|
<span class="selector-title">{{ t('sessions.sourceTitle') }}</span>
|
|
27
|
-
<div class="selector-actions sessions-header-actions">
|
|
28
|
-
<button class="btn-tool btn-tool-compact" @click="loadSessions({ forceRefresh: true })" :disabled="sessionsLoading">
|
|
29
|
-
{{ sessionsLoading ? t('sessions.refreshing') : t('sessions.refresh') }}
|
|
30
|
-
</button>
|
|
31
|
-
<button class="btn-tool btn-tool-compact" type="button" @click="switchMainTab('dashboard')">
|
|
32
|
-
{{ t('dashboard.doctor.title') }}
|
|
33
|
-
</button>
|
|
34
|
-
</div>
|
|
27
|
+
<div class="selector-actions sessions-header-actions"></div>
|
|
35
28
|
</div>
|
|
36
29
|
<div class="session-toolbar">
|
|
37
30
|
<div class="session-toolbar-group session-toolbar-primary">
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
<div class="session-source-pills" role="radiogroup" aria-label="Session source">
|
|
32
|
+
<button
|
|
33
|
+
v-for="src in sessionSourceOptions"
|
|
34
|
+
:key="src.value"
|
|
35
|
+
:class="['session-source-pill', { active: sessionFilterSource === src.value }]"
|
|
36
|
+
:data-source="src.value"
|
|
37
|
+
@click="setSessionSource(src.value)"
|
|
38
|
+
:disabled="sessionsLoading"
|
|
39
|
+
:aria-pressed="sessionFilterSource === src.value"
|
|
40
|
+
role="radio"
|
|
41
|
+
type="button">
|
|
42
|
+
<span class="session-source-pill-dot"></span>
|
|
43
|
+
<span class="session-source-pill-label">{{ src.label }}</span>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
45
46
|
<select
|
|
46
47
|
class="session-path-select"
|
|
47
48
|
v-model="sessionPathFilter"
|
|
@@ -89,6 +90,12 @@
|
|
|
89
90
|
<option value="time">{{ t('sessions.sort.time') }}</option>
|
|
90
91
|
<option value="hot">{{ t('sessions.sort.hot') }}</option>
|
|
91
92
|
</select>
|
|
93
|
+
<button class="btn-tool btn-tool-compact" @click="loadSessions({ forceRefresh: true })" :disabled="sessionsLoading" :title="t('sessions.refresh')">
|
|
94
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="btn-icon-sm"><path d="M21 2v6h-6M3 12a9 9 0 0 1 15-6.7L21 8M3 22v-6h6M21 12a9 9 0 0 1-15 6.7L3 16"/></svg>
|
|
95
|
+
</button>
|
|
96
|
+
<button class="btn-tool btn-tool-compact" type="button" @click="switchMainTab('dashboard')" :title="t('dashboard.doctor.title')">
|
|
97
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="btn-icon-sm"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
|
|
98
|
+
</button>
|
|
92
99
|
<button class="btn-tool btn-tool-compact" type="button" @click="copySessionsFilterShareUrl" :disabled="sessionsLoading">
|
|
93
100
|
{{ t('sessions.filters.copyLink') }}
|
|
94
101
|
</button>
|
|
@@ -129,7 +136,7 @@
|
|
|
129
136
|
<div
|
|
130
137
|
v-for="session in visibleSessionsList"
|
|
131
138
|
:key="session.source + '-' + session.sessionId + '-' + session.filePath"
|
|
132
|
-
v-memo="[activeSessionExportKey === getSessionExportKey(session), session.messageCount, session.updatedAt, session.title, session.sourceLabel, session.cwd, isSessionPinned(session), sessionsLoading]"
|
|
139
|
+
v-memo="[activeSessionExportKey === getSessionExportKey(session), session.messageCount, session.updatedAt, session.title, session.sourceLabel, session.cwd, isSessionPinned(session), sessionsLoading, session.match && session.match.count]"
|
|
133
140
|
:class="[
|
|
134
141
|
'session-item',
|
|
135
142
|
{
|
|
@@ -147,6 +154,13 @@
|
|
|
147
154
|
<div class="session-item-main">
|
|
148
155
|
<div class="session-item-title">{{ session.title || session.sessionId }}</div>
|
|
149
156
|
<span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
|
|
157
|
+
<span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
|
|
158
|
+
<span
|
|
159
|
+
v-if="sessionContextUtilization[getSessionExportKey(session)] && sessionContextUtilization[getSessionExportKey(session)].percent > 0"
|
|
160
|
+
:class="['session-context-badge', 'session-context-' + sessionContextUtilization[getSessionExportKey(session)].level]"
|
|
161
|
+
:title="'Context: ' + sessionContextUtilization[getSessionExportKey(session)].percent + '%'">
|
|
162
|
+
{{ sessionContextUtilization[getSessionExportKey(session)].percent }}%
|
|
163
|
+
</span>
|
|
150
164
|
</div>
|
|
151
165
|
<div class="session-item-actions">
|
|
152
166
|
<button
|
|
@@ -178,10 +192,13 @@
|
|
|
178
192
|
</div>
|
|
179
193
|
</div>
|
|
180
194
|
<div class="session-item-meta">
|
|
181
|
-
<span class="session-source">{{ session.sourceLabel }}</span>
|
|
195
|
+
<span class="session-source" :data-source="session.source">{{ session.sourceLabel }}</span>
|
|
182
196
|
<span class="session-item-time">{{ session.updatedAt || t('sessions.unknownTime') }}</span>
|
|
183
197
|
<span v-if="getSessionHotLabel(session)" class="session-item-hot">{{ getSessionHotLabel(session) }}</span>
|
|
184
198
|
<span v-if="session.cwd" class="session-item-cwd session-item-sub">{{ session.cwd }}</span>
|
|
199
|
+
<div v-if="session.match && session.match.snippets && session.match.snippets.length" class="session-match-snippets">
|
|
200
|
+
<div v-for="(snip, si) in session.match.snippets.slice(0, 2)" :key="si" class="session-match-snippet">{{ snip }}</div>
|
|
201
|
+
</div>
|
|
185
202
|
</div>
|
|
186
203
|
</div>
|
|
187
204
|
</div>
|
|
@@ -194,7 +211,7 @@
|
|
|
194
211
|
<div>
|
|
195
212
|
<div class="session-preview-title">{{ activeSession.title || activeSession.sessionId }}</div>
|
|
196
213
|
<div class="session-preview-meta">
|
|
197
|
-
<span class="session-preview-meta-item">{{ activeSession.sourceLabel }}</span>
|
|
214
|
+
<span class="session-preview-meta-item session-source" :data-source="activeSession.source">{{ activeSession.sourceLabel }}</span>
|
|
198
215
|
<span class="session-preview-meta-item">{{ activeSession.updatedAt || t('sessions.unknownTime') }}</span>
|
|
199
216
|
</div>
|
|
200
217
|
<div class="session-preview-meta" v-if="activeSession.cwd">
|
|
@@ -268,7 +285,7 @@
|
|
|
268
285
|
<span class="session-msg-time">{{ msg.timestamp || '' }}</span>
|
|
269
286
|
</div>
|
|
270
287
|
</div>
|
|
271
|
-
<div class="session-msg-content"
|
|
288
|
+
<div class="session-msg-content" v-html="highlightQueryText(msg.text) || ''"></div>
|
|
272
289
|
</div>
|
|
273
290
|
</div>
|
|
274
291
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- 回收站面板 -->
|
|
2
2
|
<div
|
|
3
3
|
v-show="mainTab === 'trash'"
|
|
4
4
|
class="mode-content"
|
|
@@ -6,22 +6,30 @@
|
|
|
6
6
|
role="tabpanel"
|
|
7
7
|
aria-labelledby="tab-trash">
|
|
8
8
|
<div v-if="!loading" class="trash-panel-shell">
|
|
9
|
-
<!-- 空态
|
|
9
|
+
<!-- 空态 -->
|
|
10
10
|
<div v-if="getSessionTrashViewState() === 'empty'" class="trash-empty-state">
|
|
11
|
-
<
|
|
11
|
+
<svg class="trash-empty-svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="1.2">
|
|
12
|
+
<path d="M20 22l4 32h16l4-32"/>
|
|
13
|
+
<path d="M14 22h36"/>
|
|
14
|
+
<path d="M24 22v-4a4 4 0 014-4h8a4 4 0 014 4v4"/>
|
|
15
|
+
<path d="M28 30v16M36 30v16" stroke-width="1.6" stroke-linecap="round"/>
|
|
16
|
+
</svg>
|
|
12
17
|
<div class="trash-empty-title">{{ t('settings.trash.empty') }}</div>
|
|
13
|
-
<div class="trash-empty-hint"
|
|
18
|
+
<div class="trash-empty-hint">删除的会话保留 {{ sessionTrashRetentionDays }} 天后自动清理</div>
|
|
14
19
|
</div>
|
|
15
20
|
|
|
16
21
|
<!-- 加载态 -->
|
|
17
22
|
<div v-else-if="getSessionTrashViewState() === 'loading'" class="trash-empty-state">
|
|
18
|
-
<div class="trash-
|
|
23
|
+
<div class="trash-spinner"></div>
|
|
19
24
|
<div class="trash-empty-title">{{ t('settings.trash.loading') }}</div>
|
|
20
25
|
</div>
|
|
21
26
|
|
|
22
27
|
<!-- 错误态 -->
|
|
23
28
|
<div v-else-if="getSessionTrashViewState() === 'retry'" class="trash-empty-state">
|
|
24
|
-
<
|
|
29
|
+
<svg class="trash-empty-svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="1.2">
|
|
30
|
+
<circle cx="32" cy="32" r="22"/>
|
|
31
|
+
<path d="M32 20v16M32 44v2" stroke-width="2" stroke-linecap="round"/>
|
|
32
|
+
</svg>
|
|
25
33
|
<div class="trash-empty-title">{{ t('settings.trash.retry') }}</div>
|
|
26
34
|
<button class="btn-tool" @click="loadSessionTrash({ forceRefresh: true })">重试</button>
|
|
27
35
|
</div>
|
|
@@ -31,58 +39,45 @@
|
|
|
31
39
|
<div class="trash-toolbar">
|
|
32
40
|
<div class="trash-toolbar-left">
|
|
33
41
|
<span class="trash-toolbar-count">{{ sessionTrashCount }} 个已删除会话</span>
|
|
34
|
-
<span class="trash-toolbar-retention"
|
|
42
|
+
<span class="trash-toolbar-retention">{{ sessionTrashRetentionDays }} 天后自动清理</span>
|
|
35
43
|
</div>
|
|
36
44
|
<div class="trash-toolbar-right">
|
|
37
|
-
<button class="btn-mini" @click="loadSessionTrash({ forceRefresh: true })" :disabled="sessionTrashLoading">
|
|
38
|
-
|
|
45
|
+
<button class="btn-mini" @click="loadSessionTrash({ forceRefresh: true })" :disabled="sessionTrashLoading" :title="t('sessions.refresh')">
|
|
46
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="btn-icon-sm"><path d="M21 2v6h-6M3 12a9 9 0 0115-6.7L21 8M3 22v-6h6M21 12a9 9 0 01-15 6.7L3 16"/></svg>
|
|
39
47
|
</button>
|
|
40
48
|
<button class="btn-mini delete" @click="clearSessionTrash" :disabled="sessionTrashClearing || sessionTrashLoading || !(Number(sessionTrashCount) > 0)">
|
|
41
|
-
{{ sessionTrashClearing ? '清空中…' : '
|
|
49
|
+
{{ sessionTrashClearing ? '清空中…' : '清空' }}
|
|
42
50
|
</button>
|
|
43
51
|
</div>
|
|
44
52
|
</div>
|
|
45
53
|
|
|
46
54
|
<div class="trash-list">
|
|
47
|
-
<div v-for="item in visibleSessionTrashItems" :key="item.trashId" class="trash-item
|
|
48
|
-
<div class="trash-item-
|
|
55
|
+
<div v-for="item in visibleSessionTrashItems" :key="item.trashId" class="trash-item">
|
|
56
|
+
<div class="trash-item-body">
|
|
49
57
|
<div class="trash-item-main">
|
|
50
|
-
<div class="trash-item-
|
|
51
|
-
|
|
52
|
-
<span class="session-
|
|
53
|
-
</div>
|
|
54
|
-
<div class="trash-item-meta session-item-meta">
|
|
55
|
-
<span class="session-source">{{ item.sourceLabel }}</span>
|
|
56
|
-
<span class="trash-item-dot">·</span>
|
|
58
|
+
<div class="trash-item-title">{{ item.title || item.sessionId }}</div>
|
|
59
|
+
<div class="trash-item-meta">
|
|
60
|
+
<span class="session-source" :data-source="item.source">{{ item.sourceLabel }}</span>
|
|
57
61
|
<span class="trash-item-time">{{ item.deletedAt || item.updatedAt || t('sessions.unknownTime') }}</span>
|
|
62
|
+
<span v-if="item.cwd" class="trash-item-cwd">{{ item.cwd }}</span>
|
|
58
63
|
</div>
|
|
59
64
|
</div>
|
|
60
|
-
<div class="trash-item-
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
</button>
|
|
68
|
-
</div>
|
|
65
|
+
<div class="trash-item-actions">
|
|
66
|
+
<button class="trash-action-btn restore" @click="restoreSessionTrash(item)" :disabled="sessionTrashLoading || sessionTrashClearing || isSessionTrashActionBusy(item)" :title="sessionTrashRestoring[getSessionTrashActionKey(item)] ? '恢复中…' : '恢复'">
|
|
67
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12a9 9 0 119 9"/><path d="M3 4v6h6"/></svg>
|
|
68
|
+
</button>
|
|
69
|
+
<button class="trash-action-btn delete" @click="purgeSessionTrash(item)" :disabled="sessionTrashLoading || sessionTrashClearing || isSessionTrashActionBusy(item)" :title="sessionTrashPurging[getSessionTrashActionKey(item)] ? '删除中…' : '彻底删除'">
|
|
70
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6M10 11v6M14 11v6"/></svg>
|
|
71
|
+
</button>
|
|
69
72
|
</div>
|
|
70
73
|
</div>
|
|
71
|
-
<div v-if="item.cwd" class="trash-item-path session-item-sub session-item-wrap">
|
|
72
|
-
<span class="trash-item-label">{{ t('settings.trash.workspace') }}</span>
|
|
73
|
-
<span>{{ item.cwd }}</span>
|
|
74
|
-
</div>
|
|
75
|
-
<div class="trash-item-path session-item-sub session-item-wrap">
|
|
76
|
-
<span class="trash-item-label">{{ t('settings.trash.originalFile') }}</span>
|
|
77
|
-
<span>{{ item.originalFilePath }}</span>
|
|
78
|
-
</div>
|
|
79
74
|
</div>
|
|
80
75
|
<div v-if="sessionTrashHasMoreItems" class="trash-list-footer">
|
|
81
76
|
<button class="btn-tool btn-tool-compact" @click="loadMoreSessionTrashItems" :disabled="sessionTrashLoading || sessionTrashClearing">
|
|
82
|
-
|
|
77
|
+
加载更多({{ sessionTrashHiddenCount }} 条)
|
|
83
78
|
</button>
|
|
84
79
|
</div>
|
|
85
80
|
</div>
|
|
86
81
|
</template>
|
|
87
82
|
</div>
|
|
88
|
-
</div>
|
|
83
|
+
</div>
|