@kolisachint/hoocode-agent 0.5.12 → 0.5.14

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 (91) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/config.d.ts +9 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +16 -0
  5. package/dist/config.js.map +1 -1
  6. package/dist/core/context-files.d.ts +16 -3
  7. package/dist/core/context-files.d.ts.map +1 -1
  8. package/dist/core/context-files.js +77 -6
  9. package/dist/core/context-files.js.map +1 -1
  10. package/dist/core/extensions/loader.d.ts +18 -6
  11. package/dist/core/extensions/loader.d.ts.map +1 -1
  12. package/dist/core/extensions/loader.js +35 -19
  13. package/dist/core/extensions/loader.js.map +1 -1
  14. package/dist/core/extensions/plugins/install.d.ts +51 -10
  15. package/dist/core/extensions/plugins/install.d.ts.map +1 -1
  16. package/dist/core/extensions/plugins/install.js +178 -31
  17. package/dist/core/extensions/plugins/install.js.map +1 -1
  18. package/dist/core/extensions/plugins/listing.d.ts +8 -2
  19. package/dist/core/extensions/plugins/listing.d.ts.map +1 -1
  20. package/dist/core/extensions/plugins/listing.js +29 -5
  21. package/dist/core/extensions/plugins/listing.js.map +1 -1
  22. package/dist/core/extensions/plugins/locations.d.ts +62 -12
  23. package/dist/core/extensions/plugins/locations.d.ts.map +1 -1
  24. package/dist/core/extensions/plugins/locations.js +74 -18
  25. package/dist/core/extensions/plugins/locations.js.map +1 -1
  26. package/dist/core/extensions/plugins/marketplace.d.ts +29 -3
  27. package/dist/core/extensions/plugins/marketplace.d.ts.map +1 -1
  28. package/dist/core/extensions/plugins/marketplace.js +40 -7
  29. package/dist/core/extensions/plugins/marketplace.js.map +1 -1
  30. package/dist/core/extensions/plugins/trust.d.ts +56 -0
  31. package/dist/core/extensions/plugins/trust.d.ts.map +1 -0
  32. package/dist/core/extensions/plugins/trust.js +88 -0
  33. package/dist/core/extensions/plugins/trust.js.map +1 -0
  34. package/dist/core/learn/digest.d.ts +17 -0
  35. package/dist/core/learn/digest.d.ts.map +1 -0
  36. package/dist/core/learn/digest.js +131 -0
  37. package/dist/core/learn/digest.js.map +1 -0
  38. package/dist/core/learn/extract.d.ts +178 -0
  39. package/dist/core/learn/extract.d.ts.map +1 -0
  40. package/dist/core/learn/extract.js +705 -0
  41. package/dist/core/learn/extract.js.map +1 -0
  42. package/dist/core/learn/normalize.d.ts +65 -0
  43. package/dist/core/learn/normalize.d.ts.map +1 -0
  44. package/dist/core/learn/normalize.js +245 -0
  45. package/dist/core/learn/normalize.js.map +1 -0
  46. package/dist/core/learn/state.d.ts +115 -0
  47. package/dist/core/learn/state.d.ts.map +1 -0
  48. package/dist/core/learn/state.js +151 -0
  49. package/dist/core/learn/state.js.map +1 -0
  50. package/dist/core/settings-defaults.d.ts +6 -0
  51. package/dist/core/settings-defaults.d.ts.map +1 -1
  52. package/dist/core/settings-defaults.js +6 -0
  53. package/dist/core/settings-defaults.js.map +1 -1
  54. package/dist/core/settings-manager.d.ts +21 -0
  55. package/dist/core/settings-manager.d.ts.map +1 -1
  56. package/dist/core/settings-manager.js +31 -0
  57. package/dist/core/settings-manager.js.map +1 -1
  58. package/dist/core/settings-types.d.ts +6 -0
  59. package/dist/core/settings-types.d.ts.map +1 -1
  60. package/dist/core/settings-types.js.map +1 -1
  61. package/dist/core/tools/plugins.d.ts.map +1 -1
  62. package/dist/core/tools/plugins.js +18 -3
  63. package/dist/core/tools/plugins.js.map +1 -1
  64. package/dist/extensions/core/hoo-core.d.ts.map +1 -1
  65. package/dist/extensions/core/hoo-core.js +2 -0
  66. package/dist/extensions/core/hoo-core.js.map +1 -1
  67. package/dist/extensions/core/learn.d.ts +22 -0
  68. package/dist/extensions/core/learn.d.ts.map +1 -0
  69. package/dist/extensions/core/learn.js +167 -0
  70. package/dist/extensions/core/learn.js.map +1 -0
  71. package/dist/extensions/core/marketplace.d.ts +7 -3
  72. package/dist/extensions/core/marketplace.d.ts.map +1 -1
  73. package/dist/extensions/core/marketplace.js +103 -11
  74. package/dist/extensions/core/marketplace.js.map +1 -1
  75. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  76. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  77. package/dist/modes/interactive/components/settings-selector.js +15 -2
  78. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  79. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  80. package/dist/modes/interactive/interactive-mode.js +6 -0
  81. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  82. package/dist/modes/interactive/resource-display.d.ts.map +1 -1
  83. package/dist/modes/interactive/resource-display.js +6 -1
  84. package/dist/modes/interactive/resource-display.js.map +1 -1
  85. package/docs/settings.md +31 -0
  86. package/docs/usage.md +64 -2
  87. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  88. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  89. package/examples/extensions/sandbox/package.json +1 -1
  90. package/examples/extensions/with-deps/package.json +1 -1
  91. package/package.json +4 -4
package/docs/usage.md CHANGED
@@ -47,6 +47,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
47
47
  | `/fork` | Create a new session from a previous user message |
48
48
  | `/clone` | Duplicate the current active branch into a new session |
49
49
  | `/compact [prompt]` | Manually compact context, optionally with custom instructions |
50
+ | `/learn [all\|stats]` | Mine recent sessions for repeated directives, fixes, and workflows and promote them to `AGENTS.md` or a skill; `stats` reports what became of past proposals |
50
51
  | `/copy` | Copy last assistant message to clipboard |
51
52
  | `/export [file]` | Export session to HTML |
52
53
  | `/share` | Upload as private GitHub gist with shareable HTML link |
@@ -92,14 +93,75 @@ See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
92
93
 
93
94
  ## Context Files
94
95
 
95
- HooCode loads `AGENTS.md` or `CLAUDE.md` at startup from:
96
+ HooCode loads `AGENTS.md` or `CLAUDE.md` at startup from, least specific first:
96
97
 
97
- - `~/.hoocode/agent/AGENTS.md` for global instructions
98
+ - `~/.agents/AGENTS.md` the cross-vendor user scope, shared with other agent tools
99
+ - `~/.hoocode/agent/AGENTS.md` — hoocode's own global instructions, which win on conflict
98
100
  - parent directories, walking up from the current working directory
99
101
  - the current directory
100
102
 
103
+ Both user scopes are read additively: neither shadows the other, so an existing
104
+ `~/.hoocode` file keeps working when you add a `~/.agents` one.
105
+
101
106
  Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
102
107
 
108
+ Context files are re-sent on **every** request, so their size is a recurring
109
+ cost. HooCode warns when one file grows past ~2k tokens, truncates it past ~10k,
110
+ and warns again when the set as a whole passes ~6k — trimming the least specific
111
+ scope first past ~16k. The startup listing shows the running total.
112
+
113
+ Long or conditional guidance belongs in a [skill](skills.md) instead: skills load
114
+ on demand, context files load always.
115
+
116
+ ### Learning rules from your sessions
117
+
118
+ `/learn` reads recent session transcripts for this directory, and reports what
119
+ repeated:
120
+
121
+ - **Directives you restated** across sessions — candidate rules, with the count
122
+ that justifies them. An item marked `restated` is already covered by a rule
123
+ that is not working and wants rewriting, not duplicating.
124
+ - **Failures you resolved** — a command that failed, then later succeeded
125
+ unchanged, with the work in between.
126
+ - **Repeated tool sequences** — candidate skills. Only procedures qualify: a
127
+ sequence has to chain at least two distinct doing-commands (test then commit,
128
+ build then publish). The edit/test rhythm is one command and every rotation of
129
+ itself, so it is not reported.
130
+
131
+ It then proposes edits to the repo `AGENTS.md`, to `~/.agents/AGENTS.md` for
132
+ habits that travel with you, or as a new skill. Nothing is written without the
133
+ usual edit approval. Because it reads transcripts from disk rather than the live
134
+ conversation, it still works after the session has been compacted.
135
+
136
+ `/learn stats` reports what became of past proposals: how many were shown, and
137
+ what share of the directive proposals you actually wrote down. It reads the
138
+ history file rather than re-mining sessions, so it is instant.
139
+
140
+ Read the number carefully. Adoption is a proxy for usefulness, not ground truth
141
+ — a proposal you correctly rejected as not durable counts against it exactly like
142
+ a junk one. Near zero means the extractor is proposing the wrong things; near
143
+ 100% means the bar is too low and everything is getting through. The trend
144
+ matters more than the value, and it is the fastest way to tell whether a change
145
+ to `learnMinRepeats` helped.
146
+
147
+ `/learn` remembers what it has already shown you, per directory. An item comes
148
+ back only once it recurs *after* it was last put in front of you — so a rule you
149
+ accepted is not re-proposed, and one you passed on does not reappear every run
150
+ unchanged. Something you keep saying anyway will return, which is the point: that
151
+ is the case where the existing rule is not working. Run `/learn all` to ignore
152
+ that memory and re-propose everything in the window.
153
+
154
+ An item shown before that still is not written down anywhere is flagged as
155
+ previously declined, so it is proposed tentatively rather than pressed a second
156
+ time. That inference reads context files and skills alike, so a proposal you
157
+ routed to `~/.agents/AGENTS.md` or turned into a skill both count as adopted.
158
+
159
+ When a directive is already covered by a **skill** and you keep asking for it by
160
+ hand, it comes back marked `has-skill` rather than as a new rule. That is a
161
+ triggering problem, not a missing rule: the skill's `description` frontmatter
162
+ probably does not describe the situation you were in, so sharpening it is the fix
163
+ rather than writing a rule that duplicates the skill.
164
+
103
165
  ### System Prompt Files
104
166
 
105
167
  Replace the default system prompt with:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.3.12",
4
+ "version": "0.3.14",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.3.12",
4
+ "version": "0.3.14",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.3.12",
4
+ "version": "0.3.14",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.3.12",
4
+ "version": "0.3.14",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "bun": ">=1.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolisachint/hoocode-agent",
3
- "version": "0.5.12",
3
+ "version": "0.5.14",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "hoocodeConfig": {
@@ -49,9 +49,9 @@
49
49
  "prepublishOnly": "npm run clean && npm run build"
50
50
  },
51
51
  "dependencies": {
52
- "@kolisachint/hoocode-agent-core": "^0.5.12",
53
- "@kolisachint/hoocode-ai": "^0.5.12",
54
- "@kolisachint/hoocode-tui": "^0.5.12",
52
+ "@kolisachint/hoocode-agent-core": "^0.5.14",
53
+ "@kolisachint/hoocode-ai": "^0.5.14",
54
+ "@kolisachint/hoocode-tui": "^0.5.14",
55
55
  "@silvia-odwyer/photon-node": "^0.3.4",
56
56
  "chalk": "^5.5.0",
57
57
  "cli-highlight": "^2.1.11",