@trim21/personal-pi-extensions 0.0.402 → 0.0.403

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trim21/personal-pi-extensions",
3
- "version": "0.0.402",
3
+ "version": "0.0.403",
4
4
  "type": "module",
5
5
  "description": "Custom pi coding-agent extensions: bwrap sandbox, workspace guard, opencode edit, and more",
6
6
  "keywords": [
@@ -87,7 +87,7 @@ export interface BwrapExecutionRequest {
87
87
  command: string;
88
88
  timeout?: number;
89
89
  requestFullAccess?: boolean;
90
- requestFullAccessReason?: string;
90
+ description?: string;
91
91
  /** 解析后的实际执行目录;缺省时与 ctx.cwd 相同。ctx.cwd 始终是 session 工作区。 */
92
92
  cwd?: string;
93
93
  signal?: AbortSignal;
@@ -354,12 +354,7 @@ export class BwrapRuntime {
354
354
  throw new Error(`Command denied by bwrap approval rule: ${request.command}`);
355
355
  }
356
356
  if (decision === undefined) {
357
- await this.approveFullAccess(
358
- request.ctx,
359
- request.command,
360
- request.requestFullAccessReason,
361
- execCwd,
362
- );
357
+ await this.approveFullAccess(request.ctx, request.command, request.description, execCwd);
363
358
  }
364
359
  }
365
360
  const operations =
@@ -127,7 +127,7 @@ export function registerShellTools(
127
127
  command: params.command,
128
128
  timeout: timeout / 1000,
129
129
  requestFullAccess: params.dangerouslyDisableSandbox,
130
- requestFullAccessReason: params.description,
130
+ description: params.description,
131
131
  signal,
132
132
  onUpdate,
133
133
  });
@@ -42,6 +42,9 @@ export default function opencodeBash(
42
42
  parameters: Type.Object(
43
43
  {
44
44
  command: Type.String({ description: "The command to execute" }),
45
+ description: Type.Optional(
46
+ Type.String({ description: "Clear, concise description of the command" }),
47
+ ),
45
48
  workdir: Type.Optional(
46
49
  Type.String({
47
50
  description:
@@ -80,6 +83,7 @@ export default function opencodeBash(
80
83
  command: params.command,
81
84
  timeout: timeout / 1000,
82
85
  requestFullAccess: params.dangerouslyDisableSandbox,
86
+ description: params.description,
83
87
  signal,
84
88
  onUpdate,
85
89
  });