active_mcp 0.10.4 → 0.10.5

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: 4e5f0c16d5def1392e446cb729d43ec33699f3162662657b13c60ee28b796d87
4
- data.tar.gz: 1fa830ca3cac342d8474aab4bf5ffdcd6b5d3c93d13e8818e0576135ae9d7dc1
3
+ metadata.gz: f7a6dec91d1f48ced13dc1699bf78b251961a4dfaf41b1c95531465c618c3ba2
4
+ data.tar.gz: e21b02b26027a3d87c44231f4cf7076febd82746e4a222fe1112a8b6b650ba12
5
5
  SHA512:
6
- metadata.gz: 985e527de84d6d16a879a3c4f54a202d95145e7a35edd78d3f692141370993278d298a62341be892f8f9a83b04bea7411607db0c98410112287544bb8e9d5abf
7
- data.tar.gz: c2bf6587bf7725f23f345ac21f43d113e7fb4eb8b9f2a20631f42492f06ceddac18351adc732a35ac7b655f051917bbad90ec15656c3d5d41be75bb5f711dd1d
6
+ metadata.gz: eace2e1b1abdfca71fe7884d654e8d698a07e0c1f175462db46a80f798e2b8a31d2561a8b3c95f558ed3d3f374ab3013f341d3eb3733e79d6f9650617ac05137
7
+ data.tar.gz: 231879557b7ec110bf2810e0ee66566cbd1bc791d695bff869b9ac197c67cfdba16e3aea1aa1fd5b2821517c99726f50d3698cdd27d499d76fa165584d7e6b72
data/README.md CHANGED
@@ -482,7 +482,7 @@ class UserResource < ActiveMcp::Resource::Base
482
482
  end
483
483
  end
484
484
 
485
- argument :id, complete: ->(value) do
485
+ argument :id, complete: ->(value, context) do
486
486
  User.all.pluck(:id).filter { _1.match(value) }
487
487
  end
488
488
 
@@ -528,7 +528,7 @@ Resources are Ruby classes `**Prompt`:
528
528
 
529
529
  ```ruby
530
530
  class HelloPrompt < ActiveMcp::Prompt::Base
531
- argument :name, required: true, description: "User name", complete: ->(value) do
531
+ argument :name, required: true, description: "User name", complete: ->(value, context) do
532
532
  User.all.pluck(:name).filter { _1.match(value) }
533
533
  end
534
534
 
@@ -8,11 +8,11 @@ module ActiveMcp
8
8
 
9
9
  if uri_template
10
10
  resource_class = refs.find { _1.uri_template == uri_template }
11
- values = resource_class.arguments[arg_name.to_sym].call(value)
11
+ values = resource_class.arguments[arg_name.to_sym].call(value, context)
12
12
  {values:, total: values.length}
13
13
  elsif ref_name
14
14
  prompt = refs.find { _1.prompt_name == ref_name }
15
- values = prompt.class.arguments.find { _1[:name] == arg_name.to_sym }[:complete].call(value)
15
+ values = prompt.class.arguments.find { _1[:name] == arg_name.to_sym }[:complete].call(value, context)
16
16
  {values:, total: values.length}
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveMcp
2
- VERSION = "0.10.4"
2
+ VERSION = "0.10.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami