@cnrai/pave 0.3.35 → 0.3.50
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/LICENSE +21 -0
- package/README.md +21 -218
- package/package.json +32 -35
- package/pave.js +3 -0
- package/sandbox/SandboxRunner.js +1 -0
- package/sandbox/pave-run.js +2 -0
- package/sandbox/permission.js +1 -0
- package/sandbox/utils/yaml.js +1 -0
- package/MARKETPLACE.md +0 -406
- package/build-binary.js +0 -591
- package/build-npm.js +0 -537
- package/build.js +0 -230
- package/check-binary.js +0 -26
- package/deploy.sh +0 -95
- package/index.js +0 -5776
- package/lib/agent-registry.js +0 -1037
- package/lib/args-parser.js +0 -837
- package/lib/blessed-widget-patched.js +0 -93
- package/lib/cli-markdown.js +0 -590
- package/lib/compaction.js +0 -153
- package/lib/duration.js +0 -94
- package/lib/hash.js +0 -22
- package/lib/marketplace.js +0 -866
- package/lib/memory-config.js +0 -166
- package/lib/skill-manager.js +0 -891
- package/lib/soul.js +0 -31
- package/lib/tool-output-formatter.js +0 -180
- package/start-pave.sh +0 -149
- package/status.js +0 -271
- package/test/abort-stream.test.js +0 -445
- package/test/agent-auto-compaction.test.js +0 -552
- package/test/agent-comm-abort.test.js +0 -95
- package/test/agent-comm.test.js +0 -598
- package/test/agent-inbox.test.js +0 -576
- package/test/agent-init.test.js +0 -264
- package/test/agent-interrupt.test.js +0 -314
- package/test/agent-lifecycle.test.js +0 -520
- package/test/agent-log-files.test.js +0 -349
- package/test/agent-mode.manual-test.js +0 -392
- package/test/agent-parsing.test.js +0 -228
- package/test/agent-post-stream-idle.test.js +0 -762
- package/test/agent-registry.test.js +0 -359
- package/test/agent-rm.test.js +0 -442
- package/test/agent-spawn.test.js +0 -933
- package/test/agent-status-api.test.js +0 -624
- package/test/agent-update.test.js +0 -435
- package/test/args-parser.test.js +0 -391
- package/test/auto-compaction-chat.manual-test.js +0 -227
- package/test/auto-compaction.test.js +0 -941
- package/test/build-config.test.js +0 -120
- package/test/build-npm.test.js +0 -388
- package/test/chat-command.test.js +0 -137
- package/test/chat-leading-lines.test.js +0 -159
- package/test/config-flag.test.js +0 -272
- package/test/cursor-drift.test.js +0 -135
- package/test/debug-require.js +0 -23
- package/test/dir-migration.test.js +0 -323
- package/test/duration.test.js +0 -229
- package/test/ghostty-term.test.js +0 -202
- package/test/http500-backoff.test.js +0 -854
- package/test/integration.test.js +0 -86
- package/test/memory-guard-env.test.js +0 -220
- package/test/pr233-fixes.test.js +0 -259
- package/test/run-agent-init.js +0 -297
- package/test/run-all.js +0 -64
- package/test/run-config-flag.js +0 -159
- package/test/run-cursor-drift.js +0 -82
- package/test/run-session-path.js +0 -154
- package/test/run-tests.js +0 -643
- package/test/sandbox-redirect.test.js +0 -202
- package/test/session-path.test.js +0 -132
- package/test/shebang-strip.test.js +0 -241
- package/test/soul-reinject.test.js +0 -1027
- package/test/soul-reread.test.js +0 -281
- package/test/tool-output-formatter.test.js +0 -486
- package/test/tool-output-gating.test.js +0 -143
- package/test/tool-states.test.js +0 -167
- package/test/tools-flag.test.js +0 -65
- package/test/tui-attach.test.js +0 -1255
- package/test/tui-compaction.test.js +0 -354
- package/test/tui-wrap.test.js +0 -568
- package/test-binary.js +0 -52
- package/test-binary2.js +0 -36
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CNRAI
|
|
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
CHANGED
|
@@ -1,237 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cnrai/pave
|
|
2
2
|
|
|
3
|
-
PAVE
|
|
3
|
+
PAVE - Personal AI Virtual Environment. AI agent framework for the terminal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
- **Resource-Efficient**: Runs smoothly on iSH iOS with Node 16
|
|
8
|
-
- **Configurable Memory Management**: CLI arguments for fine-tuning memory limits
|
|
9
|
-
- **Auto-Detection**: Automatically detects iSH environment and applies appropriate settings
|
|
10
|
-
- **Terminal UI**: Real-time chat interface with markdown rendering
|
|
11
|
-
- **Embedded Server**: No separate server process required
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
|
-
### Standard Usage
|
|
16
|
-
```bash
|
|
17
|
-
node index.js
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### ISH/iOS Usage
|
|
21
|
-
```bash
|
|
22
|
-
# Using startup script (recommended)
|
|
23
|
-
./start-pave.sh
|
|
24
|
-
|
|
25
|
-
# Or manually with garbage collection
|
|
26
|
-
node --expose-gc index.js
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## CLI Options
|
|
30
|
-
|
|
31
|
-
### Memory Configuration
|
|
32
|
-
Perfect for ISH and other resource-constrained environments:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Force ISH mode with custom memory limits
|
|
36
|
-
node index.js --ish-mode --memory-limit 16 --memory-warning 12
|
|
37
|
-
|
|
38
|
-
# Disable memory monitoring
|
|
39
|
-
node index.js --memory-monitor off
|
|
40
|
-
|
|
41
|
-
# Custom startup memory allowance (for large JS bundles)
|
|
42
|
-
node index.js --memory-startup 64 --memory-limit 12
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Server Configuration
|
|
46
|
-
```bash
|
|
47
|
-
# Custom port and host
|
|
48
|
-
node index.js --port 8080 --host 0.0.0.0
|
|
49
|
-
|
|
50
|
-
# Custom working directory
|
|
51
|
-
node index.js --opencode-dir /path/to/workspace
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Debug Options
|
|
55
|
-
```bash
|
|
56
|
-
# Debug mode with verbose logging
|
|
57
|
-
node index.js --debug --verbose
|
|
58
|
-
|
|
59
|
-
# Help and version
|
|
60
|
-
node index.js --help
|
|
61
|
-
node index.js --version
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Memory Management Options
|
|
65
|
-
|
|
66
|
-
| Option | Description | Default |
|
|
67
|
-
|--------|-------------|---------|
|
|
68
|
-
| `--ish-mode [on\|off]` | Force ISH mode detection | Auto-detected |
|
|
69
|
-
| `--memory-limit <MB>` | Heap memory limit | 8MB (ISH), 100MB (standard) |
|
|
70
|
-
| `--memory-warning <MB>` | Warning threshold | 80% of limit |
|
|
71
|
-
| `--memory-critical <MB>` | Critical threshold | Same as limit |
|
|
72
|
-
| `--memory-startup <MB>` | Startup limit | Higher to allow init |
|
|
73
|
-
| `--memory-monitor [on\|off]` | Enable monitoring | Auto (ISH=on) |
|
|
74
|
-
|
|
75
|
-
## Environment Variables
|
|
76
|
-
|
|
77
|
-
CLI arguments override environment variables:
|
|
78
|
-
|
|
79
|
-
| Variable | CLI Override | Description |
|
|
80
|
-
|----------|--------------|-------------|
|
|
81
|
-
| `PORT` | `--port` | Server port (default: 4096) |
|
|
82
|
-
| `HOST` | `--host` | Server hostname (default: 127.0.0.1) |
|
|
83
|
-
| `OPENCODE_DIR` | `--opencode-dir` | Working directory |
|
|
84
|
-
| `FORCE_ISH_MODE` | `--ish-mode` | Force ISH mode |
|
|
85
|
-
| `DEBUG` | `--debug` | Enable debug logging |
|
|
86
|
-
|
|
87
|
-
## ISH/iOS Optimization
|
|
88
|
-
|
|
89
|
-
PAVE is specifically designed to run efficiently on iSH:
|
|
90
|
-
|
|
91
|
-
### Automatic Detection
|
|
92
|
-
```bash
|
|
93
|
-
# These indicators trigger ISH mode:
|
|
94
|
-
# - platform === 'linux'
|
|
95
|
-
# - TERM_PROGRAM === 'iSH'
|
|
96
|
-
# - /etc/alpine-release exists
|
|
97
|
-
# - Node version contains 'alpine'
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Memory Protection
|
|
101
|
-
```bash
|
|
102
|
-
# ISH mode automatically enables:
|
|
103
|
-
# - 8MB heap limit (vs 100MB standard)
|
|
104
|
-
# - Memory monitoring every 5 seconds
|
|
105
|
-
# - Aggressive garbage collection
|
|
106
|
-
# - Emergency cleanup on memory pressure
|
|
107
|
-
# - Process termination before system crash
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Recommended ISH Setup
|
|
111
7
|
```bash
|
|
112
|
-
|
|
113
|
-
node --expose-gc index.js
|
|
114
|
-
|
|
115
|
-
# Or use the startup script
|
|
116
|
-
./start-pave.sh
|
|
117
|
-
|
|
118
|
-
# For persistent use, create an alias
|
|
119
|
-
echo 'alias pave="cd /path/to/pave && ./start-pave.sh"' >> ~/.profile
|
|
8
|
+
npm install -g @cnrai/pave
|
|
120
9
|
```
|
|
121
10
|
|
|
122
|
-
##
|
|
11
|
+
## Usage
|
|
123
12
|
|
|
124
|
-
### Basic Usage
|
|
125
13
|
```bash
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
#
|
|
130
|
-
node index.js --debug
|
|
14
|
+
pave # Launch TUI
|
|
15
|
+
pave --help # Show help
|
|
16
|
+
pave --version # Show version
|
|
17
|
+
pave chat "question" # Quick chat
|
|
131
18
|
```
|
|
132
19
|
|
|
133
|
-
###
|
|
134
|
-
```bash
|
|
135
|
-
# Conservative memory settings
|
|
136
|
-
node index.js --memory-limit 6 --memory-warning 4
|
|
137
|
-
|
|
138
|
-
# Higher startup allowance for large projects
|
|
139
|
-
node index.js --memory-startup 32 --memory-limit 8
|
|
20
|
+
### iSH (iOS)
|
|
140
21
|
|
|
141
|
-
# Force ISH mode for testing
|
|
142
|
-
node index.js --ish-mode --debug
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Development Setup
|
|
146
22
|
```bash
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
# Disable memory monitoring for debugging
|
|
151
|
-
node index.js --memory-monitor off --debug
|
|
23
|
+
npm install -g @cnrai/pave
|
|
24
|
+
pave # Auto-detects iSH and applies optimized Node flags
|
|
152
25
|
```
|
|
153
26
|
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
# Optimized for production use in iSH
|
|
157
|
-
./start-pave.sh --memory-limit 12 --memory-warning 8
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Startup Script
|
|
161
|
-
|
|
162
|
-
The `start-pave.sh` script provides additional convenience:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Standard startup with auto-detection
|
|
166
|
-
./start-pave.sh
|
|
167
|
-
|
|
168
|
-
# Force ISH mode
|
|
169
|
-
./start-pave.sh --ish-mode
|
|
170
|
-
|
|
171
|
-
# Custom memory limit
|
|
172
|
-
./start-pave.sh --memory-limit 32
|
|
173
|
-
|
|
174
|
-
# Debug mode
|
|
175
|
-
./start-pave.sh --debug --verbose
|
|
176
|
-
|
|
177
|
-
# Disable garbage collection
|
|
178
|
-
./start-pave.sh --no-gc
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Troubleshooting
|
|
182
|
-
|
|
183
|
-
### Memory Issues
|
|
184
|
-
```bash
|
|
185
|
-
# Check current memory usage
|
|
186
|
-
node index.js --debug --verbose
|
|
187
|
-
|
|
188
|
-
# Lower memory limits
|
|
189
|
-
node index.js --memory-limit 6 --memory-warning 4
|
|
190
|
-
|
|
191
|
-
# Disable monitoring temporarily
|
|
192
|
-
node index.js --memory-monitor off
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### ISH Detection Issues
|
|
196
|
-
```bash
|
|
197
|
-
# Force ISH mode
|
|
198
|
-
node index.js --ish-mode
|
|
199
|
-
|
|
200
|
-
# Check detection
|
|
201
|
-
FORCE_ISH_MODE=true node index.js --debug
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Performance Issues
|
|
205
|
-
```bash
|
|
206
|
-
# Enable garbage collection
|
|
207
|
-
node --expose-gc index.js
|
|
208
|
-
|
|
209
|
-
# Use startup script
|
|
210
|
-
./start-pave.sh
|
|
211
|
-
|
|
212
|
-
# Check memory configuration
|
|
213
|
-
node index.js --debug | grep -i memory
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Architecture
|
|
27
|
+
## Requirements
|
|
217
28
|
|
|
218
|
-
|
|
29
|
+
- Node.js >= 16.0.0
|
|
30
|
+
- A GitHub Copilot subscription (for the AI backend)
|
|
219
31
|
|
|
220
|
-
|
|
221
|
-
2. **Console redirected** to log file to avoid TUI corruption
|
|
222
|
-
3. **TUI launches** and connects to embedded server
|
|
223
|
-
4. **Memory monitoring** starts when first session is activated
|
|
224
|
-
5. **Automatic cleanup** prevents memory exhaustion crashes
|
|
32
|
+
## Links
|
|
225
33
|
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
- Terminal UI corruption must be avoided
|
|
230
|
-
- Reliability is critical (no crashes in mobile environment)
|
|
34
|
+
- Source: https://github.com/cnrai/openpave
|
|
35
|
+
- Issues: https://github.com/cnrai/openpave/issues
|
|
36
|
+
- Homebrew (native binary): `brew tap cnrai/tap && brew install pave`
|
|
231
37
|
|
|
232
|
-
##
|
|
38
|
+
## License
|
|
233
39
|
|
|
234
|
-
-
|
|
235
|
-
- 12MB+ available memory (8MB for heap + overhead)
|
|
236
|
-
- Terminal with basic ANSI support
|
|
237
|
-
- Optional: `--expose-gc` for optimal memory management
|
|
40
|
+
MIT - Copyright (c) 2025 CNRAI
|
package/package.json
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnrai/pave",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Personal AI Virtual Environment
|
|
5
|
-
"main": "
|
|
3
|
+
"version": "0.3.50",
|
|
4
|
+
"description": "PAVE - Personal AI Virtual Environment. AI agent framework for the terminal.",
|
|
5
|
+
"main": "pave.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"pave": "./
|
|
7
|
+
"pave": "./pave.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "node
|
|
11
|
-
"start:ish": "node --expose-gc index.js",
|
|
12
|
-
"start:debug": "node --expose-gc index.js --debug --verbose",
|
|
13
|
-
"help": "node index.js --help",
|
|
14
|
-
"build": "node build.js",
|
|
15
|
-
"build:install": "node build.js --install",
|
|
16
|
-
"build:npm": "node build-npm.js",
|
|
17
|
-
"build:npm:publish": "node build-npm.js --publish",
|
|
18
|
-
"clean": "rm -rf dist",
|
|
19
|
-
"test": "node test/run-tests.js",
|
|
20
|
-
"test:verbose": "node test/run-tests.js --verbose",
|
|
21
|
-
"test:ish": "node test/ish-fetch.test.js",
|
|
22
|
-
"status": "node status.js"
|
|
10
|
+
"start": "node pave.js"
|
|
23
11
|
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"ai",
|
|
26
|
-
"terminal",
|
|
27
|
-
"tui",
|
|
28
|
-
"opencode",
|
|
29
|
-
"ish",
|
|
30
|
-
"ios",
|
|
31
|
-
"memory-efficient",
|
|
32
|
-
"resource-constrained"
|
|
33
|
-
],
|
|
34
12
|
"engines": {
|
|
35
13
|
"node": ">=16.0.0"
|
|
36
14
|
},
|
|
@@ -40,15 +18,34 @@
|
|
|
40
18
|
"win32"
|
|
41
19
|
],
|
|
42
20
|
"dependencies": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
"blessed": "^0.1.81",
|
|
22
|
+
"js-yaml": "^4.1.0"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"pave.js",
|
|
26
|
+
"sandbox/",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"ai",
|
|
32
|
+
"terminal",
|
|
33
|
+
"tui",
|
|
34
|
+
"agent",
|
|
35
|
+
"cli",
|
|
36
|
+
"ish",
|
|
37
|
+
"ios",
|
|
38
|
+
"node16",
|
|
39
|
+
"memory-efficient"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/cnrai/openpave.git"
|
|
47
44
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
"
|
|
45
|
+
"homepage": "https://github.com/cnrai/openpave",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/cnrai/openpave/issues"
|
|
51
48
|
},
|
|
52
|
-
"author": "
|
|
49
|
+
"author": "CNRAI",
|
|
53
50
|
"license": "MIT"
|
|
54
51
|
}
|