@elizaos/plugin-shell 2.0.0-alpha.8 → 2.0.0-beta.1
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 +363 -0
- package/auto-enable.ts +21 -0
- package/dist/actions/clearHistory.d.ts.map +1 -1
- package/dist/approvals/allowlist.d.ts.map +1 -1
- package/dist/approvals/analysis.d.ts.map +1 -1
- package/dist/approvals/index.d.ts.map +1 -1
- package/dist/approvals/service.d.ts.map +1 -1
- package/dist/approvals/types.d.ts.map +1 -1
- package/dist/auto-enable.d.ts +4 -0
- package/dist/auto-enable.d.ts.map +1 -0
- package/dist/generated/specs/spec-helpers.d.ts +4 -17
- package/dist/generated/specs/spec-helpers.d.ts.map +1 -1
- package/dist/generated/specs/specs.d.ts +3 -18
- package/dist/generated/specs/specs.d.ts.map +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5758 -482
- package/dist/index.js.map +59 -19
- package/dist/prompts.d.ts +11 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/providers/shellHistoryProvider.d.ts.map +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/processRegistry.d.ts.map +1 -1
- package/dist/services/shellService.d.ts +3 -0
- package/dist/services/shellService.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/executionMode.d.ts +9 -0
- package/dist/utils/executionMode.d.ts.map +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/pathUtils.d.ts.map +1 -1
- package/dist/utils/processQueue.d.ts.map +1 -1
- package/dist/utils/ptyKeys.d.ts.map +1 -1
- package/dist/utils/shellUtils.d.ts.map +1 -1
- package/package.json +140 -124
- package/dist/build.d.ts +0 -2
- package/dist/build.d.ts.map +0 -1
- package/dist/generated/prompts/typescript/prompts.d.ts +0 -12
- package/dist/generated/prompts/typescript/prompts.d.ts.map +0 -1
- package/dist/providers/terminalUsage.d.ts +0 -3
- package/dist/providers/terminalUsage.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ElizaOS Contributors
|
|
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,363 @@
|
|
|
1
|
+
# @elizaos/plugin-shell
|
|
2
|
+
|
|
3
|
+
A comprehensive shell command execution plugin for ElizaOS with PTY support, background execution, session management, and security restrictions.
|
|
4
|
+
|
|
5
|
+
**Key Features:**
|
|
6
|
+
|
|
7
|
+
- 🔄 **PTY Support** - Run interactive terminal applications with full pseudo-terminal support
|
|
8
|
+
- ⏱️ **Background Execution** - Long-running commands automatically background with session management
|
|
9
|
+
- 📋 **Session Management** - Track, poll, and interact with running processes
|
|
10
|
+
- 🔒 **Security First** - Directory restrictions, forbidden commands, and timeout protection
|
|
11
|
+
- 📝 **Command History** - Per-conversation command tracking
|
|
12
|
+
|
|
13
|
+
**Available in three languages:**
|
|
14
|
+
|
|
15
|
+
- 🟦 **TypeScript** - Primary implementation for Node.js (full feature support)
|
|
16
|
+
- 🐍 **Python** - Native Python implementation
|
|
17
|
+
- 🦀 **Rust** - High-performance Rust implementation
|
|
18
|
+
|
|
19
|
+
## 🚨 TL;DR - Quick Setup
|
|
20
|
+
|
|
21
|
+
**Just want your agent to execute commands? Here's the fastest path:**
|
|
22
|
+
|
|
23
|
+
1. **Install the plugin**:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd your-eliza-project
|
|
27
|
+
bun add @elizaos/plugin-shell
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
2. **Create/update your `.env`**:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
SHELL_ALLOWED_DIRECTORY=/path/to/safe/directory
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. **Add to your character**:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
const character = {
|
|
40
|
+
// ... other config
|
|
41
|
+
plugins: ["@elizaos/plugin-shell"],
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. **Run:** `bun start`
|
|
46
|
+
|
|
47
|
+
⚠️ **Security note:** The agent can ONLY execute commands within `SHELL_ALLOWED_DIRECTORY` - choose wisely!
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
### Core Features
|
|
52
|
+
- ✅ **Cross-platform support**: Works on Linux, macOS, and Windows
|
|
53
|
+
- ✅ **Directory restriction**: Commands are restricted to a specified directory for safety
|
|
54
|
+
- ✅ **Command filtering**: Configurable list of forbidden commands
|
|
55
|
+
- ✅ **Timeout protection**: Automatic termination of long-running commands
|
|
56
|
+
- ✅ **Command history**: Tracks command execution history per conversation
|
|
57
|
+
- ✅ **File operation tracking**: Monitors file creation, modification, and deletion
|
|
58
|
+
- ✅ **Shell context provider**: Provides command history and working directory to agent context
|
|
59
|
+
- ✅ **Output capture**: Returns both stdout and stderr from executed commands
|
|
60
|
+
- ✅ **Safety first**: Disabled by default, requires explicit enabling
|
|
61
|
+
|
|
62
|
+
### Advanced Features (TypeScript)
|
|
63
|
+
- ✅ **PTY Support**: Run interactive terminal applications (vim, htop, etc.) with `@lydell/node-pty`
|
|
64
|
+
- ✅ **Background Execution**: Commands automatically background after configurable yield window
|
|
65
|
+
- ✅ **Session Management**: Track running/finished sessions, poll output, send keys
|
|
66
|
+
- ✅ **Process Control**: List, poll, log, write, send-keys, submit, paste, kill, clear, remove
|
|
67
|
+
- ✅ **Output Truncation**: Configurable max output with intelligent truncation
|
|
68
|
+
- ✅ **Platform-specific Shell**: Auto-detects shell (bash, sh, PowerShell on Windows)
|
|
69
|
+
|
|
70
|
+
## Project Structure
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
plugin-shell/
|
|
74
|
+
├── typescript/ # TypeScript implementation
|
|
75
|
+
│ ├── actions/ # EXECUTE_COMMAND, CLEAR_SHELL_HISTORY
|
|
76
|
+
│ ├── providers/ # SHELL_HISTORY provider
|
|
77
|
+
│ ├── services/ # ShellService
|
|
78
|
+
│ ├── utils/ # Path validation, security checks
|
|
79
|
+
│ ├── types/ # Type definitions
|
|
80
|
+
│ └── __tests__/ # Unit tests
|
|
81
|
+
├── python/ # Python implementation
|
|
82
|
+
│ ├── elizaos_plugin_shell/
|
|
83
|
+
│ │ ├── service.py # ShellService
|
|
84
|
+
│ │ ├── path_utils.py
|
|
85
|
+
│ │ └── types.py
|
|
86
|
+
│ └── tests/ # Python tests
|
|
87
|
+
├── rust/ # Rust implementation
|
|
88
|
+
│ ├── src/
|
|
89
|
+
│ │ ├── lib.rs
|
|
90
|
+
│ │ ├── service.rs # ShellService
|
|
91
|
+
│ │ ├── path_utils.rs
|
|
92
|
+
│ │ └── types.rs
|
|
93
|
+
│ └── tests/ # Integration tests
|
|
94
|
+
└── package.json # NPM package config
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Installation
|
|
98
|
+
|
|
99
|
+
### TypeScript (Node.js)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Using bun (recommended)
|
|
103
|
+
bun add @elizaos/plugin-shell
|
|
104
|
+
|
|
105
|
+
# Using npm
|
|
106
|
+
npm install @elizaos/plugin-shell
|
|
107
|
+
```
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
Set the following environment variables:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Set the allowed directory (commands can only run here)
|
|
114
|
+
SHELL_ALLOWED_DIRECTORY=/home/user/safe-workspace
|
|
115
|
+
|
|
116
|
+
# OPTIONAL: Set custom timeout in milliseconds (default: 30000)
|
|
117
|
+
SHELL_TIMEOUT=60000
|
|
118
|
+
|
|
119
|
+
# OPTIONAL: Add additional forbidden commands (comma-separated)
|
|
120
|
+
SHELL_FORBIDDEN_COMMANDS=rm,mv,cp,chmod,chown,shutdown,reboot
|
|
121
|
+
|
|
122
|
+
# OPTIONAL: Maximum output characters to capture (default: 200000)
|
|
123
|
+
SHELL_MAX_OUTPUT_CHARS=200000
|
|
124
|
+
|
|
125
|
+
# OPTIONAL: Milliseconds before backgrounding (default: 10000)
|
|
126
|
+
SHELL_BACKGROUND_MS=10000
|
|
127
|
+
|
|
128
|
+
# OPTIONAL: Allow background execution (default: true)
|
|
129
|
+
SHELL_ALLOW_BACKGROUND=true
|
|
130
|
+
|
|
131
|
+
# OPTIONAL: Session record TTL in milliseconds (default: 1800000 = 30min)
|
|
132
|
+
SHELL_JOB_TTL_MS=1800000
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Usage Examples
|
|
136
|
+
|
|
137
|
+
### TypeScript
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { shellPlugin, ShellService } from "@elizaos/plugin-shell";
|
|
141
|
+
|
|
142
|
+
// Use as a plugin
|
|
143
|
+
const character = {
|
|
144
|
+
plugins: [shellPlugin],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Or use the service directly
|
|
148
|
+
const service = new ShellService(runtime);
|
|
149
|
+
const result = await service.executeCommand("ls -la", "conversation-123");
|
|
150
|
+
|
|
151
|
+
// Advanced: Use exec with PTY and background support
|
|
152
|
+
const execResult = await service.exec("npm install", {
|
|
153
|
+
pty: true, // Run with pseudo-terminal
|
|
154
|
+
background: false, // Or yieldMs: 5000 to auto-background after 5s
|
|
155
|
+
timeout: 300, // 5 minute timeout
|
|
156
|
+
workdir: "/project",
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
if (execResult.status === "running") {
|
|
160
|
+
console.log(`Background session: ${execResult.sessionId}`);
|
|
161
|
+
|
|
162
|
+
// Poll for updates
|
|
163
|
+
const pollResult = await service.processAction({
|
|
164
|
+
action: "poll",
|
|
165
|
+
sessionId: execResult.sessionId,
|
|
166
|
+
});
|
|
167
|
+
console.log(pollResult.message);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Get the service from an Eliza agent runtime
|
|
171
|
+
const shellService = runtime.getService<ShellService>("shell");
|
|
172
|
+
```
|
|
173
|
+
## 📋 Available Actions
|
|
174
|
+
|
|
175
|
+
### EXECUTE_COMMAND
|
|
176
|
+
|
|
177
|
+
Executes ANY shell command within the allowed directory, including file operations.
|
|
178
|
+
|
|
179
|
+
**Examples:**
|
|
180
|
+
|
|
181
|
+
- `run ls -la` - List files with details
|
|
182
|
+
- `execute npm test` - Run tests
|
|
183
|
+
- `create a file called hello.txt` - Creates a new file
|
|
184
|
+
- `check git status` - Show git repository status
|
|
185
|
+
|
|
186
|
+
### MANAGE_PROCESS
|
|
187
|
+
|
|
188
|
+
Manage running and finished shell sessions. Supports the following operations:
|
|
189
|
+
|
|
190
|
+
| Action | Description |
|
|
191
|
+
|-------------|------------------------------------------------|
|
|
192
|
+
| `list` | List all running and finished sessions |
|
|
193
|
+
| `poll` | Get new output from a running session |
|
|
194
|
+
| `log` | Get session output with offset/limit |
|
|
195
|
+
| `write` | Write data to session stdin |
|
|
196
|
+
| `send-keys` | Send terminal key sequences (arrows, ctrl, etc)|
|
|
197
|
+
| `submit` | Send carriage return (Enter) |
|
|
198
|
+
| `paste` | Paste text with bracketed paste mode |
|
|
199
|
+
| `kill` | Kill a running session |
|
|
200
|
+
| `clear` | Clear a finished session record |
|
|
201
|
+
| `remove` | Kill (if running) and remove session |
|
|
202
|
+
|
|
203
|
+
**Examples:**
|
|
204
|
+
|
|
205
|
+
- `list all running processes`
|
|
206
|
+
- `check session calm-harbor`
|
|
207
|
+
- `kill the process swift-reef`
|
|
208
|
+
- `send enter to session brisk-cove`
|
|
209
|
+
|
|
210
|
+
### CLEAR_SHELL_HISTORY
|
|
211
|
+
|
|
212
|
+
Clears the command history for the current conversation.
|
|
213
|
+
|
|
214
|
+
**Examples:**
|
|
215
|
+
|
|
216
|
+
- `clear my shell history`
|
|
217
|
+
- `reset the terminal history`
|
|
218
|
+
|
|
219
|
+
## 🧠 Shell History Provider
|
|
220
|
+
|
|
221
|
+
The plugin includes a `SHELL_HISTORY` provider that makes the following information available to the agent:
|
|
222
|
+
|
|
223
|
+
- **Recent Commands**: Last 10 executed commands with their outputs
|
|
224
|
+
- **Current Working Directory**: The current directory within the allowed path
|
|
225
|
+
- **Allowed Directory**: The configured safe directory boundary
|
|
226
|
+
- **File Operations**: Recent file creation, modification, and deletion operations
|
|
227
|
+
|
|
228
|
+
## 🔒 Security Considerations
|
|
229
|
+
|
|
230
|
+
### Directory Restriction
|
|
231
|
+
|
|
232
|
+
All commands execute within `SHELL_ALLOWED_DIRECTORY`:
|
|
233
|
+
|
|
234
|
+
- Attempts to navigate outside are blocked
|
|
235
|
+
- Absolute paths outside the boundary are rejected
|
|
236
|
+
- `cd ..` stops at the allowed directory root
|
|
237
|
+
|
|
238
|
+
### Forbidden Commands
|
|
239
|
+
|
|
240
|
+
By default, these potentially dangerous commands are blocked:
|
|
241
|
+
|
|
242
|
+
- **Destructive**: `rm -rf /`, `rmdir`
|
|
243
|
+
- **Permission changes**: `chmod 777`, `chown`, `chgrp`
|
|
244
|
+
- **System operations**: `shutdown`, `reboot`, `halt`, `poweroff`
|
|
245
|
+
- **Process control**: `kill -9`, `killall`, `pkill`
|
|
246
|
+
- **User management**: `sudo rm -rf`, `su`, `passwd`, `useradd`, `userdel`
|
|
247
|
+
- **Disk operations**: `format`, `fdisk`, `mkfs`, `dd if=/dev/zero`, `shred`
|
|
248
|
+
|
|
249
|
+
### Additional Safety Features
|
|
250
|
+
|
|
251
|
+
- **No Shell Expansion**: Commands execute without dangerous shell interpretation
|
|
252
|
+
- **Timeout Protection**: Commands auto-terminate after timeout
|
|
253
|
+
- **Command History**: All executed commands are logged for audit
|
|
254
|
+
- **Path Traversal Protection**: Blocks `../` and similar patterns
|
|
255
|
+
|
|
256
|
+
## 🧪 Development & Testing
|
|
257
|
+
|
|
258
|
+
### TypeScript
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
cd typescript
|
|
262
|
+
bun run build.ts # Build
|
|
263
|
+
npx vitest # Run tests
|
|
264
|
+
```
|
|
265
|
+
### All Languages
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# From plugin root
|
|
269
|
+
bun run build # Build TypeScript
|
|
270
|
+
bun run build:python # Build Python
|
|
271
|
+
bun run build:rust # Build Rust
|
|
272
|
+
bun run test # Test TypeScript
|
|
273
|
+
bun run test:python # Test Python
|
|
274
|
+
bun run test:rust # Test Rust
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## 📖 API Reference
|
|
278
|
+
|
|
279
|
+
### CommandResult
|
|
280
|
+
|
|
281
|
+
| Field | Type | Description |
|
|
282
|
+
| ------------ | ------------------- | ----------------------------------------- |
|
|
283
|
+
| `success` | boolean | Whether the command executed successfully |
|
|
284
|
+
| `stdout` | string | Standard output from the command |
|
|
285
|
+
| `stderr` | string | Standard error output |
|
|
286
|
+
| `exitCode` | number \| null | Exit code of the command |
|
|
287
|
+
| `error` | string \| undefined | Error message if command failed |
|
|
288
|
+
| `executedIn` | string | Directory where command was executed |
|
|
289
|
+
|
|
290
|
+
### FileOperation
|
|
291
|
+
|
|
292
|
+
| Field | Type | Description |
|
|
293
|
+
| ----------------- | ------------------- | ------------------------------------------------------------------ |
|
|
294
|
+
| `type` | FileOperationType | Type of operation (create, write, read, delete, mkdir, move, copy) |
|
|
295
|
+
| `target` | string | Target file/directory path |
|
|
296
|
+
| `secondaryTarget` | string \| undefined | Secondary target for move/copy |
|
|
297
|
+
|
|
298
|
+
### ShellConfig
|
|
299
|
+
|
|
300
|
+
| Field | Type | Default | Description |
|
|
301
|
+
| ----------------------- | -------- | -------- | ------------------------------------ |
|
|
302
|
+
| `enabled` | boolean | false | Whether shell is enabled |
|
|
303
|
+
| `allowedDirectory` | string | cwd | Directory to restrict commands to |
|
|
304
|
+
| `timeout` | number | 30000 | Timeout in milliseconds |
|
|
305
|
+
| `forbiddenCommands` | string[] | [...] | List of forbidden commands |
|
|
306
|
+
| `maxOutputChars` | number | 200000 | Max output characters to capture |
|
|
307
|
+
| `pendingMaxOutputChars` | number | 200000 | Max pending output per stream |
|
|
308
|
+
| `defaultBackgroundMs` | number | 10000 | Default background yield window |
|
|
309
|
+
| `allowBackground` | boolean | true | Allow background execution |
|
|
310
|
+
|
|
311
|
+
### ProcessSession
|
|
312
|
+
|
|
313
|
+
| Field | Type | Description |
|
|
314
|
+
| --------------------- | ----------------------- | ------------------------------------- |
|
|
315
|
+
| `id` | string | Unique session identifier (slug) |
|
|
316
|
+
| `command` | string | The executed command |
|
|
317
|
+
| `pid` | number \| undefined | Process ID |
|
|
318
|
+
| `startedAt` | number | Start timestamp |
|
|
319
|
+
| `cwd` | string \| undefined | Working directory |
|
|
320
|
+
| `aggregated` | string | Accumulated output |
|
|
321
|
+
| `tail` | string | Last 2000 chars of output |
|
|
322
|
+
| `exited` | boolean | Whether process has exited |
|
|
323
|
+
| `exitCode` | number \| null | Exit code (if exited) |
|
|
324
|
+
| `exitSignal` | string \| number \| null| Exit signal (if killed) |
|
|
325
|
+
| `truncated` | boolean | Whether output was truncated |
|
|
326
|
+
| `backgrounded` | boolean | Whether running in background |
|
|
327
|
+
|
|
328
|
+
### ExecResult
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
type ExecResult =
|
|
332
|
+
| { status: "running"; sessionId: string; pid?: number; startedAt: number; cwd?: string; tail?: string }
|
|
333
|
+
| { status: "completed" | "failed"; exitCode: number | null; durationMs: number; aggregated: string; cwd?: string; timedOut?: boolean; reason?: string }
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### ExecuteOptions
|
|
337
|
+
|
|
338
|
+
| Field | Type | Description |
|
|
339
|
+
| --------------- | --------------------------- | ------------------------------------- |
|
|
340
|
+
| `workdir` | string | Working directory |
|
|
341
|
+
| `env` | Record<string, string> | Additional environment variables |
|
|
342
|
+
| `yieldMs` | number | Yield to background after this time |
|
|
343
|
+
| `background` | boolean | Run immediately in background |
|
|
344
|
+
| `timeout` | number | Timeout in seconds |
|
|
345
|
+
| `pty` | boolean | Use pseudo-terminal |
|
|
346
|
+
| `conversationId`| string | Conversation ID for history tracking |
|
|
347
|
+
| `scopeKey` | string | Scope key for session isolation |
|
|
348
|
+
| `sessionKey` | string | Session key for notifications |
|
|
349
|
+
| `notifyOnExit` | boolean | Notify on background exit |
|
|
350
|
+
| `onUpdate` | (session) => void | Callback for output updates |
|
|
351
|
+
|
|
352
|
+
## 🤝 Contributing
|
|
353
|
+
|
|
354
|
+
Contributions are welcome! Please ensure:
|
|
355
|
+
|
|
356
|
+
1. All three language implementations stay in feature parity
|
|
357
|
+
2. Tests pass for all languages
|
|
358
|
+
3. Follow the code style of each language
|
|
359
|
+
4. Update documentation as needed
|
|
360
|
+
|
|
361
|
+
## 📝 License
|
|
362
|
+
|
|
363
|
+
MIT - See [LICENSE](./LICENSE) for details.
|
package/auto-enable.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Auto-enable check for @elizaos/plugin-shell.
|
|
2
|
+
//
|
|
3
|
+
// Plugin manifest entry-point — referenced by package.json's
|
|
4
|
+
// `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
|
|
5
|
+
// no service init, no transitive imports of the full plugin runtime. The
|
|
6
|
+
// auto-enable engine loads dozens of these per boot.
|
|
7
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
8
|
+
|
|
9
|
+
function isFeatureEnabled(config: PluginAutoEnableContext["config"], key: string): boolean {
|
|
10
|
+
const f = (config?.features as Record<string, unknown> | undefined)?.[key];
|
|
11
|
+
if (f === true) return true;
|
|
12
|
+
if (f && typeof f === "object" && f !== null) {
|
|
13
|
+
return (f as Record<string, unknown>).enabled !== false;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Enable when `config.features.shell` is truthy / not explicitly disabled. */
|
|
19
|
+
export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
20
|
+
return isFeatureEnabled(ctx.config, "shell");
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearHistory.d.ts","sourceRoot":"","sources":["../../actions/clearHistory.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"clearHistory.d.ts","sourceRoot":"","sources":["../../actions/clearHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAMvB,eAAO,MAAM,YAAY,EAAE,MA2G1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../approvals/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../approvals/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAElB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,EACP,YAAY,EACb,MAAM,SAAS,CAAC;AAgCjB;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAmED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,CAmC7E;AASD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,qBAAqB,CA8C7D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,iBAAiB,CAyCjD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAoB3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,CA8BnD;AAsBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACzC,qBAAqB,CAuBvB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,qBAAqB,CAoDxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kBAAkB,EAAE,EAC7B,UAAU,EAAE,iBAAiB,GAAG,IAAI,GACnC,kBAAkB,GAAG,IAAI,CAoB3B;AAqFD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CA+BT;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAwCT;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,YAAY,CAO1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAGtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../approvals/analysis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../approvals/analysis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAmIjB;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,iBAAiB,GAAG,IAAI,CAQ1B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,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AuB,CAuC1B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,qBAAqB,CAsFxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,GAAG,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,GAAG,OAAO,CAOV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../approvals/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../approvals/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../approvals/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAQ,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAgC,OAAO,EAAE,MAAM,eAAe,CAAC;AAyBtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../approvals/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAQ,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAgC,OAAO,EAAE,MAAM,eAAe,CAAC;AAyBtE,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EAErB,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,gBAAgB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EAAE,mBAAmB,EAC5B,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/D,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KACjC,GACA,OAAO,CAAC,IAAI,CAAC;IAkEhB;;;OAGG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzE;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAyCxE;AAgBD,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../approvals/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,qBAAqB;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../approvals/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,MA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IAC/B,iCAAiC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,4EAUpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB;uBACb,YAAY;kBACd,OAAO;0BACF,YAAY;;;CAG3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-enable.d.ts","sourceRoot":"","sources":["../auto-enable.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAW7D,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAElE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Helper functions to lookup action/provider
|
|
2
|
+
* Helper functions to lookup action/provider specs by name.
|
|
3
3
|
* These allow language-specific implementations to import their text content
|
|
4
4
|
* (description, similes, examples) from the centralized specs.
|
|
5
5
|
*
|
|
6
|
-
* DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json
|
|
6
|
+
* DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json and regenerate.
|
|
7
7
|
*/
|
|
8
|
-
import { type ActionDoc, type
|
|
8
|
+
import { type ActionDoc, type ProviderDoc } from "./specs";
|
|
9
9
|
/**
|
|
10
10
|
* Get an action spec by name from the core specs.
|
|
11
11
|
* @param name - The action name
|
|
@@ -32,18 +32,5 @@ export declare function getProviderSpec(name: string): ProviderDoc | undefined;
|
|
|
32
32
|
* @throws Error if the provider is not found
|
|
33
33
|
*/
|
|
34
34
|
export declare function requireProviderSpec(name: string): ProviderDoc;
|
|
35
|
-
|
|
36
|
-
* Get an evaluator spec by name from the core specs.
|
|
37
|
-
* @param name - The evaluator name
|
|
38
|
-
* @returns The evaluator spec or undefined if not found
|
|
39
|
-
*/
|
|
40
|
-
export declare function getEvaluatorSpec(name: string): EvaluatorDoc | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Get an evaluator spec by name, throwing if not found.
|
|
43
|
-
* @param name - The evaluator name
|
|
44
|
-
* @returns The evaluator spec
|
|
45
|
-
* @throws Error if the evaluator is not found
|
|
46
|
-
*/
|
|
47
|
-
export declare function requireEvaluatorSpec(name: string): EvaluatorDoc;
|
|
48
|
-
export type { ActionDoc, ProviderDoc, EvaluatorDoc };
|
|
35
|
+
export type { ActionDoc, ProviderDoc };
|
|
49
36
|
//# sourceMappingURL=spec-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,SAAS,EAKd,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAUjB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM7D;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Auto-generated canonical action/provider
|
|
2
|
+
* Auto-generated canonical action/provider docs for plugin-shell.
|
|
3
3
|
* DO NOT EDIT - Generated from prompts/specs/**.
|
|
4
4
|
*/
|
|
5
5
|
export type ActionDoc = {
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|
|
8
|
+
descriptionCompressed?: string;
|
|
8
9
|
similes?: readonly string[];
|
|
9
10
|
parameters?: readonly unknown[];
|
|
10
11
|
examples?: readonly (readonly unknown[])[];
|
|
@@ -12,16 +13,10 @@ export type ActionDoc = {
|
|
|
12
13
|
export type ProviderDoc = {
|
|
13
14
|
name: string;
|
|
14
15
|
description: string;
|
|
16
|
+
descriptionCompressed?: string;
|
|
15
17
|
position?: number;
|
|
16
18
|
dynamic?: boolean;
|
|
17
19
|
};
|
|
18
|
-
export type EvaluatorDoc = {
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
similes?: readonly string[];
|
|
22
|
-
alwaysRun?: boolean;
|
|
23
|
-
examples?: readonly unknown[];
|
|
24
|
-
};
|
|
25
20
|
export declare const coreActionsSpec: {
|
|
26
21
|
readonly version: "1.0.0";
|
|
27
22
|
readonly actions: readonly [{
|
|
@@ -56,18 +51,8 @@ export declare const allProvidersSpec: {
|
|
|
56
51
|
readonly dynamic: true;
|
|
57
52
|
}];
|
|
58
53
|
};
|
|
59
|
-
export declare const coreEvaluatorsSpec: {
|
|
60
|
-
readonly version: "1.0.0";
|
|
61
|
-
readonly evaluators: readonly [];
|
|
62
|
-
};
|
|
63
|
-
export declare const allEvaluatorsSpec: {
|
|
64
|
-
readonly version: "1.0.0";
|
|
65
|
-
readonly evaluators: readonly [];
|
|
66
|
-
};
|
|
67
54
|
export declare const coreActionDocs: readonly ActionDoc[];
|
|
68
55
|
export declare const allActionDocs: readonly ActionDoc[];
|
|
69
56
|
export declare const coreProviderDocs: readonly ProviderDoc[];
|
|
70
57
|
export declare const allProviderDocs: readonly ProviderDoc[];
|
|
71
|
-
export declare const coreEvaluatorDocs: readonly EvaluatorDoc[];
|
|
72
|
-
export declare const allEvaluatorDocs: readonly EvaluatorDoc[];
|
|
73
58
|
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;CAUlB,CAAC;AACX,eAAO,MAAM,cAAc;;;;;;;;CAUjB,CAAC;AACX,eAAO,MAAM,iBAAiB;;;;;;;CAUpB,CAAC;AACX,eAAO,MAAM,gBAAgB;;;;;;;CAUnB,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,SAAS,SAAS,EAA4B,CAAC;AAC5E,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAA2B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EAAgC,CAAC;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAK3D,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAK3D,eAAO,MAAM,WAAW,EAAE,MAMzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare const shellPlugin: Plugin;
|
|
|
3
3
|
export default shellPlugin;
|
|
4
4
|
export { clearHistory } from "./actions/clearHistory";
|
|
5
5
|
export { addAllowlistEntry, analyzeShellCommand, type CommandCheckResult, type CommandResolution, DEFAULT_SAFE_BINS, EXEC_APPROVAL_DEFAULTS, type ExecAllowlistAnalysis, type ExecAllowlistEntry, type ExecAllowlistEvaluation, type ExecApprovalDecision, type ExecApprovalRequest, type ExecApprovalResult, ExecApprovalService, type ExecApprovalsAgent, type ExecApprovalsDefaults, type ExecApprovalsFile, type ExecApprovalsResolved, type ExecApprovalsSnapshot, type ExecAsk, type ExecCommandAnalysis, type ExecCommandSegment, type ExecHost, type ExecSecurity, ensureApprovals, evaluateExecAllowlist, evaluateShellAllowlist, getApprovalFilePath, getApprovalSocketPath, isSafeBinUsage, loadApprovals, matchAllowlist, maxAsk, minSecurity, normalizeApprovals, normalizeSafeBins, readApprovalsSnapshot, recordAllowlistUse, requiresExecApproval, resolveApprovals, resolveApprovalsFromFile, resolveCommandFromArgv, resolveCommandResolution, resolveSafeBins, saveApprovals, } from "./approvals";
|
|
6
|
-
export { terminalUsageProvider } from "./providers/terminalUsage";
|
|
7
6
|
export { shellHistoryProvider } from "./providers/shellHistoryProvider";
|
|
8
7
|
export { addSession, appendOutput, clearFinished, createSessionSlug, deleteSession, drainSession, getFinishedSession, getSession, listFinishedSessions, listRunningSessions, markBackgrounded, markExited, resetProcessRegistryForTests, setJobTtlMs, tail, trimWithCap, } from "./services/processRegistry";
|
|
9
8
|
export { ShellService } from "./services/shellService";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,eAAO,MAAM,WAAW,EAAE,MAgBzB,CAAC;AAEF,eAAe,WAAW,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,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