@cortexkit/aft-opencode 0.47.2 → 0.47.3

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/config.d.ts CHANGED
@@ -71,6 +71,11 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
71
71
  max_depth: z.ZodOptional<z.ZodNumber>;
72
72
  max_file_size: z.ZodOptional<z.ZodNumber>;
73
73
  }, z.core.$strip>>;
74
+ sandbox: z.ZodOptional<z.ZodObject<{
75
+ enabled: z.ZodOptional<z.ZodBoolean>;
76
+ write_allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ read_deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ }, z.core.$strip>>;
74
79
  bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
75
80
  rewrite: z.ZodOptional<z.ZodBoolean>;
76
81
  compress: z.ZodOptional<z.ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,UAAU,EAQhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAsMtF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkH3B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,MAAM,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AgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,EACxB,MAAM,GAAE,MAAsB,GAC7B,4BAA4B,EAAE,CAmBhC;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,GAAG,sBAAsB,CAKtF;AAED,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,MAAM,EACxB,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACzC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,0BAA0B,EAAE,MAAM,CAAA;CAAE,CAOxF;AAMD,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAoCjE"}
package/dist/index.js CHANGED
@@ -14328,6 +14328,9 @@ class SubcTransportPool {
14328
14328
  if (record.routeEntry === entry2) {
14329
14329
  entry2.closed = true;
14330
14330
  record.routeEntry = null;
14331
+ if (entry2.handle != null) {
14332
+ safeCloseRoute(entry2.client, entry2.handle);
14333
+ }
14331
14334
  }
14332
14335
  };
14333
14336
  const handleRequestFailure = (err, entry2) => {
@@ -30137,6 +30140,11 @@ var BashFeaturesSchema = exports_external.object({
30137
30140
  foreground_wait_window_ms: exports_external.number().int().positive().optional()
30138
30141
  });
30139
30142
  var BashConfigSchema = exports_external.union([exports_external.boolean(), BashFeaturesSchema]);
30143
+ var SandboxConfigSchema = exports_external.object({
30144
+ enabled: exports_external.boolean().optional(),
30145
+ write_allow: exports_external.array(exports_external.string()).optional(),
30146
+ read_deny: exports_external.array(exports_external.string()).optional()
30147
+ });
30140
30148
  var BridgeConfigSchema = exports_external.object({
30141
30149
  request_timeout_ms: exports_external.number().int().min(1000, { message: "bridge.request_timeout_ms must be at least 1000" }).optional(),
30142
30150
  hang_threshold: exports_external.number().int().min(1, { message: "bridge.hang_threshold must be at least 1" }).optional()
@@ -30178,6 +30186,7 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
30178
30186
  callgraph_chunk_size: exports_external.number().optional(),
30179
30187
  inspect: InspectConfigSchema.optional(),
30180
30188
  backup: BackupConfigSchema.optional(),
30189
+ sandbox: SandboxConfigSchema.optional(),
30181
30190
  bash: BashConfigSchema.optional(),
30182
30191
  experimental: ExperimentalConfigSchema.optional(),
30183
30192
  lsp: LspConfigSchema.optional(),
@@ -30511,6 +30520,15 @@ function mergeInspectConfig(baseInspect, overrideInspect) {
30511
30520
  }
30512
30521
  return Object.fromEntries(Object.entries(inspect).filter(([, value]) => value !== undefined));
30513
30522
  }
30523
+ function mergeSandboxConfig(base, project) {
30524
+ const readDeny = [...new Set([...base?.read_deny ?? [], ...project?.read_deny ?? []])];
30525
+ const merged = {
30526
+ ...base,
30527
+ ...readDeny.length > 0 ? { read_deny: readDeny } : {},
30528
+ ...project?.enabled === true ? { enabled: true } : {}
30529
+ };
30530
+ return Object.keys(merged).length > 0 ? merged : undefined;
30531
+ }
30514
30532
  function mergeBashConfig(baseBash, overrideBash) {
30515
30533
  if (baseBash === undefined && overrideBash === undefined)
30516
30534
  return;
@@ -30599,6 +30617,10 @@ function getStrippedTopLevelKeys(override) {
30599
30617
  stripped.push("bridge");
30600
30618
  if (override.backup !== undefined)
30601
30619
  stripped.push("backup");
30620
+ if (override.sandbox?.enabled === false)
30621
+ stripped.push("sandbox.enabled");
30622
+ if (override.sandbox?.write_allow !== undefined)
30623
+ stripped.push("sandbox.write_allow");
30602
30624
  if (override.subc !== undefined)
30603
30625
  stripped.push("subc");
30604
30626
  if (override.disabled_tools?.includes("aft_safety"))
@@ -30617,6 +30639,7 @@ function mergeConfigs(base, override) {
30617
30639
  const experimental = mergeExperimentalConfig(base.experimental, override.experimental);
30618
30640
  const bash = mergeBashConfig(base.bash, override.bash);
30619
30641
  const inspect = mergeInspectConfig(base.inspect, override.inspect);
30642
+ const sandbox = mergeSandboxConfig(base.sandbox, override.sandbox);
30620
30643
  const bridge = base.bridge;
30621
30644
  const safeOverride = pickProjectSafeFields(override);
30622
30645
  delete safeOverride.bash;
@@ -30629,6 +30652,7 @@ function mergeConfigs(base, override) {
30629
30652
  ...lsp ? { lsp } : {},
30630
30653
  ...bash !== undefined ? { bash } : {},
30631
30654
  ...inspect !== undefined ? { inspect } : {},
30655
+ ...sandbox !== undefined ? { sandbox } : {},
30632
30656
  experimental,
30633
30657
  semantic,
30634
30658
  ...bridge !== undefined ? { bridge } : {},
@@ -35110,8 +35134,8 @@ function groupBashPermissionAsks(asks) {
35110
35134
  bashAsk = { kind: "bash", patterns: [], always: [] };
35111
35135
  grouped.push(bashAsk);
35112
35136
  }
35113
- pushUnique(bashAsk.patterns, ask.patterns);
35114
- pushUnique(bashAsk.always, ask.always);
35137
+ pushUnique(bashAsk.patterns ?? [], ask.patterns ?? []);
35138
+ pushUnique(bashAsk.always ?? [], ask.always ?? []);
35115
35139
  continue;
35116
35140
  }
35117
35141
  grouped.push(ask);
@@ -35119,27 +35143,53 @@ function groupBashPermissionAsks(asks) {
35119
35143
  return grouped;
35120
35144
  }
35121
35145
  function permissionsGrantedForRetry(asks) {
35122
- return asks.flatMap((ask) => ask.always.length > 0 ? ask.always : ask.patterns);
35146
+ return asks.flatMap((ask) => {
35147
+ if (ask.kind === "escalation")
35148
+ return ask.grant_id ? [ask.grant_id] : [];
35149
+ const always = ask.always ?? [];
35150
+ return always.length > 0 ? always : ask.patterns ?? [];
35151
+ });
35152
+ }
35153
+ function escalationAskText(ask) {
35154
+ return `This command will run UNSANDBOXED on the host.
35155
+
35156
+ Exact command:
35157
+ ${ask.command ?? ""}
35158
+
35159
+ Working directory:
35160
+ ${ask.cwd ?? ""}`;
35123
35161
  }
35124
35162
  async function withPermissionLoop(ctx, runtime, params, bridgeCall, options) {
35125
- const first = await bridgeCall(ctx, runtime, "bash", params, options);
35126
- if (first.success !== false || first.code !== "permission_required")
35127
- return first;
35128
- const asks = Array.isArray(first.asks) ? first.asks : [];
35129
- for (const ask of groupBashPermissionAsks(asks)) {
35130
- const permission = ask.kind === "external_directory" ? "external_directory" : "bash";
35131
- await runAsk(runtime.ask({
35132
- permission,
35133
- patterns: ask.patterns,
35134
- always: ask.always,
35135
- metadata: {}
35136
- }));
35137
- }
35138
- const second = await bridgeCall(ctx, runtime, "bash", { ...params, permissions_granted: permissionsGrantedForRetry(asks) }, options);
35139
- if (second.success === false && second.code === "permission_required") {
35140
- throw new Error("bash permission retry failed");
35163
+ const granted = Array.isArray(params.permissions_granted) ? params.permissions_granted.filter((value) => typeof value === "string") : [];
35164
+ let response = await bridgeCall(ctx, runtime, "bash", params, options);
35165
+ for (let round = 0;round < 8; round++) {
35166
+ if (response.success !== false || response.code !== "permission_required")
35167
+ return response;
35168
+ const asks = Array.isArray(response.asks) ? response.asks : [];
35169
+ if (asks.length === 0)
35170
+ throw new Error("bash permission retry failed: no asks returned");
35171
+ for (const ask of groupBashPermissionAsks(asks)) {
35172
+ const permission = ask.kind === "external_directory" ? "external_directory" : "bash";
35173
+ const escalation = ask.kind === "escalation";
35174
+ await runAsk(runtime.ask({
35175
+ permission,
35176
+ patterns: escalation ? [escalationAskText(ask)] : ask.patterns ?? [],
35177
+ always: escalation ? [] : ask.always ?? [],
35178
+ metadata: escalation ? {
35179
+ command: ask.command ?? "",
35180
+ cwd: ask.cwd ?? "",
35181
+ grant_id: ask.grant_id ?? "",
35182
+ unsandboxed: true
35183
+ } : {}
35184
+ }));
35185
+ }
35186
+ for (const grant of permissionsGrantedForRetry(asks)) {
35187
+ if (!granted.includes(grant))
35188
+ granted.push(grant);
35189
+ }
35190
+ response = await bridgeCall(ctx, runtime, "bash", { ...params, permissions_granted: granted }, options);
35141
35191
  }
35142
- return second;
35192
+ throw new Error("bash permission retry failed: too many rounds");
35143
35193
  }
35144
35194
  function createBashTool(ctx, aftSearchRegisteredOverride) {
35145
35195
  const initialBashCfg = resolveBashConfig(ctx.config);
@@ -35157,6 +35207,7 @@ function createBashTool(ctx, aftSearchRegisteredOverride) {
35157
35207
  workdir: z4.string().optional().describe("Working directory for command execution. Relative paths resolve through the bridge; defaults to the current tool context/project root when omitted."),
35158
35208
  description: z4.string().optional().describe("Short 5-10 word human-readable summary shown in OpenCode UI metadata instead of raw shell syntax."),
35159
35209
  wait: z4.boolean().optional().describe("When true, run in the foreground without auto-promoting and wait until the command finishes or reaches its timeout; if you send a new message, the wait detaches to background. Use only when you know the result is required before doing anything else."),
35210
+ sandbox: z4.literal("host").optional().describe("Request one-command approval to run unsandboxed on the host; use only when native sandboxing blocks required work, and note that it is a no-op when sandboxing is disabled."),
35160
35211
  ...backgroundFlagArg,
35161
35212
  compressed: z4.boolean().optional().describe("When true or omitted, return compressed output with noisy terminal control sequences reduced. Set to false for raw output."),
35162
35213
  ...ptyArgs
@@ -35219,7 +35270,8 @@ function createBashTool(ctx, aftSearchRegisteredOverride) {
35219
35270
  permissions_requested: true,
35220
35271
  foreground_orchestrate: true,
35221
35272
  block_to_completion: blockToCompletion,
35222
- wait: requestedWait
35273
+ wait: requestedWait,
35274
+ sandbox: args2.sandbox
35223
35275
  }, callBashBridge, {
35224
35276
  transportTimeoutMs: orchestratedTransportTimeoutMs(blockToCompletion, requestedWait, effectiveTimeout, foregroundWaitMs),
35225
35277
  onProgress: ({ text }) => {
@@ -37702,14 +37754,14 @@ var PLUGIN_VERSION = (() => {
37702
37754
  return "0.0.0";
37703
37755
  }
37704
37756
  })();
37705
- var ANNOUNCEMENT_VERSION = "0.47.2";
37757
+ var ANNOUNCEMENT_VERSION = "0.47.3";
37706
37758
  var ANNOUNCEMENT_FEATURES = [
37707
- "Fixed: apply_patch wrote mixed line endings when editing CRLF (Windows) files; the file's dominant line ending is now preserved.",
37708
- "Fixed: inlining a function argument like twice(1 + 2) could change operator precedence; non-atomic arguments are now parenthesized.",
37709
- "Fixed: removing one name from a Python import with an aliased sibling (from m import a, b as c) could delete the whole line.",
37710
- "Fixed: bash_watch could report a match that spanned the stdout/stderr seam; streams are now scanned independently.",
37711
- "GitHub and GitLab file links (…/blob/…) now read raw file content in aft_outline/aft_zoom, and documentation heading lookups tolerate numeric prefixes, link labels, emoji, and anchor slugs.",
37712
- "bash now finds tools on a PATH exported from your shell rc (e.g. zsh .zshrc), and several warm hot paths got faster."
37759
+ "Fixed: aft_search could return zero results when a match existed — hidden test files consumed the result cap before source files were reached.",
37760
+ "Fixed: aft_import removing one name from a comma-separated PHP use (use A, B) deleted the sibling; Java static-member removal is fixed the same way.",
37761
+ "Fixed: aft_safety restore now preserves Unix permission bits (including the executable bit); aft_conflicts keeps conflicts with non-ASCII filenames.",
37762
+ "Fixed: aft_inspect no longer counts TODO markers inside strings and now reports self-import cycles; trace_data no longer reports a flow after the variable is overwritten.",
37763
+ "Long-running daemon sessions fully reclaim idle projects (lower memory), and daemon restarts no longer trigger a re-embedding storm.",
37764
+ "Faster indexed search, tool dispatch, call trees, and duplicate scans across the board."
37713
37765
  ];
37714
37766
  var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
37715
37767
  var plugin = async (input) => initializePluginForDirectory(input);
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuCjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,GACpB,MAAM,CAaR;AA6ED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CA2NhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuCjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,GACpB,MAAM,CAaR;AAwGD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAkOhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-opencode",
3
- "version": "0.47.2",
3
+ "version": "0.47.3",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
6
6
  "main": "dist/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@clack/prompts": "^1.6.0",
37
- "@cortexkit/aft-bridge": "0.47.2",
37
+ "@cortexkit/aft-bridge": "0.47.3",
38
38
  "@opentui/core": "0.4.3",
39
39
  "@opentui/solid": "0.4.3",
40
40
  "comment-json": "^4.6.2",
@@ -43,12 +43,12 @@
43
43
  "zod": "^4.4.3"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@cortexkit/aft-darwin-arm64": "0.47.2",
47
- "@cortexkit/aft-darwin-x64": "0.47.2",
48
- "@cortexkit/aft-linux-arm64": "0.47.2",
49
- "@cortexkit/aft-linux-x64": "0.47.2",
50
- "@cortexkit/aft-win32-arm64": "0.47.2",
51
- "@cortexkit/aft-win32-x64": "0.47.2"
46
+ "@cortexkit/aft-darwin-arm64": "0.47.3",
47
+ "@cortexkit/aft-darwin-x64": "0.47.3",
48
+ "@cortexkit/aft-linux-arm64": "0.47.3",
49
+ "@cortexkit/aft-linux-x64": "0.47.3",
50
+ "@cortexkit/aft-win32-arm64": "0.47.3",
51
+ "@cortexkit/aft-win32-x64": "0.47.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@opencode-ai/plugin": "^1.17.11",