calllint 1.5.0 → 1.6.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.
Files changed (2) hide show
  1. package/dist/index.js +112 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5360,8 +5360,7 @@ var WindsurfExtractor = class extends BaseAgentExtractor {
5360
5360
  return configs;
5361
5361
  }
5362
5362
  getUserConfigPath() {
5363
- const appDataDir = this.getAppDataDir();
5364
- return join10(appDataDir, "Windsurf", "mcp.json");
5363
+ return join10(this.resolveHome(), ".codeium", "mcp_config.json");
5365
5364
  }
5366
5365
  createConfig(configPath) {
5367
5366
  const exists = this.isValidConfig(configPath);
@@ -8904,9 +8903,91 @@ function claudeCodeServerEntry(server) {
8904
8903
  return entry;
8905
8904
  }
8906
8905
 
8906
+ // ../../packages/install-planner/src/adapters/cursor.ts
8907
+ var CURSOR_HOST_ID = "cursor";
8908
+ var CURSOR_TIER = "A";
8909
+ var cursorAdapter = {
8910
+ id: CURSOR_HOST_ID,
8911
+ tier: CURSOR_TIER,
8912
+ createPlan(ctx, upstream) {
8913
+ return buildInstallPlan({ ...ctx, host: CURSOR_HOST_ID, tier: CURSOR_TIER }, upstream);
8914
+ },
8915
+ validatePlan(plan) {
8916
+ return validatePlan(plan);
8917
+ },
8918
+ applyPlan(plan, ctx) {
8919
+ return applyPlan({
8920
+ plan,
8921
+ approvalDigest: ctx.approvalDigest,
8922
+ configPath: ctx.configPath,
8923
+ backupPath: ctx.backupPath,
8924
+ lockPath: ctx.lockPath,
8925
+ fs: ctx.fs,
8926
+ now: ctx.now
8927
+ });
8928
+ }
8929
+ };
8930
+ function cursorServerEntry(server) {
8931
+ const entry = {};
8932
+ if (server.url) {
8933
+ entry["url"] = server.url;
8934
+ } else if (server.command) {
8935
+ entry["command"] = server.command;
8936
+ entry["args"] = server.args ?? [];
8937
+ }
8938
+ if (server.envKeys && server.envKeys.length > 0) {
8939
+ const env = {};
8940
+ for (const k of [...server.envKeys].sort()) env[k] = "";
8941
+ entry["env"] = env;
8942
+ }
8943
+ return entry;
8944
+ }
8945
+
8946
+ // ../../packages/install-planner/src/adapters/windsurf.ts
8947
+ var WINDSURF_HOST_ID = "windsurf";
8948
+ var WINDSURF_TIER = "A";
8949
+ var windsurfAdapter = {
8950
+ id: WINDSURF_HOST_ID,
8951
+ tier: WINDSURF_TIER,
8952
+ createPlan(ctx, upstream) {
8953
+ return buildInstallPlan({ ...ctx, host: WINDSURF_HOST_ID, tier: WINDSURF_TIER }, upstream);
8954
+ },
8955
+ validatePlan(plan) {
8956
+ return validatePlan(plan);
8957
+ },
8958
+ applyPlan(plan, ctx) {
8959
+ return applyPlan({
8960
+ plan,
8961
+ approvalDigest: ctx.approvalDigest,
8962
+ configPath: ctx.configPath,
8963
+ backupPath: ctx.backupPath,
8964
+ lockPath: ctx.lockPath,
8965
+ fs: ctx.fs,
8966
+ now: ctx.now
8967
+ });
8968
+ }
8969
+ };
8970
+ function windsurfServerEntry(server) {
8971
+ const entry = {};
8972
+ if (server.url) {
8973
+ entry["serverUrl"] = server.url;
8974
+ } else if (server.command) {
8975
+ entry["command"] = server.command;
8976
+ entry["args"] = server.args ?? [];
8977
+ }
8978
+ if (server.envKeys && server.envKeys.length > 0) {
8979
+ const env = {};
8980
+ for (const k of [...server.envKeys].sort()) env[k] = "";
8981
+ entry["env"] = env;
8982
+ }
8983
+ return entry;
8984
+ }
8985
+
8907
8986
  // ../../packages/install-planner/src/index.ts
8908
8987
  var HOST_ADAPTERS = {
8909
- [claudeCodeAdapter.id]: claudeCodeAdapter
8988
+ [claudeCodeAdapter.id]: claudeCodeAdapter,
8989
+ [cursorAdapter.id]: cursorAdapter,
8990
+ [windsurfAdapter.id]: windsurfAdapter
8910
8991
  };
8911
8992
  function getHostAdapter(host) {
8912
8993
  return HOST_ADAPTERS[host] ?? null;
@@ -9081,8 +9162,10 @@ function buildAuthorityForTarget(input, artifactDigest) {
9081
9162
  }
9082
9163
  return buildAuthorityManifest({ artifactDigest, servers, surfaces });
9083
9164
  }
9084
- function defaultHostConfigPath(host) {
9165
+ function defaultHostConfigPath(host, cwd) {
9085
9166
  if (host === CLAUDE_CODE_HOST_ID) return join16(homedir(), ".claude.json");
9167
+ if (host === CURSOR_HOST_ID) return join16(cwd, ".cursor", "mcp.json");
9168
+ if (host === WINDSURF_HOST_ID) return join16(homedir(), ".codeium", "mcp_config.json");
9086
9169
  return null;
9087
9170
  }
9088
9171
  function plannedServersFor(input, host) {
@@ -9093,19 +9176,25 @@ function plannedServersFor(input, host) {
9093
9176
  } catch {
9094
9177
  return [];
9095
9178
  }
9179
+ const entryByHost = {
9180
+ [CLAUDE_CODE_HOST_ID]: claudeCodeServerEntry,
9181
+ [CURSOR_HOST_ID]: cursorServerEntry,
9182
+ [WINDSURF_HOST_ID]: windsurfServerEntry
9183
+ };
9184
+ const entryFor = entryByHost[host] ?? claudeCodeServerEntry;
9096
9185
  return servers.map((s) => ({
9097
9186
  name: s.name,
9098
- entry: claudeCodeServerEntry({ command: s.command, args: s.args, url: s.url, envKeys: s.envKeys })
9187
+ entry: entryFor({ command: s.command, args: s.args, url: s.url, envKeys: s.envKeys })
9099
9188
  }));
9100
9189
  }
9101
9190
  function buildPlanForHost(host, input, artifactDigest, authority, decision, deps, configPathOverride) {
9102
9191
  const adapter = getHostAdapter(host);
9103
9192
  if (!adapter) {
9104
- return { error: `Unknown host "${host}". Known hosts: ${CLAUDE_CODE_HOST_ID}`, exitCode: EXIT.USAGE };
9193
+ return { error: `Unknown host "${host}". Known hosts: ${knownHostList()}`, exitCode: EXIT.USAGE };
9105
9194
  }
9106
9195
  const servers = plannedServersFor(input, host);
9107
9196
  if (servers.length === 0) return null;
9108
- const configPath = configPathOverride ? resolvePath4(deps.cwd, configPathOverride) : defaultHostConfigPath(host);
9197
+ const configPath = configPathOverride ? resolvePath4(deps.cwd, configPathOverride) : defaultHostConfigPath(host, deps.cwd);
9109
9198
  if (!configPath) {
9110
9199
  return { error: `No default config path known for host "${host}"; pass --host-config <path>`, exitCode: EXIT.USAGE };
9111
9200
  }
@@ -9308,7 +9397,7 @@ function trustApply(args, deps) {
9308
9397
  return { stdout: "", stderr: `Not a calllint.install-plan.v1 document: ${planFile}`, exitCode: EXIT.ERROR };
9309
9398
  }
9310
9399
  const adapter = getHostAdapter(plan.host);
9311
- if (!adapter) return usageErr(`Unknown host "${plan.host}". Known hosts: ${CLAUDE_CODE_HOST_ID}`);
9400
+ if (!adapter) return usageErr(`Unknown host "${plan.host}". Known hosts: ${knownHostList()}`);
9312
9401
  if (!adapter.applyPlan) {
9313
9402
  return usageErr(`Host "${plan.host}" is tier ${adapter.tier} \u2014 plan-only; copy the patch or use a Tier-A host to apply.`);
9314
9403
  }
@@ -9707,6 +9796,15 @@ The write could not be verified AND the automatic rollback failed. Your
9707
9796
  }
9708
9797
  return out;
9709
9798
  }
9799
+ function hostHelpDescriptions() {
9800
+ return Object.values(HOST_ADAPTERS).map((a) => {
9801
+ const capability = a.applyPlan ? `Tier ${a.tier}, applies` : `Tier ${a.tier}, plan-only \u2014 you apply the emitted patch`;
9802
+ return `${a.id} (${capability})`;
9803
+ }).join("; ");
9804
+ }
9805
+ function knownHostList() {
9806
+ return Object.keys(HOST_ADAPTERS).join(", ");
9807
+ }
9710
9808
  function trustHelp() {
9711
9809
  return `
9712
9810
  calllint trust \u2014 Automated Trust Gateway (prepare \u2192 approve \u2192 apply \u2192 verify)
@@ -9738,10 +9836,12 @@ OPTIONS (prepare)
9738
9836
  --format json|sarif Force the evidence format (default: auto-detect)
9739
9837
  --provider <name> Force the evidence provider adapter (default: auto-detect)
9740
9838
  --policy <file> Use a policy file for the decision (default: built-in defaults)
9741
- --host <id> Build an install plan for a host (G5: claude-code). Reads
9742
- the host config READ-ONLY; never applies. Plan is emitted
9743
- only for a non-blocking decision (SAFE/REVIEW).
9744
- --host-config <path> Override the host config path (default: ~/.claude.json)
9839
+ --host <id> Build an install plan for a host \u2014 ${hostHelpDescriptions()}.
9840
+ Reads the host config READ-ONLY; never applies here. Plan
9841
+ is emitted only for a non-blocking decision.
9842
+ --host-config <path> Override the host config path (default: per host \u2014
9843
+ ~/.claude.json for claude-code, .cursor/mcp.json for
9844
+ cursor, ~/.codeium/mcp_config.json for windsurf)
9745
9845
  --write-plan Persist the plan to .calllint/plans/<plan-id>.json
9746
9846
  --flows Show static toxic-flow paths (calllint.flow.v0) behind the
9747
9847
  decision's TOXIC_FLOW_COMPOSITION reasons. With --json, emits
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "calllint",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Evidence-backed security verdicts for MCP servers and agent tools. Lint agent tool-call risk before tools run — SAFE / REVIEW / BLOCK / UNKNOWN, with evidence. Never executes the server it judges.",
5
5
  "keywords": [
6
6
  "mcp",