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:
@@ -126,8 +126,6 @@ Knowledge that's project-specific goes under `projects/<name>/`. Knowledge that'
|
||||
| Variable | What it does | Default |
|
||||
|---|---|---|
|
||||
| `OBSIDIAN_SOURCES_DIR` | Directories with docs to ingest (comma-separated) | *(empty — point agent at specific files)* |
|
||||
| `OBSIDIAN_BUSINESS_FACTS_DB` | Optional path for structured business facts such as Kingdee orders | `<vault>/_meta/business-facts.sqlite` |
|
||||
| `.runtime/kingdee.env` | Private local Kingdee sales-order API config created by `scripts/obsidian-wiki-ops.py kingdee config` | official sales-order URL, blank credentials |
|
||||
| `OBSIDIAN_CATEGORIES` | Wiki page categories | `concepts,entities,skills,references,synthesis,journal` |
|
||||
| `OBSIDIAN_MAX_PAGES_PER_INGEST` | Max pages updated per ingest | `15` |
|
||||
| `CLAUDE_HISTORY_PATH` | Where to find Claude data | *auto-discovers from `~/.claude`* |
|
||||
@@ -154,35 +152,9 @@ Knowledge that's project-specific goes under `projects/<name>/`. Knowledge that'
|
||||
| `wiki-update` | Sync current project's knowledge into the vault (works from any project) |
|
||||
| `skill-creator` | Create new skills to extend the framework |
|
||||
|
||||
## Business Facts
|
||||
## Independent order service
|
||||
|
||||
Use the business fact database for exact operational questions, for example monthly order counts or sales amounts. Do not ingest every order line into the wiki. Ask normal questions through `wiki-query`; it will decide when to use structured business facts.
|
||||
|
||||
```bash
|
||||
scripts/obsidian-wiki-ops.py kingdee sync --input ./kingdee-orders.json
|
||||
|
||||
scripts/obsidian-wiki-ops.py kingdee config
|
||||
# Fill .runtime/kingdee.env, then test login/refresh without syncing orders:
|
||||
scripts/obsidian-wiki-ops.py kingdee auth-test
|
||||
|
||||
scripts/obsidian-wiki-ops.py kingdee sync \
|
||||
--start-bizdate 2026-06-01 \
|
||||
--end-bizdate 2026-06-30 \
|
||||
--billstatus C
|
||||
scripts/obsidian-wiki-ops.py kingdee sync --incremental
|
||||
|
||||
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 template sales_amount --vault /path/to/vault --year 2026 --month 6 --json
|
||||
scripts/obsidian-wiki-ops.py kingdee template staff_order_list --vault /path/to/vault --start-date 2026-06-30 --end-date 2026-07-07 --staff 徐丽 --json
|
||||
scripts/obsidian-wiki-ops.py kingdee sql "SELECT COUNT(*) AS order_count FROM orders"
|
||||
|
||||
scripts/obsidian-wiki-ops.py timer install --vault /path/to/vault
|
||||
```
|
||||
|
||||
Without `--input`, the Kingdee sync command creates/reads `.runtime/kingdee.env`, obtains or refreshes an access token, calls the official sales order query API, then stores the fetched JSON response in `<vault>/_meta/business-facts.sqlite`. The private config supports configurable login/token URL, request body, response field paths, refresh URL/body, and required `x-acgw-identity`; fetched tokens are cached in `.runtime/kingdee-token.json`. `.runtime/` is ignored by git.
|
||||
|
||||
The answer reports the statistic, counting basis, data source, and last successful sync time. If the latest successful sync is before today, the answer warns that newer data may be missing. `wiki-query` loads the business schema, chooses a template when one fits, and uses guarded read-only SQL only for gaps. Salesperson templates default to the main salesperson and use `--staff-role-scope all` to include sales 2/3/4 and follow-up roles. The Linux timer uses `systemd --user`, runs daily by default, and syncs incrementally with a 48-hour lookback.
|
||||
Kingdee order queries and synchronization are configured in the separate `kingdee-orders-mcp` project. Wiki setup no longer configures an order database, credentials, or sync timer. See [migration details](docs/business-facts.md).
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
Reference in New Issue
Block a user