diogenes 0.1.9 → 0.1.10
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/diogenes/cli/watch.rb +82 -0
- data/lib/diogenes/cli.rb +4 -1
- data/lib/diogenes/version.rb +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1dc84b4e3e48984a9ebdd40c05a8247e8f6a2f4eeadc5d573261a4ad5978139c
|
|
4
|
+
data.tar.gz: 28a0962361eb3b84364e7ed2da762a968f5e4e4ec00397724d9e00d888325ae4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d71b4e311c6113629cc469e7ad5725724badceb37f2ad25b68b2db8fbf2d9bf3b329bf7eda939cdaf82c89ba25d61c7f72f8c2e8f86c7e0889c140917f388ffc
|
|
7
|
+
data.tar.gz: d1ed1834fd0e5a501ba11b051a2ce5e2a5199ebf89e4ee4b02178330ec8e568265b84cdffd0784471d546d53e4bac0208f5879dec643478a9ad13cecd5a9cde1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.10](https://github.com/meaganewaller/diogenes/compare/diogenes/v0.1.9...diogenes/v0.1.10) (2026-06-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **watch:** add diogenes watch command for live rebuilds :eyes: ([#19](https://github.com/meaganewaller/diogenes/issues/19)) ([d6d0d21](https://github.com/meaganewaller/diogenes/commit/d6d0d2114af408caf8647e6185e5a185bed92477))
|
|
9
|
+
|
|
3
10
|
## [0.1.9](https://github.com/meaganewaller/diogenes/compare/diogenes/v0.1.8...diogenes/v0.1.9) (2026-06-27)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# rbs_inline: enabled
|
|
3
|
+
|
|
4
|
+
require "listen"
|
|
5
|
+
|
|
6
|
+
module Diogenes
|
|
7
|
+
class Cli
|
|
8
|
+
class Watch
|
|
9
|
+
DIOGENES_DIR = ".diogenes" #: String
|
|
10
|
+
|
|
11
|
+
#: (argv: Array[String], cwd: String, out: IO, err: IO, **untyped) -> Integer
|
|
12
|
+
def self.run(argv:, cwd:, out:, err:, **_opts)
|
|
13
|
+
new(argv:, cwd:, out:, err:).run
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
#: (argv: Array[String], cwd: String, out: IO, err: IO) -> void
|
|
17
|
+
def initialize(argv:, cwd:, out:, err:)
|
|
18
|
+
@argv = argv #: Array[String]
|
|
19
|
+
@cwd = cwd #: String
|
|
20
|
+
@out = out #: IO
|
|
21
|
+
@err = err #: IO
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
#: () -> Integer
|
|
25
|
+
def run
|
|
26
|
+
diogenes_dir = File.join(@cwd, DIOGENES_DIR)
|
|
27
|
+
unless Dir.exist?(diogenes_dir)
|
|
28
|
+
@err.puts "No #{DIOGENES_DIR}/ found. Run `diogenes init` first."
|
|
29
|
+
return 1
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
@out.puts "Watching #{DIOGENES_DIR}/ for changes. Press Ctrl+C to stop."
|
|
33
|
+
@out.puts
|
|
34
|
+
|
|
35
|
+
listener = build_listener(diogenes_dir)
|
|
36
|
+
listener.start
|
|
37
|
+
sleep
|
|
38
|
+
0
|
|
39
|
+
rescue Interrupt
|
|
40
|
+
@out.puts "\nStopped."
|
|
41
|
+
0
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
#: (String) -> Listen::Listener
|
|
47
|
+
def build_listener(diogenes_dir)
|
|
48
|
+
Listen.to(diogenes_dir) do |modified, added, removed|
|
|
49
|
+
changed = (modified + added + removed).map { |f| f.delete_prefix("#{diogenes_dir}/") }
|
|
50
|
+
rebuild(changed)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
#: (Array[String]) -> void
|
|
55
|
+
def rebuild(changed_files)
|
|
56
|
+
ts = Time.now.strftime("%H:%M:%S")
|
|
57
|
+
@out.puts "[#{ts}] #{changed_files.join(", ")} changed — rebuilding..."
|
|
58
|
+
|
|
59
|
+
buf_out = StringIO.new
|
|
60
|
+
buf_err = StringIO.new
|
|
61
|
+
status = Cli::Build.run(argv: ["--all"], cwd: @cwd, out: buf_out, err: buf_err)
|
|
62
|
+
|
|
63
|
+
ts = Time.now.strftime("%H:%M:%S")
|
|
64
|
+
if status == 0
|
|
65
|
+
@out.puts "[#{ts}] Build complete."
|
|
66
|
+
buf_out.string.each_line do |line|
|
|
67
|
+
stripped = line.chomp
|
|
68
|
+
next if stripped.empty? || stripped == "Build complete."
|
|
69
|
+
@out.puts " #{stripped}"
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
@out.puts "[#{ts}] Build failed."
|
|
73
|
+
buf_err.string.each_line do |line|
|
|
74
|
+
stripped = line.chomp
|
|
75
|
+
@out.puts " #{stripped}" unless stripped.empty?
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
@out.puts
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
data/lib/diogenes/cli.rb
CHANGED
|
@@ -5,6 +5,7 @@ require_relative "cli/init"
|
|
|
5
5
|
require_relative "cli/build"
|
|
6
6
|
require_relative "cli/evaluate"
|
|
7
7
|
require_relative "cli/validate"
|
|
8
|
+
require_relative "cli/watch"
|
|
8
9
|
|
|
9
10
|
module Diogenes
|
|
10
11
|
class Cli
|
|
@@ -12,7 +13,8 @@ module Diogenes
|
|
|
12
13
|
"init" => Init,
|
|
13
14
|
"build" => Build,
|
|
14
15
|
"evaluate" => Evaluate,
|
|
15
|
-
"validate" => Validate
|
|
16
|
+
"validate" => Validate,
|
|
17
|
+
"watch" => Watch
|
|
16
18
|
}.freeze #: Hash[String, Class]
|
|
17
19
|
|
|
18
20
|
#: (?Array[String] argv, ?out: IO, ?err: IO, **untyped) -> Integer
|
|
@@ -74,6 +76,7 @@ module Diogenes
|
|
|
74
76
|
build Build the Diogenes agent configuration for a given target
|
|
75
77
|
evaluate Evaluate a proposed AI feature through the five gates
|
|
76
78
|
validate Validate the Diogenes agent configuration for a given target
|
|
79
|
+
watch Watch .diogenes/ and rebuild on changes
|
|
77
80
|
help Show help for a command
|
|
78
81
|
version Show version information
|
|
79
82
|
HELP
|
data/lib/diogenes/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diogenes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Meagan Waller
|
|
@@ -29,6 +29,20 @@ dependencies:
|
|
|
29
29
|
- - ">="
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: 2.6.0
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: listen
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '3.0'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '3.0'
|
|
32
46
|
description: A Ruby gem that holds your AI features to the light
|
|
33
47
|
executables:
|
|
34
48
|
- diogenes
|
|
@@ -68,6 +82,7 @@ files:
|
|
|
68
82
|
- lib/diogenes/cli/evaluate.rb
|
|
69
83
|
- lib/diogenes/cli/init.rb
|
|
70
84
|
- lib/diogenes/cli/validate.rb
|
|
85
|
+
- lib/diogenes/cli/watch.rb
|
|
71
86
|
- lib/diogenes/configuration.rb
|
|
72
87
|
- lib/diogenes/dsl/artifact.rb
|
|
73
88
|
- lib/diogenes/dsl/hook.rb
|