360 Secure SkillHub
360 安全技能中心

Aicoo Snapshots

该 Skill 面向笔记版本管理,使用 curl 调用 Aicoo OS 的快照接口,支持为指定笔记创建快照、列出历史版本、将笔记恢复到指定版本,并提供编辑前备份和批量定时备份的命令示例。需要预先设置 AICOO_API_KEY,响应通过 jq 解析。

xisen-w
xisen-w
热度 20.80
最近更新 2026-05-21 16:38:42
分类:知识依赖:代码执行 / 第三方 API应用场景:笔记整理 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add aicoo-snapshots
Metadata
name
snapshots
description
Use this skill when the user wants to save a version of a note, create a backup before editing, list previous versions, restore a note to an earlier state, or manage note history. Triggers on: 'save version', 'snapshot', 'backup note', 'restore', 'rollback', 'version history', 'undo changes', 'previous version'.
user-invokable
true
metadata
{"author":"systemind","version":"2.0.0"}

Snapshots — Note Versioning

Save, list, and restore note versions using Aicoo OS endpoints.

Prerequisites

  • AICOO_API_KEY must be set
  • Base URL: https://www.aicoo.io/api/v1

API Endpoints

  • GET /api/v1/os/snapshots/{noteId}
  • POST /api/v1/os/snapshots/{noteId}
  • POST /api/v1/os/snapshots/{noteId}/restore

Save a Snapshot

curl -s -X POST "https://www.aicoo.io/api/v1/os/snapshots/42" \
  -H "Authorization: Bearer $AICOO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Before Q2 update"}' | jq .

List Snapshots

curl -s "https://www.aicoo.io/api/v1/os/snapshots/42?limit=10" \
  -H "Authorization: Bearer $AICOO_API_KEY" | jq .

Restore a Snapshot

curl -s -X POST "https://www.aicoo.io/api/v1/os/snapshots/42/restore" \
  -H "Authorization: Bearer $AICOO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"versionId":7}' | jq .

Restore auto-backs up current state first.

Snapshot-Before-Edit Pattern

# 1) backup
curl -s -X POST "$PULSE_BASE/os/snapshots/42" \
  -H "Authorization: Bearer $AICOO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Pre-edit backup"}' | jq .

# 2) edit
curl -s -X PATCH "$PULSE_BASE/os/notes/42" \
  -H "Authorization: Bearer $AICOO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"# Updated content..."}' | jq .

Scheduled Backup Pattern

# list notes in a folder
NOTES=$(curl -s "$PULSE_BASE/os/notes?folderId=5&limit=200" \
  -H "Authorization: Bearer $AICOO_API_KEY" | jq -r '.notes[].id')

# backup each
for id in $NOTES; do
  curl -s -X POST "$PULSE_BASE/os/snapshots/$id" \
    -H "Authorization: Bearer $AICOO_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"label\":\"Pre-sync $(date +%Y-%m-%d)\"}" | jq .success
done

Guest Access Guidance

Guest write scope still depends on notesAccess on the share link:

  • read: can view/search notes
  • write: can create notes
  • edit: can edit notes and use snapshots