thatgfsj-code 1.0.3 → 3.0.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.
Files changed (184) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/DEVELOPMENT.md +286 -0
  3. package/dist/app/index.d.ts +40 -3
  4. package/dist/app/index.d.ts.map +1 -1
  5. package/dist/app/index.js +87 -12
  6. package/dist/app/index.js.map +1 -1
  7. package/dist/cache/fingerprint.d.ts +49 -0
  8. package/dist/cache/fingerprint.d.ts.map +1 -0
  9. package/dist/cache/fingerprint.js +100 -0
  10. package/dist/cache/fingerprint.js.map +1 -0
  11. package/dist/cache/index.d.ts +15 -0
  12. package/dist/cache/index.d.ts.map +1 -0
  13. package/dist/cache/index.js +15 -0
  14. package/dist/cache/index.js.map +1 -0
  15. package/dist/cache/smartModel.d.ts +40 -0
  16. package/dist/cache/smartModel.d.ts.map +1 -0
  17. package/dist/cache/smartModel.js +43 -0
  18. package/dist/cache/smartModel.js.map +1 -0
  19. package/dist/cache/stats.d.ts +93 -0
  20. package/dist/cache/stats.d.ts.map +1 -0
  21. package/dist/cache/stats.js +155 -0
  22. package/dist/cache/stats.js.map +1 -0
  23. package/dist/cache/volatile.d.ts +32 -0
  24. package/dist/cache/volatile.d.ts.map +1 -0
  25. package/dist/cache/volatile.js +44 -0
  26. package/dist/cache/volatile.js.map +1 -0
  27. package/dist/cmd/index.d.ts +21 -0
  28. package/dist/cmd/index.d.ts.map +1 -1
  29. package/dist/cmd/index.js +155 -31
  30. package/dist/cmd/index.js.map +1 -1
  31. package/dist/config/index.d.ts.map +1 -1
  32. package/dist/config/index.js +8 -0
  33. package/dist/config/index.js.map +1 -1
  34. package/dist/config/types.d.ts +14 -0
  35. package/dist/config/types.d.ts.map +1 -1
  36. package/dist/llm/anthropic.d.ts +55 -5
  37. package/dist/llm/anthropic.d.ts.map +1 -1
  38. package/dist/llm/anthropic.js +172 -26
  39. package/dist/llm/anthropic.js.map +1 -1
  40. package/dist/llm/index.d.ts +26 -8
  41. package/dist/llm/index.d.ts.map +1 -1
  42. package/dist/llm/index.js +83 -15
  43. package/dist/llm/index.js.map +1 -1
  44. package/dist/llm/openai.d.ts +28 -8
  45. package/dist/llm/openai.d.ts.map +1 -1
  46. package/dist/llm/openai.js +58 -8
  47. package/dist/llm/openai.js.map +1 -1
  48. package/dist/llm/provider.d.ts +40 -8
  49. package/dist/llm/provider.d.ts.map +1 -1
  50. package/dist/llm/provider.js +8 -1
  51. package/dist/llm/provider.js.map +1 -1
  52. package/dist/prompts/index.d.ts +32 -0
  53. package/dist/prompts/index.d.ts.map +1 -1
  54. package/dist/prompts/index.js +33 -11
  55. package/dist/prompts/index.js.map +1 -1
  56. package/dist/session/index.d.ts +43 -3
  57. package/dist/session/index.d.ts.map +1 -1
  58. package/dist/session/index.js +114 -17
  59. package/dist/session/index.js.map +1 -1
  60. package/dist/skills/brainstorming.js +33 -33
  61. package/dist/skills/code-review.js +35 -35
  62. package/dist/skills/executing-plans.js +18 -18
  63. package/dist/skills/frontend-design.js +25 -25
  64. package/dist/skills/git-workflow.js +26 -26
  65. package/dist/skills/improve-architecture.js +28 -28
  66. package/dist/skills/neuroweave.js +37 -37
  67. package/dist/skills/playwright.js +62 -62
  68. package/dist/skills/prototype.js +20 -20
  69. package/dist/skills/subagent.js +19 -19
  70. package/dist/skills/supabase.js +34 -34
  71. package/dist/skills/systematic-debugging.js +34 -34
  72. package/dist/skills/tdd.js +29 -29
  73. package/dist/skills/triage.js +25 -25
  74. package/dist/skills/verification.js +22 -22
  75. package/dist/skills/writing-plans.js +32 -32
  76. package/dist/tools/nwt.js +16 -16
  77. package/dist/tui/app.d.ts.map +1 -1
  78. package/dist/tui/app.js +9 -2
  79. package/dist/tui/app.js.map +1 -1
  80. package/dist/tui/components/ChatList.d.ts.map +1 -1
  81. package/dist/tui/components/ChatList.js +4 -3
  82. package/dist/tui/components/ChatList.js.map +1 -1
  83. package/dist/tui/components/Header.d.ts +8 -0
  84. package/dist/tui/components/Header.d.ts.map +1 -1
  85. package/dist/tui/components/Header.js +17 -3
  86. package/dist/tui/components/Header.js.map +1 -1
  87. package/dist/tui/components/InitWizard.d.ts +12 -1
  88. package/dist/tui/components/InitWizard.d.ts.map +1 -1
  89. package/dist/tui/components/InitWizard.js +58 -3
  90. package/dist/tui/components/InitWizard.js.map +1 -1
  91. package/dist/tui/components/ToolCall.d.ts +1 -1
  92. package/dist/tui/components/ToolCall.d.ts.map +1 -1
  93. package/dist/tui/components/ToolCall.js +4 -4
  94. package/dist/tui/components/ToolCall.js.map +1 -1
  95. package/dist/tui/hooks/useChat.d.ts +22 -0
  96. package/dist/tui/hooks/useChat.d.ts.map +1 -1
  97. package/dist/tui/hooks/useChat.js +127 -50
  98. package/dist/tui/hooks/useChat.js.map +1 -1
  99. package/dist/tui/hooks/useCommands.d.ts.map +1 -1
  100. package/dist/tui/hooks/useCommands.js +78 -0
  101. package/dist/tui/hooks/useCommands.js.map +1 -1
  102. package/dist/types.d.ts +79 -6
  103. package/dist/types.d.ts.map +1 -1
  104. package/dist/types.js +7 -0
  105. package/dist/types.js.map +1 -1
  106. package/dist/utils/stableStringify.d.ts +21 -0
  107. package/dist/utils/stableStringify.d.ts.map +1 -0
  108. package/dist/utils/stableStringify.js +53 -0
  109. package/dist/utils/stableStringify.js.map +1 -0
  110. package/dist/utils/thinking.d.ts +59 -0
  111. package/dist/utils/thinking.d.ts.map +1 -0
  112. package/dist/utils/thinking.js +104 -0
  113. package/dist/utils/thinking.js.map +1 -0
  114. package/install.bat +63 -0
  115. package/install.ps1 +238 -0
  116. package/install.sh +113 -0
  117. package/package.json +7 -4
  118. package/src/app/index.ts +180 -108
  119. package/src/cache/fingerprint.ts +101 -0
  120. package/src/cache/index.ts +15 -0
  121. package/src/cache/smartModel.ts +52 -0
  122. package/src/cache/stats.ts +199 -0
  123. package/src/cache/volatile.ts +47 -0
  124. package/src/cmd/index.tsx +288 -160
  125. package/src/config/index.ts +156 -148
  126. package/src/config/providers.ts +234 -234
  127. package/src/config/types.ts +67 -53
  128. package/src/hooks/index.ts +111 -111
  129. package/src/llm/anthropic.ts +388 -243
  130. package/src/llm/gemini.ts +169 -169
  131. package/src/llm/index.ts +265 -200
  132. package/src/llm/openai.ts +243 -196
  133. package/src/llm/provider.ts +66 -34
  134. package/src/prompts/index.ts +260 -220
  135. package/src/session/compactor.ts +103 -103
  136. package/src/session/index.ts +181 -87
  137. package/src/session/message.ts +42 -42
  138. package/src/skills/brainstorming.ts +43 -43
  139. package/src/skills/code-review.ts +45 -45
  140. package/src/skills/executing-plans.ts +27 -27
  141. package/src/skills/frontend-design.ts +35 -35
  142. package/src/skills/git-workflow.ts +36 -36
  143. package/src/skills/improve-architecture.ts +38 -38
  144. package/src/skills/index.ts +136 -136
  145. package/src/skills/neuroweave.ts +47 -47
  146. package/src/skills/playwright.ts +72 -72
  147. package/src/skills/prototype.ts +30 -30
  148. package/src/skills/subagent.ts +28 -28
  149. package/src/skills/supabase.ts +44 -44
  150. package/src/skills/systematic-debugging.ts +44 -44
  151. package/src/skills/tdd.ts +39 -39
  152. package/src/skills/triage.ts +35 -35
  153. package/src/skills/verification.ts +31 -31
  154. package/src/skills/writing-plans.ts +42 -42
  155. package/src/tools/nwt.ts +598 -598
  156. package/src/tools/types.ts +122 -122
  157. package/src/tui/app.tsx +199 -186
  158. package/src/tui/components/ChatList.tsx +41 -32
  159. package/src/tui/components/ChatMessage.tsx +54 -54
  160. package/src/tui/components/Header.tsx +56 -28
  161. package/src/tui/components/InitWizard.tsx +217 -132
  162. package/src/tui/components/Markdown.tsx +35 -35
  163. package/src/tui/components/ModelSelector.tsx +87 -87
  164. package/src/tui/components/StatusBar.tsx +30 -30
  165. package/src/tui/components/Thinking.tsx +17 -17
  166. package/src/tui/components/ToolCall.tsx +102 -71
  167. package/src/tui/components/UserInput.tsx +131 -131
  168. package/src/tui/hooks/useChat.ts +287 -194
  169. package/src/tui/hooks/useCommands.ts +234 -154
  170. package/src/tui/index.ts +6 -6
  171. package/src/tui/welcome.ts +177 -177
  172. package/src/types.ts +104 -42
  173. package/src/utils/diff.ts +71 -71
  174. package/src/utils/project.ts +99 -99
  175. package/src/utils/stableStringify.ts +47 -0
  176. package/src/utils/thinking.ts +119 -0
  177. package/tests/cache/fingerprint.test.ts +75 -0
  178. package/tests/cache/stableStringify.test.ts +43 -0
  179. package/tests/cache/stats.test.ts +146 -0
  180. package/tests/cache/volatile.test.ts +75 -0
  181. package/tests/smoke-pollution.mjs +78 -0
  182. package/tests/smoke-thinking.mjs +110 -0
  183. package/tests/smoke-tool-stream.mjs +69 -0
  184. package/tests/smoke-tool.mjs +117 -0
@@ -1,35 +1,35 @@
1
- import type { Skill } from './index.js';
2
-
3
- export const triageSkill: Skill = {
4
- id: 'triage',
5
- name: 'Issue Triage',
6
- description: 'Quickly diagnose and prioritize issues',
7
- category: 'debugging',
8
- autoActivate: ['issue', 'problem', 'not working', 'broken', '不工作', '挂了'],
9
- prompt: `## Issue Triage
10
-
11
- When something is broken, quickly assess:
12
-
13
- ### Severity Classification
14
- - **P0 Critical**: System down, data loss, security breach
15
- - **P1 High**: Major feature broken, no workaround
16
- - **P2 Medium**: Feature degraded, workaround exists
17
- - **P3 Low**: Minor issue, cosmetic, nice-to-have
18
-
19
- ### Quick Diagnosis
20
- 1. **What changed?** - Recent commits, deployments, config changes
21
- 2. **Who is affected?** - All users, some users, specific environment
22
- 3. **When did it start?** - Timeline of first occurrence
23
- 4. **What's the impact?** - Data loss, functionality, UX
24
-
25
- ### Triage Output
26
- \`\`\`
27
- ## Triage: [Issue Title]
28
-
29
- **Severity**: P1 High
30
- **Impact**: [who/what is affected]
31
- **Root Cause**: [best guess based on evidence]
32
- **Suggested Fix**: [minimal fix approach]
33
- **Workaround**: [if any]
34
- \`\`\``,
35
- };
1
+ import type { Skill } from './index.js';
2
+
3
+ export const triageSkill: Skill = {
4
+ id: 'triage',
5
+ name: 'Issue Triage',
6
+ description: 'Quickly diagnose and prioritize issues',
7
+ category: 'debugging',
8
+ autoActivate: ['issue', 'problem', 'not working', 'broken', '不工作', '挂了'],
9
+ prompt: `## Issue Triage
10
+
11
+ When something is broken, quickly assess:
12
+
13
+ ### Severity Classification
14
+ - **P0 Critical**: System down, data loss, security breach
15
+ - **P1 High**: Major feature broken, no workaround
16
+ - **P2 Medium**: Feature degraded, workaround exists
17
+ - **P3 Low**: Minor issue, cosmetic, nice-to-have
18
+
19
+ ### Quick Diagnosis
20
+ 1. **What changed?** - Recent commits, deployments, config changes
21
+ 2. **Who is affected?** - All users, some users, specific environment
22
+ 3. **When did it start?** - Timeline of first occurrence
23
+ 4. **What's the impact?** - Data loss, functionality, UX
24
+
25
+ ### Triage Output
26
+ \`\`\`
27
+ ## Triage: [Issue Title]
28
+
29
+ **Severity**: P1 High
30
+ **Impact**: [who/what is affected]
31
+ **Root Cause**: [best guess based on evidence]
32
+ **Suggested Fix**: [minimal fix approach]
33
+ **Workaround**: [if any]
34
+ \`\`\``,
35
+ };
@@ -1,31 +1,31 @@
1
- import type { Skill } from './index.js';
2
-
3
- export const verificationSkill: Skill = {
4
- id: 'verification',
5
- name: 'Verification Before Completion',
6
- description: 'Always verify work before marking as done',
7
- category: 'workflow',
8
- prompt: `## Verification Protocol
9
-
10
- Before saying "done", always verify:
11
-
12
- ### For Code Changes
13
- 1. **Read the file** - Confirm the change was actually saved
14
- 2. **Check syntax** - Make sure there are no syntax errors
15
- 3. **Run tests** - If tests exist, run them
16
- 4. **Check imports** - Verify all imports resolve
17
-
18
- ### For File Operations
19
- 1. **Verify file exists** - Check the file was created/modified
20
- 2. **Read it back** - Confirm the content is correct
21
- 3. **Check permissions** - Ensure the file is accessible
22
-
23
- ### For Commands
24
- 1. **Check exit code** - Was it 0?
25
- 2. **Read output** - Look for warnings or errors
26
- 3. **Verify side effects** - Did the command do what was expected?
27
-
28
- ### Never Say "Done" Without
29
- - Seeing actual output confirming success
30
- - Or running a verification command`,
31
- };
1
+ import type { Skill } from './index.js';
2
+
3
+ export const verificationSkill: Skill = {
4
+ id: 'verification',
5
+ name: 'Verification Before Completion',
6
+ description: 'Always verify work before marking as done',
7
+ category: 'workflow',
8
+ prompt: `## Verification Protocol
9
+
10
+ Before saying "done", always verify:
11
+
12
+ ### For Code Changes
13
+ 1. **Read the file** - Confirm the change was actually saved
14
+ 2. **Check syntax** - Make sure there are no syntax errors
15
+ 3. **Run tests** - If tests exist, run them
16
+ 4. **Check imports** - Verify all imports resolve
17
+
18
+ ### For File Operations
19
+ 1. **Verify file exists** - Check the file was created/modified
20
+ 2. **Read it back** - Confirm the content is correct
21
+ 3. **Check permissions** - Ensure the file is accessible
22
+
23
+ ### For Commands
24
+ 1. **Check exit code** - Was it 0?
25
+ 2. **Read output** - Look for warnings or errors
26
+ 3. **Verify side effects** - Did the command do what was expected?
27
+
28
+ ### Never Say "Done" Without
29
+ - Seeing actual output confirming success
30
+ - Or running a verification command`,
31
+ };
@@ -1,42 +1,42 @@
1
- import type { Skill } from './index.js';
2
-
3
- export const writingPlansSkill: Skill = {
4
- id: 'writing-plans',
5
- name: 'Writing Plans',
6
- description: 'Break down complex tasks into step-by-step execution plans',
7
- category: 'planning',
8
- autoActivate: ['plan', '怎么实现', '如何做', '方案', '设计', '架构'],
9
- prompt: `## Planning Mode
10
-
11
- When the user asks you to plan something or the task is complex:
12
-
13
- 1. **Understand the goal** - Clarify what the user wants to achieve
14
- 2. **Explore the codebase** - Read relevant files to understand context
15
- 3. **Break it down** - Create a numbered list of concrete steps
16
- 4. **Identify risks** - Note potential issues or blockers
17
- 5. **Estimate complexity** - Mark steps as simple/medium/complex
18
-
19
- ### Plan Format
20
- \`\`\`
21
- ## Plan: [Task Description]
22
-
23
- ### Context
24
- - What we know about the current state
25
- - Files/modules involved
26
-
27
- ### Steps
28
- 1. [Step description] (simple/medium/complex)
29
- 2. [Step description]
30
- - Sub-step if needed
31
- 3. [Step description]
32
-
33
- ### Risks
34
- - [Potential issue and mitigation]
35
-
36
- ### Files to modify
37
- - path/to/file1.ts - [what changes]
38
- - path/to/file2.ts - [what changes]
39
- \`\`\`
40
-
41
- Always present the plan to the user before executing. Ask: "Should I proceed with this plan?"`,
42
- };
1
+ import type { Skill } from './index.js';
2
+
3
+ export const writingPlansSkill: Skill = {
4
+ id: 'writing-plans',
5
+ name: 'Writing Plans',
6
+ description: 'Break down complex tasks into step-by-step execution plans',
7
+ category: 'planning',
8
+ autoActivate: ['plan', '怎么实现', '如何做', '方案', '设计', '架构'],
9
+ prompt: `## Planning Mode
10
+
11
+ When the user asks you to plan something or the task is complex:
12
+
13
+ 1. **Understand the goal** - Clarify what the user wants to achieve
14
+ 2. **Explore the codebase** - Read relevant files to understand context
15
+ 3. **Break it down** - Create a numbered list of concrete steps
16
+ 4. **Identify risks** - Note potential issues or blockers
17
+ 5. **Estimate complexity** - Mark steps as simple/medium/complex
18
+
19
+ ### Plan Format
20
+ \`\`\`
21
+ ## Plan: [Task Description]
22
+
23
+ ### Context
24
+ - What we know about the current state
25
+ - Files/modules involved
26
+
27
+ ### Steps
28
+ 1. [Step description] (simple/medium/complex)
29
+ 2. [Step description]
30
+ - Sub-step if needed
31
+ 3. [Step description]
32
+
33
+ ### Risks
34
+ - [Potential issue and mitigation]
35
+
36
+ ### Files to modify
37
+ - path/to/file1.ts - [what changes]
38
+ - path/to/file2.ts - [what changes]
39
+ \`\`\`
40
+
41
+ Always present the plan to the user before executing. Ask: "Should I proceed with this plan?"`,
42
+ };