feat: major architectural refactor to 5.1b1 - Service Layer, gRPC & Agent evolution (fragmented secrets)

This commit is contained in:
2026-04-17 18:42:08 -03:00
parent 85b23526cd
commit cb926c2b85
123 changed files with 38189 additions and 4640 deletions
+6 -182
View File
@@ -64,7 +64,7 @@ el.replaceWith(d);
subdir = tmp_path / "subdir"
subdir.mkdir()
result = _getcwd(["run", "run"], "run")
result = get_cwd(["run", "run"])
# Should list files
assert any("file1.txt" in r for r in result)
assert any("subdir/" in r for r in result)
@@ -75,7 +75,7 @@ el.replaceWith(d);
(tmp_path / "script.yaml").touch()
(tmp_path / "script2.yaml").touch()
result = _getcwd(["run", "script"], "run")
result = get_cwd(["run", "script"])
assert any("script" in r for r in result)
def test_folder_only(self, tmp_path, monkeypatch):
@@ -85,7 +85,7 @@ el.replaceWith(d);
subdir = tmp_path / "mydir"
subdir.mkdir()
result = _getcwd(["export", "export"], "export", folderonly=True)
result = get_cwd(["export", "export"], folderonly=True)
files_in_result = [r for r in result if "file.txt" in r]
assert len(files_in_result) == 0
dirs_in_result = [r for r in result if "mydir" in r]
@@ -110,7 +110,7 @@ el.replaceWith(d);
subdir = tmp_path / "subdir"
subdir.mkdir()
result = _getcwd(["run", "run"], "run")
result = get_cwd(["run", "run"])
# Should list files
assert any("file1.txt" in r for r in result)
assert any(&#34;subdir/&#34; in r for r in result)</code></pre>
@@ -132,7 +132,7 @@ el.replaceWith(d);
subdir = tmp_path / &#34;mydir&#34;
subdir.mkdir()
result = _getcwd([&#34;export&#34;, &#34;export&#34;], &#34;export&#34;, folderonly=True)
result = get_cwd([&#34;export&#34;, &#34;export&#34;], folderonly=True)
files_in_result = [r for r in result if &#34;file.txt&#34; in r]
assert len(files_in_result) == 0
dirs_in_result = [r for r in result if &#34;mydir&#34; in r]
@@ -154,179 +154,13 @@ el.replaceWith(d);
(tmp_path / &#34;script.yaml&#34;).touch()
(tmp_path / &#34;script2.yaml&#34;).touch()
result = _getcwd([&#34;run&#34;, &#34;script&#34;], &#34;run&#34;)
result = get_cwd([&#34;run&#34;, &#34;script&#34;])
assert any(&#34;script&#34; in r for r in result)</code></pre>
</details>
<div class="desc"><p>Lists files matching a partial path.</p></div>
</dd>
</dl>
</dd>
<dt id="connpy.tests.test_completion.TestGetPlugins"><code class="flex name class">
<span>class <span class="ident">TestGetPlugins</span></span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class TestGetPlugins:
def test_get_plugins_disable(self, tmp_path):
&#34;&#34;&#34;--disable returns enabled plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--disable&#34;, str(tmp_path))
assert &#34;active&#34; in result
assert &#34;disabled&#34; not in result
def test_get_plugins_enable(self, tmp_path):
&#34;&#34;&#34;--enable returns disabled plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--enable&#34;, str(tmp_path))
assert &#34;disabled&#34; in result
assert &#34;active&#34; not in result
def test_get_plugins_del(self, tmp_path):
&#34;&#34;&#34;--del returns all plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--del&#34;, str(tmp_path))
assert &#34;active&#34; in result
assert &#34;disabled&#34; in result
def test_get_plugins_all(self, tmp_path):
&#34;&#34;&#34;&#39;all&#39; returns dict with paths.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;myplugin.py&#34;).touch()
result = _get_plugins(&#34;all&#34;, str(tmp_path))
assert isinstance(result, dict)
assert &#34;myplugin&#34; in result
def test_get_plugins_empty_dir(self, tmp_path):
&#34;&#34;&#34;Empty plugins directory returns empty list.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
result = _get_plugins(&#34;--disable&#34;, str(tmp_path))
assert result == []</code></pre>
</details>
<div class="desc"></div>
<h3>Methods</h3>
<dl>
<dt id="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_all"><code class="name flex">
<span>def <span class="ident">test_get_plugins_all</span></span>(<span>self, tmp_path)</span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def test_get_plugins_all(self, tmp_path):
&#34;&#34;&#34;&#39;all&#39; returns dict with paths.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;myplugin.py&#34;).touch()
result = _get_plugins(&#34;all&#34;, str(tmp_path))
assert isinstance(result, dict)
assert &#34;myplugin&#34; in result</code></pre>
</details>
<div class="desc"><p>'all' returns dict with paths.</p></div>
</dd>
<dt id="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_del"><code class="name flex">
<span>def <span class="ident">test_get_plugins_del</span></span>(<span>self, tmp_path)</span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def test_get_plugins_del(self, tmp_path):
&#34;&#34;&#34;--del returns all plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--del&#34;, str(tmp_path))
assert &#34;active&#34; in result
assert &#34;disabled&#34; in result</code></pre>
</details>
<div class="desc"><p>&ndash;del returns all plugins.</p></div>
</dd>
<dt id="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_disable"><code class="name flex">
<span>def <span class="ident">test_get_plugins_disable</span></span>(<span>self, tmp_path)</span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def test_get_plugins_disable(self, tmp_path):
&#34;&#34;&#34;--disable returns enabled plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--disable&#34;, str(tmp_path))
assert &#34;active&#34; in result
assert &#34;disabled&#34; not in result</code></pre>
</details>
<div class="desc"><p>&ndash;disable returns enabled plugins.</p></div>
</dd>
<dt id="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_empty_dir"><code class="name flex">
<span>def <span class="ident">test_get_plugins_empty_dir</span></span>(<span>self, tmp_path)</span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def test_get_plugins_empty_dir(self, tmp_path):
&#34;&#34;&#34;Empty plugins directory returns empty list.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
result = _get_plugins(&#34;--disable&#34;, str(tmp_path))
assert result == []</code></pre>
</details>
<div class="desc"><p>Empty plugins directory returns empty list.</p></div>
</dd>
<dt id="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_enable"><code class="name flex">
<span>def <span class="ident">test_get_plugins_enable</span></span>(<span>self, tmp_path)</span>
</code></dt>
<dd>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def test_get_plugins_enable(self, tmp_path):
&#34;&#34;&#34;--enable returns disabled plugins.&#34;&#34;&#34;
plugin_dir = tmp_path / &#34;plugins&#34;
plugin_dir.mkdir()
(plugin_dir / &#34;active.py&#34;).touch()
(plugin_dir / &#34;disabled.py.bkp&#34;).touch()
result = _get_plugins(&#34;--enable&#34;, str(tmp_path))
assert &#34;disabled&#34; in result
assert &#34;active&#34; not in result</code></pre>
</details>
<div class="desc"><p>&ndash;enable returns disabled plugins.</p></div>
</dd>
</dl>
</dd>
<dt id="connpy.tests.test_completion.TestLoadTxtCache"><code class="flex name class">
<span>class <span class="ident">TestLoadTxtCache</span></span>
</code></dt>
@@ -411,16 +245,6 @@ el.replaceWith(d);
</ul>
</li>
<li>
<h4><code><a title="connpy.tests.test_completion.TestGetPlugins" href="#connpy.tests.test_completion.TestGetPlugins">TestGetPlugins</a></code></h4>
<ul class="">
<li><code><a title="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_all" href="#connpy.tests.test_completion.TestGetPlugins.test_get_plugins_all">test_get_plugins_all</a></code></li>
<li><code><a title="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_del" href="#connpy.tests.test_completion.TestGetPlugins.test_get_plugins_del">test_get_plugins_del</a></code></li>
<li><code><a title="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_disable" href="#connpy.tests.test_completion.TestGetPlugins.test_get_plugins_disable">test_get_plugins_disable</a></code></li>
<li><code><a title="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_empty_dir" href="#connpy.tests.test_completion.TestGetPlugins.test_get_plugins_empty_dir">test_get_plugins_empty_dir</a></code></li>
<li><code><a title="connpy.tests.test_completion.TestGetPlugins.test_get_plugins_enable" href="#connpy.tests.test_completion.TestGetPlugins.test_get_plugins_enable">test_get_plugins_enable</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="connpy.tests.test_completion.TestLoadTxtCache" href="#connpy.tests.test_completion.TestLoadTxtCache">TestLoadTxtCache</a></code></h4>
<ul class="">
<li><code><a title="connpy.tests.test_completion.TestLoadTxtCache.test_load_existing_cache" href="#connpy.tests.test_completion.TestLoadTxtCache.test_load_existing_cache">test_load_existing_cache</a></code></li>