@goodandready/dsh-time-machine 0.1.10 → 0.1.11

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 CHANGED
@@ -119,6 +119,11 @@ dsh-time-machine:
119
119
 
120
120
  ## 📋 Release Notes
121
121
 
122
+ ### v0.1.11 — Dual Sidebar Support: Native DSH Right Sidebar & BetterSidebar
123
+ * **Added in v0.1.11**: Support for native DSH Right Sidebar (`sidebarRightTabs` + `sidebar.right.pane.tab`) introduced in DSH 0.1.5-alpha.1, including guide page registration with custom icon.
124
+ * **Preserved in v0.1.11**: Legacy `betterSidebar` integration retained with deterministic surface-scoped registrations, preventing ID collisions or duplicate mounts when both surfaces exist.
125
+ * **Added in v0.1.11**: Graceful degradation to plugin settings card when neither sidebar surface is available.
126
+
122
127
  ### v0.1.10 — Stability, Dynamic CWD, Unified Diff & Architecture Polish
123
128
  * **Added in v0.1.10**: Dynamic / session-aware `cwd` resolution: TimeMachine tools and REST endpoints automatically locate the active session workspace or accept explicit target directory.
124
129
  * **Added in v0.1.10**: Unified diff support (`format: "patch" | "stat"`) with size limits (up to 256KB) and clean truncation warnings.
package/README.ru.md CHANGED
@@ -119,6 +119,11 @@ dsh-time-machine:
119
119
 
120
120
  ## 📋 История версий (Release Notes)
121
121
 
122
+ ### v0.1.11 — Поддержка нативного DSH Right Sidebar и legacy BetterSidebar
123
+ * **Added in v0.1.11**: Поддержка нативной правой панели DSH (`sidebarRightTabs` + слот `sidebar.right.pane.tab`), появившейся в DSH 0.1.5-alpha.1, включая регистрацию на странице Guide с иконкой.
124
+ * **Preserved in v0.1.11**: Полная обратная совместимость с `betterSidebar`; раздельные идентификаторы поверхностей исключают конфликты или двойное монтирование при совместном включении.
125
+ * **Added in v0.1.11**: Безопасный откат к карточке настроек плагина при отсутствии обеих боковых панелей в хосте.
126
+
122
127
  ### v0.1.10 — Стабильность, динамический CWD, Unified Diff и оптимизация архитектуры
123
128
  * **Added in v0.1.10**: Динамическое определение рабочей директории (`cwd`): инструменты и REST API автоматически определяют каталог активной сессии либо принимают явный путь.
124
129
  * **Added in v0.1.10**: Поддержка Unified Diff (`format: "patch" | "stat"`) с лимитом размера (до 256 КБ) и защитой от переполнения контекста.
package/README.zh.md CHANGED
@@ -94,6 +94,11 @@ dsh-time-machine:
94
94
 
95
95
  ## 📋 版本更新记录 (Release Notes)
96
96
 
97
+ ### v0.1.11 — 双侧边栏支持:原生 DSH 右侧边栏与 BetterSidebar
98
+ * **Added in v0.1.11**: 原生支持 DSH 0.1.5-alpha.1 引入的右侧边栏(`sidebarRightTabs` 注册与 `sidebar.right.pane.tab` 插槽),包含专属引导页卡片与图标。
99
+ * **Preserved in v0.1.11**: 保持对旧版 `betterSidebar` 的完全向后兼容;两种表面同时启用时互不干扰,杜绝重复挂载或 ID 冲突。
100
+ * **Added in v0.1.11**: 在两种侧边栏均缺失的环境下,安全降级至插件设置卡片。
101
+
97
102
  ### v0.1.10 — 稳定性、动态工作目录、统一 Diff 与架构优化
98
103
  * **Added in v0.1.10**: 动态工作区感知(`cwd`):时光机工具与 REST 接口自动关联当前会话目录或支持显式工作区路径。
99
104
  * **Added in v0.1.10**: 统一补丁支持(`format: "patch" | "stat"`),带输出截断保护(最大 256KB)。
package/lib/client.js CHANGED
@@ -65,6 +65,8 @@ window.__ModuleLoader__.load({
65
65
  unavailable: 'Settings unavailable',
66
66
  tabTitle: 'Time Machine',
67
67
  sidebarNotice: 'Checkpoints and timeline are available in the Time Machine sidebar tab.',
68
+ guideTitle: 'Time Machine',
69
+ guideDesc: 'Checkpoints, visual diffs and instant workspace rollback.',
68
70
  };
69
71
  const ru = {
70
72
  title: 'Машина времени и чекпоинты',
@@ -88,6 +90,8 @@ window.__ModuleLoader__.load({
88
90
  unavailable: 'Настройки недоступны',
89
91
  tabTitle: 'Машина времени',
90
92
  sidebarNotice: 'Лента чекпоинтов и управление снимками доступны во вкладке «Машина времени» боковой панели.',
93
+ guideTitle: 'Машина времени',
94
+ guideDesc: 'Чекпоинты, просмотр diff и мгновенный откат рабочего пространства.',
91
95
  };
92
96
  const zh = {
93
97
  title: '时光机与检查点',
@@ -111,6 +115,8 @@ window.__ModuleLoader__.load({
111
115
  unavailable: '设置不可用',
112
116
  tabTitle: '时光机',
113
117
  sidebarNotice: '检查点时间线与管理可在侧边栏“时光机”标签页中查看。',
118
+ guideTitle: '时光机',
119
+ guideDesc: '快照检查点、差异对比与即时工作区回滚。',
114
120
  };
115
121
 
116
122
  let ChevronIcon = null;
@@ -418,6 +424,85 @@ window.__ModuleLoader__.load({
418
424
  }
419
425
  }
420
426
  }
427
+
428
+ // Native DSH Right Sidebar (DSH >= 0.1.5-alpha.1)
429
+ let nativeTabRegistered = false;
430
+ const doRegisterNativeSidebar = (nctx) => {
431
+ if (nativeTabRegistered) return;
432
+ const reg = (nctx && nctx.sidebarRightTabs) || (nctx && nctx.get && (()=>{ try{return nctx.get('sidebarRightTabs')}catch{return null}})()) || ctx.sidebarRightTabs;
433
+ if (!reg || typeof reg.register !== 'function') return;
434
+ try {
435
+ const tNative = (ctx.locale && ctx.locale.bind) ? ctx.locale.bind(NS) : (k) => k;
436
+ const def = {
437
+ id: NS,
438
+ kind: 'time-machine',
439
+ priority: 'extension',
440
+ title: () => {
441
+ const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
442
+ return a.startsWith('zh') ? '时光机' : (a.startsWith('ru') ? 'Машина времени' : 'Time Machine');
443
+ },
444
+ guide: [{
445
+ order: 35,
446
+ title: () => {
447
+ const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
448
+ return a.startsWith('zh') ? '时光机' : (a.startsWith('ru') ? 'Машина времени' : 'Time Machine');
449
+ },
450
+ description: () => {
451
+ const a = (ctx.locale && ctx.locale.getSnapshot && ctx.locale.getSnapshot().active) || 'en';
452
+ return a.startsWith('zh') ? zh.guideDesc : (a.startsWith('ru') ? ru.guideDesc : en.guideDesc);
453
+ },
454
+ icon: (size) => React.createElement('svg', { width: size||16, height: size||16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' },
455
+ React.createElement('circle', { cx:12, cy:12, r:10 }),
456
+ React.createElement('polyline', { points:'12 6 12 12 16 14' })
457
+ )
458
+ }]
459
+ };
460
+
461
+ const unregDef = reg.register(def);
462
+ nativeTabRegistered = true;
463
+
464
+ // Register tab body in slot sidebar.right.pane.tab
465
+ const doRegisterPaneTab = () => {
466
+ try {
467
+ ctx.slots.register({
468
+ name: 'sidebar.right.pane.tab',
469
+ key: NS,
470
+ locale: NS,
471
+ inject: () => ({ ctx })
472
+ }, TimeMachineTab);
473
+ } catch (e) {
474
+ console.error('[dsh-time-machine] sidebar.right.pane.tab register failed', e);
475
+ }
476
+ };
477
+
478
+ if (ctx.slots && typeof ctx.slots.inject === 'function') {
479
+ try {
480
+ ctx.slots.inject('sidebar.right.pane.tab', () => {
481
+ doRegisterPaneTab();
482
+ });
483
+ } catch (e) {
484
+ doRegisterPaneTab();
485
+ }
486
+ } else {
487
+ doRegisterPaneTab();
488
+ }
489
+ } catch (e) {
490
+ console.error('[dsh-time-machine] native sidebarRightTabs register failed', e);
491
+ }
492
+ };
493
+
494
+ if (ctx.inject) {
495
+ try {
496
+ ctx.inject(['sidebarRightTabs'], (nctx) => {
497
+ doRegisterNativeSidebar(nctx);
498
+ return () => {};
499
+ });
500
+ } catch (e) {
501
+ if (!String(e && e.message || '').includes('not declared')) {
502
+ console.error('[dsh-time-machine] sidebarRightTabs inject failed', e);
503
+ }
504
+ }
505
+ }
421
506
  };
422
507
  return module.exports;
423
508
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-time-machine",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "DSH plugin for smart checkpoints, workspace safety guards, and instant rollback",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",