dsh-agent-enhancer 0.3.1 → 0.3.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/README.en.md +15 -22
- package/README.md +15 -22
- package/lib/client/dsh/controls.d.ts.map +1 -1
- package/lib/client/dsh/persist-settings.d.ts +71 -0
- package/lib/client/dsh/persist-settings.d.ts.map +1 -0
- package/lib/client/dsh/settings-form.d.ts +19 -1
- package/lib/client/dsh/settings-form.d.ts.map +1 -1
- package/lib/client/dsh/settings.d.ts +4 -1
- package/lib/client/dsh/settings.d.ts.map +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/locales.d.ts +39 -27
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/rollback/controller.d.ts +1 -0
- package/lib/client/rollback/controller.d.ts.map +1 -1
- package/lib/client/rollback/cut-cache.d.ts +13 -0
- package/lib/client/rollback/cut-cache.d.ts.map +1 -0
- package/lib/client/rollback/modal-host.d.ts.map +1 -1
- package/lib/client/rollback/remote.d.ts +2 -1
- package/lib/client/rollback/remote.d.ts.map +1 -1
- package/lib/client/rollback/scope.d.ts +3 -1
- package/lib/client/rollback/scope.d.ts.map +1 -1
- package/lib/client/rollback/session-stats-dock.d.ts +1 -1
- package/lib/client/rollback/session-stats-dock.d.ts.map +1 -1
- package/lib/client/rollback/session-stats-filter.d.ts +9 -8
- package/lib/client/rollback/session-stats-filter.d.ts.map +1 -1
- package/lib/client/rollback/session-stats-meter.d.ts +4 -2
- package/lib/client/rollback/session-stats-meter.d.ts.map +1 -1
- package/lib/client/rollback/timeline-panel.d.ts +2 -4
- package/lib/client/rollback/timeline-panel.d.ts.map +1 -1
- package/lib/client/rollback/timeline-tab.d.ts +3 -2
- package/lib/client/rollback/timeline-tab.d.ts.map +1 -1
- package/lib/client/rollback/transcript-filter.d.ts +16 -6
- package/lib/client/rollback/transcript-filter.d.ts.map +1 -1
- package/lib/client/rollback/transcript.d.ts +15 -9
- package/lib/client/rollback/transcript.d.ts.map +1 -1
- package/lib/client/rollback/types.d.ts +4 -1
- package/lib/client/rollback/types.d.ts.map +1 -1
- package/lib/client/rollback/user-node.d.ts.map +1 -1
- package/lib/client.js +612 -346
- package/lib/client.js.map +1 -1
- package/lib/config.d.ts +3 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/host/auto-route/classifier.d.ts.map +1 -1
- package/lib/host/auto-route/session-hook.d.ts.map +1 -1
- package/lib/host/auto-route/session-selection.d.ts +5 -1
- package/lib/host/auto-route/session-selection.d.ts.map +1 -1
- package/lib/host/checkpoint/chain-files.d.ts +35 -0
- package/lib/host/checkpoint/chain-files.d.ts.map +1 -0
- package/lib/host/checkpoint/cut-filter.d.ts +9 -0
- package/lib/host/checkpoint/cut-filter.d.ts.map +1 -0
- package/lib/host/checkpoint/cut-live.d.ts +13 -0
- package/lib/host/checkpoint/cut-live.d.ts.map +1 -0
- package/lib/host/checkpoint/cut-store.d.ts +30 -0
- package/lib/host/checkpoint/cut-store.d.ts.map +1 -0
- package/lib/host/checkpoint/dsh.d.ts.map +1 -1
- package/lib/host/checkpoint/files.d.ts.map +1 -1
- package/lib/host/checkpoint/live.d.ts +1 -0
- package/lib/host/checkpoint/live.d.ts.map +1 -1
- package/lib/host/checkpoint/service.d.ts +44 -5
- package/lib/host/checkpoint/service.d.ts.map +1 -1
- package/lib/host/checkpoint/store.d.ts +6 -0
- package/lib/host/checkpoint/store.d.ts.map +1 -1
- package/lib/host/index.d.ts +2 -1
- package/lib/host/index.d.ts.map +1 -1
- package/lib/host/model.d.ts.map +1 -1
- package/lib/host/rpc.d.ts +4 -0
- package/lib/host/rpc.d.ts.map +1 -1
- package/lib/identity.d.ts +1 -1
- package/lib/index.js +1063 -1086
- package/lib/index.js.map +4 -4
- package/package.json +4 -2
package/lib/client.js
CHANGED
|
@@ -1178,6 +1178,7 @@ var import_react = require("react");
|
|
|
1178
1178
|
var styles_default = {
|
|
1179
1179
|
root: "styles_root",
|
|
1180
1180
|
toolbarIcon: "styles_toolbarIcon",
|
|
1181
|
+
toolbarStatus: "styles_toolbarStatus",
|
|
1181
1182
|
settings: "styles_settings",
|
|
1182
1183
|
settingsHeader: "styles_settingsHeader",
|
|
1183
1184
|
settingDescription: "styles_settingDescription",
|
|
@@ -1210,19 +1211,43 @@ var styles_default = {
|
|
|
1210
1211
|
rollbackTimelineLink: "styles_rollbackTimelineLink",
|
|
1211
1212
|
timelineRightPane: "styles_timelineRightPane",
|
|
1212
1213
|
timelinePanel: "styles_timelinePanel",
|
|
1214
|
+
timelineToolbar: "styles_timelineToolbar",
|
|
1215
|
+
timelineSearchRow: "styles_timelineSearchRow",
|
|
1216
|
+
timelineSearch: "styles_timelineSearch",
|
|
1217
|
+
timelineSelectBar: "styles_timelineSelectBar",
|
|
1218
|
+
timelineSelectAll: "styles_timelineSelectAll",
|
|
1219
|
+
timelineBulkActions: "styles_timelineBulkActions",
|
|
1220
|
+
timelineBulkCount: "styles_timelineBulkCount",
|
|
1221
|
+
timelineCheck: "styles_timelineCheck",
|
|
1222
|
+
timelineStats: "styles_timelineStats",
|
|
1223
|
+
timelineStatIn: "styles_timelineStatIn",
|
|
1224
|
+
timelineStatOut: "styles_timelineStatOut",
|
|
1213
1225
|
timelineLead: "styles_timelineLead",
|
|
1214
1226
|
timelineStatus: "styles_timelineStatus",
|
|
1227
|
+
timelineFilters: "styles_timelineFilters",
|
|
1228
|
+
timelineFilter: "styles_timelineFilter",
|
|
1229
|
+
timelineFilterCount: "styles_timelineFilterCount",
|
|
1215
1230
|
timelineList: "styles_timelineList",
|
|
1216
1231
|
timelineItem: "styles_timelineItem",
|
|
1232
|
+
timelinePromptPreview: "styles_timelinePromptPreview",
|
|
1233
|
+
timelineMain: "styles_timelineMain",
|
|
1234
|
+
timelineLeadNote: "styles_timelineLeadNote",
|
|
1235
|
+
timelineBoundaryNote: "styles_timelineBoundaryNote",
|
|
1236
|
+
timelineTipBadge: "styles_timelineTipBadge",
|
|
1237
|
+
timelineRolledBackBadge: "styles_timelineRolledBackBadge",
|
|
1217
1238
|
timelineRow: "styles_timelineRow",
|
|
1218
|
-
|
|
1239
|
+
timelineSwitch: "styles_timelineSwitch",
|
|
1219
1240
|
timelineTurn: "styles_timelineTurn",
|
|
1220
1241
|
timelineRolledBack: "styles_timelineRolledBack",
|
|
1221
1242
|
timelineCoverage: "styles_timelineCoverage",
|
|
1222
1243
|
timelineMeta: "styles_timelineMeta",
|
|
1223
1244
|
timelineTime: "styles_timelineTime",
|
|
1224
|
-
timelinePromptPreview: "styles_timelinePromptPreview",
|
|
1225
1245
|
timelineDetail: "styles_timelineDetail",
|
|
1246
|
+
timelineDetailMeta: "styles_timelineDetailMeta",
|
|
1247
|
+
timelineDetailNote: "styles_timelineDetailNote",
|
|
1248
|
+
timelineActions: "styles_timelineActions",
|
|
1249
|
+
contextExcludedBadge: "styles_contextExcludedBadge",
|
|
1250
|
+
userMessageRow: "styles_userMessageRow",
|
|
1226
1251
|
timelinePrompt: "styles_timelinePrompt",
|
|
1227
1252
|
timelinePromptEmpty: "styles_timelinePromptEmpty",
|
|
1228
1253
|
timelineFilesEmpty: "styles_timelineFilesEmpty",
|
|
@@ -1235,7 +1260,6 @@ var styles_default = {
|
|
|
1235
1260
|
rollbackFile: "styles_rollbackFile",
|
|
1236
1261
|
rollbackMeta: "styles_rollbackMeta",
|
|
1237
1262
|
rollbackConflict: "styles_rollbackConflict",
|
|
1238
|
-
userMessageRow: "styles_userMessageRow",
|
|
1239
1263
|
userMessageActions: "styles_userMessageActions",
|
|
1240
1264
|
userMessageAction: "styles_userMessageAction",
|
|
1241
1265
|
contextMeterRow: "styles_contextMeterRow",
|
|
@@ -1393,7 +1417,7 @@ var styles_default = {
|
|
|
1393
1417
|
usageRecentTokens: "styles_usageRecentTokens"
|
|
1394
1418
|
};
|
|
1395
1419
|
var css_module_default = styles_default;
|
|
1396
|
-
var cssText = '/* src/client/styles.module.css */\n.styles_root {\n position: relative;\n}\n.styles_toolbarIcon {\n width: 28px;\n padding: 0;\n}\n.styles_settings {\n display: grid;\n gap: 16px;\n max-width: 640px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_settings h2,\n.styles_settings h3,\n.styles_settings p {\n margin: 0;\n}\n.styles_settingsHeader {\n display: grid;\n gap: 4px;\n}\n.styles_settingsHeader p,\n.styles_settingDescription,\n.styles_privacy p {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_settingRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n}\n.styles_settingText {\n display: grid;\n gap: 4px;\n min-width: 0;\n}\n.styles_settingText h3,\n.styles_privacy h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_settingControls {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n.styles_settingsBack {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_settingsBack:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_settingsConfigure,\n.styles_settingsActionPrimary {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin: 0;\n min-height: 28px;\n padding: 0 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n font: inherit;\n font-weight: 600;\n line-height: 16px;\n cursor: pointer;\n white-space: nowrap;\n}\n.styles_settingsConfigure {\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-layer-2);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n}\n.styles_settingsConfigure:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_settingsConfigure:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.styles_settingsActionPrimary {\n color: #fff;\n background: #3b7ded;\n box-shadow: 0 0 0 1px color-mix(in srgb, #3b7ded 55%, transparent);\n}\n.styles_settingsActionPrimary:hover:not(:disabled) {\n background: #2f6fe0;\n}\n.styles_settingsActionPrimary:focus-visible {\n outline: 2px solid color-mix(in srgb, #3b7ded 70%, white);\n outline-offset: 2px;\n}\n.styles_settingsActionPrimary:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n.styles_modelPill {\n max-width: 168px;\n}\n.styles_modelPillLabel {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_privacy {\n display: grid;\n gap: 8px;\n padding: 12px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_settingsUpdate {\n display: grid;\n gap: 8px;\n}\n.styles_settingsUpdateStatus {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_updateCommand {\n margin: 0;\n padding: 8px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-12, var(--dsw-font-sm-14));\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n word-break: break-all;\n white-space: pre-wrap;\n}\n.styles_autoMappingSection {\n display: grid;\n gap: 12px;\n padding: 12px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_autoMappingSection h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_prediction {\n position: absolute;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n box-sizing: border-box;\n width: auto;\n max-width: none;\n padding: 8px 12px;\n color: var(--dsw-alias-label-secondary);\n font: var(--dsw-font-sm-14);\n white-space: pre-wrap;\n pointer-events: none;\n user-select: none;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_prediction kbd {\n margin-left: 8px;\n}\n.styles_historyDialog {\n position: absolute;\n z-index: 20;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n display: grid;\n gap: 8px;\n box-sizing: border-box;\n width: auto;\n max-width: none;\n padding: 12px;\n color: var(--dsw-alias-label-primary);\n}\n.styles_historyHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n font: var(--dsw-font-sm-14);\n}\n.styles_historyResults {\n max-height: 240px;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n}\n.styles_historyResult {\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n border-radius: var(--dsw-radius-sm);\n}\n.styles_historyResult[aria-selected=true] {\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_hints {\n position: absolute;\n z-index: 21;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n display: grid;\n gap: 8px;\n box-sizing: border-box;\n width: auto;\n max-width: none;\n}\n.styles_hint {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 12px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_rollbackDialog {\n width: min(680px, 100%);\n max-height: 100%;\n min-height: 0;\n}\n.styles_rollbackContent {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n.styles_rollbackPreview {\n display: grid;\n gap: 20px;\n box-sizing: border-box;\n max-width: 72ch;\n padding: 16px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_rollbackSummaryRow {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px 16px;\n}\n.styles_rollbackSummary {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n}\n.styles_rollbackAlready {\n margin: 0;\n padding: 10px 12px;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n line-height: 1.45;\n background: var(--dsw-alias-fill-secondary, color-mix(in srgb, var(--dsw-alias-label-secondary) 12%, transparent));\n border-radius: 6px;\n}\n.styles_rollbackTimelineLink {\n margin: 0;\n padding: 0;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n.styles_rollbackTimelineLink:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_timelineRightPane {\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n overflow: auto;\n padding: 12px 14px 20px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_timelinePanel {\n display: grid;\n gap: 12px;\n min-width: 0;\n}\n.styles_timelineLead,\n.styles_timelineStatus {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineStatus {\n display: grid;\n gap: 10px;\n justify-items: start;\n}\n.styles_timelineList {\n display: grid;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_timelineItem {\n --timeline-accent: color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 80%, transparent);\n --timeline-wash: color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 10%, transparent);\n min-width: 0;\n overflow: hidden;\n border: 1px solid color-mix(in srgb, var(--timeline-accent) 55%, transparent);\n border-left-width: 3px;\n border-left-color: var(--timeline-accent);\n border-radius: var(--dsw-radius-sm);\n background: var(--timeline-wash);\n}\n.styles_timelineItem[data-coverage=files] {\n --timeline-accent: color-mix(in srgb, #0f766e 75%, var(--dsw-alias-label-primary, #0f172a));\n --timeline-wash: color-mix(in srgb, #14b8a6 12%, transparent);\n}\n.styles_timelineItem[data-coverage=partial] {\n --timeline-accent: color-mix(in srgb, #b45309 75%, var(--dsw-alias-label-primary, #0f172a));\n --timeline-wash: color-mix(in srgb, #f59e0b 14%, transparent);\n}\n.styles_timelineItem[data-coverage=conversation] {\n --timeline-accent: color-mix(in srgb, #475569 75%, var(--dsw-alias-label-primary, #0f172a));\n --timeline-wash: color-mix(in srgb, #64748b 12%, transparent);\n}\n.styles_timelineItem[data-coverage=unknown] {\n --timeline-accent: color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 80%, transparent);\n --timeline-wash: color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 8%, transparent);\n}\n.styles_timelineItem[data-rolled-back] {\n opacity: 0.72;\n}\n.styles_timelineRow {\n display: grid;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 9px 10px 9px 12px;\n color: inherit;\n text-align: start;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n.styles_timelineRow:hover,\n.styles_timelineItem[data-expanded] > .styles_timelineRow {\n background: color-mix(in srgb, var(--dsw-alias-interactive-bg-hover, rgba(0, 0, 0, 0.06)) 70%, transparent);\n}\n.styles_timelineHead {\n display: flex;\n flex-wrap: wrap;\n gap: 8px 10px;\n align-items: center;\n min-width: 0;\n}\n.styles_timelineTurn {\n font-weight: 600;\n}\n.styles_timelineRolledBack {\n padding: 1px 7px;\n color: color-mix(in srgb, #be123c 70%, var(--dsw-alias-label-primary, #0f172a));\n font-size: 0.82em;\n font-weight: 700;\n line-height: 1.35;\n white-space: nowrap;\n border-radius: 999px;\n background: color-mix(in srgb, #fb7185 16%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, #e11d48 28%, transparent);\n}\n.styles_timelineCoverage {\n max-width: 100%;\n padding: 2px 8px;\n overflow: hidden;\n color: inherit;\n font-size: 0.88em;\n font-weight: 600;\n line-height: 1.35;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 999px;\n background: color-mix(in srgb, var(--timeline-accent) 18%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--timeline-accent) 35%, transparent);\n}\n.styles_timelineCoverage[data-coverage=files] {\n color: color-mix(in srgb, #0f766e 70%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=partial] {\n color: color-mix(in srgb, #b45309 72%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=conversation] {\n color: color-mix(in srgb, #334155 65%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=unknown] {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineMeta,\n.styles_timelineTime {\n margin-left: auto;\n color: var(--dsw-alias-label-secondary);\n font-size: 0.92em;\n}\n.styles_timelinePromptPreview {\n display: -webkit-box;\n margin: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-primary, inherit);\n font-size: 0.92em;\n line-height: 1.4;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.styles_timelineDetail {\n display: grid;\n gap: 10px;\n margin: 0;\n padding: 10px 12px 12px;\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 88%, transparent);\n border-top: 1px solid color-mix(in srgb, var(--timeline-accent) 28%, transparent);\n}\n.styles_timelinePrompt,\n.styles_timelinePromptEmpty,\n.styles_timelineFilesEmpty {\n margin: 0;\n}\n.styles_timelinePromptEmpty,\n.styles_timelineFilesEmpty {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineRow > .styles_timelinePromptEmpty {\n font-size: 0.92em;\n line-height: 1.4;\n}\n.styles_timelineFiles,\n.styles_timelineGaps {\n display: grid;\n gap: 6px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_timelineFiles li {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: baseline;\n padding: 4px 8px;\n overflow-wrap: anywhere;\n border-radius: var(--dsw-radius-sm);\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-1, transparent) 40%, transparent);\n}\n.styles_timelineFiles li[data-change=create] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #0f766e 70%, transparent);\n}\n.styles_timelineFiles li[data-change=modify] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #0369a1 70%, transparent);\n}\n.styles_timelineFiles li[data-change=delete] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #be123c 70%, transparent);\n}\n.styles_timelineFileChange {\n font-size: 0.88em;\n font-weight: 600;\n}\n.styles_timelineFileChange[data-change=create] {\n color: color-mix(in srgb, #0f766e 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineFileChange[data-change=modify] {\n color: color-mix(in srgb, #0369a1 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineFileChange[data-change=delete] {\n color: color-mix(in srgb, #be123c 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineGaps li {\n padding: 4px 8px;\n color: color-mix(in srgb, #b45309 70%, var(--dsw-alias-label-primary, #0f172a));\n font-size: 0.92em;\n border-radius: var(--dsw-radius-sm);\n background: color-mix(in srgb, #f59e0b 12%, transparent);\n box-shadow: inset 2px 0 0 color-mix(in srgb, #d97706 65%, transparent);\n}\n.styles_rollbackSection {\n display: grid;\n gap: 8px;\n min-width: 0;\n}\n.styles_rollbackSection h3,\n.styles_rollbackSection p {\n margin: 0;\n}\n.styles_rollbackSection h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_rollbackList {\n display: grid;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_rollbackList li {\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.styles_rollbackMessage,\n.styles_rollbackFile {\n display: grid;\n gap: 4px;\n}\n.styles_rollbackFile {\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: baseline;\n gap: 12px;\n}\n.styles_rollbackMeta {\n color: var(--dsw-alias-label-secondary);\n font-size: 0.92em;\n}\n.styles_rollbackConflict {\n display: block;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_userMessageRow {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 6px;\n min-width: 0;\n}\n.styles_userMessageActions {\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n gap: 4px;\n}\n.styles_userMessageAction {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(28px + var(--dsh-content-font-delta, 0px));\n height: calc(28px + var(--dsh-content-font-delta, 0px));\n padding: 6px;\n color: var(--dsw-alias-label-tertiary);\n background: transparent;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n cursor: pointer;\n}\n.styles_userMessageAction svg {\n width: calc(15px + var(--dsh-content-font-delta, 0px));\n height: calc(15px + var(--dsh-content-font-delta, 0px));\n}\n.styles_userMessageAction:hover {\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_userMessageAction[data-coverage=files],\n.styles_userMessageAction[data-coverage=partial] {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_userMessageAction:disabled,\n.styles_userMessageAction[data-unavailable] {\n cursor: default;\n opacity: 0.4;\n}\n.styles_userMessageAction:disabled:hover,\n.styles_userMessageAction[data-unavailable]:hover {\n color: var(--dsw-alias-label-tertiary);\n background: transparent;\n}\n.styles_contextMeterRow {\n cursor: pointer;\n position: relative;\n padding-right: 18px;\n}\n.styles_contextMeterRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextMeterRow[data-agent-enhancer-loading="1"] {\n opacity: 0.65;\n}\n.styles_contextMeterChevron {\n position: absolute;\n right: 4px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--dsw-alias-label-tertiary);\n font-size: 14px;\n line-height: 1;\n}\n.styles_usageMeterTitleRow,\n.styles_sessionStatsCheckpointRow {\n cursor: pointer;\n position: relative;\n padding-right: 18px;\n}\n.styles_usageMeterTitleRow:hover,\n.styles_sessionStatsCheckpointRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_usageMeterTitleRow:focus-visible,\n.styles_sessionStatsCheckpointRow:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageMeterLinkChevron,\n.styles_sessionStatsCheckpointChevron {\n position: absolute;\n right: 4px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--dsw-alias-label-tertiary);\n font-size: 14px;\n line-height: 1;\n pointer-events: none;\n}\n.styles_contextRightPanel {\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px 14px 14px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-13);\n}\n.styles_contextRightHeader {\n display: flex;\n flex-direction: column;\n gap: 10px;\n flex: none;\n}\n.styles_contextRightTitleRow {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_contextRightTitle {\n margin: 0;\n font: var(--dsw-font-sm-14);\n font-weight: 600;\n}\n.styles_contextRightMeta {\n color: var(--dsw-alias-label-tertiary);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n}\n.styles_contextRightSegments {\n display: flex;\n gap: 2px;\n flex-wrap: wrap;\n padding: 2px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightSegment,\n.styles_contextRightSegmentActive {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n border-radius: var(--dsw-radius-sm);\n padding: 5px 9px;\n cursor: pointer;\n font: inherit;\n}\n.styles_contextRightSegment:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextRightSegmentActive {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n}\n.styles_contextRightStatus {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_contextChart {\n flex: none;\n display: grid;\n gap: 10px;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextChartHeading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n}\n.styles_contextChartTitle {\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextChartTotal {\n color: var(--dsw-alias-label-primary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_contextChartTotalHint {\n color: var(--dsw-alias-label-tertiary);\n font-weight: 400;\n}\n.styles_contextStackWrap {\n position: relative;\n display: grid;\n gap: 0;\n}\n.styles_contextStack {\n display: flex;\n width: 100%;\n height: 12px;\n border-radius: 999px;\n overflow: hidden;\n background: var(--dsw-alias-border-primary);\n}\n.styles_contextStackSegment,\n.styles_contextStackSegmentDim {\n display: block;\n height: 100%;\n min-width: 2px;\n cursor: default;\n transition: opacity 120ms ease, filter 120ms ease;\n}\n.styles_contextStackSegment {\n opacity: 1;\n filter: saturate(1.08);\n}\n.styles_contextStackSegmentDim {\n opacity: 0.28;\n filter: saturate(0.55);\n}\n.styles_contextChartTip {\n position: absolute;\n left: 50%;\n bottom: calc(100% + 6px);\n transform: translateX(-50%);\n z-index: 2;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: min(100%, 280px);\n padding: 5px 8px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-1);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n line-height: 16px;\n white-space: nowrap;\n pointer-events: none;\n}\n.styles_contextChartTipSwatch {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 999px;\n}\n.styles_contextChartLegend {\n list-style: none;\n margin: 0;\n padding: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.styles_contextChartLegendItem,\n.styles_contextChartLegendItemDim {\n display: grid;\n grid-template-columns: 8px minmax(0, 1fr);\n gap: 8px;\n align-items: start;\n font-size: 12px;\n border-radius: var(--dsw-radius-sm);\n padding: 2px 4px;\n margin: 0 -4px;\n transition: opacity 120ms ease, background 120ms ease;\n}\n.styles_contextChartLegendItem {\n opacity: 1;\n background: transparent;\n}\n.styles_contextChartLegendItem:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextChartLegendItemDim {\n opacity: 0.4;\n}\n.styles_contextChartSwatch {\n width: 8px;\n height: 8px;\n margin-top: 4px;\n border-radius: 999px;\n}\n.styles_contextChartLegendMain {\n min-width: 0;\n display: grid;\n gap: 4px;\n}\n.styles_contextChartLegendTop {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n.styles_contextChartLegendLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextChartLegendMeta {\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_contextChartLegendTrack {\n height: 3px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextChartLegendFill {\n height: 100%;\n border-radius: inherit;\n opacity: 0.9;\n}\n.styles_contextHeadroom {\n display: grid;\n gap: 4px;\n padding-top: 2px;\n border-top: 1px solid var(--dsw-alias-border-primary);\n}\n.styles_contextHeadroomMeta {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n}\n.styles_contextHeadroomValue {\n color: var(--dsw-alias-label-primary);\n font-variant-numeric: tabular-nums;\n}\n.styles_contextHeadroomTrack {\n height: 5px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextHeadroomFill {\n height: 100%;\n border-radius: inherit;\n background: #4c8bf5;\n opacity: 0.85;\n}\n.styles_contextHeadroomHint {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n.styles_contextCompactBar {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n flex: none;\n}\n.styles_contextCompactButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex: none;\n min-height: 30px;\n padding: 0 10px 0 8px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n cursor: pointer;\n color: #fff;\n background: #3b7ded;\n font-size: 12px;\n font-weight: 600;\n line-height: 16px;\n box-shadow: 0 0 0 1px color-mix(in srgb, #3b7ded 55%, transparent);\n}\n.styles_contextCompactButton:hover:not(:disabled) {\n color: #fff;\n background: #2f6fe0;\n}\n.styles_contextCompactButton:focus-visible {\n outline: 2px solid color-mix(in srgb, #3b7ded 70%, white);\n outline-offset: 2px;\n}\n.styles_contextCompactButton:disabled {\n cursor: default;\n opacity: 0.55;\n}\n.styles_contextCompactButtonLabel {\n max-width: 9em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_contextCompactHint,\n.styles_contextCompactNote {\n margin: 0;\n min-width: 0;\n flex: 1;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n padding-top: 5px;\n}\n.styles_contextCompactNote {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_contextEventRow {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n flex: none;\n}\n.styles_contextEventChip,\n.styles_contextEventChipCompact,\n.styles_contextEventChipPrune {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 7px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n line-height: 16px;\n}\n.styles_contextEventChipCompact {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextEventChipPrune {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextRightScroll,\n.styles_contextRightListFill {\n min-height: 0;\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.styles_contextRightScroll {\n overflow: auto;\n}\n.styles_contextRightListFill {\n overflow: hidden;\n}\n.styles_contextRightItem,\n.styles_contextRightItemActive,\n.styles_contextRightItemActiveFill {\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n}\n.styles_contextRightItem:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextRightItemActive,\n.styles_contextRightItemActiveFill {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextRightItemActiveFill {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.styles_contextRightRow {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 10px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n color: inherit;\n border-radius: var(--dsw-radius-sm);\n padding: 8px 8px 7px;\n cursor: pointer;\n font: inherit;\n}\n.styles_contextRightItemDot {\n width: 7px;\n height: 7px;\n border-radius: 999px;\n flex: none;\n margin-top: 5px;\n}\n.styles_contextRightRowMain {\n min-width: 0;\n flex: 1;\n display: grid;\n gap: 4px;\n}\n.styles_contextRightRowTitle {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n font-weight: 500;\n}\n.styles_contextRightBadge,\n.styles_contextRightBadgeMuted {\n display: inline-flex;\n align-items: center;\n padding: 0 5px;\n border-radius: var(--dsw-radius-sm);\n font-size: 10px;\n font-weight: 500;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightBadgeMuted {\n opacity: 0.9;\n}\n.styles_contextRightRowPreview {\n color: var(--dsw-alias-label-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_contextRightBarTrack {\n height: 2px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextRightBarFill {\n height: 100%;\n background: var(--dsw-alias-label-secondary);\n}\n.styles_contextRightRowTokens {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n text-align: right;\n padding-top: 1px;\n}\n.styles_contextRightShare {\n opacity: 0.85;\n}\n.styles_contextRightDetail {\n margin: 0 8px 8px 22px;\n min-height: 0;\n padding: 8px 10px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightItemActiveFill .styles_contextRightDetail {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.styles_contextRightDetailBody {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font: inherit;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_contextRightItemActiveFill .styles_contextRightDetailBody {\n flex: 1;\n min-height: 0;\n overflow: auto;\n}\n.styles_contextRightNote {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n.styles_usageRightPane {\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n display: flex;\n flex-direction: column;\n padding: 0;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-13);\n background:\n linear-gradient(\n 180deg,\n color-mix(in srgb, #3d7cf5 10%, var(--dsw-alias-bg-layer-1)) 0,\n var(--dsw-alias-bg-layer-1) 120px);\n}\n.styles_usagePanel {\n box-sizing: border-box;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 14px;\n overflow: auto;\n padding: 14px 14px 16px;\n}\n.styles_usagePanel h2,\n.styles_usagePanel h3,\n.styles_usagePanel p {\n margin: 0;\n}\n.styles_usageHeader,\n.styles_usageHero {\n display: grid;\n gap: 6px;\n flex: none;\n}\n.styles_usageHero {\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: end;\n gap: 12px;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-md, 10px);\n background:\n linear-gradient(\n 135deg,\n color-mix(in srgb, #3d7cf5 16%, transparent),\n color-mix(in srgb, #1f9a6a 8%, transparent));\n border: 1px solid color-mix(in srgb, #3d7cf5 22%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeroCopy {\n display: grid;\n gap: 4px;\n min-width: 0;\n}\n.styles_usageHeroTotal {\n display: grid;\n justify-items: end;\n gap: 2px;\n}\n.styles_usageHeroTotalValue {\n font: var(--dsw-font-sm-16, var(--dsw-font-sm-14));\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n letter-spacing: -0.02em;\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageHeroTotalLabel {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 14px;\n}\n.styles_usageMoneyBlock {\n display: grid;\n gap: 2px;\n margin-top: 4px;\n}\n.styles_usageEstimate {\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n letter-spacing: -0.01em;\n}\n.styles_usageEstimateHint,\n.styles_usageUnpriced,\n.styles_usageBalanceDetail,\n.styles_usageBalanceStale,\n.styles_usageBalanceHint {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageBalance {\n display: grid;\n gap: 2px;\n margin-top: 4px;\n font-variant-numeric: tabular-nums;\n}\n.styles_providerBalanceChip {\n display: grid;\n gap: 2px;\n justify-items: start;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n text-align: left;\n cursor: pointer;\n}\n.styles_providerBalanceChip:hover .styles_providerBalancePrimary {\n color: var(--dsw-alias-label-primary);\n}\n.styles_providerBalancePrimary {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_providerBalanceDetail {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageTitle {\n font: var(--dsw-font-sm-14);\n font-weight: 650;\n letter-spacing: -0.01em;\n}\n.styles_usageBack {\n justify-self: start;\n margin: 0 0 2px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageBack:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageNote,\n.styles_usageRetention,\n.styles_usageEmpty,\n.styles_usageEmptyInline,\n.styles_usageBucketMeta {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n.styles_usageToolbar,\n.styles_usageRecordsToolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n flex: none;\n}\n.styles_usageRanges {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n width: fit-content;\n max-width: 100%;\n padding: 4px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n flex: none;\n}\n.styles_usageRefresh {\n margin: 0;\n min-height: 28px;\n padding: 0 12px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent);\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageRefresh:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_usageRefresh:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageRefresh:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n.styles_usageRange {\n margin: 0;\n min-height: 28px;\n padding: 0 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageRange[aria-pressed=true] {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n font-weight: 600;\n}\n.styles_usageRange:hover:not(:disabled):not([aria-pressed=true]) {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRange:focus-visible,\n.styles_usageBack:focus-visible,\n.styles_usageLink:focus-visible,\n.styles_usageRecordsEntry:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageRange:disabled,\n.styles_usageRecordsEntry:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n.styles_usageCharts {\n display: grid;\n gap: 16px;\n flex: none;\n}\n.styles_usageBuckets {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n.styles_usageBucket {\n display: grid;\n gap: 4px;\n min-width: 0;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);\n}\n.styles_usageBucketLabel {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 14px;\n}\n.styles_usageBucketValue {\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageSectionTitle {\n margin: 0;\n font: var(--dsw-font-sm-13);\n font-weight: 650;\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageChart {\n display: grid;\n gap: 10px;\n}\n.styles_usageChartHead {\n display: grid;\n gap: 4px;\n}\n.styles_usageChartHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageHeatBody {\n display: grid;\n gap: 10px;\n}\n.styles_usageHeatGrid {\n display: grid;\n gap: 4px;\n}\n.styles_usageHeatGridHour {\n grid-template-columns: repeat(6, minmax(0, 1fr));\n}\n.styles_usageHeatGridDay {\n grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));\n}\n.styles_usageHeatCell,\n.styles_usageHeatCellDim {\n box-sizing: border-box;\n display: grid;\n place-items: end start;\n min-height: 36px;\n margin: 0;\n padding: 4px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);\n border-radius: 6px;\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n transition: opacity 120ms ease, transform 120ms ease;\n}\n.styles_usageHeatCell:hover,\n.styles_usageHeatCell:focus-visible {\n transform: translateY(-1px);\n outline: none;\n}\n.styles_usageHeatCell:focus-visible {\n box-shadow: 0 0 0 2px color-mix(in srgb, #3d7cf5 55%, transparent);\n}\n.styles_usageHeatCellDim {\n opacity: 0.35;\n}\n.styles_usageHeatCell[data-level="0"],\n.styles_usageHeatCellDim[data-level="0"],\n.styles_usageHeatScale span[data-level="0"] {\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageHeatCell[data-level="1"],\n.styles_usageHeatCellDim[data-level="1"],\n.styles_usageHeatScale span[data-level="1"] {\n background: color-mix(in srgb, #3d7cf5 22%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeatCell[data-level="2"],\n.styles_usageHeatCellDim[data-level="2"],\n.styles_usageHeatScale span[data-level="2"] {\n background: color-mix(in srgb, #3d7cf5 40%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeatCell[data-level="3"],\n.styles_usageHeatCellDim[data-level="3"],\n.styles_usageHeatScale span[data-level="3"] {\n background: color-mix(in srgb, #3d7cf5 62%, var(--dsw-alias-bg-layer-2));\n color: #f4f7ff;\n}\n.styles_usageHeatCell[data-level="4"],\n.styles_usageHeatCellDim[data-level="4"],\n.styles_usageHeatScale span[data-level="4"] {\n background: color-mix(in srgb, #245fd4 88%, #0b1c3a);\n color: #f4f7ff;\n}\n.styles_usageHeatLabel {\n font-size: 10px;\n line-height: 12px;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageHeatLegend {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n min-height: 20px;\n}\n.styles_usageHeatTipValue {\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageHeatTipMeta {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n}\n.styles_usageHeatScale {\n display: inline-flex;\n gap: 3px;\n margin-left: auto;\n}\n.styles_usageHeatScale span {\n width: 12px;\n height: 12px;\n border-radius: 3px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);\n}\n.styles_usageShareBody {\n display: grid;\n gap: 10px;\n}\n.styles_usageShareTrack {\n display: flex;\n width: 100%;\n height: 12px;\n overflow: hidden;\n border-radius: 999px;\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageShareSegment,\n.styles_usageShareSegmentDim {\n height: 100%;\n min-width: 2px;\n transition: opacity 120ms ease;\n}\n.styles_usageShareSegmentDim {\n opacity: 0.28;\n}\n.styles_usageLegend,\n.styles_usageRankList,\n.styles_usageRecentList {\n display: grid;\n gap: 8px;\n width: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_usageLegendItem,\n.styles_usageLegendItemDim {\n display: grid;\n grid-template-columns: 8px minmax(0, 1fr) auto;\n gap: 8px;\n align-items: center;\n}\n.styles_usageLegendItemDim {\n opacity: 0.45;\n}\n.styles_usageLegendSwatch {\n width: 8px;\n height: 8px;\n border-radius: 999px;\n}\n.styles_usageLegendLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_usageLegendMeta,\n.styles_usageRankMeta {\n color: var(--dsw-alias-label-secondary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_usageLegendShare {\n margin-left: 6px;\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_usageRankItem {\n display: grid;\n gap: 4px;\n}\n.styles_usageRankTop {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageRankLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_usageRankTrack {\n height: 6px;\n overflow: hidden;\n border-radius: 999px;\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageRankFill {\n height: 100%;\n border-radius: inherit;\n}\n.styles_usageFooter {\n margin-top: auto;\n flex: none;\n display: grid;\n gap: 8px;\n padding-top: 4px;\n}\n.styles_usageRecentPreview {\n display: grid;\n gap: 8px;\n}\n.styles_usageRecentHead {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageLink {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageLink:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRecordsEntry {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n margin: 0;\n padding: 10px 0;\n border: 0;\n border-top: 1px solid var(--dsw-alias-border-subtle, var(--dsw-alias-bg-layer-2));\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n text-align: start;\n cursor: pointer;\n}\n.styles_usageRecordsEntry:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRecordsEntryMeta {\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_usageRecentItem {\n display: grid;\n gap: 6px;\n padding: 10px 0;\n}\n.styles_usageRecentItem + .styles_usageRecentItem {\n border-top: 1px solid var(--dsw-alias-border-subtle, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageRecentMain {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageRecentSource {\n font-weight: 650;\n}\n.styles_usageRecentRoute {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 16px;\n}\n.styles_usageRecentProvider {\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_usageRecentWhen {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n white-space: nowrap;\n}\n.styles_usageRecentTokens {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 16px;\n font-variant-numeric: tabular-nums;\n}\n';
|
|
1420
|
+
var cssText = '/* src/client/styles.module.css */\n.styles_root {\n position: relative;\n}\n.styles_toolbarIcon {\n box-sizing: border-box;\n flex-shrink: 0;\n width: 28px;\n height: 28px;\n padding: 0;\n}\n.styles_toolbarStatus {\n max-width: 12rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-secondary);\n font: var(--dsw-font-sm-12, var(--dsw-font-sm-14));\n}\n.styles_settings {\n display: grid;\n gap: 16px;\n max-width: 640px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_settings h2,\n.styles_settings h3,\n.styles_settings p {\n margin: 0;\n}\n.styles_settingsHeader {\n display: grid;\n gap: 4px;\n}\n.styles_settingsHeader p,\n.styles_settingDescription,\n.styles_privacy p {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_settingRow {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n}\n.styles_settingText {\n display: grid;\n gap: 4px;\n min-width: 0;\n}\n.styles_settingText h3,\n.styles_privacy h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_settingControls {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n.styles_settingsBack {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_settingsBack:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_settingsConfigure,\n.styles_settingsActionPrimary {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin: 0;\n min-height: 28px;\n padding: 0 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n font: inherit;\n font-weight: 600;\n line-height: 16px;\n cursor: pointer;\n white-space: nowrap;\n}\n.styles_settingsConfigure {\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-layer-2);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n}\n.styles_settingsConfigure:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_settingsConfigure:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.styles_settingsActionPrimary {\n color: #fff;\n background: #3b7ded;\n box-shadow: 0 0 0 1px color-mix(in srgb, #3b7ded 55%, transparent);\n}\n.styles_settingsActionPrimary:hover:not(:disabled) {\n background: #2f6fe0;\n}\n.styles_settingsActionPrimary:focus-visible {\n outline: 2px solid color-mix(in srgb, #3b7ded 70%, white);\n outline-offset: 2px;\n}\n.styles_settingsActionPrimary:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n.styles_modelPill {\n max-width: 168px;\n}\n.styles_modelPillLabel {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_privacy {\n display: grid;\n gap: 8px;\n padding: 12px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_settingsUpdate {\n display: grid;\n gap: 8px;\n}\n.styles_settingsUpdateStatus {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_updateCommand {\n margin: 0;\n padding: 8px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-12, var(--dsw-font-sm-14));\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n word-break: break-all;\n white-space: pre-wrap;\n}\n.styles_autoMappingSection {\n display: grid;\n gap: 12px;\n padding: 12px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_autoMappingSection h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_prediction {\n position: absolute;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n box-sizing: border-box;\n width: auto;\n max-width: none;\n padding: 8px 12px;\n color: var(--dsw-alias-label-secondary);\n font: var(--dsw-font-sm-14);\n white-space: pre-wrap;\n pointer-events: none;\n user-select: none;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_prediction kbd {\n margin-left: 8px;\n}\n.styles_historyDialog {\n position: absolute;\n z-index: 20;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n display: grid;\n gap: 8px;\n box-sizing: border-box;\n width: auto;\n max-width: none;\n padding: 12px;\n color: var(--dsw-alias-label-primary);\n}\n.styles_historyHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n font: var(--dsw-font-sm-14);\n}\n.styles_historyResults {\n max-height: 240px;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n}\n.styles_historyResult {\n padding: 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n border-radius: var(--dsw-radius-sm);\n}\n.styles_historyResult[aria-selected=true] {\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_hints {\n position: absolute;\n z-index: 21;\n left: 0;\n right: 0;\n bottom: calc(100% + 8px);\n display: grid;\n gap: 8px;\n box-sizing: border-box;\n width: auto;\n max-width: none;\n}\n.styles_hint {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 12px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n}\n.styles_rollbackDialog {\n width: min(680px, 100%);\n max-height: 100%;\n min-height: 0;\n}\n.styles_rollbackContent {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n.styles_rollbackPreview {\n display: grid;\n gap: 20px;\n box-sizing: border-box;\n max-width: 72ch;\n padding: 16px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_rollbackSummaryRow {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px 16px;\n}\n.styles_rollbackSummary {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n}\n.styles_rollbackAlready {\n margin: 0;\n padding: 10px 12px;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n line-height: 1.45;\n background: var(--dsw-alias-fill-secondary, color-mix(in srgb, var(--dsw-alias-label-secondary) 12%, transparent));\n border-radius: 6px;\n}\n.styles_rollbackTimelineLink {\n margin: 0;\n padding: 0;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n.styles_rollbackTimelineLink:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_timelineRightPane {\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n overflow: auto;\n padding: 12px 14px 20px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n}\n.styles_timelinePanel {\n display: grid;\n gap: 10px;\n min-width: 0;\n align-content: start;\n}\n.styles_timelineToolbar {\n display: flex;\n flex-wrap: wrap;\n gap: 8px 12px;\n align-items: center;\n justify-content: space-between;\n}\n.styles_timelineSearchRow {\n min-width: 0;\n}\n.styles_timelineSearch {\n width: 100%;\n}\n.styles_timelineSelectBar {\n display: flex;\n flex-wrap: wrap;\n gap: 8px 12px;\n align-items: center;\n justify-content: space-between;\n}\n.styles_timelineSelectAll {\n min-width: 0;\n}\n.styles_timelineBulkActions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 8px;\n align-items: center;\n justify-content: flex-end;\n}\n.styles_timelineBulkCount {\n color: var(--dsw-alias-label-secondary);\n font-size: 0.88em;\n font-variant-numeric: tabular-nums;\n}\n.styles_timelineCheck {\n display: flex;\n align-items: center;\n padding-left: 8px;\n}\n.styles_timelineCheck span:last-child {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n white-space: nowrap;\n}\n.styles_timelineStats {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: baseline;\n min-width: 0;\n font-variant-numeric: tabular-nums;\n}\n.styles_timelineStatIn,\n.styles_timelineStatOut {\n color: var(--dsw-alias-label-primary);\n font-size: 0.95em;\n font-weight: 650;\n letter-spacing: -0.01em;\n}\n.styles_timelineStatOut {\n color: var(--dsw-alias-label-secondary);\n font-weight: 550;\n}\n.styles_timelineStatOut[data-active] {\n color: color-mix(in srgb, #9a3412 55%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineLead,\n.styles_timelineStatus {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineStatus {\n display: grid;\n gap: 10px;\n justify-items: start;\n}\n.styles_timelineFilters {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n padding: 2px;\n border-radius: var(--dsw-radius-sm);\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 55%, transparent);\n}\n.styles_timelineFilter {\n display: inline-flex;\n gap: 6px;\n align-items: center;\n margin: 0;\n padding: 5px 9px;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 0.88em;\n line-height: 1.2;\n background: transparent;\n border: 0;\n border-radius: calc(var(--dsw-radius-sm) - 1px);\n cursor: pointer;\n}\n.styles_timelineFilter:hover {\n color: var(--dsw-alias-label-primary);\n background: color-mix(in srgb, var(--dsw-alias-interactive-bg-hover, rgba(0, 0, 0, 0.06)) 80%, transparent);\n}\n.styles_timelineFilter[data-active] {\n color: var(--dsw-alias-label-primary);\n font-weight: 650;\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-1, #fff) 88%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 35%, transparent);\n}\n.styles_timelineFilterCount {\n min-width: 1.1em;\n color: inherit;\n font-variant-numeric: tabular-nums;\n opacity: 0.72;\n}\n.styles_timelineList {\n display: grid;\n gap: 2px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_timelineItem {\n --timeline-accent: color-mix(in srgb, #0f766e 55%, var(--dsw-alias-label-tertiary, #94a3b8));\n min-width: 0;\n overflow: hidden;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n box-shadow: inset 3px 0 0 var(--timeline-accent);\n transition: opacity 120ms ease, background-color 120ms ease;\n}\n.styles_timelineItem[data-context-excluded] {\n --timeline-accent: color-mix(in srgb, #9a3412 50%, var(--dsw-alias-label-tertiary, #94a3b8));\n opacity: 0.72;\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 35%, transparent);\n}\n.styles_timelineItem[data-context-excluded] .styles_timelinePromptPreview {\n text-decoration: line-through;\n text-decoration-thickness: 1px;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-label-secondary) 55%, transparent);\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineItem[data-rolled-back]:not([data-context-excluded]) {\n opacity: 0.85;\n}\n.styles_timelineMain {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 4px 8px;\n align-items: center;\n}\n.styles_timelineLeadNote,\n.styles_timelineBoundaryNote {\n margin: 0;\n color: var(--dsw-alias-label-secondary);\n font-size: 0.88em;\n line-height: 1.4;\n}\n.styles_timelineTipBadge,\n.styles_timelineRolledBackBadge {\n margin-left: 6px;\n padding: 1px 7px;\n font-size: 0.82em;\n font-weight: 700;\n line-height: 1.35;\n white-space: nowrap;\n border-radius: 999px;\n}\n.styles_timelineTipBadge {\n color: color-mix(in srgb, #0f766e 70%, var(--dsw-alias-label-primary, #0f172a));\n background: color-mix(in srgb, #14b8a6 16%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, #0f766e 28%, transparent);\n}\n.styles_timelineRolledBackBadge {\n color: color-mix(in srgb, #be123c 70%, var(--dsw-alias-label-primary, #0f172a));\n background: color-mix(in srgb, #fb7185 16%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, #e11d48 28%, transparent);\n}\n.styles_timelineItem[data-tip] {\n --timeline-accent: color-mix(in srgb, #0f766e 70%, var(--dsw-alias-label-tertiary, #94a3b8));\n}\n.styles_timelineItem[data-selected] {\n background: color-mix(in srgb, var(--dsw-alias-interactive-bg-hover, rgba(0, 0, 0, 0.06)) 55%, transparent);\n}\n.styles_timelineRow {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n gap: 6px 10px;\n align-items: baseline;\n width: 100%;\n margin: 0;\n padding: 8px 4px 8px 10px;\n color: inherit;\n text-align: start;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n.styles_timelineRow:hover,\n.styles_timelineItem[data-expanded] .styles_timelineRow {\n background: color-mix(in srgb, var(--dsw-alias-interactive-bg-hover, rgba(0, 0, 0, 0.06)) 70%, transparent);\n}\n.styles_timelineSwitch {\n display: flex;\n align-items: center;\n padding: 4px 8px 4px 0;\n}\n.styles_timelineTurn {\n flex: none;\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_timelineRolledBack {\n padding: 1px 7px;\n color: color-mix(in srgb, #be123c 70%, var(--dsw-alias-label-primary, #0f172a));\n font-size: 0.82em;\n font-weight: 700;\n line-height: 1.35;\n white-space: nowrap;\n border-radius: 999px;\n background: color-mix(in srgb, #fb7185 16%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, #e11d48 28%, transparent);\n}\n.styles_timelineCoverage {\n max-width: 100%;\n padding: 2px 8px;\n overflow: hidden;\n color: inherit;\n font-size: 0.88em;\n font-weight: 600;\n line-height: 1.35;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 999px;\n background: color-mix(in srgb, var(--timeline-accent) 18%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--timeline-accent) 35%, transparent);\n}\n.styles_timelineCoverage[data-coverage=files] {\n color: color-mix(in srgb, #0f766e 70%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=partial] {\n color: color-mix(in srgb, #b45309 72%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=conversation] {\n color: color-mix(in srgb, #334155 65%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineCoverage[data-coverage=unknown] {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineMeta,\n.styles_timelineTime {\n color: var(--dsw-alias-label-secondary);\n font-size: 0.82em;\n white-space: nowrap;\n}\n.styles_timelinePromptPreview {\n display: -webkit-box;\n margin: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-primary, inherit);\n font-size: 0.92em;\n line-height: 1.35;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n}\n.styles_timelineDetail {\n display: grid;\n gap: 10px;\n margin: 0 0 0 3px;\n padding: 8px 12px 12px 10px;\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 72%, transparent);\n border-top: 1px solid color-mix(in srgb, var(--dsw-alias-label-tertiary, #94a3b8) 22%, transparent);\n}\n.styles_timelineDetailMeta {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n margin: 0;\n}\n.styles_timelineDetailNote {\n margin: 0;\n color: color-mix(in srgb, #9a3412 55%, var(--dsw-alias-label-primary, #0f172a));\n font-size: 0.88em;\n font-weight: 600;\n}\n.styles_timelineActions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.styles_contextExcludedBadge {\n display: inline-flex;\n align-self: flex-start;\n margin: 0 0 4px;\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 0.75em;\n line-height: 1.4;\n color: var(--dsw-alias-label-secondary);\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 70%, transparent);\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-secondary) 24%, transparent);\n}\n.styles_userMessageRow[data-context-excluded] {\n opacity: 0.78;\n}\n.styles_timelinePrompt,\n.styles_timelinePromptEmpty,\n.styles_timelineFilesEmpty {\n margin: 0;\n}\n.styles_timelinePromptEmpty,\n.styles_timelineFilesEmpty {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_timelineRow > .styles_timelinePromptEmpty {\n font-size: 0.92em;\n line-height: 1.35;\n}\n@media (prefers-reduced-motion: reduce) {\n .styles_timelineItem {\n transition: none;\n }\n}\n.styles_timelineFiles,\n.styles_timelineGaps {\n display: grid;\n gap: 6px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_timelineFiles li {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: baseline;\n padding: 4px 8px;\n overflow-wrap: anywhere;\n border-radius: var(--dsw-radius-sm);\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-1, transparent) 40%, transparent);\n}\n.styles_timelineFiles li[data-change=create] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #0f766e 70%, transparent);\n}\n.styles_timelineFiles li[data-change=modify] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #0369a1 70%, transparent);\n}\n.styles_timelineFiles li[data-change=delete] {\n box-shadow: inset 2px 0 0 color-mix(in srgb, #be123c 70%, transparent);\n}\n.styles_timelineFileChange {\n font-size: 0.88em;\n font-weight: 600;\n}\n.styles_timelineFileChange[data-change=create] {\n color: color-mix(in srgb, #0f766e 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineFileChange[data-change=modify] {\n color: color-mix(in srgb, #0369a1 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineFileChange[data-change=delete] {\n color: color-mix(in srgb, #be123c 75%, var(--dsw-alias-label-primary, #0f172a));\n}\n.styles_timelineGaps li {\n padding: 4px 8px;\n color: color-mix(in srgb, #b45309 70%, var(--dsw-alias-label-primary, #0f172a));\n font-size: 0.92em;\n border-radius: var(--dsw-radius-sm);\n background: color-mix(in srgb, #f59e0b 12%, transparent);\n box-shadow: inset 2px 0 0 color-mix(in srgb, #d97706 65%, transparent);\n}\n.styles_rollbackSection {\n display: grid;\n gap: 8px;\n min-width: 0;\n}\n.styles_rollbackSection h3,\n.styles_rollbackSection p {\n margin: 0;\n}\n.styles_rollbackSection h3 {\n font: inherit;\n font-weight: 600;\n}\n.styles_rollbackList {\n display: grid;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_rollbackList li {\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.styles_rollbackMessage,\n.styles_rollbackFile {\n display: grid;\n gap: 4px;\n}\n.styles_rollbackFile {\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: baseline;\n gap: 12px;\n}\n.styles_rollbackMeta {\n color: var(--dsw-alias-label-secondary);\n font-size: 0.92em;\n}\n.styles_rollbackConflict {\n display: block;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_userMessageRow {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 6px;\n min-width: 0;\n}\n.styles_userMessageActions {\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n gap: 4px;\n}\n.styles_userMessageAction {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(28px + var(--dsh-content-font-delta, 0px));\n height: calc(28px + var(--dsh-content-font-delta, 0px));\n padding: 6px;\n color: var(--dsw-alias-label-tertiary);\n background: transparent;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n cursor: pointer;\n}\n.styles_userMessageAction svg {\n width: calc(15px + var(--dsh-content-font-delta, 0px));\n height: calc(15px + var(--dsh-content-font-delta, 0px));\n}\n.styles_userMessageAction:hover {\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_userMessageAction[data-coverage=files],\n.styles_userMessageAction[data-coverage=partial] {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_userMessageAction:disabled,\n.styles_userMessageAction[data-unavailable] {\n cursor: default;\n opacity: 0.4;\n}\n.styles_userMessageAction:disabled:hover,\n.styles_userMessageAction[data-unavailable]:hover {\n color: var(--dsw-alias-label-tertiary);\n background: transparent;\n}\n.styles_contextMeterRow {\n cursor: pointer;\n position: relative;\n padding-right: 18px;\n}\n.styles_contextMeterRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextMeterRow[data-agent-enhancer-loading="1"] {\n opacity: 0.65;\n}\n.styles_contextMeterChevron {\n position: absolute;\n right: 4px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--dsw-alias-label-tertiary);\n font-size: 14px;\n line-height: 1;\n}\n.styles_usageMeterTitleRow,\n.styles_sessionStatsCheckpointRow {\n cursor: pointer;\n position: relative;\n padding-right: 18px;\n}\n.styles_usageMeterTitleRow:hover,\n.styles_sessionStatsCheckpointRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_usageMeterTitleRow:focus-visible,\n.styles_sessionStatsCheckpointRow:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageMeterLinkChevron,\n.styles_sessionStatsCheckpointChevron {\n position: absolute;\n right: 4px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--dsw-alias-label-tertiary);\n font-size: 14px;\n line-height: 1;\n pointer-events: none;\n}\n.styles_contextRightPanel {\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px 14px 14px;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-13);\n}\n.styles_contextRightHeader {\n display: flex;\n flex-direction: column;\n gap: 10px;\n flex: none;\n}\n.styles_contextRightTitleRow {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_contextRightTitle {\n margin: 0;\n font: var(--dsw-font-sm-14);\n font-weight: 600;\n}\n.styles_contextRightMeta {\n color: var(--dsw-alias-label-tertiary);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n}\n.styles_contextRightSegments {\n display: flex;\n gap: 2px;\n flex-wrap: wrap;\n padding: 2px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightSegment,\n.styles_contextRightSegmentActive {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n border-radius: var(--dsw-radius-sm);\n padding: 5px 9px;\n cursor: pointer;\n font: inherit;\n}\n.styles_contextRightSegment:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextRightSegmentActive {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n}\n.styles_contextRightStatus {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_contextChart {\n flex: none;\n display: grid;\n gap: 10px;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextChartHeading {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 10px;\n}\n.styles_contextChartTitle {\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextChartTotal {\n color: var(--dsw-alias-label-primary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_contextChartTotalHint {\n color: var(--dsw-alias-label-tertiary);\n font-weight: 400;\n}\n.styles_contextStackWrap {\n position: relative;\n display: grid;\n gap: 0;\n}\n.styles_contextStack {\n display: flex;\n width: 100%;\n height: 12px;\n border-radius: 999px;\n overflow: hidden;\n background: var(--dsw-alias-border-primary);\n}\n.styles_contextStackSegment,\n.styles_contextStackSegmentDim {\n display: block;\n height: 100%;\n min-width: 2px;\n cursor: default;\n transition: opacity 120ms ease, filter 120ms ease;\n}\n.styles_contextStackSegment {\n opacity: 1;\n filter: saturate(1.08);\n}\n.styles_contextStackSegmentDim {\n opacity: 0.28;\n filter: saturate(0.55);\n}\n.styles_contextChartTip {\n position: absolute;\n left: 50%;\n bottom: calc(100% + 6px);\n transform: translateX(-50%);\n z-index: 2;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: min(100%, 280px);\n padding: 5px 8px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-1);\n box-shadow: 0 0 0 1px var(--dsw-alias-border-primary);\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n line-height: 16px;\n white-space: nowrap;\n pointer-events: none;\n}\n.styles_contextChartTipSwatch {\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 999px;\n}\n.styles_contextChartLegend {\n list-style: none;\n margin: 0;\n padding: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.styles_contextChartLegendItem,\n.styles_contextChartLegendItemDim {\n display: grid;\n grid-template-columns: 8px minmax(0, 1fr);\n gap: 8px;\n align-items: start;\n font-size: 12px;\n border-radius: var(--dsw-radius-sm);\n padding: 2px 4px;\n margin: 0 -4px;\n transition: opacity 120ms ease, background 120ms ease;\n}\n.styles_contextChartLegendItem {\n opacity: 1;\n background: transparent;\n}\n.styles_contextChartLegendItem:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextChartLegendItemDim {\n opacity: 0.4;\n}\n.styles_contextChartSwatch {\n width: 8px;\n height: 8px;\n margin-top: 4px;\n border-radius: 999px;\n}\n.styles_contextChartLegendMain {\n min-width: 0;\n display: grid;\n gap: 4px;\n}\n.styles_contextChartLegendTop {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n.styles_contextChartLegendLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextChartLegendMeta {\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_contextChartLegendTrack {\n height: 3px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextChartLegendFill {\n height: 100%;\n border-radius: inherit;\n opacity: 0.9;\n}\n.styles_contextHeadroom {\n display: grid;\n gap: 4px;\n padding-top: 2px;\n border-top: 1px solid var(--dsw-alias-border-primary);\n}\n.styles_contextHeadroomMeta {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n}\n.styles_contextHeadroomValue {\n color: var(--dsw-alias-label-primary);\n font-variant-numeric: tabular-nums;\n}\n.styles_contextHeadroomTrack {\n height: 5px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextHeadroomFill {\n height: 100%;\n border-radius: inherit;\n background: #4c8bf5;\n opacity: 0.85;\n}\n.styles_contextHeadroomHint {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n.styles_contextCompactBar {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n flex: none;\n}\n.styles_contextCompactButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n flex: none;\n min-height: 30px;\n padding: 0 10px 0 8px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n cursor: pointer;\n color: #fff;\n background: #3b7ded;\n font-size: 12px;\n font-weight: 600;\n line-height: 16px;\n box-shadow: 0 0 0 1px color-mix(in srgb, #3b7ded 55%, transparent);\n}\n.styles_contextCompactButton:hover:not(:disabled) {\n color: #fff;\n background: #2f6fe0;\n}\n.styles_contextCompactButton:focus-visible {\n outline: 2px solid color-mix(in srgb, #3b7ded 70%, white);\n outline-offset: 2px;\n}\n.styles_contextCompactButton:disabled {\n cursor: default;\n opacity: 0.55;\n}\n.styles_contextCompactButtonLabel {\n max-width: 9em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_contextCompactHint,\n.styles_contextCompactNote {\n margin: 0;\n min-width: 0;\n flex: 1;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n padding-top: 5px;\n}\n.styles_contextCompactNote {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_contextEventRow {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n flex: none;\n}\n.styles_contextEventChip,\n.styles_contextEventChipCompact,\n.styles_contextEventChipPrune {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 7px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n line-height: 16px;\n}\n.styles_contextEventChipCompact {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextEventChipPrune {\n color: var(--dsw-alias-label-primary);\n}\n.styles_contextRightScroll,\n.styles_contextRightListFill {\n min-height: 0;\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.styles_contextRightScroll {\n overflow: auto;\n}\n.styles_contextRightListFill {\n overflow: hidden;\n}\n.styles_contextRightItem,\n.styles_contextRightItemActive,\n.styles_contextRightItemActiveFill {\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n}\n.styles_contextRightItem:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextRightItemActive,\n.styles_contextRightItemActiveFill {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_contextRightItemActiveFill {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.styles_contextRightRow {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 10px;\n width: 100%;\n text-align: left;\n border: 0;\n background: transparent;\n color: inherit;\n border-radius: var(--dsw-radius-sm);\n padding: 8px 8px 7px;\n cursor: pointer;\n font: inherit;\n}\n.styles_contextRightItemDot {\n width: 7px;\n height: 7px;\n border-radius: 999px;\n flex: none;\n margin-top: 5px;\n}\n.styles_contextRightRowMain {\n min-width: 0;\n flex: 1;\n display: grid;\n gap: 4px;\n}\n.styles_contextRightRowTitle {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n font-weight: 500;\n}\n.styles_contextRightBadge,\n.styles_contextRightBadgeMuted {\n display: inline-flex;\n align-items: center;\n padding: 0 5px;\n border-radius: var(--dsw-radius-sm);\n font-size: 10px;\n font-weight: 500;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightBadgeMuted {\n opacity: 0.9;\n}\n.styles_contextRightRowPreview {\n color: var(--dsw-alias-label-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_contextRightBarTrack {\n height: 2px;\n border-radius: 999px;\n background: var(--dsw-alias-border-primary);\n overflow: hidden;\n}\n.styles_contextRightBarFill {\n height: 100%;\n background: var(--dsw-alias-label-secondary);\n}\n.styles_contextRightRowTokens {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n text-align: right;\n padding-top: 1px;\n}\n.styles_contextRightShare {\n opacity: 0.85;\n}\n.styles_contextRightDetail {\n margin: 0 8px 8px 22px;\n min-height: 0;\n padding: 8px 10px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_contextRightItemActiveFill .styles_contextRightDetail {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.styles_contextRightDetailBody {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font: inherit;\n color: var(--dsw-alias-label-secondary);\n}\n.styles_contextRightItemActiveFill .styles_contextRightDetailBody {\n flex: 1;\n min-height: 0;\n overflow: auto;\n}\n.styles_contextRightNote {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n.styles_usageRightPane {\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n display: flex;\n flex-direction: column;\n padding: 0;\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-13);\n background:\n linear-gradient(\n 180deg,\n color-mix(in srgb, #3d7cf5 10%, var(--dsw-alias-bg-layer-1)) 0,\n var(--dsw-alias-bg-layer-1) 120px);\n}\n.styles_usagePanel {\n box-sizing: border-box;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 14px;\n overflow: auto;\n padding: 14px 14px 16px;\n}\n.styles_usagePanel h2,\n.styles_usagePanel h3,\n.styles_usagePanel p {\n margin: 0;\n}\n.styles_usageHeader,\n.styles_usageHero {\n display: grid;\n gap: 6px;\n flex: none;\n}\n.styles_usageHero {\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: end;\n gap: 12px;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-md, 10px);\n background:\n linear-gradient(\n 135deg,\n color-mix(in srgb, #3d7cf5 16%, transparent),\n color-mix(in srgb, #1f9a6a 8%, transparent));\n border: 1px solid color-mix(in srgb, #3d7cf5 22%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeroCopy {\n display: grid;\n gap: 4px;\n min-width: 0;\n}\n.styles_usageHeroTotal {\n display: grid;\n justify-items: end;\n gap: 2px;\n}\n.styles_usageHeroTotalValue {\n font: var(--dsw-font-sm-16, var(--dsw-font-sm-14));\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n letter-spacing: -0.02em;\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageHeroTotalLabel {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 14px;\n}\n.styles_usageMoneyBlock {\n display: grid;\n gap: 2px;\n margin-top: 4px;\n}\n.styles_usageEstimate {\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n letter-spacing: -0.01em;\n}\n.styles_usageEstimateHint,\n.styles_usageUnpriced,\n.styles_usageBalanceDetail,\n.styles_usageBalanceStale,\n.styles_usageBalanceHint {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageBalance {\n display: grid;\n gap: 2px;\n margin-top: 4px;\n font-variant-numeric: tabular-nums;\n}\n.styles_providerBalanceChip {\n display: grid;\n gap: 2px;\n justify-items: start;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n text-align: left;\n cursor: pointer;\n}\n.styles_providerBalanceChip:hover .styles_providerBalancePrimary {\n color: var(--dsw-alias-label-primary);\n}\n.styles_providerBalancePrimary {\n color: var(--dsw-alias-label-secondary);\n}\n.styles_providerBalanceDetail {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageTitle {\n font: var(--dsw-font-sm-14);\n font-weight: 650;\n letter-spacing: -0.01em;\n}\n.styles_usageBack {\n justify-self: start;\n margin: 0 0 2px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageBack:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageNote,\n.styles_usageRetention,\n.styles_usageEmpty,\n.styles_usageEmptyInline,\n.styles_usageBucketMeta {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n.styles_usageToolbar,\n.styles_usageRecordsToolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n flex: none;\n}\n.styles_usageRanges {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n width: fit-content;\n max-width: 100%;\n padding: 4px;\n background: var(--dsw-alias-bg-layer-2);\n border-radius: var(--dsw-radius-sm);\n flex: none;\n}\n.styles_usageRefresh {\n margin: 0;\n min-height: 28px;\n padding: 0 12px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent);\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageRefresh:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.styles_usageRefresh:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageRefresh:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n.styles_usageRange {\n margin: 0;\n min-height: 28px;\n padding: 0 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageRange[aria-pressed=true] {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n font-weight: 600;\n}\n.styles_usageRange:hover:not(:disabled):not([aria-pressed=true]) {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRange:focus-visible,\n.styles_usageBack:focus-visible,\n.styles_usageLink:focus-visible,\n.styles_usageRecordsEntry:focus-visible {\n outline: 2px solid var(--dsw-alias-label-secondary);\n outline-offset: 2px;\n}\n.styles_usageRange:disabled,\n.styles_usageRecordsEntry:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n.styles_usageCharts {\n display: grid;\n gap: 16px;\n flex: none;\n}\n.styles_usageBuckets {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n.styles_usageBucket {\n display: grid;\n gap: 4px;\n min-width: 0;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);\n}\n.styles_usageBucketLabel {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 14px;\n}\n.styles_usageBucketValue {\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-sm-14);\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageSectionTitle {\n margin: 0;\n font: var(--dsw-font-sm-13);\n font-weight: 650;\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageChart {\n display: grid;\n gap: 10px;\n}\n.styles_usageChartHead {\n display: grid;\n gap: 4px;\n}\n.styles_usageChartHint {\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 15px;\n}\n.styles_usageHeatBody {\n display: grid;\n gap: 10px;\n}\n.styles_usageHeatGrid {\n display: grid;\n gap: 4px;\n}\n.styles_usageHeatGridHour {\n grid-template-columns: repeat(6, minmax(0, 1fr));\n}\n.styles_usageHeatGridDay {\n grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));\n}\n.styles_usageHeatCell,\n.styles_usageHeatCellDim {\n box-sizing: border-box;\n display: grid;\n place-items: end start;\n min-height: 36px;\n margin: 0;\n padding: 4px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);\n border-radius: 6px;\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n transition: opacity 120ms ease, transform 120ms ease;\n}\n.styles_usageHeatCell:hover,\n.styles_usageHeatCell:focus-visible {\n transform: translateY(-1px);\n outline: none;\n}\n.styles_usageHeatCell:focus-visible {\n box-shadow: 0 0 0 2px color-mix(in srgb, #3d7cf5 55%, transparent);\n}\n.styles_usageHeatCellDim {\n opacity: 0.35;\n}\n.styles_usageHeatCell[data-level="0"],\n.styles_usageHeatCellDim[data-level="0"],\n.styles_usageHeatScale span[data-level="0"] {\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageHeatCell[data-level="1"],\n.styles_usageHeatCellDim[data-level="1"],\n.styles_usageHeatScale span[data-level="1"] {\n background: color-mix(in srgb, #3d7cf5 22%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeatCell[data-level="2"],\n.styles_usageHeatCellDim[data-level="2"],\n.styles_usageHeatScale span[data-level="2"] {\n background: color-mix(in srgb, #3d7cf5 40%, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageHeatCell[data-level="3"],\n.styles_usageHeatCellDim[data-level="3"],\n.styles_usageHeatScale span[data-level="3"] {\n background: color-mix(in srgb, #3d7cf5 62%, var(--dsw-alias-bg-layer-2));\n color: #f4f7ff;\n}\n.styles_usageHeatCell[data-level="4"],\n.styles_usageHeatCellDim[data-level="4"],\n.styles_usageHeatScale span[data-level="4"] {\n background: color-mix(in srgb, #245fd4 88%, #0b1c3a);\n color: #f4f7ff;\n}\n.styles_usageHeatLabel {\n font-size: 10px;\n line-height: 12px;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageHeatLegend {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n min-height: 20px;\n}\n.styles_usageHeatTipValue {\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n}\n.styles_usageHeatTipMeta {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n}\n.styles_usageHeatScale {\n display: inline-flex;\n gap: 3px;\n margin-left: auto;\n}\n.styles_usageHeatScale span {\n width: 12px;\n height: 12px;\n border-radius: 3px;\n border: 1px solid color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);\n}\n.styles_usageShareBody {\n display: grid;\n gap: 10px;\n}\n.styles_usageShareTrack {\n display: flex;\n width: 100%;\n height: 12px;\n overflow: hidden;\n border-radius: 999px;\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageShareSegment,\n.styles_usageShareSegmentDim {\n height: 100%;\n min-width: 2px;\n transition: opacity 120ms ease;\n}\n.styles_usageShareSegmentDim {\n opacity: 0.28;\n}\n.styles_usageLegend,\n.styles_usageRankList,\n.styles_usageRecentList {\n display: grid;\n gap: 8px;\n width: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.styles_usageLegendItem,\n.styles_usageLegendItemDim {\n display: grid;\n grid-template-columns: 8px minmax(0, 1fr) auto;\n gap: 8px;\n align-items: center;\n}\n.styles_usageLegendItemDim {\n opacity: 0.45;\n}\n.styles_usageLegendSwatch {\n width: 8px;\n height: 8px;\n border-radius: 999px;\n}\n.styles_usageLegendLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_usageLegendMeta,\n.styles_usageRankMeta {\n color: var(--dsw-alias-label-secondary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_usageLegendShare {\n margin-left: 6px;\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_usageRankItem {\n display: grid;\n gap: 4px;\n}\n.styles_usageRankTop {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageRankLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.styles_usageRankTrack {\n height: 6px;\n overflow: hidden;\n border-radius: 999px;\n background: var(--dsw-alias-bg-layer-2);\n}\n.styles_usageRankFill {\n height: 100%;\n border-radius: inherit;\n}\n.styles_usageFooter {\n margin-top: auto;\n flex: none;\n display: grid;\n gap: 8px;\n padding-top: 4px;\n}\n.styles_usageRecentPreview {\n display: grid;\n gap: 8px;\n}\n.styles_usageRecentHead {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageLink {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n cursor: pointer;\n}\n.styles_usageLink:hover {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRecordsEntry {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n margin: 0;\n padding: 10px 0;\n border: 0;\n border-top: 1px solid var(--dsw-alias-border-subtle, var(--dsw-alias-bg-layer-2));\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n text-align: start;\n cursor: pointer;\n}\n.styles_usageRecordsEntry:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n}\n.styles_usageRecordsEntryMeta {\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.styles_usageRecentItem {\n display: grid;\n gap: 6px;\n padding: 10px 0;\n}\n.styles_usageRecentItem + .styles_usageRecentItem {\n border-top: 1px solid var(--dsw-alias-border-subtle, var(--dsw-alias-bg-layer-2));\n}\n.styles_usageRecentMain {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 12px;\n}\n.styles_usageRecentSource {\n font-weight: 650;\n}\n.styles_usageRecentRoute {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 16px;\n}\n.styles_usageRecentProvider {\n color: var(--dsw-alias-label-tertiary);\n}\n.styles_usageRecentWhen {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n white-space: nowrap;\n}\n.styles_usageRecentTokens {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 10px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 16px;\n font-variant-numeric: tabular-nums;\n}\n';
|
|
1397
1421
|
function installCss() {
|
|
1398
1422
|
const style = document.createElement("style");
|
|
1399
1423
|
style.setAttribute("data-dsh-agent-enhancer", "");
|
|
@@ -1485,7 +1509,7 @@ function AgentControls({ session, t }) {
|
|
|
1485
1509
|
const errorLocale = OPTIMIZATION_ERROR_LOCALES[optimizeError];
|
|
1486
1510
|
const tooltip = state.chipSelection ? t("optimizeChipSelection") : state.error !== null ? t(errorLocale) : state.hasChips ? t("optimizeChips") : label;
|
|
1487
1511
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1488
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1512
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.Tooltip, { label: tooltip, side: "top", portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1489
1513
|
import_dsh_client_ui_primitives.Button,
|
|
1490
1514
|
{
|
|
1491
1515
|
type: "button",
|
|
@@ -1503,7 +1527,7 @@ function AgentControls({ session, t }) {
|
|
|
1503
1527
|
children: state.status === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "ongoing" }) : state.status === "undo" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(UndoIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OptimizeIcon, {})
|
|
1504
1528
|
}
|
|
1505
1529
|
) }),
|
|
1506
|
-
state.error !== null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { role: "status", children: t(errorLocale) })
|
|
1530
|
+
state.error !== null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { role: "status", className: css_module_default.toolbarStatus, children: t(errorLocale) })
|
|
1507
1531
|
] });
|
|
1508
1532
|
}
|
|
1509
1533
|
|
|
@@ -2120,6 +2144,84 @@ function decodeModelSelection(id) {
|
|
|
2120
2144
|
return null;
|
|
2121
2145
|
}
|
|
2122
2146
|
|
|
2147
|
+
// src/client/dsh/persist-settings.ts
|
|
2148
|
+
var ENHANCER_SETTINGS_NS = "agent-enhancer";
|
|
2149
|
+
function refusalMessage(error) {
|
|
2150
|
+
if (typeof error === "string" && error.trim() !== "") return error;
|
|
2151
|
+
if (error !== null && typeof error === "object" && typeof error.message === "string" && error.message.trim() !== "") {
|
|
2152
|
+
return error.message;
|
|
2153
|
+
}
|
|
2154
|
+
return "settings mutate refused";
|
|
2155
|
+
}
|
|
2156
|
+
function revisionOrZero(readRevision) {
|
|
2157
|
+
const revision = readRevision?.();
|
|
2158
|
+
return typeof revision === "number" && Number.isFinite(revision) ? revision : 0;
|
|
2159
|
+
}
|
|
2160
|
+
function settingsRemoteOf(remote) {
|
|
2161
|
+
if (remote === void 0 || remote === null || typeof remote !== "object") {
|
|
2162
|
+
throw new Error("remote.settings unavailable");
|
|
2163
|
+
}
|
|
2164
|
+
let settings;
|
|
2165
|
+
try {
|
|
2166
|
+
settings = Reflect.get(remote, "settings");
|
|
2167
|
+
} catch {
|
|
2168
|
+
settings = void 0;
|
|
2169
|
+
}
|
|
2170
|
+
if (settings === void 0 || settings === null || typeof settings !== "object" || typeof Reflect.get(settings, "mutate") !== "function") {
|
|
2171
|
+
throw new Error("remote.settings unavailable");
|
|
2172
|
+
}
|
|
2173
|
+
return { settings };
|
|
2174
|
+
}
|
|
2175
|
+
async function withSettingsRemote(ctx, run) {
|
|
2176
|
+
return await new Promise((resolve, reject) => {
|
|
2177
|
+
let settled = false;
|
|
2178
|
+
const finish = (fn) => {
|
|
2179
|
+
if (settled) return;
|
|
2180
|
+
settled = true;
|
|
2181
|
+
fn();
|
|
2182
|
+
};
|
|
2183
|
+
const fiber = ctx.inject(["remote.settings"], (scope) => {
|
|
2184
|
+
void Promise.resolve().then(() => run(scope.remote)).then(
|
|
2185
|
+
(value) => {
|
|
2186
|
+
finish(() => {
|
|
2187
|
+
resolve(value);
|
|
2188
|
+
});
|
|
2189
|
+
},
|
|
2190
|
+
(error) => {
|
|
2191
|
+
finish(() => {
|
|
2192
|
+
reject(error);
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
).finally(() => {
|
|
2196
|
+
void Promise.resolve(fiber.dispose()).catch(() => void 0);
|
|
2197
|
+
});
|
|
2198
|
+
});
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
async function revisionFromDescribe(remote) {
|
|
2202
|
+
if (remote.settings.describe === void 0) return void 0;
|
|
2203
|
+
try {
|
|
2204
|
+
const response = await remote.settings.describe();
|
|
2205
|
+
if (!response.ok) return void 0;
|
|
2206
|
+
const row = response.value.namespaces?.find((entry) => entry.ns === ENHANCER_SETTINGS_NS);
|
|
2207
|
+
return row?.revision;
|
|
2208
|
+
} catch {
|
|
2209
|
+
return void 0;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
async function persistEnhancerSettings(remote, ops, readRevision) {
|
|
2213
|
+
const settingsRemote = settingsRemoteOf(remote);
|
|
2214
|
+
const firstRevision = revisionOrZero(readRevision);
|
|
2215
|
+
const first = await settingsRemote.settings.mutate(ENHANCER_SETTINGS_NS, ops, firstRevision);
|
|
2216
|
+
if (first.ok) return;
|
|
2217
|
+
const described = await revisionFromDescribe(settingsRemote);
|
|
2218
|
+
const mirrored = revisionOrZero(readRevision);
|
|
2219
|
+
const retryRevision = described ?? (mirrored !== firstRevision ? mirrored : firstRevision);
|
|
2220
|
+
const second = await settingsRemote.settings.mutate(ENHANCER_SETTINGS_NS, ops, retryRevision);
|
|
2221
|
+
if (second.ok) return;
|
|
2222
|
+
throw new Error(refusalMessage(second.error ?? first.error));
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2123
2225
|
// src/client/dsh/settings-form.ts
|
|
2124
2226
|
var AcceptedSettingsForm = class {
|
|
2125
2227
|
constructor(form) {
|
|
@@ -2145,16 +2247,43 @@ var AcceptedSettingsForm = class {
|
|
|
2145
2247
|
};
|
|
2146
2248
|
}
|
|
2147
2249
|
async set(field, value) {
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2250
|
+
return this.mutate([{ op: "set", path: [field], value }]);
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Optimistic overlay after a successful fence-free Host write (see
|
|
2254
|
+
* `persistEnhancerSettings`). Keeps pills in sync until ConfigForm mirrors
|
|
2255
|
+
* the document-updated event.
|
|
2256
|
+
*/
|
|
2257
|
+
acceptLocal(ops) {
|
|
2258
|
+
this.remember(ops);
|
|
2259
|
+
}
|
|
2260
|
+
/**
|
|
2261
|
+
* Fallback Host write through ConfigForm. Prefer `persistEnhancerSettings`
|
|
2262
|
+
* for UI saves — ConfigForm always attaches a revision fence.
|
|
2263
|
+
*/
|
|
2264
|
+
async mutate(ops, expectedRevision) {
|
|
2265
|
+
const accepted = expectedRevision === void 0 ? await this.form.mutate(ops) : await this.form.mutate(ops, expectedRevision);
|
|
2266
|
+
if (!accepted && expectedRevision === void 0) {
|
|
2267
|
+
const retried = await this.form.mutate(ops);
|
|
2268
|
+
if (retried) {
|
|
2269
|
+
this.remember(ops);
|
|
2270
|
+
return true;
|
|
2271
|
+
}
|
|
2272
|
+
return false;
|
|
2155
2273
|
}
|
|
2274
|
+
if (accepted) this.remember(ops);
|
|
2156
2275
|
return accepted;
|
|
2157
2276
|
}
|
|
2277
|
+
remember(ops) {
|
|
2278
|
+
const revision = this.form.getSnapshot().revision;
|
|
2279
|
+
for (const op of ops) {
|
|
2280
|
+
if (op.op !== "set" || op.path.length !== 1) continue;
|
|
2281
|
+
const key = op.path[0];
|
|
2282
|
+
this.accepted.set(key, { value: op.value, revision });
|
|
2283
|
+
}
|
|
2284
|
+
this.refresh();
|
|
2285
|
+
for (const listener of this.listeners) listener();
|
|
2286
|
+
}
|
|
2158
2287
|
refresh() {
|
|
2159
2288
|
const current = this.form.getSnapshot();
|
|
2160
2289
|
const value = { ...current.value };
|
|
@@ -2601,7 +2730,7 @@ function featureDetailTitle(feature, t) {
|
|
|
2601
2730
|
}
|
|
2602
2731
|
}
|
|
2603
2732
|
}
|
|
2604
|
-
function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate }) {
|
|
2733
|
+
function PluginSettingsBody({ form, t, persist, loadCatalog, checkUpdate, applyUpdate }) {
|
|
2605
2734
|
const formState = (0, import_react4.useSyncExternalStore)(
|
|
2606
2735
|
(listener) => form.subscribe(listener),
|
|
2607
2736
|
() => form.getSnapshot(),
|
|
@@ -2612,6 +2741,21 @@ function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate })
|
|
|
2612
2741
|
const [view, setView] = (0, import_react4.useState)({ kind: "home" });
|
|
2613
2742
|
const [saving, setSaving] = (0, import_react4.useState)(null);
|
|
2614
2743
|
const [error, setError] = (0, import_react4.useState)(false);
|
|
2744
|
+
const [saveDetail, setSaveDetail] = (0, import_react4.useState)(null);
|
|
2745
|
+
const writeOps = async (ops) => {
|
|
2746
|
+
if (persist !== void 0) {
|
|
2747
|
+
await persist(ops);
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
const accepted = await form.mutate(ops);
|
|
2751
|
+
if (!accepted) {
|
|
2752
|
+
const status = form.getSnapshot().status;
|
|
2753
|
+
if (status === "unavailable" || status === "loading") {
|
|
2754
|
+
throw new Error(t("settingsUnavailable"));
|
|
2755
|
+
}
|
|
2756
|
+
throw new Error(t("settingsError"));
|
|
2757
|
+
}
|
|
2758
|
+
};
|
|
2615
2759
|
const [catalog, setCatalog] = (0, import_react4.useState)(null);
|
|
2616
2760
|
const [catalogStatus, setCatalogStatus] = (0, import_react4.useState)(
|
|
2617
2761
|
loadCatalog === void 0 ? "idle" : "loading"
|
|
@@ -2660,11 +2804,12 @@ function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate })
|
|
|
2660
2804
|
const onToggle = async (module2, checked) => {
|
|
2661
2805
|
setSaving(`${module2}Enabled`);
|
|
2662
2806
|
setError(false);
|
|
2807
|
+
setSaveDetail(null);
|
|
2663
2808
|
try {
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
} catch {
|
|
2809
|
+
await writeOps([{ op: "set", path: [`${module2}Enabled`], value: checked }]);
|
|
2810
|
+
} catch (cause) {
|
|
2667
2811
|
setError(true);
|
|
2812
|
+
setSaveDetail(cause instanceof Error ? cause.message : String(cause));
|
|
2668
2813
|
} finally {
|
|
2669
2814
|
setSaving(null);
|
|
2670
2815
|
}
|
|
@@ -2672,16 +2817,16 @@ function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate })
|
|
|
2672
2817
|
const saveFields = async (fields) => {
|
|
2673
2818
|
setSaving(fields.map(([field]) => field).join(","));
|
|
2674
2819
|
setError(false);
|
|
2820
|
+
setSaveDetail(null);
|
|
2675
2821
|
try {
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
}
|
|
2683
|
-
} catch {
|
|
2822
|
+
await writeOps(fields.map(([field, value]) => ({
|
|
2823
|
+
op: "set",
|
|
2824
|
+
path: [field],
|
|
2825
|
+
value
|
|
2826
|
+
})));
|
|
2827
|
+
} catch (cause) {
|
|
2684
2828
|
setError(true);
|
|
2829
|
+
setSaveDetail(cause instanceof Error ? cause.message : String(cause));
|
|
2685
2830
|
} finally {
|
|
2686
2831
|
setSaving(null);
|
|
2687
2832
|
}
|
|
@@ -2750,11 +2895,12 @@ function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate })
|
|
|
2750
2895
|
const onClassifierToggle = async (checked) => {
|
|
2751
2896
|
setSaving("autoClassifierEnabled");
|
|
2752
2897
|
setError(false);
|
|
2898
|
+
setSaveDetail(null);
|
|
2753
2899
|
try {
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
} catch {
|
|
2900
|
+
await writeOps([{ op: "set", path: ["autoClassifierEnabled"], value: checked }]);
|
|
2901
|
+
} catch (cause) {
|
|
2757
2902
|
setError(true);
|
|
2903
|
+
setSaveDetail(cause instanceof Error ? cause.message : String(cause));
|
|
2758
2904
|
} finally {
|
|
2759
2905
|
setSaving(null);
|
|
2760
2906
|
}
|
|
@@ -2767,6 +2913,8 @@ function PluginSettingsBody({ form, t, loadCatalog, checkUpdate, applyUpdate })
|
|
|
2767
2913
|
};
|
|
2768
2914
|
const statusBlock = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
2769
2915
|
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("settingsError") }),
|
|
2916
|
+
saveDetail !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", className: css_module_default.settingDescription, children: saveDetail }),
|
|
2917
|
+
formState?.status === "unavailable" && !error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", className: css_module_default.settingDescription, children: t("settingsUnavailable") }),
|
|
2770
2918
|
catalogStatus === "error" && catalogError !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { role: "status", className: css_module_default.settingDescription, title: catalogError, children: [
|
|
2771
2919
|
t("modelCatalogError"),
|
|
2772
2920
|
": ",
|
|
@@ -4525,6 +4673,7 @@ var agentLocales = {
|
|
|
4525
4673
|
privacy: "\u4F18\u5316\u3001\u9884\u6D4B\u4E0E\u4E0A\u4E0B\u6587\u538B\u7F29\u4F1A\u628A\u76F8\u5173\u5185\u5BB9\u53D1\u9001\u7ED9\u6240\u9009\u6A21\u578B\u63D0\u4F9B\u5546\uFF08\u9ED8\u8BA4\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\uFF09\uFF1B\u5386\u53F2\u4E0D\u8BF7\u6C42\u6A21\u578B\uFF1B\u4E0D\u91C7\u96C6\u63D0\u793A\u8BCD\u5185\u5BB9\u6216\u91C7\u7EB3\u7387\u9065\u6D4B\u3002\u6A21\u578B\u8D26\u5355\u53EA\u8BB0\u5F55\u529F\u80FD\u3001\u6A21\u578B\u548C token\uFF0C\u7559\u5728\u672C\u673A\uFF0C\u4E0D\u4E0A\u4F20\u3002",
|
|
4526
4674
|
coexistence: "\u68C0\u6D4B\u5230\u5B98\u65B9\u6216\u7B2C\u4E09\u65B9\u540C\u7C7B\u80FD\u529B\u65F6\u4EC5\u63D0\u793A\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u505C\u7528\u3002",
|
|
4527
4675
|
settingsError: "\u8BBE\u7F6E\u672A\u4FDD\u5B58\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
4676
|
+
settingsUnavailable: "\u63D2\u4EF6\u672A\u5728\u5BBF\u4E3B\u4FA7\u542F\u7528\uFF0C\u65E0\u6CD5\u5199\u5165\u8BBE\u7F6E\u3002\u8BF7\u5728\u63D2\u4EF6\u9875\u6253\u5F00\u300C\u667A\u80FD\u4F53\u589E\u5F3A\u300D\u540E\u91CD\u8BD5\u3002",
|
|
4528
4677
|
overlapHistory: "\u68C0\u6D4B\u5230\u53E6\u4E00\u4E2A\u5386\u53F2\u63D0\u793A\u8BCD\u529F\u80FD\u3002\u667A\u80FD\u4F53\u589E\u5F3A\u7684\u5386\u53F2\u4ECD\u4FDD\u6301\u5F00\u542F\u3002",
|
|
4529
4678
|
overlapOptimize: "\u68C0\u6D4B\u5230\u53E6\u4E00\u4E2A\u63D0\u793A\u8BCD\u4F18\u5316\u529F\u80FD\u3002\u667A\u80FD\u4F53\u589E\u5F3A\u7684\u4F18\u5316\u4ECD\u4FDD\u6301\u5F00\u542F\u3002",
|
|
4530
4679
|
overlapPredict: "\u68C0\u6D4B\u5230\u53E6\u4E00\u4E2A\u56DE\u590D\u5EFA\u8BAE\u529F\u80FD\u3002\u667A\u80FD\u4F53\u589E\u5F3A\u7684\u9884\u6D4B\u4ECD\u4FDD\u6301\u5F00\u542F\u3002",
|
|
@@ -4573,17 +4722,17 @@ var agentLocales = {
|
|
|
4573
4722
|
contextInspectCompactChanged: "\u538B\u7F29\u8FC7\u7A0B\u4E2D\u5386\u53F2\u5DF2\u53D8\u5316\uFF0C\u4F1A\u8BDD\u672A\u5199\u5165\uFF1B\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
|
|
4574
4723
|
rollback: "\u5BF9\u8BDD\u4E0E\u6587\u4EF6\u6062\u590D",
|
|
4575
4724
|
rollbackDescription: "\u5728\u5408\u89C4\u7528\u6237\u6D88\u606F\u65C1\u9884\u89C8\u5E76\u6062\u590D\u5BF9\u8BDD\u4E0E\u5DF2\u8DDF\u8E2A\u6587\u4EF6",
|
|
4576
|
-
rollbackBoundary: "\
|
|
4725
|
+
rollbackBoundary: "\u4EC5\u81EA\u52A8\u6062\u590D\u5BF9\u8BDD\u6295\u5F71\u4E0E\u5DF2\u8DDF\u8E2A\u7684\u6587\u672C\u6587\u4EF6\uFF1B\u8FDB\u7A0B\u3001\u7EC8\u7AEF\u3001\u672A\u8DDF\u8E2A\u4E0E\u4E8C\u8FDB\u5236\u6587\u4EF6\u4E0D\u5728\u8303\u56F4\u5185\u3002\u5173\u95ED\u5F00\u5173\u540E\u4FDD\u7559\u5DF2\u6709\u65E5\u5FD7\u4E0E\u68C0\u67E5\u70B9\u3002",
|
|
4577
4726
|
rollbackAction: "\u6062\u590D\u5230\u8FD9\u91CC",
|
|
4578
4727
|
rollbackUndoAction: "\u64A4\u9500\u6062\u590D",
|
|
4579
|
-
rollbackUndoCommandDescription: "\u64A4\u56DE\u6700\u8FD1\u4E00\u6B21\u6062\u590D\
|
|
4728
|
+
rollbackUndoCommandDescription: "\u64A4\u56DE\u6700\u8FD1\u4E00\u6B21\u6062\u590D\u6295\u5F71",
|
|
4580
4729
|
rollbackTitle: "\u6062\u590D\u5230\u7B2C {turn} \u8F6E\u4E4B\u524D",
|
|
4581
4730
|
rollbackUndoTitle: "\u64A4\u9500\u7B2C {turn} \u8F6E\u6062\u590D",
|
|
4582
|
-
rollbackScope: "\u53EF\
|
|
4583
|
-
rollbackScopeAlready: "\u5BF9\u8BDD\u5DF2\u505C\u5728\u6B64\u68C0\u67E5\u70B9\u3002\u786E\u8BA4\u53EA\u4F1A\u91CD\u65B0\u586B\u5165\u8BE5\u8F6E\u8349\u7A3F\uFF1B\
|
|
4584
|
-
rollbackScopeCovered: "\u5F53\u524D\u5DF2\u6062\u590D\u5230\u66F4\u65E9\u7684\u68C0\u67E5\u70B9\
|
|
4585
|
-
rollbackUndoScope: "\
|
|
4586
|
-
rollbackUndoScopeConversation: "\
|
|
4731
|
+
rollbackScope: "\u53EF\u4EC5\u6062\u590D\u5BF9\u8BDD\uFF0C\u6216\u540C\u65F6\u6062\u590D\u5DF2\u8DDF\u8E2A\u6587\u672C\u6587\u4EF6\u3002\u65E0\u6587\u4EF6\u53D8\u66F4\u65F6\u4ECD\u53EF\u786E\u8BA4\uFF1B\u6709\u51B2\u7A81\u65F6\u53EF\u4EC5\u6062\u590D\u5BF9\u8BDD\u3002",
|
|
4732
|
+
rollbackScopeAlready: "\u5BF9\u8BDD\u5DF2\u505C\u5728\u6B64\u68C0\u67E5\u70B9\u3002\u786E\u8BA4\u53EA\u4F1A\u91CD\u65B0\u586B\u5165\u8BE5\u8F6E\u8349\u7A3F\uFF1B\u8981\u7528\u300C\u64A4\u9500\u6062\u590D\u300D\u624D\u4F1A\u91CD\u65B0\u663E\u793A\u88AB\u64A4\u56DE\u7684\u6D88\u606F\u3002",
|
|
4733
|
+
rollbackScopeCovered: "\u5F53\u524D\u5DF2\u6062\u590D\u5230\u66F4\u65E9\u7684\u68C0\u67E5\u70B9\u3002\u8BF7\u5148\u300C\u64A4\u9500\u6062\u590D\u300D\uFF0C\u518D\u9009\u62E9\u8FD9\u4E00\u8F6E\u3002",
|
|
4734
|
+
rollbackUndoScope: "\u6E05\u9664\u672C\u6B21\u6062\u590D\u6295\u5F71\uFF0C\u5E76\u5C3D\u91CF\u8FD8\u539F\u6062\u590D\u524D\u7684\u5BF9\u8BDD\u4E0E\u5DF2\u8DDF\u8E2A\u6587\u672C\u6587\u4EF6\u3002",
|
|
4735
|
+
rollbackUndoScopeConversation: "\u6E05\u9664\u672C\u6B21\u4EC5\u5BF9\u8BDD\u6062\u590D\u6295\u5F71\uFF0C\u5E76\u8FD8\u539F\u6062\u590D\u524D\u7684\u5BF9\u8BDD\u9884\u89C8\u3002",
|
|
4587
4736
|
rollbackClose: "\u5173\u95ED\u6062\u590D\u9884\u89C8",
|
|
4588
4737
|
rollbackConfirm: "\u6062\u590D\u5BF9\u8BDD\u4E0E\u5DF2\u8DDF\u8E2A\u6587\u4EF6",
|
|
4589
4738
|
rollbackConfirmConversation: "\u4EC5\u6062\u590D\u5BF9\u8BDD",
|
|
@@ -4619,16 +4768,21 @@ var agentLocales = {
|
|
|
4619
4768
|
rollbackCoverageConversation: "\u6062\u590D\u5230\u8FD9\u91CC \xB7 \u4EC5\u5BF9\u8BDD\u5FEB\u7167",
|
|
4620
4769
|
rollbackTimelineTitle: "\u68C0\u67E5\u70B9",
|
|
4621
4770
|
rollbackTimelineOpen: "\u68C0\u67E5\u70B9\u65F6\u95F4\u7EBF",
|
|
4622
|
-
rollbackTimelineLead: "
|
|
4771
|
+
rollbackTimelineLead: "{turns} \u8F6E \xB7 {checkpoints} \u4E2A\u68C0\u67E5\u70B9",
|
|
4772
|
+
rollbackTimelineLeadRestoredNote: "\u5DF2\u6295\u5F71\u622A\u65AD\u5230\u5F53\u524D\u6062\u590D\u70B9\u3002",
|
|
4773
|
+
rollbackTimelineFilterEmpty: "\u6CA1\u6709\u5339\u914D\u7684\u8F6E\u6B21\u3002",
|
|
4774
|
+
rollbackTimelineSearchLabel: "\u641C\u7D22\u68C0\u67E5\u70B9",
|
|
4775
|
+
rollbackTimelineSearchPlaceholder: "\u641C\u7D22\u8F6E\u6B21\u53F7\u6216\u63D0\u793A\u8BCD\u2026",
|
|
4776
|
+
rollbackTimelineRestoreHint: "",
|
|
4623
4777
|
rollbackTimelineLoading: "\u6B63\u5728\u52A0\u8F7D\u68C0\u67E5\u70B9\u2026",
|
|
4624
4778
|
rollbackTimelineFailed: "\u68C0\u67E5\u70B9\u5217\u8868\u52A0\u8F7D\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",
|
|
4625
|
-
rollbackTimelineEmpty: "\u6B64\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u68C0\u67E5\u70B9\u3002
|
|
4626
|
-
rollbackTimelineNoSession: "\u8BF7\u4ECE\u4F1A\u8BDD\u4E2D\
|
|
4779
|
+
rollbackTimelineEmpty: "\u6B64\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u68C0\u67E5\u70B9\u3002",
|
|
4780
|
+
rollbackTimelineNoSession: "\u8BF7\u4ECE\u4F1A\u8BDD\u4E2D\u6253\u5F00\u68C0\u67E5\u70B9\u65F6\u95F4\u7EBF\u3002",
|
|
4627
4781
|
rollbackTimelineTurn: "\u7B2C {turn} \u8F6E",
|
|
4628
|
-
rollbackTimelineRolledBack: "\u5DF2\
|
|
4782
|
+
rollbackTimelineRolledBack: "\u5DF2\u622A\u65AD",
|
|
4629
4783
|
rollbackTimelineTip: "\u5F53\u524D\u6062\u590D\u70B9",
|
|
4630
4784
|
rollbackTimelineOpening: "\u6B63\u5728\u6253\u5F00\u9884\u89C8\u2026",
|
|
4631
|
-
rollbackTimelineCoveredHint: "\u5DF2\u88AB\u66F4\u65E9\u7684\u6062\u590D\u70B9\u8986\u76D6\
|
|
4785
|
+
rollbackTimelineCoveredHint: "\u5DF2\u88AB\u66F4\u65E9\u7684\u6062\u590D\u70B9\u8986\u76D6\uFF0C\u8BF7\u5148\u64A4\u9500\u5F53\u524D\u6062\u590D\u3002",
|
|
4632
4786
|
rollbackTimelineNoPrompt: "\u65E0\u53EF\u7528\u63D0\u793A\u8BCD\u6458\u8981",
|
|
4633
4787
|
rollbackTimelineFileFallback: "{path}",
|
|
4634
4788
|
rollbackTimelineFilesFallback: "{path} \u7B49 {count} \u4E2A\u6587\u4EF6",
|
|
@@ -4640,7 +4794,7 @@ var agentLocales = {
|
|
|
4640
4794
|
rollbackFiles: "\u5C06\u6062\u590D\u7684\u5DF2\u8DDF\u8E2A\u6587\u4EF6",
|
|
4641
4795
|
rollbackGaps: "\u65E0\u6CD5\u6062\u590D\u7684\u539F\u56E0",
|
|
4642
4796
|
rollbackFilesLimited: "\u5B8C\u6574\u6062\u590D\u53D7\u9650",
|
|
4643
|
-
rollbackFilesLimitedHint: "\u5DF2\u8DDF\u8E2A\
|
|
4797
|
+
rollbackFilesLimitedHint: "\u5DF2\u8DDF\u8E2A\u6587\u672C\u6587\u4EF6\u4ECD\u53EF\u6062\u590D\uFF1B\u82E5\u6587\u4EF6\u51B2\u7A81\uFF0C\u4ECD\u53EF\u53EA\u6062\u590D\u5BF9\u8BDD\u3002",
|
|
4644
4798
|
rollbackConflicts: "\u6587\u4EF6\u51B2\u7A81",
|
|
4645
4799
|
rollbackNoMessages: "\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u5BF9\u8BDD\u6D88\u606F\u3002",
|
|
4646
4800
|
rollbackNoFiles: "\u6B64\u68C0\u67E5\u70B9\u6CA1\u6709\u5DF2\u8DDF\u8E2A\u6587\u4EF6\u3002",
|
|
@@ -4799,6 +4953,7 @@ var agentLocales = {
|
|
|
4799
4953
|
privacy: "Optimize, predict, and context compact send related content to the selected model provider (defaults to the current session model). History never requests a model. No prompt content or acceptance-rate telemetry is collected. The model bill records only the feature, model, and token counts on this computer, and is not uploaded.",
|
|
4800
4954
|
coexistence: "Similar official or third-party features are only reported; they are never disabled automatically.",
|
|
4801
4955
|
settingsError: "Setting was not saved. Try again.",
|
|
4956
|
+
settingsUnavailable: "The plugin is not enabled on the host, so settings cannot be written. Turn on Agent Enhance in Plugins, then try again.",
|
|
4802
4957
|
overlapHistory: "Another prompt-history feature is enabled. Agent Enhance history remains enabled.",
|
|
4803
4958
|
overlapOptimize: "Another prompt-optimization feature is enabled. Agent Enhance optimization remains enabled.",
|
|
4804
4959
|
overlapPredict: "Another reply-suggestion feature is enabled. Agent Enhance prediction remains enabled.",
|
|
@@ -4847,17 +5002,17 @@ var agentLocales = {
|
|
|
4847
5002
|
contextInspectCompactChanged: "History changed during compaction; nothing was written. Try again.",
|
|
4848
5003
|
rollback: "Conversation and file restore",
|
|
4849
5004
|
rollbackDescription: "Preview and restore conversation and tracked files from eligible user messages",
|
|
4850
|
-
rollbackBoundary: "
|
|
5005
|
+
rollbackBoundary: "Auto-restores conversation projection and tracked text files only. Processes, terminals, untracked files, and binaries are out of scope. Existing logs and checkpoints remain after disable.",
|
|
4851
5006
|
rollbackAction: "Restore to here",
|
|
4852
5007
|
rollbackUndoAction: "Undo restore",
|
|
4853
|
-
rollbackUndoCommandDescription: "Withdraw the latest restore
|
|
5008
|
+
rollbackUndoCommandDescription: "Withdraw the latest restore projection",
|
|
4854
5009
|
rollbackTitle: "Restore before turn {turn}",
|
|
4855
5010
|
rollbackUndoTitle: "Undo restore before turn {turn}",
|
|
4856
|
-
rollbackScope: "
|
|
4857
|
-
rollbackScopeAlready: "
|
|
4858
|
-
rollbackScopeCovered: "A more recent restore already sits at an earlier checkpoint. Undo that restore first, then
|
|
4859
|
-
rollbackUndoScope: "
|
|
4860
|
-
rollbackUndoScopeConversation: "
|
|
5011
|
+
rollbackScope: "Restore conversation only, or conversation plus tracked text files. Soft gaps do not block confirm; conversation-only remains available when files conflict.",
|
|
5012
|
+
rollbackScopeAlready: "Already at this checkpoint. Confirm only prefills that turn\u2019s draft; use Undo restore to bring withdrawn messages back.",
|
|
5013
|
+
rollbackScopeCovered: "A more recent restore already sits at an earlier checkpoint. Undo that restore first, then choose this turn.",
|
|
5014
|
+
rollbackUndoScope: "Clear the restore projection and bring back the conversation and tracked text files shown in preview when possible.",
|
|
5015
|
+
rollbackUndoScopeConversation: "Clear the conversation-only restore projection and bring back the conversation shown in preview.",
|
|
4861
5016
|
rollbackClose: "Close restore preview",
|
|
4862
5017
|
rollbackConfirm: "Restore conversation and tracked files",
|
|
4863
5018
|
rollbackConfirmConversation: "Restore conversation only",
|
|
@@ -4893,16 +5048,21 @@ var agentLocales = {
|
|
|
4893
5048
|
rollbackCoverageConversation: "Restore to here \xB7 conversation snapshot",
|
|
4894
5049
|
rollbackTimelineTitle: "Checkpoints",
|
|
4895
5050
|
rollbackTimelineOpen: "Checkpoint timeline",
|
|
4896
|
-
rollbackTimelineLead: "
|
|
5051
|
+
rollbackTimelineLead: "{turns} turns \xB7 {checkpoints} checkpoints",
|
|
5052
|
+
rollbackTimelineLeadRestoredNote: "Projected truncated to the current restore point.",
|
|
5053
|
+
rollbackTimelineFilterEmpty: "No matching turns.",
|
|
5054
|
+
rollbackTimelineSearchLabel: "Search checkpoints",
|
|
5055
|
+
rollbackTimelineSearchPlaceholder: "Search turn number or prompt\u2026",
|
|
5056
|
+
rollbackTimelineRestoreHint: "",
|
|
4897
5057
|
rollbackTimelineLoading: "Loading checkpoints\u2026",
|
|
4898
5058
|
rollbackTimelineFailed: "Could not load checkpoints. Try again.",
|
|
4899
|
-
rollbackTimelineEmpty: "No checkpoints for this session yet.
|
|
4900
|
-
rollbackTimelineNoSession: "Open the checkpoint timeline from a
|
|
5059
|
+
rollbackTimelineEmpty: "No checkpoints to show for this session yet.",
|
|
5060
|
+
rollbackTimelineNoSession: "Open the checkpoint timeline from a conversation.",
|
|
4901
5061
|
rollbackTimelineTurn: "Turn {turn}",
|
|
4902
|
-
rollbackTimelineRolledBack: "
|
|
5062
|
+
rollbackTimelineRolledBack: "Truncated",
|
|
4903
5063
|
rollbackTimelineTip: "Current restore point",
|
|
4904
5064
|
rollbackTimelineOpening: "Opening preview\u2026",
|
|
4905
|
-
rollbackTimelineCoveredHint: "Covered by an earlier restore. Undo the current restore
|
|
5065
|
+
rollbackTimelineCoveredHint: "Covered by an earlier restore. Undo the current restore first.",
|
|
4906
5066
|
rollbackTimelineNoPrompt: "No prompt summary available",
|
|
4907
5067
|
rollbackTimelineFileFallback: "{path}",
|
|
4908
5068
|
rollbackTimelineFilesFallback: "{path} \xB7 {count} files",
|
|
@@ -4914,7 +5074,7 @@ var agentLocales = {
|
|
|
4914
5074
|
rollbackFiles: "Tracked files to restore",
|
|
4915
5075
|
rollbackGaps: "Why restore is unavailable",
|
|
4916
5076
|
rollbackFilesLimited: "Full restore is limited",
|
|
4917
|
-
rollbackFilesLimitedHint: "Tracked
|
|
5077
|
+
rollbackFilesLimitedHint: "Tracked text files can still be restored; conversation-only remains available if files conflict.",
|
|
4918
5078
|
rollbackConflicts: "File conflicts",
|
|
4919
5079
|
rollbackNoMessages: "No conversation messages are available for preview.",
|
|
4920
5080
|
rollbackNoFiles: "This checkpoint has no tracked files.",
|
|
@@ -4958,6 +5118,7 @@ function codec(typeSymbol) {
|
|
|
4958
5118
|
}
|
|
4959
5119
|
var requestCodec = codec("dsh-agent-enhancer#CheckpointRollbackRequest");
|
|
4960
5120
|
var summariesRequestCodec = codec("dsh-agent-enhancer#CheckpointSummariesRequest");
|
|
5121
|
+
var cutRequestCodec = codec("dsh-agent-enhancer#CheckpointCutRequest");
|
|
4961
5122
|
var checkpointClientRemoteInfo = {
|
|
4962
5123
|
package: "dsh-agent-enhancer",
|
|
4963
5124
|
descriptors: [{
|
|
@@ -4990,6 +5151,16 @@ var checkpointClientRemoteInfo = {
|
|
|
4990
5151
|
parameters: [{ name: "request", wire: "request", source: "json", codec: summariesRequestCodec }],
|
|
4991
5152
|
cancellation: { parameter: "signal" },
|
|
4992
5153
|
result: codec("dsh-agent-enhancer#CheckpointSummariesResult")
|
|
5154
|
+
}, {
|
|
5155
|
+
id: "dsh-agent-enhancer#checkpointRollback/getCut",
|
|
5156
|
+
service: "checkpointRollback",
|
|
5157
|
+
namespace: "checkpointRollback",
|
|
5158
|
+
method: "getCut",
|
|
5159
|
+
implementation: "getCut",
|
|
5160
|
+
invocation: { kind: "direct" },
|
|
5161
|
+
parameters: [{ name: "request", wire: "request", source: "json", codec: cutRequestCodec }],
|
|
5162
|
+
cancellation: { parameter: "signal" },
|
|
5163
|
+
result: codec("dsh-agent-enhancer#CheckpointCutResult")
|
|
4993
5164
|
}]
|
|
4994
5165
|
};
|
|
4995
5166
|
var CheckpointRollbackClientError = class extends Error {
|
|
@@ -5025,6 +5196,9 @@ var checkpointRollbackRemote = {
|
|
|
5025
5196
|
},
|
|
5026
5197
|
summaries(remote, request, signal) {
|
|
5027
5198
|
return invoke(remote, "summaries", request, signal);
|
|
5199
|
+
},
|
|
5200
|
+
getCut(remote, request, signal) {
|
|
5201
|
+
return invoke(remote, "getCut", request, signal);
|
|
5028
5202
|
}
|
|
5029
5203
|
};
|
|
5030
5204
|
|
|
@@ -5454,8 +5628,9 @@ function blockingUnavailable(unavailable, scope, options = {}) {
|
|
|
5454
5628
|
}
|
|
5455
5629
|
|
|
5456
5630
|
// src/client/rollback/scope.ts
|
|
5457
|
-
function confirmBlocked(unavailable, conflicts, scope, trackedFiles = 0) {
|
|
5631
|
+
function confirmBlocked(unavailable, conflicts, scope, trackedFiles = 0, options = {}) {
|
|
5458
5632
|
if (blockingUnavailable(unavailable, scope, { trackedFiles }).length > 0) return true;
|
|
5633
|
+
if (options.shadowRestore === true) return false;
|
|
5459
5634
|
return scope === "conversation-and-files" && conflicts.length > 0;
|
|
5460
5635
|
}
|
|
5461
5636
|
function scopeLabel(scope) {
|
|
@@ -5523,7 +5698,10 @@ var RollbackController = class {
|
|
|
5523
5698
|
if (!this.options.enabled() || previous === void 0 || previous === running) return;
|
|
5524
5699
|
const active = this.operation;
|
|
5525
5700
|
if (active === null || active.status === "executing" || active.status === "loading") return;
|
|
5526
|
-
this.open(active.turn, active.operation, {
|
|
5701
|
+
this.open(active.turn, active.operation, {
|
|
5702
|
+
surface: active.surface,
|
|
5703
|
+
...active.atSeq === void 0 ? {} : { atSeq: active.atSeq }
|
|
5704
|
+
});
|
|
5527
5705
|
}
|
|
5528
5706
|
open(turn, operation = "rollback", options = {}) {
|
|
5529
5707
|
if (this.disposed || !this.options.enabled() || this.operation?.status === "executing") return;
|
|
@@ -5531,9 +5709,22 @@ var RollbackController = class {
|
|
|
5531
5709
|
const version = ++this.version;
|
|
5532
5710
|
const controller = new AbortController();
|
|
5533
5711
|
const surface = this.resolveSurface(options.surface ?? "composer");
|
|
5534
|
-
this.operation = {
|
|
5712
|
+
this.operation = {
|
|
5713
|
+
turn,
|
|
5714
|
+
operation,
|
|
5715
|
+
status: "loading",
|
|
5716
|
+
version,
|
|
5717
|
+
controller,
|
|
5718
|
+
surface,
|
|
5719
|
+
...options.atSeq === void 0 ? {} : { atSeq: options.atSeq }
|
|
5720
|
+
};
|
|
5535
5721
|
this.publish();
|
|
5536
|
-
const request = {
|
|
5722
|
+
const request = {
|
|
5723
|
+
sessionId: this.options.sessionId,
|
|
5724
|
+
turn,
|
|
5725
|
+
operation,
|
|
5726
|
+
...options.atSeq === void 0 ? {} : { atSeq: options.atSeq }
|
|
5727
|
+
};
|
|
5537
5728
|
void this.options.remote.preview(request, controller.signal).then((result) => {
|
|
5538
5729
|
if (!this.current(version, request, result)) return;
|
|
5539
5730
|
this.rememberPreviewCoverage(result);
|
|
@@ -5541,11 +5732,15 @@ var RollbackController = class {
|
|
|
5541
5732
|
...this.operation,
|
|
5542
5733
|
turn: result.turn,
|
|
5543
5734
|
status: "ready",
|
|
5544
|
-
preview: result
|
|
5735
|
+
preview: result,
|
|
5736
|
+
...typeof result.atSeq === "number" ? { atSeq: result.atSeq } : {}
|
|
5545
5737
|
};
|
|
5546
5738
|
this.publish();
|
|
5547
5739
|
}).catch((error) => {
|
|
5548
5740
|
if (!this.current(version, request)) return;
|
|
5741
|
+
if (controller.signal.aborted || error instanceof Error && (error.name === "AbortError" || error.message === "AbortError")) {
|
|
5742
|
+
return;
|
|
5743
|
+
}
|
|
5549
5744
|
this.operation = {
|
|
5550
5745
|
...this.operation,
|
|
5551
5746
|
status: "error",
|
|
@@ -5577,7 +5772,8 @@ var RollbackController = class {
|
|
|
5577
5772
|
sessionId: this.options.sessionId,
|
|
5578
5773
|
turn,
|
|
5579
5774
|
operation,
|
|
5580
|
-
scope: effectiveScope
|
|
5775
|
+
scope: effectiveScope,
|
|
5776
|
+
...typeof preview.atSeq === "number" ? { atSeq: preview.atSeq } : {}
|
|
5581
5777
|
};
|
|
5582
5778
|
const controller = new AbortController();
|
|
5583
5779
|
this.operation = {
|
|
@@ -5598,7 +5794,7 @@ var RollbackController = class {
|
|
|
5598
5794
|
return;
|
|
5599
5795
|
}
|
|
5600
5796
|
if (this.disposed || !this.options.enabled()) return;
|
|
5601
|
-
if (result === null || typeof result !== "object" || result.sessionId !== request.sessionId || result.turn !== request.turn || typeof result.draft !== "string") {
|
|
5797
|
+
if (result === null || typeof result !== "object" || result.sessionId !== request.sessionId || Number(result.turn) !== Number(request.turn) || typeof result.draft !== "string") {
|
|
5602
5798
|
this.failExecute(turn, operation, preview, effectiveScope);
|
|
5603
5799
|
return;
|
|
5604
5800
|
}
|
|
@@ -5677,7 +5873,7 @@ var RollbackController = class {
|
|
|
5677
5873
|
}
|
|
5678
5874
|
if (response.sessionId !== request.sessionId) return false;
|
|
5679
5875
|
if (operation === "undo") return true;
|
|
5680
|
-
return response.turn === request.turn;
|
|
5876
|
+
return Number(response.turn) === Number(request.turn);
|
|
5681
5877
|
}
|
|
5682
5878
|
failExecute(turn, operation, preview, scope, error) {
|
|
5683
5879
|
this.operation = {
|
|
@@ -5712,7 +5908,8 @@ var RollbackController = class {
|
|
|
5712
5908
|
...this.operation.preview === void 0 ? {} : { preview: this.operation.preview },
|
|
5713
5909
|
...this.operation.scope === void 0 ? {} : { scope: this.operation.scope },
|
|
5714
5910
|
...this.operation.error === void 0 ? {} : { error: this.operation.error },
|
|
5715
|
-
...this.operation.errorCode === void 0 ? {} : { errorCode: this.operation.errorCode }
|
|
5911
|
+
...this.operation.errorCode === void 0 ? {} : { errorCode: this.operation.errorCode },
|
|
5912
|
+
...this.operation.atSeq === void 0 ? {} : { atSeq: this.operation.atSeq }
|
|
5716
5913
|
}
|
|
5717
5914
|
};
|
|
5718
5915
|
for (const listener of this.listeners) listener();
|
|
@@ -5723,6 +5920,41 @@ function errorFields(error) {
|
|
|
5723
5920
|
return errorCode === void 0 ? {} : { errorCode };
|
|
5724
5921
|
}
|
|
5725
5922
|
|
|
5923
|
+
// src/client/rollback/cut-cache.ts
|
|
5924
|
+
var SessionCutCache = class {
|
|
5925
|
+
cuts = /* @__PURE__ */ new Map();
|
|
5926
|
+
listeners = /* @__PURE__ */ new Set();
|
|
5927
|
+
get(sessionId) {
|
|
5928
|
+
return this.cuts.get(sessionId);
|
|
5929
|
+
}
|
|
5930
|
+
set(sessionId, cut) {
|
|
5931
|
+
const previous = this.cuts.get(sessionId);
|
|
5932
|
+
if (previous === cut || previous !== void 0 && cut !== null && previous !== null && previous.hideTurnsFrom === cut.hideTurnsFrom && previous.cutSeq === cut.cutSeq && previous.restoredAtSeq === cut.restoredAtSeq) {
|
|
5933
|
+
if (previous === void 0 && cut === null) {
|
|
5934
|
+
this.cuts.set(sessionId, null);
|
|
5935
|
+
this.emit();
|
|
5936
|
+
}
|
|
5937
|
+
return;
|
|
5938
|
+
}
|
|
5939
|
+
this.cuts.set(sessionId, cut);
|
|
5940
|
+
this.emit();
|
|
5941
|
+
}
|
|
5942
|
+
clear(sessionId) {
|
|
5943
|
+
if (!this.cuts.has(sessionId)) return;
|
|
5944
|
+
this.cuts.delete(sessionId);
|
|
5945
|
+
this.emit();
|
|
5946
|
+
}
|
|
5947
|
+
subscribe(listener) {
|
|
5948
|
+
this.listeners.add(listener);
|
|
5949
|
+
return () => {
|
|
5950
|
+
this.listeners.delete(listener);
|
|
5951
|
+
};
|
|
5952
|
+
}
|
|
5953
|
+
emit() {
|
|
5954
|
+
for (const listener of this.listeners) listener();
|
|
5955
|
+
}
|
|
5956
|
+
};
|
|
5957
|
+
|
|
5726
5958
|
// src/client/rollback/modal-host.tsx
|
|
5727
5959
|
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5728
5960
|
var import_react12 = require("react");
|
|
@@ -5994,7 +6226,10 @@ function RollbackModalHost(props) {
|
|
|
5994
6226
|
};
|
|
5995
6227
|
const runRetry = () => {
|
|
5996
6228
|
if (active.status !== "error") return;
|
|
5997
|
-
props.rollback.open(active.turn, active.operation, {
|
|
6229
|
+
props.rollback.open(active.turn, active.operation, {
|
|
6230
|
+
surface: active.surface,
|
|
6231
|
+
...active.atSeq === void 0 && active.preview?.atSeq === void 0 ? {} : { atSeq: active.atSeq ?? active.preview?.atSeq }
|
|
6232
|
+
});
|
|
5998
6233
|
};
|
|
5999
6234
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6000
6235
|
import_dsh_client_ui_primitives6.Modal,
|
|
@@ -6071,7 +6306,14 @@ function RollbackModalHost(props) {
|
|
|
6071
6306
|
)
|
|
6072
6307
|
] })
|
|
6073
6308
|
] }),
|
|
6074
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6310
|
+
RollbackPreview,
|
|
6311
|
+
{
|
|
6312
|
+
active,
|
|
6313
|
+
t: props.t,
|
|
6314
|
+
onOpenTimeline: props.onOpenTimeline
|
|
6315
|
+
}
|
|
6316
|
+
)
|
|
6075
6317
|
}
|
|
6076
6318
|
);
|
|
6077
6319
|
}
|
|
@@ -6302,7 +6544,8 @@ function liveTipMarker(events) {
|
|
|
6302
6544
|
if (markers.length === 0) return void 0;
|
|
6303
6545
|
return markers.reduce((latest, event) => Number(event.seq) >= Number(latest.seq) ? event : latest);
|
|
6304
6546
|
}
|
|
6305
|
-
function activeRollbackHideTurnsFrom(entries) {
|
|
6547
|
+
function activeRollbackHideTurnsFrom(entries, cut) {
|
|
6548
|
+
if (cut !== null && cut !== void 0) return cut.hideTurnsFrom;
|
|
6306
6549
|
let hideTurnsFrom;
|
|
6307
6550
|
for (const tip of activeTipMarkers(entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []))) {
|
|
6308
6551
|
if (tip.type !== "user/message") continue;
|
|
@@ -6312,11 +6555,13 @@ function activeRollbackHideTurnsFrom(entries) {
|
|
|
6312
6555
|
}
|
|
6313
6556
|
return hideTurnsFrom;
|
|
6314
6557
|
}
|
|
6315
|
-
function activeRollbackContinueAfterSeq(entries) {
|
|
6558
|
+
function activeRollbackContinueAfterSeq(entries, cut) {
|
|
6559
|
+
if (cut !== null && cut !== void 0) return cut.restoredAtSeq;
|
|
6316
6560
|
const tip = liveTipMarker(entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []));
|
|
6317
6561
|
return tip === void 0 ? void 0 : Number(tip.seq);
|
|
6318
6562
|
}
|
|
6319
|
-
function keepPrefixLoadThroughSeq(entries) {
|
|
6563
|
+
function keepPrefixLoadThroughSeq(entries, cut) {
|
|
6564
|
+
if (cut !== null && cut !== void 0) return Math.max(0, cut.cutSeq);
|
|
6320
6565
|
const markers = activeTipMarkers(entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []));
|
|
6321
6566
|
if (markers.length === 0) return void 0;
|
|
6322
6567
|
let minShadowed;
|
|
@@ -6338,12 +6583,17 @@ function hasKeepPrefixConversation(entries) {
|
|
|
6338
6583
|
return !isRollbackMarkerEvent(event) && !isUndoCopyEvent2(event);
|
|
6339
6584
|
});
|
|
6340
6585
|
}
|
|
6341
|
-
function needsKeepPrefixHistory(entries, hasMore) {
|
|
6586
|
+
function needsKeepPrefixHistory(entries, hasMore, cut) {
|
|
6342
6587
|
if (!hasMore) return false;
|
|
6343
|
-
if (keepPrefixLoadThroughSeq(entries) === void 0) return false;
|
|
6588
|
+
if (keepPrefixLoadThroughSeq(entries, cut) === void 0) return false;
|
|
6344
6589
|
return !hasKeepPrefixConversation(entries);
|
|
6345
6590
|
}
|
|
6346
|
-
function activeRollbackUndoTip(entries) {
|
|
6591
|
+
function activeRollbackUndoTip(entries, cut) {
|
|
6592
|
+
if (cut !== null && cut !== void 0) {
|
|
6593
|
+
const events2 = entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []);
|
|
6594
|
+
const later2 = events2.some((event) => Number(event.seq) > cut.restoredAtSeq && !isRollbackMarkerEvent(event) && !isUndoCopyEvent2(event));
|
|
6595
|
+
return later2 ? void 0 : { turn: cut.hideTurnsFrom };
|
|
6596
|
+
}
|
|
6347
6597
|
const events = entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []);
|
|
6348
6598
|
const tip = liveTipMarker(events);
|
|
6349
6599
|
if (tip === void 0 || tip.type !== "user/message") return void 0;
|
|
@@ -6548,20 +6798,21 @@ function renumberCollidingTurns(entries) {
|
|
|
6548
6798
|
});
|
|
6549
6799
|
return changed ? next : entries;
|
|
6550
6800
|
}
|
|
6551
|
-
function presentRollbackTranscript(entries) {
|
|
6801
|
+
function presentRollbackTranscript(entries, cut) {
|
|
6552
6802
|
const events = entries.flatMap((entry) => entry.type === "event" ? [entry.event] : []);
|
|
6553
6803
|
const bySeq = new Map(events.map((event) => [Number(event.seq), event]));
|
|
6554
6804
|
const everShadowed = /* @__PURE__ */ new Set();
|
|
6555
|
-
const liveTip = liveTipMarker(events);
|
|
6805
|
+
const liveTip = cut !== null && cut !== void 0 ? void 0 : liveTipMarker(events);
|
|
6556
6806
|
const liveTipSeq = liveTip === void 0 ? void 0 : Number(liveTip.seq);
|
|
6557
|
-
const hideTurnsFrom = activeRollbackHideTurnsFrom(entries);
|
|
6558
|
-
const continueAfterSeq = activeRollbackContinueAfterSeq(entries);
|
|
6807
|
+
const hideTurnsFrom = activeRollbackHideTurnsFrom(entries, cut);
|
|
6808
|
+
const continueAfterSeq = activeRollbackContinueAfterSeq(entries, cut);
|
|
6559
6809
|
const undoRanges = undoShellRanges(events);
|
|
6560
6810
|
for (const event of events) {
|
|
6561
6811
|
if (!isRollbackMarkerEvent(event)) continue;
|
|
6562
6812
|
for (const seq of event.sourceEventSeqs ?? []) everShadowed.add(Number(seq));
|
|
6563
6813
|
}
|
|
6564
|
-
|
|
6814
|
+
const hasCut = cut !== null && cut !== void 0;
|
|
6815
|
+
if (!hasCut && everShadowed.size === 0 && liveTipSeq === void 0 && undoRanges.length === 0 && !events.some(isUndoCopyEvent2)) return renumberCollidingTurns(entries);
|
|
6565
6816
|
let changed = false;
|
|
6566
6817
|
const next = [];
|
|
6567
6818
|
const presentSteps = collectStepChromeKeys([]);
|
|
@@ -6571,12 +6822,16 @@ function presentRollbackTranscript(entries) {
|
|
|
6571
6822
|
continue;
|
|
6572
6823
|
}
|
|
6573
6824
|
const event = entry.event;
|
|
6574
|
-
|
|
6825
|
+
const seq = Number(event.seq);
|
|
6826
|
+
if (hasCut && seq > cut.cutSeq && seq <= cut.restoredAtSeq) {
|
|
6827
|
+
changed = true;
|
|
6828
|
+
continue;
|
|
6829
|
+
}
|
|
6830
|
+
if (everShadowed.has(seq)) {
|
|
6575
6831
|
changed = true;
|
|
6576
6832
|
continue;
|
|
6577
6833
|
}
|
|
6578
6834
|
const ownedTurn = turnOfEvent(event);
|
|
6579
|
-
const seq = Number(event.seq);
|
|
6580
6835
|
const shell = undoRanges.find((range) => seq >= range.startSeq && seq <= range.endSeq);
|
|
6581
6836
|
if (shell !== void 0) {
|
|
6582
6837
|
if (event.type === "turn/start" || event.type === "turn/end" || event.type === "tool/call") {
|
|
@@ -6592,7 +6847,7 @@ function presentRollbackTranscript(entries) {
|
|
|
6592
6847
|
}
|
|
6593
6848
|
}
|
|
6594
6849
|
const beforeTip = continueAfterSeq === void 0 || seq <= continueAfterSeq;
|
|
6595
|
-
if (hideTurnsFrom !== void 0 && ownedTurn !== void 0 && ownedTurn >= hideTurnsFrom && beforeTip && !isRollbackMarkerEvent(event) && !isUndoCopyEvent2(event)) {
|
|
6850
|
+
if (!hasCut && hideTurnsFrom !== void 0 && ownedTurn !== void 0 && ownedTurn >= hideTurnsFrom && beforeTip && !isRollbackMarkerEvent(event) && !isUndoCopyEvent2(event)) {
|
|
6596
6851
|
changed = true;
|
|
6597
6852
|
continue;
|
|
6598
6853
|
}
|
|
@@ -6602,6 +6857,10 @@ function presentRollbackTranscript(entries) {
|
|
|
6602
6857
|
presentSteps.ends.add(stepKey(event.data.turn, event.data.step));
|
|
6603
6858
|
}
|
|
6604
6859
|
if (isRollbackMarkerEvent(event)) {
|
|
6860
|
+
if (hasCut) {
|
|
6861
|
+
changed = true;
|
|
6862
|
+
continue;
|
|
6863
|
+
}
|
|
6605
6864
|
if (liveTipSeq === void 0 || Number(event.seq) !== liveTipSeq) {
|
|
6606
6865
|
changed = true;
|
|
6607
6866
|
continue;
|
|
@@ -6632,24 +6891,66 @@ function presentRollbackTranscript(entries) {
|
|
|
6632
6891
|
|
|
6633
6892
|
// src/client/rollback/transcript-filter.ts
|
|
6634
6893
|
var KEEP_PREFIX_MAX_PAGES = 12;
|
|
6635
|
-
function
|
|
6894
|
+
function eventSeq(entry) {
|
|
6895
|
+
if (entry.type !== "event") return void 0;
|
|
6896
|
+
const value = Number(entry.event.seq);
|
|
6897
|
+
return Number.isFinite(value) ? value : void 0;
|
|
6898
|
+
}
|
|
6899
|
+
function mergeTranscriptEntries(raw, incoming) {
|
|
6900
|
+
const bySeq = /* @__PURE__ */ new Map();
|
|
6901
|
+
for (const entry of raw) {
|
|
6902
|
+
const seq = eventSeq(entry);
|
|
6903
|
+
if (seq !== void 0) bySeq.set(seq, entry);
|
|
6904
|
+
}
|
|
6905
|
+
const rest = [];
|
|
6906
|
+
for (const entry of incoming) {
|
|
6907
|
+
const seq = eventSeq(entry);
|
|
6908
|
+
if (seq === void 0) {
|
|
6909
|
+
rest.push(entry);
|
|
6910
|
+
continue;
|
|
6911
|
+
}
|
|
6912
|
+
bySeq.set(seq, entry);
|
|
6913
|
+
}
|
|
6914
|
+
return [
|
|
6915
|
+
...[...bySeq.entries()].sort((left, right) => left[0] - right[0]).map(([, entry]) => entry),
|
|
6916
|
+
...rest
|
|
6917
|
+
];
|
|
6918
|
+
}
|
|
6919
|
+
function sameEntries(left, right) {
|
|
6920
|
+
if (left === right) return true;
|
|
6921
|
+
if (left.length !== right.length) return false;
|
|
6922
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
6923
|
+
const a = left[index];
|
|
6924
|
+
const b = right[index];
|
|
6925
|
+
if (a === b) continue;
|
|
6926
|
+
if (a.type !== b.type) return false;
|
|
6927
|
+
if (a.type === "event" && b.type === "event" && Number(a.event.seq) !== Number(b.event.seq)) {
|
|
6928
|
+
return false;
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
return true;
|
|
6932
|
+
}
|
|
6933
|
+
function installRollbackTranscriptFilter(ctx, tips, cuts) {
|
|
6636
6934
|
const sessions = ctx.get("sessions");
|
|
6637
6935
|
if (sessions?.list === void 0 || typeof sessions.binding !== "function") return () => {
|
|
6638
6936
|
};
|
|
6639
6937
|
const watched = /* @__PURE__ */ new Map();
|
|
6938
|
+
const rawWindows = /* @__PURE__ */ new Map();
|
|
6640
6939
|
const keepPrefixAttempted = /* @__PURE__ */ new Map();
|
|
6641
6940
|
const loadingKeepPrefix = /* @__PURE__ */ new Set();
|
|
6941
|
+
const syncing = /* @__PURE__ */ new Set();
|
|
6642
6942
|
const sessionOpen = (session) => session.openState === void 0 || session.openState === "open";
|
|
6643
6943
|
const requestKeepPrefix = (sessionId, binding, entries) => {
|
|
6644
6944
|
if (loadingKeepPrefix.has(sessionId)) return;
|
|
6645
|
-
const
|
|
6945
|
+
const cut = cuts?.get(sessionId) ?? null;
|
|
6946
|
+
const tipSeq = activeRollbackContinueAfterSeq(entries, cut);
|
|
6646
6947
|
if (tipSeq === void 0) return;
|
|
6647
6948
|
if (keepPrefixAttempted.get(sessionId) === tipSeq) return;
|
|
6648
6949
|
const session = binding.session;
|
|
6649
6950
|
const source = binding.eventSource;
|
|
6650
6951
|
if (session === void 0 || source.replace === void 0) return;
|
|
6651
6952
|
if (!sessionOpen(session) || session.loadingOlder === true) return;
|
|
6652
|
-
const target = keepPrefixLoadThroughSeq(entries);
|
|
6953
|
+
const target = keepPrefixLoadThroughSeq(entries, cut);
|
|
6653
6954
|
if (session.hasMore === false) {
|
|
6654
6955
|
keepPrefixAttempted.set(sessionId, tipSeq);
|
|
6655
6956
|
return;
|
|
@@ -6658,7 +6959,7 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6658
6959
|
keepPrefixAttempted.set(sessionId, tipSeq);
|
|
6659
6960
|
return;
|
|
6660
6961
|
}
|
|
6661
|
-
if (typeof session.baseSeq === "number" && session.baseSeq <= target && !needsKeepPrefixHistory(entries, true)) {
|
|
6962
|
+
if (typeof session.baseSeq === "number" && session.baseSeq <= target && !needsKeepPrefixHistory(entries, true, cut)) {
|
|
6662
6963
|
keepPrefixAttempted.set(sessionId, tipSeq);
|
|
6663
6964
|
return;
|
|
6664
6965
|
}
|
|
@@ -6675,8 +6976,10 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6675
6976
|
if (typeof session.loadOlder === "function") {
|
|
6676
6977
|
for (let page = 0; page < KEEP_PREFIX_MAX_PAGES; page += 1) {
|
|
6677
6978
|
const snap = source.getSnapshot();
|
|
6678
|
-
const
|
|
6679
|
-
|
|
6979
|
+
const liveCut = cuts?.get(sessionId) ?? null;
|
|
6980
|
+
const raw = rawWindows.get(sessionId)?.entries ?? snap.entries;
|
|
6981
|
+
const presented = presentRollbackTranscript(raw, liveCut);
|
|
6982
|
+
if (!needsKeepPrefixHistory(presented, snap.hasMore || session.hasMore !== false, liveCut)) break;
|
|
6680
6983
|
if (session.hasMore === false || session.loadingOlder === true) break;
|
|
6681
6984
|
await session.loadOlder();
|
|
6682
6985
|
}
|
|
@@ -6689,25 +6992,38 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6689
6992
|
})();
|
|
6690
6993
|
};
|
|
6691
6994
|
const syncSession = (sessionId) => {
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6995
|
+
if (syncing.has(sessionId)) return;
|
|
6996
|
+
syncing.add(sessionId);
|
|
6997
|
+
try {
|
|
6998
|
+
const binding = sessions.binding(sessionId);
|
|
6999
|
+
const source = binding?.eventSource;
|
|
7000
|
+
if (source?.replace === void 0) {
|
|
7001
|
+
tips?.set(sessionId, void 0);
|
|
7002
|
+
return;
|
|
7003
|
+
}
|
|
7004
|
+
const window2 = source.getSnapshot();
|
|
7005
|
+
const cut = cuts?.get(sessionId) ?? null;
|
|
7006
|
+
const previous = rawWindows.get(sessionId);
|
|
7007
|
+
const merged = previous === void 0 ? window2.entries : mergeTranscriptEntries(previous.entries, window2.entries);
|
|
7008
|
+
const raw = { entries: merged, hasMore: window2.hasMore };
|
|
7009
|
+
rawWindows.set(sessionId, raw);
|
|
7010
|
+
const before = promptLedgerFor(sessionId).list().length;
|
|
7011
|
+
promptLedgerFor(sessionId).observe(promptsFromSessionEntries(raw.entries));
|
|
7012
|
+
if (promptLedgerFor(sessionId).list().length !== before) {
|
|
7013
|
+
invalidatePromptHistory(sessionId);
|
|
7014
|
+
}
|
|
7015
|
+
const presented = presentRollbackTranscript(raw.entries, cut);
|
|
7016
|
+
tips?.set(sessionId, activeRollbackUndoTip(presented, cut)?.turn);
|
|
7017
|
+
const tipSeq = activeRollbackContinueAfterSeq(presented, cut);
|
|
7018
|
+
if (tipSeq === void 0) keepPrefixAttempted.delete(sessionId);
|
|
7019
|
+
if (!sameEntries(presented, window2.entries)) {
|
|
7020
|
+
source.replace(presented, raw.hasMore);
|
|
7021
|
+
}
|
|
7022
|
+
if (needsKeepPrefixHistory(presented, window2.hasMore, cut) && binding !== void 0) {
|
|
7023
|
+
requestKeepPrefix(sessionId, binding, presented);
|
|
7024
|
+
}
|
|
7025
|
+
} finally {
|
|
7026
|
+
syncing.delete(sessionId);
|
|
6711
7027
|
}
|
|
6712
7028
|
};
|
|
6713
7029
|
const watch = (sessionId) => {
|
|
@@ -6729,7 +7045,9 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6729
7045
|
watched.delete(sessionId);
|
|
6730
7046
|
loadingKeepPrefix.delete(sessionId);
|
|
6731
7047
|
keepPrefixAttempted.delete(sessionId);
|
|
7048
|
+
rawWindows.delete(sessionId);
|
|
6732
7049
|
tips?.set(sessionId, void 0);
|
|
7050
|
+
cuts?.clear(sessionId);
|
|
6733
7051
|
}
|
|
6734
7052
|
}) ?? (() => {
|
|
6735
7053
|
});
|
|
@@ -6739,6 +7057,7 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6739
7057
|
unsubRetention();
|
|
6740
7058
|
loadingKeepPrefix.delete(sessionId);
|
|
6741
7059
|
keepPrefixAttempted.delete(sessionId);
|
|
7060
|
+
rawWindows.delete(sessionId);
|
|
6742
7061
|
tips?.set(sessionId, void 0);
|
|
6743
7062
|
});
|
|
6744
7063
|
syncSession(sessionId);
|
|
@@ -6747,13 +7066,19 @@ function installRollbackTranscriptFilter(ctx, tips) {
|
|
|
6747
7066
|
for (const id of sessions.list.getSnapshot().ids ?? []) watch(id);
|
|
6748
7067
|
};
|
|
6749
7068
|
const unsubList = sessions.list.subscribe(syncList);
|
|
7069
|
+
const unsubCuts = cuts?.subscribe(() => {
|
|
7070
|
+
for (const id of watched.keys()) syncSession(id);
|
|
7071
|
+
}) ?? (() => {
|
|
7072
|
+
});
|
|
6750
7073
|
syncList();
|
|
6751
7074
|
return () => {
|
|
6752
7075
|
unsubList();
|
|
7076
|
+
unsubCuts();
|
|
6753
7077
|
for (const dispose of watched.values()) dispose();
|
|
6754
7078
|
watched.clear();
|
|
6755
7079
|
loadingKeepPrefix.clear();
|
|
6756
7080
|
keepPrefixAttempted.clear();
|
|
7081
|
+
rawWindows.clear();
|
|
6757
7082
|
};
|
|
6758
7083
|
}
|
|
6759
7084
|
|
|
@@ -6839,96 +7164,8 @@ function installRollbackTurnOutlineFilter(ctx) {
|
|
|
6839
7164
|
}
|
|
6840
7165
|
|
|
6841
7166
|
// src/client/rollback/session-stats-filter.ts
|
|
6842
|
-
function
|
|
6843
|
-
return typeof value === "object" && value !== null;
|
|
6844
|
-
}
|
|
6845
|
-
function withActivityCounts(base, activity) {
|
|
6846
|
-
if (!isRecord2(base)) return base;
|
|
6847
|
-
if (base.turns === activity.turns && base.steps === activity.steps) return base;
|
|
6848
|
-
return { ...base, turns: activity.turns, steps: activity.steps };
|
|
6849
|
-
}
|
|
6850
|
-
function installRollbackSessionStatsFilter(ctx) {
|
|
6851
|
-
const sessions = ctx.get("sessions");
|
|
6852
|
-
if (sessions?.list === void 0 || typeof sessions.binding !== "function") return () => {
|
|
6853
|
-
};
|
|
6854
|
-
const watched = /* @__PURE__ */ new Map();
|
|
6855
|
-
const hostStats = /* @__PURE__ */ new Map();
|
|
6856
|
-
const published = /* @__PURE__ */ new Map();
|
|
6857
|
-
const publish = (sessionId) => {
|
|
6858
|
-
const binding = sessions.binding(sessionId);
|
|
6859
|
-
const projections = binding?.session.projections;
|
|
6860
|
-
const source = binding?.eventSource;
|
|
6861
|
-
if (projections?.get === void 0 || projections.apply === void 0 || source === void 0) return;
|
|
6862
|
-
const base = hostStats.get(sessionId);
|
|
6863
|
-
if (!isRecord2(base)) return;
|
|
6864
|
-
const entries = source.getSnapshot().entries;
|
|
6865
|
-
const next = withActivityCounts(base, activityStatsFromEntries(entries));
|
|
6866
|
-
if (Object.is(next, projections.get("sessionStats"))) return;
|
|
6867
|
-
const currentSeq = Number(projections.seqOf("sessionStats") ?? 0);
|
|
6868
|
-
projections.apply("sessionStats", next, Number.isFinite(currentSeq) ? currentSeq + 1 : 1);
|
|
6869
|
-
published.set(sessionId, next);
|
|
6870
|
-
};
|
|
6871
|
-
const watch = (sessionId) => {
|
|
6872
|
-
if (watched.has(sessionId)) return;
|
|
6873
|
-
const binding = sessions.binding(sessionId);
|
|
6874
|
-
if (binding === void 0) return;
|
|
6875
|
-
const projections = binding.session.projections;
|
|
6876
|
-
if (projections?.faceOf === void 0 || projections.get === void 0) return;
|
|
6877
|
-
let applying = false;
|
|
6878
|
-
const onStats = () => {
|
|
6879
|
-
if (applying) return;
|
|
6880
|
-
const current = projections.get("sessionStats");
|
|
6881
|
-
if (current === published.get(sessionId)) return;
|
|
6882
|
-
hostStats.set(sessionId, current);
|
|
6883
|
-
applying = true;
|
|
6884
|
-
try {
|
|
6885
|
-
publish(sessionId);
|
|
6886
|
-
} finally {
|
|
6887
|
-
applying = false;
|
|
6888
|
-
}
|
|
6889
|
-
};
|
|
6890
|
-
const onEvents = () => {
|
|
6891
|
-
applying = true;
|
|
6892
|
-
try {
|
|
6893
|
-
publish(sessionId);
|
|
6894
|
-
} finally {
|
|
6895
|
-
applying = false;
|
|
6896
|
-
}
|
|
6897
|
-
};
|
|
6898
|
-
const unsubSource = binding.eventSource.subscribe(onEvents);
|
|
6899
|
-
const unsubStats = projections.faceOf("sessionStats").subscribe(onStats);
|
|
6900
|
-
const retention = sessions.retainInfo?.(sessionId);
|
|
6901
|
-
const unsubRetention = retention?.subscribe(() => {
|
|
6902
|
-
if (sessions.binding(sessionId) === void 0) {
|
|
6903
|
-
watched.get(sessionId)?.();
|
|
6904
|
-
watched.delete(sessionId);
|
|
6905
|
-
hostStats.delete(sessionId);
|
|
6906
|
-
published.delete(sessionId);
|
|
6907
|
-
}
|
|
6908
|
-
}) ?? (() => {
|
|
6909
|
-
});
|
|
6910
|
-
watched.set(sessionId, () => {
|
|
6911
|
-
unsubSource();
|
|
6912
|
-
unsubStats();
|
|
6913
|
-
unsubRetention();
|
|
6914
|
-
hostStats.delete(sessionId);
|
|
6915
|
-
published.delete(sessionId);
|
|
6916
|
-
});
|
|
6917
|
-
const initial = projections.get("sessionStats");
|
|
6918
|
-
if (isRecord2(initial)) hostStats.set(sessionId, initial);
|
|
6919
|
-
onEvents();
|
|
6920
|
-
};
|
|
6921
|
-
const syncList = () => {
|
|
6922
|
-
for (const id of sessions.list.getSnapshot().ids ?? []) watch(id);
|
|
6923
|
-
};
|
|
6924
|
-
const unsubList = sessions.list.subscribe(syncList);
|
|
6925
|
-
syncList();
|
|
7167
|
+
function installRollbackSessionStatsFilter(_ctx) {
|
|
6926
7168
|
return () => {
|
|
6927
|
-
unsubList();
|
|
6928
|
-
for (const dispose of watched.values()) dispose();
|
|
6929
|
-
watched.clear();
|
|
6930
|
-
hostStats.clear();
|
|
6931
|
-
published.clear();
|
|
6932
7169
|
};
|
|
6933
7170
|
}
|
|
6934
7171
|
|
|
@@ -7093,7 +7330,8 @@ function RollbackUserNode(props) {
|
|
|
7093
7330
|
const turn = turnOf2(props.node.location);
|
|
7094
7331
|
const isMarker = isRollbackMarkerMessage(data.source, messageId);
|
|
7095
7332
|
const rollbackTurn = turnFromRollbackMarkerId(messageId) ?? turn?.turn;
|
|
7096
|
-
const
|
|
7333
|
+
const snapshot = (0, import_react14.useSyncExternalStore)(props.rollback.subscribe, props.rollback.getSnapshot);
|
|
7334
|
+
const rollbackEnabled = snapshot.enabled;
|
|
7097
7335
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: css_module_default.userMessageRow, children: [
|
|
7098
7336
|
props.renderFactorySlot("conversation.chat.user.content", {
|
|
7099
7337
|
content: prepared,
|
|
@@ -7205,10 +7443,13 @@ function enhanceTitleRow2(row, options) {
|
|
|
7205
7443
|
}
|
|
7206
7444
|
function installSessionStatsCheckpointLink(options) {
|
|
7207
7445
|
const scan = () => {
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7446
|
+
try {
|
|
7447
|
+
const panel = findOpenSessionStatsPanel();
|
|
7448
|
+
if (panel === null) return;
|
|
7449
|
+
const title = findSessionStatsTitleRow(panel);
|
|
7450
|
+
if (title !== null) enhanceTitleRow2(title, options);
|
|
7451
|
+
} catch {
|
|
7452
|
+
}
|
|
7212
7453
|
};
|
|
7213
7454
|
const observer = new MutationObserver(scan);
|
|
7214
7455
|
observer.observe(document.body, {
|
|
@@ -7275,9 +7516,6 @@ function timelineGapLabel(gap, t) {
|
|
|
7275
7516
|
}
|
|
7276
7517
|
}
|
|
7277
7518
|
}
|
|
7278
|
-
function sortTimelineByConversation(turns) {
|
|
7279
|
-
return [...turns].sort((left, right) => left.atSeq - right.atSeq || left.turn - right.turn || left.createdAt - right.createdAt);
|
|
7280
|
-
}
|
|
7281
7519
|
function formatCheckpointTime(createdAt, locale) {
|
|
7282
7520
|
try {
|
|
7283
7521
|
return new Intl.DateTimeFormat(locale, {
|
|
@@ -7306,89 +7544,62 @@ function timelinePromptLabel(summary, t) {
|
|
|
7306
7544
|
|
|
7307
7545
|
// src/client/rollback/timeline-panel.tsx
|
|
7308
7546
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
7309
|
-
var emptyActivity = {
|
|
7310
|
-
turns: 0,
|
|
7311
|
-
steps: 0,
|
|
7312
|
-
checkpoints: 0,
|
|
7313
|
-
liveCheckpoints: 0
|
|
7314
|
-
};
|
|
7315
7547
|
function mergeChatActivity(activity, chat) {
|
|
7316
7548
|
if (chat === void 0) return activity;
|
|
7317
7549
|
if (activity.turns === chat.turns && activity.steps === chat.steps) return activity;
|
|
7318
7550
|
return { ...activity, turns: chat.turns, steps: chat.steps };
|
|
7319
7551
|
}
|
|
7552
|
+
function matchesQuery(summary, query) {
|
|
7553
|
+
const normalized = query.trim().toLowerCase();
|
|
7554
|
+
if (normalized.length === 0) return true;
|
|
7555
|
+
if (String(summary.turn).includes(normalized)) return true;
|
|
7556
|
+
if (summary.prompt.toLowerCase().includes(normalized)) return true;
|
|
7557
|
+
if (summary.promptPreview.toLowerCase().includes(normalized)) return true;
|
|
7558
|
+
return summary.files.some((file) => file.path.toLowerCase().includes(normalized));
|
|
7559
|
+
}
|
|
7320
7560
|
function CheckpointTimelinePanel(props) {
|
|
7321
7561
|
const [state, setState] = (0, import_react16.useState)({ status: "loading" });
|
|
7322
7562
|
const [expanded, setExpanded] = (0, import_react16.useState)(props.focusTurn ?? null);
|
|
7323
|
-
const [
|
|
7324
|
-
const [
|
|
7563
|
+
const [query, setQuery] = (0, import_react16.useState)("");
|
|
7564
|
+
const [busyTurn, setBusyTurn] = (0, import_react16.useState)(null);
|
|
7325
7565
|
const wasActive = (0, import_react16.useRef)(false);
|
|
7326
|
-
const
|
|
7566
|
+
const [chatActivity, setChatActivity] = (0, import_react16.useState)(
|
|
7567
|
+
() => props.readChatActivity?.() ?? void 0
|
|
7568
|
+
);
|
|
7569
|
+
const load = (0, import_react16.useCallback)((options = {}) => {
|
|
7327
7570
|
const summaries = props.remote.summaries;
|
|
7328
7571
|
if (summaries === void 0) {
|
|
7329
7572
|
setState({ status: "error" });
|
|
7330
|
-
return
|
|
7331
|
-
};
|
|
7573
|
+
return;
|
|
7332
7574
|
}
|
|
7575
|
+
if (!options.quiet) setState({ status: "loading" });
|
|
7333
7576
|
const controller = new AbortController();
|
|
7334
|
-
setState({ status: "loading" });
|
|
7335
7577
|
void summaries({ sessionId: props.sessionId }, controller.signal).then((result) => {
|
|
7336
|
-
if (controller.signal.aborted) return;
|
|
7337
|
-
if (result.sessionId !== props.sessionId) {
|
|
7338
|
-
setState({ status: "error" });
|
|
7339
|
-
return;
|
|
7340
|
-
}
|
|
7341
|
-
const turns = sortTimelineByConversation(result.turns);
|
|
7342
|
-
const activity2 = result.activity ?? {
|
|
7343
|
-
...emptyActivity,
|
|
7344
|
-
checkpoints: turns.length,
|
|
7345
|
-
liveCheckpoints: turns.filter((turn) => !turn.rolledBack).length
|
|
7346
|
-
};
|
|
7347
7578
|
setState({
|
|
7348
7579
|
status: "ready",
|
|
7349
|
-
turns,
|
|
7350
|
-
activity: mergeChatActivity(
|
|
7580
|
+
turns: result.turns,
|
|
7581
|
+
activity: mergeChatActivity(result.activity, props.readChatActivity?.())
|
|
7351
7582
|
});
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
}
|
|
7355
|
-
}).catch(() => {
|
|
7356
|
-
if (!controller.signal.aborted) setState({ status: "error" });
|
|
7583
|
+
}, () => {
|
|
7584
|
+
if (!options.quiet) setState({ status: "error" });
|
|
7357
7585
|
});
|
|
7358
7586
|
return () => {
|
|
7359
7587
|
controller.abort();
|
|
7360
7588
|
};
|
|
7361
|
-
}, [props.
|
|
7362
|
-
(0, import_react16.useEffect)(() =>
|
|
7589
|
+
}, [props.remote.summaries, props.sessionId, props.readChatActivity]);
|
|
7590
|
+
(0, import_react16.useEffect)(() => load(), [load]);
|
|
7363
7591
|
(0, import_react16.useEffect)(() => {
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
next = read();
|
|
7370
|
-
} catch {
|
|
7371
|
-
return;
|
|
7372
|
-
}
|
|
7373
|
-
setChatActivity((previous) => {
|
|
7374
|
-
if (previous?.turns === next?.turns && previous?.steps === next?.steps) return previous;
|
|
7375
|
-
return next;
|
|
7376
|
-
});
|
|
7377
|
-
};
|
|
7378
|
-
sync();
|
|
7379
|
-
try {
|
|
7380
|
-
return props.subscribeChatActivity?.(sync);
|
|
7381
|
-
} catch {
|
|
7382
|
-
return void 0;
|
|
7383
|
-
}
|
|
7384
|
-
}, [props.readChatActivity, props.subscribeChatActivity]);
|
|
7592
|
+
if (props.subscribeChatActivity === void 0) return;
|
|
7593
|
+
return props.subscribeChatActivity(() => {
|
|
7594
|
+
setChatActivity(props.readChatActivity?.());
|
|
7595
|
+
});
|
|
7596
|
+
}, [props.subscribeChatActivity, props.readChatActivity]);
|
|
7385
7597
|
(0, import_react16.useEffect)(() => {
|
|
7386
|
-
if (chatActivity === void 0) return;
|
|
7387
7598
|
setState((previous) => {
|
|
7388
7599
|
if (previous.status !== "ready") return previous;
|
|
7389
|
-
const
|
|
7390
|
-
if (
|
|
7391
|
-
return { ...previous, activity
|
|
7600
|
+
const activity = mergeChatActivity(previous.activity, chatActivity);
|
|
7601
|
+
if (activity === previous.activity) return previous;
|
|
7602
|
+
return { ...previous, activity };
|
|
7392
7603
|
});
|
|
7393
7604
|
}, [chatActivity]);
|
|
7394
7605
|
(0, import_react16.useEffect)(() => {
|
|
@@ -7397,18 +7608,24 @@ function CheckpointTimelinePanel(props) {
|
|
|
7397
7608
|
const active = props.rollback.getSnapshot().active;
|
|
7398
7609
|
if (active !== null) {
|
|
7399
7610
|
wasActive.current = true;
|
|
7400
|
-
if (active.status === "loading" || active.status === "ready" || active.status === "executing") {
|
|
7401
|
-
setOpeningTurn(active.turn);
|
|
7402
|
-
}
|
|
7403
7611
|
return;
|
|
7404
7612
|
}
|
|
7405
|
-
setOpeningTurn(null);
|
|
7406
7613
|
if (wasActive.current) {
|
|
7407
7614
|
wasActive.current = false;
|
|
7408
|
-
|
|
7615
|
+
load({ quiet: true });
|
|
7409
7616
|
}
|
|
7410
7617
|
});
|
|
7411
|
-
}, [props.rollback,
|
|
7618
|
+
}, [props.rollback, load]);
|
|
7619
|
+
const visible = (0, import_react16.useMemo)(() => {
|
|
7620
|
+
if (state.status !== "ready") return [];
|
|
7621
|
+
return state.turns.filter((turn) => matchesQuery(turn, query));
|
|
7622
|
+
}, [state, query]);
|
|
7623
|
+
const openRestore = (summary, operation) => {
|
|
7624
|
+
if (props.rollback === void 0) return;
|
|
7625
|
+
setBusyTurn(summary.turn);
|
|
7626
|
+
props.rollback.open(summary.turn, operation, { surface: "timeline", atSeq: summary.atSeq });
|
|
7627
|
+
setBusyTurn(null);
|
|
7628
|
+
};
|
|
7412
7629
|
if (state.status === "loading") {
|
|
7413
7630
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineStatus, role: "status", children: props.t("rollbackTimelineLoading") });
|
|
7414
7631
|
}
|
|
@@ -7416,29 +7633,36 @@ function CheckpointTimelinePanel(props) {
|
|
|
7416
7633
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: css_module_default.timelineStatus, children: [
|
|
7417
7634
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { role: "alert", children: props.t("rollbackTimelineFailed") }),
|
|
7418
7635
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", onClick: () => {
|
|
7419
|
-
|
|
7636
|
+
load();
|
|
7420
7637
|
}, children: props.t("rollbackRetry") })
|
|
7421
7638
|
] });
|
|
7422
7639
|
}
|
|
7423
7640
|
if (state.turns.length === 0) {
|
|
7424
7641
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineStatus, children: props.t("rollbackTimelineEmpty") });
|
|
7425
7642
|
}
|
|
7426
|
-
const
|
|
7643
|
+
const tipTurn = state.turns.find((turn) => turn.tip)?.turn;
|
|
7427
7644
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: css_module_default.timelinePanel, children: [
|
|
7428
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7645
|
+
tipTurn === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("header", { className: css_module_default.timelineToolbar, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineLeadNote, role: "note", children: props.t("rollbackTimelineLeadRestoredNote") }) }),
|
|
7646
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: css_module_default.timelineSearchRow, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7647
|
+
import_dsh_client_ui_primitives10.Input,
|
|
7648
|
+
{
|
|
7649
|
+
type: "search",
|
|
7650
|
+
value: query,
|
|
7651
|
+
className: css_module_default.timelineSearch,
|
|
7652
|
+
placeholder: props.t("rollbackTimelineSearchPlaceholder"),
|
|
7653
|
+
"aria-label": props.t("rollbackTimelineSearchLabel"),
|
|
7654
|
+
onChange: (event) => {
|
|
7655
|
+
setQuery(event.target.value);
|
|
7656
|
+
}
|
|
7657
|
+
}
|
|
7658
|
+
) }),
|
|
7659
|
+
visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineStatus, children: props.t("rollbackTimelineFilterEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ol", { className: css_module_default.timelineList, children: visible.map((summary) => {
|
|
7435
7660
|
const open = expanded === summary.turn;
|
|
7436
7661
|
const time = formatCheckpointTime(summary.createdAt, props.locale ?? "en");
|
|
7437
7662
|
const coverage = coverageAffordance(summary);
|
|
7438
7663
|
const prompt = timelinePromptLabel(summary, props.t);
|
|
7439
|
-
const
|
|
7440
|
-
const
|
|
7441
|
-
const primary = checkpointPrimaryAction(summary);
|
|
7664
|
+
const busy = busyTurn === summary.turn;
|
|
7665
|
+
const isTip = summary.tip;
|
|
7442
7666
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7443
7667
|
"li",
|
|
7444
7668
|
{
|
|
@@ -7446,63 +7670,69 @@ function CheckpointTimelinePanel(props) {
|
|
|
7446
7670
|
"data-coverage": coverage,
|
|
7447
7671
|
"data-expanded": open || void 0,
|
|
7448
7672
|
"data-rolled-back": summary.rolledBack || void 0,
|
|
7449
|
-
"data-tip":
|
|
7450
|
-
"data-action": primary,
|
|
7673
|
+
"data-tip": isTip || void 0,
|
|
7451
7674
|
children: [
|
|
7452
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
7464
|
-
|
|
7465
|
-
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: css_module_default.timelineMain, children: [
|
|
7676
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
7677
|
+
"button",
|
|
7678
|
+
{
|
|
7679
|
+
type: "button",
|
|
7680
|
+
className: css_module_default.timelineRow,
|
|
7681
|
+
"aria-expanded": open,
|
|
7682
|
+
onClick: () => {
|
|
7683
|
+
setExpanded(open ? null : summary.turn);
|
|
7684
|
+
},
|
|
7685
|
+
children: [
|
|
7686
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: css_module_default.timelineTurn, children: [
|
|
7687
|
+
props.t("rollbackTimelineTurn", { turn: summary.turn }),
|
|
7688
|
+
isTip ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineTipBadge, children: props.t("rollbackTimelineTip") }) : null,
|
|
7689
|
+
summary.rolledBack && !isTip ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineRolledBackBadge, children: props.t("rollbackTimelineRolledBack") }) : null
|
|
7690
|
+
] }),
|
|
7691
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7692
|
+
"span",
|
|
7693
|
+
{
|
|
7694
|
+
className: prompt.empty ? css_module_default.timelinePromptEmpty : css_module_default.timelinePromptPreview,
|
|
7695
|
+
children: prompt.text
|
|
7696
|
+
}
|
|
7697
|
+
),
|
|
7466
7698
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineTime, children: time })
|
|
7467
|
-
]
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
className: prompt.empty ? css_module_default.timelinePromptEmpty : css_module_default.timelinePromptPreview,
|
|
7472
|
-
children: prompt.text
|
|
7473
|
-
}
|
|
7474
|
-
)
|
|
7475
|
-
]
|
|
7476
|
-
}
|
|
7477
|
-
),
|
|
7478
|
-
!open ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: css_module_default.timelineDetail, children: [
|
|
7479
|
-
summary.promptPreview.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelinePromptEmpty, children: props.t("rollbackTimelineNoPrompt") }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelinePrompt, children: summary.promptPreview }),
|
|
7480
|
-
summary.files.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineFilesEmpty, children: props.t("rollbackNoFiles") }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: css_module_default.timelineFiles, children: summary.files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { "data-change": file.change, children: [
|
|
7481
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: file.path }),
|
|
7482
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineFileChange, "data-change": file.change, children: props.t(`rollbackFile_${file.change}`) })
|
|
7483
|
-
] }, file.path)) }),
|
|
7484
|
-
summary.gaps.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: css_module_default.timelineGaps, children: summary.gaps.map((gap) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { "data-gap": gap.type, children: timelineGapLabel(gap, props.t) }, `${gap.type}:${gap.reason}`)) }),
|
|
7485
|
-
covered ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineFilesEmpty, role: "status", children: props.t("rollbackTimelineCoveredHint") }) : null,
|
|
7486
|
-
opening ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineFilesEmpty, role: "status", children: props.t("rollbackTimelineOpening") }) : null,
|
|
7487
|
-
primary === "undo" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7699
|
+
]
|
|
7700
|
+
}
|
|
7701
|
+
),
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: css_module_default.timelineActions, children: isTip ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7488
7703
|
import_dsh_client_ui_primitives10.Button,
|
|
7489
7704
|
{
|
|
7490
7705
|
type: "button",
|
|
7491
|
-
disabled:
|
|
7706
|
+
disabled: busy || props.rollback === void 0,
|
|
7492
7707
|
onClick: () => {
|
|
7493
|
-
|
|
7494
|
-
props.onUndo(summary.turn);
|
|
7708
|
+
openRestore(summary, "undo");
|
|
7495
7709
|
},
|
|
7496
7710
|
children: props.t("rollbackUndoAction")
|
|
7497
7711
|
}
|
|
7498
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7712
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
7713
|
+
import_dsh_client_ui_primitives10.Button,
|
|
7714
|
+
{
|
|
7715
|
+
type: "button",
|
|
7716
|
+
disabled: busy || props.rollback === void 0,
|
|
7717
|
+
onClick: () => {
|
|
7718
|
+
openRestore(summary, "rollback");
|
|
7719
|
+
},
|
|
7720
|
+
children: props.t("rollbackAction")
|
|
7721
|
+
}
|
|
7722
|
+
) })
|
|
7723
|
+
] }),
|
|
7724
|
+
!open ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: css_module_default.timelineDetail, children: [
|
|
7725
|
+
summary.promptPreview.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelinePromptEmpty, children: props.t("rollbackTimelineNoPrompt") }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelinePrompt, children: summary.promptPreview }),
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: css_module_default.timelineDetailMeta, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineCoverage, "data-coverage": coverage, children: timelineCoverageLabel(summary, props.t) }) }),
|
|
7727
|
+
summary.files.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: css_module_default.timelineFiles, children: summary.files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { "data-change": file.change, children: [
|
|
7728
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: file.path }),
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: css_module_default.timelineFileChange, "data-change": file.change, children: props.t(`rollbackFile_${file.change}`) })
|
|
7730
|
+
] }, file.path)) }),
|
|
7731
|
+
summary.gaps.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: css_module_default.timelineGaps, children: summary.gaps.map((gap) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { "data-gap": gap.type, children: timelineGapLabel(gap, props.t) }, `${gap.type}:${gap.reason}`)) })
|
|
7502
7732
|
] })
|
|
7503
7733
|
]
|
|
7504
7734
|
},
|
|
7505
|
-
summary.turn
|
|
7735
|
+
`${summary.turn}:${summary.atSeq}`
|
|
7506
7736
|
);
|
|
7507
7737
|
}) })
|
|
7508
7738
|
] });
|
|
@@ -7546,6 +7776,12 @@ function paramsOf2(raw) {
|
|
|
7546
7776
|
...typeof record.turn === "number" ? { turn: record.turn } : {}
|
|
7547
7777
|
};
|
|
7548
7778
|
}
|
|
7779
|
+
function resolveTimelineSessionId(scopedSessionId, params) {
|
|
7780
|
+
if (typeof scopedSessionId === "string" && scopedSessionId !== "") {
|
|
7781
|
+
return scopedSessionId;
|
|
7782
|
+
}
|
|
7783
|
+
return params.sessionId;
|
|
7784
|
+
}
|
|
7549
7785
|
function CheckpointTimelineTabBody(props) {
|
|
7550
7786
|
const rollback = props.rollbackFor(props.sessionId);
|
|
7551
7787
|
const activityBridge = (0, import_react17.useMemo)(() => {
|
|
@@ -7567,13 +7803,7 @@ function CheckpointTimelineTabBody(props) {
|
|
|
7567
7803
|
rollback,
|
|
7568
7804
|
t: props.t,
|
|
7569
7805
|
locale: props.locale,
|
|
7570
|
-
...activityBridge
|
|
7571
|
-
onRestore: (turn) => {
|
|
7572
|
-
props.onRestore(props.sessionId, turn);
|
|
7573
|
-
},
|
|
7574
|
-
onUndo: (turn) => {
|
|
7575
|
-
props.onUndo(props.sessionId, turn);
|
|
7576
|
-
}
|
|
7806
|
+
...activityBridge
|
|
7577
7807
|
}
|
|
7578
7808
|
),
|
|
7579
7809
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -7591,14 +7821,18 @@ function CheckpointTimelineTabBody(props) {
|
|
|
7591
7821
|
function CheckpointTimelineTab(props) {
|
|
7592
7822
|
const info = props.useTabInfo();
|
|
7593
7823
|
const params = paramsOf2(info.tab.navigation.params);
|
|
7594
|
-
|
|
7824
|
+
const sessionId = resolveTimelineSessionId(
|
|
7825
|
+
typeof props.sessionId === "string" ? props.sessionId : void 0,
|
|
7826
|
+
params
|
|
7827
|
+
);
|
|
7828
|
+
if (sessionId === void 0) {
|
|
7595
7829
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: css_module_default.timelineRightPane, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: css_module_default.timelineStatus, children: props.t("rollbackTimelineNoSession") }) });
|
|
7596
7830
|
}
|
|
7597
7831
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7598
7832
|
CheckpointTimelineTabBody,
|
|
7599
7833
|
{
|
|
7600
7834
|
...props,
|
|
7601
|
-
sessionId
|
|
7835
|
+
sessionId,
|
|
7602
7836
|
focusTurn: params.turn
|
|
7603
7837
|
}
|
|
7604
7838
|
);
|
|
@@ -7609,6 +7843,9 @@ function CheckpointTimelineTabTitle(props) {
|
|
|
7609
7843
|
|
|
7610
7844
|
// src/client/index.ts
|
|
7611
7845
|
var inject = [
|
|
7846
|
+
// Do not hard-inject remote.settings: that delays this client fiber until the
|
|
7847
|
+
// settings controller is up and has been observed to slow Desktop account
|
|
7848
|
+
// paint. Persist probes settings softly at save time instead.
|
|
7612
7849
|
"remote",
|
|
7613
7850
|
"remote.session",
|
|
7614
7851
|
"remote.pluginInventory",
|
|
@@ -7685,9 +7922,18 @@ function apply(ctx) {
|
|
|
7685
7922
|
}));
|
|
7686
7923
|
return source === "account" ? all.account : all.apiKey;
|
|
7687
7924
|
};
|
|
7925
|
+
const persist = async (ops) => {
|
|
7926
|
+
await withSettingsRemote(ctx, (remote) => persistEnhancerSettings(
|
|
7927
|
+
remote,
|
|
7928
|
+
ops,
|
|
7929
|
+
() => form.getSnapshot().revision
|
|
7930
|
+
));
|
|
7931
|
+
form.acceptLocal(ops);
|
|
7932
|
+
};
|
|
7688
7933
|
const SettingsTab = (props) => (0, import_react18.createElement)(PluginSettings, {
|
|
7689
7934
|
form: props.form,
|
|
7690
7935
|
t: props.t,
|
|
7936
|
+
persist,
|
|
7691
7937
|
loadCatalog,
|
|
7692
7938
|
checkUpdate,
|
|
7693
7939
|
applyUpdate
|
|
@@ -7899,29 +8145,61 @@ function apply(ctx) {
|
|
|
7899
8145
|
const rollbackRemote = {
|
|
7900
8146
|
preview: (request, signal) => checkpointRollbackRemote.preview(mountedCtx.remote, request, signal),
|
|
7901
8147
|
execute: (request, signal) => checkpointRollbackRemote.execute(mountedCtx.remote, request, signal),
|
|
7902
|
-
summaries: (request, signal) => checkpointRollbackRemote.summaries(mountedCtx.remote, request, signal)
|
|
8148
|
+
summaries: (request, signal) => checkpointRollbackRemote.summaries(mountedCtx.remote, request, signal),
|
|
8149
|
+
getCut: (request, signal) => checkpointRollbackRemote.getCut(mountedCtx.remote, request, signal)
|
|
7903
8150
|
};
|
|
7904
8151
|
const rollbackSessions = /* @__PURE__ */ new Map();
|
|
7905
8152
|
const rollbackRetentions = /* @__PURE__ */ new Map();
|
|
7906
8153
|
const undoTips = new RollbackUndoTipStore();
|
|
8154
|
+
const cutCache = new SessionCutCache();
|
|
8155
|
+
const refreshCut = async (sessionId) => {
|
|
8156
|
+
const getCut = rollbackRemote.getCut;
|
|
8157
|
+
if (getCut === void 0) return;
|
|
8158
|
+
try {
|
|
8159
|
+
const result = await getCut({ sessionId }, new AbortController().signal);
|
|
8160
|
+
cutCache.set(sessionId, result.cut === null ? null : {
|
|
8161
|
+
hideTurnsFrom: result.cut.hideTurnsFrom,
|
|
8162
|
+
cutSeq: result.cut.cutSeq,
|
|
8163
|
+
restoredAtSeq: result.cut.restoredAtSeq
|
|
8164
|
+
});
|
|
8165
|
+
} catch {
|
|
8166
|
+
}
|
|
8167
|
+
};
|
|
7907
8168
|
const tEnhancer = mountedCtx.locale.bind("agent-enhancer");
|
|
7908
8169
|
const tChat = mountedCtx.locale.bind("chat");
|
|
7909
8170
|
const rollbackEnabled = () => resolveSettings(form.getSnapshot().value).rollbackEnabled;
|
|
7910
8171
|
const rollbackFor = (sessionId) => {
|
|
7911
8172
|
let rollback = rollbackSessions.get(sessionId);
|
|
7912
8173
|
if (rollback === void 0) {
|
|
8174
|
+
const remote = {
|
|
8175
|
+
...rollbackRemote,
|
|
8176
|
+
async execute(request, signal) {
|
|
8177
|
+
const result = await rollbackRemote.execute(request, signal);
|
|
8178
|
+
await refreshCut(sessionId);
|
|
8179
|
+
return result;
|
|
8180
|
+
},
|
|
8181
|
+
async summaries(request, signal) {
|
|
8182
|
+
const summaries = rollbackRemote.summaries;
|
|
8183
|
+
if (summaries === void 0) throw new Error("summaries unavailable");
|
|
8184
|
+
const result = await summaries(request, signal);
|
|
8185
|
+
void refreshCut(sessionId);
|
|
8186
|
+
return result;
|
|
8187
|
+
}
|
|
8188
|
+
};
|
|
7913
8189
|
rollback = new RollbackController({
|
|
7914
8190
|
sessionId,
|
|
7915
8191
|
enabled: rollbackEnabled,
|
|
7916
|
-
remote
|
|
8192
|
+
remote
|
|
7917
8193
|
});
|
|
7918
8194
|
rollbackSessions.set(sessionId, rollback);
|
|
8195
|
+
void refreshCut(sessionId);
|
|
7919
8196
|
const sessions = mountedCtx.get("sessions");
|
|
7920
8197
|
if (sessions !== void 0) {
|
|
7921
8198
|
const retention = sessions.retainInfo(sessionId);
|
|
7922
8199
|
rollbackRetentions.set(sessionId, retention.subscribe(() => {
|
|
7923
8200
|
if ((retention.getSnapshot().retainedBy.mainView ?? 0) === 0) {
|
|
7924
8201
|
rollbackSessions.get(sessionId)?.close();
|
|
8202
|
+
cutCache.clear(sessionId);
|
|
7925
8203
|
}
|
|
7926
8204
|
}));
|
|
7927
8205
|
}
|
|
@@ -7931,16 +8209,6 @@ function apply(ctx) {
|
|
|
7931
8209
|
const openTimeline = (sessionId, turn) => {
|
|
7932
8210
|
openCheckpointTimelineTab(mountedCtx.sidebarRight, turn === void 0 ? { sessionId } : { sessionId, turn });
|
|
7933
8211
|
};
|
|
7934
|
-
const restoreFromTimeline = (sessionId, turn) => {
|
|
7935
|
-
queueMicrotask(() => {
|
|
7936
|
-
rollbackFor(sessionId).open(turn, "rollback", { surface: "timeline" });
|
|
7937
|
-
});
|
|
7938
|
-
};
|
|
7939
|
-
const undoFromTimeline = (sessionId, turn) => {
|
|
7940
|
-
queueMicrotask(() => {
|
|
7941
|
-
rollbackFor(sessionId).open(turn, "undo", { surface: "timeline" });
|
|
7942
|
-
});
|
|
7943
|
-
};
|
|
7944
8212
|
const TimelineTab = (props) => (0, import_react18.createElement)(
|
|
7945
8213
|
CheckpointTimelineTab,
|
|
7946
8214
|
{
|
|
@@ -7949,9 +8217,7 @@ function apply(ctx) {
|
|
|
7949
8217
|
remote: rollbackRemote,
|
|
7950
8218
|
sessions: mountedCtx.get("sessions"),
|
|
7951
8219
|
rollbackFor,
|
|
7952
|
-
locale: resolveUiLocale(mountedCtx.locale.getLocale().active) === "zh" ? "zh-CN" : "en"
|
|
7953
|
-
onRestore: restoreFromTimeline,
|
|
7954
|
-
onUndo: undoFromTimeline
|
|
8220
|
+
locale: resolveUiLocale(mountedCtx.locale.getLocale().active) === "zh" ? "zh-CN" : "en"
|
|
7955
8221
|
}
|
|
7956
8222
|
);
|
|
7957
8223
|
const TimelineTitle = (props) => (0, import_react18.createElement)(
|
|
@@ -8044,7 +8310,7 @@ function apply(ctx) {
|
|
|
8044
8310
|
order: 55,
|
|
8045
8311
|
locale: "agent-enhancer"
|
|
8046
8312
|
}, StatsCheckpointDock)));
|
|
8047
|
-
disposers.push(installRollbackTranscriptFilter(mountedCtx, undoTips));
|
|
8313
|
+
disposers.push(installRollbackTranscriptFilter(mountedCtx, undoTips, cutCache));
|
|
8048
8314
|
disposers.push(installRollbackTurnOutlineFilter(mountedCtx));
|
|
8049
8315
|
disposers.push(installRollbackSessionStatsFilter(mountedCtx));
|
|
8050
8316
|
disposers.push(installRollbackUndoCommand({
|