@bahulam/code 2.6.15 → 2.6.16

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.
@@ -50,6 +50,8 @@ export const COMMANDS = {
50
50
  '/review': 'Code review agent',
51
51
  '/architect': 'Feature architect agent',
52
52
  '/safety': 'Show safety guardrail status',
53
+ '/auto': 'Session autopilot: auto-approve routine tools (dangerous still prompts)',
54
+ '/approvals': 'List or edit session approval grants',
53
55
  '/revoke': 'Revoke auto-approvals',
54
56
  '/resume': 'Resume a previous session',
55
57
  '/sessions': 'List resumable sessions',
@@ -53,6 +53,20 @@ export function subAgentIndent(extraDepth = 0) {
53
53
  *
54
54
  * @returns {string} ANSI-styled multi-line block (no trailing newline).
55
55
  */
56
+ /**
57
+ * Reduce a sub-agent query to its human-readable core. Handoff envelopes
58
+ * ([User intent], ## Work Scope, Schema:, Active roots:) are machine
59
+ * context — printing them flooded the transcript with 15+ lines per
60
+ * spawn. Full text stays available via /expand on the recorded card.
61
+ */
62
+ export function displayQuery(query, max = 140) {
63
+ let s = String(query || '');
64
+ const cut = s.search(/\n\s*(?:\[User intent\]|##\s*Work Scope|Schema:\s*kepler\.|Active roots:)/);
65
+ if (cut >= 0) s = s.slice(0, cut);
66
+ s = s.replace(/^\[Thoroughness:\s*[^\]]*\]\s*/i, '').replace(/\s+/g, ' ').trim();
67
+ return truncate(s, max);
68
+ }
69
+
56
70
  export function renderSubAgentOpen({ id, type, query, parentDepth } = {}) {
57
71
  const t = type || 'sub-agent';
58
72
  const depthBefore = _stack.length;
@@ -60,10 +74,11 @@ export function renderSubAgentOpen({ id, type, query, parentDepth } = {}) {
60
74
 
61
75
  const indent = ' '.repeat(2 + depthBefore * 3);
62
76
  const iconChar = SUB_ICONS[t] || icons.subAgent;
63
- const head = `${indent}${iconChar} ${paint.brand.data(t)} ${paint.text.dim(`"${query || ''}"`)}`;
77
+ const shown = displayQuery(query);
78
+ const head = `${indent}${iconChar} ${paint.brand.data(t)} ${paint.text.dim(`"${shown}"`)}`;
64
79
  const tag1 = paint.text.dim('▸ running');
65
80
 
66
- return query
81
+ return shown
67
82
  ? `\n${head} ${tag1}`
68
83
  : `\n${indent}${iconChar} ${paint.brand.data(t)} ${tag1}`;
69
84
  }