@trops/dash-core 0.1.499 → 0.1.500

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
@@ -49211,6 +49211,40 @@ var EnforcementToggles = function EnforcementToggles() {
49211
49211
  }
49212
49212
  setPendingDisable(null);
49213
49213
  };
49214
+
49215
+ // One-click JIT trigger for testing. Calls the gate via a fake widget
49216
+ // identity that has no grant — the gate denies, JIT escalates, the
49217
+ // modal pops. After approval, the call proceeds to the (nonexistent)
49218
+ // "test-server" and errors with "server not connected"; that's the
49219
+ // expected response since the goal is to exercise the consent flow,
49220
+ // not the server's response.
49221
+ var triggerTestJitPrompt = /*#__PURE__*/function () {
49222
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
49223
+ var _window$mainApi3, _window$mainApi3$call;
49224
+ return _regeneratorRuntime.wrap(function (_context5) {
49225
+ while (1) switch (_context5.prev = _context5.next) {
49226
+ case 0:
49227
+ _context5.prev = 0;
49228
+ _context5.next = 1;
49229
+ return (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.mcp) === null || _window$mainApi3 === void 0 || (_window$mainApi3$call = _window$mainApi3.callTool) === null || _window$mainApi3$call === void 0 ? void 0 : _window$mainApi3$call.call(_window$mainApi3, "test-server", "test_tool", {
49230
+ path: "/tmp/jit-probe.txt"
49231
+ }, null, "@test/jit-probe");
49232
+ case 1:
49233
+ _context5.next = 3;
49234
+ break;
49235
+ case 2:
49236
+ _context5.prev = 2;
49237
+ _context5["catch"](0);
49238
+ case 3:
49239
+ case "end":
49240
+ return _context5.stop();
49241
+ }
49242
+ }, _callee5, null, [[0, 2]]);
49243
+ }));
49244
+ return function triggerTestJitPrompt() {
49245
+ return _ref6.apply(this, arguments);
49246
+ };
49247
+ }();
49214
49248
  return /*#__PURE__*/jsxs("div", {
49215
49249
  className: "flex flex-col space-y-4 border border-gray-700 rounded p-4",
49216
49250
  children: [/*#__PURE__*/jsxs("div", {
@@ -49250,6 +49284,25 @@ var EnforcementToggles = function EnforcementToggles() {
49250
49284
  return setPendingDisable(null);
49251
49285
  },
49252
49286
  onConfirm: confirmDisable
49287
+ }), enforceEnabled && jitEnabled && /*#__PURE__*/jsxs("div", {
49288
+ className: "flex flex-row items-center justify-between gap-4 border-t border-gray-800 pt-4",
49289
+ children: [/*#__PURE__*/jsxs("div", {
49290
+ className: "flex flex-col",
49291
+ children: [/*#__PURE__*/jsx("span", {
49292
+ className: "text-sm font-medium text-gray-200",
49293
+ children: "Test JIT consent prompt"
49294
+ }), /*#__PURE__*/jsxs("span", {
49295
+ className: "text-xs text-gray-400 mt-1",
49296
+ children: ["Fires a fake tool call from ", /*#__PURE__*/jsx("code", {
49297
+ children: "@test/jit-probe"
49298
+ }), " to", " ", /*#__PURE__*/jsx("code", {
49299
+ children: "test-server"
49300
+ }), ". The gate runs first (no real server needed), so you'll see the JIT modal exactly as it appears in production. Approve and the call proceeds \u2014 the fake server isn't running, so a \"server not connected\" error follows in the console. That's the expected response; the goal is to validate the consent flow."]
49301
+ })]
49302
+ }), /*#__PURE__*/jsx(Button, {
49303
+ title: "Test prompt",
49304
+ onClick: triggerTestJitPrompt
49305
+ })]
49253
49306
  })]
49254
49307
  });
49255
49308
  };
@@ -49276,10 +49329,10 @@ var DISABLE_COPY = {
49276
49329
  * nesting entirely; the user keeps context and the warning is
49277
49330
  * impossible to miss right where the toggle lives.
49278
49331
  */
49279
- var ConfirmDisableInline = function ConfirmDisableInline(_ref6) {
49280
- var pending = _ref6.pending,
49281
- onCancel = _ref6.onCancel,
49282
- onConfirm = _ref6.onConfirm;
49332
+ var ConfirmDisableInline = function ConfirmDisableInline(_ref7) {
49333
+ var pending = _ref7.pending,
49334
+ onCancel = _ref7.onCancel,
49335
+ onConfirm = _ref7.onConfirm;
49283
49336
  if (!pending) return null;
49284
49337
  var copy = DISABLE_COPY[pending.flag];
49285
49338
  if (!copy) return null;
@@ -49309,15 +49362,15 @@ var ConfirmDisableInline = function ConfirmDisableInline(_ref6) {
49309
49362
  })]
49310
49363
  });
49311
49364
  };
49312
- var WidgetGrantRow = function WidgetGrantRow(_ref7) {
49313
- var widgetId = _ref7.widgetId,
49314
- declared = _ref7.declared,
49315
- granted = _ref7.granted,
49316
- hasManifest = _ref7.hasManifest,
49317
- grantOrigin = _ref7.grantOrigin,
49318
- onRevokeWidget = _ref7.onRevokeWidget,
49319
- onRevokeServer = _ref7.onRevokeServer,
49320
- onGrantManually = _ref7.onGrantManually;
49365
+ var WidgetGrantRow = function WidgetGrantRow(_ref8) {
49366
+ var widgetId = _ref8.widgetId,
49367
+ declared = _ref8.declared,
49368
+ granted = _ref8.granted,
49369
+ hasManifest = _ref8.hasManifest,
49370
+ grantOrigin = _ref8.grantOrigin,
49371
+ onRevokeWidget = _ref8.onRevokeWidget,
49372
+ onRevokeServer = _ref8.onRevokeServer,
49373
+ onGrantManually = _ref8.onGrantManually;
49321
49374
  var declaredServers = declared && declared.servers || {};
49322
49375
  var grantedServers = granted && granted.servers || {};
49323
49376
  var allServerNames = Array.from(new Set([].concat(_toConsumableArray(Object.keys(declaredServers)), _toConsumableArray(Object.keys(grantedServers)))));
@@ -49389,10 +49442,10 @@ var WidgetGrantRow = function WidgetGrantRow(_ref7) {
49389
49442
  })]
49390
49443
  });
49391
49444
  };
49392
- var PermsList = function PermsList(_ref8) {
49393
- var label = _ref8.label,
49394
- declaredItems = _ref8.declaredItems,
49395
- grantedItems = _ref8.grantedItems;
49445
+ var PermsList = function PermsList(_ref9) {
49446
+ var label = _ref9.label,
49447
+ declaredItems = _ref9.declaredItems,
49448
+ grantedItems = _ref9.grantedItems;
49396
49449
  if (declaredItems.length === 0 && grantedItems.length === 0) return null;
49397
49450
  var grantedSet = new Set(grantedItems);
49398
49451
  var declaredSet = new Set(declaredItems);
@@ -49448,8 +49501,8 @@ function isServerEntirelyStale(decl, grant) {
49448
49501
  * the user audit grants that were approved against a scanner guess
49449
49502
  * rather than the developer's explicit declaration.
49450
49503
  */
49451
- var GrantOriginBadge = function GrantOriginBadge(_ref9) {
49452
- var origin = _ref9.origin;
49504
+ var GrantOriginBadge = function GrantOriginBadge(_ref0) {
49505
+ var origin = _ref0.origin;
49453
49506
  var styles = {
49454
49507
  declared: {
49455
49508
  label: "declared",