mcptask-rails-runner 0.3.0-aarch64-linux
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 +7 -0
- data/CHANGELOG.md +33 -0
- data/LICENSE +21 -0
- data/README.md +143 -0
- data/lib/mcptask/rails/runner.rb +4 -0
- data/lib/mcptask_rails_runner/binary.rb +154 -0
- data/lib/mcptask_rails_runner/railtie.rb +11 -0
- data/lib/mcptask_rails_runner/version.rb +14 -0
- data/lib/mcptask_rails_runner.rb +21 -0
- data/lib/tasks/mcptask_runner.rake +98 -0
- data/libexec/mcptask_runner +0 -0
- metadata +70 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 03223dd8a23acf3c545df7ab4cf4b83ef43882ea8a91a91236d206fd4563a457
|
|
4
|
+
data.tar.gz: 31c7064d6f89e918936152b815cea1fd79151921140691bfd43b6373eea6aa5c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9942953edb8f0874ba056310ed56ef8b1fe58fa8ba3861b62a0d54225773495dc512b5798105a7f22f060489c1ae184a044ad8248caebeb53b3898e0c4b55bf1
|
|
7
|
+
data.tar.gz: 555ac773cc0e86295d7c2b9d463f80b86c3da786f62aae217291e1fee0f3fc0bc2aa6d9955898e870b45cc11479d31ed1d0e7be4e7863e08c30ab0b21b2cd211
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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.3.0
|
|
9
|
+
|
|
10
|
+
- The Go runner is the runner: this gem is the Rails distribution, and the
|
|
11
|
+
legacy `mcptask_runner` gem is retired to critical fixes and its role as the
|
|
12
|
+
conformance suite's reference implementation.
|
|
13
|
+
|
|
14
|
+
- The ARM Linux platform gem is named `aarch64-linux`, which is the platform
|
|
15
|
+
such hosts actually resolve. 0.2.4 published it as `arm64-linux`, which
|
|
16
|
+
matches nothing: every Graviton server, ARM CI runner and Docker container on
|
|
17
|
+
Apple Silicon fell back to the binary-less `ruby` gem and failed at run time.
|
|
18
|
+
That gem stays published and unreachable.
|
|
19
|
+
- `mcptask_runner:install` and `:update` copy the binary out of the gem to
|
|
20
|
+
`~/.mcptask/bin/mcptask_runner` and run it from there, so the scheduled job
|
|
21
|
+
they generate survives the next `bundle update` — which deletes the gem
|
|
22
|
+
directory the job used to point into. They print which version they wrote and
|
|
23
|
+
never replace a newer installed binary with an older one. Migrating hosts
|
|
24
|
+
should re-run install once, with `FORCE=1`, to regenerate the job.
|
|
25
|
+
|
|
26
|
+
## 0.2.4
|
|
27
|
+
|
|
28
|
+
- First release. Thin Rails wrapper around the `mcptask_runner` Go binary,
|
|
29
|
+
with the rake surface of the legacy `mcptask_runner` gem kept unchanged so
|
|
30
|
+
migrating is a one-line Gemfile edit.
|
|
31
|
+
- Platform gems for `arm64-darwin`, `x86_64-darwin`, `arm64-linux`,
|
|
32
|
+
`x86_64-linux` and `x64-mingw-ucrt`; the `ruby` fallback gem explains how to
|
|
33
|
+
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,143 @@
|
|
|
1
|
+
# mcptask-rails-runner
|
|
2
|
+
|
|
3
|
+
Rails distribution of the [mcptask.online](https://mcptask.online) autonomous
|
|
4
|
+
runner, and the way a Rails app installs it. A thin Ruby wrapper around the
|
|
5
|
+
`mcptask_runner` Go binary: the gem ships the platform-specific binary inside
|
|
6
|
+
itself (`libexec/`) and exposes the same rake tasks as the legacy
|
|
7
|
+
`mcptask_runner` gem, delegating 1:1 to the CLI.
|
|
8
|
+
|
|
9
|
+
The legacy gem is retired. It gets critical fixes only, and it stays in
|
|
10
|
+
existence as the reference implementation the Go runner's conformance suite
|
|
11
|
+
measures against; everything new is written in Go. What you gain by moving:
|
|
12
|
+
Linux and Windows hosts, a scheduled job with no bundler in its path, and a
|
|
13
|
+
handful of places where the old implementation was simply wrong (its token
|
|
14
|
+
resolution read a different half of `.mcp.json` in each of three places, and
|
|
15
|
+
its stream reader died mid-run on an API error envelope).
|
|
16
|
+
|
|
17
|
+
One gem version carries exactly one binary version — `mcptask-rails-runner
|
|
18
|
+
X.Y.Z` contains the binary from the `vX.Y.Z` release of
|
|
19
|
+
[jchsoft/mcptask-releases](https://github.com/jchsoft/mcptask-releases).
|
|
20
|
+
|
|
21
|
+
`mcptask_runner:install` and `:update` copy that binary out of the gem to
|
|
22
|
+
`~/.mcptask/bin/mcptask_runner` and run it from there. The scheduled job runs
|
|
23
|
+
that copy, because a job pointing inside a gem directory dies at the next
|
|
24
|
+
`bundle update` — at 08:00, in a log nobody reads. So the pin is per project:
|
|
25
|
+
the Gemfile decides what a foreground `rake mcptask_runner:*` runs, while the
|
|
26
|
+
machine has one installed binary however many projects it carries, and the
|
|
27
|
+
newest version any of them offers is the one that stays. Install and update
|
|
28
|
+
print which version they wrote, and never replace a newer installed binary
|
|
29
|
+
with an older one.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- Ruby >= 3.0, Rails >= 6.0
|
|
34
|
+
- [Claude Code](https://claude.com/claude-code) CLI
|
|
35
|
+
- An mcptask.online account
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
# Gemfile
|
|
41
|
+
gem "mcptask-rails-runner"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bundle install
|
|
46
|
+
bundle exec rake mcptask_runner:install
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Migrating from the legacy mcptask_runner gem
|
|
50
|
+
|
|
51
|
+
The rake surface is identical — the migration is one Gemfile line:
|
|
52
|
+
|
|
53
|
+
```diff
|
|
54
|
+
- gem "mcptask_runner", git: "git@github.com:jchsoft/mcptask_runner.git"
|
|
55
|
+
+ gem "mcptask-rails-runner"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bundle install
|
|
62
|
+
FORCE=1 bundle exec rake mcptask_runner:install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Re-running install is what regenerates the scheduled job. The legacy launcher
|
|
66
|
+
runs `bundle exec rake` and logs the active version by grepping `Gemfile.lock`
|
|
67
|
+
for the old gem name — neither survives the rename, so a job left as it is
|
|
68
|
+
keeps working but stops recording what it ran. The regenerated one execs
|
|
69
|
+
`~/.mcptask/bin/mcptask_runner` directly, with no bundler in the 08:00 path.
|
|
70
|
+
|
|
71
|
+
Every `rake mcptask_runner:*` invocation and shell alias keeps working
|
|
72
|
+
unchanged. Your existing
|
|
73
|
+
`config/mcptask_runner.yml`, `.mcp.json` and `.claude/` setup are read by the
|
|
74
|
+
Go binary as-is. The only legacy task without a counterpart is
|
|
75
|
+
`mcptask_runner:prepare:permissions` — permission sync is part of
|
|
76
|
+
`mcptask_runner:install` now.
|
|
77
|
+
|
|
78
|
+
## Tasks
|
|
79
|
+
|
|
80
|
+
| Task | Delegates to |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `mcptask_runner:install` | `mcptask_runner init` (from `~/.mcptask/bin`) |
|
|
83
|
+
| `mcptask_runner:update` | `mcptask_runner update` (from `~/.mcptask/bin`) |
|
|
84
|
+
| `mcptask_runner:bug_report` | `mcptask_runner bug-report` |
|
|
85
|
+
| `mcptask_runner:version` | `mcptask_runner version` |
|
|
86
|
+
| `mcptask_runner:manual:once` (`once_dry`, `today`, `daily`, `review`, `reviews`, `workflow`, `queue`) | `mcptask_runner run <mode>` |
|
|
87
|
+
| `mcptask_runner:manual:story[123]` / `manual:task[123]` | `run story_manual --story-id 123` / `run task_manual --task-id 123` |
|
|
88
|
+
| `mcptask_runner:auto:once` | `run once_auto_squash` |
|
|
89
|
+
| `mcptask_runner:auto:squash:today` (`queue`, `story[123]`, `task[123]`) | `run <mode>_auto_squash` |
|
|
90
|
+
|
|
91
|
+
`verbose=true` and `ignore_quota=true` environment variables are honored by
|
|
92
|
+
the binary itself, exactly as before.
|
|
93
|
+
|
|
94
|
+
## Supported platforms
|
|
95
|
+
|
|
96
|
+
Platform gems exist for `arm64-darwin`, `x86_64-darwin`, `aarch64-linux`,
|
|
97
|
+
`x86_64-linux` and `x64-mingw-ucrt`. On anything else bundler falls back to
|
|
98
|
+
the binary-less `ruby` platform gem, which fails at run time with
|
|
99
|
+
instructions: install the binary from
|
|
100
|
+
[mcptask-releases](https://github.com/jchsoft/mcptask-releases) (or via
|
|
101
|
+
`install.sh` / npm `@mcptask/cli`) and point `MCPTASK_RUNNER_BIN` at it. The
|
|
102
|
+
same variable also serves offline or air-gapped installs.
|
|
103
|
+
|
|
104
|
+
The wrapper always executes the binary through an absolute path — inside the
|
|
105
|
+
gem for the run tasks, `~/.mcptask/bin` for install and update — and never
|
|
106
|
+
through PATH: the binary shares its name with the legacy tooling, and a PATH
|
|
107
|
+
lookup could pick up the wrong install. `MCPTASK_RUNNER_BIN` overrides both,
|
|
108
|
+
and install leaves `~/.mcptask/bin` untouched while it is set.
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bundle install
|
|
114
|
+
bundle exec rake test # unit tests (binary resolution + task mapping)
|
|
115
|
+
bin/fetch-binaries # stage release binaries into tmp/binaries/
|
|
116
|
+
bundle exec rake package:all # build all platform gems into pkg/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Releasing
|
|
120
|
+
|
|
121
|
+
Releases are cut by tagging: bump `lib/mcptask_rails_runner/version.rb` to
|
|
122
|
+
match an existing `mcptask-releases` tag, push a matching `vX.Y.Z` tag, and
|
|
123
|
+
the Release workflow downloads the binaries (sha256-verified), builds the
|
|
124
|
+
platform gems and publishes them to rubygems.org through OIDC trusted
|
|
125
|
+
publishing. See `.github/workflows/release.yml`.
|
|
126
|
+
|
|
127
|
+
One-time setup on rubygems.org, before the first tag can publish anything —
|
|
128
|
+
the gem name has to exist as a trusted-publisher entry:
|
|
129
|
+
|
|
130
|
+
1. Sign in on rubygems.org, open **Profile → Trusted publishers → Create**.
|
|
131
|
+
2. For a gem that has never been pushed, use **Create a pending trusted
|
|
132
|
+
publisher** with gem name `mcptask-rails-runner`; for an existing gem, add
|
|
133
|
+
the publisher on the gem's own page.
|
|
134
|
+
3. Repository owner `jchsoft`, repository name `mcptask-rails-runner`,
|
|
135
|
+
workflow filename `release.yml`, environment empty.
|
|
136
|
+
|
|
137
|
+
No API key is stored anywhere: `rubygems/configure-rubygems-credentials`
|
|
138
|
+
exchanges the workflow's OIDC token for a short-lived credential at push time.
|
|
139
|
+
The same model as the npm publish in the Go repository.
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
|
|
5
|
+
module McptaskRailsRunner
|
|
6
|
+
# Locates, installs and executes the bundled Go binary.
|
|
7
|
+
module Binary
|
|
8
|
+
GEM_ROOT = File.expand_path("../..", __dir__)
|
|
9
|
+
|
|
10
|
+
SUPPORTED_PLATFORMS = %w[
|
|
11
|
+
arm64-darwin
|
|
12
|
+
x86_64-darwin
|
|
13
|
+
aarch64-linux
|
|
14
|
+
x86_64-linux
|
|
15
|
+
x64-mingw-ucrt
|
|
16
|
+
].freeze
|
|
17
|
+
|
|
18
|
+
# Where the binary is installed to live, outside every gem directory.
|
|
19
|
+
#
|
|
20
|
+
# The scheduled job runs this path, and it has to be one that survives a
|
|
21
|
+
# `bundle update`: a job pointing into
|
|
22
|
+
# gems/mcptask-rails-runner-<version>-<platform>/libexec dies the moment the
|
|
23
|
+
# gem is bumped, at 08:00, in a log nobody reads. Under the runner's own
|
|
24
|
+
# ~/.mcptask rather than /usr/local/bin, because `bundle install` has no
|
|
25
|
+
# sudo and a gem cannot write there. The Go side knows the same path — see
|
|
26
|
+
# InstalledBinary in internal/install/schedule.go.
|
|
27
|
+
INSTALL_DIR = File.join(Dir.home, ".mcptask", "bin")
|
|
28
|
+
|
|
29
|
+
# The line `mcptask_runner version` prints the version on.
|
|
30
|
+
VERSION_LINE = /Version:\s*(\S+)/
|
|
31
|
+
|
|
32
|
+
module_function
|
|
33
|
+
|
|
34
|
+
def executable_name
|
|
35
|
+
Gem.win_platform? ? "mcptask_runner.exe" : "mcptask_runner"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Absolute path to the binary this gem runs. Never resolved through PATH:
|
|
39
|
+
# the binary shares the mcptask_runner name with the legacy gem's rake
|
|
40
|
+
# namespace, and a PATH lookup could pick up a stale or wrong install.
|
|
41
|
+
def path(gem_root: GEM_ROOT)
|
|
42
|
+
override = ENV["MCPTASK_RUNNER_BIN"]
|
|
43
|
+
return override unless override.nil? || override.empty?
|
|
44
|
+
|
|
45
|
+
bundled_path(gem_root: gem_root)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# The copy that ships inside this gem, which is the one the Gemfile pins.
|
|
49
|
+
def bundled_path(gem_root: GEM_ROOT)
|
|
50
|
+
exe = File.join(gem_root, "libexec", executable_name)
|
|
51
|
+
return exe if File.file?(exe)
|
|
52
|
+
|
|
53
|
+
raise Error, <<~MSG
|
|
54
|
+
mcptask_runner binary not found at #{exe}.
|
|
55
|
+
|
|
56
|
+
The platform gem for #{Gem::Platform.local} was probably not installed.
|
|
57
|
+
Supported platforms: #{SUPPORTED_PLATFORMS.join(', ')}.
|
|
58
|
+
|
|
59
|
+
On a supported platform, re-run `bundle install` (and make sure the
|
|
60
|
+
platform is in Gemfile.lock: `bundle lock --add-platform #{Gem::Platform.local}`).
|
|
61
|
+
On an unsupported platform, install the binary from
|
|
62
|
+
https://github.com/jchsoft/mcptask-releases and point the
|
|
63
|
+
MCPTASK_RUNNER_BIN environment variable at it.
|
|
64
|
+
MSG
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# The version-free path the installed copy lives at.
|
|
68
|
+
def installed_path(install_dir: INSTALL_DIR)
|
|
69
|
+
File.join(install_dir, executable_name)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Copies the bundled binary out of the gem, and returns what to run.
|
|
73
|
+
#
|
|
74
|
+
# The gem bootstraps the binary; it does not host it. Everything the
|
|
75
|
+
# scheduled job touches has to outlive `bundle update`, and a gem directory
|
|
76
|
+
# does not — so install and update put a copy where nothing but they will
|
|
77
|
+
# ever move it. A copy rather than a symlink: a link into the gem's libexec
|
|
78
|
+
# dangles on the same bundle update, which is the identical 08:00 failure
|
|
79
|
+
# moved one step along, and Windows wants a privilege for symlinks besides.
|
|
80
|
+
#
|
|
81
|
+
# Teaching the launcher to run `bundle exec rake` instead would fix the path
|
|
82
|
+
# and put bundler and Gemfile.lock back into the 08:00 path — the layer the
|
|
83
|
+
# Go port set out to remove.
|
|
84
|
+
#
|
|
85
|
+
# Newest wins, and says so. A host with several projects has several gem
|
|
86
|
+
# versions and one installed binary, so a project pinning an older gem must
|
|
87
|
+
# not quietly drag the machine's runner backwards.
|
|
88
|
+
def install!(install_dir: INSTALL_DIR, gem_root: GEM_ROOT, out: $stdout)
|
|
89
|
+
override = ENV["MCPTASK_RUNNER_BIN"]
|
|
90
|
+
unless override.nil? || override.empty?
|
|
91
|
+
out.puts "[mcptask_runner] MCPTASK_RUNNER_BIN is set — running #{override} " \
|
|
92
|
+
"and leaving #{installed_path(install_dir: install_dir)} alone."
|
|
93
|
+
return override
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
source = bundled_path(gem_root: gem_root)
|
|
97
|
+
target = installed_path(install_dir: install_dir)
|
|
98
|
+
|
|
99
|
+
existing = installed_version(target)
|
|
100
|
+
if existing && existing > Gem::Version.new(VERSION)
|
|
101
|
+
out.puts "[mcptask_runner] #{target} already holds #{existing}, which is newer than this " \
|
|
102
|
+
"gem's #{VERSION} — keeping it. Delete that file to install this gem's binary instead."
|
|
103
|
+
return target
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
copy(source, target)
|
|
107
|
+
out.puts "[mcptask_runner] installed mcptask_runner #{VERSION} into #{target}" \
|
|
108
|
+
"#{existing ? " (replacing #{existing})" : ''}."
|
|
109
|
+
target
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Replaces the current process, so the binary's exit code and signal
|
|
113
|
+
# handling reach the caller (rake) unchanged.
|
|
114
|
+
def exec!(*args)
|
|
115
|
+
Kernel.exec(path, *args)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Installs the binary outside the gem first, then runs that copy.
|
|
119
|
+
#
|
|
120
|
+
# Used by install and update, the two tasks that generate the scheduled job:
|
|
121
|
+
# the job runs whichever binary is executing them, so it has to be the copy
|
|
122
|
+
# at the version-free path rather than the one inside this gem.
|
|
123
|
+
def exec_installed!(*args)
|
|
124
|
+
Kernel.exec(install!, *args)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# What the installed copy reports about itself, or nil when there is none —
|
|
128
|
+
# or when it cannot be asked, which a stray file at that path cannot be.
|
|
129
|
+
#
|
|
130
|
+
# Asked of the binary rather than recorded in a marker file beside it: the
|
|
131
|
+
# binary is what actually runs at 08:00, and a marker can only be right
|
|
132
|
+
# about installs that went through here.
|
|
133
|
+
def installed_version(target)
|
|
134
|
+
return nil unless File.file?(target)
|
|
135
|
+
|
|
136
|
+
banner = IO.popen([target, "version"], err: File::NULL, &:read)
|
|
137
|
+
raw = banner.to_s[VERSION_LINE, 1]
|
|
138
|
+
raw && Gem::Version.new(raw)
|
|
139
|
+
rescue StandardError
|
|
140
|
+
nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Written beside the target and renamed into place: a half-copied binary
|
|
144
|
+
# over a working one is a scheduled job that fails on a corrupt file, and
|
|
145
|
+
# the rename also sidesteps the ETXTBSY a running copy would give.
|
|
146
|
+
def copy(source, target)
|
|
147
|
+
FileUtils.mkdir_p(File.dirname(target))
|
|
148
|
+
staged = "#{target}.new"
|
|
149
|
+
FileUtils.cp(source, staged)
|
|
150
|
+
FileUtils.chmod(0o755, staged)
|
|
151
|
+
File.rename(staged, target)
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module McptaskRailsRunner
|
|
4
|
+
# The gem version names the mcptask_runner binary release it carries (tag
|
|
5
|
+
# v#{VERSION} in jchsoft/mcptask-releases). Bump both together.
|
|
6
|
+
#
|
|
7
|
+
# What it does not name is the binary the host runs at 08:00. That one is
|
|
8
|
+
# installed outside every gem directory, by install and update, and a machine
|
|
9
|
+
# has one of it however many projects and gem versions it carries — see
|
|
10
|
+
# Binary::INSTALL_DIR. So the pin is per project and per foreground rake
|
|
11
|
+
# invocation; the installed copy is per machine, and the newest binary any of
|
|
12
|
+
# those projects offers is the one that stays.
|
|
13
|
+
VERSION = "0.3.0"
|
|
14
|
+
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,98 @@
|
|
|
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
|
+
# Two of them delegate to the installed copy instead of the bundled one. install
|
|
9
|
+
# and update are the tasks that generate the scheduled job, and the job runs
|
|
10
|
+
# whichever binary generated it: pointing it inside this gem would have it die
|
|
11
|
+
# at the next `bundle update`, which deletes that directory. Everything else
|
|
12
|
+
# runs the binary the Gemfile pins, which is what a foreground rake invocation
|
|
13
|
+
# should do.
|
|
14
|
+
|
|
15
|
+
require "mcptask_rails_runner"
|
|
16
|
+
|
|
17
|
+
namespace :mcptask_runner do
|
|
18
|
+
desc "Install skills, permissions, token and scheduled job into this project"
|
|
19
|
+
task :install do
|
|
20
|
+
McptaskRailsRunner::Binary.exec_installed!("init")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "Refresh bundled skills and helpers"
|
|
24
|
+
task :update do
|
|
25
|
+
McptaskRailsRunner::Binary.exec_installed!("update")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "File a bug against the project with the last run log attached"
|
|
29
|
+
task :bug_report do
|
|
30
|
+
McptaskRailsRunner::Binary.exec!("bug-report")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
desc "Print runner version and resolved configuration"
|
|
34
|
+
task :version do
|
|
35
|
+
McptaskRailsRunner::Binary.exec!("version")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
namespace :manual do
|
|
39
|
+
{
|
|
40
|
+
once: "once",
|
|
41
|
+
once_dry: "once_dry",
|
|
42
|
+
today: "today",
|
|
43
|
+
daily: "daily",
|
|
44
|
+
review: "review",
|
|
45
|
+
reviews: "reviews",
|
|
46
|
+
workflow: "workflow",
|
|
47
|
+
queue: "queue_manual"
|
|
48
|
+
}.each do |task_name, mode|
|
|
49
|
+
desc "Run the work loop in #{mode} mode"
|
|
50
|
+
task task_name do
|
|
51
|
+
McptaskRailsRunner::Binary.exec!("run", mode)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
desc "Work a single story in manual mode"
|
|
56
|
+
task :story, [:story_id] do |_t, args|
|
|
57
|
+
id = McptaskRailsRunner.piece_id!(args[:story_id], "story_id", "mcptask_runner:manual:story[123]")
|
|
58
|
+
McptaskRailsRunner::Binary.exec!("run", "story_manual", "--story-id", id)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
desc "Work a single task in manual mode"
|
|
62
|
+
task :task, [:task_id] do |_t, args|
|
|
63
|
+
id = McptaskRailsRunner.piece_id!(args[:task_id], "task_id", "mcptask_runner:manual:task[123]")
|
|
64
|
+
McptaskRailsRunner::Binary.exec!("run", "task_manual", "--task-id", id)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
namespace :auto do
|
|
69
|
+
desc "Run the work loop in once_auto_squash mode"
|
|
70
|
+
task :once do
|
|
71
|
+
McptaskRailsRunner::Binary.exec!("run", "once_auto_squash")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
namespace :squash do
|
|
75
|
+
desc "Run the work loop in today_auto_squash mode"
|
|
76
|
+
task :today do
|
|
77
|
+
McptaskRailsRunner::Binary.exec!("run", "today_auto_squash")
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
desc "Run the work loop in queue_auto_squash mode"
|
|
81
|
+
task :queue do
|
|
82
|
+
McptaskRailsRunner::Binary.exec!("run", "queue_auto_squash")
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
desc "Work a single story in auto-squash mode"
|
|
86
|
+
task :story, [:story_id] do |_t, args|
|
|
87
|
+
id = McptaskRailsRunner.piece_id!(args[:story_id], "story_id", "mcptask_runner:auto:squash:story[123]")
|
|
88
|
+
McptaskRailsRunner::Binary.exec!("run", "story_auto_squash", "--story-id", id)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
desc "Work a single task in auto-squash mode"
|
|
92
|
+
task :task, [:task_id] do |_t, args|
|
|
93
|
+
id = McptaskRailsRunner.piece_id!(args[:task_id], "task_id", "mcptask_runner:auto:squash:task[123]")
|
|
94
|
+
McptaskRailsRunner::Binary.exec!("run", "task_auto_squash", "--task-id", id)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
Binary file
|
metadata
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mcptask-rails-runner
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.3.0
|
|
5
|
+
platform: aarch64-linux
|
|
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
|
+
- libexec/mcptask_runner
|
|
45
|
+
homepage: https://github.com/jchsoft/mcptask-rails-runner
|
|
46
|
+
licenses:
|
|
47
|
+
- MIT
|
|
48
|
+
metadata:
|
|
49
|
+
source_code_uri: https://github.com/jchsoft/mcptask-rails-runner
|
|
50
|
+
bug_tracker_uri: https://github.com/jchsoft/mcptask-rails-runner/issues
|
|
51
|
+
changelog_uri: https://github.com/jchsoft/mcptask-rails-runner/blob/main/CHANGELOG.md
|
|
52
|
+
rubygems_mfa_required: 'true'
|
|
53
|
+
rdoc_options: []
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '3.0'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubygems_version: 3.6.9
|
|
68
|
+
specification_version: 4
|
|
69
|
+
summary: mcptask.online autonomous runner for Rails apps
|
|
70
|
+
test_files: []
|