agent-import
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent Import — Migration Bundle Loader
Agent导入 — 迁移包加载器
Download and load a migration bundle into this Starchild agent. The bundle is created by another agent using the skill.
agent-export将迁移包下载并加载到本Starchild agent中。该迁移包由另一个agent使用技能创建。
agent-exportQuick Start
快速开始
When user provides a migration code and download token:
1. Run the import script to download & extract
2. Review the extracted data with the user
3. Apply each component using native tools当用户提供迁移代码和下载令牌时:
1. 运行导入脚本进行下载和解压
2. 与用户一起查看解压后的数据
3. 使用原生工具应用每个组件Step 1 — Download & Extract
步骤1 — 下载与解压
The user will provide two values from the source agent: a CODE (8 chars) and a DOWNLOAD_TOKEN.
bash
python3 sc-agent-migration/skills/agent-import/scripts/download.py <CODE> <DOWNLOAD_TOKEN>This downloads from the relay over the public internet — no special network required. The download token authorizes the download; it is single-use and expires with the code (1 hour TTL).
On success the script extracts the bundle to and prints a summary of what's included.
migration/用户将从源agent提供两个值:CODE(8位字符)和DOWNLOAD_TOKEN。
bash
python3 sc-agent-migration/skills/agent-import/scripts/download.py <CODE> <DOWNLOAD_TOKEN>此操作通过公共互联网从relay下载——无需特殊网络。下载令牌用于授权下载;它是一次性的,且会随代码一起过期(TTL为1小时)。
成功后,脚本会将包解压到目录,并打印包含内容的摘要。
migration/Step 2 — Review Contents
步骤2 — 查看内容
Read and summarize what the bundle contains before applying anything:
bash
cat migration/manifest.json
cat migration/memory/agent.json 2>/dev/null
cat migration/memory/user.json 2>/dev/null
cat migration/identity/profile.json 2>/dev/null
cat migration/identity/soul.md 2>/dev/null
cat migration/user/settings.json 2>/dev/null
cat migration/tasks/tasks.json 2>/dev/null
cat migration/env/keys.json 2>/dev/null
find migration/files/ -type f 2>/dev/nullAlways show the user a summary and ask for confirmation before applying.
在应用任何内容之前,先读取并总结包中包含的信息:
bash
cat migration/manifest.json
cat migration/memory/agent.json 2>/dev/null
cat migration/memory/user.json 2>/dev/null
cat migration/identity/profile.json 2>/dev/null
cat migration/identity/soul.md 2>/dev/null
cat migration/user/settings.json 2>/dev/null
cat migration/tasks/tasks.json 2>/dev/null
cat migration/env/keys.json 2>/dev/null
find migration/files/ -type f 2>/dev/null在应用之前,务必向用户展示摘要并请求确认。
Step 3 — Apply Components
步骤3 — 应用组件
Apply each component using Starchild native tools. The order matters:
使用Starchild原生工具应用每个组件。顺序很重要:
3a. User Settings (first — sets timezone/language for everything else)
3a. 用户设置(优先设置——为其他所有内容配置时区/语言)
Read , then call:
migration/user/settings.jsonuser_settings(action="update", settings={
"name": "...",
"what_to_call": "...",
"timezone": "...",
"language": "..."
})Only include fields that are present in the JSON.
读取,然后调用:
migration/user/settings.jsonuser_settings(action="update", settings={
"name": "...",
"what_to_call": "...",
"timezone": "...",
"language": "..."
})仅包含JSON中存在的字段。
3b. Agent Identity
3b. Agent身份信息
Read , then call:
migration/identity/profile.jsonagent_profile(action="update", profile={
"name": "...",
"vibe": "...",
"emoji": "...",
"creature": "..."
})读取,然后调用:
migration/identity/profile.jsonagent_profile(action="update", profile={
"name": "...",
"vibe": "...",
"emoji": "...",
"creature": "..."
})3c. SOUL.md
3c. SOUL.md
If exists, read it and write to .
migration/identity/soul.mdprompt/SOUL.mdMerge with existing SOUL.md if it has content. Don't overwrite platform defaults blindly — integrate the personality bits.
如果存在,读取该文件并写入。
migration/identity/soul.mdprompt/SOUL.md如果已有SOUL.md内容,进行合并。不要盲目覆盖平台默认设置——整合个性相关内容。
3d. Memory — Agent
3d. 记忆 — Agent
Read , for each entry call:
migration/memory/agent.jsonmemory(action="add", target="memory", content="<entry>")⚠️ Memory has a 5000 char limit. If the bundle has many entries, prioritize the most useful ones. Check current usage with first.
memory(action="read")读取,对每个条目调用:
migration/memory/agent.jsonmemory(action="add", target="memory", content="<entry>")⚠️ 记忆有5000字符限制。如果包中有多个条目,优先处理最有用的内容。先使用检查当前使用情况。
memory(action="read")3e. Memory — User
3e. 记忆 — 用户
Read , for each entry call:
migration/memory/user.jsonmemory(action="add", target="user", content="<entry>")⚠️ User memory has a 3000 char limit. Prioritize preferences and corrections.
读取,对每个条目调用:
migration/memory/user.jsonmemory(action="add", target="user", content="<entry>")⚠️ 用户记忆有3000字符限制。优先处理偏好和修正内容。
3f. Tasks
3f. 任务
Read , for each task:
migration/tasks/tasks.jsonscheduled_task(action="register", title=..., schedule=..., description=..., channels=...)- Write the script based on the description
run.py - Test it:
bash("python3 tasks/{job_id}/run.py") scheduled_task(action="activate", job_id=...)
Tasks need actual implementation — the description is a spec, not runnable code. Use your judgment to build each task's script.
读取,对每个任务执行以下操作:
migration/tasks/tasks.jsonscheduled_task(action="register", title=..., schedule=..., description=..., channels=...)- 根据描述编写脚本
run.py - 测试脚本:
bash("python3 tasks/{job_id}/run.py") scheduled_task(action="activate", job_id=...)
任务需要实际实现——描述只是规范,并非可运行代码。请自行判断构建每个任务的脚本。
3g. Environment Keys
3g. 环境密钥
Read , then call:
migration/env/keys.jsonrequest_env_input(env_vars=[...], reason="Migration from <source>")This prompts the user to enter values securely.
读取,然后调用:
migration/env/keys.jsonrequest_env_input(env_vars=[...], reason="Migration from <source>")这会提示用户安全输入值。
3h. Files
3h. 文件
Copy files from to the workspace:
migration/files/bash
cp -r migration/files/* . 2>/dev/nullReview what's being copied and skip anything that would overwrite important existing files.
将中的文件复制到工作区:
migration/files/bash
cp -r migration/files/* . 2>/dev/null检查要复制的内容,跳过任何会覆盖重要现有文件的内容。
Step 4 — Cleanup
步骤4 — 清理
bash
rm -rf migration/ migration-bundle.tar.gzbash
rm -rf migration/ migration-bundle.tar.gzError Handling
错误处理
| Error | Cause | Fix |
|---|---|---|
| Wrong or missing download token | Re-check the token from the source agent output |
| Code already used or never existed | Ask source agent to re-export |
| Code older than 1 hour | Ask source agent to re-export |
| Too many failed attempts | Wait 1 hour |
| Invalid tar.gz | Corrupted upload | Re-export from source agent |
| No manifest.json | Invalid bundle structure | Bundle must have manifest.json at root |
| 错误 | 原因 | 修复方法 |
|---|---|---|
| 下载令牌错误或缺失 | 重新检查源agent输出中的令牌 |
| 代码已被使用或从未存在 | 请求源agent重新导出 |
| 代码已超过1小时 | 请求源agent重新导出 |
| 失败尝试过多 | 等待1小时 |
| Invalid tar.gz | 上传文件损坏 | 从源agent重新导出 |
| No manifest.json | 包结构无效 | 包的根目录必须包含manifest.json |