lex-coldstart 0.1.1 → 0.1.3
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/Gemfile +5 -2
- data/lib/legion/extensions/coldstart/helpers/claude_parser.rb +3 -3
- data/lib/legion/extensions/coldstart/runners/coldstart.rb +3 -3
- data/lib/legion/extensions/coldstart/runners/ingest.rb +13 -11
- data/lib/legion/extensions/coldstart/version.rb +1 -1
- data/lib/legion/extensions/coldstart.rb +1 -1
- 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: 77ee2421158cb9a62de788b3ccfb8333a133a51205a2de77cb4676717fb03f5f
|
|
4
|
+
data.tar.gz: c91dd8d5e753495d06a7bab45305a0c6bbb8708d0ac3c465aeacc67bd7ad8ed9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33885d264cb29034efa973f6a501bc55ee1ad29556c70dcf5e22b88604f618f467143b2617d66cbb4a03b5b17b790a636ab35f9b04f8578443884b9a28fb8ddf
|
|
7
|
+
data.tar.gz: 9bc2bdd0c4f97a573d637bacdb495557f3aea405a19f7830eeb381f41af4a6e6fec3e5af36b9c0b668709c09374a105d014e355972660cc18ce143f4e7e9d6e7
|
data/Gemfile
CHANGED
|
@@ -108,7 +108,7 @@ module Legion
|
|
|
108
108
|
# Returns Array<Hash{ heading:, heading_slug:, body: }>
|
|
109
109
|
def split_sections(content)
|
|
110
110
|
sections = []
|
|
111
|
-
current = { heading: 'preamble', heading_slug: 'preamble', body:
|
|
111
|
+
current = { heading: 'preamble', heading_slug: 'preamble', body: +'' }
|
|
112
112
|
|
|
113
113
|
content.each_line do |line|
|
|
114
114
|
if line.match?(/\A##\s+/)
|
|
@@ -117,7 +117,7 @@ module Legion
|
|
|
117
117
|
current = {
|
|
118
118
|
heading: heading,
|
|
119
119
|
heading_slug: slugify(heading),
|
|
120
|
-
body:
|
|
120
|
+
body: +''
|
|
121
121
|
}
|
|
122
122
|
else
|
|
123
123
|
current[:body] << line
|
|
@@ -136,7 +136,7 @@ module Legion
|
|
|
136
136
|
in_code_block = false
|
|
137
137
|
|
|
138
138
|
body.each_line do |line|
|
|
139
|
-
if line.
|
|
139
|
+
if line.start_with?('```')
|
|
140
140
|
if in_code_block
|
|
141
141
|
current_item << line
|
|
142
142
|
items << current_item
|
|
@@ -5,8 +5,8 @@ module Legion
|
|
|
5
5
|
module Coldstart
|
|
6
6
|
module Runners
|
|
7
7
|
module Coldstart
|
|
8
|
-
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
|
|
9
|
-
Legion::Extensions::Helpers.const_defined?(:Lex)
|
|
8
|
+
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
|
|
9
|
+
Legion::Extensions::Helpers.const_defined?(:Lex, false)
|
|
10
10
|
|
|
11
11
|
def begin_imprint(**)
|
|
12
12
|
bootstrap.load_firmware
|
|
@@ -40,7 +40,7 @@ module Legion
|
|
|
40
40
|
progress
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def imprint_active?(**)
|
|
43
|
+
def imprint_active?(**)
|
|
44
44
|
active = bootstrap.imprint_active?
|
|
45
45
|
log.debug "[coldstart] imprint_active?=#{active}"
|
|
46
46
|
{ active: active }
|
|
@@ -5,14 +5,14 @@ module Legion
|
|
|
5
5
|
module Coldstart
|
|
6
6
|
module Runners
|
|
7
7
|
module Ingest
|
|
8
|
-
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
|
|
9
|
-
Legion::Extensions::Helpers.const_defined?(:Lex)
|
|
8
|
+
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
|
|
9
|
+
Legion::Extensions::Helpers.const_defined?(:Lex, false)
|
|
10
10
|
|
|
11
|
-
# Ingest a single Claude memory or CLAUDE.md file into
|
|
12
|
-
# If lex-memory is not loaded, returns the parsed traces without storing.
|
|
11
|
+
# Ingest a single Claude memory or CLAUDE.md file into agentic memory traces.
|
|
12
|
+
# If lex-agentic-memory is not loaded, returns the parsed traces without storing.
|
|
13
13
|
#
|
|
14
14
|
# @param file_path [String] absolute path to the markdown file
|
|
15
|
-
# @param store_traces [Boolean] whether to store into
|
|
15
|
+
# @param store_traces [Boolean] whether to store into agentic memory (default: true)
|
|
16
16
|
# @return [Hash] { file:, file_type:, traces_parsed:, traces_stored:, traces: }
|
|
17
17
|
def ingest_file(file_path:, store_traces: true, **)
|
|
18
18
|
unless File.exist?(file_path)
|
|
@@ -39,7 +39,7 @@ module Legion
|
|
|
39
39
|
#
|
|
40
40
|
# @param dir_path [String] absolute path to the directory
|
|
41
41
|
# @param pattern [String] glob pattern (default: '**/{CLAUDE,MEMORY}.md')
|
|
42
|
-
# @param store_traces [Boolean] whether to store into
|
|
42
|
+
# @param store_traces [Boolean] whether to store into agentic memory (default: true)
|
|
43
43
|
# @return [Hash] { directory:, files_found:, total_parsed:, total_stored:, files: }
|
|
44
44
|
def ingest_directory(dir_path:, pattern: '**/{CLAUDE,MEMORY}.md', store_traces: true, **)
|
|
45
45
|
unless Dir.exist?(dir_path)
|
|
@@ -117,18 +117,20 @@ module Legion
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def memory_available?
|
|
120
|
-
Legion::Extensions.const_defined?(:
|
|
121
|
-
Legion::Extensions::
|
|
122
|
-
Legion::Extensions::Memory
|
|
120
|
+
Legion::Extensions.const_defined?(:Agentic, false) &&
|
|
121
|
+
Legion::Extensions::Agentic.const_defined?(:Memory, false) &&
|
|
122
|
+
Legion::Extensions::Agentic::Memory.const_defined?(:Trace, false) &&
|
|
123
|
+
Legion::Extensions::Agentic::Memory::Trace.const_defined?(:Runners, false) &&
|
|
124
|
+
Legion::Extensions::Agentic::Memory::Trace::Runners.const_defined?(:Traces, false)
|
|
123
125
|
end
|
|
124
126
|
|
|
125
127
|
def memory_runner
|
|
126
|
-
@memory_runner ||= Object.new.extend(Legion::Extensions::Memory::Runners::Traces)
|
|
128
|
+
@memory_runner ||= Object.new.extend(Legion::Extensions::Agentic::Memory::Trace::Runners::Traces)
|
|
127
129
|
end
|
|
128
130
|
|
|
129
131
|
def imprint_active_now?
|
|
130
132
|
bootstrap.imprint_active?
|
|
131
|
-
rescue StandardError
|
|
133
|
+
rescue StandardError => _e
|
|
132
134
|
false
|
|
133
135
|
end
|
|
134
136
|
|
|
@@ -10,7 +10,7 @@ require 'legion/extensions/coldstart/runners/ingest'
|
|
|
10
10
|
module Legion
|
|
11
11
|
module Extensions
|
|
12
12
|
module Coldstart
|
|
13
|
-
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
|
|
13
|
+
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
end
|