svc-infra 0.1.625__py3-none-any.whl → 0.1.626__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.
Potentially problematic release.
This version of svc-infra might be problematic. Click here for more details.
- svc_infra/cli/cmds/docs/docs_cmds.py +7 -56
- svc_infra/cli/cmds/help.py +2 -2
- svc_infra/mcp/svc_infra_mcp.py +14 -18
- {svc_infra-0.1.625.dist-info → svc_infra-0.1.626.dist-info}/METADATA +1 -1
- {svc_infra-0.1.625.dist-info → svc_infra-0.1.626.dist-info}/RECORD +7 -7
- {svc_infra-0.1.625.dist-info → svc_infra-0.1.626.dist-info}/WHEEL +0 -0
- {svc_infra-0.1.625.dist-info → svc_infra-0.1.626.dist-info}/entry_points.txt +0 -0
|
@@ -51,29 +51,17 @@ def _discover_pkg_topics() -> Dict[str, Path]:
|
|
|
51
51
|
def _resolve_docs_dir(ctx: click.Context) -> Path | None:
|
|
52
52
|
"""
|
|
53
53
|
Optional override precedence:
|
|
54
|
-
1)
|
|
55
|
-
2)
|
|
56
|
-
3) *Only when working inside the svc-infra repo itself*: repo-root /docs
|
|
54
|
+
1) SVC_INFRA_DOCS_DIR env var
|
|
55
|
+
2) *Only when working inside the svc-infra repo itself*: repo-root /docs
|
|
57
56
|
"""
|
|
58
|
-
# 1)
|
|
59
|
-
current: click.Context | None = ctx
|
|
60
|
-
while current is not None:
|
|
61
|
-
docs_dir_opt = (current.params or {}).get("docs_dir")
|
|
62
|
-
if docs_dir_opt:
|
|
63
|
-
path = docs_dir_opt if isinstance(docs_dir_opt, Path) else Path(docs_dir_opt)
|
|
64
|
-
path = path.expanduser()
|
|
65
|
-
if path.exists():
|
|
66
|
-
return path
|
|
67
|
-
current = current.parent
|
|
68
|
-
|
|
69
|
-
# 2) Env var
|
|
57
|
+
# 1) Env var
|
|
70
58
|
env_dir = os.getenv("SVC_INFRA_DOCS_DIR")
|
|
71
59
|
if env_dir:
|
|
72
60
|
p = Path(env_dir).expanduser()
|
|
73
61
|
if p.exists():
|
|
74
62
|
return p
|
|
75
63
|
|
|
76
|
-
#
|
|
64
|
+
# 2) In-repo convenience (so `svc-infra docs` works inside this repo)
|
|
77
65
|
try:
|
|
78
66
|
root = resolve_project_root()
|
|
79
67
|
proj_docs = root / "docs"
|
|
@@ -130,46 +118,9 @@ def register(app: typer.Typer) -> None:
|
|
|
130
118
|
docs_app = typer.Typer(no_args_is_help=True, add_completion=False, cls=DocsGroup)
|
|
131
119
|
|
|
132
120
|
@docs_app.callback(invoke_without_command=True)
|
|
133
|
-
def _docs_options(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"--docs-dir",
|
|
137
|
-
help="Path to a docs directory to read from (overrides packaged docs)",
|
|
138
|
-
),
|
|
139
|
-
topic: str | None = typer.Option(None, "--topic", help="Topic to show directly"),
|
|
140
|
-
) -> None:
|
|
141
|
-
if topic:
|
|
142
|
-
key = _norm(topic)
|
|
143
|
-
ctx = click.get_current_context()
|
|
144
|
-
dir_to_use = _resolve_docs_dir(ctx)
|
|
145
|
-
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
146
|
-
if key in fs:
|
|
147
|
-
typer.echo(fs[key].read_text(encoding="utf-8", errors="replace"))
|
|
148
|
-
raise typer.Exit(code=0)
|
|
149
|
-
pkg = _discover_pkg_topics()
|
|
150
|
-
if key in pkg:
|
|
151
|
-
typer.echo(pkg[key].read_text(encoding="utf-8", errors="replace"))
|
|
152
|
-
raise typer.Exit(code=0)
|
|
153
|
-
raise typer.BadParameter(f"Unknown topic: {topic}")
|
|
154
|
-
|
|
155
|
-
@docs_app.command("list", help="List available documentation topics")
|
|
156
|
-
def list_topics() -> None:
|
|
157
|
-
ctx = click.get_current_context()
|
|
158
|
-
dir_to_use = _resolve_docs_dir(ctx)
|
|
159
|
-
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
160
|
-
pkg = _discover_pkg_topics()
|
|
161
|
-
|
|
162
|
-
def _print(name: str, path: Path) -> None:
|
|
163
|
-
try:
|
|
164
|
-
typer.echo(f"{name}\t{path}")
|
|
165
|
-
except Exception:
|
|
166
|
-
typer.echo(name)
|
|
167
|
-
|
|
168
|
-
for name, path in fs.items():
|
|
169
|
-
_print(name, path)
|
|
170
|
-
for name, path in pkg.items():
|
|
171
|
-
if name not in fs:
|
|
172
|
-
_print(name, path)
|
|
121
|
+
def _docs_options() -> None:
|
|
122
|
+
# No group-level options; dynamic commands and 'show' handle topics.
|
|
123
|
+
return None
|
|
173
124
|
|
|
174
125
|
@docs_app.command("show", help="Show docs for a topic (alternative to dynamic subcommand)")
|
|
175
126
|
def show(topic: str) -> None:
|
svc_infra/cli/cmds/help.py
CHANGED
|
@@ -23,6 +23,6 @@ Notes:
|
|
|
23
23
|
* You can point `--project-root` at your Alembic root; if omitted we auto-detect.
|
|
24
24
|
|
|
25
25
|
Learn more:
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* Explore available topics: `svc-infra docs --help`
|
|
27
|
+
* Show a topic directly: `svc-infra docs <topic>` or `svc-infra docs show <topic>`
|
|
28
28
|
"""
|
svc_infra/mcp/svc_infra_mcp.py
CHANGED
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
|
|
5
|
-
from ai_infra.llm.tools.custom.cli import cli_cmd_help, cli_subcmd_help
|
|
5
|
+
from ai_infra.llm.tools.custom.cli import cli_cmd_help, cli_subcmd_help
|
|
6
6
|
from ai_infra.mcp.server.tools import mcp_from_functions
|
|
7
7
|
|
|
8
8
|
from svc_infra.app.env import prepare_env
|
|
@@ -20,22 +20,22 @@ async def svc_infra_cmd_help() -> dict:
|
|
|
20
20
|
return await cli_cmd_help(CLI_PROG)
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
"""Run `svc-infra docs list` and return its output.
|
|
23
|
+
# No dedicated 'docs list' function — users can use 'docs --help' to discover topics.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
async def svc_infra_docs_help() -> dict:
|
|
27
|
+
"""
|
|
28
|
+
Run 'svc-infra docs --help' and return its output.
|
|
29
|
+
Prepares the project environment and executes from the repo root so
|
|
30
|
+
environment-provided docs directories and local topics are discoverable.
|
|
27
31
|
"""
|
|
28
32
|
root = prepare_env()
|
|
29
|
-
|
|
30
|
-
text = await run_cli(CLI_PROG, ["docs", "list"], cwd=str(root))
|
|
31
|
-
except TypeError:
|
|
32
|
-
# Fallback for older run_cli signatures
|
|
33
|
-
text = await run_from_root(root, CLI_PROG, ["docs", "list"])
|
|
33
|
+
text = await run_from_root(root, CLI_PROG, ["docs", "--help"])
|
|
34
34
|
return {
|
|
35
35
|
"ok": True,
|
|
36
|
-
"action": "
|
|
36
|
+
"action": "docs_help",
|
|
37
37
|
"project_root": str(root),
|
|
38
|
-
"
|
|
38
|
+
"help": text,
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
|
|
@@ -71,7 +71,7 @@ class Subcommand(str, Enum):
|
|
|
71
71
|
obs_scaffold = "obs scaffold"
|
|
72
72
|
|
|
73
73
|
# Docs group
|
|
74
|
-
|
|
74
|
+
docs_help = "docs --help"
|
|
75
75
|
docs_show = "docs show"
|
|
76
76
|
|
|
77
77
|
# DX group
|
|
@@ -114,12 +114,8 @@ mcp = mcp_from_functions(
|
|
|
114
114
|
functions=[
|
|
115
115
|
svc_infra_cmd_help,
|
|
116
116
|
svc_infra_subcmd_help,
|
|
117
|
-
|
|
118
|
-
#
|
|
119
|
-
# Exposed as a dedicated MCP function for quick discovery in clients.
|
|
120
|
-
# See: svc_infra.cli.cmds.docs.docs_cmds
|
|
121
|
-
# NOTE: Prefer run_cli with cwd=project root; fallback to run_from_root if signature differs.
|
|
122
|
-
# Implemented as an inline wrapper to keep the API surface minimal.
|
|
117
|
+
svc_infra_docs_help,
|
|
118
|
+
# Docs listing is available via 'docs --help'; no separate MCP function needed.
|
|
123
119
|
],
|
|
124
120
|
)
|
|
125
121
|
|
|
@@ -142,10 +142,10 @@ svc_infra/cli/cmds/db/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
142
142
|
svc_infra/cli/cmds/db/sql/alembic_cmds.py,sha256=uCreHg69Zf6B5gbv9Dm39jCRk6q2KQy_05A-75IP0Fg,9650
|
|
143
143
|
svc_infra/cli/cmds/db/sql/sql_export_cmds.py,sha256=YpkguUJFeFApMphVkhOJllTi25ejlsQaJarMe6vJD54,2685
|
|
144
144
|
svc_infra/cli/cmds/db/sql/sql_scaffold_cmds.py,sha256=MKc_T_tY1Y_wQl7XTlq8GhYWMMI1q1_vcFZVPOEcNUg,4601
|
|
145
|
-
svc_infra/cli/cmds/docs/docs_cmds.py,sha256=
|
|
145
|
+
svc_infra/cli/cmds/docs/docs_cmds.py,sha256=kvrBLeAvkv1lx_6TzvY_ciC9NJNBMNbmH0-wzA9LeHo,4501
|
|
146
146
|
svc_infra/cli/cmds/dx/__init__.py,sha256=wQtl3-kOgoESlpVkjl3YFtqkOnQSIvVsOdutiaZFejM,197
|
|
147
147
|
svc_infra/cli/cmds/dx/dx_cmds.py,sha256=XTKUJzS3UIYn6h3CHzDEWKYJaWn0TzGiUCq3OeW27E0,3326
|
|
148
|
-
svc_infra/cli/cmds/help.py,sha256=
|
|
148
|
+
svc_infra/cli/cmds/help.py,sha256=a_U0MbzBTAs4WHO0e8GcdFwLUA8O5mzVXTxpyelhtiU,906
|
|
149
149
|
svc_infra/cli/cmds/jobs/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
150
150
|
svc_infra/cli/cmds/jobs/jobs_cmds.py,sha256=l-w5GuR82GWR_F1CA7WPYAM895XBD8TQj_hZ6retBv0,1252
|
|
151
151
|
svc_infra/cli/cmds/obs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -257,7 +257,7 @@ svc_infra/jobs/redis_queue.py,sha256=wgmWKslF1dkYscJe49UgUX7gwEuGyOUWEb0-pn82I3g
|
|
|
257
257
|
svc_infra/jobs/scheduler.py,sha256=dTUEEyEuTVHNmJT8wPdMu4YjnTN7R_YW67gtCKpqC7M,1180
|
|
258
258
|
svc_infra/jobs/worker.py,sha256=T2A575_mnieJHPOYU_FseubLA_HQf9pB4CkRgzRJBHU,694
|
|
259
259
|
svc_infra/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
260
|
-
svc_infra/mcp/svc_infra_mcp.py,sha256=
|
|
260
|
+
svc_infra/mcp/svc_infra_mcp.py,sha256=ELX4jUOrHa55asCu7q4jhDvfB9EFPNwogqX3fnSa-z0,3489
|
|
261
261
|
svc_infra/obs/README.md,sha256=pmd6AyFZW3GCCi0sr3uTHrPj5KgAI8rrXw8QPkrf1R8,8021
|
|
262
262
|
svc_infra/obs/__init__.py,sha256=t5DgkiuuhHnfAHChzYqCI1-Fpr68iQ0A1nHOLFIlAuM,75
|
|
263
263
|
svc_infra/obs/add.py,sha256=Qa8pswZDxspIn3oniqe8NYeHmVhFwiYOYxF9xNAyCOs,4016
|
|
@@ -325,7 +325,7 @@ svc_infra/webhooks/fastapi.py,sha256=BCNvGNxukf6dC2a4i-6en-PrjBGV19YvCWOot5lXWsA
|
|
|
325
325
|
svc_infra/webhooks/router.py,sha256=6JvAVPMEth_xxHX-IsIOcyMgHX7g1H0OVxVXKLuMp9w,1596
|
|
326
326
|
svc_infra/webhooks/service.py,sha256=hWgiJRXKBwKunJOx91C7EcLUkotDtD3Xp0RT6vj2IC0,1797
|
|
327
327
|
svc_infra/webhooks/signing.py,sha256=NCwdZzmravUe7HVIK_uXK0qqf12FG-_MVsgPvOw6lsM,784
|
|
328
|
-
svc_infra-0.1.
|
|
329
|
-
svc_infra-0.1.
|
|
330
|
-
svc_infra-0.1.
|
|
331
|
-
svc_infra-0.1.
|
|
328
|
+
svc_infra-0.1.626.dist-info/METADATA,sha256=OC4P-US0KYQFiLZZflkU5ndhPHcj4F0RhM1MxK0PBK0,8748
|
|
329
|
+
svc_infra-0.1.626.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
330
|
+
svc_infra-0.1.626.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
|
|
331
|
+
svc_infra-0.1.626.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|