brainiac-github 0.0.4 → 0.0.5
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/lib/brainiac/plugins/github/version.rb +1 -1
- data/lib/brainiac/plugins/github.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5541245a5dbeb29674e8d43c8cca5d63321f8c671b970e5bd240340839adfdc2
|
|
4
|
+
data.tar.gz: 06f83b16e583224a4f174023435b1f9f674525ce1c48c45295a1fc4fcc204fc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d603efcbea95b3ce87d8d5675bf5e1590cc6ef813a4946cdec89ac6d890e0bc9bceffd13db64be35c454ed08664b5e5bb82c2977523c09ddd5296c60e00eea8
|
|
7
|
+
data.tar.gz: c642f3900281f2fcf4ca0134e5153347ea1feefc1805a4bfda2ac740c508e74c34de7997a8e14b77f645dfaa5639bb93437814b04e1e6e94137ff1d597dea767
|
|
@@ -19,6 +19,7 @@ module Brainiac
|
|
|
19
19
|
Config.load!
|
|
20
20
|
Brainiac.register_channel_prompt(:github, Prompts::CHANNEL, pre_post_check: Prompts::PRE_POST_CHECK)
|
|
21
21
|
register_crash_handler!
|
|
22
|
+
register_agent_lifecycle_hooks!
|
|
22
23
|
setup_routes(app)
|
|
23
24
|
LOG.info "[GitHub] Plugin registered (webhook: /github)"
|
|
24
25
|
end
|
|
@@ -39,6 +40,18 @@ module Brainiac
|
|
|
39
40
|
|
|
40
41
|
private
|
|
41
42
|
|
|
43
|
+
def register_agent_lifecycle_hooks!
|
|
44
|
+
Brainiac.on(:agent_added) do |ctx|
|
|
45
|
+
Config.reload!
|
|
46
|
+
LOG.info "[GitHub] Agent added: #{ctx[:display_name]} — config reloaded" if defined?(LOG)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
Brainiac.on(:agent_removed) do |ctx|
|
|
50
|
+
Config.reload!
|
|
51
|
+
LOG.info "[GitHub] Agent removed: #{ctx[:agent_key]} — config reloaded" if defined?(LOG)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
42
55
|
def register_crash_handler!
|
|
43
56
|
Brainiac.on(:agent_crashed) do |ctx|
|
|
44
57
|
next unless ctx[:source] == :github
|