lazyopencode 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl

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.
lazyopencode/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.2.1'
32
- __version_tuple__ = version_tuple = (0, 2, 1)
31
+ __version__ = version = '0.2.3'
32
+ __version_tuple__ = version_tuple = (0, 2, 3)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -73,6 +73,19 @@ class ConfigDiscoveryService:
73
73
  """Path to project's .opencode directory."""
74
74
  return self.project_root / ".opencode"
75
75
 
76
+ def _get_path_variants(self, base_path: Path, singular: str) -> list[Path]:
77
+ """Return both singular and plural path variants that exist.
78
+
79
+ Args:
80
+ base_path: Base directory to check
81
+ singular: Singular form of folder name (e.g., 'command')
82
+
83
+ Returns:
84
+ List of existing paths (both singular and plural if they exist)
85
+ """
86
+ variants = [base_path / singular, base_path / f"{singular}s"]
87
+ return [p for p in variants if p.exists()]
88
+
76
89
  def discover_all(self) -> list[Customization]:
77
90
  """
78
91
  Discover all customizations from global and project levels.
@@ -152,16 +165,13 @@ class ConfigDiscoveryService:
152
165
  self, base_path: Path, level: ConfigLevel
153
166
  ) -> list[Customization]:
154
167
  """Discover command customizations."""
155
- commands_path = base_path / "command"
156
- if not commands_path.exists():
157
- return []
158
-
159
168
  customizations = []
160
169
  parser = self._parsers[CustomizationType.COMMAND]
161
170
 
162
- for md_file in commands_path.glob("*.md"):
163
- if parser.can_parse(md_file):
164
- customizations.append(parser.parse(md_file, level))
171
+ for commands_path in self._get_path_variants(base_path, "command"):
172
+ for md_file in commands_path.glob("*.md"):
173
+ if parser.can_parse(md_file):
174
+ customizations.append(parser.parse(md_file, level))
165
175
 
166
176
  return customizations
167
177
 
@@ -182,16 +192,13 @@ class ConfigDiscoveryService:
182
192
  self, base_path: Path, level: ConfigLevel
183
193
  ) -> list[Customization]:
184
194
  """Discover agent customizations."""
185
- agents_path = base_path / "agent"
186
- if not agents_path.exists():
187
- return []
188
-
189
195
  customizations = []
190
196
  parser = self._parsers[CustomizationType.AGENT]
191
197
 
192
- for md_file in agents_path.glob("*.md"):
193
- if parser.can_parse(md_file):
194
- customizations.append(parser.parse(md_file, level))
198
+ for agents_path in self._get_path_variants(base_path, "agent"):
199
+ for md_file in agents_path.glob("*.md"):
200
+ if parser.can_parse(md_file):
201
+ customizations.append(parser.parse(md_file, level))
195
202
 
196
203
  return customizations
197
204
 
@@ -211,39 +218,72 @@ class ConfigDiscoveryService:
211
218
  def _discover_skills(
212
219
  self, base_path: Path, level: ConfigLevel
213
220
  ) -> list[Customization]:
214
- """Discover skill customizations from .opencode/skill/."""
221
+ """Discover skill customizations from .opencode/skill/ or skills/.
222
+
223
+ Also discovers from agent-compatible paths (.agents/skill[s]/)
224
+ and Claude-compatible paths (.claude/skill[s]/) per OpenCode docs:
225
+ https://opencode.ai/docs/skills/#place-files
226
+ """
215
227
  customizations = []
228
+ parser = self._parsers[CustomizationType.SKILL]
216
229
 
217
- # Discover from standard OpenCode path
218
- skills_path = base_path / "skill"
219
- customizations.extend(self._discover_skills_from_path(skills_path, level))
230
+ # Check both singular and plural variants
231
+ for skills_path in self._get_path_variants(base_path, "skill"):
232
+ for skill_dir in skills_path.iterdir():
233
+ if skill_dir.is_dir():
234
+ skill_file = skill_dir / "SKILL.md"
235
+ if parser.can_parse(skill_file):
236
+ customizations.append(parser.parse(skill_file, level))
220
237
 
221
238
  # Also discover from Claude-compatible path at project level
222
239
  if level == ConfigLevel.PROJECT:
223
- claude_skills_path = self.project_root / ".claude" / "skills"
224
- customizations.extend(
225
- self._discover_skills_from_path(claude_skills_path, level)
226
- )
240
+ for claude_skills_path in self._get_path_variants(
241
+ self.project_root / ".claude", "skill"
242
+ ):
243
+ for skill_dir in claude_skills_path.iterdir():
244
+ if skill_dir.is_dir():
245
+ skill_file = skill_dir / "SKILL.md"
246
+ if parser.can_parse(skill_file):
247
+ customizations.append(parser.parse(skill_file, level))
248
+
249
+ # Discover from agent-compatible paths (.agents/skill[s]/)
250
+ self._discover_skills_from_compat_roots(
251
+ customizations, parser, level, ".agents"
252
+ )
227
253
 
228
254
  return customizations
229
255
 
230
- def _discover_skills_from_path(
231
- self, skills_path: Path, level: ConfigLevel
232
- ) -> list[Customization]:
233
- """Discover skills from a specific directory path."""
234
- if not skills_path.exists():
235
- return []
256
+ def _discover_skills_from_compat_roots(
257
+ self,
258
+ customizations: list[Customization],
259
+ parser: object,
260
+ level: ConfigLevel,
261
+ compat_dir: str,
262
+ ) -> None:
263
+ """Discover skills from a compatibility root directory.
236
264
 
237
- customizations = []
238
- parser = self._parsers[CustomizationType.SKILL]
265
+ At PROJECT level: scans <project_root>/<compat_dir>/skill[s]/*/SKILL.md
266
+ At GLOBAL level: scans ~/<compat_dir>/skill[s]/*/SKILL.md
239
267
 
240
- for skill_dir in skills_path.iterdir():
241
- if skill_dir.is_dir():
242
- skill_file = skill_dir / "SKILL.md"
243
- if parser.can_parse(skill_file):
244
- customizations.append(parser.parse(skill_file, level))
268
+ Args:
269
+ customizations: List to append discovered skills to
270
+ parser: Skill parser instance
271
+ level: Configuration level (GLOBAL or PROJECT)
272
+ compat_dir: Compatibility directory name (e.g., ".agents")
273
+ """
274
+ if level == ConfigLevel.PROJECT:
275
+ compat_base = self.project_root / compat_dir
276
+ else:
277
+ compat_base = Path.home() / compat_dir
245
278
 
246
- return customizations
279
+ for skills_path in self._get_path_variants(compat_base, "skill"):
280
+ for skill_dir in skills_path.iterdir():
281
+ if skill_dir.is_dir():
282
+ skill_file = skill_dir / "SKILL.md"
283
+ if parser.can_parse(skill_file): # type: ignore[attr-defined]
284
+ customizations.append(
285
+ parser.parse(skill_file, level) # type: ignore[attr-defined]
286
+ )
247
287
 
248
288
  def _discover_rules(self, level: ConfigLevel) -> list[Customization]:
249
289
  """Discover AGENTS.md rules files."""
@@ -278,16 +318,13 @@ class ConfigDiscoveryService:
278
318
  self, base_path: Path, level: ConfigLevel
279
319
  ) -> list[Customization]:
280
320
  """Discover tool customizations from .opencode/tool/."""
281
- tools_path = base_path / "tool"
282
- if not tools_path.exists():
283
- return []
284
-
285
321
  customizations = []
286
322
  parser = self._parsers[CustomizationType.TOOL]
287
323
 
288
- for tool_file in tools_path.iterdir():
289
- if tool_file.is_file() and parser.can_parse(tool_file):
290
- customizations.append(parser.parse(tool_file, level))
324
+ for tools_path in self._get_path_variants(base_path, "tool"):
325
+ for tool_file in tools_path.iterdir():
326
+ if tool_file.is_file() and parser.can_parse(tool_file):
327
+ customizations.append(parser.parse(tool_file, level))
291
328
 
292
329
  return customizations
293
330
 
@@ -295,16 +332,13 @@ class ConfigDiscoveryService:
295
332
  self, base_path: Path, level: ConfigLevel
296
333
  ) -> list[Customization]:
297
334
  """Discover plugin customizations from .opencode/plugin/."""
298
- plugins_path = base_path / "plugin"
299
- if not plugins_path.exists():
300
- return []
301
-
302
335
  customizations = []
303
336
  parser = self._parsers[CustomizationType.PLUGIN]
304
337
 
305
- for plugin_file in plugins_path.iterdir():
306
- if plugin_file.is_file() and parser.can_parse(plugin_file):
307
- customizations.append(parser.parse(plugin_file, level))
338
+ for plugins_path in self._get_path_variants(base_path, "plugin"):
339
+ for plugin_file in plugins_path.iterdir():
340
+ if plugin_file.is_file() and parser.can_parse(plugin_file):
341
+ customizations.append(parser.parse(plugin_file, level))
308
342
 
309
343
  return customizations
310
344
 
@@ -23,7 +23,11 @@ class AgentParser(ICustomizationParser):
23
23
 
24
24
  def can_parse(self, path: Path) -> bool:
25
25
  """Check if path is an agent markdown file."""
26
- return path.is_file() and path.suffix == ".md" and path.parent.name == "agent"
26
+ return (
27
+ path.is_file()
28
+ and path.suffix == ".md"
29
+ and path.parent.name in ("agent", "agents")
30
+ )
27
31
 
28
32
  def parse(self, path: Path, level: ConfigLevel) -> Customization:
29
33
  """Parse agent file."""
@@ -23,7 +23,11 @@ class CommandParser(ICustomizationParser):
23
23
 
24
24
  def can_parse(self, path: Path) -> bool:
25
25
  """Check if path is a command markdown file."""
26
- return path.is_file() and path.suffix == ".md" and path.parent.name == "command"
26
+ return (
27
+ path.is_file()
28
+ and path.suffix == ".md"
29
+ and path.parent.name in ("command", "commands")
30
+ )
27
31
 
28
32
  def parse(self, path: Path, level: ConfigLevel) -> Customization:
29
33
  """Parse command file."""
@@ -32,7 +32,7 @@ class PluginParser(ICustomizationParser):
32
32
  return (
33
33
  path.is_file()
34
34
  and path.suffix in self.VALID_EXTENSIONS
35
- and path.parent.name == "plugin"
35
+ and path.parent.name in ("plugin", "plugins")
36
36
  )
37
37
 
38
38
  def parse(self, path: Path, level: ConfigLevel) -> Customization:
@@ -92,10 +92,11 @@ class SkillParser(ICustomizationParser):
92
92
 
93
93
  def can_parse(self, path: Path) -> bool:
94
94
  """Check if path is a SKILL.md file in a skill directory."""
95
+ parent_dir_name = path.parent.parent.name
95
96
  return (
96
97
  path.is_file()
97
98
  and path.name == "SKILL.md"
98
- and path.parent.parent.name == "skill"
99
+ and parent_dir_name in ("skill", "skills")
99
100
  )
100
101
 
101
102
  def parse(self, path: Path, level: ConfigLevel) -> Customization:
@@ -24,7 +24,7 @@ class ToolParser(ICustomizationParser):
24
24
  return (
25
25
  path.is_file()
26
26
  and path.suffix in self.VALID_EXTENSIONS
27
- and path.parent.name == "tool"
27
+ and path.parent.name in ("tool", "tools")
28
28
  )
29
29
 
30
30
  def parse(self, path: Path, level: ConfigLevel) -> Customization:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lazyopencode
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: A lazygit-style TUI for visualizing OpenCode customizations
5
5
  Project-URL: Homepage, https://github.com/nikiforovall/lazyopencode
6
6
  Project-URL: Repository, https://github.com/nikiforovall/lazyopencode
@@ -1,6 +1,6 @@
1
1
  lazyopencode/__init__.py,sha256=roprUA5NQ0OsqJrG-XYGgCJYST5_M3oQNKSVrpDZM1E,1558
2
2
  lazyopencode/__main__.py,sha256=8sGwTbHrRZyACIYWqpMRP76sq7fTBeJSj-VOAd6hUKE,120
3
- lazyopencode/_version.py,sha256=vYqoJTG51NOUmYyL0xt8asRK8vUT4lGAdal_EZ59mvw,704
3
+ lazyopencode/_version.py,sha256=kBRz0P2plw1eVdIpt70W6m1LMbEIhLY3RyOfVGdubaI,704
4
4
  lazyopencode/app.py,sha256=L7fpKK8VO7NduLvdgGQlROAfxo7O7D_RpVtxCXgICq8,18137
5
5
  lazyopencode/bindings.py,sha256=nIcMU77LxjQQ2YsitSdmcODP9e3UGHqZyc8NCnTFQ4s,1394
6
6
  lazyopencode/themes.py,sha256=9KsyWlk9XeAupAdUTj785riWuDlQMnERjD8DUzogCPc,713
@@ -10,7 +10,7 @@ lazyopencode/mixins/navigation.py,sha256=RHA5J9Wn9nYjDmRglMagvn94OFTti8q3yuYI6bN
10
10
  lazyopencode/models/__init__.py,sha256=X2Wlkc6IS1nQF0JNTvqZNNLh6YI1SH-D5YP4xpWL-rc,298
11
11
  lazyopencode/models/customization.py,sha256=4Vu2lCaRT5icdzx01A83camsdOSVlu0t-q3CF9Tkt2A,4453
12
12
  lazyopencode/services/__init__.py,sha256=aCVZJecnMeupVU-T6EhR34dFu295XwJP9dqZ8MKWOJE,146
13
- lazyopencode/services/discovery.py,sha256=w7qv_Sk83zpmEZJnP1HCM8JxaJDHqyQE59zQP3prrJc,13510
13
+ lazyopencode/services/discovery.py,sha256=UeeXkPlHzyVs9w8w42Nqp0_idxtKxykg8xZiJN2d2I0,15555
14
14
  lazyopencode/services/gitignore_filter.py,sha256=9QFKrUsSm0kSSYXzJ3_Zx440Pk1T6CSo6eaoPP5Pthk,3155
15
15
  lazyopencode/services/writer.py,sha256=B9XZor9VH28P3Fo6sQ2HhT1Tj1eDq7Pcc8i-YpkYoGg,5328
16
16
  lazyopencode/services/claude_code/__init__.py,sha256=lMcoJR-x2eHR6ddvL3YbYT4xonGjKKFUdHwjBwEcaNg,310
@@ -21,13 +21,13 @@ lazyopencode/services/claude_code/parsers/agent.py,sha256=YeqmBinlqViAWb2FGxnsAn
21
21
  lazyopencode/services/claude_code/parsers/command.py,sha256=E8H0X0lMaEzT2PIpNQKhtydf3chw7NKzNh-F9B121Cw,2429
22
22
  lazyopencode/services/claude_code/parsers/skill.py,sha256=nD7JxkJW_hHrvA0Nfb5t7OKx4p1TBIdlfn90-KfGVak,3805
23
23
  lazyopencode/services/parsers/__init__.py,sha256=zav6eIpqF5TGFp2jlGSOFZtCicHyltA--cVMycox9M0,4344
24
- lazyopencode/services/parsers/agent.py,sha256=zaw8y3RZsPFOu8DsoM3b2XPGzp0BnQJcbx86mEIYUxM,2885
25
- lazyopencode/services/parsers/command.py,sha256=-Mg3sq_4TLkIvXKzIX4lB7KvU0e4T0TA-5lpwhcUgBE,2977
24
+ lazyopencode/services/parsers/agent.py,sha256=mRbNeUttKUEwos63L6kA4_75MnO4RYrD8-HYDSOIN5M,2945
25
+ lazyopencode/services/parsers/command.py,sha256=fNAEhfQiXUw5_bT6xjm2qYyQwZhz_1Fgt1keP8RC3UI,3039
26
26
  lazyopencode/services/parsers/mcp.py,sha256=4C5LoXE82KOG7e-hoS12U-0MSDiyPjPAHKE4EmOlaIE,2127
27
- lazyopencode/services/parsers/plugin.py,sha256=7J-z7-5iOnk64iYxDPiVV9ak013KKJQhdjolBn43z7A,4014
27
+ lazyopencode/services/parsers/plugin.py,sha256=qIl5n8EbZDJn6MQOPPndjlG3VfRbHMJM25xsTI1BqGs,4027
28
28
  lazyopencode/services/parsers/rules.py,sha256=D92lCK_UHnVAeXV4W-lVX5kztwQY9gPEaJQgWp2exBo,2053
29
- lazyopencode/services/parsers/skill.py,sha256=WMKIv1HJSdx0vt0KJ9YtQ0oB1G5GOOC_smnBPynx7s8,4062
30
- lazyopencode/services/parsers/tool.py,sha256=sL3N63cim68R_wo5s0WONnnnvYxrK-tyiGCIc7guMV0,1800
29
+ lazyopencode/services/parsers/skill.py,sha256=ink4nab0CoanzPp8iktYZByg5cU88mbL6R4fCmqkJuE,4116
30
+ lazyopencode/services/parsers/tool.py,sha256=m6PQZCTcqVQleMF2xYSdZkEzf3VR_Pr5OXHthIzfooY,1811
31
31
  lazyopencode/styles/app.tcss,sha256=fAAWxQ7ePJ7oYfMUoU3ffC3PfJ9hGocHhPF7nNMf-qU,2658
32
32
  lazyopencode/widgets/__init__.py,sha256=syhZGjXKhKjg75iSU1xgRqiRWV-S-Jh8ipd0g1-qkMs,497
33
33
  lazyopencode/widgets/app_footer.py,sha256=K5qf_KhY6njSh8UXTtn7LahnACzMuNnhRlfzGBu2E7U,2478
@@ -40,8 +40,8 @@ lazyopencode/widgets/status_panel.py,sha256=k4lx4GrHlVUvt6t32_bz2WOWvZdPNawdSMhm
40
40
  lazyopencode/widgets/type_panel.py,sha256=wg2D5diKvdrwco7pvcUnF9WPOgTveiH1qt0O82gkqa4,19313
41
41
  lazyopencode/widgets/helpers/__init__.py,sha256=-jGrYtTMl9rmX8Q5Vod_oAuYaMl6Yh5JRwv8AFKQcwk,135
42
42
  lazyopencode/widgets/helpers/rendering.py,sha256=lgxzVsnH6fgTZss2x4n8hKYYtDN35YmFMD83impkpH8,576
43
- lazyopencode-0.2.1.dist-info/METADATA,sha256=n_xtbwjR_Xdtg0HovrurySD2iP3x43uQlL8dpM3kPp4,4243
44
- lazyopencode-0.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
45
- lazyopencode-0.2.1.dist-info/entry_points.txt,sha256=PPVT4NhHce2hFuMj-NQTSN9xQIM2jwb0_ojMEcOpPJ0,60
46
- lazyopencode-0.2.1.dist-info/licenses/LICENSE,sha256=KY9Pw3pDaLTe2eiMvUoj09VHhE3i8N1Le0d01JrG_3Q,1069
47
- lazyopencode-0.2.1.dist-info/RECORD,,
43
+ lazyopencode-0.2.3.dist-info/METADATA,sha256=kAmDDpZ_0GxA2RXHLvp_H-pWDZ4EYtB2n1uGLiK9Qho,4243
44
+ lazyopencode-0.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
45
+ lazyopencode-0.2.3.dist-info/entry_points.txt,sha256=PPVT4NhHce2hFuMj-NQTSN9xQIM2jwb0_ojMEcOpPJ0,60
46
+ lazyopencode-0.2.3.dist-info/licenses/LICENSE,sha256=KY9Pw3pDaLTe2eiMvUoj09VHhE3i8N1Le0d01JrG_3Q,1069
47
+ lazyopencode-0.2.3.dist-info/RECORD,,