@capybara-hq/plugin-todo 0.1.0-rc.1 → 0.1.0-rc.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.
@@ -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.11",
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.11",
17
18
  "sdk": "^0.1.0-rc.0",
18
19
  "provides": [],
19
20
  "requires": [],
@@ -26,8 +27,7 @@
26
27
  "views": [
27
28
  "tasks-panel",
28
29
  "tasks-section",
29
- "tasks-card",
30
- "tasks"
30
+ "tasks-card"
31
31
  ]
32
32
  }
33
33
  },
@@ -39,42 +39,32 @@
39
39
  {
40
40
  "id": "tasks-panel",
41
41
  "title": {
42
- "zh": "任务",
43
- "en": "Tasks"
42
+ "zh": "待办",
43
+ "en": "Todos"
44
44
  },
45
- "place": "panel",
45
+ "slot": "conversation.panel",
46
46
  "kind": "view",
47
47
  "icon": "list-checks"
48
48
  },
49
49
  {
50
50
  "id": "tasks-section",
51
51
  "title": {
52
- "zh": "任务",
53
- "en": "Tasks"
52
+ "zh": "待办",
53
+ "en": "Todos"
54
54
  },
55
- "place": "section",
55
+ "slot": "conversation.properties.section",
56
56
  "kind": "view",
57
57
  "icon": "list-checks"
58
58
  },
59
59
  {
60
60
  "id": "tasks-card",
61
61
  "title": {
62
- "zh": "任务",
63
- "en": "Tasks"
62
+ "zh": "待办",
63
+ "en": "Todos"
64
64
  },
65
- "place": "inline",
65
+ "slot": "conversation.tool-result.card",
66
66
  "kind": "view",
67
67
  "icon": "list-checks"
68
- },
69
- {
70
- "id": "tasks",
71
- "title": {
72
- "zh": "任务",
73
- "en": "Tasks"
74
- },
75
- "place": "conversation",
76
- "kind": "view",
77
- "aliasOf": "tasks-panel"
78
68
  }
79
69
  ]
80
70
  },
package/dist/index.mjs CHANGED
@@ -104,13 +104,12 @@ async function readSnapshot(db, conversationId, id) {
104
104
  var TASKS_PANEL = "tasks-panel";
105
105
  var TASKS_SECTION = "tasks-section";
106
106
  var TASKS_CARD = "tasks-card";
107
- var TASKS_LEGACY = "tasks";
108
- var TASKS_ALL = [TASKS_PANEL, TASKS_SECTION, TASKS_CARD, TASKS_LEGACY];
107
+ var TASKS_ALL = [TASKS_PANEL, TASKS_SECTION, TASKS_CARD];
109
108
  var label = (t) => t.status === "in_progress" ? t.activeForm : t.content;
110
- var badge = (todos) => `${todos.filter((t) => t.status === "completed").length}/${todos.length}`;
109
+ var badge = (todos) => todos.length === 0 ? {} : { badge: `${todos.filter((t) => t.status === "completed").length}/${todos.length}` };
111
110
  function tasksView(todos) {
112
111
  return {
113
- badge: badge(todos),
112
+ ...badge(todos),
114
113
  blocks: [
115
114
  {
116
115
  type: "checklist",
@@ -120,8 +119,9 @@ function tasksView(todos) {
120
119
  };
121
120
  }
122
121
  function tasksSectionView(todos) {
122
+ if (todos.length === 0) return { blocks: [] };
123
123
  return {
124
- badge: badge(todos),
124
+ ...badge(todos),
125
125
  open: { contribution: TASKS_PANEL },
126
126
  blocks: [
127
127
  {
@@ -137,7 +137,7 @@ function tasksSectionView(todos) {
137
137
  }
138
138
  function tasksCardView(todos) {
139
139
  return {
140
- badge: badge(todos),
140
+ ...badge(todos),
141
141
  open: { contribution: TASKS_PANEL },
142
142
  blocks: [
143
143
  { type: "checklist", items: todos.map((t) => ({ text: label(t), status: t.status })) }
@@ -163,30 +163,41 @@ function writeHandler(db, ui) {
163
163
  content: [{ type: "text", text: renderTodos(todos) }],
164
164
  display: {
165
165
  summary: {
166
- zh: `更新任务清单(${todos.length} 项)`,
167
- en: `Updated task list (${todos.length} items)`
166
+ zh: `更新待办(${todos.length} 项)`,
167
+ en: `Updated todos (${todos.length} items)`
168
168
  }
169
169
  },
170
170
  card: { view: TASKS_CARD, key: snapshot }
171
171
  };
172
172
  };
173
173
  }
174
- var title = { zh: "任务", en: "Tasks" };
174
+ var title = { zh: "待办", en: "Todos" };
175
175
  var index_default = defineExtension({
176
176
  name: "todo",
177
- version: "0.1.0-rc.1",
177
+ version: "0.1.0-rc.11",
178
178
  sdk: "^0.1.0-rc.0",
179
179
  provides: [],
180
180
  migrations: "../migrations",
181
181
  ui: [
182
- { id: "tasks-panel", title, place: "panel", kind: "view", icon: "list-checks" },
183
- { id: "tasks-section", title, place: "section", kind: "view", icon: "list-checks" },
184
- { id: "tasks-card", title, place: "inline", kind: "view", icon: "list-checks" },
185
- { id: "tasks", title, place: "conversation", kind: "view", aliasOf: "tasks-panel" }
182
+ { id: "tasks-panel", title, slot: "conversation.panel", kind: "view", icon: "list-checks" },
183
+ {
184
+ id: "tasks-section",
185
+ title,
186
+ slot: "conversation.properties.section",
187
+ kind: "view",
188
+ icon: "list-checks"
189
+ },
190
+ {
191
+ id: "tasks-card",
192
+ title,
193
+ slot: "conversation.tool-result.card",
194
+ kind: "view",
195
+ icon: "list-checks"
196
+ }
186
197
  ],
187
198
  permissions: {
188
199
  tools: ["write"],
189
- ui: { views: ["tasks-panel", "tasks-section", "tasks-card", "tasks"] }
200
+ ui: { views: ["tasks-panel", "tasks-section", "tasks-card"] }
190
201
  },
191
202
  setup(ctx) {
192
203
  ctx.tools.register(
@@ -211,7 +222,6 @@ var index_default = defineExtension({
211
222
  export {
212
223
  SNAPSHOTS_PER_CONVERSATION,
213
224
  TASKS_CARD,
214
- TASKS_LEGACY,
215
225
  TASKS_PANEL,
216
226
  TASKS_SECTION,
217
227
  index_default as default,
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.11",
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",