catalog-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Purpose

目的

Update the code module index from AI-generated JSON. Only touches the code modules section of topics.md, not the knowledge files section.
通过AI生成的JSON更新代码模块索引。仅修改topics.md中的代码模块部分,不涉及知识文件部分。

Input

输入

JSON via stdin with schema:
json
{
  "modules": [
    {
      "name": "module-name",
      "summary": "One-line description",
      "files": [
        {"path": "src/file.py", "description": "What this file does"}
      ]
    }
  ]
}
通过标准输入(stdin)传入符合以下 schema 的JSON:
json
{
  "modules": [
    {
      "name": "module-name",
      "summary": "One-line description",
      "files": [
        {"path": "src/file.py", "description": "What this file does"}
      ]
    }
  ]
}

Required Flow

必要流程

bash
memory-hub catalog-update <<'EOF'
<modules JSON>
EOF
Automatically triggers
catalog.repair
after completion.
bash
memory-hub catalog-update <<'EOF'
<modules JSON>
EOF
完成后自动触发
catalog.repair

Output

输出

JSON envelope with
data.modules_written
,
data.modules_deleted
, and repair results.
包含
data.modules_written
data.modules_deleted
以及修复结果的JSON包。

Error Handling

错误处理

  • NO_INPUT
    → no stdin provided
  • INVALID_JSON
    → stdin is not valid JSON
  • INVALID_SCHEMA
    modules
    is not an array
  • NO_INPUT
    → 未提供标准输入
  • INVALID_JSON
    → 标准输入不是有效的JSON
  • INVALID_SCHEMA
    modules
    不是数组