dsh-ws-recency 0.23.1 → 0.23.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.md +8 -3
- package/client.js +696 -638
- package/index.js +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -139,57 +139,57 @@
|
|
|
139
139
|
".wsr-trash-row{display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
140
140
|
".wsr-footer-action{display:flex;box-sizing:border-box;flex:none;align-items:center;justify-content:flex-start;gap:8px;width:calc(100% + 4px);min-width:0;height:42px;margin:4px -2px;padding:0 10px 0 8px;border:0;border-radius:12px;background:transparent;color:var(--dsw-alias-label-primary);font-family:inherit;font-size:14px;line-height:22px;text-align:left;cursor:pointer}",
|
|
141
141
|
".wsr-footer-action:hover{background:var(--dsw-alias-interactive-bg-hover)}",
|
|
142
|
-
".wsr-page{display:flex;flex-direction:column;gap:10px;padding:16px 18px;min-width:0;box-sizing:border-box;height:100%;overflow:auto}",
|
|
143
|
-
".wsr-handoff-option{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:8px;cursor:pointer}",
|
|
144
|
-
".wsr-handoff-option:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))}",
|
|
145
|
-
".wsr-handoff-option input{margin-top:2px}",
|
|
146
|
-
".wsr-handoff-option-text{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
147
|
-
".wsr-handoff-option-title{font-size:13px;color:var(--dsw-alias-label-primary)}",
|
|
148
|
-
".wsr-handoff-option-desc{font-size:11px;color:var(--dsw-alias-label-tertiary)}",
|
|
149
|
-
".wsr-handoff-extra{width:100%;box-sizing:border-box;min-height:56px;max-height:140px;resize:vertical;font:inherit;font-size:12px;line-height:1.6;padding:8px 10px;border-radius:8px;border:.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.16));background:var(--dsw-alias-bg-layer-1,#1b1b1b);color:var(--dsw-alias-label-primary,#e6e6e6)}",
|
|
150
|
-
".wsr-handoff-body{white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;max-height:220px;overflow:auto;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-1,#1b1b1b)}",
|
|
151
|
-
".wsr-qcard{width:100%;max-width:var(--dsh-chat-content-width,100%);border-radius:var(--dsw-radius-xl,16px);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-2));box-shadow:var(--dsw-elevation-panel,0 8px 24px rgba(0,0,0,.35));color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;padding:0 0 10px;margin:8px 0;overflow:hidden}",
|
|
152
|
-
".wsr-qcard *{box-sizing:border-box}",
|
|
153
|
-
".wsr-qhead{display:flex;align-items:flex-start;gap:8px;padding:14px 16px 8px}",
|
|
154
|
-
".wsr-qheading{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}",
|
|
155
|
-
".wsr-qeyebrow{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.04em}",
|
|
156
|
-
".wsr-qtitle{font-size:15px;font-weight:500;line-height:22px;color:var(--dsw-alias-label-primary)}",
|
|
157
|
-
".wsr-qdetail{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary)}",
|
|
158
|
-
".wsr-qicon{flex:none;border:none;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;cursor:pointer;padding:2px 6px;border-radius:6px}",
|
|
159
|
-
".wsr-qicon:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
|
|
160
|
-
".wsr-qoptions{display:flex;flex-direction:column;gap:1px;margin:8px 0 0;padding:4px 12px}",
|
|
161
|
-
".wsr-qoption{display:flex;align-items:flex-start;gap:8px;width:100%;min-height:40px;padding:8px 12px 8px 8px;border:1px solid transparent;border-radius:var(--dsw-radius-md,8px);background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit;transition:background-color .12s,border-color .12s}",
|
|
162
|
-
".wsr-qoption:hover,.wsr-qoption-selected{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}",
|
|
163
|
-
".wsr-qoption-selected{border-color:var(--dsw-alias-border-l2,rgba(255,255,255,.16))}",
|
|
164
|
-
".wsr-qnum{flex:none;width:18px;font-size:12px;line-height:20px;color:var(--dsw-alias-label-tertiary);text-align:center}",
|
|
165
|
-
".wsr-qtext{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
166
|
-
".wsr-qextra{padding:4px 16px 0}",
|
|
167
|
-
".wsr-qpreview{margin:8px 16px 0;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-1,rgba(0,0,0,.24));white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;max-height:220px;overflow:auto}",
|
|
168
|
-
".wsr-qfooter{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:8px 16px 0}",
|
|
169
|
-
".wsr-qactions{display:flex;align-items:center;gap:8px}",
|
|
170
|
-
".wsr-qcancel{border:none;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;cursor:pointer;padding:4px 8px;border-radius:6px}",
|
|
171
|
-
".wsr-qcancel:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}",
|
|
172
|
-
".wsr-qsubmit{border:none;border-radius:8px;background:var(--dsw-alias-brand-primary,#4f7cff);color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;padding:6px 14px}",
|
|
173
|
-
".wsr-qsubmit:hover{filter:brightness(1.06)}",
|
|
174
|
-
".wsr-handoff-live{margin:8px 0;font-size:12px;color:var(--dsw-alias-label-tertiary)}",
|
|
175
|
-
".wsr-msg-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}",
|
|
176
|
-
".wsr-msg-btn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
|
|
177
|
-
".wsr-handoff-status{font-size:12px;color:var(--dsw-alias-label-tertiary);line-height:1.6}",
|
|
142
|
+
".wsr-page{display:flex;flex-direction:column;gap:10px;padding:16px 18px;min-width:0;box-sizing:border-box;height:100%;overflow:auto}",
|
|
143
|
+
".wsr-handoff-option{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:8px;cursor:pointer}",
|
|
144
|
+
".wsr-handoff-option:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))}",
|
|
145
|
+
".wsr-handoff-option input{margin-top:2px}",
|
|
146
|
+
".wsr-handoff-option-text{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
147
|
+
".wsr-handoff-option-title{font-size:13px;color:var(--dsw-alias-label-primary)}",
|
|
148
|
+
".wsr-handoff-option-desc{font-size:11px;color:var(--dsw-alias-label-tertiary)}",
|
|
149
|
+
".wsr-handoff-extra{width:100%;box-sizing:border-box;min-height:56px;max-height:140px;resize:vertical;font:inherit;font-size:12px;line-height:1.6;padding:8px 10px;border-radius:8px;border:.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.16));background:var(--dsw-alias-bg-layer-1,#1b1b1b);color:var(--dsw-alias-label-primary,#e6e6e6)}",
|
|
150
|
+
".wsr-handoff-body{white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;max-height:220px;overflow:auto;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-1,#1b1b1b)}",
|
|
151
|
+
".wsr-qcard{width:100%;max-width:var(--dsh-chat-content-width,100%);border-radius:var(--dsw-radius-xl,16px);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-2));box-shadow:var(--dsw-elevation-panel,0 8px 24px rgba(0,0,0,.35));color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;padding:0 0 10px;margin:8px 0;overflow:hidden}",
|
|
152
|
+
".wsr-qcard *{box-sizing:border-box}",
|
|
153
|
+
".wsr-qhead{display:flex;align-items:flex-start;gap:8px;padding:14px 16px 8px}",
|
|
154
|
+
".wsr-qheading{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}",
|
|
155
|
+
".wsr-qeyebrow{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.04em}",
|
|
156
|
+
".wsr-qtitle{font-size:15px;font-weight:500;line-height:22px;color:var(--dsw-alias-label-primary)}",
|
|
157
|
+
".wsr-qdetail{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary)}",
|
|
158
|
+
".wsr-qicon{flex:none;border:none;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;cursor:pointer;padding:2px 6px;border-radius:6px}",
|
|
159
|
+
".wsr-qicon:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
|
|
160
|
+
".wsr-qoptions{display:flex;flex-direction:column;gap:1px;margin:8px 0 0;padding:4px 12px}",
|
|
161
|
+
".wsr-qoption{display:flex;align-items:flex-start;gap:8px;width:100%;min-height:40px;padding:8px 12px 8px 8px;border:1px solid transparent;border-radius:var(--dsw-radius-md,8px);background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit;transition:background-color .12s,border-color .12s}",
|
|
162
|
+
".wsr-qoption:hover,.wsr-qoption-selected{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}",
|
|
163
|
+
".wsr-qoption-selected{border-color:var(--dsw-alias-border-l2,rgba(255,255,255,.16))}",
|
|
164
|
+
".wsr-qnum{flex:none;width:18px;font-size:12px;line-height:20px;color:var(--dsw-alias-label-tertiary);text-align:center}",
|
|
165
|
+
".wsr-qtext{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
166
|
+
".wsr-qextra{padding:4px 16px 0}",
|
|
167
|
+
".wsr-qpreview{margin:8px 16px 0;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-1,rgba(0,0,0,.24));white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;max-height:220px;overflow:auto}",
|
|
168
|
+
".wsr-qfooter{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:8px 16px 0}",
|
|
169
|
+
".wsr-qactions{display:flex;align-items:center;gap:8px}",
|
|
170
|
+
".wsr-qcancel{border:none;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;cursor:pointer;padding:4px 8px;border-radius:6px}",
|
|
171
|
+
".wsr-qcancel:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}",
|
|
172
|
+
".wsr-qsubmit{border:none;border-radius:8px;background:var(--dsw-alias-brand-primary,#4f7cff);color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;padding:6px 14px}",
|
|
173
|
+
".wsr-qsubmit:hover{filter:brightness(1.06)}",
|
|
174
|
+
".wsr-handoff-live{margin:8px 0;font-size:12px;color:var(--dsw-alias-label-tertiary)}",
|
|
175
|
+
".wsr-msg-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}",
|
|
176
|
+
".wsr-msg-btn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
|
|
177
|
+
".wsr-handoff-status{font-size:12px;color:var(--dsw-alias-label-tertiary);line-height:1.6}",
|
|
178
178
|
".wsr-handoff-text{width:100%;box-sizing:border-box;min-height:220px;max-height:46vh;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;padding:10px;border-radius:8px;border:.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.16));background:var(--dsw-alias-bg-layer-1,#1b1b1b);color:var(--dsw-alias-label-primary,#e6e6e6)}",
|
|
179
179
|
".wsr-page-head{display:flex;align-items:center;gap:8px}",
|
|
180
180
|
".wsr-page-heading{flex:1;font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}",
|
|
181
181
|
".wsr-page-list{display:flex;flex-direction:column;gap:6px}",
|
|
182
|
-
".wsr-page-row{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
183
|
-
".wsr-card{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.08));border-radius:10px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
184
|
-
".wsr-card-head{display:flex;align-items:center;gap:10px;min-width:0}",
|
|
185
|
-
".wsr-card-badge{flex:none;font-size:11px;line-height:18px;padding:0 8px;border-radius:9px;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08));color:var(--dsw-alias-label-secondary)}",
|
|
186
|
-
".wsr-card-badge-danger{color:var(--dsw-alias-state-error-primary,#d9534f);background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#d9534f) 14%,transparent)}",
|
|
187
|
-
".wsr-card-badge-muted{color:var(--dsw-alias-label-tertiary)}",
|
|
188
|
-
".wsr-card-title{flex:1;min-width:0;font-size:13px;font-weight:500;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
189
|
-
".wsr-card-title-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-tertiary)}",
|
|
190
|
-
".wsr-card-actions{flex:none;display:flex;gap:6px;align-items:center;white-space:nowrap}",
|
|
191
|
-
".wsr-chips{display:flex;flex-wrap:wrap;gap:6px}",
|
|
192
|
-
".wsr-chip{font-size:11px;line-height:18px;padding:0 7px;border-radius:9px;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.06));color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}",
|
|
182
|
+
".wsr-page-row{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
183
|
+
".wsr-card{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.08));border-radius:10px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
|
|
184
|
+
".wsr-card-head{display:flex;align-items:center;gap:10px;min-width:0}",
|
|
185
|
+
".wsr-card-badge{flex:none;font-size:11px;line-height:18px;padding:0 8px;border-radius:9px;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08));color:var(--dsw-alias-label-secondary)}",
|
|
186
|
+
".wsr-card-badge-danger{color:var(--dsw-alias-state-error-primary,#d9534f);background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#d9534f) 14%,transparent)}",
|
|
187
|
+
".wsr-card-badge-muted{color:var(--dsw-alias-label-tertiary)}",
|
|
188
|
+
".wsr-card-title{flex:1;min-width:0;font-size:13px;font-weight:500;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
189
|
+
".wsr-card-title-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-tertiary)}",
|
|
190
|
+
".wsr-card-actions{flex:none;display:flex;gap:6px;align-items:center;white-space:nowrap}",
|
|
191
|
+
".wsr-chips{display:flex;flex-wrap:wrap;gap:6px}",
|
|
192
|
+
".wsr-chip{font-size:11px;line-height:18px;padding:0 7px;border-radius:9px;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.06));color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}",
|
|
193
193
|
".wsr-card-path{font-size:11px;color:var(--dsw-alias-label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
194
194
|
".wsr-page-text{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}",
|
|
195
195
|
".wsr-page-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
@@ -295,33 +295,33 @@
|
|
|
295
295
|
"stats.agentDetail": "主 agent 构成:思考 {reasoning} · 回复 {text} · 用户消息 {user} · 系统提示 {system}",
|
|
296
296
|
"stats.diagnose.unmounted": "\n\n(宿主半已加载,但统计路由没挂上——重启应用再试)",
|
|
297
297
|
"stats.diagnose.noHost": "\n\n(宿主半未加载:需要重启应用加载新版本)",
|
|
298
|
-
"menu.move": "移动到工作区…",
|
|
299
|
-
"menu.handoff": "交接到新会话",
|
|
300
|
-
"handoff.title": "会话交接",
|
|
301
|
-
"handoff.note": "交接指令已经放进输入框(或点「复制指令」自己粘),发送后我在这里等 AI 写出交接块;抓到以后可以直接开到新会话。",
|
|
302
|
-
"handoff.instruction": "我要把这个会话交接给一个新会话继续推进。请按下面的要求输出一份交接说明,写进一个 ```handoff 代码块里,我会原样交给新会话:\n\n1. 只给文档路径和一句话说明「读它为什么」,不要粘贴文档内容;\n2. 文档按重要性排序,标注哪些必读、哪些按需;\n3. 包含:目标、当前进度、尚未完成与下一步、关键决策与约束、踩过的坑、验证方式;\n4. 交接正文控制在 400 字以内(文档引用除外)。",
|
|
303
|
-
"handoff.inserted": "交接指令已放进输入框,按回车发送;我会自动抓取回复。",
|
|
304
|
-
"handoff.copyHint": "没能直接写入输入框,请点「复制指令」再粘贴到输入框发送。",
|
|
305
|
-
"handoff.copy": "复制指令",
|
|
306
|
-
"handoff.waiting": "等待 AI 写出交接块…({n} 秒)",
|
|
307
|
-
"handoff.found": "已抓到交接块,确认后会在当前工作区开一个新会话并把它带过去。",
|
|
308
|
-
"handoff.confirm": "确认交接,开新会话",
|
|
309
|
-
"handoff.more": "继续补充",
|
|
310
|
-
"handoff.noService": "没能自动开新会话,交接内容已复制到剪贴板,手动新建会话粘贴即可。",
|
|
311
|
-
"handoff.preamble": "以下是一个会话交接说明,来自上一个会话。请先按「文档引用」逐份阅读文档,再结合要点接续工作;已经完成的部分不要重做。",
|
|
298
|
+
"menu.move": "移动到工作区…",
|
|
299
|
+
"menu.handoff": "交接到新会话",
|
|
300
|
+
"handoff.title": "会话交接",
|
|
301
|
+
"handoff.note": "交接指令已经放进输入框(或点「复制指令」自己粘),发送后我在这里等 AI 写出交接块;抓到以后可以直接开到新会话。",
|
|
302
|
+
"handoff.instruction": "我要把这个会话交接给一个新会话继续推进。请按下面的要求输出一份交接说明,写进一个 ```handoff 代码块里,我会原样交给新会话:\n\n1. 只给文档路径和一句话说明「读它为什么」,不要粘贴文档内容;\n2. 文档按重要性排序,标注哪些必读、哪些按需;\n3. 包含:目标、当前进度、尚未完成与下一步、关键决策与约束、踩过的坑、验证方式;\n4. 交接正文控制在 400 字以内(文档引用除外)。",
|
|
303
|
+
"handoff.inserted": "交接指令已放进输入框,按回车发送;我会自动抓取回复。",
|
|
304
|
+
"handoff.copyHint": "没能直接写入输入框,请点「复制指令」再粘贴到输入框发送。",
|
|
305
|
+
"handoff.copy": "复制指令",
|
|
306
|
+
"handoff.waiting": "等待 AI 写出交接块…({n} 秒)",
|
|
307
|
+
"handoff.found": "已抓到交接块,确认后会在当前工作区开一个新会话并把它带过去。",
|
|
308
|
+
"handoff.confirm": "确认交接,开新会话",
|
|
309
|
+
"handoff.more": "继续补充",
|
|
310
|
+
"handoff.noService": "没能自动开新会话,交接内容已复制到剪贴板,手动新建会话粘贴即可。",
|
|
311
|
+
"handoff.preamble": "以下是一个会话交接说明,来自上一个会话。请先按「文档引用」逐份阅读文档,再结合要点接续工作;已经完成的部分不要重做。",
|
|
312
312
|
"handoff.footnote": "交接内容会另存一份到 .wsr/handoff/,方便追溯。",
|
|
313
|
-
"handoff.preparing": "正在准备交接,等这一轮回复写完…",
|
|
314
|
-
"handoff.pressEnter": "指令已放进输入框,请按回车发送(自动发送没有生效)。",
|
|
315
|
-
"handoff.cancel": "放弃交接",
|
|
316
|
-
"handoff.confirmDesc": "带着这份内容在当前工作区开一个新会话",
|
|
317
|
-
"handoff.regen": "不满意,重新生成一版",
|
|
318
|
-
"handoff.regenDesc": "让当前会话按同样的要求再写一份",
|
|
319
|
-
"handoff.extraPlaceholder": "补充调整意见(填了就按这些要求重写,例如:多写接口约束、少写历史)",
|
|
320
|
-
"handoff.preview": "查看内容",
|
|
321
|
-
"handoff.submit": "提交",
|
|
322
|
-
"handoff.eyebrow": "需要你确认",
|
|
323
|
-
"handoff.regeneratePrompt": "这份交接说明需要重写。请按最初同样的要求再输出一份,同样写进 ```handoff 代码块,路径与要点保持精炼。",
|
|
324
|
-
"handoff.adjustPrompt": "请按下面的补充要求重写交接说明,保持 ```handoff 代码块格式:",
|
|
313
|
+
"handoff.preparing": "正在准备交接,等这一轮回复写完…",
|
|
314
|
+
"handoff.pressEnter": "指令已放进输入框,请按回车发送(自动发送没有生效)。",
|
|
315
|
+
"handoff.cancel": "放弃交接",
|
|
316
|
+
"handoff.confirmDesc": "带着这份内容在当前工作区开一个新会话",
|
|
317
|
+
"handoff.regen": "不满意,重新生成一版",
|
|
318
|
+
"handoff.regenDesc": "让当前会话按同样的要求再写一份",
|
|
319
|
+
"handoff.extraPlaceholder": "补充调整意见(填了就按这些要求重写,例如:多写接口约束、少写历史)",
|
|
320
|
+
"handoff.preview": "查看内容",
|
|
321
|
+
"handoff.submit": "提交",
|
|
322
|
+
"handoff.eyebrow": "需要你确认",
|
|
323
|
+
"handoff.regeneratePrompt": "这份交接说明需要重写。请按最初同样的要求再输出一份,同样写进 ```handoff 代码块,路径与要点保持精炼。",
|
|
324
|
+
"handoff.adjustPrompt": "请按下面的补充要求重写交接说明,保持 ```handoff 代码块格式:",
|
|
325
325
|
"move.title": "移动到工作区",
|
|
326
326
|
"move.warning": "只移动会话本身:它在旧工作区里创建或修改的文件不会跟着走,仍留在原目录。",
|
|
327
327
|
"move.note": "会话属于哪个工作区,由它创建时的目录决定;移动会改写会话记录的 cwd,把日志搬到新工作区目录,旧日志备份在 .trash/ws-recency。",
|
|
@@ -356,8 +356,8 @@
|
|
|
356
356
|
"trash.working": "处理中…",
|
|
357
357
|
"trash.failed": "操作失败:",
|
|
358
358
|
"trash.note": "回收站里的都是完整日志目录;恢复会按记录的 cwd 放回 sessions/<项目> 并重新挂到对应工作区。",
|
|
359
|
-
"trash.turns": "轮次",
|
|
360
|
-
"trash.steps": "步骤",
|
|
359
|
+
"trash.turns": "轮次",
|
|
360
|
+
"trash.steps": "步骤",
|
|
361
361
|
"trash.section.trash": "已删除的会话",
|
|
362
362
|
"trash.section.archived": "已归档的会话",
|
|
363
363
|
"archive.description": "归档是宿主的「视图选项 → 仅显示已归档」那一套:会话被隐藏,但日志仍在 sessions/ 里,原工作区的槽位也保留着。这里可以取消归档、移入回收站,或者彻底删除。",
|
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
"archive.forgotten": "已彻底删除。",
|
|
374
374
|
"archive.failed": "归档操作失败:",
|
|
375
375
|
"archive.noWorkspace": "(它原来的目录现在没有对应的工作区,需要先建一个同名工作区才能看到它)",
|
|
376
|
-
"archive.badge": "已归档",
|
|
376
|
+
"archive.badge": "已归档",
|
|
377
377
|
"archive.blank": "空白草稿",
|
|
378
378
|
"archive.workspace": "工作区",
|
|
379
379
|
"move.failed": "移动失败:",
|
|
@@ -427,33 +427,33 @@
|
|
|
427
427
|
"stats.agentDetail": "Agent composition: reasoning {reasoning} \u00b7 reply {text} \u00b7 user messages {user} \u00b7 system prompt {system}",
|
|
428
428
|
"stats.diagnose.unmounted": "\n\n(the host half is loaded but the statistics route did not mount - restart the app and retry)",
|
|
429
429
|
"stats.diagnose.noHost": "\n\n(the host half is not loaded: restart the app to pick up the new version)",
|
|
430
|
-
"menu.move": "Move to workspace\u2026",
|
|
431
|
-
"menu.handoff": "Hand off to a new session",
|
|
432
|
-
"handoff.title": "Session handoff",
|
|
433
|
-
"handoff.note": "The instruction is in the composer (or copy it yourself). Once you send it I watch for the handoff block and can carry it into a fresh Session.",
|
|
434
|
-
"handoff.instruction": "I am handing this session over to a new one. Please answer with a handoff note inside a ```handoff code block, which I will pass on verbatim:\n\n1. Reference documents by path with one line on why to read them; never paste document contents.\n2. Order them by importance and mark which are required and which are optional.\n3. Cover: goal, current progress, remaining work and next step, key decisions and constraints, pitfalls, and how to verify.\n4. Keep the note under 400 words (references excluded).",
|
|
435
|
-
"handoff.inserted": "Instruction placed in the composer; press Enter and I will pick up the reply.",
|
|
436
|
-
"handoff.copyHint": "Could not write into the composer; copy the instruction and paste it yourself.",
|
|
437
|
-
"handoff.copy": "Copy instruction",
|
|
438
|
-
"handoff.waiting": "Waiting for the handoff block… ({n}s)",
|
|
439
|
-
"handoff.found": "Handoff found. Confirming opens a new Session in this workspace with it carried over.",
|
|
440
|
-
"handoff.confirm": "Confirm and open new Session",
|
|
441
|
-
"handoff.more": "Keep refining",
|
|
442
|
-
"handoff.noService": "Could not open a Session automatically; the handoff was copied to the clipboard.",
|
|
443
|
-
"handoff.preamble": "Below is a handoff note from the previous Session. Read the referenced documents first, then continue from the notes; do not redo what is already done.",
|
|
430
|
+
"menu.move": "Move to workspace\u2026",
|
|
431
|
+
"menu.handoff": "Hand off to a new session",
|
|
432
|
+
"handoff.title": "Session handoff",
|
|
433
|
+
"handoff.note": "The instruction is in the composer (or copy it yourself). Once you send it I watch for the handoff block and can carry it into a fresh Session.",
|
|
434
|
+
"handoff.instruction": "I am handing this session over to a new one. Please answer with a handoff note inside a ```handoff code block, which I will pass on verbatim:\n\n1. Reference documents by path with one line on why to read them; never paste document contents.\n2. Order them by importance and mark which are required and which are optional.\n3. Cover: goal, current progress, remaining work and next step, key decisions and constraints, pitfalls, and how to verify.\n4. Keep the note under 400 words (references excluded).",
|
|
435
|
+
"handoff.inserted": "Instruction placed in the composer; press Enter and I will pick up the reply.",
|
|
436
|
+
"handoff.copyHint": "Could not write into the composer; copy the instruction and paste it yourself.",
|
|
437
|
+
"handoff.copy": "Copy instruction",
|
|
438
|
+
"handoff.waiting": "Waiting for the handoff block… ({n}s)",
|
|
439
|
+
"handoff.found": "Handoff found. Confirming opens a new Session in this workspace with it carried over.",
|
|
440
|
+
"handoff.confirm": "Confirm and open new Session",
|
|
441
|
+
"handoff.more": "Keep refining",
|
|
442
|
+
"handoff.noService": "Could not open a Session automatically; the handoff was copied to the clipboard.",
|
|
443
|
+
"handoff.preamble": "Below is a handoff note from the previous Session. Read the referenced documents first, then continue from the notes; do not redo what is already done.",
|
|
444
444
|
"handoff.footnote": "A copy is saved under .wsr/handoff/ for later reference.",
|
|
445
|
-
"handoff.preparing": "Preparing the handoff; waiting for this turn to finish…",
|
|
446
|
-
"handoff.pressEnter": "The instruction is in the composer; press Enter to send it (automatic send did not take).",
|
|
447
|
-
"handoff.cancel": "Cancel handoff",
|
|
448
|
-
"handoff.confirmDesc": "Open a new Session in this workspace with this note",
|
|
449
|
-
"handoff.regen": "Not good enough, regenerate",
|
|
450
|
-
"handoff.regenDesc": "Ask the current Session to write it again with the same rules",
|
|
451
|
-
"handoff.extraPlaceholder": "Adjustments (if filled, the note is rewritten with them: more constraints, less history, …)",
|
|
452
|
-
"handoff.preview": "Show note",
|
|
453
|
-
"handoff.submit": "Submit",
|
|
454
|
-
"handoff.eyebrow": "Needs your decision",
|
|
455
|
-
"handoff.regeneratePrompt": "Rewrite the handoff note with the same rules as before, again inside a ```handoff block.",
|
|
456
|
-
"handoff.adjustPrompt": "Rewrite the handoff note following these adjustments, keeping the ```handoff block format:",
|
|
445
|
+
"handoff.preparing": "Preparing the handoff; waiting for this turn to finish…",
|
|
446
|
+
"handoff.pressEnter": "The instruction is in the composer; press Enter to send it (automatic send did not take).",
|
|
447
|
+
"handoff.cancel": "Cancel handoff",
|
|
448
|
+
"handoff.confirmDesc": "Open a new Session in this workspace with this note",
|
|
449
|
+
"handoff.regen": "Not good enough, regenerate",
|
|
450
|
+
"handoff.regenDesc": "Ask the current Session to write it again with the same rules",
|
|
451
|
+
"handoff.extraPlaceholder": "Adjustments (if filled, the note is rewritten with them: more constraints, less history, …)",
|
|
452
|
+
"handoff.preview": "Show note",
|
|
453
|
+
"handoff.submit": "Submit",
|
|
454
|
+
"handoff.eyebrow": "Needs your decision",
|
|
455
|
+
"handoff.regeneratePrompt": "Rewrite the handoff note with the same rules as before, again inside a ```handoff block.",
|
|
456
|
+
"handoff.adjustPrompt": "Rewrite the handoff note following these adjustments, keeping the ```handoff block format:",
|
|
457
457
|
"move.title": "Move to workspace",
|
|
458
458
|
"move.warning": "Only the session moves: files it created or changed in the old workspace stay where they are.",
|
|
459
459
|
"move.note": "A session belongs to the workspace of the directory it was created in. Moving rewrites the stored cwd, relocates the log and keeps the old one as a backup in .trash/ws-recency.",
|
|
@@ -488,8 +488,8 @@
|
|
|
488
488
|
"trash.working": "Working\u2026",
|
|
489
489
|
"trash.failed": "Action failed: ",
|
|
490
490
|
"trash.note": "Every entry is a complete log directory; restoring puts it back under sessions/<project> using the recorded cwd and re-attaches it.",
|
|
491
|
-
"trash.turns": "turns",
|
|
492
|
-
"trash.steps": "steps",
|
|
491
|
+
"trash.turns": "turns",
|
|
492
|
+
"trash.steps": "steps",
|
|
493
493
|
"trash.section.trash": "Deleted sessions",
|
|
494
494
|
"trash.section.archived": "Archived sessions",
|
|
495
495
|
"archive.description": "Archiving is the Host's own view filter (\"Show archived only\"): the session is hidden, but its log stays under sessions/ and its workspace still holds its slot. Unarchive it here, move it into the trash, or delete it for good.",
|
|
@@ -846,12 +846,12 @@
|
|
|
846
846
|
var updated = updatedAtOf(row, sessions);
|
|
847
847
|
var stale = updated !== null && updated < cutoff;
|
|
848
848
|
var blank = isBlankRow(row, sessions);
|
|
849
|
-
/* "Needs follow-up" means "I still owe this one an answer": hiding it
|
|
850
|
-
behind a fold defeats the mark, so it is exempt like a running row. */
|
|
851
|
-
var marked = sessionIdOf(row);
|
|
852
|
-
var flagged = marked !== null && settings.followUps !== null
|
|
853
|
-
&& typeof settings.followUps === "object"
|
|
854
|
-
&& settings.followUps[marked] !== undefined;
|
|
849
|
+
/* "Needs follow-up" means "I still owe this one an answer": hiding it
|
|
850
|
+
behind a fold defeats the mark, so it is exempt like a running row. */
|
|
851
|
+
var marked = sessionIdOf(row);
|
|
852
|
+
var flagged = marked !== null && settings.followUps !== null
|
|
853
|
+
&& typeof settings.followUps === "object"
|
|
854
|
+
&& settings.followUps[marked] !== undefined;
|
|
855
855
|
var exempt = flagged || (settings.keepActive && (isActiveRow(row) || isSelectedRow(row)));
|
|
856
856
|
var hide = !expanded && stale && !exempt && !blank;
|
|
857
857
|
if (hide) {
|
|
@@ -1924,410 +1924,468 @@
|
|
|
1924
1924
|
}, t("menu.move"));
|
|
1925
1925
|
}
|
|
1926
1926
|
|
|
1927
|
-
/* ------------------------------ handoff ------------------------------ */
|
|
1928
|
-
|
|
1929
|
-
/* A plain observable, not a slot store: the turn card and the turn action are
|
|
1930
|
-
different slot instances, and a store handle would hand each its own copy. */
|
|
1931
|
-
var handoffState = { sessionId: "", phase: "idle", block: "", needsEnter: false };
|
|
1932
|
-
var handoffListeners = [];
|
|
1933
|
-
|
|
1934
|
-
function currentHandoffState() {
|
|
1935
|
-
return handoffState;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
function setHandoffState(patch) {
|
|
1939
|
-
handoffState = Object.assign({}, handoffState, patch);
|
|
1940
|
-
var listeners = handoffListeners.slice();
|
|
1941
|
-
for (var i = 0; i < listeners.length; i += 1) {
|
|
1942
|
-
try { listeners[i](handoffState); } catch (error) { /* a dead component */ }
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
function subscribeHandoff(listener) {
|
|
1947
|
-
handoffListeners.push(listener);
|
|
1948
|
-
return function () {
|
|
1949
|
-
var at = handoffListeners.indexOf(listener);
|
|
1950
|
-
if (at !== -1) handoffListeners.splice(at, 1);
|
|
1951
|
-
};
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
var handoffTimer = null;
|
|
1955
|
-
var handoffBaseline = 0;
|
|
1956
|
-
var handoffTries = 0;
|
|
1957
|
-
var handoffSession = null;
|
|
1958
|
-
|
|
1959
|
-
/** The instruction the user sends to the current Session. */
|
|
1960
|
-
function handoffInstruction() {
|
|
1961
|
-
return t("handoff.instruction");
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
function handoffPost(payload) {
|
|
1965
|
-
return fetch("/ws-recency/handoff", {
|
|
1966
|
-
method: "POST",
|
|
1967
|
-
headers: { "content-type": "application/json" },
|
|
1968
|
-
body: JSON.stringify(payload),
|
|
1969
|
-
}).then(function (response) {
|
|
1970
|
-
return response.json().catch(function () { return null; });
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
/** Enter is the only submit path the composer exposes to a plugin. */
|
|
1975
|
-
function pressEnter(editor) {
|
|
1976
|
-
try {
|
|
1977
|
-
var event = new window.KeyboardEvent("keydown", {
|
|
1978
|
-
key: "Enter",
|
|
1979
|
-
code: "Enter",
|
|
1980
|
-
keyCode: 13,
|
|
1981
|
-
which: 13,
|
|
1982
|
-
bubbles: true,
|
|
1983
|
-
cancelable: true,
|
|
1984
|
-
});
|
|
1985
|
-
editor.dispatchEvent(event);
|
|
1986
|
-
return true;
|
|
1987
|
-
} catch (error) {
|
|
1988
|
-
return false;
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
/** The composer of the open conversation, if it is on screen. */
|
|
1993
|
-
function composerEditor() {
|
|
1994
|
-
if (typeof document === "undefined") return null;
|
|
1995
|
-
var seat = typeof document.querySelector === "function" ? document.querySelector("[data-composer-seat]") : null;
|
|
1996
|
-
if (seat === null || seat === undefined) return null;
|
|
1997
|
-
var editor = null;
|
|
1998
|
-
try { editor = seat.querySelector('[contenteditable="true"]'); } catch (error) { editor = null; }
|
|
1999
|
-
if (editor === null || editor === undefined) {
|
|
2000
|
-
try { editor = seat.querySelector("textarea"); } catch (error) { editor = null; }
|
|
2001
|
-
}
|
|
2002
|
-
return editor === undefined ? null : editor;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
function editorText(editor) {
|
|
2006
|
-
if (editor === null || editor === undefined) return "";
|
|
2007
|
-
if (editor.tagName === "TEXTAREA" || editor.tagName === "INPUT") return typeof editor.value === "string" ? editor.value : "";
|
|
2008
|
-
return typeof editor.textContent === "string" ? editor.textContent : "";
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
/**
|
|
2012
|
-
* Send the handoff in the Session that was just opened.
|
|
2013
|
-
*
|
|
2014
|
-
* The draft initialises asynchronously: poll until the composer actually holds
|
|
2015
|
-
* the note, press Enter once, then stop. If it never shows up (slow render,
|
|
2016
|
-
* another draft kept) the text simply stays there for a manual Enter.
|
|
2017
|
-
*/
|
|
2018
|
-
function autoSendDraft(marker) {
|
|
2019
|
-
if (typeof window === "undefined") return;
|
|
2020
|
-
var tries = 0;
|
|
2021
|
-
function step() {
|
|
2022
|
-
tries += 1;
|
|
2023
|
-
var editor = composerEditor();
|
|
2024
|
-
if (editor !== null) {
|
|
2025
|
-
var text = editorText(editor);
|
|
2026
|
-
if (text.indexOf(marker) !== -1) {
|
|
2027
|
-
try { if (typeof editor.focus === "function") editor.focus(); } catch (error) { /* focus is best effort */ }
|
|
2028
|
-
pressEnter(editor);
|
|
2029
|
-
return;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
if (tries < 40) window.setTimeout(step, 350);
|
|
2033
|
-
}
|
|
2034
|
-
window.setTimeout(step, 400);
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
/** Put text into an editor without losing the framework's own input event. */
|
|
2038
|
-
function writeIntoEditor(editor, text) {
|
|
2039
|
-
try {
|
|
2040
|
-
if (typeof editor.focus === "function") editor.focus();
|
|
2041
|
-
if (editor.tagName === "TEXTAREA" || editor.tagName === "INPUT") {
|
|
2042
|
-
editor.value = text;
|
|
2043
|
-
editor.dispatchEvent(new window.Event("input", { bubbles: true }));
|
|
2044
|
-
return true;
|
|
2045
|
-
}
|
|
2046
|
-
var selection = typeof window.getSelection === "function" ? window.getSelection() : null;
|
|
2047
|
-
if (selection !== null && typeof document.createRange === "function") {
|
|
2048
|
-
var range = document.createRange();
|
|
2049
|
-
range.selectNodeContents(editor);
|
|
2050
|
-
range.collapse(false);
|
|
2051
|
-
selection.removeAllRanges();
|
|
2052
|
-
selection.addRange(range);
|
|
2053
|
-
}
|
|
2054
|
-
if (typeof document.execCommand === "function" && document.execCommand("insertText", false, text)) return true;
|
|
2055
|
-
editor.textContent = text;
|
|
2056
|
-
editor.dispatchEvent(new window.Event("input", { bubbles: true }));
|
|
2057
|
-
return true;
|
|
2058
|
-
} catch (error) {
|
|
2059
|
-
return false;
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
|
-
/**
|
|
2064
|
-
* Press Enter until the text actually leaves the composer.
|
|
2065
|
-
*
|
|
2066
|
-
* The editor commits an inserted text and a synthetic Enter in different
|
|
2067
|
-
* frames: pressing Enter in the same tick as the insert is swallowed, which
|
|
2068
|
-
* is why the instruction used to sit in the box until the user pressed it.
|
|
2069
|
-
* Wait a beat, then press again only while the text is still there.
|
|
2070
|
-
*/
|
|
2071
|
-
function armEnter(editor, attempt) {
|
|
2072
|
-
if (typeof window === "undefined") return;
|
|
2073
|
-
window.setTimeout(function () {
|
|
2074
|
-
if (composerEditor() !== editor) return;
|
|
2075
|
-
if (editorText(editor).trim() === "") return;
|
|
2076
|
-
pressEnter(editor);
|
|
2077
|
-
if (attempt < 2) armEnter(editor, attempt + 1);
|
|
2078
|
-
}, attempt === 0 ? 250 : 800);
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
/** Write text into the composer and send it, if the editor is reachable. */
|
|
2082
|
-
function sendToSession(text) {
|
|
2083
|
-
if (typeof document === "undefined" || typeof text !== "string" || text === "") return false;
|
|
2084
|
-
var editor = composerEditor();
|
|
2085
|
-
if (editor === null || editor === undefined) return false;
|
|
2086
|
-
if (!writeIntoEditor(editor, text)) return false;
|
|
2087
|
-
armEnter(editor, 0);
|
|
2088
|
-
return true;
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
|
-
function stopHandoffPolling() {
|
|
2092
|
-
if (handoffTimer !== null && typeof window.clearTimeout === "function") window.clearTimeout(handoffTimer);
|
|
2093
|
-
handoffTimer = null;
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
function resetHandoff() {
|
|
2097
|
-
stopHandoffPolling();
|
|
2098
|
-
handoffSession = null;
|
|
2099
|
-
handoffBaseline = 0;
|
|
2100
|
-
handoffTries = 0;
|
|
2101
|
-
setHandoffState({ sessionId: "", phase: "idle", block: "", needsEnter: false });
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
if (
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
var
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
),
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
1927
|
+
/* ------------------------------ handoff ------------------------------ */
|
|
1928
|
+
|
|
1929
|
+
/* A plain observable, not a slot store: the turn card and the turn action are
|
|
1930
|
+
different slot instances, and a store handle would hand each its own copy. */
|
|
1931
|
+
var handoffState = { sessionId: "", phase: "idle", block: "", needsEnter: false };
|
|
1932
|
+
var handoffListeners = [];
|
|
1933
|
+
|
|
1934
|
+
function currentHandoffState() {
|
|
1935
|
+
return handoffState;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
function setHandoffState(patch) {
|
|
1939
|
+
handoffState = Object.assign({}, handoffState, patch);
|
|
1940
|
+
var listeners = handoffListeners.slice();
|
|
1941
|
+
for (var i = 0; i < listeners.length; i += 1) {
|
|
1942
|
+
try { listeners[i](handoffState); } catch (error) { /* a dead component */ }
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
function subscribeHandoff(listener) {
|
|
1947
|
+
handoffListeners.push(listener);
|
|
1948
|
+
return function () {
|
|
1949
|
+
var at = handoffListeners.indexOf(listener);
|
|
1950
|
+
if (at !== -1) handoffListeners.splice(at, 1);
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
var handoffTimer = null;
|
|
1955
|
+
var handoffBaseline = 0;
|
|
1956
|
+
var handoffTries = 0;
|
|
1957
|
+
var handoffSession = null;
|
|
1958
|
+
|
|
1959
|
+
/** The instruction the user sends to the current Session. */
|
|
1960
|
+
function handoffInstruction() {
|
|
1961
|
+
return t("handoff.instruction");
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
function handoffPost(payload) {
|
|
1965
|
+
return fetch("/ws-recency/handoff", {
|
|
1966
|
+
method: "POST",
|
|
1967
|
+
headers: { "content-type": "application/json" },
|
|
1968
|
+
body: JSON.stringify(payload),
|
|
1969
|
+
}).then(function (response) {
|
|
1970
|
+
return response.json().catch(function () { return null; });
|
|
1971
|
+
});
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/** Enter is the only submit path the composer exposes to a plugin. */
|
|
1975
|
+
function pressEnter(editor) {
|
|
1976
|
+
try {
|
|
1977
|
+
var event = new window.KeyboardEvent("keydown", {
|
|
1978
|
+
key: "Enter",
|
|
1979
|
+
code: "Enter",
|
|
1980
|
+
keyCode: 13,
|
|
1981
|
+
which: 13,
|
|
1982
|
+
bubbles: true,
|
|
1983
|
+
cancelable: true,
|
|
1984
|
+
});
|
|
1985
|
+
editor.dispatchEvent(event);
|
|
1986
|
+
return true;
|
|
1987
|
+
} catch (error) {
|
|
1988
|
+
return false;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
/** The composer of the open conversation, if it is on screen. */
|
|
1993
|
+
function composerEditor() {
|
|
1994
|
+
if (typeof document === "undefined") return null;
|
|
1995
|
+
var seat = typeof document.querySelector === "function" ? document.querySelector("[data-composer-seat]") : null;
|
|
1996
|
+
if (seat === null || seat === undefined) return null;
|
|
1997
|
+
var editor = null;
|
|
1998
|
+
try { editor = seat.querySelector('[contenteditable="true"]'); } catch (error) { editor = null; }
|
|
1999
|
+
if (editor === null || editor === undefined) {
|
|
2000
|
+
try { editor = seat.querySelector("textarea"); } catch (error) { editor = null; }
|
|
2001
|
+
}
|
|
2002
|
+
return editor === undefined ? null : editor;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
function editorText(editor) {
|
|
2006
|
+
if (editor === null || editor === undefined) return "";
|
|
2007
|
+
if (editor.tagName === "TEXTAREA" || editor.tagName === "INPUT") return typeof editor.value === "string" ? editor.value : "";
|
|
2008
|
+
return typeof editor.textContent === "string" ? editor.textContent : "";
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* Send the handoff in the Session that was just opened.
|
|
2013
|
+
*
|
|
2014
|
+
* The draft initialises asynchronously: poll until the composer actually holds
|
|
2015
|
+
* the note, press Enter once, then stop. If it never shows up (slow render,
|
|
2016
|
+
* another draft kept) the text simply stays there for a manual Enter.
|
|
2017
|
+
*/
|
|
2018
|
+
function autoSendDraft(marker) {
|
|
2019
|
+
if (typeof window === "undefined") return;
|
|
2020
|
+
var tries = 0;
|
|
2021
|
+
function step() {
|
|
2022
|
+
tries += 1;
|
|
2023
|
+
var editor = composerEditor();
|
|
2024
|
+
if (editor !== null) {
|
|
2025
|
+
var text = editorText(editor);
|
|
2026
|
+
if (text.indexOf(marker) !== -1) {
|
|
2027
|
+
try { if (typeof editor.focus === "function") editor.focus(); } catch (error) { /* focus is best effort */ }
|
|
2028
|
+
pressEnter(editor);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
if (tries < 40) window.setTimeout(step, 350);
|
|
2033
|
+
}
|
|
2034
|
+
window.setTimeout(step, 400);
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/** Put text into an editor without losing the framework's own input event. */
|
|
2038
|
+
function writeIntoEditor(editor, text) {
|
|
2039
|
+
try {
|
|
2040
|
+
if (typeof editor.focus === "function") editor.focus();
|
|
2041
|
+
if (editor.tagName === "TEXTAREA" || editor.tagName === "INPUT") {
|
|
2042
|
+
editor.value = text;
|
|
2043
|
+
editor.dispatchEvent(new window.Event("input", { bubbles: true }));
|
|
2044
|
+
return true;
|
|
2045
|
+
}
|
|
2046
|
+
var selection = typeof window.getSelection === "function" ? window.getSelection() : null;
|
|
2047
|
+
if (selection !== null && typeof document.createRange === "function") {
|
|
2048
|
+
var range = document.createRange();
|
|
2049
|
+
range.selectNodeContents(editor);
|
|
2050
|
+
range.collapse(false);
|
|
2051
|
+
selection.removeAllRanges();
|
|
2052
|
+
selection.addRange(range);
|
|
2053
|
+
}
|
|
2054
|
+
if (typeof document.execCommand === "function" && document.execCommand("insertText", false, text)) return true;
|
|
2055
|
+
editor.textContent = text;
|
|
2056
|
+
editor.dispatchEvent(new window.Event("input", { bubbles: true }));
|
|
2057
|
+
return true;
|
|
2058
|
+
} catch (error) {
|
|
2059
|
+
return false;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* Press Enter until the text actually leaves the composer.
|
|
2065
|
+
*
|
|
2066
|
+
* The editor commits an inserted text and a synthetic Enter in different
|
|
2067
|
+
* frames: pressing Enter in the same tick as the insert is swallowed, which
|
|
2068
|
+
* is why the instruction used to sit in the box until the user pressed it.
|
|
2069
|
+
* Wait a beat, then press again only while the text is still there.
|
|
2070
|
+
*/
|
|
2071
|
+
function armEnter(editor, attempt) {
|
|
2072
|
+
if (typeof window === "undefined") return;
|
|
2073
|
+
window.setTimeout(function () {
|
|
2074
|
+
if (composerEditor() !== editor) return;
|
|
2075
|
+
if (editorText(editor).trim() === "") return;
|
|
2076
|
+
pressEnter(editor);
|
|
2077
|
+
if (attempt < 2) armEnter(editor, attempt + 1);
|
|
2078
|
+
}, attempt === 0 ? 250 : 800);
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
/** Write text into the composer and send it, if the editor is reachable. */
|
|
2082
|
+
function sendToSession(text) {
|
|
2083
|
+
if (typeof document === "undefined" || typeof text !== "string" || text === "") return false;
|
|
2084
|
+
var editor = composerEditor();
|
|
2085
|
+
if (editor === null || editor === undefined) return false;
|
|
2086
|
+
if (!writeIntoEditor(editor, text)) return false;
|
|
2087
|
+
armEnter(editor, 0);
|
|
2088
|
+
return true;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
function stopHandoffPolling() {
|
|
2092
|
+
if (handoffTimer !== null && typeof window.clearTimeout === "function") window.clearTimeout(handoffTimer);
|
|
2093
|
+
handoffTimer = null;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
function resetHandoff() {
|
|
2097
|
+
stopHandoffPolling();
|
|
2098
|
+
handoffSession = null;
|
|
2099
|
+
handoffBaseline = 0;
|
|
2100
|
+
handoffTries = 0;
|
|
2101
|
+
setHandoffState({ sessionId: "", phase: "idle", block: "", needsEnter: false });
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* Every fenced block in a reply, in order: `{ label, body }`.
|
|
2106
|
+
*
|
|
2107
|
+
* A fence stops only on a line that is nothing but backticks. The handoff
|
|
2108
|
+
* note names the fence it came in ("→ 抓到 ```handoff 块"), and matching the
|
|
2109
|
+
* first three backticks used to close the block right there: the note was
|
|
2110
|
+
* cut mid-sentence and that truncated text went into the new Session.
|
|
2111
|
+
*/
|
|
2112
|
+
function fencedBlocks(text) {
|
|
2113
|
+
var lines = String(text).split(/\r?\n/);
|
|
2114
|
+
var opens = /^ {0,3}(`{3,})[ \t]*([A-Za-z0-9_+-]*)[ \t]*$/;
|
|
2115
|
+
var closes = /^ {0,3}(`{3,})[ \t]*$/;
|
|
2116
|
+
var blocks = [];
|
|
2117
|
+
var at = -1;
|
|
2118
|
+
var label = "";
|
|
2119
|
+
for (var i = 0; i < lines.length; i += 1) {
|
|
2120
|
+
if (at !== -1) {
|
|
2121
|
+
if (closes.test(lines[i])) {
|
|
2122
|
+
blocks.push({ label: label, body: lines.slice(at + 1, i).join("\n").trim() });
|
|
2123
|
+
at = -1;
|
|
2124
|
+
label = "";
|
|
2125
|
+
}
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
var opened = opens.exec(lines[i]);
|
|
2129
|
+
if (opened === null) continue;
|
|
2130
|
+
at = i;
|
|
2131
|
+
label = opened[2].toLowerCase();
|
|
2132
|
+
}
|
|
2133
|
+
return blocks;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* Pull the fenced block out of an assistant reply.
|
|
2138
|
+
*
|
|
2139
|
+
* Fences only count at the start of a line, and only a closed pair counts at
|
|
2140
|
+
* all: a note often mentions a ```handoff block in prose (which cut the note
|
|
2141
|
+
* in half before), and a reply that is still streaming has no closing fence
|
|
2142
|
+
* yet (which would otherwise be captured half-written).
|
|
2143
|
+
*/
|
|
2144
|
+
function handoffBlockOf(text) {
|
|
2145
|
+
if (typeof text !== "string") return "";
|
|
2146
|
+
var tagged = /^[ \t]*```handoff[ \t]*$/m.exec(text);
|
|
2147
|
+
if (tagged !== null) {
|
|
2148
|
+
var from = tagged.index + tagged[0].length;
|
|
2149
|
+
var rest = text.slice(from);
|
|
2150
|
+
var close = /^[ \t]*```[ \t]*$/m.exec(rest);
|
|
2151
|
+
if (close === null) return "";
|
|
2152
|
+
return rest.slice(0, close.index).replace(/^\r?\n/, "").trim();
|
|
2153
|
+
}
|
|
2154
|
+
/* Older replies may use a plain fence: take the first one that reads like a
|
|
2155
|
+
document, skipping unrelated code samples above it. */
|
|
2156
|
+
var fence = /^[ \t]*```[ \t]*[a-zA-Z0-9_-]*[ \t]*$/gm;
|
|
2157
|
+
var opened;
|
|
2158
|
+
while ((opened = fence.exec(text)) !== null) {
|
|
2159
|
+
var bodyFrom = opened.index + opened[0].length;
|
|
2160
|
+
var tail = text.slice(bodyFrom);
|
|
2161
|
+
var ending = /^[ \t]*```[ \t]*$/m.exec(tail);
|
|
2162
|
+
if (ending === null) return "";
|
|
2163
|
+
var body = tail.slice(0, ending.index).replace(/^\r?\n/, "").trim();
|
|
2164
|
+
if (body.indexOf("#") !== -1) return body;
|
|
2165
|
+
fence.lastIndex = bodyFrom + ending.index + ending[0].length;
|
|
2166
|
+
}
|
|
2167
|
+
return "";
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
/** Start the watch: the next reply that carries a handoff block becomes the card. */
|
|
2171
|
+
function watchHandoff(sessionId) {
|
|
2172
|
+
handoffSession = sessionId;
|
|
2173
|
+
handoffTries = 0;
|
|
2174
|
+
stopHandoffPolling();
|
|
2175
|
+
if (typeof window === "undefined") return;
|
|
2176
|
+
function tick() {
|
|
2177
|
+
if (handoffSession !== sessionId) return;
|
|
2178
|
+
handoffTries += 1;
|
|
2179
|
+
handoffPost({ action: "tail", sessionId: sessionId }).then(function (answer) {
|
|
2180
|
+
if (handoffSession !== sessionId) return;
|
|
2181
|
+
if (answer !== null && answer.ok === true) {
|
|
2182
|
+
var replies = typeof answer.replies === "number" ? answer.replies : 0;
|
|
2183
|
+
if (replies > handoffBaseline) {
|
|
2184
|
+
var found = handoffBlockOf(answer.text);
|
|
2185
|
+
if (found !== "") {
|
|
2186
|
+
setHandoffState({ sessionId: sessionId, phase: "ready", block: found, needsEnter: false });
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
/* Keep looking at this same reply: it may still be streaming, and a
|
|
2190
|
+
reply without a block is not a reason to move past it. */
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
if (handoffTries > 150) {
|
|
2194
|
+
setHandoffState({ sessionId: "", phase: "idle", block: "", needsEnter: false });
|
|
2195
|
+
handoffSession = null;
|
|
2196
|
+
return;
|
|
2197
|
+
}
|
|
2198
|
+
handoffTimer = window.setTimeout(tick, 2000);
|
|
2199
|
+
}).catch(function () {
|
|
2200
|
+
handoffTimer = window.setTimeout(tick, 4000);
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
/* The baseline is the reply count before the instruction is answered. */
|
|
2204
|
+
handoffPost({ action: "tail", sessionId: sessionId }).then(function (answer) {
|
|
2205
|
+
if (handoffSession !== sessionId) return;
|
|
2206
|
+
handoffBaseline = answer !== null && answer.ok === true && typeof answer.replies === "number" ? answer.replies : 0;
|
|
2207
|
+
handoffTimer = window.setTimeout(tick, 1500);
|
|
2208
|
+
}).catch(function () {
|
|
2209
|
+
handoffTimer = window.setTimeout(tick, 3000);
|
|
2210
|
+
});
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
/** The turn action: send the instruction and wait for the block. */
|
|
2214
|
+
function startHandoff(sessionId) {
|
|
2215
|
+
if (typeof sessionId !== "string" || sessionId === "") return;
|
|
2216
|
+
var sent = sendToSession(handoffInstruction());
|
|
2217
|
+
setHandoffState({ sessionId: sessionId, phase: "running", block: "", needsEnter: sent !== true });
|
|
2218
|
+
watchHandoff(sessionId);
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
/** The card carries it over: open a fresh Session in the same workspace. */
|
|
2222
|
+
function carryHandoff(sessionId, block) {
|
|
2223
|
+
var text = typeof block === "string" ? block.trim() : "";
|
|
2224
|
+
if (text === "") return;
|
|
2225
|
+
handoffPost({ action: "save", sessionId: sessionId, text: text }).catch(function () { return null; }).then(function () {
|
|
2226
|
+
var owner = workspaceOfSession(sessionId);
|
|
2227
|
+
var workspaceId = owner === null ? undefined : owner.workspaceId;
|
|
2228
|
+
var service = data.service;
|
|
2229
|
+
var prompt = t("handoff.preamble") + "\n\n" + text;
|
|
2230
|
+
if (service !== null && service !== undefined && typeof service.startSession === "function") {
|
|
2231
|
+
try {
|
|
2232
|
+
service.startSession(workspaceId, { prompt: prompt, whenDraftExists: "replace" });
|
|
2233
|
+
resetHandoff();
|
|
2234
|
+
autoSendDraft(t("handoff.preamble").slice(0, 12));
|
|
2235
|
+
return;
|
|
2236
|
+
} catch (error) {
|
|
2237
|
+
/* fall through */
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
try {
|
|
2241
|
+
if (navigator !== undefined && navigator.clipboard !== undefined) navigator.clipboard.writeText(prompt);
|
|
2242
|
+
} catch (error) {
|
|
2243
|
+
/* clipboard unavailable */
|
|
2244
|
+
}
|
|
2245
|
+
resetHandoff();
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
/** Ask the current Session to rewrite the handoff with the user's adjustments. */
|
|
2250
|
+
function rewriteHandoff(sessionId, extra) {
|
|
2251
|
+
var text = extra.trim() === "" ? t("handoff.regeneratePrompt") : t("handoff.adjustPrompt") + "\n\n" + extra.trim();
|
|
2252
|
+
var sent = sendToSession(text);
|
|
2253
|
+
setHandoffState({ sessionId: sessionId, phase: "running", block: "", needsEnter: sent !== true });
|
|
2254
|
+
handoffBaseline = 0;
|
|
2255
|
+
handoffTries = 0;
|
|
2256
|
+
handoffSession = sessionId;
|
|
2257
|
+
watchHandoff(sessionId);
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* The handoff question card.
|
|
2262
|
+
*
|
|
2263
|
+
* Visual language copied from the Host's own ask-a-question card (the one the
|
|
2264
|
+
* question tool renders): a raised panel with a title, numbered option rows
|
|
2265
|
+
* and one footer of actions. Two mutually exclusive choices plus a free-text
|
|
2266
|
+
* field, which takes precedence when it has content.
|
|
2267
|
+
*/
|
|
2268
|
+
function HandoffTailCard(props) {
|
|
2269
|
+
var sessionId = props !== undefined && props !== null && typeof props.sessionId === "string" ? props.sessionId : "";
|
|
2270
|
+
var pair = react.useState(currentHandoffState());
|
|
2271
|
+
var live = pair[0];
|
|
2272
|
+
var setLive = pair[1];
|
|
2273
|
+
react.useEffect(function () {
|
|
2274
|
+
return subscribeHandoff(function (next) { setLive(next); });
|
|
2275
|
+
}, []);
|
|
2276
|
+
var choice = react.useState("confirm");
|
|
2277
|
+
var picked = choice[0];
|
|
2278
|
+
var setPicked = choice[1];
|
|
2279
|
+
var extraPair = react.useState("");
|
|
2280
|
+
var extra = extraPair[0];
|
|
2281
|
+
var setExtra = extraPair[1];
|
|
2282
|
+
|
|
2283
|
+
var state = live;
|
|
2284
|
+
if (state === null || state === undefined || state.sessionId !== sessionId) return null;
|
|
2285
|
+
if (state.phase === "running") {
|
|
2286
|
+
return h("div", { className: "wsr-handoff-live" }, state.needsEnter === true ? t("handoff.pressEnter") : t("handoff.preparing"));
|
|
2287
|
+
}
|
|
2288
|
+
if (state.phase !== "ready") return null;
|
|
2289
|
+
|
|
2290
|
+
function optionRow(id, index, title, description) {
|
|
2291
|
+
return h("button", {
|
|
2292
|
+
type: "button",
|
|
2293
|
+
key: "opt-" + id,
|
|
2294
|
+
className: "wsr-qoption" + (picked === id ? " wsr-qoption-selected" : ""),
|
|
2295
|
+
onClick: function () { setPicked(id); },
|
|
2296
|
+
},
|
|
2297
|
+
h("span", { className: "wsr-qnum" }, String(index)),
|
|
2298
|
+
h("span", { className: "wsr-qtext" },
|
|
2299
|
+
h("span", { className: "wsr-qtitle" }, title),
|
|
2300
|
+
h("span", { className: "wsr-qdetail" }, description),
|
|
2301
|
+
),
|
|
2302
|
+
);
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
return h("div", { className: "wsr-qcard" },
|
|
2306
|
+
h("div", { className: "wsr-qhead" },
|
|
2307
|
+
h("div", { className: "wsr-qheading" },
|
|
2308
|
+
h("div", { className: "wsr-qeyebrow" }, t("handoff.eyebrow")),
|
|
2309
|
+
h("div", { className: "wsr-qtitle" }, t("handoff.found")),
|
|
2310
|
+
),
|
|
2311
|
+
h("button", {
|
|
2312
|
+
type: "button",
|
|
2313
|
+
className: "wsr-qicon",
|
|
2314
|
+
title: t("handoff.preview"),
|
|
2315
|
+
onClick: function () {
|
|
2316
|
+
var body = typeof document !== "undefined" ? document.querySelector('[data-wsr-handoff-preview="' + sessionId + '"]') : null;
|
|
2317
|
+
if (body !== null && body !== undefined && body.style !== undefined) {
|
|
2318
|
+
body.style.display = body.style.display === "none" ? "" : "none";
|
|
2319
|
+
}
|
|
2320
|
+
},
|
|
2321
|
+
}, t("handoff.preview")),
|
|
2322
|
+
),
|
|
2323
|
+
h("div", { className: "wsr-qoptions" },
|
|
2324
|
+
optionRow("confirm", 1, t("handoff.confirm"), t("handoff.confirmDesc")),
|
|
2325
|
+
optionRow("redo", 2, t("handoff.regen"), t("handoff.regenDesc")),
|
|
2326
|
+
),
|
|
2327
|
+
h("div", { className: "wsr-qextra" },
|
|
2328
|
+
h("textarea", {
|
|
2329
|
+
className: "wsr-handoff-extra",
|
|
2330
|
+
placeholder: t("handoff.extraPlaceholder"),
|
|
2331
|
+
value: extra,
|
|
2332
|
+
onChange: function (event) { setExtra(event.target.value); },
|
|
2333
|
+
}),
|
|
2334
|
+
),
|
|
2335
|
+
h("div", { "data-wsr-handoff-preview": sessionId, className: "wsr-qpreview", style: { display: "none" } }, state.block),
|
|
2336
|
+
h("div", { className: "wsr-qfooter" },
|
|
2337
|
+
h("div", { className: "wsr-qactions" },
|
|
2338
|
+
h("button", {
|
|
2339
|
+
type: "button",
|
|
2340
|
+
className: "wsr-qcancel",
|
|
2341
|
+
onClick: function () { resetHandoff(); },
|
|
2342
|
+
}, t("handoff.cancel")),
|
|
2343
|
+
h("button", {
|
|
2344
|
+
type: "button",
|
|
2345
|
+
className: "wsr-qsubmit",
|
|
2346
|
+
onClick: function () {
|
|
2347
|
+
if (extra.trim() !== "") { rewriteHandoff(sessionId, extra); return; }
|
|
2348
|
+
if (picked === "redo") { rewriteHandoff(sessionId, ""); return; }
|
|
2349
|
+
carryHandoff(sessionId, state.block);
|
|
2350
|
+
},
|
|
2351
|
+
}, t("handoff.submit")),
|
|
2352
|
+
),
|
|
2353
|
+
),
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Turn actions: the handoff sits in the same row as copy / rate / branch,
|
|
2359
|
+
* which the chat renders once at the end of a completed turn.
|
|
2360
|
+
*/
|
|
2361
|
+
function HandoffTurnAction(props) {
|
|
2362
|
+
var Icon = ui.IconShareOutlineRegular;
|
|
2363
|
+
var Tooltip = ui.Tooltip;
|
|
2364
|
+
var label = t("menu.handoff");
|
|
2365
|
+
var button = h("button", {
|
|
2366
|
+
type: "button",
|
|
2367
|
+
className: "wsr-msg-btn",
|
|
2368
|
+
"aria-label": label,
|
|
2369
|
+
"data-wsr-handoff-action": "true",
|
|
2370
|
+
onClick: function () {
|
|
2371
|
+
var sessionId = props !== undefined && props !== null && typeof props.sessionId === "string" ? props.sessionId : null;
|
|
2372
|
+
if (sessionId !== null) startHandoff(sessionId);
|
|
2373
|
+
},
|
|
2374
|
+
}, typeof Icon === "function" ? h(Icon, { size: 16 }) : null);
|
|
2375
|
+
return typeof Tooltip === "function" ? h(Tooltip, { label: label, side: "bottom" }, button) : button;
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
/** Session "..." menu row: hand the work over to a fresh Session. */
|
|
2379
|
+
function HandoffMenuItem(props) {
|
|
2380
|
+
var Item = ui.MenuItemButton;
|
|
2381
|
+
if (typeof Item !== "function") return null;
|
|
2382
|
+
var Icon = ui.IconDataOutlineRegular;
|
|
2383
|
+
return h(Item, {
|
|
2384
|
+
icon: typeof Icon === "function" ? h(Icon, {}) : undefined,
|
|
2385
|
+
onSelect: function () { openHandoffPanel(props.sessionId); },
|
|
2386
|
+
}, t("menu.handoff"));
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2331
2389
|
/** Session "..." menu row: token statistics of that session. */
|
|
2332
2390
|
function StatsMenuItem(props) {
|
|
2333
2391
|
var Item = ui.MenuItemButton;
|
|
@@ -2610,27 +2668,27 @@
|
|
|
2610
2668
|
* Host's archive set (hidden sessions whose logs are still in place)
|
|
2611
2669
|
* below. Both are "put away", so both are managed from here.
|
|
2612
2670
|
*/
|
|
2613
|
-
/** One entry as a card: badge, title, the numbers that matter, and actions. */
|
|
2614
|
-
function entryCard(options) {
|
|
2615
|
-
return h("div", { className: "wsr-card", key: options.key, title: options.titleAttr || "" },
|
|
2616
|
-
h("div", { className: "wsr-card-head" },
|
|
2617
|
-
options.badge !== null && options.badge !== undefined
|
|
2618
|
-
? h("span", { className: "wsr-card-badge " + (options.badgeClass || "") }, options.badge)
|
|
2619
|
-
: null,
|
|
2620
|
-
h("div", { className: options.titleClass || "wsr-card-title" }, options.title),
|
|
2621
|
-
h("div", { className: "wsr-card-actions" }, options.actions),
|
|
2622
|
-
),
|
|
2623
|
-
options.chips.length > 0
|
|
2624
|
-
? h("div", { className: "wsr-chips" }, options.chips.map(function (text, index) {
|
|
2625
|
-
return h("span", { className: "wsr-chip", key: String(index) }, text);
|
|
2626
|
-
}))
|
|
2627
|
-
: null,
|
|
2628
|
-
typeof options.path === "string" && options.path !== ""
|
|
2629
|
-
? h("div", { className: "wsr-card-path" }, options.path)
|
|
2630
|
-
: null,
|
|
2631
|
-
);
|
|
2632
|
-
}
|
|
2633
|
-
|
|
2671
|
+
/** One entry as a card: badge, title, the numbers that matter, and actions. */
|
|
2672
|
+
function entryCard(options) {
|
|
2673
|
+
return h("div", { className: "wsr-card", key: options.key, title: options.titleAttr || "" },
|
|
2674
|
+
h("div", { className: "wsr-card-head" },
|
|
2675
|
+
options.badge !== null && options.badge !== undefined
|
|
2676
|
+
? h("span", { className: "wsr-card-badge " + (options.badgeClass || "") }, options.badge)
|
|
2677
|
+
: null,
|
|
2678
|
+
h("div", { className: options.titleClass || "wsr-card-title" }, options.title),
|
|
2679
|
+
h("div", { className: "wsr-card-actions" }, options.actions),
|
|
2680
|
+
),
|
|
2681
|
+
options.chips.length > 0
|
|
2682
|
+
? h("div", { className: "wsr-chips" }, options.chips.map(function (text, index) {
|
|
2683
|
+
return h("span", { className: "wsr-chip", key: String(index) }, text);
|
|
2684
|
+
}))
|
|
2685
|
+
: null,
|
|
2686
|
+
typeof options.path === "string" && options.path !== ""
|
|
2687
|
+
? h("div", { className: "wsr-card-path" }, options.path)
|
|
2688
|
+
: null,
|
|
2689
|
+
);
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2634
2692
|
function TrashPanelPage() {
|
|
2635
2693
|
var state = react.useState({ loaded: false, entries: [], archived: [], note: "", failed: "" });
|
|
2636
2694
|
var view = state[0];
|
|
@@ -2703,75 +2761,75 @@
|
|
|
2703
2761
|
});
|
|
2704
2762
|
};
|
|
2705
2763
|
|
|
2706
|
-
var rows = [];
|
|
2707
|
-
for (var i = 0; i < view.entries.length; i += 1) {
|
|
2708
|
-
(function (entry) {
|
|
2709
|
-
var chips = [];
|
|
2710
|
-
if (entry.turns > 0) chips.push(t("trash.turns") + " " + entry.turns);
|
|
2711
|
-
if (entry.steps > 0) chips.push(t("trash.steps") + " " + entry.steps);
|
|
2712
|
-
if (entry.tokens > 0) chips.push(formatTokens(entry.tokens) + " tokens");
|
|
2713
|
-
chips.push(formatBytes(entry.sizeBytes));
|
|
2714
|
-
var when = formatWhen(entry.at);
|
|
2715
|
-
if (when !== "") chips.push(when);
|
|
2716
|
-
var actions = [];
|
|
2717
|
-
if (entry.restorable === true) {
|
|
2718
|
-
actions.push(h("button", {
|
|
2719
|
-
type: "button",
|
|
2720
|
-
className: "wsr-btn",
|
|
2721
|
-
onClick: function () { act(entry, "restore"); },
|
|
2722
|
-
}, t("trash.restore")));
|
|
2723
|
-
}
|
|
2724
|
-
actions.push(h("button", {
|
|
2725
|
-
type: "button",
|
|
2726
|
-
className: "wsr-btn wsr-btn-danger",
|
|
2727
|
-
onClick: function () { act(entry, "purge"); },
|
|
2728
|
-
}, t("trash.purge")));
|
|
2729
|
-
var hasTitle = typeof entry.title === "string" && entry.title !== "";
|
|
2730
|
-
rows.push(entryCard({
|
|
2731
|
-
key: entry.name,
|
|
2732
|
-
badge: entry.reason === "move" ? t("trash.reason.move") : t("trash.reason.delete"),
|
|
2733
|
-
badgeClass: entry.reason === "move" ? "wsr-card-badge-muted" : "wsr-card-badge-danger",
|
|
2734
|
-
titleClass: hasTitle ? "wsr-card-title" : "wsr-card-title wsr-card-title-id",
|
|
2735
|
-
title: hasTitle ? entry.title : (entry.sessionId === null ? entry.name : entry.sessionId),
|
|
2736
|
-
titleAttr: entry.sessionId === null ? entry.name : entry.sessionId,
|
|
2737
|
-
chips: chips,
|
|
2738
|
-
path: entry.cwd,
|
|
2739
|
-
actions: actions,
|
|
2740
|
-
}));
|
|
2741
|
-
})(view.entries[i]);
|
|
2742
|
-
}
|
|
2743
|
-
|
|
2744
|
-
var archivedRows = [];
|
|
2745
|
-
var archivedList = Array.isArray(view.archived) ? view.archived : [];
|
|
2746
|
-
for (var j = 0; j < archivedList.length; j += 1) {
|
|
2747
|
-
(function (entry) {
|
|
2748
|
-
var chips = [];
|
|
2749
|
-
if (entry.turns > 0) chips.push(t("trash.turns") + " " + entry.turns);
|
|
2750
|
-
if (entry.steps > 0) chips.push(t("trash.steps") + " " + entry.steps);
|
|
2751
|
-
if (entry.tokens > 0) chips.push(formatTokens(entry.tokens) + " tokens");
|
|
2752
|
-
chips.push(formatBytes(entry.sizeBytes));
|
|
2753
|
-
var when = formatWhen(entry.lastAt !== 0 ? entry.lastAt : entry.createdAt);
|
|
2754
|
-
if (when !== "") chips.push(when);
|
|
2755
|
-
if (entry.blank === true) chips.push(t("archive.blank"));
|
|
2756
|
-
var hasTitle = typeof entry.title === "string" && entry.title !== "";
|
|
2757
|
-
archivedRows.push(entryCard({
|
|
2758
|
-
key: entry.sessionId,
|
|
2759
|
-
badge: t("archive.badge"),
|
|
2760
|
-
badgeClass: "wsr-card-badge-muted",
|
|
2761
|
-
titleClass: hasTitle ? "wsr-card-title" : "wsr-card-title wsr-card-title-id",
|
|
2762
|
-
title: hasTitle ? entry.title : entry.sessionId,
|
|
2763
|
-
titleAttr: entry.sessionId,
|
|
2764
|
-
chips: chips,
|
|
2765
|
-
path: typeof entry.workspacePath === "string" && entry.workspacePath !== "" ? entry.workspacePath : entry.cwd,
|
|
2766
|
-
actions: [
|
|
2767
|
-
h("button", { type: "button", className: "wsr-btn", onClick: function () { actArchived(entry, "unarchive"); } }, t("archive.unarchive")),
|
|
2768
|
-
h("button", { type: "button", className: "wsr-btn", onClick: function () { actArchived(entry, "delete"); } }, t("archive.delete")),
|
|
2769
|
-
h("button", { type: "button", className: "wsr-btn wsr-btn-danger", onClick: function () { actArchived(entry, "forget"); } }, t("archive.forget")),
|
|
2770
|
-
],
|
|
2771
|
-
}));
|
|
2772
|
-
})(archivedList[j]);
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2764
|
+
var rows = [];
|
|
2765
|
+
for (var i = 0; i < view.entries.length; i += 1) {
|
|
2766
|
+
(function (entry) {
|
|
2767
|
+
var chips = [];
|
|
2768
|
+
if (entry.turns > 0) chips.push(t("trash.turns") + " " + entry.turns);
|
|
2769
|
+
if (entry.steps > 0) chips.push(t("trash.steps") + " " + entry.steps);
|
|
2770
|
+
if (entry.tokens > 0) chips.push(formatTokens(entry.tokens) + " tokens");
|
|
2771
|
+
chips.push(formatBytes(entry.sizeBytes));
|
|
2772
|
+
var when = formatWhen(entry.at);
|
|
2773
|
+
if (when !== "") chips.push(when);
|
|
2774
|
+
var actions = [];
|
|
2775
|
+
if (entry.restorable === true) {
|
|
2776
|
+
actions.push(h("button", {
|
|
2777
|
+
type: "button",
|
|
2778
|
+
className: "wsr-btn",
|
|
2779
|
+
onClick: function () { act(entry, "restore"); },
|
|
2780
|
+
}, t("trash.restore")));
|
|
2781
|
+
}
|
|
2782
|
+
actions.push(h("button", {
|
|
2783
|
+
type: "button",
|
|
2784
|
+
className: "wsr-btn wsr-btn-danger",
|
|
2785
|
+
onClick: function () { act(entry, "purge"); },
|
|
2786
|
+
}, t("trash.purge")));
|
|
2787
|
+
var hasTitle = typeof entry.title === "string" && entry.title !== "";
|
|
2788
|
+
rows.push(entryCard({
|
|
2789
|
+
key: entry.name,
|
|
2790
|
+
badge: entry.reason === "move" ? t("trash.reason.move") : t("trash.reason.delete"),
|
|
2791
|
+
badgeClass: entry.reason === "move" ? "wsr-card-badge-muted" : "wsr-card-badge-danger",
|
|
2792
|
+
titleClass: hasTitle ? "wsr-card-title" : "wsr-card-title wsr-card-title-id",
|
|
2793
|
+
title: hasTitle ? entry.title : (entry.sessionId === null ? entry.name : entry.sessionId),
|
|
2794
|
+
titleAttr: entry.sessionId === null ? entry.name : entry.sessionId,
|
|
2795
|
+
chips: chips,
|
|
2796
|
+
path: entry.cwd,
|
|
2797
|
+
actions: actions,
|
|
2798
|
+
}));
|
|
2799
|
+
})(view.entries[i]);
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
var archivedRows = [];
|
|
2803
|
+
var archivedList = Array.isArray(view.archived) ? view.archived : [];
|
|
2804
|
+
for (var j = 0; j < archivedList.length; j += 1) {
|
|
2805
|
+
(function (entry) {
|
|
2806
|
+
var chips = [];
|
|
2807
|
+
if (entry.turns > 0) chips.push(t("trash.turns") + " " + entry.turns);
|
|
2808
|
+
if (entry.steps > 0) chips.push(t("trash.steps") + " " + entry.steps);
|
|
2809
|
+
if (entry.tokens > 0) chips.push(formatTokens(entry.tokens) + " tokens");
|
|
2810
|
+
chips.push(formatBytes(entry.sizeBytes));
|
|
2811
|
+
var when = formatWhen(entry.lastAt !== 0 ? entry.lastAt : entry.createdAt);
|
|
2812
|
+
if (when !== "") chips.push(when);
|
|
2813
|
+
if (entry.blank === true) chips.push(t("archive.blank"));
|
|
2814
|
+
var hasTitle = typeof entry.title === "string" && entry.title !== "";
|
|
2815
|
+
archivedRows.push(entryCard({
|
|
2816
|
+
key: entry.sessionId,
|
|
2817
|
+
badge: t("archive.badge"),
|
|
2818
|
+
badgeClass: "wsr-card-badge-muted",
|
|
2819
|
+
titleClass: hasTitle ? "wsr-card-title" : "wsr-card-title wsr-card-title-id",
|
|
2820
|
+
title: hasTitle ? entry.title : entry.sessionId,
|
|
2821
|
+
titleAttr: entry.sessionId,
|
|
2822
|
+
chips: chips,
|
|
2823
|
+
path: typeof entry.workspacePath === "string" && entry.workspacePath !== "" ? entry.workspacePath : entry.cwd,
|
|
2824
|
+
actions: [
|
|
2825
|
+
h("button", { type: "button", className: "wsr-btn", onClick: function () { actArchived(entry, "unarchive"); } }, t("archive.unarchive")),
|
|
2826
|
+
h("button", { type: "button", className: "wsr-btn", onClick: function () { actArchived(entry, "delete"); } }, t("archive.delete")),
|
|
2827
|
+
h("button", { type: "button", className: "wsr-btn wsr-btn-danger", onClick: function () { actArchived(entry, "forget"); } }, t("archive.forget")),
|
|
2828
|
+
],
|
|
2829
|
+
}));
|
|
2830
|
+
})(archivedList[j]);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2775
2833
|
var archiveSection = view.archived === null ? null : [
|
|
2776
2834
|
h("div", { className: "wsr-page-section", key: "archive-head" },
|
|
2777
2835
|
h("span", null, t("trash.section.archived")),
|
|
@@ -3031,7 +3089,7 @@
|
|
|
3031
3089
|
|
|
3032
3090
|
/* The statistics renderer is plain DOM, not a slot component: keep the
|
|
3033
3091
|
store handle so it can read the argument-mode preference live. */
|
|
3034
|
-
|
|
3092
|
+
|
|
3035
3093
|
prefsStore = prefs;
|
|
3036
3094
|
|
|
3037
3095
|
if (typeof MutationObserver === "function" && top() !== null) {
|
|
@@ -3112,26 +3170,26 @@
|
|
|
3112
3170
|
}, ArgModeRow);
|
|
3113
3171
|
});
|
|
3114
3172
|
|
|
3115
|
-
ctx.slots.inject("conversation.chat.assistant-actions", function () {
|
|
3116
|
-
return ctx.slots.register({
|
|
3117
|
-
name: "conversation.chat.assistant-actions",
|
|
3118
|
-
id: "ws-recency-handoff",
|
|
3119
|
-
order: 20,
|
|
3120
|
-
locale: NS,
|
|
3121
|
-
inject: function (sessionId) { return { sessionId: sessionId }; },
|
|
3122
|
-
}, HandoffTurnAction);
|
|
3123
|
-
});
|
|
3124
|
-
|
|
3125
|
-
ctx.slots.inject("conversation.chat.turnTail", function () {
|
|
3126
|
-
return ctx.slots.register({
|
|
3127
|
-
name: "conversation.chat.turnTail",
|
|
3128
|
-
id: "ws-recency-handoff-card",
|
|
3129
|
-
order: 30,
|
|
3130
|
-
locale: NS,
|
|
3131
|
-
inject: function (sessionId) { return { sessionId: sessionId }; },
|
|
3132
|
-
}, HandoffTailCard);
|
|
3133
|
-
});
|
|
3134
|
-
|
|
3173
|
+
ctx.slots.inject("conversation.chat.assistant-actions", function () {
|
|
3174
|
+
return ctx.slots.register({
|
|
3175
|
+
name: "conversation.chat.assistant-actions",
|
|
3176
|
+
id: "ws-recency-handoff",
|
|
3177
|
+
order: 20,
|
|
3178
|
+
locale: NS,
|
|
3179
|
+
inject: function (sessionId) { return { sessionId: sessionId }; },
|
|
3180
|
+
}, HandoffTurnAction);
|
|
3181
|
+
});
|
|
3182
|
+
|
|
3183
|
+
ctx.slots.inject("conversation.chat.turnTail", function () {
|
|
3184
|
+
return ctx.slots.register({
|
|
3185
|
+
name: "conversation.chat.turnTail",
|
|
3186
|
+
id: "ws-recency-handoff-card",
|
|
3187
|
+
order: 30,
|
|
3188
|
+
locale: NS,
|
|
3189
|
+
inject: function (sessionId) { return { sessionId: sessionId }; },
|
|
3190
|
+
}, HandoffTailCard);
|
|
3191
|
+
});
|
|
3192
|
+
|
|
3135
3193
|
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
3136
3194
|
return ctx.slots.register({
|
|
3137
3195
|
name: "sidebar.workspaces.session.menu.item",
|
|
@@ -3165,16 +3223,16 @@
|
|
|
3165
3223
|
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
3166
3224
|
return ctx.slots.register({
|
|
3167
3225
|
name: "sidebar.workspaces.session.menu.item",
|
|
3168
|
-
id: "ws-recency-handoff",
|
|
3169
|
-
order: 685,
|
|
3170
|
-
store: prefs,
|
|
3171
|
-
locale: NS,
|
|
3172
|
-
}, HandoffMenuItem);
|
|
3173
|
-
});
|
|
3174
|
-
|
|
3175
|
-
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
3176
|
-
return ctx.slots.register({
|
|
3177
|
-
name: "sidebar.workspaces.session.menu.item",
|
|
3226
|
+
id: "ws-recency-handoff",
|
|
3227
|
+
order: 685,
|
|
3228
|
+
store: prefs,
|
|
3229
|
+
locale: NS,
|
|
3230
|
+
}, HandoffMenuItem);
|
|
3231
|
+
});
|
|
3232
|
+
|
|
3233
|
+
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
3234
|
+
return ctx.slots.register({
|
|
3235
|
+
name: "sidebar.workspaces.session.menu.item",
|
|
3178
3236
|
id: "ws-recency-stats",
|
|
3179
3237
|
order: 710,
|
|
3180
3238
|
store: prefs,
|
|
@@ -3200,9 +3258,9 @@
|
|
|
3200
3258
|
schedule();
|
|
3201
3259
|
}
|
|
3202
3260
|
|
|
3203
|
-
/* Test hook: the card state is a module observable, invisible from outside. */
|
|
3204
|
-
exports.__handoff = { current: currentHandoffState, set: setHandoffState };
|
|
3205
|
-
|
|
3261
|
+
/* Test hook: the card state is a module observable, invisible from outside. */
|
|
3262
|
+
exports.__handoff = { current: currentHandoffState, set: setHandoffState, blockOf: handoffBlockOf };
|
|
3263
|
+
|
|
3206
3264
|
exports.name = "dsh-ws-recency";
|
|
3207
3265
|
exports.inject = inject;
|
|
3208
3266
|
exports.apply = apply_;
|