@steerable/steer 0.3.26 → 0.3.28

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
@@ -1,6 +1,6 @@
1
1
  # @steerable/steer
2
2
 
3
- Official command-line interface and terminal TUI (`steer`) for [Steer Agent](https://steeragent.app) (v0.3.26).
3
+ Official command-line interface and terminal TUI (`steer`) for [Steer Agent](https://steeragent.app) (v0.3.28).
4
4
 
5
5
  Runs directly on macOS, Linux (`x64` / `arm64`), and Windows — including headless SSH servers — and automatically pulls the portable Python sidecar runtime for your platform. When installed alongside the Steer desktop app, `steer` shares the same local `~/.steer` workspace history, skills, and model configuration.
6
6
 
@@ -1343,5 +1343,22 @@
1343
1343
  "Set up API key…": "配置 API Key…",
1344
1344
  "API key not configured — click to set up ({model})": "尚未配置 API Key — 点击前往配置({model})",
1345
1345
  "Save a model API key below (or switch Provider to local Ollama) — your message will be sent automatically.": "在下方保存模型 API Key(或切换为本地免密 Ollama)后,将自动发送你刚输入的消息。",
1346
- "No API key is configured yet. Paste a key below and click Save, or switch Provider to Ollama (Local).": "尚未填写可用的 API Key:请在下方粘贴密钥后点「保存」,或将服务商切换为本地 Ollama。"
1346
+ "No API key is configured yet. Paste a key below and click Save, or switch Provider to Ollama (Local).": "尚未填写可用的 API Key:请在下方粘贴密钥后点「保存」,或将服务商切换为本地 Ollama。",
1347
+ "Destructive command · confirm before running": "高危操作确认",
1348
+ "Agent requests access outside the workspace": "Agent 请求访问工作区外目录",
1349
+ "Agent requests to install packages and run code": "Agent 请求安装依赖并运行代码",
1350
+ "This command can delete or overwrite data: {reason}": "包含不可逆删除或重置指令({reason}),请核对后再决定是否执行。",
1351
+ "Target folder: {dir}": "目标目录:{dir}",
1352
+ "Needs a new package: {packages}": "需联网安装新依赖:{packages}",
1353
+ "Installs {packages} before running. The command sandbox is off.": "运行前会安装依赖:{packages}。命令沙箱已关闭。",
1354
+ "Installs {packages} before running inside the workspace sandbox.": "在工作区沙箱内运行,并在运行前安装依赖:{packages}。",
1355
+ "Runs with the local interpreter. The command sandbox is off.": "使用本机解释器运行。命令沙箱已关闭。",
1356
+ "Runs inside the workspace sandbox.": "在工作区沙箱内运行。",
1357
+ "Allow this folder in this chat": "本任务允许此目录",
1358
+ "Always allow commands starting with {prefix}": "始终允许以 {prefix} 开头的命令",
1359
+ "Saved on this computer and applies to matching commands in every chat": "写入本机规则,对所有任务中匹配该前缀的命令生效",
1360
+ "Enter to allow · Shift+Enter for this folder · Esc to deny": "↵ 允许一次 · Shift+Enter 允许此目录 · Esc 拒绝",
1361
+ "Enter to allow · Shift+Enter for this chat · Esc to deny": "↵ 允许一次 · Shift+Enter 本任务允许 · Esc 拒绝",
1362
+ "Running with default permissions. Files, commands, and snippets inside the workspace run automatically. Access outside it, new packages, and destructive commands still ask.": "当前在默认权限下运行。工作区内的文件、命令和代码片段自动运行;访问外部目录、安装新依赖或执行高危删除命令前会向你确认。",
1363
+ "Full access is enabled. Files, commands, and snippets on this computer run without a prompt. Destructive commands and outward submissions still ask.": "已开启完整权限。本机文件、命令和代码片段无需逐次确认;高危删除命令和对外提交仍会向你确认。"
1347
1364
  }
@@ -1,13 +1,40 @@
1
1
  /**
2
2
  * Steer 的回合中权限申请。
3
- * 审批卡先看到同样的路径和理由;用户允许之后,这个会话后面的回合把目录放进可写根。
4
- * 本回合开始时已经定下的系统沙箱不会中途改写。
3
+ * 审批卡先看到同样的路径和理由;用户允许之后,目录立刻进入本对话的可写根,
4
+ * 当前回合和后续回合都能写这些目录。
5
5
  */
6
6
  import fs from 'node:fs/promises';
7
7
  import path from 'node:path';
8
8
  import { getPackAssemblies, registerPackAssembly, } from '@steerable/agent-shell/host/pack-assembly';
9
9
  import { registerPackTurnHooks } from '@steerable/agent-shell/local-backend/pack-turn-hooks';
10
10
  import { isProductApprovalEnabled } from '@steerable/agent-shell/host-tools-runtime';
11
+ /**
12
+ * The live grant lives in the shell. A shell build that predates it has no
13
+ * module; later turns still use the pack grant map.
14
+ */
15
+ function loadSessionDirectoryGrants() {
16
+ const specifier = [
17
+ '@steerable/agent-shell',
18
+ 'local-backend/session-directory-grants',
19
+ ].join('/');
20
+ return import(specifier).then((mod) => {
21
+ if (!mod || typeof mod !== 'object')
22
+ return null;
23
+ const record = mod;
24
+ if (typeof record.grantChatDirectories !== 'function')
25
+ return null;
26
+ if (typeof record.clearChatGrantedDirectoriesForTests !== 'function')
27
+ return null;
28
+ return record;
29
+ }, (err) => {
30
+ const code = err && typeof err === 'object' && 'code' in err
31
+ ? err.code
32
+ : undefined;
33
+ if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND')
34
+ return null;
35
+ throw err;
36
+ });
37
+ }
11
38
  const ALLOWED = new Set(['allow_once', 'allow_for_session', 'allow_always']);
12
39
  const MAX_PATHS = 8;
13
40
  const MAX_REASON = 500;
@@ -81,7 +108,7 @@ async function acceptPaths(paths) {
81
108
  }
82
109
  /**
83
110
  * 按审批卡的决定记下或拒绝这次申请。
84
- * 允许之后,后续回合的可写根包含这些目录。
111
+ * 允许之后,这些目录进入本对话的可写根,并通知正在跑的回合。
85
112
  */
86
113
  export async function applyPermissionDecision(chatId, request, decision) {
87
114
  const card = permissionCardPayload(request);
@@ -112,11 +139,16 @@ export async function applyPermissionDecision(chatId, request, decision) {
112
139
  }
113
140
  const network = request.network || previous?.network === true;
114
141
  grants.set(chatId, { paths, network });
142
+ const sessionGrants = await loadSessionDirectoryGrants();
143
+ if (sessionGrants)
144
+ await sessionGrants.grantChatDirectories(chatId, paths);
115
145
  return {
116
146
  success: true,
117
147
  paths,
118
148
  network,
119
- note: 'These directories are writable on later turns in this chat. This turn keeps the sandbox it started with.',
149
+ note: sessionGrants
150
+ ? 'These directories are now writable in this turn and later turns in this chat.'
151
+ : 'These directories are writable on later turns in this chat. This turn keeps the sandbox it started with.',
120
152
  card,
121
153
  };
122
154
  }
@@ -126,8 +158,8 @@ export function createSteerPermissionTools() {
126
158
  name: 'request_permissions',
127
159
  description: 'Ask the user for extra directories when the current sandbox cannot write there. '
128
160
  + 'The approval card shows the paths and the reason. '
129
- + 'After they allow it, later turns in this chat can write those directories. '
130
- + 'This turn keeps the sandbox it started with. Network is already available.',
161
+ + 'After they allow it, this turn and later turns in this chat can write those directories. '
162
+ + 'Network is already available.',
131
163
  mode: 'local',
132
164
  inputSchema: {
133
165
  type: 'object',
@@ -169,6 +201,8 @@ export function registerSteerPermissions() {
169
201
  registerPackAssembly('steer-permissions', assembleSteerPermissions);
170
202
  }
171
203
  /** 测试收尾:清掉已同意的目录。 */
172
- export function resetSteerPermissionsForTests() {
204
+ export async function resetSteerPermissionsForTests() {
173
205
  grants.clear();
206
+ const sessionGrants = await loadSessionDirectoryGrants();
207
+ sessionGrants?.clearChatGrantedDirectoriesForTests();
174
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steerable/steer",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "Steer Agent CLI & TUI — local-first AI assistant for your terminal and server.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://steeragent.app",
@@ -25,18 +25,18 @@
25
25
  "node": ">=22.19.0"
26
26
  },
27
27
  "dependencies": {
28
- "@steerable/agent-cli": "0.14.8",
29
- "@steerable/agent-protocol": "0.14.8",
30
- "@steerable/agent-shell": "0.14.8",
28
+ "@steerable/agent-cli": "0.14.10",
29
+ "@steerable/agent-protocol": "0.14.10",
30
+ "@steerable/agent-shell": "0.14.10",
31
31
  "fflate": "^0.8.2",
32
32
  "playwright-core": "1.63.0",
33
33
  "sharp": "^0.33.5"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@steerable/runtime-darwin-arm64": "0.14.8",
37
- "@steerable/runtime-darwin-x64": "0.14.8",
38
- "@steerable/runtime-linux-arm64": "0.14.8",
39
- "@steerable/runtime-linux-x64": "0.14.8",
40
- "@steerable/runtime-win32-x64": "0.14.8"
36
+ "@steerable/runtime-darwin-arm64": "0.14.10",
37
+ "@steerable/runtime-darwin-x64": "0.14.10",
38
+ "@steerable/runtime-linux-arm64": "0.14.10",
39
+ "@steerable/runtime-linux-x64": "0.14.10",
40
+ "@steerable/runtime-win32-x64": "0.14.10"
41
41
  }
42
42
  }