@wrongstack/acp 0.292.1 → 0.293.0

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/dist/index.js CHANGED
@@ -1916,7 +1916,7 @@ var ACPSession = class _ACPSession {
1916
1916
  termOpts.outputByteLimit = opts.terminalOutputByteLimit;
1917
1917
  }
1918
1918
  this.terminalServer = new TerminalServer(termOpts);
1919
- this.permissionPolicy = opts.permissionPolicy ?? defaultPermissionPolicy;
1919
+ this.permissionPolicy = opts.permissionPolicy ?? readOnlyPermissionPolicy;
1920
1920
  }
1921
1921
  // ──────────────────────────────────────────────────────────────────────
1922
1922
  // Public accessors
@@ -2731,11 +2731,12 @@ var ACPSession = class _ACPSession {
2731
2731
  * closing the gap where the agent simply skips the voluntary permission
2732
2732
  * request and sends the privileged callback directly.
2733
2733
  *
2734
- * Uses the session's permission policy. The default policy
2735
- * (`defaultPermissionPolicy`) auto-approves everything this is correct
2736
- * for trusted local agents (CLI `acp spawn`, Director fan-out). For
2737
- * untrusted/remote agents, the host should inject
2738
- * `readOnlyPermissionPolicy` or an interactive policy.
2734
+ * Uses the session's permission policy. The default
2735
+ * (`readOnlyPermissionPolicy`) auto-approves only side-effect-free tool
2736
+ * calls (read/search/fetch/think) and rejects everything else this is
2737
+ * the safe-by-default posture. For trusted local agents (CLI `acp spawn`,
2738
+ * Director fan-out), inject `defaultPermissionPolicy` to grant
2739
+ * write/execute access.
2739
2740
  *
2740
2741
  * Returns true if the callback is authorized, false if denied.
2741
2742
  */
@@ -2747,7 +2748,8 @@ var ACPSession = class _ACPSession {
2747
2748
  toolCallId: partial.toolCallId,
2748
2749
  title: partial.title,
2749
2750
  kind: partial.kind,
2750
- status: "pending"
2751
+ status: "pending",
2752
+ ...partial.rawInput ? { rawInput: partial.rawInput } : {}
2751
2753
  },
2752
2754
  options: [
2753
2755
  { optionId: "allow", name: "Allow", kind: "allow_once" },
@@ -2772,7 +2774,8 @@ var ACPSession = class _ACPSession {
2772
2774
  const allowed = await this.authorizeCallback({
2773
2775
  toolCallId: `acp-fs-write-${id}`,
2774
2776
  title: `Write file: ${params.path}`,
2775
- kind: "edit"
2777
+ kind: "edit",
2778
+ rawInput: { path: params.path, sessionId: params.sessionId }
2776
2779
  });
2777
2780
  if (!allowed) {
2778
2781
  await this.sendErrorResponse(id, -32602, "filesystem write denied by permission policy");
@@ -2810,7 +2813,8 @@ var ACPSession = class _ACPSession {
2810
2813
  const allowed = await this.authorizeCallback({
2811
2814
  toolCallId: `acp-terminal-create-${id}`,
2812
2815
  title: `Run command: ${String(params.command ?? "")} ${(Array.isArray(params.args) ? params.args : []).join(" ")}`.trim(),
2813
- kind: "execute"
2816
+ kind: "execute",
2817
+ rawInput: { command: params.command, args: params.args, cwd: params.cwd, sessionId: params.sessionId }
2814
2818
  });
2815
2819
  if (!allowed) {
2816
2820
  await this.sendErrorResponse(id, -32602, "terminal create denied by permission policy");
@@ -3768,6 +3772,9 @@ async function runOne(agentId, cmd, task, timeoutMs, signal, onProgress) {
3768
3772
  const { runner, stop } = await makeACPSubagentRunnerWithStop({
3769
3773
  ...cmd,
3770
3774
  timeoutMs,
3775
+ // CLI /acp parallel and Director fan-out are trusted local agents — grant write/execute access.
3776
+ // The session default is read-only for untrusted agents (acp-session.ts:221).
3777
+ permissionPolicy: defaultPermissionPolicy,
3771
3778
  ...onProgress ? { onProgress: (event) => onProgress(agentId, event) } : {}
3772
3779
  });
3773
3780
  try {