@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.
- package/README.md +18 -0
- package/README_CN.md +14 -0
- package/bin/hncode +54 -8
- package/package.json +1 -1
- package/src/agent-task.js +356 -337
- package/src/agent.js +1465 -1405
- package/src/animate.js +56 -0
- package/src/colors.js +615 -593
- package/src/config.js +50 -7
- package/src/context-bar.js +280 -278
- package/src/doctor.js +4 -3
- package/src/file-tree.js +4 -3
- package/src/highlight.js +20 -6
- package/src/i18n.js +1432 -389
- package/src/image-row.js +11 -2
- package/src/index.js +218 -6
- package/src/keybindings.js +2 -1
- package/src/llm.js +146 -21
- package/src/log-file.js +112 -0
- package/src/markdown.js +646 -567
- package/src/mcp-server.js +409 -0
- package/src/mcp.js +279 -29
- package/src/memory-profile.js +19 -16
- package/src/migrate-index.js +175 -0
- package/src/migrate.js +392 -0
- package/src/panels.js +9 -7
- package/src/plan.js +7 -5
- package/src/plugin.js +37 -21
- package/src/registry-browser.js +17 -15
- package/src/rows-plan-bg.js +3 -2
- package/src/rows-status.js +20 -6
- package/src/rows-tool-result.js +242 -208
- package/src/screen-paint.js +153 -128
- package/src/session-recover.js +317 -0
- package/src/session.js +203 -13
- package/src/settings-schema.js +9 -0
- package/src/swarm-progress.js +6 -2
- package/src/tasks-browser.js +37 -36
- package/src/team-panel.js +12 -11
- package/src/term.js +57 -21
- package/src/text.js +254 -149
- package/src/tool-line.js +7 -2
- package/src/tool-result.js +400 -327
- package/src/tools/agent.js +7 -2
- package/src/tools/ask-user-question.js +1 -2
- package/src/tools/bash.js +446 -434
- package/src/tools/edit.js +653 -665
- package/src/tools/goal.js +130 -93
- package/src/tools/read.js +141 -133
- package/src/tools/tasks.js +214 -214
- package/src/tools/utils.js +143 -104
- package/src/tui.js +20887 -19942
package/src/tools/agent.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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.
|