shmakk 1.1.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/.env.example +23 -0
- package/LICENSE +21 -0
- package/README.md +138 -0
- package/bin/shmakk.js +2 -0
- package/docs/index.html +581 -0
- package/docs/voice.md +181 -0
- package/package.json +58 -0
- package/scripts/patch-onnxruntime.js +82 -0
- package/src/agent.js +0 -0
- package/src/audit.js +18 -0
- package/src/cli.js +177 -0
- package/src/completions.js +167 -0
- package/src/control.js +250 -0
- package/src/correction.js +159 -0
- package/src/endpoints.js +52 -0
- package/src/global-doctor.js +33 -0
- package/src/global-setup.js +62 -0
- package/src/glossary.js +235 -0
- package/src/history-parser.js +166 -0
- package/src/hooks/bash.js +43 -0
- package/src/hooks/fish.js +25 -0
- package/src/hooks/index.js +14 -0
- package/src/hooks/zsh.js +42 -0
- package/src/index.js +166 -0
- package/src/llm.js +45 -0
- package/src/markers.js +113 -0
- package/src/orchestrator.js +61 -0
- package/src/profiles.js +19 -0
- package/src/prompt-cache.js +83 -0
- package/src/pty.js +107 -0
- package/src/review.js +75 -0
- package/src/safety.js +77 -0
- package/src/services/stt.js +131 -0
- package/src/services/tts.js +307 -0
- package/src/services/voice.js +362 -0
- package/src/session.js +604 -0
- package/src/setup-voice.js +108 -0
- package/src/shell.js +32 -0
- package/src/skills.js +309 -0
- package/src/subagent.js +42 -0
- package/src/system-prompt.js +261 -0
- package/src/tools.js +386 -0
- package/src/web.js +228 -0
- package/src/workspace-index.js +213 -0
package/.env.example
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAI-compatible provider endpoint
|
|
2
|
+
SHMAKK_BASE_URL=https://your-provider.example/v1
|
|
3
|
+
|
|
4
|
+
# API key for the provider
|
|
5
|
+
SHMAKK_API_KEY=replace-with-your-api-key
|
|
6
|
+
|
|
7
|
+
# Default model
|
|
8
|
+
SHMAKK_MODEL=gpt-4o-mini
|
|
9
|
+
|
|
10
|
+
# Optional extra headers (k=v,k=v)
|
|
11
|
+
# SHMAKK_HEADERS=
|
|
12
|
+
|
|
13
|
+
# Voice input (microphone → Whisper API / local faster-whisper transcription)
|
|
14
|
+
|
|
15
|
+
## Option A — local faster-whisper server (no API key needed)
|
|
16
|
+
# Start the server: python src/voice_server.py --model base
|
|
17
|
+
# SHMAKK_VOICE_LOCAL_URL=http://127.0.0.1:5000
|
|
18
|
+
|
|
19
|
+
## Option B — remote OpenAI-compatible endpoint
|
|
20
|
+
# Requires SHMAKK_BASE_URL + SHMAKK_API_KEY (Whisper-compatible endpoint)
|
|
21
|
+
# SHMAKK_VOICE_MODEL=whisper-1
|
|
22
|
+
# SHMAKK_VOICE_LANGUAGE=en
|
|
23
|
+
# SHMAKK_VOICE_MAX_SEC=10
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 shmakk
|
|
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,138 @@
|
|
|
1
|
+
# shmakk
|
|
2
|
+
|
|
3
|
+
AI-supervised terminal wrapper — command correction, tool-driven task execution, safety confirmations, and profile-based runtime modes.
|
|
4
|
+
|
|
5
|
+
Your terminal, supercharged by AI. Optionally: talk to it.
|
|
6
|
+
|
|
7
|
+
**[Live demo →](https://marbad1994.github.io/shmakk/)**
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- **Node.js 18+**
|
|
12
|
+
- **Linux or macOS** shell environment
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g shmakk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
That's it. Once installed, use `shmakk` anywhere:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
shmakk --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
### 1. Set up an AI provider
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
export SHMAKK_BASE_URL="https://your-provider.example/v1"
|
|
32
|
+
export SHMAKK_API_KEY="your-api-key"
|
|
33
|
+
export SHMAKK_MODEL="gpt-4o-mini"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or copy the template and fill it in:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cp node_modules/shmakk/.env.example .env
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. Launch
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
shmakk
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You're now in an AI-supervised terminal. Type commands as normal. shmakk will:
|
|
49
|
+
|
|
50
|
+
- **Correct mistakes** — typo in `gti status`? shmakk suggests `git status`. If the correction succeeds, shmakk follows up with the agent using your *original* intent, not just the fixed command.
|
|
51
|
+
- **Execute tasks** — ask "set up a new React project" and shmakk handles the steps
|
|
52
|
+
- **Keep you safe** — confirms risky commands before running them
|
|
53
|
+
|
|
54
|
+
## Voice (optional)
|
|
55
|
+
|
|
56
|
+
speak naturally — shmakk listens, transcribes, responds, and reads its answer aloud. No push-to-talk.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Install system dependency
|
|
60
|
+
sudo pacman -S sox # Arch/EndeavourOS
|
|
61
|
+
sudo apt install sox # Debian/Ubuntu
|
|
62
|
+
brew install sox # macOS
|
|
63
|
+
|
|
64
|
+
# Install voice deps and run preflight check
|
|
65
|
+
npm run setup:voice
|
|
66
|
+
|
|
67
|
+
# Launch in speech-to-speech mode
|
|
68
|
+
shmakk --sts
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Say **"stop"** or **"quiet"** to interrupt TTS mid-sentence.
|
|
72
|
+
|
|
73
|
+
→ Full voice documentation: [docs/voice.md](docs/voice.md)
|
|
74
|
+
|
|
75
|
+
## Profiles
|
|
76
|
+
|
|
77
|
+
Choose a profile to match your workflow:
|
|
78
|
+
|
|
79
|
+
| Profile | Use case |
|
|
80
|
+
|---------|----------|
|
|
81
|
+
| `tiny` | Minimal context, fastest responses |
|
|
82
|
+
| `balanced` | Default — good for daily work |
|
|
83
|
+
| `deep` | Larger investigations, multi-step tasks |
|
|
84
|
+
| `builder` / `large-app` | Editing and building large projects |
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
shmakk --profile builder
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Switch profiles mid-session:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
shmakk --profile-set deep
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Environment variables
|
|
97
|
+
|
|
98
|
+
| Variable | Description |
|
|
99
|
+
|----------|-------------|
|
|
100
|
+
| `SHMAKK_BASE_URL` | OpenAI-compatible base URL |
|
|
101
|
+
| `SHMAKK_API_KEY` | API key |
|
|
102
|
+
| `SHMAKK_MODEL` | Default model |
|
|
103
|
+
| `SHMAKK_HEADERS` | Extra headers (k=v,k=v) |
|
|
104
|
+
|
|
105
|
+
## Useful commands
|
|
106
|
+
|
|
107
|
+
| Command | What it does |
|
|
108
|
+
|---------|-------------|
|
|
109
|
+
| `shmakk --help` | Show help |
|
|
110
|
+
| `shmakk --status` | Check if inside shmakk |
|
|
111
|
+
| `shmakk --stats` | Session statistics |
|
|
112
|
+
| `shmakk --compact` | Clear conversation history |
|
|
113
|
+
| `shmakk --load-skill <name>` | Load a skill |
|
|
114
|
+
| `shmakk --list-skills` | List loaded skills |
|
|
115
|
+
| `shmakk --reset` | Reset conversation + task journal |
|
|
116
|
+
| `shmakk --restart` | Restart the inner shell |
|
|
117
|
+
| `shmakk --exit` | Exit shmakk |
|
|
118
|
+
| `shmakk --review` | Confirm every AI action |
|
|
119
|
+
| `shmakk --yes-files` | Auto-accept file writes |
|
|
120
|
+
| `shmakk --no-correction` | Disable command correction |
|
|
121
|
+
| `shmakk --colors true\|false` | Toggle colored output |
|
|
122
|
+
| `shmakk --sts` | Speech-to-speech mode |
|
|
123
|
+
| `shmakk --stt` | Mic input, text responses |
|
|
124
|
+
| `shmakk --tts` | Text input, spoken responses |
|
|
125
|
+
|
|
126
|
+
## Safety
|
|
127
|
+
|
|
128
|
+
- shmakk prompts you before running commands flagged as risky (writes, deletes, network, installs)
|
|
129
|
+
- Secrets (`.env`, keys, tokens) are never sent to the AI
|
|
130
|
+
- Workspace root is enforced — tools can't access files outside it
|
|
131
|
+
|
|
132
|
+
## How it works
|
|
133
|
+
|
|
134
|
+
shmakk wraps your shell in a PTY (pseudo-terminal). Every command that fails is checked against a deterministic correction engine (no LLM, no API call). If a correction matches and the fixed command succeeds, shmakk feeds the agent your **original input** (not the fixed command) so the agent can address your full intent — not just the typo. You can also give task instructions in natural language — shmakk uses tools to read files, write code, list directories, and run commands, all constrained to your workspace.
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT
|
package/bin/shmakk.js
ADDED