@trops/dash-core 0.1.494 → 0.1.496

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.esm.js CHANGED
@@ -48834,7 +48834,7 @@ var GrantManuallyModal = function GrantManuallyModal(_ref) {
48834
48834
  isOpen: isOpen,
48835
48835
  setIsOpen: setIsOpen,
48836
48836
  children: /*#__PURE__*/jsxs("div", {
48837
- className: "flex flex-col w-full max-w-xl ring-2 ring-amber-500",
48837
+ className: "flex flex-col w-full max-w-xl border-2 border-amber-500 rounded",
48838
48838
  children: [/*#__PURE__*/jsxs("div", {
48839
48839
  className: "px-5 py-4 border-b border-gray-700",
48840
48840
  children: [/*#__PURE__*/jsxs("div", {
@@ -48853,20 +48853,12 @@ var GrantManuallyModal = function GrantManuallyModal(_ref) {
48853
48853
  children: "Server name"
48854
48854
  }), /*#__PURE__*/jsx("input", {
48855
48855
  type: "text",
48856
- list: "known-mcp-servers",
48857
48856
  value: serverName,
48858
48857
  onChange: function onChange(e) {
48859
48858
  return setServerName(e.target.value);
48860
48859
  },
48861
- placeholder: "e.g. filesystem, github, slack",
48862
- className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700"
48863
- }), /*#__PURE__*/jsx("datalist", {
48864
- id: "known-mcp-servers",
48865
- children: knownServerNames.map(function (n) {
48866
- return /*#__PURE__*/jsx("option", {
48867
- value: n
48868
- }, n);
48869
- })
48860
+ placeholder: knownServerNames.length > 0 ? "e.g. ".concat(knownServerNames.slice(0, 3).join(", ")) : "e.g. filesystem, github, slack",
48861
+ className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 text-gray-200"
48870
48862
  })]
48871
48863
  }), /*#__PURE__*/jsxs("div", {
48872
48864
  className: "flex flex-col gap-1",
@@ -48880,7 +48872,7 @@ var GrantManuallyModal = function GrantManuallyModal(_ref) {
48880
48872
  return setToolsText(e.target.value);
48881
48873
  },
48882
48874
  placeholder: "e.g. read_file, list_directory",
48883
- className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 font-mono"
48875
+ className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 text-gray-200 font-mono"
48884
48876
  })]
48885
48877
  }), /*#__PURE__*/jsxs("div", {
48886
48878
  className: "flex flex-col gap-1",
@@ -48894,7 +48886,7 @@ var GrantManuallyModal = function GrantManuallyModal(_ref) {
48894
48886
  },
48895
48887
  placeholder: "/Users/jane/Documents\n/tmp/notes",
48896
48888
  rows: 3,
48897
- className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 font-mono"
48889
+ className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 text-gray-200 font-mono"
48898
48890
  })]
48899
48891
  }), /*#__PURE__*/jsxs("div", {
48900
48892
  className: "flex flex-col gap-1",
@@ -48908,10 +48900,10 @@ var GrantManuallyModal = function GrantManuallyModal(_ref) {
48908
48900
  },
48909
48901
  placeholder: "/tmp/output",
48910
48902
  rows: 3,
48911
- className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 font-mono"
48903
+ className: "text-xs px-2 py-1.5 rounded bg-gray-800 border border-gray-700 text-gray-200 font-mono"
48912
48904
  })]
48913
48905
  }), error && /*#__PURE__*/jsx("div", {
48914
- className: "text-xs text-red-400 bg-red-900 bg-opacity-20 border border-red-700 rounded px-3 py-2",
48906
+ className: "text-xs text-red-400 bg-red-950 border border-red-700 rounded px-3 py-2",
48915
48907
  children: error
48916
48908
  })]
48917
48909
  }), /*#__PURE__*/jsxs("div", {
@@ -49192,6 +49184,7 @@ var WidgetGrantRow = function WidgetGrantRow(_ref6) {
49192
49184
  }), allServerNames.map(function (serverName) {
49193
49185
  var decl = declaredServers[serverName] || {};
49194
49186
  var grant = grantedServers[serverName];
49187
+ var allStale = isServerEntirelyStale(decl, grant);
49195
49188
  return /*#__PURE__*/jsxs("div", {
49196
49189
  className: "flex flex-col space-y-2 border-t border-gray-800 pt-2",
49197
49190
  children: [/*#__PURE__*/jsxs("div", {
@@ -49208,6 +49201,9 @@ var WidgetGrantRow = function WidgetGrantRow(_ref6) {
49208
49201
  return onRevokeServer(serverName);
49209
49202
  }
49210
49203
  })]
49204
+ }), allStale && /*#__PURE__*/jsx("div", {
49205
+ className: "text-xs text-amber-400 bg-amber-900 bg-opacity-20 border border-amber-700 rounded px-2 py-1.5",
49206
+ children: "All grants on this server are no longer in the manifest \u2014 the widget likely no longer uses this server. Consider revoking."
49211
49207
  }), /*#__PURE__*/jsx(PermsList, {
49212
49208
  label: "Tools",
49213
49209
  declaredItems: decl.tools || [],
@@ -49241,17 +49237,44 @@ var PermsList = function PermsList(_ref7) {
49241
49237
  }), all.map(function (item) {
49242
49238
  var isGranted = grantedSet.has(item);
49243
49239
  var isDeclared = declaredSet.has(item);
49240
+ var isStale = isGranted && !isDeclared;
49244
49241
  return /*#__PURE__*/jsxs("span", {
49245
- className: "text-xs font-mono break-all ".concat(isGranted ? "opacity-100" : isDeclared ? "opacity-50 line-through" : "opacity-100 text-amber-400"),
49246
- children: [item, !isDeclared && isGranted && /*#__PURE__*/jsx("span", {
49247
- className: "ml-2 opacity-60",
49248
- children: "(no longer declared)"
49242
+ className: "text-xs font-mono break-all ".concat(isStale ? "text-amber-400" : isGranted ? "opacity-100" : "opacity-50 line-through"),
49243
+ children: [item, isStale && /*#__PURE__*/jsx("span", {
49244
+ className: "ml-2 not-italic font-sans normal-case tracking-normal text-amber-400",
49245
+ children: "(stale \u2014 widget no longer requests this; consider revoking)"
49249
49246
  })]
49250
49247
  }, item);
49251
49248
  })]
49252
49249
  });
49253
49250
  };
49254
49251
 
49252
+ /**
49253
+ * True when the granted entry has at least one item AND every granted
49254
+ * item is missing from the current declared block (i.e. all of this
49255
+ * server's grants are unused by the current manifest). Used to surface
49256
+ * a "this whole server's grant looks unused" suggestion at the row level.
49257
+ */
49258
+ function isServerEntirelyStale(decl, grant) {
49259
+ if (!grant) return false;
49260
+ var declTools = new Set(decl.tools || []);
49261
+ var declRead = new Set(decl.readPaths || []);
49262
+ var declWrite = new Set(decl.writePaths || []);
49263
+ var grantedTools = grant.tools || [];
49264
+ var grantedRead = grant.readPaths || [];
49265
+ var grantedWrite = grant.writePaths || [];
49266
+ var total = grantedTools.length + grantedRead.length + grantedWrite.length;
49267
+ if (total === 0) return false;
49268
+ var stale = grantedTools.every(function (t) {
49269
+ return !declTools.has(t);
49270
+ }) && grantedRead.every(function (p) {
49271
+ return !declRead.has(p);
49272
+ }) && grantedWrite.every(function (p) {
49273
+ return !declWrite.has(p);
49274
+ });
49275
+ return stale;
49276
+ }
49277
+
49255
49278
  /**
49256
49279
  * Renders a small badge showing how the user got to this grant. Helps
49257
49280
  * the user audit grants that were approved against a scanner guess
@@ -49355,6 +49378,31 @@ var EXAMPLE_FIXTURES = [{
49355
49378
  }
49356
49379
  }
49357
49380
  }
49381
+ }, {
49382
+ caption: "Stale grant — the widget upgraded and dropped readPaths from its manifest, but the user's grant is still present.",
49383
+ widgetId: "@example/upgraded-widget",
49384
+ hasManifest: true,
49385
+ grantOrigin: "declared",
49386
+ declared: {
49387
+ // Manifest now declares only the tool, no paths.
49388
+ servers: {
49389
+ filesystem: {
49390
+ tools: ["read_file"],
49391
+ readPaths: [],
49392
+ writePaths: []
49393
+ }
49394
+ }
49395
+ },
49396
+ granted: {
49397
+ grantOrigin: "declared",
49398
+ servers: {
49399
+ filesystem: {
49400
+ tools: ["read_file"],
49401
+ readPaths: ["~/Documents/old-notes"],
49402
+ writePaths: []
49403
+ }
49404
+ }
49405
+ }
49358
49406
  }];
49359
49407
  var noop = function noop() {};
49360
49408