@hncode/hncode 0.8.1 → 0.8.3

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 (52) hide show
  1. package/README.md +18 -0
  2. package/README_CN.md +14 -0
  3. package/bin/hncode +54 -8
  4. package/package.json +1 -1
  5. package/src/agent-task.js +356 -337
  6. package/src/agent.js +1465 -1405
  7. package/src/animate.js +56 -0
  8. package/src/colors.js +615 -593
  9. package/src/config.js +50 -7
  10. package/src/context-bar.js +280 -278
  11. package/src/doctor.js +4 -3
  12. package/src/file-tree.js +4 -3
  13. package/src/highlight.js +20 -6
  14. package/src/i18n.js +1432 -389
  15. package/src/image-row.js +11 -2
  16. package/src/index.js +218 -6
  17. package/src/keybindings.js +2 -1
  18. package/src/llm.js +146 -21
  19. package/src/log-file.js +112 -0
  20. package/src/markdown.js +646 -567
  21. package/src/mcp-server.js +409 -0
  22. package/src/mcp.js +279 -29
  23. package/src/memory-profile.js +19 -16
  24. package/src/migrate-index.js +175 -0
  25. package/src/migrate.js +392 -0
  26. package/src/panels.js +9 -7
  27. package/src/plan.js +7 -5
  28. package/src/plugin.js +37 -21
  29. package/src/registry-browser.js +17 -15
  30. package/src/rows-plan-bg.js +3 -2
  31. package/src/rows-status.js +20 -6
  32. package/src/rows-tool-result.js +242 -208
  33. package/src/screen-paint.js +153 -128
  34. package/src/session-recover.js +317 -0
  35. package/src/session.js +203 -13
  36. package/src/settings-schema.js +9 -0
  37. package/src/swarm-progress.js +6 -2
  38. package/src/tasks-browser.js +37 -36
  39. package/src/team-panel.js +12 -11
  40. package/src/term.js +57 -21
  41. package/src/text.js +254 -149
  42. package/src/tool-line.js +7 -2
  43. package/src/tool-result.js +400 -327
  44. package/src/tools/agent.js +7 -2
  45. package/src/tools/ask-user-question.js +1 -2
  46. package/src/tools/bash.js +446 -434
  47. package/src/tools/edit.js +653 -665
  48. package/src/tools/goal.js +130 -93
  49. package/src/tools/read.js +141 -133
  50. package/src/tools/tasks.js +214 -214
  51. package/src/tools/utils.js +143 -104
  52. package/src/tui.js +20887 -19942
@@ -58,7 +58,12 @@ export function listSubagents() {
58
58
  function systemPromptFor(type, cfg, systemPrompt) {
59
59
  const profile = SUBAGENT_TYPES[type] || SUBAGENT_TYPES[DEFAULT_SUBAGENT_TYPE];
60
60
  const base = (cfg.systemPrompt && String(cfg.systemPrompt).trim()) || systemPrompt;
61
- return `${profile.prompt}\n\n${base}`;
61
+ // The inline-reasoning instruction, for a model with no reasoning channel of its own —
62
+ // the same rule the main agent applies (see needsThinkingTags).
63
+ const tags = needsThinkingTags(cfg)
64
+ ? `\n\n${THINKING_TAGS_INSTRUCTION}`
65
+ : '';
66
+ return `${profile.prompt}\n\n${base}${tags}`;
62
67
  }
63
68
 
64
69
  // Run a subagent to completion. `history` seeds its messages (fork). Returns
@@ -70,7 +75,7 @@ function systemPromptFor(type, cfg, systemPrompt) {
70
75
  async function runSubagent({ cfg, type, prompt, history, signal, onEvent, onProgress, onStep, agentId, onAgent }) {
71
76
  // The parent-signal listener (registered below, removed when the run settles).
72
77
  let onSubagentAbort = null;
73
- const { Agent, SYSTEM_PROMPT } = await import('../agent.js');
78
+ const { Agent, SYSTEM_PROMPT, THINKING_TAGS_INSTRUCTION, needsThinkingTags } = await import('../agent.js');
74
79
  const subCfg = {
75
80
  ...cfg,
76
81
  systemPrompt: systemPromptFor(type, cfg, SYSTEM_PROMPT),
@@ -53,8 +53,7 @@ Do NOT use it for what you can infer from context, or for trivial decisions —
53
53
 
54
54
  Usage:
55
55
  - Users always get an "Other" option; do not create one.
56
- + 'For an answer that cannot be enumerated (a name, a path, a description), set free_text: true and omit'
57
- + ' options — the user gets a focused field instead of a list.',
56
+ For an answer that cannot be enumerated (a name, a path, a description), set free_text: true and omit options — the user gets a focused field instead of a list.
58
57
  - 2-4 distinct options per question, labels 1-5 words, descriptions carry the trade-offs. Labels unique within a question, question texts unique across the call.
59
58
  - 1-4 questions at a time, related ones grouped. multi_select allows several answers.
60
59
  - Put a recommended option first and append "(Recommended)" to its label.