@capybara-hq/plugin-todo 0.1.0-rc.1 → 0.1.0-rc.10

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.
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "todo",
4
- "version": "0.1.0-rc.1",
4
+ "version": "0.1.0-rc.10",
5
5
  "publisher": "Capybara",
6
- "description": "Todo list tool for agents: plugin__todo__write keeps a per-conversation task list in PostgreSQL",
6
+ "description": "Todo list tool for agents: plugin__todo__write keeps a per-conversation todo list in PostgreSQL",
7
7
  "displayName": {
8
8
  "zh": "待办清单",
9
9
  "en": "Todo list"
10
10
  },
11
+ "icon": "./icon.svg",
11
12
  "homepage": "https://github.com/capybara-hq/plugins/tree/main/plugins/todo#readme",
12
13
  "extension": {
13
14
  "entry": "./dist/index.mjs",
14
15
  "manifest": {
15
16
  "name": "todo",
16
- "version": "0.1.0-rc.1",
17
+ "version": "0.1.0-rc.10",
17
18
  "sdk": "^0.1.0-rc.0",
18
19
  "provides": [],
19
20
  "requires": [],
@@ -39,8 +40,8 @@
39
40
  {
40
41
  "id": "tasks-panel",
41
42
  "title": {
42
- "zh": "任务",
43
- "en": "Tasks"
43
+ "zh": "待办",
44
+ "en": "Todos"
44
45
  },
45
46
  "place": "panel",
46
47
  "kind": "view",
@@ -49,8 +50,8 @@
49
50
  {
50
51
  "id": "tasks-section",
51
52
  "title": {
52
- "zh": "任务",
53
- "en": "Tasks"
53
+ "zh": "待办",
54
+ "en": "Todos"
54
55
  },
55
56
  "place": "section",
56
57
  "kind": "view",
@@ -59,8 +60,8 @@
59
60
  {
60
61
  "id": "tasks-card",
61
62
  "title": {
62
- "zh": "任务",
63
- "en": "Tasks"
63
+ "zh": "待办",
64
+ "en": "Todos"
64
65
  },
65
66
  "place": "inline",
66
67
  "kind": "view",
@@ -69,8 +70,8 @@
69
70
  {
70
71
  "id": "tasks",
71
72
  "title": {
72
- "zh": "任务",
73
- "en": "Tasks"
73
+ "zh": "待办",
74
+ "en": "Todos"
74
75
  },
75
76
  "place": "conversation",
76
77
  "kind": "view",
package/dist/index.mjs CHANGED
@@ -107,10 +107,10 @@ var TASKS_CARD = "tasks-card";
107
107
  var TASKS_LEGACY = "tasks";
108
108
  var TASKS_ALL = [TASKS_PANEL, TASKS_SECTION, TASKS_CARD, TASKS_LEGACY];
109
109
  var label = (t) => t.status === "in_progress" ? t.activeForm : t.content;
110
- var badge = (todos) => `${todos.filter((t) => t.status === "completed").length}/${todos.length}`;
110
+ var badge = (todos) => todos.length === 0 ? {} : { badge: `${todos.filter((t) => t.status === "completed").length}/${todos.length}` };
111
111
  function tasksView(todos) {
112
112
  return {
113
- badge: badge(todos),
113
+ ...badge(todos),
114
114
  blocks: [
115
115
  {
116
116
  type: "checklist",
@@ -120,8 +120,9 @@ function tasksView(todos) {
120
120
  };
121
121
  }
122
122
  function tasksSectionView(todos) {
123
+ if (todos.length === 0) return { blocks: [] };
123
124
  return {
124
- badge: badge(todos),
125
+ ...badge(todos),
125
126
  open: { contribution: TASKS_PANEL },
126
127
  blocks: [
127
128
  {
@@ -137,7 +138,7 @@ function tasksSectionView(todos) {
137
138
  }
138
139
  function tasksCardView(todos) {
139
140
  return {
140
- badge: badge(todos),
141
+ ...badge(todos),
141
142
  open: { contribution: TASKS_PANEL },
142
143
  blocks: [
143
144
  { type: "checklist", items: todos.map((t) => ({ text: label(t), status: t.status })) }
@@ -163,18 +164,18 @@ function writeHandler(db, ui) {
163
164
  content: [{ type: "text", text: renderTodos(todos) }],
164
165
  display: {
165
166
  summary: {
166
- zh: `更新任务清单(${todos.length} 项)`,
167
- en: `Updated task list (${todos.length} items)`
167
+ zh: `更新待办(${todos.length} 项)`,
168
+ en: `Updated todos (${todos.length} items)`
168
169
  }
169
170
  },
170
171
  card: { view: TASKS_CARD, key: snapshot }
171
172
  };
172
173
  };
173
174
  }
174
- var title = { zh: "任务", en: "Tasks" };
175
+ var title = { zh: "待办", en: "Todos" };
175
176
  var index_default = defineExtension({
176
177
  name: "todo",
177
- version: "0.1.0-rc.1",
178
+ version: "0.1.0-rc.10",
178
179
  sdk: "^0.1.0-rc.0",
179
180
  provides: [],
180
181
  migrations: "../migrations",
package/icon.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" shape-rendering="crispEdges"><title>Todo list</title><style>@media (prefers-color-scheme: dark){path{fill:#FF6A13}}</style><path fill="#CC4609" d="M14 1.4h1.35v1.35h-1.35zM12.65 2.75h4.05v1.35h-4.05zM4.55 4.1h14.85v1.35h-14.85zM3.2 5.45h12.15v1.35h-12.15zM16.7 5.45h2.7v1.35h-2.7zM1.85 6.8h17.55v1.35h-17.55zM1.85 8.15h17.55v1.35h-17.55zM1.85 9.5h17.55v1.35h-17.55zM3.2 10.85h13.5v1.35h-13.5zM3.2 12.2h2.7v1.35h-2.7zM8.6 12.2h1.35v1.35h-1.35zM12.65 12.2h2.7v1.35h-2.7zM3.2 13.55h2.7v1.35h-2.7zM8.6 13.55h1.35v1.35h-1.35zM12.65 13.55h2.7v1.35h-2.7z"/><path fill="#CC4609" d="M21.7 15.1h1.15v1.15h-1.15zM20.55 16.25h2.3v1.15h-2.3zM14.8 17.4h1.15v1.15h-1.15zM19.4 17.4h2.3v1.15h-2.3zM14.8 18.55h2.3v1.15h-2.3zM18.25 18.55h2.3v1.15h-2.3zM15.95 19.7h3.45v1.15h-3.45zM17.1 20.85h1.15v1.15h-1.15z"/></svg>
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-todo",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.10",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
- "description": "Todo list tool for agents: plugin__todo__write keeps a per-conversation task list in PostgreSQL",
6
+ "description": "Todo list tool for agents: plugin__todo__write keeps a per-conversation todo list in PostgreSQL",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/capybara-hq/plugins.git",