hub_kernel-mcp 0.8.1 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8be7b91fc6f1b95d55f4871c4cf2dae03c8f72190cee92e273e92db032d79598
4
- data.tar.gz: c91d179ce33133ecde7db361d391f6660776bfeb4f337ad74b46f5b2cacf4cdd
3
+ metadata.gz: e8534b1719040ee0fe7abd7dbf92ab23f559c488830a708197ee1b2180c10ef8
4
+ data.tar.gz: c9786d5f6a3f119b0764d13f89388c0f79af29c61a61a5474ccb0c416e787be5
5
5
  SHA512:
6
- metadata.gz: 01ac0ebea68d3a158c35f13881fe955829f09945400ce9dea2005610e0a9a4b5984ae5c026784aac8dce8315e4b52829aa992a0394cff182d5cdc4e9b473b35c
7
- data.tar.gz: c57338ec7927c22bd802c7faf5a0a3e5909e11653271a8965202f1d7a80c65323f22fcd6fdf13ab9555f9b3a0da07a508ccc27087d29e1286f4b3dadc9d14e68
6
+ metadata.gz: cf5665cfff0c4fa70f333d33da2f44d0bf1ad4ea61d36963c072c0c1111092b6b49ad81c6602d397bb5554dc1870acf7077afe64c3ea5514e8f564fa1f23a318
7
+ data.tar.gz: 679fde439d3736ba3ad2237dd50588cef2ca1c5692758791461b639bab6273fc133266f18492d96d30dedfd38ec5edbd8f85af496cd070493affea4dab342be9
@@ -0,0 +1,7 @@
1
+ module HubKernel
2
+ module Mcp
3
+ class ApplicationController < HubKernel::Mcp.browser_controller.constantize
4
+ helper KeystoneUiHelper
5
+ end
6
+ end
7
+ end
@@ -2,7 +2,7 @@ require "uri"
2
2
 
3
3
  module HubKernel
4
4
  module Mcp
5
- class AuthorizationsController < HubKernel::Mcp.browser_controller.constantize
5
+ class AuthorizationsController < ApplicationController
6
6
  APPROVAL_PARAMS = %i[response_type client_id redirect_uri state code_challenge code_challenge_method].freeze
7
7
 
8
8
  layout -> { HubKernel::Mcp.browser_layout }
@@ -1,10 +1,15 @@
1
1
  <ul>
2
2
  <% HubKernel::Mcp::Connection.of(person).includes(:client).order(:created_at).each do |connection| %>
3
3
  <li>
4
- <strong><%= connection.client.name %></strong>
5
- <span>Connected <%= l(connection.created_at, format: :long) %></span>
6
- <span><%= connection.last_used_at ? "Last used #{l(connection.last_used_at, format: :long)}" : "Never used" %></span>
7
- <%= button_to "Disconnect", submit_url, method: :patch, params: { connection_id: connection.id } %>
4
+ <%= ui_section(title: connection.client.name, subtitle: "Connected #{l(connection.created_at, format: :long)}") do %>
5
+ <%= ui_panel do %>
6
+ <span><%= connection.last_used_at ? "Last used #{l(connection.last_used_at, format: :long)}" : "Never used" %></span>
7
+ <%= ui_form(action: submit_url, method: :patch) do %>
8
+ <%= hidden_field_tag :connection_id, connection.id %>
9
+ <%= ui_button(label: "Disconnect", variant: :danger) %>
10
+ <% end %>
11
+ <% end %>
12
+ <% end %>
8
13
  </li>
9
14
  <% end %>
10
15
  </ul>
@@ -1,9 +1,17 @@
1
- <h1><%= @client.name %> wants to connect as you</h1>
1
+ <%= ui_page_header(title: "#{@client.name} wants to connect as you") %>
2
2
 
3
- <%= form_with url: request.path, method: :post, data: { turbo: false } do |form| %>
3
+ <%= ui_form(action: request.path, data: { turbo: false }) do %>
4
4
  <% approval_params.each do |name, value| %>
5
5
  <%= hidden_field_tag name, value %>
6
6
  <% end %>
7
- <%= form.button "Approve", name: "decision", value: "approve" %>
8
- <%= form.button "Deny", name: "decision", value: "deny" %>
7
+ <%= hidden_field_tag :decision, "approve" %>
8
+ <%= ui_button(label: "Approve") %>
9
+ <% end %>
10
+
11
+ <%= ui_form(action: request.path, data: { turbo: false }) do %>
12
+ <% approval_params.each do |name, value| %>
13
+ <%= hidden_field_tag name, value %>
14
+ <% end %>
15
+ <%= hidden_field_tag :decision, "deny" %>
16
+ <%= ui_button(label: "Deny", variant: :secondary) %>
9
17
  <% end %>
@@ -1 +1,3 @@
1
- <h1><%= @reason %></h1>
1
+ <%= ui_page_header(title: "Can't connect") %>
2
+
3
+ <%= ui_alert(message: @reason, type: :error) %>
@@ -1,3 +1,4 @@
1
+ require "keystone_ui"
1
2
  require "hub_kernel/mcp/challenge"
2
3
 
3
4
  module HubKernel
@@ -6,6 +7,10 @@ module HubKernel
6
7
  isolate_namespace HubKernel::Mcp
7
8
 
8
9
  middleware.use HubKernel::Mcp::Challenge
10
+
11
+ initializer "hub_kernel.mcp.tailwind" do
12
+ KeystoneUi.configuration.tailwind_sources << root.join("app/views/**/*.erb").to_s
13
+ end
9
14
  end
10
15
  end
11
16
  end
@@ -1,5 +1,5 @@
1
1
  module HubKernel
2
2
  module Mcp
3
- VERSION = "0.8.1"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_kernel-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0.6'
40
+ - !ruby/object:Gem::Dependency
41
+ name: keystone_ui
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.11.0
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.11.0
40
54
  description: hub_kernel-mcp serves the methods every hub a host serves exposes as
41
55
  MCP tools at one address, with every call going through the host's sign-in, permission
42
56
  check and account scope.
@@ -49,6 +63,7 @@ files:
49
63
  - MIT-LICENSE
50
64
  - README.md
51
65
  - Rakefile
66
+ - app/controllers/hub_kernel/mcp/application_controller.rb
52
67
  - app/controllers/hub_kernel/mcp/authorizations_controller.rb
53
68
  - app/controllers/hub_kernel/mcp/discovery_controller.rb
54
69
  - app/controllers/hub_kernel/mcp/messages_controller.rb