mcptask-rails-runner 0.2.4

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 90fb6326f0a5b5ffde6055867b4709a7574acb7f1e8cc3facc9b00c37d60518e
4
+ data.tar.gz: 30dd43c20ec169dadcb0729e63e6c074c84180a2649983478bb9c56a57b630fc
5
+ SHA512:
6
+ metadata.gz: f2b2a21772d92034835ba3c75483f51312bda2ea235cc407fca2de43a44f4e5dca62f72f3cb4da04e6d50f0c22fa8bf258b02b3bfd0268378e9b984f8197c51c
7
+ data.tar.gz: 901f117d861d84118d85e0a1684573858aa826f10a969df45130656b480452022618297f70fd35103e76d88f880525a4a787b0dabde04e7504ee1b0dd3d0fcd6
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ The version number tracks the `mcptask_runner` binary the gem ships, so the
4
+ entries below describe wrapper changes only. Binary changes are listed in the
5
+ [mcptask-releases](https://github.com/jchsoft/mcptask-releases/releases)
6
+ release notes for the same tag.
7
+
8
+ ## 0.2.4
9
+
10
+ - First release. Thin Rails wrapper around the `mcptask_runner` Go binary,
11
+ with the rake surface of the legacy `mcptask_runner` gem kept unchanged so
12
+ migrating is a one-line Gemfile edit.
13
+ - Platform gems for `arm64-darwin`, `x86_64-darwin`, `arm64-linux`,
14
+ `x86_64-linux` and `x64-mingw-ucrt`; the `ruby` fallback gem explains how to
15
+ supply a binary through `MCPTASK_RUNNER_BIN`.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JchSoft s.r.o.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # mcptask-rails-runner
2
+
3
+ Rails distribution of the [mcptask.online](https://mcptask.online) autonomous
4
+ runner. A thin Ruby wrapper around the `mcptask_runner` Go binary: the gem
5
+ ships the platform-specific binary inside itself (`libexec/`) and exposes the
6
+ same rake tasks as the legacy `mcptask_runner` gem, delegating 1:1 to the CLI.
7
+
8
+ One gem version carries exactly one binary version — `mcptask-rails-runner
9
+ X.Y.Z` contains the binary from the `vX.Y.Z` release of
10
+ [jchsoft/mcptask-releases](https://github.com/jchsoft/mcptask-releases).
11
+
12
+ ## Requirements
13
+
14
+ - Ruby >= 3.0, Rails >= 6.0
15
+ - [Claude Code](https://claude.com/claude-code) CLI
16
+ - An mcptask.online account
17
+
18
+ ## Installation
19
+
20
+ ```ruby
21
+ # Gemfile
22
+ gem "mcptask-rails-runner"
23
+ ```
24
+
25
+ ```bash
26
+ bundle install
27
+ bundle exec rake mcptask_runner:install
28
+ ```
29
+
30
+ ## Migrating from the legacy mcptask_runner gem
31
+
32
+ The rake surface is identical — the migration is one Gemfile line:
33
+
34
+ ```diff
35
+ - gem "mcptask_runner", git: "git@github.com:jchsoft/mcptask_runner.git"
36
+ + gem "mcptask-rails-runner"
37
+ ```
38
+
39
+ Then `bundle install` and carry on; every `rake mcptask_runner:*` invocation,
40
+ LaunchAgent and shell alias keeps working. Your existing
41
+ `config/mcptask_runner.yml`, `.mcp.json` and `.claude/` setup are read by the
42
+ Go binary as-is. The only legacy task without a counterpart is
43
+ `mcptask_runner:prepare:permissions` — permission sync is part of
44
+ `mcptask_runner:install` now.
45
+
46
+ ## Tasks
47
+
48
+ | Task | Delegates to |
49
+ |---|---|
50
+ | `mcptask_runner:install` | `mcptask_runner init` |
51
+ | `mcptask_runner:update` | `mcptask_runner update` |
52
+ | `mcptask_runner:bug_report` | `mcptask_runner bug-report` |
53
+ | `mcptask_runner:version` | `mcptask_runner version` |
54
+ | `mcptask_runner:manual:once` (`once_dry`, `today`, `daily`, `review`, `reviews`, `workflow`, `queue`) | `mcptask_runner run <mode>` |
55
+ | `mcptask_runner:manual:story[123]` / `manual:task[123]` | `run story_manual --story-id 123` / `run task_manual --task-id 123` |
56
+ | `mcptask_runner:auto:once` | `run once_auto_squash` |
57
+ | `mcptask_runner:auto:squash:today` (`queue`, `story[123]`, `task[123]`) | `run <mode>_auto_squash` |
58
+
59
+ `verbose=true` and `ignore_quota=true` environment variables are honored by
60
+ the binary itself, exactly as before.
61
+
62
+ ## Supported platforms
63
+
64
+ Platform gems exist for `arm64-darwin`, `x86_64-darwin`, `arm64-linux`,
65
+ `x86_64-linux` and `x64-mingw-ucrt`. On anything else bundler falls back to
66
+ the binary-less `ruby` platform gem, which fails at run time with
67
+ instructions: install the binary from
68
+ [mcptask-releases](https://github.com/jchsoft/mcptask-releases) (or via
69
+ `install.sh` / npm `@mcptask/cli`) and point `MCPTASK_RUNNER_BIN` at it. The
70
+ same variable also serves offline or air-gapped installs.
71
+
72
+ The wrapper always executes the binary through an absolute path inside the
73
+ gem, never through PATH — the binary shares its name with the legacy tooling,
74
+ and a PATH lookup could pick up the wrong install.
75
+
76
+ ## Development
77
+
78
+ ```bash
79
+ bundle install
80
+ bundle exec rake test # unit tests (binary resolution + task mapping)
81
+ bin/fetch-binaries # stage release binaries into tmp/binaries/
82
+ bundle exec rake package:all # build all platform gems into pkg/
83
+ ```
84
+
85
+ ## Releasing
86
+
87
+ Releases are cut by tagging: bump `lib/mcptask_rails_runner/version.rb` to
88
+ match an existing `mcptask-releases` tag, push a matching `vX.Y.Z` tag, and
89
+ the Release workflow downloads the binaries (sha256-verified), builds the
90
+ platform gems and publishes them to rubygems.org through OIDC trusted
91
+ publishing. See `.github/workflows/release.yml`.
92
+
93
+ One-time setup on rubygems.org, before the first tag can publish anything —
94
+ the gem name has to exist as a trusted-publisher entry:
95
+
96
+ 1. Sign in on rubygems.org, open **Profile → Trusted publishers → Create**.
97
+ 2. For a gem that has never been pushed, use **Create a pending trusted
98
+ publisher** with gem name `mcptask-rails-runner`; for an existing gem, add
99
+ the publisher on the gem's own page.
100
+ 3. Repository owner `jchsoft`, repository name `mcptask-rails-runner`,
101
+ workflow filename `release.yml`, environment empty.
102
+
103
+ No API key is stored anywhere: `rubygems/configure-rubygems-credentials`
104
+ exchanges the workflow's OIDC token for a short-lived credential at push time.
105
+ The same model as the npm publish in the Go repository.
106
+
107
+ ## License
108
+
109
+ MIT
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Bundler's default require for a gem named mcptask-rails-runner.
4
+ require "mcptask_rails_runner"
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module McptaskRailsRunner
4
+ # Locates and executes the bundled Go binary.
5
+ module Binary
6
+ GEM_ROOT = File.expand_path("../..", __dir__)
7
+
8
+ SUPPORTED_PLATFORMS = %w[
9
+ arm64-darwin
10
+ x86_64-darwin
11
+ arm64-linux
12
+ x86_64-linux
13
+ x64-mingw-ucrt
14
+ ].freeze
15
+
16
+ module_function
17
+
18
+ def executable_name
19
+ Gem.win_platform? ? "mcptask_runner.exe" : "mcptask_runner"
20
+ end
21
+
22
+ # Absolute path to the bundled binary. Never resolved through PATH: the
23
+ # binary shares the mcptask_runner name with the legacy gem's rake
24
+ # namespace, and a PATH lookup could pick up a stale or wrong install.
25
+ def path(gem_root: GEM_ROOT)
26
+ override = ENV["MCPTASK_RUNNER_BIN"]
27
+ return override unless override.nil? || override.empty?
28
+
29
+ exe = File.join(gem_root, "libexec", executable_name)
30
+ return exe if File.file?(exe)
31
+
32
+ raise Error, <<~MSG
33
+ mcptask_runner binary not found at #{exe}.
34
+
35
+ The platform gem for #{Gem::Platform.local} was probably not installed.
36
+ Supported platforms: #{SUPPORTED_PLATFORMS.join(', ')}.
37
+
38
+ On a supported platform, re-run `bundle install` (and make sure the
39
+ platform is in Gemfile.lock: `bundle lock --add-platform #{Gem::Platform.local}`).
40
+ On an unsupported platform, install the binary from
41
+ https://github.com/jchsoft/mcptask-releases and point the
42
+ MCPTASK_RUNNER_BIN environment variable at it.
43
+ MSG
44
+ end
45
+
46
+ # Replaces the current process, so the binary's exit code and signal
47
+ # handling reach the caller (rake) unchanged.
48
+ def exec!(*args)
49
+ Kernel.exec(path, *args)
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/railtie"
4
+
5
+ module McptaskRailsRunner
6
+ class Railtie < ::Rails::Railtie
7
+ rake_tasks do
8
+ load File.expand_path("../tasks/mcptask_runner.rake", __dir__)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module McptaskRailsRunner
4
+ # The gem version is pinned 1:1 to the mcptask_runner binary release it
5
+ # carries (tag v#{VERSION} in jchsoft/mcptask-releases). Bump both together.
6
+ VERSION = "0.2.4"
7
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "mcptask_rails_runner/version"
4
+
5
+ module McptaskRailsRunner
6
+ class Error < StandardError; end
7
+
8
+ # Validates a rake bracket argument such as manual:story[123].
9
+ def self.piece_id!(value, name, example)
10
+ id = Integer(value, exception: false)
11
+ raise ArgumentError, "#{name} is required and must be a positive integer (usage: rake '#{example}')" if id.nil? || id < 1
12
+
13
+ id.to_s
14
+ end
15
+ end
16
+
17
+ require_relative "mcptask_rails_runner/binary"
18
+
19
+ # Only inside a booted Rails app — rails/railtie needs active_support loaded,
20
+ # and outside Rails there is nothing to hook the rake tasks into.
21
+ require_relative "mcptask_rails_runner/railtie" if defined?(::Rails::Railtie)
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Rake surface kept identical to the legacy mcptask_runner gem, so migrating
4
+ # a customer is only a Gemfile line swap. Every task delegates 1:1 to the
5
+ # bundled Go CLI via Kernel#exec — the binary's exit code and signal handling
6
+ # reach the caller unchanged, and nothing runs after the delegation line.
7
+
8
+ require "mcptask_rails_runner"
9
+
10
+ namespace :mcptask_runner do
11
+ desc "Install skills, permissions, token and scheduled job into this project"
12
+ task :install do
13
+ McptaskRailsRunner::Binary.exec!("init")
14
+ end
15
+
16
+ desc "Refresh bundled skills and helpers"
17
+ task :update do
18
+ McptaskRailsRunner::Binary.exec!("update")
19
+ end
20
+
21
+ desc "File a bug against the project with the last run log attached"
22
+ task :bug_report do
23
+ McptaskRailsRunner::Binary.exec!("bug-report")
24
+ end
25
+
26
+ desc "Print runner version and resolved configuration"
27
+ task :version do
28
+ McptaskRailsRunner::Binary.exec!("version")
29
+ end
30
+
31
+ namespace :manual do
32
+ {
33
+ once: "once",
34
+ once_dry: "once_dry",
35
+ today: "today",
36
+ daily: "daily",
37
+ review: "review",
38
+ reviews: "reviews",
39
+ workflow: "workflow",
40
+ queue: "queue_manual"
41
+ }.each do |task_name, mode|
42
+ desc "Run the work loop in #{mode} mode"
43
+ task task_name do
44
+ McptaskRailsRunner::Binary.exec!("run", mode)
45
+ end
46
+ end
47
+
48
+ desc "Work a single story in manual mode"
49
+ task :story, [:story_id] do |_t, args|
50
+ id = McptaskRailsRunner.piece_id!(args[:story_id], "story_id", "mcptask_runner:manual:story[123]")
51
+ McptaskRailsRunner::Binary.exec!("run", "story_manual", "--story-id", id)
52
+ end
53
+
54
+ desc "Work a single task in manual mode"
55
+ task :task, [:task_id] do |_t, args|
56
+ id = McptaskRailsRunner.piece_id!(args[:task_id], "task_id", "mcptask_runner:manual:task[123]")
57
+ McptaskRailsRunner::Binary.exec!("run", "task_manual", "--task-id", id)
58
+ end
59
+ end
60
+
61
+ namespace :auto do
62
+ desc "Run the work loop in once_auto_squash mode"
63
+ task :once do
64
+ McptaskRailsRunner::Binary.exec!("run", "once_auto_squash")
65
+ end
66
+
67
+ namespace :squash do
68
+ desc "Run the work loop in today_auto_squash mode"
69
+ task :today do
70
+ McptaskRailsRunner::Binary.exec!("run", "today_auto_squash")
71
+ end
72
+
73
+ desc "Run the work loop in queue_auto_squash mode"
74
+ task :queue do
75
+ McptaskRailsRunner::Binary.exec!("run", "queue_auto_squash")
76
+ end
77
+
78
+ desc "Work a single story in auto-squash mode"
79
+ task :story, [:story_id] do |_t, args|
80
+ id = McptaskRailsRunner.piece_id!(args[:story_id], "story_id", "mcptask_runner:auto:squash:story[123]")
81
+ McptaskRailsRunner::Binary.exec!("run", "story_auto_squash", "--story-id", id)
82
+ end
83
+
84
+ desc "Work a single task in auto-squash mode"
85
+ task :task, [:task_id] do |_t, args|
86
+ id = McptaskRailsRunner.piece_id!(args[:task_id], "task_id", "mcptask_runner:auto:squash:task[123]")
87
+ McptaskRailsRunner::Binary.exec!("run", "task_auto_squash", "--task-id", id)
88
+ end
89
+ end
90
+ end
91
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mcptask-rails-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.4
5
+ platform: ruby
6
+ authors:
7
+ - Josef Chmel
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: railties
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '6.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '6.0'
26
+ description: Thin Rails wrapper around the mcptask_runner Go binary. Ships the platform-specific
27
+ binary inside the gem and exposes the same rake tasks as the legacy mcptask_runner
28
+ gem, delegating 1:1 to the CLI.
29
+ email:
30
+ - info@jchsoft.cz
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - CHANGELOG.md
36
+ - LICENSE
37
+ - README.md
38
+ - lib/mcptask/rails/runner.rb
39
+ - lib/mcptask_rails_runner.rb
40
+ - lib/mcptask_rails_runner/binary.rb
41
+ - lib/mcptask_rails_runner/railtie.rb
42
+ - lib/mcptask_rails_runner/version.rb
43
+ - lib/tasks/mcptask_runner.rake
44
+ homepage: https://github.com/jchsoft/mcptask-rails-runner
45
+ licenses:
46
+ - MIT
47
+ metadata:
48
+ source_code_uri: https://github.com/jchsoft/mcptask-rails-runner
49
+ bug_tracker_uri: https://github.com/jchsoft/mcptask-rails-runner/issues
50
+ changelog_uri: https://github.com/jchsoft/mcptask-rails-runner/blob/main/CHANGELOG.md
51
+ rubygems_mfa_required: 'true'
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '3.0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubygems_version: 3.6.9
67
+ specification_version: 4
68
+ summary: mcptask.online autonomous runner for Rails apps
69
+ test_files: []