claude-code-kanban 7.25.0 → 7.27.0

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/server.js CHANGED
@@ -121,6 +121,7 @@ const CCK_DIR = path.join(CLAUDE_DIR, '.cck');
121
121
  const AGENT_ACTIVITY_DIR = path.join(CCK_DIR, 'agent-activity');
122
122
  const CONTEXT_STATUS_DIR = path.join(CCK_DIR, 'context-status');
123
123
  const ATTACHMENTS_DIR = path.join(CCK_DIR, 'attachments');
124
+ const SHOW_DIR = path.join(CCK_DIR, 'show');
124
125
  const PINS_FILE = path.join(CCK_DIR, 'pins.json');
125
126
  const USER_GROUPS_FILE = path.join(CCK_DIR, 'groups.json');
126
127
  const DISPATCHED_FILE = path.join(CCK_DIR, 'dispatched.json');
@@ -2581,6 +2582,12 @@ app.get('/api/sessions/:sessionId/agents', async (req, res) => {
2581
2582
  }
2582
2583
  }
2583
2584
 
2585
+ const subMetas = new Map();
2586
+ const subMeta = (jsonl) => {
2587
+ if (!subMetas.has(jsonl)) subMetas.set(jsonl, readSubagentMeta(jsonl));
2588
+ return subMetas.get(jsonl);
2589
+ };
2590
+
2584
2591
  // The plugin's start record carries the model; this covers sessions without it.
2585
2592
  const agentsNeedingModel = agents.filter(a => !a.model && a.modelUnavailable !== MODEL_SCAN);
2586
2593
  if (agentsNeedingModel.length && meta.jsonlPath) {
@@ -2598,7 +2605,7 @@ app.get('/api/sessions/:sessionId/agents', async (req, res) => {
2598
2605
  // Until the transcript has an assistant line, show the requested alias.
2599
2606
  // agent.model stays empty so the exact id is still looked up.
2600
2607
  if (!agent.modelAlias) {
2601
- let alias = readSubagentMeta(jsonl)?.model || null;
2608
+ let alias = subMeta(jsonl)?.model || null;
2602
2609
  if (alias === 'inherit') {
2603
2610
  try { alias = extractModelFromTranscript(meta.jsonlPath); } catch (_) { alias = null; }
2604
2611
  }
@@ -2614,6 +2621,16 @@ app.get('/api/sessions/:sessionId/agents', async (req, res) => {
2614
2621
  }
2615
2622
  }
2616
2623
 
2624
+ if (meta.jsonlPath) {
2625
+ for (const agent of agents) {
2626
+ if (agent.parent !== undefined) continue;
2627
+ const sub = subMeta(subagentJsonlForExtraction(meta, agent.agentId));
2628
+ if (!sub && isAgentLive(agent)) continue;
2629
+ agent.parent = sub?.parentAgentId || null;
2630
+ dirty.add(agent);
2631
+ }
2632
+ }
2633
+
2617
2634
  // Workflow-spawned subagents given a schema end on a forced StructuredOutput
2618
2635
  // tool call (background subagents on SubagentHandback) and never emit a text
2619
2636
  // lastMessage — surface that result as the agent's response.
@@ -3502,9 +3519,16 @@ const show = createShowStore({
3502
3519
  onChange: saveTerminals,
3503
3520
  onPosted: (e) => broadcast({ type: 'show:posted', ...e }),
3504
3521
  startedSession: terminal.sessionOfTerminal,
3505
- resolveDir: (id) => {
3522
+ resolveDir: (id) => (sessionMetaFor(id) ? path.join(SHOW_DIR, id) : null),
3523
+ // Claims go where the session can write without a prompt: its scratchpad as of its last process start.
3524
+ // The convention dir follows it, for claims made before Claude Code 2.1.317 moved the root.
3525
+ scratchpadDirs: (id) => {
3506
3526
  const meta = sessionMetaFor(id);
3507
- return meta ? getScratchpadDir(id, meta) : null;
3527
+ if (!meta?.jsonlPath) return [];
3528
+ const recorded = getScratchpadDir(id, meta);
3529
+ const convention = getScratchpadDir(id, { ...meta, scratchpadDir: null });
3530
+ const dirs = [recorded, convention].filter(Boolean).map((dir) => path.join(dir, '.cck', 'show'));
3531
+ return [...new Set(dirs)];
3508
3532
  },
3509
3533
  });
3510
3534
  mountShowRoutes(app, {
@@ -3591,6 +3615,16 @@ app.post('/api/dispatch', terminalRoute(async (req, res) => {
3591
3615
  });
3592
3616
  }));
3593
3617
 
3618
+ app.post('/api/dispatch/:id/child', (req, res) => {
3619
+ const { child } = req.body || {};
3620
+ if (typeof child !== 'boolean') return res.status(400).json({ error: 'child must be true or false' });
3621
+ const marker = dispatched.get(req.params.id);
3622
+ if (!marker) return res.status(404).json({ error: 'not a dispatched session' });
3623
+ if (child && !marker.parent) return res.status(400).json({ error: 'child needs a parent session' });
3624
+ if (dispatched.setChild(req.params.id, child)) broadcast({ type: 'dispatch-update' });
3625
+ res.json({ session: req.params.id, child });
3626
+ });
3627
+
3594
3628
  app.get('/api/dispatch', (req, res) => {
3595
3629
  res.setHeader('Cache-Control', 'no-store');
3596
3630
  const parent = typeof req.query.parent === 'string' && req.query.parent ? req.query.parent : null;
@@ -4985,7 +5019,7 @@ async function cleanupAgentActivity() {
4985
5019
  } catch { /* agent-activity dir may not exist */ }
4986
5020
  }
4987
5021
 
4988
- // Dispatch markers, pane layouts, add-on sessions, reviews, attachments, context status and worktrees: see docs/retention.md.
5022
+ // Dispatch markers, pane layouts, add-on sessions, reviews, attachments, show indexes, context status and worktrees: see docs/retention.md.
4989
5023
  async function runRetention() {
4990
5024
  try {
4991
5025
  const scan = await scanTranscripts(PROJECTS_DIR);
@@ -4996,12 +5030,13 @@ async function runRetention() {
4996
5030
  const addonSessions = addons.prune(opts);
4997
5031
  const reviews = await pruneSessionDirs(REVIEW_DIR, opts);
4998
5032
  const attachments = await pruneSessionDirs(ATTACHMENTS_DIR, opts);
5033
+ const shows = await pruneSessionDirs(SHOW_DIR, opts);
4999
5034
  const contexts = await pruneContextStatus(CONTEXT_STATUS_DIR, opts);
5000
5035
  const wts = worktrees.prune(scan?.dirs);
5001
5036
  const taskMaps = await pruneTaskMaps(TASK_MAPS_DIR, opts);
5002
5037
  const grouped = expireGroupMembers(scan?.ids);
5003
- if (markers || layouts || addonSessions || reviews || attachments || contexts || wts || taskMaps || grouped.members) {
5004
- console.log(`[retention] removed ${markers} dispatch markers, ${layouts} pane layouts, ${addonSessions} add-on sessions, ${reviews} reviews, ${attachments} attachments, ${contexts} context status files, ${wts} worktrees, ${taskMaps} task-list mappings, ${grouped.members} group members, ${grouped.groups} groups`);
5038
+ if (markers || layouts || addonSessions || reviews || attachments || shows || contexts || wts || taskMaps || grouped.members) {
5039
+ console.log(`[retention] removed ${markers} dispatch markers, ${layouts} pane layouts, ${addonSessions} add-on sessions, ${reviews} reviews, ${attachments} attachments, ${shows} show files, ${contexts} context status files, ${wts} worktrees, ${taskMaps} task-list mappings, ${grouped.members} group members, ${grouped.groups} groups`);
5005
5040
  }
5006
5041
  } catch (e) {
5007
5042
  console.warn('[retention] failed:', e.message);