clawthor 0.3.0
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/LICENSE +21 -0
- data/README.md +365 -0
- data/exe/clawthor +8 -0
- data/lib/clawthor/cli.rb +140 -0
- data/lib/clawthor/compiler.rb +1258 -0
- data/lib/clawthor/dsl.rb +95 -0
- data/lib/clawthor/orchestrator.rb +35 -0
- data/lib/clawthor/primitives/agent.rb +77 -0
- data/lib/clawthor/primitives/command.rb +20 -0
- data/lib/clawthor/primitives/hook.rb +50 -0
- data/lib/clawthor/primitives/module.rb +75 -0
- data/lib/clawthor/primitives/service.rb +80 -0
- data/lib/clawthor/primitives/skill.rb +135 -0
- data/lib/clawthor/primitives/task.rb +60 -0
- data/lib/clawthor/primitives/workspace.rb +71 -0
- data/lib/clawthor/registry.rb +38 -0
- data/lib/clawthor/version.rb +5 -0
- data/lib/clawthor.rb +38 -0
- metadata +92 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Clawthor
|
|
4
|
+
module DSL
|
|
5
|
+
# ─── Registry ───────────────────────────────────────────────
|
|
6
|
+
# Collects all declared primitives during DSL evaluation.
|
|
7
|
+
|
|
8
|
+
class Registry
|
|
9
|
+
attr_reader :workspace, :skills, :hooks, :agents, :tasks, :commands, :services, :modules
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
@workspace = nil
|
|
13
|
+
@skills = {}
|
|
14
|
+
@hooks = {}
|
|
15
|
+
@agents = {}
|
|
16
|
+
@tasks = {}
|
|
17
|
+
@commands = {}
|
|
18
|
+
@services = {}
|
|
19
|
+
@modules = {}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def set_workspace(ws)
|
|
23
|
+
@workspace = ws
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Merge a module's primitives into the top-level registry.
|
|
27
|
+
# Called when `use :module_name` appears in a definition.
|
|
28
|
+
def merge_module!(mod)
|
|
29
|
+
@skills.merge!(mod.skills)
|
|
30
|
+
@hooks.merge!(mod.hooks)
|
|
31
|
+
@agents.merge!(mod.agents)
|
|
32
|
+
@tasks.merge!(mod.tasks)
|
|
33
|
+
@commands.merge!(mod.commands)
|
|
34
|
+
@services.merge!(mod.services)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/clawthor.rb
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "clawthor/version"
|
|
4
|
+
require "clawthor/orchestrator"
|
|
5
|
+
require "clawthor/compiler"
|
|
6
|
+
require "clawthor/cli"
|
|
7
|
+
|
|
8
|
+
module Clawthor
|
|
9
|
+
# Public API for programmatic compilation
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# Clawthor.compile(
|
|
13
|
+
# definition_file: "plugin.rb",
|
|
14
|
+
# output_dir: "dist",
|
|
15
|
+
# mode: :plugin # or :marketplace
|
|
16
|
+
# )
|
|
17
|
+
def self.compile(definition_file:, output_dir:, mode: :plugin)
|
|
18
|
+
unless File.exist?(definition_file)
|
|
19
|
+
raise "Definition file not found: #{definition_file}"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Reset registry for fresh compilation
|
|
23
|
+
registry = DSL::Registry.new
|
|
24
|
+
DSL.send(:remove_const, :REGISTRY) if DSL.const_defined?(:REGISTRY)
|
|
25
|
+
DSL.const_set(:REGISTRY, registry)
|
|
26
|
+
|
|
27
|
+
# Evaluate the definition file in DSL context
|
|
28
|
+
context = Object.new
|
|
29
|
+
context.extend(DSL::Methods)
|
|
30
|
+
context.instance_eval(File.read(definition_file), definition_file)
|
|
31
|
+
|
|
32
|
+
# Compile to output
|
|
33
|
+
compiler = Compiler.new(DSL::REGISTRY, output_dir, mode: mode)
|
|
34
|
+
compiler.compile!
|
|
35
|
+
|
|
36
|
+
DSL::REGISTRY
|
|
37
|
+
end
|
|
38
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: clawthor
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.3.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- James
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-02-05 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: minitest
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5.16'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '5.16'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '13.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '13.0'
|
|
41
|
+
description: Clawthor is a Ruby DSL and compiler for building Claude Code plugins.
|
|
42
|
+
Define skills, agents, commands, and tasks declaratively, then compile to plugin
|
|
43
|
+
manifests automatically.
|
|
44
|
+
email:
|
|
45
|
+
- james@anthropic.com
|
|
46
|
+
executables:
|
|
47
|
+
- clawthor
|
|
48
|
+
extensions: []
|
|
49
|
+
extra_rdoc_files: []
|
|
50
|
+
files:
|
|
51
|
+
- LICENSE
|
|
52
|
+
- README.md
|
|
53
|
+
- exe/clawthor
|
|
54
|
+
- lib/clawthor.rb
|
|
55
|
+
- lib/clawthor/cli.rb
|
|
56
|
+
- lib/clawthor/compiler.rb
|
|
57
|
+
- lib/clawthor/dsl.rb
|
|
58
|
+
- lib/clawthor/orchestrator.rb
|
|
59
|
+
- lib/clawthor/primitives/agent.rb
|
|
60
|
+
- lib/clawthor/primitives/command.rb
|
|
61
|
+
- lib/clawthor/primitives/hook.rb
|
|
62
|
+
- lib/clawthor/primitives/module.rb
|
|
63
|
+
- lib/clawthor/primitives/service.rb
|
|
64
|
+
- lib/clawthor/primitives/skill.rb
|
|
65
|
+
- lib/clawthor/primitives/task.rb
|
|
66
|
+
- lib/clawthor/primitives/workspace.rb
|
|
67
|
+
- lib/clawthor/registry.rb
|
|
68
|
+
- lib/clawthor/version.rb
|
|
69
|
+
homepage: https://github.com/anthropics/clawthor
|
|
70
|
+
licenses:
|
|
71
|
+
- MIT
|
|
72
|
+
metadata: {}
|
|
73
|
+
post_install_message:
|
|
74
|
+
rdoc_options: []
|
|
75
|
+
require_paths:
|
|
76
|
+
- lib
|
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 3.0.0
|
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '0'
|
|
87
|
+
requirements: []
|
|
88
|
+
rubygems_version: 3.0.3.1
|
|
89
|
+
signing_key:
|
|
90
|
+
specification_version: 4
|
|
91
|
+
summary: DSL and compiler for Claude Code plugins
|
|
92
|
+
test_files: []
|