@vm0/cli 9.98.1 → 9.99.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.
@@ -49,7 +49,7 @@ if (DSN) {
49
49
  Sentry.init({
50
50
  dsn: DSN,
51
51
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
52
- release: "9.98.1",
52
+ release: "9.99.0",
53
53
  sendDefaultPii: false,
54
54
  tracesSampleRate: 0,
55
55
  shutdownTimeout: 500,
@@ -68,7 +68,7 @@ if (DSN) {
68
68
  }
69
69
  });
70
70
  Sentry.setContext("cli", {
71
- version: "9.98.1",
71
+ version: "9.99.0",
72
72
  command: process.argv.slice(2).join(" ")
73
73
  });
74
74
  Sentry.setContext("runtime", {
@@ -7725,6 +7725,19 @@ var slackFirewall = {
7725
7725
  }
7726
7726
  ]
7727
7727
  };
7728
+ var slackDefaultAllowed = [
7729
+ "bookmarks:read",
7730
+ "channels:history",
7731
+ "channels:read",
7732
+ "emoji:read",
7733
+ "pins:read",
7734
+ "reactions:read",
7735
+ "search:read",
7736
+ "team:read",
7737
+ "usergroups:read",
7738
+ "users.profile:read",
7739
+ "users:read"
7740
+ ];
7728
7741
 
7729
7742
  // ../../packages/core/src/firewalls/categories.ts
7730
7743
  var CATEGORY_REGISTRY = {};
@@ -22518,7 +22531,23 @@ var linearFirewall = {
22518
22531
  Authorization: "Bearer ${{ secrets.LINEAR_TOKEN }}"
22519
22532
  }
22520
22533
  },
22521
- permissions: []
22534
+ permissions: [
22535
+ {
22536
+ name: "read",
22537
+ description: "Read data (all GraphQL queries)",
22538
+ rules: ["POST /graphql GraphQL type:query"]
22539
+ },
22540
+ {
22541
+ name: "write",
22542
+ description: "Modify data (all GraphQL mutations)",
22543
+ rules: ["POST /graphql GraphQL type:mutation"]
22544
+ },
22545
+ {
22546
+ name: "subscribe",
22547
+ description: "Subscribe to real-time events",
22548
+ rules: ["POST /graphql GraphQL type:subscription"]
22549
+ }
22550
+ ]
22522
22551
  }
22523
22552
  ]
22524
22553
  };
@@ -27113,6 +27142,35 @@ function isFirewallConnectorType(type) {
27113
27142
  function getConnectorFirewall(type) {
27114
27143
  return EXPANDED_CONNECTOR_FIREWALLS[type];
27115
27144
  }
27145
+ var DEFAULT_ALLOWED = {
27146
+ slack: slackDefaultAllowed
27147
+ };
27148
+ function getDefaultFirewallPolicies(type) {
27149
+ const allowed = DEFAULT_ALLOWED[type];
27150
+ if (!allowed) return null;
27151
+ const allowSet = new Set(allowed);
27152
+ const config = getConnectorFirewall(type);
27153
+ const result = {};
27154
+ for (const api of config.apis) {
27155
+ if (api.permissions) {
27156
+ for (const p of api.permissions) {
27157
+ result[p.name] = allowSet.has(p.name) ? "allow" : "deny";
27158
+ }
27159
+ }
27160
+ }
27161
+ return result;
27162
+ }
27163
+ function resolveFirewallPolicies(stored, connectors) {
27164
+ let resolved = stored;
27165
+ for (const connector of connectors) {
27166
+ if (!isFirewallConnectorType(connector)) continue;
27167
+ if (resolved?.[connector]) continue;
27168
+ const defaults = getDefaultFirewallPolicies(connector);
27169
+ if (!defaults) continue;
27170
+ resolved = { ...resolved, [connector]: defaults };
27171
+ }
27172
+ return resolved;
27173
+ }
27116
27174
 
27117
27175
  // ../../packages/core/src/firewall-loader.ts
27118
27176
  var MAX_RESPONSE_SIZE = 128 * 1024;
@@ -27148,7 +27206,40 @@ function matchFirewallPath(path, pattern) {
27148
27206
  if (pi !== pathSegs.length) return null;
27149
27207
  return params;
27150
27208
  }
27151
- function findMatchingPermissions(method, path, config) {
27209
+ function parseGraphQLRule(rest) {
27210
+ const gqlIdx = rest.indexOf(" GraphQL");
27211
+ if (gqlIdx === -1) return null;
27212
+ const path = gqlIdx > 0 ? rest.slice(0, gqlIdx) : "/";
27213
+ const suffixParts = rest.slice(gqlIdx + 1).split(/\s+/);
27214
+ let typeFilter = null;
27215
+ let opFilter = null;
27216
+ for (let i = 1; i < suffixParts.length; i++) {
27217
+ const part = suffixParts[i];
27218
+ if (part.startsWith("type:")) {
27219
+ typeFilter = part.slice(5);
27220
+ } else if (part.startsWith("operationName:")) {
27221
+ opFilter = part.slice(14);
27222
+ }
27223
+ }
27224
+ return { path, typeFilter, opFilter };
27225
+ }
27226
+ function matchGraphQLBody(body, typeFilter, opFilter) {
27227
+ if (!body) return false;
27228
+ if (typeFilter !== null && body.type !== typeFilter) {
27229
+ return false;
27230
+ }
27231
+ if (opFilter !== null) {
27232
+ const opName = body.operationName;
27233
+ if (!opName) return false;
27234
+ if (opFilter.endsWith("*")) {
27235
+ if (!opName.startsWith(opFilter.slice(0, -1))) return false;
27236
+ } else if (opName !== opFilter) {
27237
+ return false;
27238
+ }
27239
+ }
27240
+ return true;
27241
+ }
27242
+ function findMatchingPermissions(method, path, config, graphqlBody) {
27152
27243
  const upperMethod = method.toUpperCase();
27153
27244
  const matched = /* @__PURE__ */ new Set();
27154
27245
  for (const api of config.apis) {
@@ -27159,9 +27250,14 @@ function findMatchingPermissions(method, path, config) {
27159
27250
  const spaceIdx = rule.indexOf(" ");
27160
27251
  if (spaceIdx === -1) continue;
27161
27252
  const ruleMethod = rule.slice(0, spaceIdx).toUpperCase();
27162
- const rulePath = rule.slice(spaceIdx + 1);
27253
+ const rest = rule.slice(spaceIdx + 1);
27163
27254
  if (ruleMethod !== "ANY" && ruleMethod !== upperMethod) continue;
27255
+ const gql = parseGraphQLRule(rest);
27256
+ const rulePath = gql ? gql.path : rest;
27164
27257
  if (matchFirewallPath(path, rulePath) !== null) {
27258
+ if (gql && (gql.typeFilter !== null || gql.opFilter !== null) && !matchGraphQLBody(graphqlBody, gql.typeFilter, gql.opFilter)) {
27259
+ continue;
27260
+ }
27165
27261
  matched.add(perm.name);
27166
27262
  break;
27167
27263
  }
@@ -31727,6 +31823,7 @@ export {
31727
31823
  resolveSkillRef,
31728
31824
  isFirewallConnectorType,
31729
31825
  getConnectorFirewall,
31826
+ resolveFirewallPolicies,
31730
31827
  findMatchingPermissions,
31731
31828
  getInstructionsStorageName,
31732
31829
  getSkillStorageName,
@@ -31843,4 +31940,4 @@ export {
31843
31940
  parseTime,
31844
31941
  paginate
31845
31942
  };
31846
- //# sourceMappingURL=chunk-F2IYWURQ.js.map
31943
+ //# sourceMappingURL=chunk-52LSZTSN.js.map