smolcoder-plus 1.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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -0
  3. package/dist/agent.js +748 -0
  4. package/dist/attachments.js +158 -0
  5. package/dist/config.js +87 -0
  6. package/dist/context.js +498 -0
  7. package/dist/detect.js +474 -0
  8. package/dist/events.js +24 -0
  9. package/dist/history.js +9 -0
  10. package/dist/hosts.js +107 -0
  11. package/dist/index.js +391 -0
  12. package/dist/logo.js +48 -0
  13. package/dist/netscan.js +159 -0
  14. package/dist/network.js +193 -0
  15. package/dist/plan.js +102 -0
  16. package/dist/prompt.js +84 -0
  17. package/dist/providers/lmstudio.js +347 -0
  18. package/dist/providers/ollama.js +269 -0
  19. package/dist/providers/scheduler.js +57 -0
  20. package/dist/providers/transport.js +86 -0
  21. package/dist/providers/types.js +62 -0
  22. package/dist/sandbox.js +207 -0
  23. package/dist/session.js +639 -0
  24. package/dist/tools/check.js +193 -0
  25. package/dist/tools/fs-tools.js +431 -0
  26. package/dist/tools/index.js +260 -0
  27. package/dist/tools/search-worker.js +34 -0
  28. package/dist/tools/shell.js +186 -0
  29. package/dist/tools/tasks.js +147 -0
  30. package/dist/tools/web-search.js +155 -0
  31. package/dist/tui/editor.js +134 -0
  32. package/dist/tui/keys.js +145 -0
  33. package/dist/tui/tui.js +723 -0
  34. package/dist/ui.js +226 -0
  35. package/dist/util.js +91 -0
  36. package/dist/verification.js +71 -0
  37. package/dist/web/channel.js +260 -0
  38. package/dist/web/client.js +1010 -0
  39. package/dist/web/hub.js +952 -0
  40. package/dist/web/page.js +87 -0
  41. package/dist/web/store.js +199 -0
  42. package/dist/web/styles.js +333 -0
  43. package/dist/web/terminal.js +190 -0
  44. package/package.json +49 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Leon van Zyl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # SMOL Coder Plus ๐Ÿš€
2
+
3
+ **SMOL Coder Plus** is an enhanced fork of the original [SMOL Coder](https://github.com/leonvanzyl/smolcoder) (MIT License, ยฉ Leon van Zyl), designed for more robust and capable AI agentic workflows. It takes the core principles of SMOL Coder and injects production-ready features to handle real-world complexity.
4
+
5
+ > This project is a fork of [leonvanzyl/smolcoder](https://github.com/leonvanzyl/smolcoder). The original copyright notice and MIT license are preserved in [`LICENSE`](./LICENSE).
6
+
7
+ ## โœจ Key Enhancements
8
+
9
+ ### ๐ŸŒ Integrated Web Search (Brave API)
10
+ The agent is no longer confined to its internal knowledge.
11
+ - **Brave Search Integration**: Seamlessly browse the live web to get up-to-date information.
12
+ - **Smart Parsing**: Automatically extracts and formats web results for easier agent comprehension.
13
+ - **Safety & Limits**: Includes automatic output truncation and formatting to keep the context window clean.
14
+
15
+ ### ๐Ÿ› ๏ธ Robust Environment Handling
16
+ We've improved how the agent interacts with your system environment.
17
+ - **Recursive `.env` Loading**: The tool now intelligently searches for `.env` files in the current and parent directories.
18
+ - **Why it matters**: You can run the agent from any subdirectory within your project, and it will still correctly find your API keys and configuration settings at the root.
19
+
20
+ ### ๐Ÿงช Production-Ready Testing
21
+ Reliability is at the core of SMOL Coder Plus.
22
+ - **End-to-End Integration Tests**: We've added tests that simulate the full agent-to-tool-to-API path (using mocked network responses), ensuring that new features don't break existing ones.
23
+ - **Regression Test Suite**: Includes a dedicated `regtest.js` script. Run it to verify that core functionalities remain intact as you continue to build.
24
+
25
+ ## ๐Ÿš€ Getting Started
26
+
27
+ ### Installation
28
+ Install the `smolcoder-plus` command globally from npm:
29
+
30
+ ```bash
31
+ npm install -g smolcoder-plus
32
+ ```
33
+
34
+ Then run it in any project directory:
35
+
36
+ ```bash
37
+ cd my-project
38
+ smolcoder-plus
39
+ ```
40
+
41
+ (Alternative: install from a local checkout with `npm install -g .` from
42
+ the project root.)
43
+
44
+ For development (keeps the command linked to your working tree, so edits
45
+ take effect after a rebuild):
46
+
47
+ ```bash
48
+ npm install
49
+ npm run build
50
+ npm link # adds the `smolcoder-plus` command
51
+ ```
52
+
53
+ Unlink later with `npm unlink -g smolcoder-plus` (or `npm rm -g smolcoder-plus`).
54
+
55
+ ### ๐ŸŒ Internet Search โ€” Setup & Usage Guide
56
+
57
+ The agent ships with a `web_search` tool (Brave Search API) that it calls
58
+ automatically whenever it needs up-to-date information from the live web โ€”
59
+ you don't need to invoke it manually. Just ask, e.g. *"What's the latest
60
+ stable version of TypeScript?"* and the agent will search and cite sources.
61
+
62
+ **1. Get a free API key**
63
+
64
+ 1. Create a free account at [brave.com/search/api](https://brave.com/search/api/).
65
+ 2. In the dashboard, create an API key. The free plan includes 1 query/second
66
+ and 2,000 queries/month โ€” plenty for agent use.
67
+
68
+ **2. Add the key to a `.env` file**
69
+
70
+ Put a `.env` file in your **project root**:
71
+
72
+ ```env
73
+ BRAVE_API_KEY=your_api_key_here
74
+ ```
75
+
76
+ - The loader walks **up from the current directory** to find `.env`, so the
77
+ agent works from any subdirectory of the project.
78
+ - A real exported environment variable always wins over `.env` values:
79
+ `export BRAVE_API_KEY=...` is a valid alternative (useful for CI).
80
+ - Keep the key secret โ€” never commit `.env` (add it to `.gitignore`).
81
+
82
+ **3. Verify it works**
83
+
84
+ Run the agent in your project and ask something that requires live data.
85
+ If the key is missing, the tool returns `Error: Missing BRAVE_API_KEY
86
+ environment variable.` โ€” that's your cue to set it up.
87
+
88
+ **Notes**
89
+
90
+ - Results are capped at 8 per call (default 5) and truncated to ~3,000 chars
91
+ to keep the context window clean.
92
+ - No key? Everything else (file tools, shell, planning, TUI/Web UI) works
93
+ normally โ€” only `web_search` is unavailable.
94
+
95
+ ## ๐Ÿ—๏ธ Architecture
96
+ - **Core Agent**: Enhanced with better planning and tool-use logic.
97
+ - **Web Search Tool**: A dedicated module for interacting with Brave Search.
98
+ - **Sandbox**: Secure execution environment for shell and file operations.
99
+ - **TUI/Web UI**: Sleek interfaces for monitoring agent progress.
100
+
101
+ ---
102
+ *Built with โค๏ธ to make AI agents more capable, reliable, and ready for real-world tasks.*