dsh-seal-scripts 0.6.0 → 0.6.2

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/lib/client.js CHANGED
@@ -262,7 +262,20 @@ window.__ModuleLoader__.load({
262
262
  'help.injectGroup': '回顾划分为四级深度,载入内容分别为:3级,载入原对话文本;2级,载入压缩概述;1级,载入模型总结;0级,仅载入关键词作为索引。\n回顾深度降低点分别为第二天、第三天、第二十八天及以后,在被用户指出模型内容记忆有误时,模型自身会调用session_mem_read直接读取回顾文件的原会话对话文本,并且对对应回顾加权并锁定载入内容。使用过程中出现深度为1级、0级的空回顾时,这是正常现象,插件会通过注入提醒来让模型调用session_mem_write写总结与提取关键词,上下文侧与系统提示词侧的遵守程度不同,请根据实际情况选用。\n不建议开启“全量加载”,关键节点建议直接使用DSH自带的分支功能。',
263
263
  'opt.auto': '自动回顾',
264
264
  'opt.auto.desc': '开启时维持原来的行为:压缩后创建回顾文件,并按下面的设置将回顾注入上下文,将提醒注入到选择的位置。关闭后停止创建与注入,下面所有选项变为不可改。',
265
- 'opt.auto.off': '未开启回顾功能,已停止回顾文件的创建与注入,如果你没有其他记忆插件或者回顾工作流系统,建议开启本项。'
265
+ 'opt.auto.off': '未开启回顾功能,已停止回顾文件的创建与注入,如果你没有其他记忆插件或者回顾工作流系统,建议开启本项。',
266
+ 'si.import': '导入',
267
+ 'si.target': '目标工作区',
268
+ 'si.preview': function (id, cwd) { return '包内会话:' + id + '\n工作目录:' + cwd },
269
+ 'si.previewTarget': function (title, path) { return '将导入到:' + (title || path) + '(' + path + ')' },
270
+ 'si.branchWarn': '同 id 已在目标工作区:导入会换成新 id,并挂成那条会话的分支;原来那条一个字都不动。',
271
+ 'si.renameWarn': '同 id 已在别的工作区,导入时会换成新 id;原来那条一个字节都不动。',
272
+ 'si.counts': function (m, f, s) { return '包内有图片 ' + m + ' 张、文件 ' + f + ' 个、子代理 ' + s + ' 条。' },
273
+ 'si.confirm': '确认导入',
274
+ 'si.cancel': '取消',
275
+ 'si.done': function (id, m, f) { return '已导入 ' + id + ';图片 ' + m + ' 张,文件 ' + f + ' 个。' },
276
+ 'si.doneRenamed': function (id, old) { return '已导入,id 换成 ' + id + '(原 ' + old + ');原来那条没动。' },
277
+ 'si.noTarget': '没有可选的工作区:先在 DSH 里建一个。',
278
+ 'si.noZstd': '这台机器的 Node 没有 zstdCompress,写不了会话日志,导入暂不可用。'
266
279
  },
267
280
  en: {
268
281
  'app.title': 'Tool (script) manager',
@@ -394,7 +407,20 @@ window.__ModuleLoader__.load({
394
407
  'help.injectGroup': 'A review has four depths, each loading something different: level 3, the original transcript; level 2, the compaction summary; level 1, the model’s own summary; level 0, keywords only, used as an index.\nDepths drop on the second day, the third day, and the twenty-eighth day onward. When you point out that the model misremembers something, the model itself calls session_mem_read to read that review’s original transcript, then weights and locks the loaded content of that review. An empty review at depth 1 or 0 is normal: the plugin injects a reminder telling the model to call session_mem_write with a summary and keywords. Compliance differs between the context channel and the system-prompt channel, so pick whichever fits.\nTurning on “Full load” is not recommended; for important checkpoints, use DSH’s own branching instead.',
395
408
  'opt.auto': 'Auto review',
396
409
  'opt.auto.desc': 'When on, behaviour stays as before: a review is created on every compaction and injected into the context and system prompt per the options below. When off, creation and injection stop and every option below becomes read-only.',
397
- 'opt.auto.off': 'Review is off, so review files are neither created nor injected. If you have no other memory plugin or review workflow, turn this on.'
410
+ 'opt.auto.off': 'Review is off, so review files are neither created nor injected. If you have no other memory plugin or review workflow, turn this on.',
411
+ 'si.import': 'Import',
412
+ 'si.target': 'Target workspace',
413
+ 'si.preview': function (id, cwd) { return 'Session in the package: ' + id + '\nWorking directory: ' + cwd },
414
+ 'si.previewTarget': function (title, path) { return 'Import into: ' + (title || path) + ' (' + path + ')' },
415
+ 'si.branchWarn': 'This id already exists in the target workspace: the import will use a new id and attach it under that session as a branch, leaving the original untouched.',
416
+ 'si.renameWarn': 'This id already lives in another workspace; the import will use a new id and leave the original untouched.',
417
+ 'si.counts': function (m, f, s) { return 'The package holds ' + m + ' image(s), ' + f + ' file(s) and ' + s + ' subagent session(s).' },
418
+ 'si.confirm': 'Import',
419
+ 'si.cancel': 'Cancel',
420
+ 'si.done': function (id, m, f) { return 'Imported ' + id + '; ' + m + ' image(s), ' + f + ' file(s).' },
421
+ 'si.doneRenamed': function (id, old) { return 'Imported with a new id ' + id + ' (was ' + old + '); the original was left alone.' },
422
+ 'si.noTarget': 'No workspace to import into: create one in DSH first.',
423
+ 'si.noZstd': 'This host runs a Node without zstdCompress, so session logs cannot be written; import is unavailable.'
398
424
  },
399
425
  ja: {
400
426
  'app.title': 'ツール(スクリプト)管理',
@@ -524,7 +550,20 @@ window.__ModuleLoader__.load({
524
550
  'help.injectGroup': 'レビューは 4 段階の深度に分かれ、読み込む内容が異なります:レベル 3 は元の会話文、レベル 2 は圧縮要約、レベル 1 はモデル自身のまとめ、レベル 0 はキーワードのみ(索引として使う)。\n深度は 2 日目、3 日目、28 日目以降に下がります。モデルの記憶違いを指摘すると、モデルは session_mem_read を呼んでそのレビューの原文を読み直し、該当レビューの重みを上げて読み込み内容をロックします。レベル 1・0 の空レビューは正常で、プラグインは注入リマインダーでモデルに session_mem_write でまとめとキーワードを書かせます。コンテキスト側とシステムプロンプト側で遵守度が異なるため、状況に応じて選んでください。\n「全量読み込み」は推奨しません。重要な区切りでは DSH 標準のブランチ機能を使ってください。',
525
551
  'opt.auto': '自動レビュー',
526
552
  'opt.auto.desc': 'オンにすると従来どおり:圧縮のたびにレビューファイルを作り、以下の設定でレビューをコンテキストとシステムプロンプトに注入し、リマインダーを選択位置に注入します。オフにすると作成と注入を停止し、以下の設定はすべて変更できなくなります。',
527
- 'opt.auto.off': 'レビュー機能はオフです。レビューファイルの作成も注入も停止しています。他の記憶プラグインやレビュー運用がない場合はこの項目をオンにしてください。'
553
+ 'opt.auto.off': 'レビュー機能はオフです。レビューファイルの作成も注入も停止しています。他の記憶プラグインやレビュー運用がない場合はこの項目をオンにしてください。',
554
+ 'si.import': 'インポート',
555
+ 'si.target': '対象ワークスペース',
556
+ 'si.preview': function (id, cwd) { return 'パッケージ内のセッション:' + id + '\n作業ディレクトリ:' + cwd },
557
+ 'si.previewTarget': function (title, path) { return 'インポート先:' + (title || path) + '(' + path + ')' },
558
+ 'si.branchWarn': '同じ id が対象ワークスペースにあります。インポートは新しい id を使い、そのセッションのブランチとして追加します。元のセッションは変更しません。',
559
+ 'si.renameWarn': '同じ id が他のワークスペースにあります。インポート時は新しい id を使い、元のセッションは変更しません。',
560
+ 'si.counts': function (m, f, s) { return 'パッケージ内:画像 ' + m + ' 枚、ファイル ' + f + ' 個、サブエージェント ' + s + ' 件。' },
561
+ 'si.confirm': 'インポート',
562
+ 'si.cancel': 'キャンセル',
563
+ 'si.done': function (id, m, f) { return id + ' をインポートしました(画像 ' + m + ' 枚、ファイル ' + f + ' 個)。' },
564
+ 'si.doneRenamed': function (id, old) { return 'インポートしました。id は ' + id + '(元は ' + old + ')。元のセッションは変更していません。' },
565
+ 'si.noTarget': 'インポート先のワークスペースがありません。先に DSH で作成してください。',
566
+ 'si.noZstd': 'この Node には zstdCompress がないためセッションログを書き込めません。インポートは使えません。'
528
567
  },
529
568
  es: {
530
569
  'app.title': 'Gestor de herramientas (scripts)',
@@ -656,7 +695,20 @@ window.__ModuleLoader__.load({
656
695
  'help.injectGroup': 'Una revisión tiene cuatro profundidades, cada una carga algo distinto: nivel 3, la transcripción original; nivel 2, el resumen de la compactación; nivel 1, el resumen del propio modelo; nivel 0, solo palabras clave, como índice.\nLa profundidad baja al segundo día, al tercer día y del vigésimo octavo en adelante. Cuando señalas que el modelo recuerda algo mal, el propio modelo llama a session_mem_read para leer la transcripción de esa revisión y luego pondera y bloquea su contenido cargado. Una revisión vacía en nivel 1 o 0 es normal: el plugin inyecta un recordatorio para que el modelo llame a session_mem_write con un resumen y palabras clave. El cumplimiento difiere entre el canal de contexto y el del prompt del sistema, así que elige el que mejor te funcione.\nNo se recomienda activar «Carga completa»; para hitos importantes usa las ramas propias de DSH.',
657
696
  'opt.auto': 'Revisión automática',
658
697
  'opt.auto.desc': 'Cuando está activada, el comportamiento es el de siempre: se crea una revisión en cada compactación y se inyecta en el contexto y el prompt del sistema según las opciones de abajo. Al desactivarla, se detienen la creación y la inyección y todas las opciones de abajo quedan de solo lectura.',
659
- 'opt.auto.off': 'La revisión está desactivada, así que no se crean ni se inyectan archivos de revisión. Si no tienes otro plugin de memoria ni un flujo de revisiones, actívala.'
698
+ 'opt.auto.off': 'La revisión está desactivada, así que no se crean ni se inyectan archivos de revisión. Si no tienes otro plugin de memoria ni un flujo de revisiones, actívala.',
699
+ 'si.import': 'Importar',
700
+ 'si.target': 'Espacio de trabajo destino',
701
+ 'si.preview': function (id, cwd) { return 'Sesión del paquete: ' + id + '\nDirectorio de trabajo: ' + cwd },
702
+ 'si.previewTarget': function (title, path) { return 'Se importará en: ' + (title || path) + ' (' + path + ')' },
703
+ 'si.branchWarn': 'El mismo id ya existe en el espacio de trabajo destino: la importación usará un id nuevo y la colgará como rama de esa sesión, sin tocar la original.',
704
+ 'si.renameWarn': 'El mismo id ya está en otro espacio de trabajo: la importación usará un id nuevo y no tocará el original.',
705
+ 'si.counts': function (m, f, s) { return 'El paquete contiene ' + m + ' imagen(es), ' + f + ' archivo(s) y ' + s + ' sesión(es) de subagente.' },
706
+ 'si.confirm': 'Importar',
707
+ 'si.cancel': 'Cancelar',
708
+ 'si.done': function (id, m, f) { return 'Importado ' + id + '; ' + m + ' imagen(es), ' + f + ' archivo(s).' },
709
+ 'si.doneRenamed': function (id, old) { return 'Importado con id nuevo ' + id + ' (antes ' + old + '); el original no se tocó.' },
710
+ 'si.noTarget': 'No hay espacio de trabajo destino: crea uno en DSH primero.',
711
+ 'si.noZstd': 'Este Node no tiene zstdCompress; no se pueden escribir registros de sesión y la importación no está disponible.'
660
712
  },
661
713
  fr: {
662
714
  'app.title': 'Gestion des outils (scripts)',
@@ -788,7 +840,20 @@ window.__ModuleLoader__.load({
788
840
  'help.injectGroup': 'Une revue a quatre profondeurs, chacune chargeant un contenu différent : niveau 3, la transcription d’origine ; niveau 2, le résumé de compaction ; niveau 1, le résumé du modèle lui-même ; niveau 0, les mots-clés seuls, comme index.\nLa profondeur baisse le deuxième jour, le troisième jour, puis à partir du vingt-huitième. Quand vous signalez un souvenir erroné, le modèle appelle lui-même session_mem_read pour relire la transcription de cette revue, puis pondère et verrouille son contenu chargé. Une revue vide en niveau 1 ou 0 est normale : le plugin injecte un rappel demandant au modèle d’appeler session_mem_write avec un résumé et des mots-clés. Le respect varie entre le canal contexte et le canal prompt système : choisissez celui qui vous convient.\nActiver « Chargement complet » n’est pas recommandé ; pour les étapes importantes, utilisez les branches natives de DSH.',
789
841
  'opt.auto': 'Revue automatique',
790
842
  'opt.auto.desc': 'Quand c’est activé, le comportement reste le même : une revue est créée à chaque compaction et injectée dans le contexte et le prompt système selon les options ci-dessous. Désactivé, la création et l’injection s’arrêtent et toutes les options ci-dessous deviennent en lecture seule.',
791
- 'opt.auto.off': 'La revue est désactivée : les fichiers de revue ne sont ni créés ni injectés. Si vous n’avez pas d’autre plugin de mémoire ni d’enchaînement de revues, activez cette option.'
843
+ 'opt.auto.off': 'La revue est désactivée : les fichiers de revue ne sont ni créés ni injectés. Si vous n’avez pas d’autre plugin de mémoire ni d’enchaînement de revues, activez cette option.',
844
+ 'si.import': 'Importer',
845
+ 'si.target': 'Espace de travail cible',
846
+ 'si.preview': function (id, cwd) { return 'Session du paquet : ' + id + '\nRépertoire de travail : ' + cwd },
847
+ 'si.previewTarget': function (title, path) { return 'Importer vers : ' + (title || path) + ' (' + path + ')' },
848
+ 'si.branchWarn': 'Cet id existe déjà dans l’espace de travail cible : l’import utilisera un nouvel id et le rattachera comme branche de cette session, sans toucher à l’original.',
849
+ 'si.renameWarn': 'Cet id existe déjà dans un autre espace de travail : l’import utilisera un nouvel id et ne touchera pas l’original.',
850
+ 'si.counts': function (m, f, s) { return 'Le paquet contient ' + m + ' image(s), ' + f + ' fichier(s) et ' + s + ' session(s) de sous-agent.' },
851
+ 'si.confirm': 'Importer',
852
+ 'si.cancel': 'Annuler',
853
+ 'si.done': function (id, m, f) { return id + ' importé ; ' + m + ' image(s), ' + f + ' fichier(s).' },
854
+ 'si.doneRenamed': function (id, old) { return 'Importé sous le nouvel id ' + id + ' (ancien : ' + old + ') ; l’original est intact.' },
855
+ 'si.noTarget': 'Aucun espace de travail cible : créez-en un dans DSH.',
856
+ 'si.noZstd': 'Ce Node n’a pas zstdCompress : impossible d’écrire les journaux de session, l’import est indisponible.'
792
857
  },
793
858
  de: {
794
859
  'app.title': 'Werkzeug- (Skript-)Verwaltung',
@@ -920,7 +985,20 @@ window.__ModuleLoader__.load({
920
985
  'help.injectGroup': 'Eine Review hat vier Tiefen, die jeweils etwas anderes laden: Stufe 3 das ursprüngliche Transkript, Stufe 2 die Kompressions-Zusammenfassung, Stufe 1 die eigene Zusammenfassung des Modells, Stufe 0 nur Stichwörter als Index.\nDie Tiefe sinkt am zweiten Tag, am dritten Tag und ab dem achtundzwanzigsten. Wenn du dem Modell eine falsche Erinnerung nachweist, ruft es selbst session_mem_read auf, liest das Transkript dieser Review und gewichtet und sperrt danach den geladenen Inhalt. Eine leere Review auf Stufe 1 oder 0 ist normal: Das Plugin injiziert eine Erinnerung, damit das Modell session_mem_write mit Zusammenfassung und Stichwörtern aufruft. Die Befolgung unterscheidet sich zwischen Kontext- und System-Prompt-Kanal, wähle je nach Bedarf.\n„Vollständig laden“ ist nicht empfehlenswert; nutze für wichtige Punkte die Branches von DSH.',
921
986
  'opt.auto': 'Automatische Review',
922
987
  'opt.auto.desc': 'Wenn ein, bleibt das Verhalten wie bisher: Bei jeder Kompression wird eine Review angelegt und gemäß den Optionen unten in Kontext und System-Prompt injiziert. Wenn aus, stoppen Anlegen und Injizieren und alle Optionen unten werden schreibgeschützt.',
923
- 'opt.auto.off': 'Die Review ist aus, es werden weder Review-Dateien angelegt noch injiziert. Wenn du kein anderes Speicher-Plugin oder keinen Review-Ablauf hast, schalte dies ein.'
988
+ 'opt.auto.off': 'Die Review ist aus, es werden weder Review-Dateien angelegt noch injiziert. Wenn du kein anderes Speicher-Plugin oder keinen Review-Ablauf hast, schalte dies ein.',
989
+ 'si.import': 'Importieren',
990
+ 'si.target': 'Ziel-Workspace',
991
+ 'si.preview': function (id, cwd) { return 'Session im Paket: ' + id + '\nArbeitsverzeichnis: ' + cwd },
992
+ 'si.previewTarget': function (title, path) { return 'Import nach: ' + (title || path) + ' (' + path + ')' },
993
+ 'si.branchWarn': 'Diese id existiert im Ziel-Workspace bereits: der Import nutzt eine neue id und hängt sie als Branch unter diese Session, das Original bleibt unangetastet.',
994
+ 'si.renameWarn': 'Diese id liegt bereits in einem anderen Workspace: der Import nutzt eine neue id und lässt das Original unangetastet.',
995
+ 'si.counts': function (m, f, s) { return 'Das Paket enthält ' + m + ' Bild(er), ' + f + ' Datei(en) und ' + s + ' Subagent-Session(s).' },
996
+ 'si.confirm': 'Importieren',
997
+ 'si.cancel': 'Abbrechen',
998
+ 'si.done': function (id, m, f) { return id + ' importiert; ' + m + ' Bild(er), ' + f + ' Datei(en).' },
999
+ 'si.doneRenamed': function (id, old) { return 'Importiert mit neuer id ' + id + ' (vorher ' + old + '); das Original blieb unverändert.' },
1000
+ 'si.noTarget': 'Kein Ziel-Workspace vorhanden: lege zuerst einen in DSH an.',
1001
+ 'si.noZstd': 'Dieses Node hat kein zstdCompress; Session-Logs lassen sich nicht schreiben, der Import ist nicht verfügbar.'
924
1002
  },
925
1003
  ru: {
926
1004
  'app.title': 'Управление инструментами (скриптами)',
@@ -1052,7 +1130,20 @@ window.__ModuleLoader__.load({
1052
1130
  'help.injectGroup': 'У обзора четыре глубины, каждая загружает своё: уровень 3 — исходная расшифровка; уровень 2 — итог сжатия; уровень 1 — собственный итог модели; уровень 0 — только ключевые слова как индекс.\nГлубина снижается на второй день, на третий и начиная с двадцать восьмого. Когда вы указываете модели на ошибку в памяти, она сама вызывает session_mem_read, читает расшифровку этого обзора, затем повышает вес и закрепляет загруженное содержимое. Пустой обзор на уровне 1 или 0 — это нормально: плагин вставляет напоминание, чтобы модель вызвала session_mem_write с итогом и ключевыми словами. Соблюдение различается для канала контекста и канала системного промпта, выбирайте по ситуации.\nВключать «Полную загрузку» не рекомендуется; для важных точек используйте ветвления самого DSH.',
1053
1131
  'opt.auto': 'Автоматический обзор',
1054
1132
  'opt.auto.desc': 'Когда включено, поведение прежнее: при каждом сжатии создаётся обзор и вставляется в контекст и системный промпт согласно параметрам ниже. Когда выключено, создание и вставка останавливаются, а все параметры ниже становятся только для чтения.',
1055
- 'opt.auto.off': 'Обзоры выключены, файлы обзоров не создаются и не вставляются. Если у вас нет другого плагина памяти или процесса обзоров, включите этот параметр.'
1133
+ 'opt.auto.off': 'Обзоры выключены, файлы обзоров не создаются и не вставляются. Если у вас нет другого плагина памяти или процесса обзоров, включите этот параметр.',
1134
+ 'si.import': 'Импорт',
1135
+ 'si.target': 'Целевое рабочее пространство',
1136
+ 'si.preview': function (id, cwd) { return 'Сессия в пакете: ' + id + '\nРабочий каталог: ' + cwd },
1137
+ 'si.previewTarget': function (title, path) { return 'Импорт в: ' + (title || path) + ' (' + path + ')' },
1138
+ 'si.branchWarn': 'Этот id уже есть в целевом пространстве: импорт возьмёт новый id и повесит её ветвью под эту сессию, оригинал останется нетронутым.',
1139
+ 'si.renameWarn': 'Этот id уже есть в другом рабочем пространстве: импорт возьмёт новый id, оригинал останется нетронутым.',
1140
+ 'si.counts': function (m, f, s) { return 'В пакете: изображений ' + m + ', файлов ' + f + ', субагентских сессий ' + s + '.' },
1141
+ 'si.confirm': 'Импортировать',
1142
+ 'si.cancel': 'Отмена',
1143
+ 'si.done': function (id, m, f) { return 'Импортировано ' + id + '; изображений ' + m + ', файлов ' + f + '.' },
1144
+ 'si.doneRenamed': function (id, old) { return 'Импортировано с новым id ' + id + ' (был ' + old + '); оригинал не тронут.' },
1145
+ 'si.noTarget': 'Нет целевого рабочего пространства: сначала создайте его в DSH.',
1146
+ 'si.noZstd': 'В этом Node нет zstdCompress; журналы сессий записать нельзя, импорт недоступен.'
1056
1147
  },
1057
1148
  pt: {
1058
1149
  'app.title': 'Gerenciador de ferramentas (scripts)',
@@ -1184,7 +1275,20 @@ window.__ModuleLoader__.load({
1184
1275
  'help.injectGroup': 'Uma revisão tem quatro profundidades, cada uma carregando algo diferente: nível 3, a transcrição original; nível 2, o resumo da compactação; nível 1, o resumo do próprio modelo; nível 0, apenas palavras-chave como índice.\nA profundidade cai no segundo dia, no terceiro dia e a partir do vigésimo oitavo. Quando você aponta que o modelo lembra algo errado, o próprio modelo chama session_mem_read para reler a transcrição dessa revisão e então pondera e trava o conteúdo carregado. Uma revisão vazia em nível 1 ou 0 é normal: o plugin injeta um lembrete para o modelo chamar session_mem_write com resumo e palavras-chave. O cumprimento difere entre o canal de contexto e o do prompt do sistema, escolha conforme o caso.\nAtivar “Carga completa” não é recomendado; para marcos importantes use as ramificações do próprio DSH.',
1185
1276
  'opt.auto': 'Revisão automática',
1186
1277
  'opt.auto.desc': 'Quando ligado, o comportamento é o de sempre: uma revisão é criada a cada compactação e injetada no contexto e no prompt do sistema conforme as opções abaixo. Quando desligado, criação e injeção param e todas as opções abaixo ficam somente leitura.',
1187
- 'opt.auto.off': 'A revisão está desligada, então arquivos de revisão não são criados nem injetados. Se você não tem outro plugin de memória nem um fluxo de revisões, ligue esta opção.'
1278
+ 'opt.auto.off': 'A revisão está desligada, então arquivos de revisão não são criados nem injetados. Se você não tem outro plugin de memória nem um fluxo de revisões, ligue esta opção.',
1279
+ 'si.import': 'Importar',
1280
+ 'si.target': 'Workspace de destino',
1281
+ 'si.preview': function (id, cwd) { return 'Sessão no pacote: ' + id + '\nDiretório de trabalho: ' + cwd },
1282
+ 'si.previewTarget': function (title, path) { return 'Importar para: ' + (title || path) + ' (' + path + ')' },
1283
+ 'si.branchWarn': 'Este id já existe no workspace de destino: a importação usará um id novo e a pendurará como ramo dessa sessão, sem tocar na original.',
1284
+ 'si.renameWarn': 'Este id já está em outro workspace: a importação usa um id novo e não toca no original.',
1285
+ 'si.counts': function (m, f, s) { return 'O pacote tem ' + m + ' imagem(ns), ' + f + ' arquivo(s) e ' + s + ' sessão(ões) de subagente.' },
1286
+ 'si.confirm': 'Importar',
1287
+ 'si.cancel': 'Cancelar',
1288
+ 'si.done': function (id, m, f) { return 'Importado ' + id + '; ' + m + ' imagem(ns), ' + f + ' arquivo(s).' },
1289
+ 'si.doneRenamed': function (id, old) { return 'Importado com id novo ' + id + ' (antes ' + old + '); o original ficou intacto.' },
1290
+ 'si.noTarget': 'Nenhum workspace de destino: crie um no DSH primeiro.',
1291
+ 'si.noZstd': 'Este Node não tem zstdCompress; não dá para gravar logs de sessão, a importação está indisponível.'
1188
1292
  }
1189
1293
  }
1190
1294
 
@@ -1200,16 +1304,12 @@ window.__ModuleLoader__.load({
1200
1304
  return value === undefined ? key : value
1201
1305
  }
1202
1306
 
1203
- // 右侧拖条:::-webkit-scrollbar 是伪元素,内联样式改不到,只能注入一段真 CSS。
1204
- // 四个滚动容器共用 .recall-scroll 这个 class。
1307
+ // 0.6.2:滑条改成插件自绘(见 ScrollBox)。
1308
+ // 原生 ::-webkit-scrollbar 在触屏上根本拖不动:手指按在滑条上既不跟手、也不滚,
1309
+ // 鼠标上去倒是正常 —— 所以把原生滑条整个隐藏,由 pointer 事件自己画、自己拖。
1205
1310
  var SCROLL_CSS = [
1206
- '.recall-scroll { overflow-y: auto; overscroll-behavior: contain; }',
1207
- '.recall-scroll::-webkit-scrollbar { width: 20px; height: 20px; }',
1208
- '.recall-scroll::-webkit-scrollbar-button { display: none; width: 0; height: 0; }',
1209
- '.recall-scroll::-webkit-scrollbar-track { background: transparent; }',
1210
- '.recall-scroll::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,.38); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; min-height: 48px; }',
1211
- '.recall-scroll::-webkit-scrollbar-thumb:active { background-color: rgba(0,0,0,.62); }',
1212
- '.recall-scroll::-webkit-scrollbar-corner { background: transparent; }'
1311
+ '.seal-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }',
1312
+ '.seal-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }'
1213
1313
  ].join('')
1214
1314
 
1215
1315
  /** 只注入一次;没有 document 的环境直接跳过。 */
@@ -1227,6 +1327,7 @@ window.__ModuleLoader__.load({
1227
1327
  // 2. border 简写与 borderColor 不能混用 —— 撤销时 removeProperty 会回退到 currentColor(黑框);
1228
1328
  // 所以归档左边条用一个独立的绝对定位子元素画虚线,完全不碰行的 border。
1229
1329
  var S = {
1330
+ // 0.6.2:整页只留这一条滑条 —— 插件设置区自己滚,填满宿主内容面板的高度。
1230
1331
  wrap: { display: 'flex', flexDirection: 'column', gap: 12, minHeight: 0 },
1231
1332
  head: { display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', gap: 10 },
1232
1333
  h1: { fontSize: 15, fontWeight: 600 },
@@ -1235,7 +1336,9 @@ window.__ModuleLoader__.load({
1235
1336
  tab: { padding: '6px 14px', borderRadius: 8, border: '1px solid transparent', background: 'transparent', cursor: 'pointer', fontSize: 14, color: 'inherit', opacity: 0.62 },
1236
1337
  tabOn: { padding: '6px 14px', borderRadius: 8, border: '1px solid #e5e5e5', background: '#f6f6f6', cursor: 'pointer', fontSize: 14, color: 'inherit', opacity: 1, fontWeight: 600 },
1237
1338
  ws: { fontSize: 12, opacity: 0.6, margin: '12px 0 6px', fontFamily: 'ui-monospace, monospace' },
1238
- list: { display: 'flex', flexDirection: 'column', gap: 6, maxHeight: '42vh', overflowY: 'auto' },
1339
+ // 0.6.2:会话列表不再各自套一个 42vh 滚动框(每个工作区一条分滑条)。
1340
+ // 整个「会话」页只留 S.page 一个滚动框,列表和下面三颗按钮一起在里面滚。
1341
+ list: { display: 'flex', flexDirection: 'column', gap: 6 },
1239
1342
  row: { position: 'relative', display: 'flex', alignItems: 'center', gap: 8, padding: '9px 12px', borderRadius: 10, border: '1px solid #e5e5e5', cursor: 'pointer', fontSize: 13, background: 'transparent', color: 'inherit', textAlign: 'left', width: '100%', boxSizing: 'border-box', outline: 'none', boxShadow: 'none', WebkitTapHighlightColor: 'transparent', userSelect: 'none' },
1240
1343
  rowOn: { background: 'rgba(64,120,255,0.12)', border: '1px solid #4078ff' },
1241
1344
  leftBar: { position: 'absolute', left: 0, top: 0, bottom: 0, width: 0, borderLeft: '1px dashed #9a9a9a', pointerEvents: 'none' },
@@ -1245,10 +1348,14 @@ window.__ModuleLoader__.load({
1245
1348
  muted: { opacity: 0.62 },
1246
1349
  badge: { fontSize: 10, padding: '1px 6px', borderRadius: 999, border: '1px dashed #9a9a9a', opacity: 0.8, flex: '0 0 auto' },
1247
1350
  footer: { display: 'flex', gap: 10, paddingTop: 12, borderTop: '1px solid #e5e5e5', marginTop: 12 },
1351
+ // 0.6.2:会话页头(导入 / 删除 / 删除并回顾)。原先在页底,要滚到底才够得着。
1352
+ sessionBar: { display: 'flex', gap: 10, flexWrap: 'wrap', paddingBottom: 12, borderBottom: '1px solid #e5e5e5' },
1248
1353
  btn: { padding: '8px 16px', borderRadius: 9, border: '1px solid #e5e5e5', background: '#f6f6f6', cursor: 'pointer', fontSize: 13, color: 'inherit' },
1249
1354
  btnDanger: { padding: '8px 16px', borderRadius: 9, border: '1px solid #d9534f', background: 'transparent', color: '#d9534f', cursor: 'pointer', fontSize: 13 },
1250
1355
  btnOff: { padding: '8px 16px', borderRadius: 9, border: '1px solid #e5e5e5', background: 'transparent', color: 'inherit', opacity: 0.35, cursor: 'not-allowed', fontSize: 13 },
1251
1356
  note: { fontSize: 12, opacity: 0.6, minHeight: 18 },
1357
+ // 页脚状态区(0.6.2):回执/报错固定在页底,不再混在正文最后一行。
1358
+ status: { display: 'flex', flexDirection: 'column', gap: 4, paddingTop: 8, borderTop: '1px solid #ececec', marginTop: 6 },
1252
1359
  err: { fontSize: 12, color: '#d9534f', minHeight: 18 },
1253
1360
  chip: { fontSize: 11, padding: '1px 7px', borderRadius: 999, border: '1px solid #ddd', opacity: 0.85, flex: '0 0 auto' },
1254
1361
  // 锁定过的深度用实心蓝底,跟普通灰框一眼分得开(锁定意味着不再衰减)。
@@ -1268,10 +1375,13 @@ window.__ModuleLoader__.load({
1268
1375
  disc: { display: 'flex', alignItems: 'center' },
1269
1376
  discBtn: { width: '100%', display: 'flex', alignItems: 'center', gap: 8, padding: '10px 12px', borderRadius: 10, border: '1px solid #e5e5e5', background: '#f6f6f6', cursor: 'pointer', fontSize: 13, color: 'inherit', textAlign: 'left', boxSizing: 'border-box', outline: 'none' },
1270
1377
  caret: { fontSize: 11, opacity: 0.6, width: 12, flex: '0 0 auto' },
1271
- page: { maxHeight: '60vh', overflowY: 'auto', overscrollBehavior: 'contain' },
1378
+ // 0.6.2:页面级滑条删掉,滚动交给外层 wrap;这里只保证能收缩。
1379
+ page: { minHeight: 0 },
1272
1380
  // 选项页内容一屏装得下:不套 60vh 滚动框,右侧就不会多出一道拉条(0.2.1)。
1273
1381
  pageFlat: { minHeight: 0 },
1274
- preWide: { whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 12, lineHeight: 1.6, background: '#f8f8f8', border: '1px solid #e5e5e5', borderRadius: 10, padding: 12, maxHeight: '52vh', overflowY: 'auto', fontFamily: 'inherit' },
1382
+ // 0.6.2:右边留 24px,让预览框的滑条和整页滑条之间有一道空隙(两条滑条不再紧贴/重叠)。
1383
+ // 0.6.2:高度上限与外边距交给 ScrollBox 的外层(boxStyle),这里只管字体和配色。
1384
+ preWide: { whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 12, lineHeight: 1.6, background: '#f8f8f8', border: '1px solid #e5e5e5', borderRadius: 10, padding: 12, fontFamily: 'inherit' },
1275
1385
  // 选项页:一组一块,标签在左、开关/下拉在右。
1276
1386
  optGroup: { fontSize: 12, opacity: 0.6, paddingBottom: 6, borderBottom: '1px solid #ececec', marginTop: 6 },
1277
1387
  optRow: { display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 14, padding: '10px 0', borderBottom: '1px solid #f4f4f4' },
@@ -1281,7 +1391,10 @@ window.__ModuleLoader__.load({
1281
1391
  // 全量加载开启后整段警示标红:不用 0.62 透明度,红字要压得住。
1282
1392
  optDescWarn: { fontSize: 12, lineHeight: 1.55, color: '#d9534f', fontWeight: 600 },
1283
1393
  // 「自创工具」页的预览框:等宽、可折行,自己的高度上限里滚,不撑破整页。
1284
- expPre: { margin: 0, whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 12, lineHeight: 1.6, fontFamily: 'ui-monospace, monospace', background: '#f8f8f8', border: '1px solid #e5e5e5', borderRadius: 10, padding: 12, maxHeight: '38vh', overflowY: 'auto' },
1394
+ // 0.6.2:margin 不能写成 0,否则会把右侧 24px 的滑条空隙一起覆盖掉。
1395
+ // 0.6.2:同上,maxHeight / marginRight 由 ScrollBox 的 boxStyle 给;
1396
+ // margin 必须显式写 0,否则 pre 的 UA 外边距会把预览框顶下去一截。
1397
+ expPre: { margin: 0, whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 12, lineHeight: 1.6, fontFamily: 'ui-monospace, monospace', background: '#f8f8f8', border: '1px solid #e5e5e5', borderRadius: 10, padding: 12 },
1285
1398
  // 大类标题 + 问号(0.3.10):问号贴着标题,气泡以它为锚点弹出来。
1286
1399
  // 标题本身 0.6 透明(S.groupTitle),外层不透明——否则气泡里的字也被压淡。
1287
1400
  groupHead: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap', opacity: 1 },
@@ -1290,7 +1403,7 @@ window.__ModuleLoader__.load({
1290
1403
  helpBtn: { width: 16, height: 16, padding: 0, lineHeight: '14px', borderRadius: 999, border: '1px solid #c9c9c9', background: 'transparent', color: 'inherit', fontSize: 11, cursor: 'pointer', opacity: 0.75, flex: '0 0 auto' },
1291
1404
  helpBtnOn: { width: 16, height: 16, padding: 0, lineHeight: '14px', borderRadius: 999, border: '1px solid #4078ff', background: 'transparent', color: '#4078ff', fontSize: 11, cursor: 'pointer', fontWeight: 600, flex: '0 0 auto' },
1292
1405
  // 气泡压在下面的行上面:绝对定位 + zIndex,不改任何父容器的定位与溢出。
1293
- helpBubble: { position: 'absolute', top: '135%', left: 0, zIndex: 60, width: 400, maxWidth: '76vw', padding: '10px 12px', borderRadius: 10, border: '1px solid #d6d6d6', background: '#f8f8f8', color: 'inherit', boxShadow: '0 6px 20px rgba(0,0,0,.18)', fontSize: 12, lineHeight: 1.65, whiteSpace: 'pre-wrap', wordBreak: 'break-word', textAlign: 'left', fontWeight: 'normal', maxHeight: '46vh', overflowY: 'auto' },
1406
+ helpBubble: { position: 'absolute', top: '135%', left: 0, zIndex: 60, width: 400, maxWidth: '76vw', padding: '10px 12px', borderRadius: 10, border: '1px solid #d6d6d6', background: '#f8f8f8', color: 'inherit', boxShadow: '0 6px 20px rgba(0,0,0,.18)', fontSize: 12, lineHeight: 1.65, whiteSpace: 'pre-wrap', wordBreak: 'break-word', textAlign: 'left', fontWeight: 'normal' },
1294
1407
  // 工具组目录那一行:等宽、可选中复制(路径要能被人直接拿去用)。
1295
1408
  pathLine: { fontSize: 12, fontFamily: 'ui-monospace, monospace', opacity: 0.72, wordBreak: 'break-all', margin: '2px 0 0', userSelect: 'text' },
1296
1409
  swOn: { flex: '0 0 auto', padding: '5px 12px', borderRadius: 999, border: '1px solid #4078ff', background: '#4078ff', color: '#fff', fontSize: 12, fontWeight: 600, cursor: 'pointer' },
@@ -1511,6 +1624,146 @@ window.__ModuleLoader__.load({
1511
1624
  }))
1512
1625
  }
1513
1626
 
1627
+ // 0.6.2:自绘滑条。原生 ::-webkit-scrollbar 在触屏上拖不动,所以隐藏原生滑条,
1628
+ // 由这里用 pointer 事件接管:拇指位移 dy → 滚动 dy × (scrollHeight-clientHeight)/(轨道高-拇指高),
1629
+ // 拇指与手指 1:1 跟手;只滚自己这一层,鼠标和触屏都一样。
1630
+ var RAIL_W = 20
1631
+
1632
+ function ScrollBox(props) {
1633
+ var scrollRef = React.useRef(null)
1634
+ var railRef = React.useRef(null)
1635
+ var vs = React.useState({ sh: 0, ch: 0, top: 0, track: 0 })
1636
+ var view = vs[0], setView = vs[1]
1637
+ var drag = React.useRef(null)
1638
+ var hs = React.useState(false)
1639
+ var hot = hs[0], setHot = hs[1]
1640
+
1641
+ function measure() {
1642
+ var el = scrollRef.current
1643
+ if (!el) return
1644
+ // 轨道高要实测:预览框的 pre 有 padding/border,clientHeight 会比轨道短一截。
1645
+ var next = { sh: el.scrollHeight, ch: el.clientHeight, top: el.scrollTop, track: railRef.current ? railRef.current.clientHeight : 0 }
1646
+ setView(function (prev) {
1647
+ if (prev.sh === next.sh && prev.ch === next.ch && prev.top === next.top && prev.track === next.track) return prev
1648
+ return next
1649
+ })
1650
+ }
1651
+
1652
+ function setTop(v) {
1653
+ var el = scrollRef.current
1654
+ if (!el) return
1655
+ var range = el.scrollHeight - el.clientHeight
1656
+ if (range < 0) range = 0
1657
+ if (v < 0) v = 0
1658
+ if (v > range) v = range
1659
+ el.scrollTop = v
1660
+ }
1661
+
1662
+ React.useEffect(function () {
1663
+ var el = scrollRef.current
1664
+ if (!el) return
1665
+ measure()
1666
+ var ro = typeof ResizeObserver === 'function' ? new ResizeObserver(measure) : null
1667
+ if (ro) {
1668
+ ro.observe(el)
1669
+ Array.prototype.forEach.call(el.children, function (c) { ro.observe(c) })
1670
+ }
1671
+ var mo = typeof MutationObserver === 'function' ? new MutationObserver(measure) : null
1672
+ if (mo) mo.observe(el, { childList: true, subtree: true, characterData: true })
1673
+ return function () {
1674
+ if (ro) ro.disconnect()
1675
+ if (mo) mo.disconnect()
1676
+ }
1677
+ }, [])
1678
+
1679
+ // 每次渲染后再量一次:切标签、展开工作区、导入回执都会改内容高度。
1680
+ React.useEffect(function () { measure() })
1681
+
1682
+ var sh = view.sh, ch = view.ch, top = view.top
1683
+ var can = sh - ch > 1
1684
+ var trackH = view.track > 0 ? view.track : ch
1685
+ var thumbH = can ? Math.max(48, Math.round(trackH * ch / sh)) : 0
1686
+ if (thumbH > trackH) thumbH = trackH
1687
+ var maxThumb = trackH - thumbH
1688
+ var thumbTop = can && maxThumb > 0 ? Math.min(maxThumb, Math.round(maxThumb * top / (sh - ch))) : 0
1689
+
1690
+ function thumbDown(e) {
1691
+ if (!can) return
1692
+ e.preventDefault()
1693
+ e.stopPropagation()
1694
+ setHot(true)
1695
+ try { e.currentTarget.setPointerCapture(e.pointerId) } catch (err) { /* 老浏览器:退化为普通拖动 */ }
1696
+ drag.current = { y: e.clientY, top: scrollRef.current ? scrollRef.current.scrollTop : 0 }
1697
+ }
1698
+
1699
+ function thumbMove(e) {
1700
+ var d = drag.current
1701
+ if (!d) return
1702
+ e.preventDefault()
1703
+ e.stopPropagation()
1704
+ var range = sh - ch
1705
+ if (range <= 0) return
1706
+ setTop(d.top + (maxThumb > 0 ? (e.clientY - d.y) * range / maxThumb : 0))
1707
+ }
1708
+
1709
+ function thumbUp(e) {
1710
+ if (!drag.current) return
1711
+ drag.current = null
1712
+ setHot(false)
1713
+ try { e.currentTarget.releasePointerCapture(e.pointerId) } catch (err) { /* 同上 */ }
1714
+ }
1715
+
1716
+ function railDown(e) {
1717
+ if (!can) return
1718
+ e.preventDefault()
1719
+ e.stopPropagation()
1720
+ var box = e.currentTarget.getBoundingClientRect()
1721
+ var pos = maxThumb > 0 ? (e.clientY - box.top - thumbH / 2) / maxThumb : 0
1722
+ if (pos < 0) pos = 0
1723
+ if (pos > 1) pos = 1
1724
+ setTop(pos * (sh - ch))
1725
+ }
1726
+
1727
+ var rail = can ? h('div', {
1728
+ ref: railRef,
1729
+ style: { flex: '0 0 ' + RAIL_W + 'px', width: RAIL_W, position: 'relative', touchAction: 'none', zIndex: 5 },
1730
+ onPointerDown: railDown,
1731
+ role: 'scrollbar',
1732
+ 'aria-orientation': 'vertical',
1733
+ 'aria-valuenow': Math.round(top),
1734
+ 'aria-valuemin': 0,
1735
+ 'aria-valuemax': Math.max(0, sh - ch)
1736
+ },
1737
+ h('div', {
1738
+ style: {
1739
+ position: 'absolute', right: 2, top: thumbTop, width: RAIL_W - 4, height: thumbH,
1740
+ borderRadius: 20, background: hot ? 'rgba(0,0,0,.62)' : 'rgba(0,0,0,.38)',
1741
+ touchAction: 'none', userSelect: 'none', WebkitUserSelect: 'none'
1742
+ },
1743
+ onPointerDown: thumbDown,
1744
+ onPointerMove: thumbMove,
1745
+ onPointerUp: thumbUp,
1746
+ onPointerCancel: thumbUp
1747
+ })
1748
+ ) : null
1749
+ // 不滚动时轨道也占 20px,内容宽度不会来回跳。
1750
+ var railBox = rail || h('div', { style: { flex: '0 0 ' + RAIL_W + 'px', width: RAIL_W } })
1751
+
1752
+ return h('div', { style: Object.assign({ position: 'relative', display: 'flex', flexDirection: 'column', minHeight: 0 }, props.boxStyle || {}) },
1753
+ h('div', { style: { display: 'flex', flexDirection: 'row', flex: '1 1 auto', minHeight: 0 } },
1754
+ h(props.as || 'div', {
1755
+ ref: scrollRef,
1756
+ className: 'seal-scroll',
1757
+ style: Object.assign({ flex: '1 1 auto', minWidth: 0, minHeight: 0 }, props.style || {}),
1758
+ onScroll: measure
1759
+ }, props.children),
1760
+ railBox
1761
+ ),
1762
+ // 0.6.2:页脚状态区固定在这一层(不随正文滚),「已保存」这类回执才落在页底。
1763
+ props.footer || null
1764
+ )
1765
+ }
1766
+
1514
1767
  function Section(props) {
1515
1768
  var hasHost = props !== null && props !== undefined && typeof props.useSessions === 'function'
1516
1769
  return hasHost ? h(SectionHost, props) : h(SectionFallback)
@@ -1537,12 +1790,18 @@ window.__ModuleLoader__.load({
1537
1790
  var tab = t[0], setTab = t[1]
1538
1791
  var sel = React.useState(null)
1539
1792
  var selected = sel[0], setSelected = sel[1]
1793
+ // 0.6.2:会话页的工作区默认收起,点列表头展开;展开状态按 cwd 记。
1794
+ var wso = React.useState({})
1795
+ var wsOpen = wso[0], setWsOpen = wso[1]
1540
1796
  var rng = React.useState(null)
1541
1797
  var range = rng[0], setRange = rng[1]
1542
1798
  // 回执(0.5.1):带上它属于哪个标签。以前是一条全页共享的字符串,而那一行
1543
1799
  // 渲染在标签内容区外面,所以在「选项」页存完设置、切到别的页也能看见「已保存」。
1544
1800
  var nt = React.useState(null); var note = nt[0], setNote = nt[1]
1545
- var err = React.useState(''); var setErr = err[1]
1801
+ // 报错只属于产生它的那一页(0.6.1):以前它是全页一条字符串、渲染在标签内容区外面,
1802
+ // 于是「会话」页的报错在四个页都显示。现在带上标签,切过去就看不见别人的错。
1803
+ var err = React.useState(null); var errState = err[0]
1804
+ function setErr(text) { err[1](text ? { tab: tab, text: String(text) } : null) }
1546
1805
  var ldi = React.useState(null); var loadInfo = ldi[0], setLoadInfo = ldi[1]
1547
1806
  var op = React.useState(false); var open = op[0], setOpen = op[1]
1548
1807
  var mp = React.useState(null); var memPick = mp[0], setMemPick = mp[1]
@@ -1571,13 +1830,20 @@ window.__ModuleLoader__.load({
1571
1830
  var cca = React.useState(false); var clearArmed = cca[0], setClearArmed = cca[1]
1572
1831
  var ccn = React.useState(''); var cacheNote = ccn[0], setCacheNote = ccn[1]
1573
1832
  var fileInput = React.useRef(null)
1833
+ // 「会话导入」(0.6.1):会话页最左边那颗按钮。包、预演结果、目标工作区、回执。
1834
+ var sif = React.useState(null); var sessionFile = sif[0], setSessionFile = sif[1]
1835
+ var sip = React.useState(null); var sessionPlan = sip[0], setSessionPlan = sip[1]
1836
+ var sit = React.useState(''); var sessionTarget = sit[0], setSessionTarget = sit[1]
1837
+ var sin = React.useState(''); var sessionNote = sin[0], setSessionNote = sin[1]
1838
+ var sib = React.useState(false); var sessionBusy = sib[0], setSessionBusy = sib[1]
1839
+ var sessionFileInput = React.useRef(null)
1574
1840
 
1575
1841
  var load = React.useCallback(async function () {
1576
1842
  try {
1577
1843
  var res = await fetch(API + 'state')
1578
1844
  var json = await res.json()
1579
1845
  if (!res.ok) throw new Error((json.error && json.error.message) || ('HTTP ' + res.status))
1580
- setData({ loading: false, error: '', workspaces: json.workspaces || [], capabilities: json.capabilities || null })
1846
+ setData({ loading: false, error: '', workspaces: json.workspaces || [], targets: json.targets || [], capabilities: json.capabilities || null })
1581
1847
  if (json.options) setOptions(json.options)
1582
1848
  return json
1583
1849
  } catch (e) {
@@ -1589,6 +1855,7 @@ window.__ModuleLoader__.load({
1589
1855
  React.useEffect(function () { load() }, [])
1590
1856
 
1591
1857
  // 切标签就把上一页的回执和「举刀」状态收掉:它们只属于生成它们的那一页(0.5.1)。
1858
+ // 报错按页留着(0.6.1):切走看不见,切回来还在——它不是回执,是「这页哪一步坏了」。
1592
1859
  React.useEffect(function () { setNote(null); setClearArmed(false) }, [tab])
1593
1860
 
1594
1861
  var selectedWorkspace = selected
@@ -1612,6 +1879,14 @@ window.__ModuleLoader__.load({
1612
1879
  /** 写一条本页回执:记下当前标签。切页时由下面的 effect 清掉。 */
1613
1880
  function showNote(text) { setNote({ tab: tab, text: text }) }
1614
1881
 
1882
+ /** 0.6.2:会话页工作区折叠 —— 点列表头展开/收起,默认全部收起。 */
1883
+ function toggleWs(cwd) {
1884
+ var next = Object.assign({}, wsOpen)
1885
+ if (next[cwd]) delete next[cwd]
1886
+ else next[cwd] = true
1887
+ setWsOpen(next)
1888
+ }
1889
+
1615
1890
  // 换会话就把上一轮的选择清掉,否则会拿着旧工作区的选中项继续显示。
1616
1891
  React.useEffect(function () {
1617
1892
  setSelected(null); setMemPick(null); setRange(null); setConfirming(''); setNote(null)
@@ -1726,6 +2001,96 @@ window.__ModuleLoader__.load({
1726
2001
  } finally { setBusy(false) }
1727
2002
  }
1728
2003
 
2004
+ /* ── 会话导入(0.6.1)──────────────────────────────────────
2005
+ 会话页最左边的「导入」:选一个 dsh-session-<id>.zip,先预演(不写盘),
2006
+ 确认之后才真装。目标工作区用 id 传,服务端只信 id、不信界面上的路径。 */
2007
+
2008
+ function importTargetsOf() { return Array.isArray(data.targets) ? data.targets : [] }
2009
+
2010
+ /** 默认目标:当前会话所在的工作区 > 第一个。 */
2011
+ function defaultImportTarget() {
2012
+ var list = importTargetsOf()
2013
+ if (list.length === 0) return ''
2014
+ var cur = currentWorkspace && currentWorkspace.cwd
2015
+ for (var i = 0; i < list.length; i++) if (list[i].path === cur) return list[i].id
2016
+ return list[0].id
2017
+ }
2018
+
2019
+ function sessionImportUrl(dryRun, target) {
2020
+ return API + 'session-import?workspaceId=' + encodeURIComponent(target || '') + (dryRun ? '&dryRun=1' : '')
2021
+ }
2022
+
2023
+ /** 预演:只报会碰到谁、要不要换 id,一个字节都不写。 */
2024
+ async function previewSessionImport(entry, target) {
2025
+ var res = await fetch(sessionImportUrl(true, target), {
2026
+ method: 'POST',
2027
+ headers: { 'Content-Type': 'application/zip' },
2028
+ body: entry.file
2029
+ })
2030
+ var json = await res.json()
2031
+ if (!res.ok) throw new Error((json.error && json.error.message) || ('HTTP ' + res.status))
2032
+ setSessionPlan(json)
2033
+ }
2034
+
2035
+ function pickSessionZip() {
2036
+ if (isBusy || sessionBusy) return
2037
+ setErr(''); setSessionNote(''); setSessionPlan(null); setSessionFile(null)
2038
+ var target = sessionTarget || defaultImportTarget()
2039
+ setSessionTarget(target)
2040
+ if (target === '') { setErr(tr('si.noTarget')); return }
2041
+ var el = sessionFileInput.current
2042
+ if (el) { el.value = ''; el.click() }
2043
+ }
2044
+
2045
+ async function onSessionZipChosen(ev) {
2046
+ var file = ev && ev.target && ev.target.files && ev.target.files[0]
2047
+ if (!file) return
2048
+ setSessionBusy(true); setErr(''); setSessionNote(''); setSessionPlan(null)
2049
+ var entry = { name: file.name, file: file }
2050
+ setSessionFile(entry)
2051
+ try { await previewSessionImport(entry, sessionTarget) }
2052
+ catch (e) { setSessionFile(null); setErr(String(e.message || e)) }
2053
+ finally { setSessionBusy(false) }
2054
+ }
2055
+
2056
+ /** 换目标工作区:撞号结果跟着目标变,重新预演一遍。 */
2057
+ async function onSessionTargetChange(id) {
2058
+ setSessionTarget(id)
2059
+ if (!sessionFile) return
2060
+ setSessionBusy(true); setErr('')
2061
+ try { await previewSessionImport(sessionFile, id) }
2062
+ catch (e) { setSessionPlan(null); setErr(String(e.message || e)) }
2063
+ finally { setSessionBusy(false) }
2064
+ }
2065
+
2066
+ async function confirmSessionImport() {
2067
+ if (sessionBusy || !sessionFile || !sessionPlan) return
2068
+ var plan = sessionPlan
2069
+ setSessionBusy(true); setErr(''); setSessionNote('')
2070
+ try {
2071
+ var res = await fetch(sessionImportUrl(false, sessionTarget), {
2072
+ method: 'POST',
2073
+ headers: { 'Content-Type': 'application/zip' },
2074
+ body: sessionFile.file
2075
+ })
2076
+ var json = await res.json()
2077
+ if (!res.ok) throw new Error((json.error && json.error.message) || ('HTTP ' + res.status))
2078
+ var got = json.session || {}
2079
+ setSessionNote(got.renamed
2080
+ ? tr('si.doneRenamed', got.id, got.originalId)
2081
+ : tr('si.done', got.id, (json.counts && json.counts.media) || 0, (json.counts && json.counts.files) || 0))
2082
+ setSessionPlan(null); setSessionFile(null)
2083
+ await load()
2084
+ if (got.id) setSelected({ id: got.id, cwd: got.cwd || plan.workspace.path })
2085
+ } catch (e) { setErr(String(e.message || e)) }
2086
+ finally { setSessionBusy(false) }
2087
+ }
2088
+
2089
+ function closeSessionDialog() {
2090
+ if (sessionBusy) return
2091
+ setSessionPlan(null); setSessionFile(null)
2092
+ }
2093
+
1729
2094
  /**
1730
2095
  * 导出:让宿主把 toolSequence.zip 直接写进当前会话所在的工作区文件夹。
1731
2096
  * 落点由宿主算(它拿得到真实路径),界面只负责把它念出来。
@@ -1837,6 +2202,53 @@ window.__ModuleLoader__.load({
1837
2202
  )
1838
2203
  }
1839
2204
 
2205
+ // Esc 关会话导入弹窗(0.6.1):和工具导入一样只认 Esc,不劫持遮罩点击。
2206
+ React.useEffect(function () {
2207
+ if (sessionPlan === null) return undefined
2208
+ if (typeof document === 'undefined' || typeof document.addEventListener !== 'function') return undefined
2209
+ function onKey(e) { if (e && e.key === 'Escape') closeSessionDialog() }
2210
+ document.addEventListener('keydown', onKey)
2211
+ return function () { document.removeEventListener('keydown', onKey) }
2212
+ }, [sessionPlan, sessionBusy])
2213
+
2214
+ /** 会话导入的确认弹窗(0.6.1):结构照工具导入那张,多一个目标工作区下拉。 */
2215
+ function sessionImportDialogView() {
2216
+ if (sessionPlan === null) return null
2217
+ var list = importTargetsOf()
2218
+ var plan = sessionPlan
2219
+ var busyNow = sessionBusy
2220
+ var options = list.map(function (w) { return [w.id, w.title || w.path] })
2221
+ return h('div', { style: S.modalOverlay, 'data-session-import-dialog': '1' },
2222
+ h('div', { style: S.modalBox, role: 'dialog', 'aria-modal': 'true' },
2223
+ h('p', { style: S.modalBody }, tr('si.preview', plan.session.originalId, plan.session.cwd)),
2224
+ list.length > 1
2225
+ ? h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
2226
+ h('span', { style: S.optLabel }, tr('si.target')),
2227
+ h(Select, { value: sessionTarget, options: options, onChange: onSessionTargetChange }))
2228
+ : null,
2229
+ h('p', { style: S.modalBody }, tr('si.previewTarget', plan.workspace.title || '', plan.workspace.path)),
2230
+ plan.session.willBranch ? h('p', { style: S.modalBody }, tr('si.branchWarn')) : null,
2231
+ plan.session.willRename && !plan.session.willBranch ? h('p', { style: S.modalBody }, tr('si.renameWarn')) : null,
2232
+ h('p', { style: S.modalBody }, tr('si.counts', plan.counts.media, plan.counts.files, plan.counts.subagents)),
2233
+ h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end', flexWrap: 'wrap' } },
2234
+ h('button', {
2235
+ type: 'button',
2236
+ style: busyNow ? S.btnOff : S.btnPrimary,
2237
+ disabled: busyNow,
2238
+ 'data-confirm-action': 'primary',
2239
+ onClick: confirmSessionImport
2240
+ }, tr('si.confirm')),
2241
+ h('button', {
2242
+ type: 'button',
2243
+ style: busyNow ? S.btnOff : S.btnGhost,
2244
+ disabled: busyNow,
2245
+ 'data-confirm-action': 'cancel',
2246
+ onClick: closeSessionDialog
2247
+ }, tr('si.cancel')))
2248
+ )
2249
+ )
2250
+ }
2251
+
1840
2252
  /**
1841
2253
  * 改一个或多个选项。落盘后把回顾页的预览与深度徽章全部作废重取:
1842
2254
  * 选项只改载入时的装配,不改载入文件里记下的深度,所以重取就能看到新内容。
@@ -1983,7 +2395,7 @@ window.__ModuleLoader__.load({
1983
2395
  h('div', { style: S.optGroup },
1984
2396
  tr('tl.preview') + (toolSequence !== null && toolSequence.bytes ? tr('tl.bytes', toolSequence.bytes) : '') +
1985
2397
  (on ? '' : ' ' + tr('tl.off'))),
1986
- h('pre', { className: 'recall-scroll', style: S.expPre }, preview),
2398
+ h(ScrollBox, { as: 'pre', style: S.expPre, boxStyle: { maxHeight: '38vh', marginRight: 24 } }, preview),
1987
2399
  h('div', { style: S.note }, tr('tl.note')),
1988
2400
  h('div', { style: S.note, 'data-tl-refresh': refreshMode },
1989
2401
  refreshMode === 'realtime' ? tr('tl.note.realtime') : tr('tl.note.newSession')),
@@ -2165,14 +2577,31 @@ window.__ModuleLoader__.load({
2165
2577
  for (var nz = 0; nz < data.workspaces.length; nz++) {
2166
2578
  if (data.workspaces[nz].sessions.some(function (x) { return x.digestCode === 'no-zstd' })) { noZstd = true; break }
2167
2579
  }
2168
- body = h('div', null,
2580
+ // 0.6.2:所有工作区的会话排进同一个列表,滚动交给外层整页(S.page)。
2581
+ // 每个工作区默认收起,点列表头展开;选中的工作区在收起状态下也留着蓝点。
2582
+ body = h('div', { style: S.list },
2169
2583
  noZstd ? h('div', { style: S.note }, tr('digest.noZstd')) : null,
2170
2584
  data.workspaces.map(function (ws) {
2171
2585
  if (ws.sessions.length === 0) return null
2172
2586
  var ac = ws.sessions.filter(function (x) { return x.archived }).length
2173
- return h('div', { key: ws.cwd },
2174
- h('div', { style: S.ws }, ws.cwd + (ac > 0 ? tr('ws.archived', ac) : '')),
2175
- h('div', { className: 'recall-scroll', style: S.list }, ws.sessions.map(function (sess) {
2587
+ var opens = wsOpen[ws.cwd] === true
2588
+ var hasSel = selected !== null && selected.cwd === ws.cwd
2589
+ return h('div', { key: ws.cwd, style: { display: 'flex', flexDirection: 'column', gap: 6 } },
2590
+ h('div', { style: S.disc },
2591
+ h('button', {
2592
+ style: S.discBtn,
2593
+ 'data-ws-head': ws.cwd,
2594
+ 'aria-expanded': opens ? 'true' : 'false',
2595
+ onClick: function () { toggleWs(ws.cwd) }
2596
+ },
2597
+ h('span', { style: S.caret }, opens ? '▾' : '▸'),
2598
+ h('span', { style: Object.assign({}, S.title, { textAlign: 'left' }) }, ws.cwd),
2599
+ hasSel ? h('span', { style: S.dotOn }) : null,
2600
+ ac > 0 ? h('span', { style: S.badge }, tr('ws.archived', ac)) : null,
2601
+ h('span', { style: { opacity: 0.55, flex: '0 0 auto', fontSize: 11 } }, String(ws.sessions.length))
2602
+ )
2603
+ ),
2604
+ opens ? ws.sessions.map(function (sess) {
2176
2605
  var on = selected && selected.id === sess.id
2177
2606
  return h(Row, {
2178
2607
  key: sess.id, title: sess.id, on: on, archived: sess.archived,
@@ -2182,7 +2611,7 @@ window.__ModuleLoader__.load({
2182
2611
  h('span', { style: Object.assign({}, S.title, sess.hasTitle ? {} : S.muted) }, sess.title),
2183
2612
  sess.archived ? h('span', { style: S.badge }, tr('badge.archived')) : null
2184
2613
  )
2185
- }))
2614
+ }) : null
2186
2615
  )
2187
2616
  }))
2188
2617
  } else {
@@ -2264,7 +2693,7 @@ window.__ModuleLoader__.load({
2264
2693
  ranged && shown.length === 0
2265
2694
  ? h('div', { style: S.note }, tr('range.empty', range.from, range.to))
2266
2695
  : null,
2267
- h('div', { className: 'recall-scroll', style: S.preWide }, memPick && !picked ? tr('loading') : boxText),
2696
+ h(ScrollBox, { style: S.preWide, boxStyle: { maxHeight: '52vh', marginRight: 24 } }, memPick && !picked ? tr('loading') : boxText),
2268
2697
  h('div', { style: { display: 'flex', justifyContent: 'flex-end' } },
2269
2698
  h('button', {
2270
2699
  style: !memPick || isBusy ? S.btnOff : S.btnDanger,
@@ -2286,18 +2715,34 @@ window.__ModuleLoader__.load({
2286
2715
  body)
2287
2716
  }
2288
2717
 
2289
- var footer = tab === 'sessions' ? h('div', { style: S.footer },
2718
+ // 「导入」在最左(0.6.1):删除 / 删除并回顾 这一行从左边加一颗按钮。
2719
+ // 宿主 Node 写不了 zstd 时这颗按钮明确变灰,并在会话页里说明原因。
2720
+ // 0.6.2:这一行从页底挪到页头 —— 不用滚到列表底部才够得着三颗按钮。
2721
+ var canImport = !(data.capabilities && data.capabilities.table && data.capabilities.table['zstd.compress'] === false)
2722
+ var sessionBar = tab === 'sessions' ? h('div', { style: S.sessionBar },
2723
+ h('button', {
2724
+ style: (isBusy || sessionBusy || !canImport) ? S.btnOff : S.btn,
2725
+ disabled: isBusy || sessionBusy || !canImport,
2726
+ 'data-session-import': '1',
2727
+ onClick: pickSessionZip
2728
+ }, tr('si.import')),
2290
2729
  h('button', { style: !selected || isBusy ? S.btnOff : S.btnDanger, disabled: !selected || isBusy, onClick: doDelete },
2291
2730
  confirming === 'delete' ? tr('btn.confirm') : tr('btn.delete')),
2292
2731
  h('button', { style: !selected || isBusy ? S.btnOff : S.btn, disabled: !selected || isBusy, onClick: doCompactDelete },
2293
2732
  isCompacting ? tr('btn.compacting') : (confirming === 'compact' ? tr('btn.confirmCompact') : tr('btn.deleteCompact')))
2294
2733
  ) : null
2295
2734
 
2296
- // 会话、回顾两页内容可能很长,仍走 .recall-scroll;选项页只四行,不要滚动框。
2297
- // 0.4.3:自创工具页多了导入/导出一块,整页不再保证一屏装得下,跟着一起滚。
2298
- var pageBox = tab === 'options'
2299
- ? h('div', { style: S.pageFlat }, body)
2300
- : h('div', { className: 'recall-scroll', style: S.page }, body)
2735
+ // 0.6.2:页面级滚动框全部删掉 —— 会话/自创工具/回顾/选项四页都在同一个
2736
+ // 整页滚动框(最外层 wrap 的 .recall-scroll)里滚,全插件只剩这一条页面滑条;
2737
+ // 预览框内部的滑条不动(自创工具、回顾各一条)。
2738
+ // 会话页自己的回执、弹窗与能力说明仍挂在页面里面:切到别页就一起消失。
2739
+ var pageInner = tab === 'sessions'
2740
+ ? h('div', null, body,
2741
+ canImport ? null : h('div', { style: S.note, 'data-session-import-off': '1' }, tr('si.noZstd')),
2742
+ sessionNote ? h('div', { style: S.note, 'data-session-import-note': '1' }, sessionNote) : null,
2743
+ sessionImportDialogView())
2744
+ : body
2745
+ var pageBox = h('div', { style: S.page }, pageInner)
2301
2746
 
2302
2747
  // E1:宿主能力不全时,在每页顶部都说清缺了什么、哪块被关了。
2303
2748
  var missingCaps = data.capabilities && data.capabilities.ok === false
@@ -2306,10 +2751,23 @@ window.__ModuleLoader__.load({
2306
2751
  ? h('div', { style: S.err }, tr('host.degraded', missingCaps.map(function (m) { return m.block }).join(', ')))
2307
2752
  : null
2308
2753
 
2309
- return h('div', { style: S.wrap },
2310
- head, tabs, capWarn, pageBox, footer,
2311
- note && note.tab === tab ? h('div', { style: S.note }, note.text) : null,
2312
- err[0] ? h('div', { style: S.err }, err[0]) : null
2754
+ // 0.6.2:回执(「已保存」等)和报错放进页脚状态区,固定在页底,不跟着正文滚。
2755
+ var footNote = note && note.tab === tab ? note.text : ''
2756
+ var footErr = errState && errState.tab === tab ? errState.text : ''
2757
+ var statusFoot = (footNote || footErr) ? h('div', { style: S.status, 'data-status': '1' },
2758
+ footNote ? h('div', { style: S.note }, footNote) : null,
2759
+ footErr ? h('div', { style: S.err }, footErr) : null
2760
+ ) : null
2761
+
2762
+ return h(ScrollBox, { style: S.wrap, boxStyle: { maxHeight: '100%' }, footer: statusFoot },
2763
+ head, tabs, capWarn, sessionBar, pageBox,
2764
+ h('input', {
2765
+ type: 'file',
2766
+ accept: '.zip,application/zip',
2767
+ style: { display: 'none' },
2768
+ ref: sessionFileInput,
2769
+ onChange: onSessionZipChosen
2770
+ })
2313
2771
  )
2314
2772
  }
2315
2773