list_tasks no_repo lists repo-less notes
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

The board reads open notes through list_tasks, which hides notes
without a repo, so kuhy's ideas never reached it.

Todo: 475dc1d1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWXu5EV5tPkCTEu6nxf
This commit is contained in:
Krzysztof Rudnicki 2026-11-19 10:53:18 +01:00
parent 3a747c2e51
commit 9d2a5a0bd3
4 changed files with 67 additions and 7 deletions

View File

@ -95,17 +95,18 @@ class TaskService {
return (reply: await _save(added.note, verb), start: null);
}
/// `list_tasks`: repo tasks, open ones unless `status` says otherwise.
/// `list_tasks`: repo tasks, open ones unless `status` says otherwise;
/// `no_repo: true` lists the repo-less notes (ideas) instead.
Future<String> list(Map<String, dynamic> args) => _serial(() async {
final a = _Args(args);
final repo = a.repo();
final statuses = a.statuses();
final ideas = a.flag('no_repo');
await _pull();
return _lines(
await _session.repository.listNotes(
filter: NoteFilter(statuses: statuses, repo: repo, repoTasksOnly: true),
),
final notes = await _session.repository.listNotes(
filter: NoteFilter(statuses: statuses, repo: repo, repoTasksOnly: !ideas),
);
return _lines(ideas ? notes.where((n) => n.repo == null).toList() : notes);
});
/// `search_tasks`: repo tasks of any status whose text or repo matches.

View File

@ -143,9 +143,13 @@ McpServer _server(TaskService tasks) {
'list_tasks',
'List repo tasks, one line each: 8-char id, status, priority, repo, '
'title, created_by (kuhy|claude). Default status "open" '
'(todo + in_progress).',
'(todo + in_progress). no_repo: true lists the notes WITHOUT a repo '
'(ideas) instead.',
{
'repo': repo,
'no_repo': JsonSchema.boolean(
description: 'List only notes that have no repo (repo shows as -).',
),
'status': JsonSchema.string(
description: 'open | all | todo | in_progress | done | abandoned.',
),

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.96+1
version: 1.0.97+1
environment:
sdk: ^3.12.2

View File

@ -0,0 +1,55 @@
// list_tasks `no_repo: true` lists the open notes that have no repo (ideas),
// which the board shows in its Yours lane; without it they stay invisible.
import 'package:flutter_test/flutter_test.dart';
import 'package:mcp_dart/mcp_dart.dart';
import 'package:todo/data/note.dart';
import 'mcp_harness.dart';
void main() {
late McpHarness h;
late McpClient c;
setUp(() async {
h = McpHarness();
await h.start();
c = await h.connect();
});
tearDown(() => h.dispose());
Future<void> idea(String id, String text, Status status) async {
final now = DateTime.now();
await h.session.repository.upsert(
Note(
id: id,
text: text,
status: status,
priority: Priority.medium,
createdAt: now,
updatedAt: now,
),
);
}
test('no_repo lists only open repo-less notes', () async {
await idea('11111111-aaaa', 'open idea', Status.todo);
await idea('22222222-aaaa', 'finished idea', Status.done);
await h.call(c, 'add_task', {'repo': 'kuhyx/x', 'title': 'repo task'});
final plain = await h.call(c, 'list_tasks', {});
expect(plain, isNot(contains('open idea')));
final ideas = await h.call(c, 'list_tasks', {'no_repo': true});
expect(ideas.trim().split('\n'), hasLength(1));
expect(ideas, allOf(contains('11111111'), contains('open idea')));
expect(ideas, isNot(contains('repo task')));
});
test('no_repo with nothing to list says so', () async {
expect(await h.call(c, 'list_tasks', {'no_repo': true}), 'no tasks match');
});
test('no_repo is named in the tool text', () async {
final tools = (await c.listTools()).tools;
final list = tools.singleWhere((t) => t.name == 'list_tasks');
expect(list.description, contains('no_repo'));
});
}