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