tascan-mcp 3.0.0 → 3.0.1

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/tools.cjs +33 -5
package/index.js CHANGED
@@ -45,7 +45,7 @@ async function api(method, path, body) {
45
45
  }
46
46
 
47
47
  const server = new Server(
48
- { name: 'tascan', version: '3.0.0' },
48
+ { name: 'tascan', version: '3.0.1' },
49
49
  { capabilities: { tools: {} } }
50
50
  );
51
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tascan-mcp",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "mcpName": "io.github.snowbikemike/tascan-mcp",
5
5
  "description": "TaScan MCP Server — Closed-loop autonomous operations protocol. 36 tools for projects, tasks, workers, QR codes, NFC tag registry, scan verification, AI issue analysis, and autonomous remediation dispatch. 12 patents filed (335+ claims). Task. Scan. Done.",
6
6
  "type": "module",
package/tools.cjs CHANGED
@@ -13,6 +13,34 @@
13
13
  // content blocks.
14
14
  // ============================================================
15
15
 
16
+ // ─── Response display normalization ─────────────────────
17
+ // The worker app stores the clean value in response_value AND a raw
18
+ // submission blob {"type","value","submitted_at"} in notes for typed
19
+ // tasks; for checkbox tasks the human text lives only in notes.
20
+ // Collapse to one display value, never print the blob.
21
+ function fmtResponse(responseValue, notes) {
22
+ let value = responseValue;
23
+ if (value && typeof value === 'object') {
24
+ value = ('value' in value) ? value.value : JSON.stringify(value);
25
+ }
26
+ let note = notes || null;
27
+ if (note && typeof note === 'string' && note.trim().startsWith('{')) {
28
+ try {
29
+ const parsed = JSON.parse(note);
30
+ if (parsed && typeof parsed === 'object' && 'value' in parsed) {
31
+ if (value == null || value === '') value = parsed.value;
32
+ note = null; // pure duplicate of response_value — drop the blob
33
+ }
34
+ } catch { /* plain text note that happens to start with { — keep it */ }
35
+ }
36
+ if ((value == null || value === '') && note) {
37
+ // checkbox task with a typed note — the note IS the data
38
+ value = note;
39
+ note = null;
40
+ }
41
+ return { value: value == null || value === '' ? null : String(value), note };
42
+ }
43
+
16
44
  const AGENT_REGISTRY = [
17
45
  {
18
46
  id: 'claude-code-local',
@@ -532,8 +560,8 @@ const TOOLS = [
532
560
  text += '\n';
533
561
  if (args.include_responses && task.responses && task.responses.length > 0) {
534
562
  for (const resp of task.responses) {
535
- const val = resp.response_value != null ? JSON.stringify(resp.response_value) : '(no value)';
536
- text += ` -> ${val}${resp.notes ? ' — ' + resp.notes : ''} (${resp.worker_name}, ${resp.completed_at})\n`;
563
+ const { value, note } = fmtResponse(resp.response_value, resp.notes);
564
+ text += ` -> ${value != null ? value : '(no value)'}${note ? ' — ' + note : ''} (${resp.worker_name}, ${resp.completed_at})\n`;
537
565
  }
538
566
  }
539
567
  }
@@ -560,10 +588,10 @@ const TOOLS = [
560
588
  const r = result.data;
561
589
  let text = `Responses for "${r.task}" in project "${r.project_name}" (${r.matched_tasks} matching task(s), ${r.responses.length} response(s), oldest first):\n\n`;
562
590
  for (const resp of r.responses) {
563
- const val = resp.response_value != null ? JSON.stringify(resp.response_value) : '(no value)';
591
+ const { value, note } = fmtResponse(resp.response_value, resp.notes);
564
592
  const when = (resp.completed_at || '').slice(0, 16).replace('T', ' ');
565
- text += `${when} · ${resp.list_name} · ${resp.task_title}: ${val}`;
566
- if (resp.notes) text += ` — ${resp.notes}`;
593
+ text += `${when} · ${resp.list_name} · ${resp.task_title}: ${value != null ? value : '(no value)'}`;
594
+ if (note) text += ` — ${note}`;
567
595
  text += ` (${resp.worker_name})\n`;
568
596
  }
569
597
  if (r.responses.length === 0) text += '(no responses found)\n';