thatgfsj-code 0.6.0 → 0.7.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 (149) hide show
  1. package/dist/app/index.d.ts +2 -0
  2. package/dist/app/index.d.ts.map +1 -1
  3. package/dist/app/index.js +10 -5
  4. package/dist/app/index.js.map +1 -1
  5. package/dist/cmd/index.js +1 -1
  6. package/dist/prompts/index.d.ts +2 -0
  7. package/dist/prompts/index.d.ts.map +1 -1
  8. package/dist/prompts/index.js +7 -0
  9. package/dist/prompts/index.js.map +1 -1
  10. package/dist/skills/brainstorming.d.ts +3 -0
  11. package/dist/skills/brainstorming.d.ts.map +1 -0
  12. package/dist/skills/brainstorming.js +42 -0
  13. package/dist/skills/brainstorming.js.map +1 -0
  14. package/dist/skills/code-review.d.ts +3 -0
  15. package/dist/skills/code-review.d.ts.map +1 -0
  16. package/dist/skills/code-review.js +44 -0
  17. package/dist/skills/code-review.js.map +1 -0
  18. package/dist/skills/executing-plans.d.ts +3 -0
  19. package/dist/skills/executing-plans.d.ts.map +1 -0
  20. package/dist/skills/executing-plans.js +26 -0
  21. package/dist/skills/executing-plans.js.map +1 -0
  22. package/dist/skills/frontend-design.d.ts +3 -0
  23. package/dist/skills/frontend-design.d.ts.map +1 -0
  24. package/dist/skills/frontend-design.js +34 -0
  25. package/dist/skills/frontend-design.js.map +1 -0
  26. package/dist/skills/git-workflow.d.ts +3 -0
  27. package/dist/skills/git-workflow.d.ts.map +1 -0
  28. package/dist/skills/git-workflow.js +35 -0
  29. package/dist/skills/git-workflow.js.map +1 -0
  30. package/dist/skills/improve-architecture.d.ts +3 -0
  31. package/dist/skills/improve-architecture.d.ts.map +1 -0
  32. package/dist/skills/improve-architecture.js +37 -0
  33. package/dist/skills/improve-architecture.js.map +1 -0
  34. package/dist/skills/index.d.ts +50 -0
  35. package/dist/skills/index.d.ts.map +1 -0
  36. package/dist/skills/index.js +98 -0
  37. package/dist/skills/index.js.map +1 -0
  38. package/dist/skills/neuroweave.d.ts +3 -0
  39. package/dist/skills/neuroweave.d.ts.map +1 -0
  40. package/dist/skills/neuroweave.js +46 -0
  41. package/dist/skills/neuroweave.js.map +1 -0
  42. package/dist/skills/playwright.d.ts +3 -0
  43. package/dist/skills/playwright.d.ts.map +1 -0
  44. package/dist/skills/playwright.js +71 -0
  45. package/dist/skills/playwright.js.map +1 -0
  46. package/dist/skills/prototype.d.ts +3 -0
  47. package/dist/skills/prototype.d.ts.map +1 -0
  48. package/dist/skills/prototype.js +29 -0
  49. package/dist/skills/prototype.js.map +1 -0
  50. package/dist/skills/subagent.d.ts +3 -0
  51. package/dist/skills/subagent.d.ts.map +1 -0
  52. package/dist/skills/subagent.js +27 -0
  53. package/dist/skills/subagent.js.map +1 -0
  54. package/dist/skills/supabase.d.ts +3 -0
  55. package/dist/skills/supabase.d.ts.map +1 -0
  56. package/dist/skills/supabase.js +43 -0
  57. package/dist/skills/supabase.js.map +1 -0
  58. package/dist/skills/systematic-debugging.d.ts +3 -0
  59. package/dist/skills/systematic-debugging.d.ts.map +1 -0
  60. package/dist/skills/systematic-debugging.js +43 -0
  61. package/dist/skills/systematic-debugging.js.map +1 -0
  62. package/dist/skills/tdd.d.ts +3 -0
  63. package/dist/skills/tdd.d.ts.map +1 -0
  64. package/dist/skills/tdd.js +38 -0
  65. package/dist/skills/tdd.js.map +1 -0
  66. package/dist/skills/triage.d.ts +3 -0
  67. package/dist/skills/triage.d.ts.map +1 -0
  68. package/dist/skills/triage.js +34 -0
  69. package/dist/skills/triage.js.map +1 -0
  70. package/dist/skills/verification.d.ts +3 -0
  71. package/dist/skills/verification.d.ts.map +1 -0
  72. package/dist/skills/verification.js +30 -0
  73. package/dist/skills/verification.js.map +1 -0
  74. package/dist/skills/writing-plans.d.ts +3 -0
  75. package/dist/skills/writing-plans.d.ts.map +1 -0
  76. package/dist/skills/writing-plans.js +41 -0
  77. package/dist/skills/writing-plans.js.map +1 -0
  78. package/dist/tools/index.d.ts +1 -0
  79. package/dist/tools/index.d.ts.map +1 -1
  80. package/dist/tools/index.js +3 -0
  81. package/dist/tools/index.js.map +1 -1
  82. package/dist/tools/nwt.d.ts +70 -0
  83. package/dist/tools/nwt.d.ts.map +1 -0
  84. package/dist/tools/nwt.js +289 -0
  85. package/dist/tools/nwt.js.map +1 -0
  86. package/dist/tui/app.d.ts.map +1 -1
  87. package/dist/tui/app.js +6 -6
  88. package/dist/tui/app.js.map +1 -1
  89. package/dist/tui/components/ChatList.d.ts +4 -5
  90. package/dist/tui/components/ChatList.d.ts.map +1 -1
  91. package/dist/tui/components/ChatList.js +6 -4
  92. package/dist/tui/components/ChatList.js.map +1 -1
  93. package/dist/tui/components/ChatMessage.d.ts +2 -1
  94. package/dist/tui/components/ChatMessage.d.ts.map +1 -1
  95. package/dist/tui/components/ChatMessage.js +10 -8
  96. package/dist/tui/components/ChatMessage.js.map +1 -1
  97. package/dist/tui/components/Header.d.ts +1 -1
  98. package/dist/tui/components/Header.d.ts.map +1 -1
  99. package/dist/tui/components/Header.js +5 -3
  100. package/dist/tui/components/Header.js.map +1 -1
  101. package/dist/tui/components/StatusBar.d.ts +9 -0
  102. package/dist/tui/components/StatusBar.d.ts.map +1 -0
  103. package/dist/tui/components/StatusBar.js +10 -0
  104. package/dist/tui/components/StatusBar.js.map +1 -0
  105. package/dist/tui/components/Thinking.js +1 -1
  106. package/dist/tui/components/Thinking.js.map +1 -1
  107. package/dist/tui/components/ToolCall.d.ts +2 -1
  108. package/dist/tui/components/ToolCall.d.ts.map +1 -1
  109. package/dist/tui/components/ToolCall.js +29 -24
  110. package/dist/tui/components/ToolCall.js.map +1 -1
  111. package/dist/tui/components/UserInput.d.ts +1 -1
  112. package/dist/tui/components/UserInput.d.ts.map +1 -1
  113. package/dist/tui/components/UserInput.js +19 -42
  114. package/dist/tui/components/UserInput.js.map +1 -1
  115. package/dist/tui/hooks/useCommands.d.ts.map +1 -1
  116. package/dist/tui/hooks/useCommands.js +28 -1
  117. package/dist/tui/hooks/useCommands.js.map +1 -1
  118. package/package.json +1 -1
  119. package/src/app/index.ts +12 -6
  120. package/src/cmd/index.tsx +1 -1
  121. package/src/prompts/index.ts +8 -0
  122. package/src/skills/brainstorming.ts +43 -0
  123. package/src/skills/code-review.ts +45 -0
  124. package/src/skills/executing-plans.ts +27 -0
  125. package/src/skills/frontend-design.ts +35 -0
  126. package/src/skills/git-workflow.ts +36 -0
  127. package/src/skills/improve-architecture.ts +38 -0
  128. package/src/skills/index.ts +136 -0
  129. package/src/skills/neuroweave.ts +47 -0
  130. package/src/skills/playwright.ts +72 -0
  131. package/src/skills/prototype.ts +30 -0
  132. package/src/skills/subagent.ts +28 -0
  133. package/src/skills/supabase.ts +44 -0
  134. package/src/skills/systematic-debugging.ts +44 -0
  135. package/src/skills/tdd.ts +39 -0
  136. package/src/skills/triage.ts +35 -0
  137. package/src/skills/verification.ts +31 -0
  138. package/src/skills/writing-plans.ts +42 -0
  139. package/src/tools/index.ts +3 -0
  140. package/src/tools/nwt.ts +362 -0
  141. package/src/tui/app.tsx +9 -8
  142. package/src/tui/components/ChatList.tsx +8 -5
  143. package/src/tui/components/ChatMessage.tsx +16 -13
  144. package/src/tui/components/Header.tsx +15 -9
  145. package/src/tui/components/StatusBar.tsx +30 -0
  146. package/src/tui/components/Thinking.tsx +3 -3
  147. package/src/tui/components/ToolCall.tsx +34 -32
  148. package/src/tui/components/UserInput.tsx +20 -54
  149. package/src/tui/hooks/useCommands.ts +29 -1
@@ -11,58 +11,60 @@ interface ToolCallData {
11
11
 
12
12
  interface Props {
13
13
  tool: ToolCallData;
14
+ width?: number;
14
15
  }
15
16
 
16
- function formatArgs(args: string): string {
17
+ function formatToolParams(name: string, args: string): string {
17
18
  try {
18
19
  const obj = JSON.parse(args);
19
- const entries = Object.entries(obj);
20
- if (entries.length === 0) return '';
21
- return entries
22
- .map(([k, v]) => {
23
- const val = typeof v === 'string' && v.length > 60
24
- ? v.slice(0, 60) + '...'
25
- : JSON.stringify(v);
26
- return `${k}=${val}`;
27
- })
28
- .join(' ');
20
+ switch (name) {
21
+ case 'file': {
22
+ const action = obj.action || '';
23
+ const path = (obj.path || '').replace(/.*[/\\]/, '');
24
+ return `${action} ${path || obj.path || ''}`;
25
+ }
26
+ case 'shell': return obj.command || '';
27
+ case 'git': return obj.command || '';
28
+ case 'search': return obj.query || obj.pattern || '';
29
+ case 'nwt': return obj.action || '';
30
+ default: {
31
+ const first = Object.entries(obj)[0];
32
+ if (!first) return '';
33
+ const val = typeof first[1] === 'string' && first[1].length > 40
34
+ ? first[1].slice(0, 40) + '...'
35
+ : JSON.stringify(first[1]);
36
+ return `${first[0]}=${val}`;
37
+ }
38
+ }
29
39
  } catch {
30
- return args.length > 80 ? args.slice(0, 80) + '...' : args;
40
+ return args.length > 50 ? args.slice(0, 50) + '...' : args;
31
41
  }
32
42
  }
33
43
 
34
- function formatResult(output: string, maxLines = 15): { text: string; truncated: boolean } {
44
+ function formatResult(output: string, maxLines = 10): { text: string; truncated: boolean } {
35
45
  const lines = output.split('\n');
36
- if (lines.length <= maxLines) {
37
- return { text: output, truncated: false };
38
- }
39
- return {
40
- text: lines.slice(0, maxLines).join('\n'),
41
- truncated: true,
42
- };
46
+ if (lines.length <= maxLines) return { text: output, truncated: false };
47
+ return { text: lines.slice(0, maxLines).join('\n'), truncated: true };
43
48
  }
44
49
 
45
- export function ToolCall({ tool }: Props) {
46
- const argsStr = formatArgs(tool.args);
50
+ export function ToolCall({ tool, width }: Props) {
51
+ const params = formatToolParams(tool.name, tool.args);
47
52
  const result = tool.result ? formatResult(tool.result) : null;
48
53
 
49
54
  return (
50
- <Box flexDirection="column" marginY={0}>
55
+ <Box borderStyle="round" borderLeft borderColor="#06B6D4" paddingLeft={1} flexDirection="column" marginBottom={0}>
51
56
  <Box>
52
- <Text color="yellow"> </Text>
53
- <Text bold color="yellow">{tool.name}</Text>
54
- {argsStr && <Text dimColor> {argsStr}</Text>}
57
+ <Text color="#06B6D4" bold>⚙ {tool.name}: </Text>
58
+ <Text color="#94A3B8">{params}</Text>
55
59
  </Box>
56
60
  {result && (
57
- <Box paddingLeft={4} flexDirection="column">
61
+ <Box paddingLeft={1} flexDirection="column">
58
62
  {result.text.split('\n').map((line, i) => (
59
- <Text key={i} dimColor={tool.isError} color={tool.isError ? 'red' : undefined}>
60
- {tool.isError ? '✖ ' : '│ '}{line}
63
+ <Text key={i} color={tool.isError ? '#EF4444' : '#64748B'}>
64
+ {line}
61
65
  </Text>
62
66
  ))}
63
- {result.truncated && (
64
- <Text dimColor>│ ... (truncated)</Text>
65
- )}
67
+ {result.truncated && <Text dimColor>...</Text>}
66
68
  </Box>
67
69
  )}
68
70
  </Box>
@@ -1,5 +1,5 @@
1
1
  /** @jsxImportSource react */
2
- import React, { useState, useCallback } from 'react';
2
+ import React, { useState, memo } from 'react';
3
3
  import { Box, Text, useInput, useApp } from 'ink';
4
4
 
5
5
  interface Props {
@@ -7,9 +7,8 @@ interface Props {
7
7
  disabled?: boolean;
8
8
  }
9
9
 
10
- export function UserInput({ onSubmit, disabled }: Props) {
10
+ export const UserInput = memo(function UserInput({ onSubmit, disabled }: Props) {
11
11
  const [value, setValue] = useState('');
12
- const [cursorPos, setCursorPos] = useState(0);
13
12
  const [history, setHistory] = useState<string[]>([]);
14
13
  const [historyIdx, setHistoryIdx] = useState(-1);
15
14
  const { exit } = useApp();
@@ -20,82 +19,49 @@ export function UserInput({ onSubmit, disabled }: Props) {
20
19
  if (key.return) {
21
20
  const trimmed = value.trim();
22
21
  if (trimmed) {
23
- if (trimmed === 'exit' || trimmed === 'quit') {
24
- exit();
25
- return;
26
- }
22
+ if (trimmed === 'exit' || trimmed === 'quit') { exit(); return; }
27
23
  setHistory(prev => [...prev, trimmed]);
28
24
  setHistoryIdx(-1);
29
25
  onSubmit(trimmed);
30
26
  setValue('');
31
- setCursorPos(0);
32
27
  }
33
28
  return;
34
29
  }
35
30
 
36
- if (key.upArrow) {
37
- if (history.length > 0) {
38
- const newIdx = historyIdx === -1 ? history.length - 1 : Math.max(0, historyIdx - 1);
39
- setHistoryIdx(newIdx);
40
- setValue(history[newIdx]);
41
- setCursorPos(history[newIdx].length);
42
- }
31
+ if (key.upArrow && history.length > 0) {
32
+ const newIdx = historyIdx === -1 ? history.length - 1 : Math.max(0, historyIdx - 1);
33
+ setHistoryIdx(newIdx);
34
+ setValue(history[newIdx]);
43
35
  return;
44
36
  }
45
37
 
46
- if (key.downArrow) {
47
- if (historyIdx >= 0) {
48
- const newIdx = historyIdx + 1;
49
- if (newIdx >= history.length) {
50
- setHistoryIdx(-1);
51
- setValue('');
52
- setCursorPos(0);
53
- } else {
54
- setHistoryIdx(newIdx);
55
- setValue(history[newIdx]);
56
- setCursorPos(history[newIdx].length);
57
- }
38
+ if (key.downArrow && historyIdx >= 0) {
39
+ const newIdx = historyIdx + 1;
40
+ if (newIdx >= history.length) {
41
+ setHistoryIdx(-1); setValue('');
42
+ } else {
43
+ setHistoryIdx(newIdx); setValue(history[newIdx]);
58
44
  }
59
45
  return;
60
46
  }
61
47
 
62
48
  if (key.backspace || key.delete) {
63
- if (cursorPos > 0) {
64
- setValue(v => v.slice(0, cursorPos - 1) + v.slice(cursorPos));
65
- setCursorPos(p => p - 1);
66
- }
67
- return;
68
- }
69
-
70
- if (key.leftArrow) {
71
- setCursorPos(p => Math.max(0, p - 1));
72
- return;
73
- }
74
-
75
- if (key.rightArrow) {
76
- setCursorPos(p => Math.min(value.length, p + 1));
49
+ setValue(v => v.slice(0, -1));
77
50
  return;
78
51
  }
79
52
 
80
- if (key.ctrl && input === 'c') {
81
- exit();
82
- return;
83
- }
53
+ if (key.ctrl && input === 'c') { exit(); return; }
84
54
 
85
- // Regular character input
86
55
  if (input && !key.ctrl && !key.meta) {
87
- setValue(v => v.slice(0, cursorPos) + input + v.slice(cursorPos));
88
- setCursorPos(p => p + input.length);
56
+ setValue(v => v + input);
89
57
  }
90
58
  });
91
59
 
92
- const prefix = disabled ? ' ' : '❯ ';
93
-
94
60
  return (
95
- <Box>
96
- <Text bold color="cyan">{prefix}</Text>
61
+ <Box paddingY={0}>
62
+ <Text color="#06B6D4" bold>{disabled ? ' ' : '❯ '}</Text>
97
63
  <Text>{value}</Text>
98
- {!disabled && <Text color="cyan">█</Text>}
64
+ {!disabled && <Text color="#06B6D4">█</Text>}
99
65
  </Box>
100
66
  );
101
- }
67
+ });
@@ -51,10 +51,38 @@ export function useCommands(app: App) {
51
51
  }
52
52
 
53
53
  case 'clear':
54
- // Handled separately in the App component
55
54
  return { handled: true };
56
55
 
57
56
  default:
57
+ // Handle /skill commands
58
+ if (cmd.startsWith('skill') || cmd.startsWith('/skill')) {
59
+ const parts = input.trim().split(/\s+/);
60
+ const sub = parts[1] || 'list';
61
+
62
+ if (sub === 'list') {
63
+ const all = app.skills.list();
64
+ const lines = all.map(s => {
65
+ const active = app.skills.isActive(s.id) ? '✓' : ' ';
66
+ return ` [${active}] ${s.name.padEnd(28)} ${s.description}`;
67
+ });
68
+ return {
69
+ handled: true,
70
+ output: ['Skills ([✓] = active):', ...lines, '', 'Usage: skill <id> to toggle'].join('\n'),
71
+ };
72
+ }
73
+
74
+ // Toggle skill
75
+ const skillId = sub;
76
+ if (app.skills.isActive(skillId)) {
77
+ app.skills.deactivate(skillId);
78
+ return { handled: true, output: ` Deactivated: ${skillId}` };
79
+ } else if (app.skills.activate(skillId)) {
80
+ return { handled: true, output: ` Activated: ${skillId}` };
81
+ } else {
82
+ return { handled: true, output: ` Unknown skill: ${skillId}` };
83
+ }
84
+ }
85
+
58
86
  return { handled: false };
59
87
  }
60
88
  }, [app]);