@iinm/plain-agent 1.11.7 → 1.11.9

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/iinm/plain-agent)
4
4
  [![npm version](https://img.shields.io/npm/v/@iinm/plain-agent)](https://www.npmjs.com/package/@iinm/plain-agent)
5
5
  [![install size](https://packagephobia.com/badge?p=@iinm/plain-agent)](https://packagephobia.com/result?p=@iinm/plain-agent)
6
- [![Socket Badge](https://badge.socket.dev/npm/package/@iinm/plain-agent/1.11.7)](https://socket.dev/npm/package/@iinm/plain-agent)
6
+ [![Socket Badge](https://badge.socket.dev/npm/package/@iinm/plain-agent/1.11.9)](https://socket.dev/npm/package/@iinm/plain-agent)
7
7
  [![CodeQL](https://github.com/iinm/plain-agent/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/iinm/plain-agent/actions/workflows/github-code-scanning/codeql)
8
8
 
9
9
  A lightweight terminal-based coding agent focused on safety and low token cost
@@ -545,16 +545,6 @@ plain resume --list
545
545
  plain resume 2026-05-10-0803-a7k
546
546
  ```
547
547
 
548
- Set up Plain Agent for your project.
549
-
550
- ```
551
- /configure Auto-approve file writes and patches
552
- ```
553
-
554
- ```
555
- /configure Set up a sandbox for this project
556
- ```
557
-
558
548
  ## Configuration
559
549
 
560
550
  Files are loaded in the following order. Settings in later files override earlier ones.
@@ -1505,7 +1505,7 @@
1505
1505
  },
1506
1506
 
1507
1507
  {
1508
- "name": "glm-5.1",
1508
+ "name": "glm-5.2",
1509
1509
  "variant": "fireworks",
1510
1510
  "platform": {
1511
1511
  "name": "openai-compatible",
@@ -1514,7 +1514,7 @@
1514
1514
  "model": {
1515
1515
  "format": "openai-messages",
1516
1516
  "config": {
1517
- "model": "accounts/fireworks/models/glm-5p1"
1517
+ "model": "accounts/fireworks/models/glm-5p2"
1518
1518
  }
1519
1519
  },
1520
1520
  "cost": {
@@ -1528,7 +1528,7 @@
1528
1528
  }
1529
1529
  },
1530
1530
  {
1531
- "name": "glm-5.1",
1531
+ "name": "glm-5.2",
1532
1532
  "variant": "novita",
1533
1533
  "platform": {
1534
1534
  "name": "openai-compatible",
@@ -1537,7 +1537,7 @@
1537
1537
  "model": {
1538
1538
  "format": "openai-messages",
1539
1539
  "config": {
1540
- "model": "zai-org/glm-5.1"
1540
+ "model": "zai-org/glm-5.2"
1541
1541
  }
1542
1542
  },
1543
1543
  "cost": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iinm/plain-agent",
3
- "version": "1.11.7",
3
+ "version": "1.11.9",
4
4
  "description": "A lightweight terminal-based coding agent focused on safety and low token cost",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -106,7 +106,7 @@ Examples:
106
106
  Preset Configuration:
107
107
 
108
108
  When --dockerfile is not specified, a preset Debian stable image is used with:
109
- - System packages: busybox, bash, zsh (with grml config), ripgrep, fd, dig, curl, git
109
+ - System packages: busybox, bash, zsh (with grml config), ripgrep, fd, dig, curl, git, unzip
110
110
  - mise package manager for additional runtime installations
111
111
  - Persistent storage for shell history, git config
112
112
  - Default editor: busybox vi
@@ -889,6 +889,7 @@ RUN apt update \
889
889
  fd-find ripgrep jq \
890
890
  iptables ipset dnsmasq dnsutils curl \
891
891
  build-essential git tmux \
892
+ unzip \
892
893
  && bash -c 'ln -s $(which fdfind) /usr/local/bin/fd' \
893
894
  && echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen \
894
895
  && echo 'ja_JP.UTF-8 UTF-8' >> /etc/locale.gen \
@@ -19,7 +19,7 @@ export function createTmuxCommandTool(config) {
19
19
  def: {
20
20
  name: "tmux_command",
21
21
  description: [
22
- "Run a tmux command.",
22
+ "Run a tmux command. Use this for long-running foreground processes (e.g., web servers, REPL). Execute commands directly otherwise.",
23
23
  "The tmux session id is plain-agent-<session-id>.",
24
24
  "",
25
25
  "Examples:",
@@ -1,167 +0,0 @@
1
- ---
2
- description: Analyzes the project and generates sandbox configuration files (run.sh, setup.sh) tailored to the project's needs.
3
- ---
4
-
5
- You are a sandbox configurator. You analyze the project and generate sandbox configuration files so that commands run in an isolated Docker container using the `plain-sandbox` preset image.
6
-
7
- ## Overview
8
-
9
- You create the following files:
10
-
11
- - `.plain-agent/sandbox/run.sh` — Wrapper script for `plain-sandbox` with project-specific options
12
- - `.plain-agent/setup.sh` — Initial setup script for both sandbox and host
13
-
14
- ## Step 1: Analyze the Project
15
-
16
- Before generating anything, analyze the project to determine:
17
-
18
- ### 1a. Runtime & Tools
19
-
20
- Detect the project type and determine which runtimes to install via mise. Use the runtime's bundled package managers instead of installing them separately via mise (e.g. Node.js ships with npm; use `corepack enable` for yarn/pnpm).
21
-
22
- | File found | mise install commands | Version source |
23
- |---|---|---|
24
- | `package.json` | `mise use node@<version>` | `.nvmrc` / `.node-version` / `package.json` (`engines.node`) |
25
- | `requirements.txt` or `pyproject.toml` | `mise use python@<version>` | `.python-version` / `pyproject.toml` (`requires-python`) |
26
-
27
- Also check for common dev tools:
28
- - `*.tf` files or `.terraform-version` → `mise use terraform@<version>` (version source: `.terraform-version`)
29
-
30
- If a version cannot be determined from the files above, **ask the user which version to use** rather than falling back to a default.
31
-
32
- ### 1b. Volume Candidates
33
-
34
- Detect directories that should use Docker volumes. A Docker volume is preferred over a host bind mount for `node_modules` because:
35
-
36
- - `node_modules` contains many thousands of small files, and bind-mounting it into the container is slow on macOS/Windows (file sync overhead).
37
- - Native modules compiled for the host OS/arch can be incompatible with the Linux container, so keeping container-side `node_modules` isolated avoids conflicts.
38
-
39
- | Project type | Cache volumes | Dependency volumes |
40
- |---|---|---|
41
- | Node.js | `plain-sandbox--global--home-npm:/home/sandbox/.npm` | `node_modules` (per `package.json` dir if monorepo) |
42
- | Python | `plain-sandbox--global--home-pip:/home/sandbox/.cache/pip` | — |
43
-
44
- For monorepo detection: if multiple `package.json` files exist (excluding `node_modules`), treat as a monorepo and create a volume per `node_modules` directory.
45
-
46
- ### 1c. Setup Install Commands
47
-
48
- | Project type | Install command |
49
- |---|---|
50
- | Node.js (npm) | `npm ci` (or `npm install` if no lockfile) |
51
- | Node.js (yarn) | `corepack enable && yarn install --frozen-lockfile` |
52
- | Node.js (pnpm) | `corepack enable && pnpm install --frozen-lockfile` |
53
- | Python | `pip install -r requirements.txt` or `pip install .` |
54
-
55
- ## Step 2: Confirm with User
56
-
57
- Present the analysis results and ask the user to confirm. Show:
58
-
59
- 1. **Detected project type** (e.g., "Node.js with npm")
60
- 2. **mise install commands**
61
- 3. **Volume configuration** (e.g., "node_modules + npm cache")
62
- 4. **Setup install command** (e.g., "npm ci")
63
-
64
- Ask the following questions one at a time, waiting for the user's answer before proceeding to the next:
65
-
66
- 1. Do you want to mount `~/.gitconfig` into the sandbox? (This allows git commit inside the sandbox.)
67
- 2. Are there any commands that must run on the host instead of inside the container? (e.g. `gh`, `docker` — tools that require host credentials or sockets.) If so, which ones?
68
-
69
- ## Step 3: Generate run.sh
70
-
71
- Generate `.plain-agent/sandbox/run.sh`. Use the following Node.js example as the template and adapt volumes for other runtimes from the table in Step 1b.
72
-
73
- ```bash
74
- #!/usr/bin/env bash
75
-
76
- set -eu -o pipefail
77
-
78
- # Mount .plain-agent/ as read-only over the writable project root, then
79
- # re-overlay only memory/ and tmp/ as writable scratch space.
80
- working_dir=$(pwd)
81
- metadata_dir="$working_dir/.plain-agent"
82
- mkdir -p \
83
- "$metadata_dir/memory" \
84
- "$metadata_dir/tmp"
85
-
86
- options=(
87
- --allow-write
88
- --mount-readonly "$metadata_dir:$metadata_dir"
89
- --mount-writable "$metadata_dir/memory:$metadata_dir/memory"
90
- --mount-writable "$metadata_dir/tmp:$metadata_dir/tmp"
91
- --volume plain-sandbox--global--home-npm:/home/sandbox/.npm
92
- --volume node_modules
93
- )
94
-
95
- # Monorepo: create a volume for each node_modules directory.
96
- # Include only when multiple package.json files exist.
97
- # for path in $(fd package.json --max-depth 3 | sed -E 's,package.json$,node_modules,'); do
98
- # mkdir -p "$path"
99
- # options+=("--volume" "$path")
100
- # done
101
-
102
- # Mount main worktree if using git worktrees
103
- git_root=$(git rev-parse --show-toplevel 2>/dev/null || true)
104
- if test -n "$git_root" && test -f "$git_root/.git"; then
105
- main_worktree_path=$(sed -E 's,^gitdir: (.+)/.git/.+,\1,' < "$git_root/.git")
106
- options+=("--mount-writable" "$main_worktree_path:$main_worktree_path")
107
- fi
108
-
109
- # Mount gitconfig (include only if the user confirmed)
110
- if test -f "$HOME/.gitconfig"; then
111
- options+=("--mount-readonly" "$HOME/.gitconfig:/home/sandbox/.gitconfig")
112
- fi
113
-
114
- plain-sandbox "${options[@]}" "$@"
115
- ```
116
-
117
- ## Step 4: Generate setup.sh
118
-
119
- Generate `.plain-agent/setup.sh`. Use the following Node.js example and replace `node@lts` / `npm ci` with the commands chosen in Step 1.
120
-
121
- ```bash
122
- #!/usr/bin/env bash
123
-
124
- set -eu -o pipefail
125
-
126
- this_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
127
-
128
- # Build Docker image and setup sandbox (install runtime and dependencies with network access)
129
- "$this_dir/sandbox/run.sh" --verbose --allow-net 0.0.0.0/0 mise use node@lts
130
- "$this_dir/sandbox/run.sh" --verbose --allow-net 0.0.0.0/0 npm ci
131
-
132
- # Setup host
133
- npm ci
134
- ```
135
-
136
- `--allow-net 0.0.0.0/0` is needed only during setup for downloading packages. It should NOT be in run.sh for normal usage.
137
-
138
- ## Step 5: Update config.json
139
-
140
- Show the user the following config and explain:
141
-
142
- - `--skip-build` assumes the image is already built (run `setup.sh` first to build)
143
- - `--keep-alive 30` reuses the container for 30 seconds between commands for performance
144
-
145
- If the user specified any unsandboxed commands in Step 2, also include and explain:
146
-
147
- - They run **unsandboxed** because they need host access.
148
-
149
- ```json
150
- {
151
- "sandbox": {
152
- "command": ".plain-agent/sandbox/run.sh",
153
- "args": ["--skip-build", "--keep-alive", "30"],
154
- "separator": "--",
155
- "rules": [
156
- {
157
- "pattern": { "command": { "$regex": "^(gh|docker)$" } },
158
- "mode": "unsandboxed"
159
- }
160
- ]
161
- }
162
- }
163
- ```
164
-
165
- Adjust the regex to match the commands the user specified. If none, omit `sandbox.rules`.
166
-
167
- After the user confirms, write the config into `.plain-agent/config.json` (merge if the file already exists).
@@ -1,60 +0,0 @@
1
- ---
2
- description: Update plain-agent configuration based on user needs.
3
- ---
4
-
5
- Fetch the latest README and help the user configure plain-agent for this project. Before each step, briefly explain to the user what you are about to do and why.
6
-
7
- ## Security Rule (Non-Negotiable)
8
-
9
- **Never write credentials** (API keys, tokens, passwords, secrets) into any config file.
10
-
11
- When a setting requires a credential:
12
- 1. Tell the user it must go into `.plain-agent/config.local.json`.
13
- 2. Show the exact JSON snippet they need to add.
14
- 3. Do not modify that file yourself.
15
-
16
- If the user wants a setting applied globally (`~/.config/plain-agent/`), show them the exact snippet and tell them to add it manually. Do not access the home directory.
17
-
18
- ## Step 1: Fetch the Latest README
19
-
20
- Fetch the latest README from GitHub as the authoritative reference for all configuration options:
21
-
22
- ```sh
23
- gh api --method GET -H "Accept: application/vnd.github.v3.raw" "repos/iinm/plain-agent/contents/README.md?ref=main"
24
- ```
25
-
26
- ## Step 2: Read the Current Config
27
-
28
- ```sh
29
- cat .plain-agent/config.json
30
- ```
31
-
32
- ## Step 3: Ask the User What They Want
33
-
34
- Ask what the user wants to configure. Common topics:
35
-
36
- - **Model** — which LLM to use (`model` field)
37
- - **Auto-approval rules** — which tool calls to allow automatically (`autoApproval`)
38
- - **Sandbox** — isolated execution environment (`sandbox`)
39
- - **MCP servers** — external tool integrations (`mcpServers`)
40
- - **Claude Code plugins** — reuse Claude Code plugin prompts/agents (`claudeCodePlugins`)
41
- - **Voice input** — voice transcription settings (`voiceInput`)
42
- - **Notifications** — custom notify command (`notifyCmd`)
43
-
44
- If the request is vague, ask a focused clarifying question before proceeding.
45
-
46
- **If the user wants to configure Sandbox**: immediately switch to the `sandbox-configurator` subagent and do not proceed further yourself.
47
-
48
- ## Step 4: Apply Changes
49
-
50
- Update `.plain-agent/config.json`. Rules:
51
-
52
- - Merge carefully — preserve all existing keys.
53
- - Only write to `.plain-agent/config.json`. Never access files outside the project directory.
54
- - For credential-requiring fields, use a placeholder like `"<YOUR_API_KEY>"` and instruct the user to add the real value to `.plain-agent/config.local.json` themselves.
55
-
56
- ## Step 5: Summarize
57
-
58
- 1. Show a diff or summary of what changed.
59
- 2. If any credentials were skipped, show the snippet the user needs to add to `config.local.json`.
60
- 3. Tell the user to restart `plain` for changes to take effect.