dsh-task-cat 1.0.1 → 1.0.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/README.md CHANGED
@@ -34,9 +34,10 @@ Harness 的桌面外壳并没有向插件开放窗口 API(preload 只暴露文
34
34
 
35
35
  行为细节:
36
36
 
37
- - 点一下桌面宠物 → 在**宠物正上方**弹出会话卡片,再点一下关闭(空间不够时自动翻到下方,并始终留在屏幕内)。卡片的层级和窗口内那份面板一致:标题「任务宠物」+ 一句话汇总 + 一句说明,下面依次是会话,每行是「状态点 + 标题 + 状态行 + 进度条」,当前打开的那一行用一张圆角卡片标出来,并带「· 当前会话」。状态点按类型上色(进行中=蓝色实心带呼吸光晕、待查看=琥珀、失败=红、已完成=绿、推进中但没在跑=薄荷空心、空闲=灰空心),状态行和窗口内那只宠物用的是同一句话(例如 `4m · 2/5 · bash`、`待查看`、`上次运行失败`),有 todo 的行下面还有一条进度条。清单**按最近更新排序**(新开的会话排在最上面),默认显示 **5 个**,更多的收在底部「还有 N 个会话…」里,点一下展开全部、再点收起。点其中一行跳到那个对话,并把 Harness 窗口带到前台。卡片跟随应用的浅色/深色主题(页面把当前明暗传给助手),不会出现深色卡片压在白底应用上。
37
+ - 点一下桌面宠物 → 在**宠物正上方**弹出会话卡片,再点一下关闭(空间不够时自动翻到下方,并始终留在屏幕内)。卡片的层级和窗口内那份面板一致:标题「任务宠物」+ 一句话汇总 + 一句说明,下面依次是会话,每行是「状态点 + 标题 + 状态行 + 进度条」,当前打开的那一行用一张圆角卡片标出来,并带「· 当前会话」。状态点按类型上色(进行中=蓝色实心带呼吸光晕、待查看=琥珀、失败=红、已完成=绿、推进中但没在跑=薄荷空心、空闲=灰空心),状态行和窗口内那只宠物用的是同一句话(例如 `4m · 2/5 · bash`、`待查看`、`上次运行失败`),有 todo 的行下面还有一条进度条。清单**先排需要你的**(待查看 → 进行中 → 其余按最近更新),所以「N 个待查看」里的那几个永远在最上面;待查看一行会写清是「待查看」还是「等你回答」。默认显示 **5 个**,更多的收在底部「还有 N 个会话…」里,点一下展开全部、再点收起。点其中一行跳到那个对话,并把 Harness 窗口带到前台。卡片跟随应用的浅色/深色主题(页面把当前明暗传给助手),不会出现深色卡片压在白底应用上。
38
38
  - 宠物本身下方也有一条细进度条,显示「点它就会跳到的那个会话」的完成度;不用打开清单就能看出走到哪一步了。
39
39
  - 按住拖动可换位置;位置记在 `$DSH_HOME/cache/dsh-task-pet/position.txt`,换屏、拔掉显示器后会自动拉回可视区域。
40
+ - 宠物右上角:琥珀色数字是「需要你」的会话数;同时有会话在跑时,数字左边会多一个蓝点,两个状态同时可见。
40
41
  - 菜单栏也有一项「任务宠物」:图标是那只宠物,待处理时带上数字,点开能看汇总和说明,以及隐藏 / 移到当前屏幕 / 打开 Harness。
41
42
  - 右键:动作菜单(打开 Harness / 移到当前屏幕 / 隐藏桌面宠物)。
42
43
  - 卡片不会抢焦点:鼠标移开卡片和宠物一会儿就自动收起,再点宠物也能收起。
package/client.js CHANGED
@@ -100,6 +100,8 @@ window.__ModuleLoader__.load({
100
100
  'list.step': '第 {step} 步',
101
101
  'list.goal': '目标:{objective}',
102
102
  'list.jump': '打开对话',
103
+ 'list.ask': '等你回答',
104
+ 'list.behind': 'N 个待查看',
103
105
  'list.more': '还有 {count} 个会话',
104
106
  'list.less': '收起',
105
107
  'empty.title': '暂无任务',
@@ -134,7 +136,8 @@ window.__ModuleLoader__.load({
134
136
  'list.current': 'Current session',
135
137
  'list.step': 'Step {step}',
136
138
  'list.goal': 'Goal: {objective}',
137
- 'list.jump': 'Open conversation',
139
+ 'list.ask': 'Waiting for your answer',
140
+ 'list.behind': '{count} need review',
138
141
  'list.more': '{count} more sessions',
139
142
  'list.less': 'Show less',
140
143
  'empty.title': 'No tasks yet',
@@ -169,7 +172,8 @@ window.__ModuleLoader__.load({
169
172
  'list.current': '現在の会話',
170
173
  'list.step': 'ステップ {step}',
171
174
  'list.goal': '目標:{objective}',
172
- 'list.jump': '会話を開く',
175
+ 'list.ask': '回答待ち',
176
+ 'list.behind': '未確認 {count} 件',
173
177
  'list.more': '他 {count} 件',
174
178
  'list.less': '折りたたむ',
175
179
  'empty.title': 'タスクはまだありません',
@@ -204,7 +208,8 @@ window.__ModuleLoader__.load({
204
208
  'list.current': 'Conversación actual',
205
209
  'list.step': 'Paso {step}',
206
210
  'list.goal': 'Objetivo: {objective}',
207
- 'list.jump': 'Abrir conversación',
211
+ 'list.ask': 'Esperando tu respuesta',
212
+ 'list.behind': '{count} por revisar',
208
213
  'list.more': '{count} conversaciones más',
209
214
  'list.less': 'Mostrar menos',
210
215
  'empty.title': 'Aún no hay tareas',
@@ -239,7 +244,8 @@ window.__ModuleLoader__.load({
239
244
  'list.current': 'Conversation actuelle',
240
245
  'list.step': 'Étape {step}',
241
246
  'list.goal': 'Objectif : {objective}',
242
- 'list.jump': 'Ouvrir la conversation',
247
+ 'list.ask': 'En attente de votre réponse',
248
+ 'list.behind': '{count} à vérifier',
243
249
  'list.more': '{count} autres conversations',
244
250
  'list.less': 'Afficher moins',
245
251
  'empty.title': 'Aucune tâche pour le moment',
@@ -274,7 +280,8 @@ window.__ModuleLoader__.load({
274
280
  'list.current': 'Aktuelle Unterhaltung',
275
281
  'list.step': 'Schritt {step}',
276
282
  'list.goal': 'Ziel: {objective}',
277
- 'list.jump': 'Unterhaltung öffnen',
283
+ 'list.ask': 'Wartet auf deine Antwort',
284
+ 'list.behind': '{count} zu prüfen',
278
285
  'list.more': '{count} weitere Unterhaltungen',
279
286
  'list.less': 'Weniger anzeigen',
280
287
  'empty.title': 'Noch keine Aufgaben',
@@ -309,7 +316,8 @@ window.__ModuleLoader__.load({
309
316
  'list.current': 'Текущий диалог',
310
317
  'list.step': 'Шаг {step}',
311
318
  'list.goal': 'Цель: {objective}',
312
- 'list.jump': 'Открыть диалог',
319
+ 'list.ask': 'Ждёт вашего ответа',
320
+ 'list.behind': '{count} требуют внимания',
313
321
  'list.more': 'Ещё диалогов: {count}',
314
322
  'list.less': 'Свернуть',
315
323
  'empty.title': 'Задач пока нет',
@@ -344,7 +352,8 @@ window.__ModuleLoader__.load({
344
352
  'list.current': 'Conversa atual',
345
353
  'list.step': 'Passo {step}',
346
354
  'list.goal': 'Meta: {objective}',
347
- 'list.jump': 'Abrir conversa',
355
+ 'list.ask': 'Aguardando sua resposta',
356
+ 'list.behind': '{count} para revisar',
348
357
  'list.more': 'Mais {count} conversas',
349
358
  'list.less': 'Mostrar menos',
350
359
  'empty.title': 'Nenhuma tarefa ainda',
@@ -548,7 +557,6 @@ window.__ModuleLoader__.load({
548
557
  }
549
558
 
550
559
  /** Display priority of one kind; the roster lists the most urgent first. */
551
- const KIND_ORDER = { running: 0, attention: 1, progress: 2, failed: 3, finished: 4, idle: 5 };
552
560
 
553
561
  /**
554
562
  * Format an elapsed duration for the roster.
@@ -880,7 +888,12 @@ window.__ModuleLoader__.load({
880
888
  const pet = row.pet;
881
889
  const todos = pet === null || pet === undefined ? null : pet.todos;
882
890
  const goal = pet === null || pet === undefined ? null : pet.goal;
883
- if (kind === 'attention') return t('list.attention');
891
+ if (kind === 'attention') {
892
+ // Distinguish a question from an unread completion: both are attention,
893
+ // but only one of them is blocked on the user.
894
+ const pending = status?.pendingInteraction;
895
+ return pending !== undefined && pending !== null ? t('list.ask') : t('list.attention');
896
+ }
884
897
  if (kind === 'running') {
885
898
  const parts = [];
886
899
  if (pet !== null && pet !== undefined && pet.startedAt !== null) parts.push(elapsedLabel(now - pet.startedAt));
@@ -1043,12 +1056,15 @@ window.__ModuleLoader__.load({
1043
1056
  };
1044
1057
  }, [open]);
1045
1058
 
1046
- // Newest first. A freshly opened conversation used to sink to the bottom
1047
- // of the kind buckets, which is the one place the user is most likely to
1048
- // look — the badge and the dots still carry urgency.
1059
+ // Action first, then recency. Pure recency buried both the sessions that
1060
+ // need an answer and the one that is running under a pile of finished
1061
+ // ones — the card then showed a count nobody could locate.
1049
1062
  const ranked = rows
1050
1063
  .map((row) => ({ row, kind: rowKind(row, statuses.get(row.id)) }))
1051
- .sort((a, b) => (b.row.updatedAt - a.row.updatedAt) || (KIND_ORDER[a.kind] - KIND_ORDER[b.kind]));
1064
+ .sort((a, b) => {
1065
+ const weight = (kind) => (kind === 'attention' ? 0 : kind === 'running' ? 1 : 2);
1066
+ return (weight(a.kind) - weight(b.kind)) || (b.row.updatedAt - a.row.updatedAt);
1067
+ });
1052
1068
  const running = ranked.filter((entry) => entry.kind === 'running').length;
1053
1069
  const attention = ranked.filter((entry) => entry.kind === 'attention').length;
1054
1070
  const failed = ranked.filter((entry) => entry.kind === 'failed').length;
@@ -229,6 +229,9 @@ final class PetView: NSView {
229
229
  // bobs, and it never competes with the count badge in the top-right corner.
230
230
  drawProgressMeter(ctx)
231
231
  if badge > 0 { drawBadge(ctx, text: badge > 9 ? "9+" : String(badge)) }
232
+ // The badge counts what needs the user; when something is also running, the
233
+ // badge alone hid that. A small dot beside it keeps both facts on the pet.
234
+ if working && badge > 0 { drawRunningDot(ctx) }
232
235
  }
233
236
 
234
237
  /// A slim meter under the pet showing how much of the target Session's plan is
@@ -445,6 +448,18 @@ final class PetView: NSView {
445
448
  }
446
449
  }
447
450
 
451
+ /// A blue dot left of the count badge: "something is running right now".
452
+ private func drawRunningDot(_ ctx: CGContext) {
453
+ let badgeWidth: CGFloat = badge > 9 ? 24 : 20
454
+ let x = bounds.width - badgeWidth - 2 - 12
455
+ let rect = CGRect(x: x, y: bounds.height - 16, width: 8, height: 8)
456
+ ctx.setFillColor(CGColor(srgbRed: 0.298, green: 0.565, blue: 0.949, alpha: 1))
457
+ ctx.fillEllipse(in: rect)
458
+ ctx.setStrokeColor(CGColor(srgbRed: 1, green: 1, blue: 1, alpha: 0.85))
459
+ ctx.setLineWidth(1.2)
460
+ ctx.strokeEllipse(in: rect.insetBy(dx: 0.6, dy: 0.6))
461
+ }
462
+
448
463
  private func drawBadge(_ ctx: CGContext, text: String) {
449
464
  let width: CGFloat = text.count > 1 ? 24 : 20
450
465
  let rect = CGRect(x: bounds.width - width - 2, y: bounds.height - 22, width: width, height: 20)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-task-cat",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Task cat: a floating white cat that watches every session's progress and jumps into the conversation that needs you.",
5
5
  "type": "module",
6
6
  "exports": {