@trops/dash-core 0.1.493 → 0.1.494

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
@@ -49123,9 +49123,9 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49123
49123
  padding: false
49124
49124
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
49125
49125
  className: "text-xs opacity-60",
49126
- children: "Tools and paths each widget is allowed to call via MCP. Granted paths are visible to other widgets in the same dashboard that use the same MCP server. Revoke any time."
49126
+ children: "Granting access here is a trust signal about the widget \u2014 not a per-dashboard switch."
49127
49127
  })]
49128
- }), error && /*#__PURE__*/jsxRuntime.jsx("div", {
49128
+ }), /*#__PURE__*/jsxRuntime.jsx(HowThisWorksPanel, {}), error && /*#__PURE__*/jsxRuntime.jsx("div", {
49129
49129
  className: "text-xs text-red-400 bg-red-900 bg-opacity-20 border border-red-700 rounded p-3",
49130
49130
  children: error
49131
49131
  }), rows.length === 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -49300,6 +49300,223 @@ var GrantOriginBadge = function GrantOriginBadge(_ref8) {
49300
49300
  });
49301
49301
  };
49302
49302
 
49303
+ // Mock fixtures for the "Example rows" section. These use the same
49304
+ // WidgetGrantRow component the real rows use, so the preview always
49305
+ // reflects the real rendering. Click handlers are no-ops — the panel is
49306
+ // for visualization only.
49307
+ var EXAMPLE_FIXTURES = [{
49308
+ caption: "Declared by the developer and granted by the user.",
49309
+ widgetId: "@example/notes-summarizer",
49310
+ hasManifest: true,
49311
+ grantOrigin: "declared",
49312
+ declared: {
49313
+ servers: {
49314
+ filesystem: {
49315
+ tools: ["read_file", "list_directory"],
49316
+ readPaths: ["~/Documents/notes"],
49317
+ writePaths: []
49318
+ }
49319
+ }
49320
+ },
49321
+ granted: {
49322
+ grantOrigin: "declared",
49323
+ servers: {
49324
+ filesystem: {
49325
+ tools: ["read_file", "list_directory"],
49326
+ readPaths: ["~/Documents/notes"],
49327
+ writePaths: []
49328
+ }
49329
+ }
49330
+ }
49331
+ }, {
49332
+ caption: "Declared by the developer — the user hasn't decided yet.",
49333
+ widgetId: "@example/code-search",
49334
+ hasManifest: true,
49335
+ grantOrigin: null,
49336
+ declared: {
49337
+ servers: {
49338
+ github: {
49339
+ tools: ["search_repositories", "get_file_contents"]
49340
+ }
49341
+ }
49342
+ },
49343
+ granted: null
49344
+ }, {
49345
+ caption: "Detected by the install-time scanner and granted.",
49346
+ widgetId: "@example/file-helper",
49347
+ hasManifest: false,
49348
+ grantOrigin: "discovered",
49349
+ declared: null,
49350
+ granted: {
49351
+ grantOrigin: "discovered",
49352
+ servers: {
49353
+ filesystem: {
49354
+ tools: ["read_file"],
49355
+ readPaths: [],
49356
+ writePaths: []
49357
+ }
49358
+ }
49359
+ }
49360
+ }, {
49361
+ caption: "Granted manually because the widget had no manifest.",
49362
+ widgetId: "@example/legacy-widget",
49363
+ hasManifest: false,
49364
+ grantOrigin: "manual",
49365
+ declared: null,
49366
+ granted: {
49367
+ grantOrigin: "manual",
49368
+ servers: {
49369
+ filesystem: {
49370
+ tools: ["read_file", "write_file"],
49371
+ readPaths: ["~/Downloads"],
49372
+ writePaths: ["/tmp/widget-output"]
49373
+ }
49374
+ }
49375
+ }
49376
+ }];
49377
+ var noop = function noop() {};
49378
+
49379
+ /**
49380
+ * Collapsible explainer that documents how grants flow per-widget vs
49381
+ * per-dashboard, with a concrete example table and rendered preview rows
49382
+ * for each grant state. Default-collapsed so users who don't care never
49383
+ * see it.
49384
+ */
49385
+ var HowThisWorksPanel = function HowThisWorksPanel() {
49386
+ var _useState1 = React.useState(false),
49387
+ _useState10 = _slicedToArray(_useState1, 2),
49388
+ open = _useState10[0],
49389
+ setOpen = _useState10[1];
49390
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
49391
+ className: "border border-gray-700 rounded",
49392
+ children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
49393
+ type: "button",
49394
+ onClick: function onClick() {
49395
+ return setOpen(function (v) {
49396
+ return !v;
49397
+ });
49398
+ },
49399
+ className: "w-full flex flex-row items-center justify-between px-3 py-2 text-left text-sm hover:bg-gray-800",
49400
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
49401
+ children: "How widget MCP permissions work"
49402
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
49403
+ icon: open ? "chevron-up" : "chevron-down",
49404
+ className: "h-3 w-3 opacity-60"
49405
+ })]
49406
+ }), open && /*#__PURE__*/jsxRuntime.jsxs("div", {
49407
+ className: "flex flex-col space-y-4 px-3 py-3 border-t border-gray-800 text-xs leading-relaxed",
49408
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
49409
+ className: "space-y-2",
49410
+ children: [/*#__PURE__*/jsxRuntime.jsxs("p", {
49411
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
49412
+ className: "font-semibold",
49413
+ children: "The grant is about the widget, not the dashboard."
49414
+ }), " ", "When you grant ", /*#__PURE__*/jsxRuntime.jsx("code", {
49415
+ children: "@trops/notes-summarizer"
49416
+ }), " access to", " ", /*#__PURE__*/jsxRuntime.jsx("code", {
49417
+ children: "~/Documents"
49418
+ }), ", you're saying \"I trust this widget with this path, anywhere.\" Grants live one-per-widget, regardless of how many dashboards use it."]
49419
+ }), /*#__PURE__*/jsxRuntime.jsxs("p", {
49420
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
49421
+ className: "font-semibold",
49422
+ children: "Each dashboard automatically scopes its servers."
49423
+ }), " ", "When you open a dashboard, Dash spawns a separate MCP server process per dashboard. That server is configured with only the paths granted to widgets actually on that dashboard \u2014 nothing else. Two dashboards using the same widget share the same grant; two dashboards using different widgets get different effective scopes."]
49424
+ }), /*#__PURE__*/jsxRuntime.jsxs("p", {
49425
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
49426
+ className: "font-semibold",
49427
+ children: "What this doesn't do."
49428
+ }), " ", "There's no way today to say \"this widget can use filesystem on Dashboard 1 but not Dashboard 2.\" Grants are per-widget; per-(widget, dashboard) granularity would need a bigger UX rework. If you don't want a widget to access a path on a particular dashboard, the workaround is to remove it from that dashboard or revoke the grant entirely."]
49429
+ })]
49430
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
49431
+ className: "space-y-2",
49432
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
49433
+ className: "font-semibold",
49434
+ children: ["Example: widget A granted ", /*#__PURE__*/jsxRuntime.jsx("code", {
49435
+ children: "/Documents"
49436
+ }), ", widget B granted ", /*#__PURE__*/jsxRuntime.jsx("code", {
49437
+ children: "/Code"
49438
+ })]
49439
+ }), /*#__PURE__*/jsxRuntime.jsxs("table", {
49440
+ className: "w-full text-xs border border-gray-800",
49441
+ children: [/*#__PURE__*/jsxRuntime.jsx("thead", {
49442
+ children: /*#__PURE__*/jsxRuntime.jsxs("tr", {
49443
+ className: "bg-gray-900",
49444
+ children: [/*#__PURE__*/jsxRuntime.jsx("th", {
49445
+ className: "text-left px-2 py-1 border-b border-gray-800",
49446
+ children: "Scenario"
49447
+ }), /*#__PURE__*/jsxRuntime.jsx("th", {
49448
+ className: "text-left px-2 py-1 border-b border-gray-800",
49449
+ children: "Dashboard 1 sees"
49450
+ }), /*#__PURE__*/jsxRuntime.jsx("th", {
49451
+ className: "text-left px-2 py-1 border-b border-gray-800",
49452
+ children: "Dashboard 2 sees"
49453
+ })]
49454
+ })
49455
+ }), /*#__PURE__*/jsxRuntime.jsxs("tbody", {
49456
+ children: [/*#__PURE__*/jsxRuntime.jsxs("tr", {
49457
+ children: [/*#__PURE__*/jsxRuntime.jsx("td", {
49458
+ className: "px-2 py-1 border-b border-gray-800",
49459
+ children: "A on Dash 1, B on Dash 2"
49460
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49461
+ className: "px-2 py-1 border-b border-gray-800 font-mono",
49462
+ children: "/Documents"
49463
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49464
+ className: "px-2 py-1 border-b border-gray-800 font-mono",
49465
+ children: "/Code"
49466
+ })]
49467
+ }), /*#__PURE__*/jsxRuntime.jsxs("tr", {
49468
+ children: [/*#__PURE__*/jsxRuntime.jsx("td", {
49469
+ className: "px-2 py-1 border-b border-gray-800",
49470
+ children: "A on both, B on Dash 2"
49471
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49472
+ className: "px-2 py-1 border-b border-gray-800 font-mono",
49473
+ children: "/Documents"
49474
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49475
+ className: "px-2 py-1 border-b border-gray-800 font-mono",
49476
+ children: "/Documents, /Code"
49477
+ })]
49478
+ }), /*#__PURE__*/jsxRuntime.jsxs("tr", {
49479
+ children: [/*#__PURE__*/jsxRuntime.jsx("td", {
49480
+ className: "px-2 py-1",
49481
+ children: "A + B both on Dash 1"
49482
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49483
+ className: "px-2 py-1 font-mono",
49484
+ children: "/Documents, /Code"
49485
+ }), /*#__PURE__*/jsxRuntime.jsx("td", {
49486
+ className: "px-2 py-1 opacity-60",
49487
+ children: "(no server)"
49488
+ })]
49489
+ })]
49490
+ })]
49491
+ })]
49492
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
49493
+ className: "space-y-3",
49494
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
49495
+ className: "font-semibold",
49496
+ children: "What each row state looks like"
49497
+ }), EXAMPLE_FIXTURES.map(function (f) {
49498
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
49499
+ className: "space-y-1",
49500
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
49501
+ className: "italic opacity-60",
49502
+ children: f.caption
49503
+ }), /*#__PURE__*/jsxRuntime.jsx(WidgetGrantRow, {
49504
+ widgetId: f.widgetId,
49505
+ declared: f.declared,
49506
+ granted: f.granted,
49507
+ hasManifest: f.hasManifest,
49508
+ grantOrigin: f.grantOrigin,
49509
+ onRevokeWidget: noop,
49510
+ onRevokeServer: noop,
49511
+ onGrantManually: noop
49512
+ })]
49513
+ }, f.widgetId);
49514
+ })]
49515
+ })]
49516
+ })]
49517
+ });
49518
+ };
49519
+
49303
49520
  var SECTIONS = [{
49304
49521
  key: "general",
49305
49522
  label: "General",