返回顶部
c

calendar-hold-sync日历同步锁定

Sync one or more source Google calendars into private Busy hold events in one or more target calendars using gog. Use when users need idempotent double-booking prevention, backfill of legacy holds, drift reconcile, or safe scheduled sync.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
784
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

calendar-hold-sync

日历占位同步

实现从源Google日历到目标日历的占位镜像,以防止重复预订。

依赖项

  • - 需要在PATH中安装gog命令行工具。
  • 需要为mappings中使用的每个账户预先配置用户OAuth。
  • 不要在代码中硬编码账户邮箱、日历ID或事件ID。

如果gog未配置,请使用以下设置流程:

  1. 1. 运行gog auth credentials /path/to/client_secret.json。
  2. 运行gog auth add you@gmail.com --services calendar。
  3. 使用gog auth list验证。

仅当您明确需要其他工作流程时,才添加额外的Google服务。

官方gog参考:

  • - 主页:https://gogcli.sh/
  • 源码:https://github.com/steipete/gogcli

配置契约

使用用户提供的JSON配置文件,结构如下:

  • - mappings[]
  • mappings[].name
  • mappings[].targetAccount
  • mappings[].targetCalendarId(默认primary)
  • mappings[].sources[],包含{ account, calendarId }
  • mappings[].lookaheadDays(默认30)
  • mappings[].allDayMode:ignore|mirror
  • mappings[].overlapPolicy:skip|allow
  • hold.summary(默认Busy)
  • hold.visibility(private)
  • hold.transparency(busy)
  • hold.notifications(none)
  • hold.reminders(none)
  • metadata.format(SYNCV1)
  • metadata.encoding(base64url(json))
  • metadata.fields:srcAccount,srcCalendar,eventId,start,end,title
  • scheduling.reconcileCron
  • scheduling.daytimeCron(可选)
  • scheduling.driftWindowDays(可选)
  • scheduling.watchIntervalSeconds(可选,默认20)
  • safety.dryRun
  • safety.maxChangesPerRun
  • safety.excludeIfSummaryMatches[]
  • safety.excludeIfDescriptionPrefix[]
  • gog.listEventsCmd|createEventCmd|updateEventCmd|deleteEventCmd(可选模板覆盖)
  • gog.allowCustomCommands(必须为true才能启用任何gog.*Cmd覆盖)

自定义命令模板安全

启用自定义命令时:

  • - 仅接受gog命令模板。
  • 模板通过替换{account}和{calendarId}等占位符进行渲染。
  • 渲染后的命令作为argv令牌执行(无shell插值)。
  • 除非您完全信任并审计配置文件,否则保持gog.allowCustomCommands=false。

元数据编码

在占位事件的description中存储源链接,格式为:

  • - SYNCV1:

JSON字段:

  • - srcAccount
  • srcCalendar
  • eventId
  • start
  • end
  • title

行为

对于每个映射:

  1. 1. 读取活动窗口中的源事件。
  2. 构建所需的占位事件(private、busy、无提醒)。
  3. 通过SYNCV1:前缀检测现有管理的占位事件。
  4. 幂等地进行协调:
- 创建缺失的占位事件。 - 更新偏移的占位事件。 - 删除过时的占位事件。
  1. 5. 如果重叠策略为skip,则在非管理的目标事件重叠时不创建占位事件。
  2. 强制执行maxChangesPerRun。
  3. 尊重dryRun。

回填

回填模式通过附加编码的元数据(当存在唯一源匹配时)升级遗留的占位事件(匹配预期的占位签名但缺少SYNCV1)。

命令接口

  • - hold-sync validate-config
  • hold-sync reconcile --mapping |--all [--dry-run]
  • hold-sync backfill --mapping |--all [--dry-run]
  • hold-sync status --mapping |--all
  • hold-sync install-cron --mapping |--all
  • hold-sync watch --mapping |--all [--dry-run] [--interval-seconds ]

监控节奏

要求监控节奏可从用户配置中调整:

  • - scheduling.watchIntervalSeconds控制监控轮询频率。
  • mappings[].lookaheadDays控制滚动监控/协调窗口。

建议基准值:

  • - watchIntervalSeconds: 900(15分钟)
  • lookaheadDays: 1(24小时)

工作模型

  • - 使用基于轮询的监控模式(hold-sync watch)实现快速更新。
  • 预期更新延迟大约等于watchIntervalSeconds。
  • 将其视为自托管/操作员运行的自动化。

已知限制

  • - 不要假设存在webhook/推送订阅;当前快速同步路径为轮询。
  • 即使启用了监控模式,也要保留定期计划的协调作为后备方案。

必需测试

  • - 元数据编码/解码往返测试
  • 重叠检测正确性测试
  • 幂等协调插入/删除行为测试

归属:gog设置流程改编自:

  • - https://clawhub.ai/steipete/gog
  • https://github.com/steipete/gogcli
  • https://gogcli.sh/

提供商说明(openclaw)

在发布到ClawHub/OpenClaw时使用此变体。

  • - 保持说明以实现为重点、以命令为导向。
  • 保持依赖项明确:gog必须由用户预先配置。
  • 优先选择确定性脚本执行而非推测性编辑。
  • 避免提供商特定的API;将CLI视为边界。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 calendar-hold-sync-1776419962 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 calendar-hold-sync-1776419962 技能

通过命令行安装

skillhub install calendar-hold-sync-1776419962

下载

⬇ 下载 calendar-hold-sync v1.0.1(免费)

文件大小: 18.14 KB | 发布时间: 2026-4-17 19:49

v1.0.1 最新 2026-4-17 19:49
- Updated dependency instructions to clarify only required Google services should be added in `gog` setup.
- Added new section "Custom Command Template Safety" describing how custom `gog` command templates are handled and their execution safety.
- Introduced a "Working Model" section to explain polling-based watch mode and expected update behavior.
- Added "Known Limits" section to highlight lack of webhook support and importance of scheduled reconcile as fallback.
- Minor clarifications and improved command guidance in dependency setup for clarity and safety.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部