stack-service-base 0.0.58 → 0.0.60
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 +4 -4
- data/lib/stack-service-base/mcp_processor.rb +28 -4
- data/lib/stack-service-base/project_template/gitlab-c/docker/Dockerfile.build +1 -1
- data/lib/stack-service-base/rack_helpers.rb +1 -0
- data/lib/stack-service-base/stack_template/home/stack/stack.drs +1 -1
- data/lib/stack-service-base/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a484a4b111bb64584904cfa41d26ac06d59aca66f203b740d5ae8ea8496b0597
|
|
4
|
+
data.tar.gz: b3d6034376d7112be1dfc68e39f119d60b1609ca92d6f7ebde8ddcc66143a812
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2aa379daf4976849e6475d6169bc0d91a1885acde8b9deb1359f842f10ba50925bb0f7bb34c99d59e26a3b08c29280b609e186122b644d5829941e0b73bac18f
|
|
7
|
+
data.tar.gz: 6a98356cd43a5a14f96bb6ab713cb6517dfcdb8191424795af4b37559e4b2879164ff91ae09d0fbebe1233a74f0e6b12e269444cfa3af6edd0f793cd5a8b07c6
|
|
@@ -14,6 +14,8 @@ module RpcErrorHelpers
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
class McpProcessor
|
|
17
|
+
PROTOCOL_VERSION = '2025-06-18'
|
|
18
|
+
|
|
17
19
|
include RpcErrorHelpers
|
|
18
20
|
ParseError = Class.new(StandardError) do
|
|
19
21
|
attr_reader :body, :status
|
|
@@ -54,18 +56,40 @@ class McpProcessor
|
|
|
54
56
|
end
|
|
55
57
|
|
|
56
58
|
def rpc_response(id:, method:, params:)
|
|
57
|
-
json_rpc_response(id: id) { handle(method: method, params: params) }
|
|
59
|
+
json_rpc_response(id: id) { |body| handle(method: method, params: params, body: body) }
|
|
58
60
|
end
|
|
59
61
|
|
|
60
|
-
def handle(method:, params:)
|
|
62
|
+
def handle(method:, params:, body: )
|
|
61
63
|
case method
|
|
62
|
-
when "tools/list"
|
|
63
|
-
when "tools/call"
|
|
64
|
+
when "tools/list" then list_tools
|
|
65
|
+
when "tools/call" then call_tool(params || {})
|
|
66
|
+
when "initialize" then initialize_(body)
|
|
67
|
+
when "initialized" then {}
|
|
64
68
|
else
|
|
65
69
|
rpc_error!(-32601, "Unknown method #{method}")
|
|
66
70
|
end
|
|
67
71
|
end
|
|
68
72
|
|
|
73
|
+
# https://gist.github.com/ruvnet/7b6843c457822cbcf42fc4aa635eadbb
|
|
74
|
+
|
|
75
|
+
def initialize_(body)
|
|
76
|
+
body[:serverInfo] = {
|
|
77
|
+
name: 'mcp-server',
|
|
78
|
+
title: 'MCP Server',
|
|
79
|
+
version: '1.0.0'
|
|
80
|
+
}
|
|
81
|
+
# result
|
|
82
|
+
{
|
|
83
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
84
|
+
capabilities: {
|
|
85
|
+
logging: {},
|
|
86
|
+
prompts: { listChanged: false },
|
|
87
|
+
resources: { listChanged: false },
|
|
88
|
+
tools: { listChanged: false }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
69
93
|
private
|
|
70
94
|
|
|
71
95
|
def json_rpc_response(id:)
|
|
@@ -8,7 +8,7 @@ COPY . .
|
|
|
8
8
|
|
|
9
9
|
CMD ["bash", "-c", "-x", "\
|
|
10
10
|
env && cd /build/docker && \
|
|
11
|
-
build-labels -n -c docker-compose.yml gitlab set_version to_dockerfiles to_compose | tee bake.yml && \
|
|
11
|
+
build-labels -n -c docker-compose.yml changed gitlab set_version to_dockerfiles to_compose | tee bake.yml && \
|
|
12
12
|
export OTEL_RESOURCE_ATTRIBUTES=service.name=docker-builder,pipeline.id=${CI_PIPELINE_ID},project.name=${CI_PROJECT_NAME} && \
|
|
13
13
|
export REGISTRY_HOST=$CI_REGISTRY_HOST && \
|
|
14
14
|
grep \"services: {}\" bake.yml || docker buildx bake -f bake.yml $([ -z \"$CI_SKIP_PUSH\" ] && echo \"--push\") && \
|
|
@@ -117,6 +117,7 @@ module RackHelpers
|
|
|
117
117
|
# end
|
|
118
118
|
|
|
119
119
|
Rack.define_middleware :HeadersLogger do |env, app, opts|
|
|
120
|
+
LOGGER.info env.select { %w'REQUEST_METHOD REQUEST_PATH REQUEST_URI QUERY_STRING'.include? _1 }
|
|
120
121
|
LOGGER.info env.select { _1 =~ /HTTP/ }.transform_keys { _1.gsub 'HTTP_', '' }
|
|
121
122
|
status, headers, body =app.call env
|
|
122
123
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Options name: 'stack-name'
|
|
2
2
|
|
|
3
|
-
Service :service_name, image: 'service_name/master', ports:
|
|
3
|
+
Service :service_name, image: 'service_name/master', ports: 7000, ingress: { host: 'service_name.*' }
|
|
4
4
|
|
|
5
5
|
raise 'Configure the stack (https://github.com/artyomb/dry-stack)'
|