refactor(mcp): extract order services into independent project

Remove Kingdee sync, business CLI/MCP tools, and internal order-query routing
now owned by the separate kingdee-orders-mcp project. Keep Wiki retrieval,
file assets and ingest available in code while its deployed service is off.
Retain legacy response fields with business access disabled, and document
migration ownership and rollback without exposing credentials or data.

Validation: 174 Wiki tests pass. Independent order service verified with
36 template parity checks, authenticated HTTP queries, and a real sync.
This commit is contained in:
Codex
2026-10-31 07:41:18 +00:00
parent 6c451c3eb6
commit 2396bd2d3e
25 changed files with 47 additions and 5793 deletions
-62
View File
@@ -18,7 +18,6 @@ for path in (REPO_ROOT, SCRIPT_DIR):
from obsidian_wiki.cli import main as obsidian_cli_main
import manage_business_sync
import manage_mcp_service
@@ -31,18 +30,6 @@ Usage:
scripts/obsidian-wiki-ops.py info
scripts/obsidian-wiki-ops.py file-index rebuild [args...]
scripts/obsidian-wiki-ops.py kingdee config [args...]
scripts/obsidian-wiki-ops.py kingdee auth-test [args...]
scripts/obsidian-wiki-ops.py kingdee sync [args...]
scripts/obsidian-wiki-ops.py kingdee schema --json
scripts/obsidian-wiki-ops.py kingdee template order_count --vault /path/to/vault --year 2026 --month 6 --json
scripts/obsidian-wiki-ops.py kingdee sql "SELECT COUNT(*) FROM orders" [args...]
scripts/obsidian-wiki-ops.py timer install [args...]
scripts/obsidian-wiki-ops.py timer run-now [args...]
scripts/obsidian-wiki-ops.py timer status
scripts/obsidian-wiki-ops.py timer stop
scripts/obsidian-wiki-ops.py timer uninstall [args...]
scripts/obsidian-wiki-ops.py mcp start [args...]
scripts/obsidian-wiki-ops.py mcp tools list
@@ -53,7 +40,6 @@ Usage:
scripts/obsidian-wiki-ops.py daily-update [args...]
Notes:
timer install is an alias for installing and starting the Kingdee business sync timer.
Use --help after any forwarded command to see that command's detailed options.
"""
@@ -63,7 +49,6 @@ CLI_COMMANDS = {
"list",
"info",
"file-index",
"business",
"mcp-server",
"bot-view",
}
@@ -80,49 +65,6 @@ def run_script(script_name: str, args: Sequence[str]) -> int:
return int(completed.returncode)
def route_kingdee(args: Sequence[str]) -> int:
if not args:
return print_help()
action, *rest = args
if action == "config":
return obsidian_cli_main(["business", "config", "kingdee", *rest])
if action == "auth-test":
return obsidian_cli_main(["business", "sync", "kingdee", "--dry-run-auth", *rest])
if action == "sync":
return obsidian_cli_main(["business", "sync", "kingdee", *rest])
if action == "schema":
return obsidian_cli_main(["business", "schema", *rest])
if action == "template":
return obsidian_cli_main(["business", "template", *rest])
if action == "query":
return obsidian_cli_main(["business", "query", *rest])
if action == "sql":
return obsidian_cli_main(["business", "sql", *rest])
print(f"Unknown kingdee action: {action}", file=sys.stderr)
return 2
def route_timer(args: Sequence[str]) -> int:
if not args:
return print_help()
action, *rest = args
action_aliases = {
"install": "start",
"start": "start",
"run": "run-now",
"now": "run-now",
"run-now": "run-now",
"status": "status",
"stop": "stop",
"uninstall": "uninstall",
}
mapped = action_aliases.get(action)
if mapped is None:
print(f"Unknown timer action: {action}", file=sys.stderr)
return 2
return manage_business_sync.main([mapped, *rest])
def main(argv: Sequence[str] | None = None) -> int:
args = list(sys.argv[1:] if argv is None else argv)
if not args or args[0] in {"help", "-h", "--help"}:
@@ -131,10 +73,6 @@ def main(argv: Sequence[str] | None = None) -> int:
command, *rest = args
if command in CLI_COMMANDS:
return obsidian_cli_main([command, *rest])
if command == "kingdee":
return route_kingdee(rest)
if command == "timer":
return route_timer(rest)
if command == "mcp":
return manage_mcp_service.main(rest)
if command == "daily-update":