Manifest 规范

manifest.json 是资产包进入方案网络的技术合同

创作者、买家、Agent、交付服务和本地 runner 都通过 manifest 理解一个资产包是什么、如何运行、需要哪些凭证、会输出什么,以及它能如何作为解决方案组件被复用。Relicex 使用一个统一标准 relicex.pack.v0,通过 kind 区分记忆包、经验包和能力包。

一个统一标准三种 kind方案组件底座

一个标准,三种包类型

不要把记忆包、经验包、能力包理解成三套 manifest。它们都是 relicex.pack.v0,只是 kind 不同。

memory_pack

记忆包:长期记忆、项目历史、偏好、上下文与事实材料。

experience_pack

经验包:流程、方法论、模板、提示词、案例和最佳实践。

capability_pack

能力包:可执行能力、工具、工作流、输入输出 schema 与评估。

它如何连接到解决方案

Manifest 不负责定价或销售,但它让平台知道一个资产包能在方案里承担什么角色。方案页面、checkout 和收益结算会基于这些技术信息解释能力、授权和复用边界。

asset_kind

memory / experience / capability 决定资产包的基础类型。

component_role

方案组合时可用来说明它是数据源、workflow、agent skill、评估、模板或运行能力。

entitlement_policy

购买方案后是否授予独立资产包授权,由 checkout / solution composition 决定。

核心字段

所有包都应该使用相同的顶层字段。listing 的价格、库存、发布状态和 solution 组合关系不属于 manifest;它们属于市场记录、方案记录和 checkout quote。

api_version

固定为 relicex.pack.v0。

kind

memory_pack、experience_pack 或 capability_pack。

id / version

包内稳定标识和版本。

title / description

给用户和 Agent 看的说明。

runtime

可执行包的运行入口;非运行包通常为 null。

files

README、代码、模板、示例和资产索引。

manifest.json
{
  "api_version": "relicex.pack.v0",
  "kind": "capability_pack",
  "id": "my_pack",
  "version": "0.1.0",
  "title": "My Pack",
  "description": "What this pack does.",
  "author": { "name": "creator", "id": "creator_id" },
  "tags": ["capability"],
  "mode": "code",
  "runtime": {
    "kind": "interpreted",
    "profile": "python311-base@1",
    "entry": { "kind": "python", "value": "code/main.py:run" }
  },
  "inputs_schema": { "type": "object" },
  "outputs_schema": { "type": "object" },
  "files": { "readme": "README.md", "code": ["code/main.py"] },
  "secret_requirements": [],
  "secret_groups": [],
  "runtime_permissions": {
    "network": { "required": false, "allow_domains": [] },
    "filesystem": { "reads": ["./inputs"], "writes": ["./outputs", "./artifacts", "./logs", "./tmp"] }
  },
  "redaction": { "enabled": true, "patterns": [] }
}

运行凭证如何声明

包只声明需要什么凭证,不能包含真实 API Key、Token、密码或私钥。最重要的匹配字段是 placement[].name。

这个名字同时用于三处

manifest.secret_requirements[].placement[].name = 用户凭证库里的“凭证名称 / 环境变量名” = runner 注入给子进程的环境变量名。

placement[].nameCredential Vault env_namerunner env
secret_requirements
{
  "secret_requirements": [
    {
      "id": "openai_api_key",
      "label": "OpenAI API Key",
      "provider": "openai",
      "type": "api_key",
      "required": true,
      "sensitive": true,
      "description": "Used by this package to call OpenAI.",
      "placement": [{ "type": "env", "name": "OPENAI_API_KEY" }]
    }
  ]
}
一个凭证 = 一个环境变量名 = 一个真实值。
Direct Resolve 优先按 env_name 完全匹配。
找不到时提示用户新增凭证;找到多个时让用户在包凭证配置页绑定。
provider 和 type 只是元信息和旧数据 fallback,不是主匹配键。

能力包运行时输入输出目录

inputs_schema 和 outputs_schema 是主契约;如果能力包读取用户文件或生成 Markdown、CSV、PDF、图片等非 JSON 产物,就使用统一运行目录,方便 runner、Agent 和用户找到结果。

runtime workspace
relicex_runs/<package_name>_<timestamp>/
├── inputs/
│   ├── input.json
│   └── files/
├── outputs/
│   └── result.json
├── artifacts/
├── logs/
└── tmp/
inputs/input.json 和 outputs/result.json 必须是 JSON object,并分别符合 inputs_schema / outputs_schema。
用户提供的大文件放 inputs/files/,生成的报告、图表、CSV、PDF、图片放 artifacts/。
输出 JSON 只能用相对路径引用 artifact,例如 artifacts/report.md。
禁止绝对路径、~、../ 路径穿越和未脱敏日志。

多个凭证和服务选择

如果一个服务需要多个值,不要新增 credential_bundle 字段。直接声明多个 secret_requirements,并用 secret_groups 表达配置规则。

all_of

all_of 表示这些凭证需要同时配置,例如 BYBIT_API_KEY + BYBIT_API_SECRET。

multiple requirements
{
  "secret_requirements": [
    {
      "id": "bybit_api_key",
      "label": "Bybit API Key",
      "provider": "bybit",
      "type": "api_key",
      "required": true,
      "sensitive": true,
      "placement": [{ "type": "env", "name": "BYBIT_API_KEY" }]
    },
    {
      "id": "bybit_api_secret",
      "label": "Bybit API Secret",
      "provider": "bybit",
      "type": "api_secret",
      "required": true,
      "sensitive": true,
      "placement": [{ "type": "env", "name": "BYBIT_API_SECRET" }]
    }
  ],
  "secret_groups": [
    {
      "id": "bybit_credentials",
      "label": "Bybit API credentials",
      "mode": "all_of",
      "required": true,
      "members": ["bybit_api_key", "bybit_api_secret"]
    }
  ]
}

one_of

one_of 表示用户选择一种服务,例如 OpenAI 或 Anthropic。

provider choices
{
  "secret_groups": [
    {
      "id": "llm_provider",
      "label": "LLM Provider",
      "mode": "one_of",
      "required": true,
      "options": [
        { "id": "openai", "label": "OpenAI", "members": ["openai_api_key"] },
        { "id": "anthropic", "label": "Anthropic", "members": ["anthropic_api_key"] }
      ]
    }
  ]
}

废弃字段和安全边界

旧包可能包含 requires.secret_slots。它只保留兼容,新的包都应该使用 secret_requirements。

active starter templates 不再包含 requires.secret_slots。
如果 secret_requirements 存在,它就是凭证声明的 source of truth。
不要把 price、supply、listing status、publish visibility 写入 manifest。
不要把 .env、.relicex、私钥、cookies 或任何真实凭证打进包里。

Relicex

创作者接下来怎么做?

从 starter template 开始,写好 manifest 后用 relicex_skill validate_pack 检查。