omnifocus_mcp 1.0.0 → 1.0.1
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/bin/omnifocus-mcp +10 -2
- data/lib/omnifocus_mcp/cli.rb +25 -0
- data/lib/omnifocus_mcp/json_rpc_compat.rb +8 -1
- data/lib/omnifocus_mcp/mcp.rb +4 -1
- data/lib/omnifocus_mcp/tools/presenters/query_results.rb +7 -7
- data/lib/omnifocus_mcp/version.rb +2 -1
- data/lib/omnifocus_mcp.rb +1 -0
- metadata +2 -3
- data/lib/omnifocus_mcp/infrastructure/.keep +0 -1
- data/lib/omnifocus_mcp/parsers/.keep +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e41a69180f0d9273204d7c1768eebccad3d62c0378608e2d5f8d7af2a1e0efc9
|
|
4
|
+
data.tar.gz: a1ead1aa0c0a8c7080c9701a89507d662ab58d76311445f1c53d90a0446578b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d07d104a5f1a0d49cef8668099f785fee962ec0cdcf6cf2a23a6899c3bddba4fb184d04cf45094aeb2500f5a32a4cf783ec751b79ca86e1888f1dcd76a99dea6
|
|
7
|
+
data.tar.gz: e99de7a835a14187683b719ac5b876684ebda26cb2f0334ac05c04d20ee5b7d2a404d0f7c9e589de8756d2c9b53803f8635eafb327f55f4d0615bf0048ae1dce
|
data/bin/omnifocus-mcp
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
+
# Keep in sync with OmnifocusMcp::VERSION_ARGS in lib/omnifocus_mcp/version.rb.
|
|
5
|
+
VERSION_ARGS = %w[--version -v version].freeze
|
|
6
|
+
|
|
7
|
+
if ARGV.intersect?(VERSION_ARGS)
|
|
8
|
+
require "omnifocus_mcp/version"
|
|
9
|
+
puts OmnifocusMcp::VERSION
|
|
10
|
+
exit 0
|
|
11
|
+
end
|
|
12
|
+
|
|
4
13
|
require "bundler/setup"
|
|
5
14
|
require "omnifocus_mcp"
|
|
6
|
-
|
|
7
|
-
OmnifocusMcp::Mcp.start
|
|
15
|
+
OmnifocusMcp::Cli.run
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OmnifocusMcp
|
|
4
|
+
# Command-line entry point for the `omnifocus-mcp` executable.
|
|
5
|
+
module Cli
|
|
6
|
+
module_function
|
|
7
|
+
|
|
8
|
+
def run(argv = ARGV)
|
|
9
|
+
if version_requested?(argv)
|
|
10
|
+
print_version
|
|
11
|
+
exit 0
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Mcp.start
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def version_requested?(argv)
|
|
18
|
+
argv.intersect?(OmnifocusMcp::VERSION_ARGS)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def print_version
|
|
22
|
+
puts VERSION
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -10,12 +10,17 @@ module OmnifocusMcp
|
|
|
10
10
|
module_function
|
|
11
11
|
|
|
12
12
|
def apply!
|
|
13
|
+
$stdin.set_encoding(Encoding::UTF_8) if $stdin.respond_to?(:set_encoding)
|
|
13
14
|
patch_server_send_error!
|
|
14
15
|
patch_stdio_transport!
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def normalize_id(id) = id.nil? ? UNKNOWN_REQUEST_ID : id
|
|
18
19
|
|
|
20
|
+
# MCP clients send UTF-8 JSON, but stdio may be US-ASCII-labelled (same as
|
|
21
|
+
# osascript stdout in ScriptRunner). Re-label before strip/parse.
|
|
22
|
+
def normalize_line(line) = line.to_s.dup.force_encoding(Encoding::UTF_8).strip
|
|
23
|
+
|
|
19
24
|
def patch_server_send_error!
|
|
20
25
|
return if server_send_error_patched?
|
|
21
26
|
|
|
@@ -29,6 +34,7 @@ module OmnifocusMcp
|
|
|
29
34
|
end
|
|
30
35
|
private_class_method :patch_server_send_error!
|
|
31
36
|
|
|
37
|
+
# rubocop:disable Metrics
|
|
32
38
|
def patch_stdio_transport!
|
|
33
39
|
return if stdio_transport_patched?
|
|
34
40
|
|
|
@@ -40,7 +46,7 @@ module OmnifocusMcp
|
|
|
40
46
|
@running = true
|
|
41
47
|
|
|
42
48
|
while @running && (line = $stdin.gets)
|
|
43
|
-
stripped = line
|
|
49
|
+
stripped = OmnifocusMcp::JsonRpcCompat.normalize_line(line)
|
|
44
50
|
next if stripped.empty?
|
|
45
51
|
|
|
46
52
|
begin
|
|
@@ -60,6 +66,7 @@ module OmnifocusMcp
|
|
|
60
66
|
end
|
|
61
67
|
end
|
|
62
68
|
end
|
|
69
|
+
# rubocop:enable Metrics
|
|
63
70
|
private_class_method :patch_stdio_transport!
|
|
64
71
|
|
|
65
72
|
def server_send_error_patched?
|
data/lib/omnifocus_mcp/mcp.rb
CHANGED
|
@@ -49,15 +49,15 @@ module OmnifocusMcp
|
|
|
49
49
|
parts << "has note: #{f["hasNote"]}" unless f["hasNote"].nil?
|
|
50
50
|
parts << "inbox: #{f["inbox"]}" unless f["inbox"].nil?
|
|
51
51
|
|
|
52
|
-
parts << format_on(label: "due", value: f["dueOn"])
|
|
53
|
-
parts << format_on(label: "defer", value: f["deferOn"])
|
|
54
|
-
parts << format_on(label: "planned", value: f["plannedOn"])
|
|
52
|
+
parts << format_on(label: "due", value: f["dueOn"]) if f["dueOn"]
|
|
53
|
+
parts << format_on(label: "defer", value: f["deferOn"]) if f["deferOn"]
|
|
54
|
+
parts << format_on(label: "planned", value: f["plannedOn"]) if f["plannedOn"]
|
|
55
55
|
|
|
56
|
-
parts << "added within #{f["addedWithin"]} days"
|
|
57
|
-
parts << "added on day #{f["addedOn"]}"
|
|
56
|
+
parts << "added within #{f["addedWithin"]} days" if f["addedWithin"]
|
|
57
|
+
parts << "added on day #{f["addedOn"]}" if f["addedOn"]
|
|
58
58
|
parts << "repeating: #{f["isRepeating"]}" unless f["isRepeating"].nil?
|
|
59
|
-
parts << "completed within #{f["completedWithin"]} days"
|
|
60
|
-
parts << "completed on day #{f["completedOn"]}"
|
|
59
|
+
parts << "completed within #{f["completedWithin"]} days" if f["completedWithin"]
|
|
60
|
+
parts << "completed on day #{f["completedOn"]}" if f["completedOn"]
|
|
61
61
|
|
|
62
62
|
parts.join(", ")
|
|
63
63
|
end
|
data/lib/omnifocus_mcp.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omnifocus_mcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henry Maddocks
|
|
@@ -40,9 +40,9 @@ files:
|
|
|
40
40
|
- Rakefile
|
|
41
41
|
- bin/omnifocus-mcp
|
|
42
42
|
- lib/omnifocus_mcp.rb
|
|
43
|
+
- lib/omnifocus_mcp/cli.rb
|
|
43
44
|
- lib/omnifocus_mcp/config.rb
|
|
44
45
|
- lib/omnifocus_mcp/infrastructure.rb
|
|
45
|
-
- lib/omnifocus_mcp/infrastructure/.keep
|
|
46
46
|
- lib/omnifocus_mcp/infrastructure/apple_script.rb
|
|
47
47
|
- lib/omnifocus_mcp/infrastructure/apple_script_date_builder.rb
|
|
48
48
|
- lib/omnifocus_mcp/infrastructure/js_embed.rb
|
|
@@ -51,7 +51,6 @@ files:
|
|
|
51
51
|
- lib/omnifocus_mcp/logger.rb
|
|
52
52
|
- lib/omnifocus_mcp/mcp.rb
|
|
53
53
|
- lib/omnifocus_mcp/parsers.rb
|
|
54
|
-
- lib/omnifocus_mcp/parsers/.keep
|
|
55
54
|
- lib/omnifocus_mcp/parsers/apple_script_envelope.rb
|
|
56
55
|
- lib/omnifocus_mcp/resources/base.rb
|
|
57
56
|
- lib/omnifocus_mcp/resources/flagged_resource.rb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|