@princetheprogrammerbtw/husk 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -3,13 +3,16 @@
3
3
  > The agent harness that gives your LLM memory, hands, and a nervous system.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/%40princetheprogrammerbtw%2Fhusk.svg)](https://www.npmjs.com/package/@princetheprogrammerbtw/husk)
6
+ [![npm downloads](https://img.shields.io/npm/dm/%40princetheprogrammerbtw%2Fhusk.svg)](https://www.npmjs.com/package/@princetheprogrammerbtw/husk)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
8
  [![Node](https://img.shields.io/node/v/%40princetheprogrammerbtw%2Fhusk.svg)](https://nodejs.org)
8
- [![CI](https://github.com/10xdev4u-alt/husk/actions/workflows/ci.yml/badge.svg)](./.github/workflows/ci.yml)
9
+ [![CI](https://github.com/10xdev4u-alt/husk/actions/workflows/ci.yml/badge.svg)](https://github.com/10xdev4u-alt/husk/actions/workflows/ci.yml)
10
+ [![GitHub stars](https://img.shields.io/github/stars/10xdev4u-alt/husk.svg)](https://github.com/10xdev4u-alt/husk/stargazers)
11
+ [![Bundle size](https://img.shields.io/bundlephobia/minzip/%40princetheprogrammerbtw%2Fhusk.svg)](https://bundlephobia.com/package/@princetheprogrammerbtw/husk)
9
12
 
10
13
  ## What is Husk?
11
14
 
12
- Most LLM calls are a brain in a jar — they can think, but can't act, remember, verify their own work, or show you what they did. **Husk** is the body, hands, memory, and nervous system you wrap around any LLM (Claude, GPT, Gemini, local models) to turn it into a real agent.
15
+ Most LLM calls are a **brain in a jar** — they can think, but can't act, remember, verify their own work, or show you what they did. **Husk** is the body, hands, memory, and nervous system you wrap around any LLM (Claude, GPT, Gemini, local models) to turn it into a real agent.
13
16
 
14
17
  ```ts
15
18
  import { Agent, AnthropicProvider, Read, Write, Edit, Bash, Grep, FileStore } from '@princetheprogrammerbtw/husk';
@@ -31,16 +34,27 @@ const result = await agent.run('Review src/core/agent.ts');
31
34
  console.log(result.output);
32
35
  ```
33
36
 
37
+ ## Why Husk?
38
+
39
+ | You're used to… | Husk gives you… |
40
+ |---|---|
41
+ | One-shot LLM calls with no memory | Persistent file-backed or in-memory memory across calls |
42
+ | Hand-rolled tool-calling loops | A small, typed event stream you can subscribe to |
43
+ | Tied to one provider's SDK | Provider-agnostic core; swap Anthropic ↔ OpenAI in one line |
44
+ | Reinventing agent loops in every project | Drop-in `Agent` class with stop conditions, parallel tool execution, and error recovery |
45
+ | No observability into what the model actually did | Typed events for every iteration, tool call, and provider response |
46
+
34
47
  ## Features
35
48
 
36
49
  - 🧠 **Provider-agnostic** — Anthropic, OpenAI, more coming. Bring your own model.
37
- - 🛠️ **5 built-in tools** — `Read`, `Write`, `Edit`, `Bash` (with safety denylist), `Grep` (ripgrep with grep fallback)
50
+ - 🛠️ **5 built-in tools** — `Read`, `Write`, `Edit`, `Bash` (with safety denylist for `rm -rf /`, fork bombs, etc.), `Grep` (ripgrep with grep fallback)
38
51
  - 💾 **Memory** — `InMemoryStore` for sessions, `FileStore` for persistence
39
52
  - 👀 **Observability** — typed event emitter, drop in any logger or tracer
40
53
  - 🧭 **Steering** — system prompts, numbered rules, few-shot examples
41
54
  - 🤝 **Sub-agents** — compose agents inside agents (see [multi-agent example](./examples/03-multi-agent))
42
- - 📦 **Batteries included** — 35KB ESM bundle, full TypeScript types
55
+ - 📦 **Batteries included** — 35KB ESM bundle, 26KB d.ts, zero runtime deps except the provider SDKs
43
56
  - 🖥️ **CLI** — `husk run "<prompt>"` for one-shot invocations
57
+ - 🔒 **Type-safe** — strict TypeScript, no `any`, full type definitions shipped
44
58
 
45
59
  ## Install
46
60
 
@@ -50,6 +64,8 @@ npm install @princetheprogrammerbtw/husk
50
64
  pnpm add @princetheprogrammerbtw/husk
51
65
  # or
52
66
  bun add @princetheprogrammerbtw/husk
67
+ # or
68
+ yarn add @princetheprogrammerbtw/husk
53
69
  ```
54
70
 
55
71
  You'll also need an API key for the provider you choose:
@@ -61,7 +77,7 @@ export OPENAI_API_KEY=sk-... # for GPT
61
77
 
62
78
  ## Quickstart
63
79
 
64
- The smallest possible agent:
80
+ The smallest possible agent — model, prompt, done:
65
81
 
66
82
  ```ts
67
83
  import { Agent, AnthropicProvider } from '@princetheprogrammerbtw/husk';
@@ -74,6 +90,41 @@ const result = await agent.run('What is the capital of France? Answer in one sen
74
90
  console.log(result.output); // "Paris"
75
91
  ```
76
92
 
93
+ A more realistic agent — with tools, memory, and steering:
94
+
95
+ ```ts
96
+ import {
97
+ Agent, AnthropicProvider, Read, Write, Edit, Bash, Grep,
98
+ FileStore, InMemoryStore,
99
+ } from '@princetheprogrammerbtw/husk';
100
+
101
+ const agent = new Agent({
102
+ model: new AnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY }),
103
+ tools: [Read, Write, Edit, Bash, Grep],
104
+ memory: new FileStore({ path: './.husk/memory' }),
105
+ steering: {
106
+ systemPrompt: 'You are a careful code reviewer.',
107
+ rules: [
108
+ 'Read the file in full before commenting.',
109
+ 'Cite specific line numbers for every finding.',
110
+ ],
111
+ },
112
+ });
113
+
114
+ const result = await agent.run('Review src/core/agent.ts');
115
+ ```
116
+
117
+ Swapping to OpenAI is a one-line change:
118
+
119
+ ```ts
120
+ import { OpenAIProvider } from '@princetheprogrammerbtw/husk';
121
+
122
+ const agent = new Agent({
123
+ model: new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY }),
124
+ // ...same config otherwise
125
+ });
126
+ ```
127
+
77
128
  ## CLI
78
129
 
79
130
  ```bash
@@ -84,9 +135,11 @@ husk run "Summarize README.md" --provider openai --model gpt-5
84
135
  husk run --help
85
136
  ```
86
137
 
138
+ The CLI wraps the same `Agent` class — flags map directly to `AgentConfig` fields.
139
+
87
140
  ## Examples
88
141
 
89
- Three worked examples in the `examples/` directory:
142
+ Three worked examples in the [`examples/`](./examples) directory:
90
143
 
91
144
  - **[01-hello-agent](./examples/01-hello-agent)** — minimal agent, no tools
92
145
  - **[02-code-reviewer](./examples/02-code-reviewer)** — full tool set + steering for code review
@@ -96,9 +149,10 @@ Run any example with `bun run examples/0X-name/index.ts`.
96
149
 
97
150
  ## Documentation
98
151
 
99
- - **[Learning Journal](./LEARNING.md)** — design decisions, trade-offs, and lessons learned
100
- - **[Changelog](./CHANGELOG.md)** — release history
101
- - **[Contributing](./CONTRIBUTING.md)** — how to contribute
152
+ - 📓 **[Learning Journal](./LEARNING.md)** — design decisions, trade-offs, and lessons learned while building
153
+ - 📋 **[Changelog](./CHANGELOG.md)** — release history
154
+ - 🤝 **[Contributing](./CONTRIBUTING.md)** — how to contribute
155
+ - 🏗️ **[Architecture](#architecture)** — the module layout, below
102
156
 
103
157
  ## Architecture
104
158
 
@@ -111,15 +165,26 @@ src/
111
165
  └── index.ts # public API surface
112
166
  ```
113
167
 
114
- Every piece composes through a typed event stream. The agent loop is ~150 lines. Provider adapters are the only files that know about provider-specific wire formats.
168
+ Every piece composes through a **typed event stream**. The agent loop is ~150 lines. Provider adapters are the only files that know about provider-specific wire formats. Tools are plain objects implementing a 4-field interface — register by passing an array to the Agent.
115
169
 
116
170
  ## Roadmap
117
171
 
118
172
  - **v0.1.0** ✅ Core loop, Anthropic + OpenAI, 5 built-in tools, memory, observability, CLI
173
+ - **v0.1.1** ✅ CLI shebang fix, version bump
119
174
  - **v0.2.0** Eval runner, OTel export, Ollama adapter
120
175
  - **v0.3.0** Vector memory, hosted dashboard
121
176
  - **v1.0.0** Stable API, marketplace, enterprise features
122
177
 
178
+ ## Contributing
179
+
180
+ PRs welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for the dev setup, scripts, and commit conventions.
181
+
182
+ The project follows Conventional Commits. Every commit body explains *why*, not what — the diff already shows what.
183
+
184
+ ## Show your support
185
+
186
+ If Husk saves you time, ⭐️ the [GitHub repo](https://github.com/10xdev4u-alt/husk) — it helps others find the project. Issues, PRs, and feedback all welcome.
187
+
123
188
  ## License
124
189
 
125
- MIT © 2026 princetheprogrammerbtw
190
+ MIT © 2026 [princetheprogrammerbtw](https://github.com/10xdev4u-alt)
package/dist/cli/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { promisify, parseArgs } from 'util';
2
3
  import { promises } from 'fs';
3
4
  import { resolve, dirname, join } from 'path';
@@ -5,8 +6,6 @@ import Anthropic from '@anthropic-ai/sdk';
5
6
  import OpenAI from 'openai';
6
7
  import { exec } from 'child_process';
7
8
 
8
- // src/cli/index.ts
9
-
10
9
  // src/core/events.ts
11
10
  var AgentEventEmitter = class {
12
11
  handlers = /* @__PURE__ */ new Map();
@@ -1140,7 +1139,7 @@ Examples:
1140
1139
  husk run "Summarize README.md" --provider openai --model gpt-5
1141
1140
  `);
1142
1141
  }
1143
- var VERSION = "0.0.1";
1142
+ var VERSION = "0.1.0";
1144
1143
  await main();
1145
1144
  //# sourceMappingURL=index.js.map
1146
1145
  //# sourceMappingURL=index.js.map