save-creation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Save creation

保存创作

Push a creative document to OriginMind (
status: saved
). Plans, statements, proposals — not source code.
Server auto-ingests saved creations into Creative DNA (
vector_only
) by deleting the prior Memory Engine document and re-ingesting (one registry row per creation). Do not call a separate project ingest after a successful save.
将创意文档推送到 OriginMind(
status: saved
)。适用于计划、声明、提案等文档,不适用于源代码。
服务器会将已保存的创作自动摄取到 Creative DNA(
vector_only
),方式是删除先前的 Memory Engine 文档并重新摄取(每个创作对应一条注册表记录)。保存成功后,不要调用单独的项目摄取流程。

When to use

何时使用

  • User asks to save, sync, or update a creative document on another device
  • End of a session when the output is a document (not code)
  • 用户要求在另一台设备上保存、同步或更新创意文档
  • 会话结束且输出为文档(而非代码)时

When NOT to use

何时不要使用

  • Source code, configs, tests, or repo implementation
  • User says don't save
  • No API key
  • 源代码、配置、测试或仓库实现
  • 用户明确表示不要保存
  • 没有 API key

API

API

  • Base URL:
    https://api.originmind.ai
  • GET /api/v1/creations?project_id=...
  • GET /api/v1/creations/{id}
  • PATCH /api/v1/creations/{id}
    —
    { "title", "content", "status": "saved" }
  • POST /api/v1/creations
    —
    { "project_id", "title", "content", "status": "saved" }
  • Auth:
    X-OriAI-Api-Key
    or Bearer JWT
  • Base URL:
    https://api.originmind.ai
  • GET /api/v1/creations?project_id=...
  • GET /api/v1/creations/{id}
  • PATCH /api/v1/creations/{id}
    —
    { "title", "content", "status": "saved" }
  • POST /api/v1/creations
    —
    { "project_id", "title", "content", "status": "saved" }
  • 身份验证:
    X-OriAI-Api-Key
    或 Bearer JWT

Bootstrap

初始化

Once per shell:
powershell
. ./skills/create/scripts/bootstrap-originmind-env.ps1
bash
source ./skills/create/scripts/bootstrap-originmind-env.sh
MISSING_KEY
→ one-click OAuth:
. ./skills/create/scripts/setup-oauth.ps1
(or
.sh
), or manually: app.originmind.ai → API key →
.env.local
ORIGINMIND_API_KEY=om_live_...
. Do not Read
.env
in chat.
每个 shell 执行一次:
powershell
. ./skills/create/scripts/bootstrap-originmind-env.ps1
bash
source ./skills/create/scripts/bootstrap-originmind-env.sh
MISSING_KEY
→ 一键 OAuth:
. ./skills/create/scripts/setup-oauth.ps1
(或
.sh
),或手动操作:app.originmind.ai → API key →
.env.local
ORIGINMIND_API_KEY=om_live_...
。不要在聊天中读取
.env
。

Resolve project_id

解析 project_id

  1. User or context names
    proj_...
    or project name →
    GET /api/v1/projects
    .
  2. ORIGINMIND_CREATIVE_DNA_PROJECT_ID
    in env.
  3. Config-based inference (no API call) — read
    .originmind/om_project.config.json
    →
    projects[]
    (or legacy
    defaultProjectId
    ). Score each project's name against the user message + conversation context per search-creative-dna config-based inference. If one is clearly relevant (≥80%), use it.
  4. Else most recently updated project from
    GET /api/v1/projects
    .
  1. 用户或上下文提供
    proj_...
    或项目名称 →
    GET /api/v1/projects
    。
  2. 环境变量
    ORIGINMIND_CREATIVE_DNA_PROJECT_ID
    。
  3. 基于配置推断(无 API 调用)——读取
    .originmind/om_project.config.json
    →
    projects[]
    (或旧版
    defaultProjectId
    )。按照基于配置推断(无 API 调用)中的规则,根据用户消息和对话上下文为每个项目名称评分。如果有一个项目明显相关(≥80%),则使用它。
  4. 否则,使用
    GET /api/v1/projects
    返回的最近更新项目。

Workflow — GET first, then PATCH or POST

工作流——先 GET,再 PATCH 或 POST

  1. Prepare
    title
    and
    content
    (markdown; not a code dump).
  2. GET /api/v1/creations?project_id={project_id}
  3. Candidate among
    saved
    /
    draft
    (not
    finalized
    ): user-named
    id
    , else same title (case-insensitive), else most recently updated match.
  4. Exists:
    GET /api/v1/creations/{id}
    → same content skip; else
    PATCH
    with updated
    title
    /
    content
    /
    status: saved
    .
  5. No match:
    POST /api/v1/creations
    .
  6. Never
    PATCH
    a
    finalized
    row —
    POST
    new or ask user.
  7. Echo creation
    id
    . Do not follow with a separate ingest call.
  1. 准备
    title
    和
    content
    (Markdown;不要直接转储代码)。
  2. GET /api/v1/creations?project_id={project_id}
  3. 在
    saved
    /
    draft
    状态中查找候选项(不包括
    finalized
    ):优先使用用户指定的
    id
    ,其次匹配标题相同且不区分大小写的记录,否则选择最近更新的匹配项。
  4. 存在:
    GET /api/v1/creations/{id}
    → 如果内容相同则跳过;否则使用更新后的
    title
    /
    content
    /
    status: saved
    执行
    PATCH
    。
  5. 没有匹配项: 执行
    POST /api/v1/creations
    。
  6. 绝不要对
    finalized
    记录执行
    PATCH
    ——应执行
    POST
    创建新记录或询问用户。
  7. 回显创作的
    id
    。不要在之后调用单独的摄取流程。

Errors

错误

CodeAction
401New key at app
404Wrong ids
400Finalized — POST new or ask user
402 / 429Stop — https://app.originmind.ai/
代码操作
401在 app 中创建新 key
404ID 错误
400已 finalized——执行
POST
创建新记录或询问用户
402 / 429停止——https://app.originmind.ai/