@iinm/plain-agent 1.0.6 → 1.0.7

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 (2) hide show
  1. package/README.md +23 -33
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,20 +6,20 @@ A lightweight CLI-based coding agent.
6
6
  - **Multi-provider** — Supports Anthropic, OpenAI, Gemini, Bedrock, Azure, Vertex AI, and more
7
7
  - **Sequential subagent delegation** — Delegate subtasks to specialized subagents with full visibility
8
8
  - **MCP support** — Connect to external MCP servers to extend available tools
9
- - **Claude Code compatible** *(experimental)* — Reuse Claude Code plugins, agents, commands, and skills
9
+ - **Claude Code compatible** — Reuse Claude Code plugins, agents, commands, and skills
10
10
 
11
11
  ## Safety Controls
12
12
 
13
- This CLI tool automatically allows the execution of certain tools but requires explicit approval for security-sensitive operations, such as accessing parent directories.
14
- The security rules are defined in [`config.predefined.json`](https://github.com/iinm/plain-agent/blob/main/.config/config.predefined.json) and [`toolInputValidator.mjs`](https://github.com/iinm/plain-agent/blob/main/src/toolInputValidator.mjs) within this repository.
13
+ **Auto-Approval**: Tools with no side effects and no sensitive data access are automatically approved based on patterns defined in [`config.predefined.json#autoApproval`](https://github.com/iinm/plain-agent/blob/main/.config/config.predefined.json).
15
14
 
16
- ⚠️ `write_file` and `patch_file` block access to git-ignored files. `exec_command` blocks direct path arguments (e.g., `ls .env`), but cannot block access from executed programs (e.g., `node script.js`). Use a sandbox for stronger isolation.
15
+ **Path Validation**: All file paths in tool inputs are validated to remain within the working directory and under git control.
16
+
17
+ ⚠️ `write_file` and `patch_file` require explicit path arguments. However, `exec_command` can run arbitrary code where file access cannot be validated. Use a sandbox for stronger isolation.
17
18
 
18
19
  ## Requirements
19
20
 
20
- - Linux or macOS
21
21
  - Node.js 22 or later
22
- - LLM provider credentials (API keys, AWS SSO, gcloud CLI, or Azure CLI)
22
+ - LLM provider credentials
23
23
  - bash / docker for sandboxed execution
24
24
  - [ripgrep](https://github.com/burntsushi/ripgrep)
25
25
  - [fd](https://github.com/sharkdp/fd)
@@ -140,7 +140,7 @@ Run the agent.
140
140
  ```sh
141
141
  plain
142
142
 
143
- # Or specify a specific model
143
+ # Or
144
144
  plain -m <model>+<variant>
145
145
  ```
146
146
 
@@ -165,7 +165,7 @@ The agent can use the following tools to assist with tasks:
165
165
  - **patch_file**: Patch a file.
166
166
  - **tmux_command**: Run a tmux command.
167
167
  - **fetch_web_page**: Fetch and extract web page content from a given URL, returning it as Markdown.
168
- - **ask_google**: Ask Google a question using natural language (requires Gemini API key).
168
+ - **ask_google**: Ask Google a question using natural language (requires Google API key or Vertex AI configuration).
169
169
  - **search_web**: Search the web for information (requires Tavily API key).
170
170
  - **delegate_to_subagent**: Delegate a subtask to a subagent. The agent switches to a subagent role within the same conversation, focusing on the specified goal.
171
171
  - **report_as_subagent**: Report completion and return to the main agent. Used by subagents to communicate results and restore the main agent role. After reporting, the subagent's conversation history is removed from the context.
@@ -206,13 +206,10 @@ The agent loads configuration files in the following order. Settings in later fi
206
206
  ```js
207
207
  {
208
208
  "autoApproval": {
209
- // Automatically deny unmatched tools instead of asking
210
209
  "defaultAction": "deny",
211
- // The maximum number of automatic approvals.
212
210
  "maxApprovals": 100,
213
- // Patterns are evaluated in order. First match wins.
214
211
  "patterns": [
215
- // Prohibit direct access to external URLs
212
+ // Prohibit direct access to external URLs (even GET requests can leak data via URL parameters)
216
213
  {
217
214
  "toolName": "fetch_web_page",
218
215
  "action": "deny",
@@ -269,7 +266,7 @@ The agent loads configuration files in the following order. Settings in later fi
269
266
  "patterns": [
270
267
  {
271
268
  "toolName": { "$regex": "^(write_file|patch_file)$" },
272
- "input": { "filePath": { "$regex": "^\\.plain-agent/memory/.+\\.md$" } },
269
+ "input": { "filePath": { "$regex": "^(\\./)?\\.plain-agent/memory/.+\\.md$" } },
273
270
  "action": "allow"
274
271
  },
275
272
  {
@@ -278,8 +275,7 @@ The agent loads configuration files in the following order. Settings in later fi
278
275
  "action": "allow"
279
276
  },
280
277
 
281
- // ⚠️ `npm run test` may execute arbitrary code and access git-ignored files.
282
- // It must be run in a sandbox.
278
+ // ⚠️ Arbitrary code execution can access unauthorized files and networks. Always use a sandbox.
283
279
  {
284
280
  "toolName": "exec_command",
285
281
  "input": { "command": "npm", "args": ["run", { "$regex": "^(check|test|lint|fix)$" }] },
@@ -327,7 +323,7 @@ The agent loads configuration files in the following order. Settings in later fi
327
323
  ]
328
324
  },
329
325
 
330
- // Configure MCP servers for extended functionality
326
+ // Configure MCP servers
331
327
  "mcpServers": {
332
328
  "chrome_devtools": {
333
329
  "command": "npx",
@@ -365,12 +361,10 @@ The agent loads configuration files in the following order. Settings in later fi
365
361
 
366
362
  ## Prompts
367
363
 
368
- You can define reusable prompts in Markdown files. These are especially useful for common tasks like creating commit messages or conducting retrospectives.
364
+ You can define reusable prompts in Markdown files.
369
365
 
370
366
  ### Prompt File Format
371
367
 
372
- Prompts are Markdown files with a YAML frontmatter:
373
-
374
368
  ```md
375
369
  ---
376
370
  description: Create a commit message based on staged changes
@@ -407,25 +401,23 @@ Remote prompts are fetched and cached locally. The local content will be appende
407
401
 
408
402
  The agent searches for prompts in the following directories:
409
403
 
410
- - `~/.config/plain-agent/prompts/` (Global/User-defined prompts)
411
- - `.plain-agent/prompts/` (Project-specific prompts)
412
- - `.claude/commands/` (Claude-specific commands, prefixed with `claude/commands:`)
413
- - `.claude/skills/` (Claude-specific skills, prefixed with `claude/skills:`)
404
+ - `~/.config/plain-agent/prompts/`
405
+ - `.plain-agent/prompts/`
406
+ - `.claude/commands/`
407
+ - `.claude/skills/`
414
408
 
415
- The prompt ID is the relative path of the file without the `.md` extension. For example, `.plain-agent/prompts/retro.md` becomes `/prompts:retro`.
409
+ The prompt ID is the relative path of the file without the `.md` extension. For example, `.plain-agent/prompts/commit.md` becomes `/prompts:commit`.
416
410
 
417
411
  ### Shortcuts
418
412
 
419
- Prompts located in a `shortcuts/` subdirectory (e.g., `.plain-agent/prompts/shortcuts/review.md`) can be invoked directly as a top-level command (e.g., `/review`). This is useful for frequently used tasks. If a prompt is in a `shortcuts/` subdirectory, its ID is simplified by removing the `shortcuts/` prefix for use as a shortcut (e.g., `shortcuts/review` becomes `/review`).
413
+ Prompts located in a `shortcuts/` subdirectory (e.g., `.plain-agent/prompts/shortcuts/commit.md`) can be invoked directly as a top-level command (e.g., `/commit`).
420
414
 
421
415
  ## Subagents
422
416
 
423
- Subagents are specialized agents that can be delegated specific tasks. They allow you to break down complex workflows into focused, manageable components.
417
+ Subagents are specialized agents designed for specific tasks.
424
418
 
425
419
  ### Subagent File Format
426
420
 
427
- Subagent definitions are Markdown files with a YAML frontmatter:
428
-
429
421
  ```md
430
422
  ---
431
423
  description: Simplifies and refines code for clarity and maintainability
@@ -450,11 +442,9 @@ Remote subagents are fetched and cached locally. The local content will be appen
450
442
 
451
443
  The agent searches for subagent definitions in the following directories:
452
444
 
453
- - `~/.config/plain-agent/agents/` (Global/User-defined agents)
454
- - `.plain-agent/agents/` (Project-specific agents)
455
- - `.claude/agents/` (Claude-specific agents)
456
-
457
- The subagent ID is the relative path of the file without the `.md` extension. For example, `.plain-agent/agents/worker.md` becomes `worker`.
445
+ - `~/.config/plain-agent/agents/`
446
+ - `.plain-agent/agents/`
447
+ - `.claude/agents/`
458
448
 
459
449
  ## Claude Code Plugin Support
460
450
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iinm/plain-agent",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A lightweight CLI-based coding agent",
5
5
  "license": "MIT",
6
6
  "type": "module",