{
  "schemaVersion": 2,
  "id": "@forgeax-extension/ai-asset",
  "version": "0.1.5",
  "displayName": {
    "zh": "AI 小物件低模生成",
    "en": "AI Asset Lowpoly Generator"
  },
  "description": {
    "zh": "经 LiteLLM 网关驱动 Meshy 的 AI 小物件 3D 低模资产生成：文/图/多图 → lowpoly mesh → (可选 refine PBR 纹理) → (可选 remesh 降面) → glb → 落盘游戏可用资产。区别于 3d-lowpoly（程序化 CAD）。",
    "en": "LiteLLM-gateway-driven Meshy generator for small 3D lowpoly props: text/image/multi-image → lowpoly mesh → (optional refine PBR) → (optional remesh) → glb → durable game asset. Distinct from 3d-lowpoly (programmatic CAD)."
  },
  "author": {
    "name": "forgeax",
    "email": "dev@forgeax.local"
  },
  "icon": "Package",
  "keywords": [
    "meshy",
    "lowpoly",
    "ai",
    "asset",
    "props",
    "glb",
    "3d",
    "generation"
  ],
  "entry": {
    "backend": "./server/tool-handlers.ts",
    "frontend": "./dist/index.html",
    "standalone": {
      "start": "npm run dev",
      "port": 15190,
      "readyProbe": "/",
      "dev": {
        "watch": true,
        "hmr": true
      },
      "embeddedAlso": true,
      "devOnly": false
    }
  },
  "permissions": [],
  "hot": false,
  "experimental": true,
  "compatibleWith": {
    "forgeax-bus": "^1.0.0"
  },
  "contributes": {
    "panelTypes": [
      {
        "id": "ai-asset.content",
        "runtime": "iframe",
        "entry": "./dist/index.html"
      }
    ],
    "pages": [
      {
        "id": "ai-asset",
        "title": {
          "zh": "AI 小物件低模生成",
          "en": "AI Asset Lowpoly Generator"
        },
        "icon": "Package",
        "cardinality": "singleton",
        "restorePolicy": "project",
        "layout": {
          "version": 2,
          "root": {
            "kind": "split",
            "direction": "horizontal",
            "sizes": [
              320,
              840
            ],
            "children": [
              {
                "kind": "tabs",
                "placements": [
                  "sidebar"
                ],
                "active": "sidebar"
              },
              {
                "kind": "tabs",
                "placements": [
                  "workspace"
                ],
                "active": "workspace"
              }
            ]
          }
        },
        "layoutVersion": 2,
        "panels": [
          {
            "id": "sidebar",
            "panelType": {
              "extension": "self",
              "id": "ai-asset.content"
            },
            "initialProps": {
              "pane": "left",
              "width": 320,
              "scrollable": true
            }
          },
          {
            "id": "workspace",
            "panelType": {
              "extension": "self",
              "id": "ai-asset.content"
            },
            "initialProps": {
              "pane": "center",
              "minHeight": 600,
              "scrollable": true
            }
          }
        ],
        "matchProduces": [
          "**/.forgeax/games/*/assets/3d/props/**/*.glb"
        ],
        "preferredAgent": "@forgeax-extension/agent-ai-asset"
      }
    ],
    "activities": [
      {
        "id": "ai-asset.launcher",
        "title": {
          "zh": "AI 小物件低模生成",
          "en": "AI Asset Lowpoly Generator"
        },
        "icon": "Package",
        "order": 158,
        "category": "general",
        "pageType": {
          "extension": "self",
          "id": "ai-asset"
        }
      }
    ],
    "tools": [
      {
        "id": "aiasset:provider-status",
        "args": "./schemas/provider-status.args.json",
        "returns": "./schemas/provider-status.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "读取 Meshy 网关配置 + COS 状态（网关无余额端点）；返回静态、无配额数据。",
          "en": "Read Meshy gateway config + COS state (gateway has no balance endpoint). Static, no quota."
        }
      },
      {
        "id": "aiasset:text-to-3d",
        "args": "./schemas/text-to-3d.args.json",
        "returns": "./schemas/text-to-3d.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "文生低模（默认 precise-lowpoly：standard 生成 → 减面到目标面数 → 可选 PBR 重贴图）→ 落盘持久 manifest。未配置 Meshy 时回退确定性 mock。",
          "en": "Text-to-lowpoly (default precise-lowpoly: standard generate → remesh to target → optional PBR retexture) → durable manifest. Mock fallback when Meshy unconfigured."
        }
      },
      {
        "id": "aiasset:image-to-3d",
        "args": "./schemas/image-to-3d.args.json",
        "returns": "./schemas/image-to-3d.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "图生低模（默认 precise-lowpoly 管线, 单图, 需 COS 中转）→ 落盘持久 manifest。",
          "en": "Image-to-lowpoly (default precise-lowpoly pipeline, single image, COS relay) → durable manifest."
        }
      },
      {
        "id": "aiasset:multi-image-to-3d",
        "args": "./schemas/multi-image-to-3d.args.json",
        "returns": "./schemas/multi-image-to-3d.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "多视角生低模（默认 precise-lowpoly 管线, 多图, 需 COS 中转）→ 落盘持久 manifest。",
          "en": "Multi-image-to-lowpoly (default precise-lowpoly pipeline, multi-view, COS relay) → durable manifest."
        }
      },
      {
        "id": "aiasset:refine",
        "args": "./schemas/refine.args.json",
        "returns": "./schemas/refine.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "给 preview 低模加 PBR 纹理（Meshy text-to-3d mode:refine）→ 新持久 manifest。",
          "en": "Add PBR texture to a preview lowpoly (Meshy text-to-3d mode:refine) → new durable manifest."
        }
      },
      {
        "id": "aiasset:retexture",
        "args": "./schemas/retexture.args.json",
        "returns": "./schemas/retexture.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "给已有模型换风格 PBR 纹理（Meshy retexture）→ 新持久 manifest。",
          "en": "Restyle an existing model with PBR texture (Meshy retexture) → new durable manifest."
        }
      },
      {
        "id": "aiasset:remesh",
        "args": "./schemas/remesh.args.json",
        "returns": "./schemas/remesh.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "对已有 Meshy 任务结果重拓扑降面到 target polycount（Meshy remesh）→ 新持久 manifest。",
          "en": "Remesh an existing Meshy task result to target polycount (Meshy remesh) → new durable manifest."
        }
      },
      {
        "id": "aiasset:upload-image",
        "args": "./schemas/upload-image.args.json",
        "returns": "./schemas/upload-image.returns.json",
        "exposedToAI": false,
        "description": {
          "zh": "本地图片上传 COS（中转产物,非资产）→ 24h presigned URL 供 Meshy URL-fetch。未配置 COS 报 cos_not_configured。",
          "en": "Upload local image to COS (transfer artifact, NOT an asset) → 24h presigned URL for Meshy URL-fetch. Errors cos_not_configured if COS unset."
        }
      },
      {
        "id": "aiasset:list-assets",
        "args": "./schemas/list-assets.args.json",
        "returns": "./schemas/list-assets.returns.json",
        "exposedToAI": true,
        "description": {
          "zh": "列出当前游戏已生成的 props 3D 资产 manifest。",
          "en": "List the active game's generated props 3D asset manifests."
        }
      },
      {
        "id": "aiasset:engine-import-status",
        "args": "./schemas/engine-import-status.args.json",
        "returns": "./schemas/engine-import-status.returns.json",
        "exposedToAI": false,
        "description": {
          "zh": "只读：查询该资产的引擎身份证是否存在且对应当前 GLB 内容。",
          "en": "Read-only: check whether the engine identity meta exists and matches the current GLB content."
        }
      },
      {
        "id": "aiasset:import-to-engine",
        "args": "./schemas/import-to-engine.args.json",
        "returns": "./schemas/import-to-engine.returns.json",
        "exposedToAI": false,
        "description": {
          "zh": "导入到游戏：必要时规范化 Draco → 办/重办引擎身份证，使 Edit 资产面板认得出。",
          "en": "Import to Game: normalize Draco if needed → cook/re-cook engine identity meta so the Edit asset panel recognizes it."
        }
      },
      {
        "id": "aiasset:get-credentials",
        "args": "./schemas/get-credentials.args.json",
        "returns": "./schemas/get-credentials.returns.json",
        "exposedToAI": false,
        "description": {
          "zh": "读取网关 + COS 凭证掩码配置状态（网关 key 由 Studio 设置统一管理，不返回明文）。",
          "en": "Read masked gateway + COS credential state (gateway key managed in Studio Settings; no plaintext)."
        }
      },
      {
        "id": "aiasset:set-credentials",
        "args": "./schemas/set-credentials.args.json",
        "returns": "./schemas/set-credentials.returns.json",
        "exposedToAI": false,
        "requireConfirm": "destructive",
        "description": {
          "zh": "写入/更新 COS 凭证 + 总开关到插件本地 .env 并即时生效（Meshy 网关 key 由 Studio 设置统一管理，此处不可写）。",
          "en": "Write/update COS credentials + master switch to plugin-local .env, applied live. The Meshy gateway key is managed in Studio Settings and is not writable here."
        }
      }
    ],
    "events": [
      {
        "name": "aiasset.provider.status-read"
      },
      {
        "name": "aiasset.assets.listed"
      },
      {
        "name": "aiasset.asset.generated"
      }
    ]
  }
}
