worldmonitor 0.1.1 → 0.1.2

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: 21a8e9381b9f05721cdeb381abcac0488239cf95c2bbb72dbdc8bef6a4d911b9
4
- data.tar.gz: b5918147776ca7a3131b1a96b5789ebe8ecf859ab1f401097b1ac148c4f72c46
3
+ metadata.gz: 7f18135a89a4477f6dbc945d3b8f5616ac884dd324b2ea033defbbfb775e5d06
4
+ data.tar.gz: 919f2ebbc2e35c6bd4c82365838c5dc777835600a550b0e6f4ed5d6bd18dd9c4
5
5
  SHA512:
6
- metadata.gz: 8e9573e0560b790b2613f4c90d2b82938cac85ffd7928aa494c444050a4489661cb8e4b9f1642976dfb2d61cf3dcb1c96539c0bc8bc7aa6846b8ff07a3356071
7
- data.tar.gz: bfb272552adccba08db1ab7e508bf4adcb8cde989ba73c9544aec11298beb89b7add68cbbac523e3713e3d7341500ae154a5f2275bf3a1131c679eb63e3af798
6
+ metadata.gz: dcec69f1fab5be413340256a1223b4c537f3030c590e2509ec14a6ed4881263fa0659e80aaf4f794b104ceec7d920c969c9a6fde76f4d9d64b07d5469d1cd0ec
7
+ data.tar.gz: '0148a5cfb62dda40d0a680b6c27dad08a29c49b1428ef192860973006d276ef032d1dfe84644f909d3dc79ee9f035d4fecf8164e38d95694c7f681489a1555a9'
data/README.md CHANGED
@@ -24,7 +24,7 @@ client.call_tool("get_market_data", asset_class: "crypto") # any MCP tool
24
24
  client.get("/api/health") # raw REST GET
25
25
  ```
26
26
 
27
- Data calls (`tools/call`) need a user API key — get one at [worldmonitor.app/pro](https://www.worldmonitor.app/pro). Listing tools, prompts, and resources is public.
27
+ `get_sources` is the sole credential-free, daily-quota-free data tool; anonymous calls use a separate fail-closed 10/minute/IP ceiling. Every other data-bearing `tools/call` needs a subscription API key — get one at [worldmonitor.app/pro](https://www.worldmonitor.app/pro). Listing tools, prompts, and resources is public.
28
28
 
29
29
  ## Server-side projection
30
30
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorldMonitor
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/worldmonitor.rb CHANGED
@@ -5,10 +5,12 @@
5
5
  # Stdlib-only (Net::HTTP), MCP-first — the same design as the `worldmonitor`
6
6
  # npm CLI this mirrors (`cli/` in the main repository). The MCP server
7
7
  # (https://worldmonitor.app/mcp) is the live, documented agent surface:
8
- # `tools/list` is public, and `tools/call` (used by the curated helpers)
9
- # authenticates with a user API key. A small REST escape hatch
10
- # (`get`/`health`) rounds it out for host-relative and self-hosted use.
8
+ # `tools/list` is public. `get_sources` is the only data tool that can be
9
+ # called without a key; the other `tools/call` operations authenticate with a
10
+ # user API key. A small REST escape hatch (`get`/`health`) rounds it out for
11
+ # host-relative and self-hosted use.
11
12
  #
13
+ # WorldMonitor::Client.new(env: {}).call_tool("get_sources", view: "summary")
12
14
  # client = WorldMonitor::Client.new(api_key: "wm_...")
13
15
  # client.country_risk("IR")
14
16
  # client.call_tool("get_market_data", asset_class: "crypto")
@@ -83,7 +85,10 @@ module WorldMonitor
83
85
  def initialize(api_key: nil, base_url: nil, mcp_url: nil,
84
86
  timeout: DEFAULT_TIMEOUT, transport: nil, env: ENV)
85
87
  @api_key = api_key || env["WORLDMONITOR_API_KEY"] || env["WM_API_KEY"]
86
- @base_url = (base_url || env["WORLDMONITOR_BASE_URL"] || DEFAULT_BASE_URL).sub(%r{/+\z}, "")
88
+ @base_url = base_url || env["WORLDMONITOR_BASE_URL"] || DEFAULT_BASE_URL
89
+ end_index = @base_url.bytesize
90
+ end_index -= 1 while end_index.positive? && @base_url.getbyte(end_index - 1) == 47
91
+ @base_url = @base_url.byteslice(0, end_index)
87
92
  @mcp_url = mcp_url || env["WORLDMONITOR_MCP_URL"] || DEFAULT_MCP_URL
88
93
  @timeout = timeout
89
94
  @transport = transport || method(:http_transport)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worldmonitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - World Monitor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-05 00:00:00.000000000 Z
11
+ date: 2026-10-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Country briefs, risk scores, conflict/cyber/market/news feeds, and MCP
14
14
  tools from the World Monitor global-intelligence API without writing an HTTP integration.