@trim21/personal-pi-extensions 0.1.577 → 0.1.578

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.1.577",
3
+ "version": "0.1.578",
4
4
  "type": "module",
5
5
  "description": "Custom pi coding-agent extensions: bwrap sandbox, workspace guard, opencode edit, and more",
6
6
  "keywords": [
@@ -292,11 +292,12 @@ const UNSANDBOXED_DENIED = "User denied unsandboxed execution.";
292
292
 
293
293
  /** 命令没经沙箱时沿用 prompt 里的说法,给出在沙盒外重跑的手段。 */
294
294
  const SANDBOX_ESCAPE_HATCH =
295
- "[Sandbox] If the command needs more than that, use the `dangerouslyDisableSandbox` parameter to request unsandboxed execution; the user must approve this request.";
295
+ "If the command needs more than that, use the `dangerouslyDisableSandbox` parameter to request unsandboxed execution; the user must approve this request.";
296
296
 
297
297
  /**
298
298
  * 命令失败时作为独立信息块附上的沙箱状态:默认写边界 + 网络层级,以及在沙盒外重跑的手段。
299
299
  * 写边界只说沙箱布局(不展开用户配置的可写路径),网络只说层级(不列白名单域名)。
300
+ * 整块包在 `<system-reminder>` 里,与其它系统注入的提示同一形态,模型不会把它当成命令输出。
300
301
  * 命令没经沙箱(allow-all、审批通过的全权限、Windows)时返回 undefined:
301
302
  * 没有沙箱就没什么可提示的。
302
303
  */
@@ -304,8 +305,10 @@ export function describeSandbox(resolved: ResolvedBwrap, unsandboxed: boolean):
304
305
  if (unsandboxed) return undefined;
305
306
  const writes = resolved.mode === "readonly" ? "the filesystem is read-only" : SANDBOX_WRITE_RULES;
306
307
  return [
307
- `[Sandbox] This command ran in a sandbox: ${writes}; ${describeNetwork(resolved)}.`,
308
+ "<system-reminder>",
309
+ `This command ran in a sandbox: ${writes}; ${describeNetwork(resolved)}.`,
308
310
  SANDBOX_ESCAPE_HATCH,
311
+ "</system-reminder>",
309
312
  ].join("\n");
310
313
  }
311
314